Browse Source

Added section describing the font cache

Björn Ritzl 6 years ago
parent
commit
9f5762df17
1 changed files with 6 additions and 0 deletions
  1. 6 0
      docs/en/manuals/font.md

+ 6 - 0
docs/en/manuals/font.md

@@ -134,4 +134,10 @@ Distance field fonts need to be rendered to a target size that is big enough to
 
 ![Distance field artifacts](images/font/df_artifacts.png){srcset="images/font/[email protected] 2x"}
 
+## Font Cache
+A font resource in Defold will result in two things at runtime, a texture and the font data.
 
+* The font data consist of a list of glyph entries, each containing some basic kerning info and the bitmap data for that glyph.
+* The texture is internally called the "glyph cache texture" and it will be used when rendering text for a specific font.
+
+At runtime, when rendering text, the engine will first loop through the glyphs to be rendered to check which glyphs are available in the texture cache. Each glyph that is missing from the glyph texture cache will trigger a texture upload from the bitmap data stored in the font data.