In this paper, we propose a novel FFG model, which is able to calculate the spatial correspondence of the content and reference based on their component features. Our proposed Style Aggregation Module aggregates fine-grained local styles of references to content's corresponding location with high-fidelity. Besides, we propose a Self-Reconstruction branch to help model to recover details from references. Last but not least, our Reference Selection strategy guarantee that each content can match references that share common conspicuous components. Our extensive experiments show that FSFont significantly outperforms other methods in both objective and subjective similarity. Limitation The model is trained on limited data, it can not faithfully replicate every detail of the font. Negative Impact Though FSFont can be potentially used to imitate handwriting, a human expert can still spot the difference between generated and real handwritings.


Appendices

Implementation Details
Reference Selection
In this section, we will discuss the implementation details of reference selection, which can be divided into two steps: reference set determination and content-reference mapping.
Reference set determination As mentioned in paper's section 3.4, our target is to search for a reference glyph set which covers the most conspicuous-level components, and our detailed algorithm can be demonstrated by Algorithm REF . In our algorithm, \(X\)  denotes the entire character list sorted by glyphs' occurrence frequency, whose total capacity is 20K. \(T\)  denotes the single level decomposition look-up tables for all characters in \(X\) . For one key \(x_i\)  in \(T\) , their corresponding value \(\chi _i\)  is a subset of \(X\) , consisting of their decomposing components' name list and corresponding decomposing form. By
exploring this components list, we employ breadth first search to recursively obtain all the components at different levels, which forming the component tree in our work. \(C\)  denotes the set that contains all conspicuous-level components, whose total capacity is 374. \(N_{ref}\)  denotes the total capacity of our target reference set, which is is fixed to 100 in our experiments.
As an initialization, we set our target reference set \(\hat{U}\)  and corresponding covering components \(\hat{C}\)  as \(\emptyset \) . Then we begin searching process in \(X\) . For every glyph \(x_i\)  in \(X\) , we obtain its conspicuous-level components \(c_i\)  via the function searchComponents in REF . If there is unique components in \(c_i\)  which is not in current component pool \(\hat{C}\) , we regard this glyph \(x_i\)  as our target reference glyph, and we add it and its unique components to \(\hat{U}\)  and \(\hat{C}\)  respectively. In our experiment, we ensure that every latest adding reference have 2 or more unique components. Once the capacity of \(\hat{U}\)  reaches \(N_{ref}\) , we terminate the searching process.
Inputinput
Outputoutput
Dodowhile

\(\hat{U}\) : Reference set.
\(\hat{C}\) : All components which \(U\)  can cover.

FMainsearchComponents
FnFunction:
\(x_i\) 
\(queue \leftarrow \lbrace x_i\rbrace \) ; \(i \leftarrow 0\) ; \({c_i} \leftarrow \emptyset \)
\(i \ge d\) 
\(queue^{*} \leftarrow \emptyset \)
\(x\in queue\) 
\(queue^{*} \leftarrow queue^{*} \cup T(x) \)
\({c_i} \leftarrow T(x) \cap C \) 

\(queue \leftarrow queue^{*}\) ; \(i \leftarrow i+1\) 

return \({c_i}\)

End Function
FMainMain
FnFunction:

\(\hat{U} \leftarrow \emptyset \) ; \(\hat{C} \leftarrow \emptyset \)
\(x_i\in X\) 
\(c_i \leftarrow \)  searchComponents(\(x_i\) )
\(\exists \hat{c} \in {c}_{i}\)  s.t. \(\hat{c} \notin \hat{C}\) 
\(\hat{C} \leftarrow \hat{C} \cup {c}_{i}\) , add \(x_i\)  to \(\hat{U}\) 

Len(\(\hat{U}\) ) \(\ge \)  \({N}_{ref}\)break

return \(\hat{U}\) , \(\hat{C} \)

End Function
Reference set selection
Content-reference mapping Since we have determined the reference set. It's more convenient for us to find the mapping relationship between a arbitrary glyph and its references whose conspicuous components are in common. For \(k\) -shot reference mapping (one content glyph corresponds to \(k\)  style references), we do the following searching process for \(k\)  times: We find the glyph in reference set which share the most conspicuous component, and remove it from the original reference set. If there is multiple choice, we leave the one whose component's composition form is the same with the content glyph.
We show some of the finding mappings between content and references in Fig. REF .

Model Architecture
Our entire model can be divided into two parts: the generator and discriminator. Both of them are built up of two typical types of blocks: the Convolution block and the Residual block, which are illustrated in Fig REF . The Residual block contains two identical Convolution blocks. Since the Residual block has its own downsampling operator, its Convolution blocks skip the downsampling step.
Generator As mentioned in our method, the generator model consists of three respective modules: reference encoder \(E_r\) , content encoder \(E_c\) , and decoder \(D\) . Both \(E_r\)  and \(E_c\)  are also made up of the following two types of blocks: the Convolution block and Residual block. The detailed architecture is illustrated in Table. REF . In \(D\) , every Convolution block is followed by a spectral normalization.
Discriminator The discriminator is also made up of the Convolution block and the Residual block. The detailed architecture is illustrated in Table. REF .
<TABLE><FIGURE>
Training details
We use Adam optimizer to optimize the FSFont's parameters. The generator and discriminator's learning rates are 0.0002 and 0.0008, respectively. Kaiming initialization is applied for the model. During training, by default we set the reference to be 3-shot for training. If one glyph's reference set's capacity is less than 3, we duplicate one of reference glyph until the capacity equals to 3 for purpose of batch training. In our proposed SAM, empirically we set number of attention heads to be 8 and batch size to be 32. We train our model with full objective function for 500k iterations.

Additional Experimental Results
In Fig.REF , we demonstrate more experimental results on unseen fonts. The results show that FSFont can deal with variant font styles, including typewriter fonts, artistic fonts, and handwriting fonts. In addition, we show the content font we used in our experiment in Fig.REF .
<FIGURE><FIGURE>We also demonstrate more visualization results about the attention maps in Fig. REF . We show the attention maps on characters with variant structures. It is shown that the attention is able to capture the correct correspondence in different structures.
<FIGURE>
User Study Examples
We show the sample images used for the user study in Fig.REF  and Fig.REF . A content image, a reference set, and shuffled results from five methods, i.e. FUNIT[1]}, AGISNet[2]}, LF-Font[3]}, DFFont[4]}, MX-Font[5]}, and FSFont, are displayed to users for every query. Users are required to choose the most consistent one according the style of the reference set. As the orders of the methods are shuffled, we also provide the answers for each case.
<FIGURE><FIGURE>