GlyphPrinter: Region-Grouped Direct Preference Optimization for Glyph-Accurate Visual Text Rendering
Authors: Xincheng Shuai, Ziye Li, Henghui Ding, Dacheng Tao
Organizations: Institute of Big Data, College of Computer Science and Artificial Intelligence, Fudan University, China · Generative AI Lab, College of Computing and Data Science, Nanyang Technological University, Singapore
Generating accurate glyphs for visual text rendering is essential yet challenging. Existing methods typically enhance text rendering by training on a large amount of high-quality scene text images, but the limited coverage of glyph variations and excessive stylization often compromise glyph accuracy, especially for complex or out-of-domain characters. Some methods leverage reinforcement learning to alleviate this issue, yet their reward models usually depend on text recognition systems that are insensitive to fine-grained glyph errors, so images with incorrect glyphs may still receive high rewards. Inspired by Direct Preference Optimization (DPO), we propose GlyphPrinter, a preference-based text rendering method that eliminates reliance on explicit reward models. However, the standard DPO objective only models overall preference between two samples, which is insufficient for visual text rendering where glyph errors typically occur in localized regions. To address this issue, we construct the GlyphCorrector dataset with region-level glyph preference annotations and propose Region-Grouped DPO (R-GDPO), a region-based objective that optimizes inter- and intra-sample preferences over annotated regions, substantially enhancing glyph accuracy. Furthermore, we introduce Regional Reward Guidance, an inference strategy that samples from an optimal distribution with controllable glyph accuracy. Extensive experiments demonstrate that the proposed GlyphPrinter outperforms existing methods in glyph accuracy while maintaining a favorable balance between stylization and precision.
Figures & tables
Figure 2: Text recognition models [ 11 , 50 ] used in existing RL-based methods are insensitive to incorrect glyphs (highlighted with green boxes), leading to inflated rewards for such samples.
Figure 3: (a) Construction of the attention mask used in GlyphPrinter . In addition to the prompt-image and intra-modality attentions, we only enable the communication between the image features from the text region and the corresponding glyph feature for each text block. (b) Construction of the preference masks used in R-GDPO . Our GlyphCorrector contains region-level preference annotations for samples from each generated group, where the incorrect text regions are highlighted with green boxes. To make more efficient use of data, we simultaneously use inter-sample ( Mi,j+,− ) and intra-sample preference masks ( Mi+,Mi− ) to construct winning-losing pairs.
Figure 4: Text rendering results under simple and complex glyph conditions. Our GlyphPrinter outperforms other methods in preserving fine details of glyphs, particularly for some complex cases in the 2nd and 3rd rows. Best viewed zoomed in to see the fine glyph details.
Figure 5: Text rendering results under multilingual and out-of-domain glyph conditions. Our method GlyphPrinter consistently preserves glyph fidelity, indicating strong generalization ability. Please zoom in for better visibility of fine text details.
Method
GlyphPrinter (Ours)
AnyText2 [ 46 ]
EasyText [ 33 ]
Glyph-Byt5-v2 [ 32 ]
X-Omni [ 17 ]
Qwen-Image [ 53 ]
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
English
0.9851
0.9320
0.8162
0.5291
0.9780
0.9174
0.9844
0.9223
0.7963
0.5146
0.9193
0.8689
Chinese
0.9728
0.9339
0.9004
0.7899
0.9569
0.9144
0.9295
0.8093
0.7318
0.4397
0.9149
0.9183
Japanese
0.9616
0.9167
0.8543
0.6111
0.9389
0.8888
0.9038
0.8056
0.5148
0.2222
0.7324
0.5278
Korean
0.9693
0.9362
0.7222
0.4894
0.8544
0.7660
0.9648
0.8511
0.0670
0.0213
0.5167
0.2128
French
0.9714
0.8427
0.7321
0.3270
0.9671
0.8553
0.9740
0.8742
0.6939
0.2390
0.7470
0.5220
Table 1: Evaluation of text rendering accuracy. The rows from “English” to “Thai’ indicate the results of GlyphAcc-Multilingual, while the “Complex” row shows the result of GlyphAcc-Complex. Bold indicates the best result, and underline denotes the second best.
Method
Aes
Text.Align
Glyph.Acc
GlyphPrinter ( Ours )
7.9143
8.1692
8.3084
GlyphPrinter-Stage 1
7.9507
8.0899
7.5332
Anytext2 [ 46 ]
5.5310
6.3298
5.3769
EasyText [ 33 ]
7.0964
7.6767
7.4411
Glyph-Byt5-v2 [ 32 ]
3.4454
3.7173
6.3919
X-Omni [ 17 ]
6.6660
7.1328
5.8972
Table 2: The user study assesses image aesthetic ( Aes ), text-image alignment ( Text.Align ), and glyph accuracy ( Glyph.Acc ). All scores are within the range of 1 to 10.
Method
GlyphPrinter (Ours)
AnyText2 [ 46 ]
EasyText [ 33 ]
Glyph-Byt5-v2 [ 32 ]
X-Omni [ 17 ]
Qwen-Image [ 53 ]
Text.Align
Aes
Text.Align
Aes
Text.Align
Aes
Text.Align
Aes
Text.Align
Aes
Text.Align
Aes
Multilingual
84.2992
87.3315
69.1752
82.5957
83.2642
86.5148
72.7898
82.5067
79.0825
89.6392
88.1968
87.8167
Complex
91.8969
89.5330
84.4742
86.2886
88.2371
89.2268
81.7010
84.1237
81.8652
87.4663
92.0825
89.4845
Table 3: Evaluation of text-image alignment and image aesthetic. Both scores are within the range of 1 to 100.
Method
GlyphPrinter (Ours)
Stage 1
SFT
Mask SFT
w/o RRG
λinter=1
λinter=0
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
Multilingual
0.9715
0.8932
0.9360
0.8023
0.9357
0.8238
0.9483
0.8275
0.9522
0.8772
0.9605
0.8725
0.9549
0.8458
Complex
0.9013
0.8349
0.8142
0.6981
0.8418
0.7406
0.8437
0.7547
0.8810
0.8019
0.8908
0.8066
0.8781
0.7925
Table 4: Ablation study. Bold indicates the best result, and underline denotes the second best.
Figure 6: Ablation studies. The erroneous regions of each image are highlighted with green boxes.
Figure I : Samples from the (a) synthetic dataset and (b) realistic dataset used in Stage 1.
Figure II : Samples from the proposed GlyphCorrector. The erroneous regions are highlighted with green boxes.
Figure III : Samples from the constructed benchmarks (a) GlyphAcc-Multilingual and (b) GlyphAcc-Complex.
Figure IV : Comparison results on GlyphAcc-Multilingual.
Figure V : Comparison results on GlyphAcc-Complex.
Figure VI : Comparison results under out-of-domain conditions.
Figure VII : More results of ablation studies. The erroneous regions of each image are highlighted with green boxes.
Language
GlyphPrinter (Ours)
AnyText2 [ 46 ]
EasyText [ 33 ]
Glyph-Byt5-v2 [ 32 ]
X-Omni [ 17 ]
Qwen-Image [ 53 ]
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
NED
Sen.Acc
English
0.9704
0.8853
0.6314
0.5301
0.9571
0.8741
0.8060
0.7650
0.8930
0.6353
0.9432
0.8327
Chinese
0.9771
0.8932
0.7642
0.5089
0.9589
0.8808
0.9287
0.8274
0.7705
0.4199
0.9424
0.8630
Table I : The quantitative results on the OneIG [ 3 ] benchmark.