GlyphGAN: Style-consistent font generation based on generative adversarial networks☆
Introduction
There is a variety of fonts in the world. As shown in Fig. 1, fonts are characterized by various components such as the thickness of lines, decoration, and serifs. There are also handwritten-like fonts, fonts made of outlines, fonts with lowercase letters capitalized, and so on. Among these fonts, the best ones will be chosen according to the medium such as books, newspapers, signboards, and web pages. Even for the same medium, different fonts can be used depending on the title, text, and speakers. In response to these demands, a large number of fonts have been created.
This study aims at the automatic design of fonts; a computer automatically generates various fonts instead of a human designing fonts individually. There are two reasons why we aim at automatic design even though a large number of fonts already exists.
The first aim is to reduce the labor for creating a new font. Even today, new fonts are still being created. When a font is created, a large number of characters with the same style should be designed. In the case of alphabetic fonts, not only 52 upper/lowercase letters but symbols also are designed. For Japanese fonts, the labor increases because the Japanese language has a large number of letters including hiragana, katakana, and kanji. Therefore, automatic font design can potentially reduce this labor by a large extent.
The second aim is to understand designers’ tacit knowledge via a constructive approach. Basically, fonts are created by designers individually. This know-how is fundamentally cultivated by the designer’s experience and is not easily systematized. Reproduction of the process where a designer becomes able to create new fonts will lead to new knowledge of character design.
To realize the above aims, the following approaches can be considered.
- 1.
Designing all characters from a few samples: After manually designing a few examples as templates, the system automatically designs the remaining characters using these templates. This approach is effective, particularly for character sets with many of the same parts such as Chinese characters.
- 2.
Transformation and interpolation: A new font is made of existing fonts via operations such as changing the thickness of lines, adding decorations, and calculating an interpolation of two fonts. This approach has difficulty in designing a completely novel font because the generated font depends on the original font.
- 3.
Generating fonts automatically using machine learning: Utilizing a large number of fonts, a computer is trained to learn the design principle. If the computer can learn the designer’s know-how, which is difficult to describe explicitly, then automatic font design with a high degree of freedom is realized.
Studies related to the above approaches are described in the next section.
This study focuses on approach #3, i.e., machine learning-based font generation. This approach mainly includes two methods: transformation-based and generative model-based methods. In the former, a font is generated by adding style information to the existing font [1], [2], [3]. The latter estimates the manifold that the existing fonts compose in the image space, and then generates new font images by sampling data from the estimated manifold [4], [5]. This second method has the potential to generate more diverse fonts although there are challenges in the manifold estimation and generation stability.
Related to the generative model-based method, generative adversarial networks (GANs) [6] have attracted much attention in terms of image generation. GANs are a framework for learning a generative model using a system of two neural networks competing with each other. One network generates synthetic images from a random input, and the other discriminates between synthetic and real images, thereby allowing the generation of highly realistic images. However, it is basically difficult to control the characteristics of the generated images using GANs because GANs generate images from random input. Considering the application to font generation, the generated font should have the same style for all characters.
In this paper, we propose a font generation method based on GANs, which is named GlyphGAN. In GlyphGAN, the input vector for the generator network consists of two vectors: character class vector and style vector. The former is a one-hot vector and is associated with the character class of each sample during training. The latter is a uniform random vector without supervised information. In this way, GlyphGAN can generate an infinite variety of fonts with the character and style independently controlled.
The main features of the proposed GlyphGAN are as follows:
- •
Style consistency: GlyphGAN can generate a font that has the same style over all characters.
- •
Legibility: The generated fonts are legible compared with the other methods.
- •
Diversity: The generated fonts have diversity different from the training images.
Section snippets
Example-based font generation
Various attempts have been made in previous studies on automatic font design. One of the classical methods is example-based font generation [7], [8], [9], [10]. For example, “A” is generated from human-designed “B”, “C”, , “Z”. Tenenbaum and Freeman [7] used several font sets containing all alphabets to separate them into standard shapes of individual alphabets and font styles. Then, the style of example patterns was extracted by using the standard shape and applied to the other alphabets.
Overview
GANs are a framework for estimating a generative model composed of two neural networks called the generator and the discriminator . The generator takes a vector of random numbers as an input, and produces data with the same dimensions as the training data. Meanwhile, the discriminator discriminates between samples from real data and data generated by the generator. The original version proposed by Goodfellow et al. [6] is called the vanilla GAN.
In the training, and play the minimax
GlyphGAN: Style-consistent font generation
Fig. 2 shows an overview of GlyphGAN. The major differences from the ordinary GANs are as follows.
- •
The input vector of the generator consists of a style vector and a character class vector .
- •
During training, the character class vector is associated with the character class of the training pattern.
Font generation experiment
To evaluate the capability of the proposed method, we conducted a font generation experiment. We evaluated the generated fonts from the following viewpoints:
- •
Legibility: We verify that the generated font has legibility via a character recognition experiment using a pretrained CNN.
- •
Diversity: We validate whether the generated font set has diversity different from the training data.
- •
Style consistency: We qualitatively verify that the generated font has style consistency via visual observation, and
Discussion
Difference from existing GANs: As stated in Section 3, various GAN derivations have been proposed. The most similar types are GANs that can control the output such as the conditional GAN [27]. The main structural differences from such GANs are that the character class information is provided only to the generator’s input, and that the sampling from the real data distribution is associated with the character class. The procedure intrinsically makes GlyphGAN learn the conditional distribution of
Conclusion
In this paper, we proposed GlyphGAN a style-consistent font generation based on generative adversarial networks (GANs). In GlyphGAN, the input vector for the generator network consists of a character class vector and style vector, thereby allowing font generation with style consistency. In the font generation experiment, we showed that the learning method employed in the proposed method improved the legibility of the generated fonts. The experimental results also showed that the generated font
Acknowledgment
This work was partially supported by JSPS KAKENHI Grant Number JP17H06100.
References (34)
- et al.
Text effects transfer via distribution-aware texture synthesis
Comput. Vis. Image Underst.
(2018) - et al.
Computationally evaluating and synthesizing Chinese calligraphy
Neurocomputing
(2014) - et al.
Effective data generation for imbalanced learning using conditional generative adversarial networks
Expert Syst. Appl.
(2018) - et al.
TarGAN: Generating target data with class labels for unsupervised domain adaptation
Knowl.-Based Syst.
(2019) - G. Atarsaikhan, B.K. Iwana, A. Narusawa, K. Yanai, S. Uchida, Neural font style transfer, in: Proceedings of the 14th...
zi2zi: Master Chinese calligraphy with conditional adversarial networks
(2017)- P. Lyu, X. Bai, C. Yao, Z. Zhu, T. Huang, W. Liu, Auto-encoder guided GAN for Chinese clligraphy synthesis, in:...
Analyzing 50k fonts using deep neural networks
(2016)deep-fonts
(2016)- I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, Y. Bengio, Generative...
Separating style and content with bilinear models
Neural Comput.
Human-level concept learning through probabilistic program induction
Science
Automatic generation of typographic font from a small font subset
IEEE Comput. Graph. Appl.
Flexyfont: Learning transferring rules for flexible typeface synthesis
Comput. Graph. Forum
Learning a manifold of fonts
ACM Trans. Graph.
Cited by (0)
- ☆
No author associated with this paper has disclosed any potential or pertinent conflicts which may be perceived to have impending conflict with this work. For full disclosure statements refer to https://doi.org/10.1016/j.knosys.2019.104927.