Table of Contents
Fetching ...

GlyphPrinter: Region-Grouped Direct Preference Optimization for Glyph-Accurate Visual Text Rendering

Xincheng Shuai, Ziye Li, Henghui Ding, Dacheng Tao

Abstract

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.

GlyphPrinter: Region-Grouped Direct Preference Optimization for Glyph-Accurate Visual Text Rendering

Abstract

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.
Paper Structure (29 sections, 31 equations, 13 figures, 5 tables, 1 algorithm)

This paper contains 29 sections, 31 equations, 13 figures, 5 tables, 1 algorithm.

Figures (13)

  • Figure 1: Comparison of different methods on text rendering. The figures show that the proposed GlyphPrinter achieves higher glyph accuracy than advanced methods wu2025qwenlu2025easytext in (a) complex, (b) multilingual, and (c) out-of-domain text rendering.
  • Figure 2: Text recognition models du2020ppwang2024qwen2 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 ($M_{i,j}^{+,-}$) and intra-sample preference masks ($M_{i}^{+},M_{i}^{-}$) 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.
  • ...and 8 more figures