Skip to content

Text and text tags ​

This page is part of the GenPy Ren'Py learning path. It focuses on practical Ren'Py 8.x production and links each concept back to the GenPy workflow.

Learning goals ​

  • Use text tags for local emphasis without overusing them.
  • Interpolate variables safely in dialogue.
  • Choose fonts and language handling with export in mind.

Core syntax ​

  • text tags
  • interpolation
  • {w}
  • {p}
  • {color}
  • {font}

Runnable example ​

text
# gui.rpy 里设置中文字体
define gui.text_font = "fonts/SourceHanSansSC-Regular.otf"
define gui.name_text_font = "fonts/SourceHanSansSC-Bold.otf"
define gui.interface_text_font = "fonts/SourceHanSansSC-Regular.otf"

Study outline ​

  • Start with the smallest example for text and text tags.
  • Test the key terms in a clean Ren'Py project: text tags, interpolation, {w}, {p}.
  • Move the pattern back into your real project only after the example runs.
  • Use GenPy docs and validation to keep the feature connected to story, assets, and export readiness.

Common pitfalls ​

  • Test the smallest working script before layering on visual or UI complexity.
  • Run Ren'Py Lint before release builds, even when the script appears to run locally.
  • Keep examples in standard .rpy files so they remain editable outside GenPy.

Official references ​

How this fits in GenPy ​

  • Use Code mode for precise text tags and Validation before export.
  • Use Translation docs when text length and fonts matter across languages.

Recommended GenPy docs:

Built for GenPy creators.