Create font texture manually?


19-05-2011 15:28:54

Hi, just a quick question about generating font texture on the fly.
Is there anyway to generate the font texture manually while the program is running?
Chinese code points is huge set and take a long time to load. I wonder if there's anyway to load the font texture only when it's used?



19-05-2011 15:54:40

Font texture generated whenever you load xml with font definition. So use separate files for different font definitions and load them whenever you need.


19-05-2011 23:42:48

Hum.. maybe I didn't state it clear enough. Say I have a font with the following xml file

<Resource type="ResourceTrueTypeFont" name="font_Simhei">
<Property key="Source" value="simhei.ttf"/>
<Property key="Size" value="19"/>
<Property key="Resolution" value="50"/>
<Property key="Antialias" value="false"/>
<Property key="SpaceWidth" value="4"/>
<Property key="TabWidth" value="8"/>
<Property key="CursorWidth" value="2"/>
<Property key="Distance" value="6"/>
<Property key="OffsetHeight" value="0"/>
<Code range="33 126"/>
<Code range="19969 40869"/>
<Code hide="128"/>
<Code hide="1026 1039"/>
<Code hide="1104"/>

There is a huge code range from 19969 to 40869 and loading this will take lots of time. Since I'm working on a chat window, Is it possible to display random code alone without loading the xml file?



23-05-2011 02:21:03

I guess this is not doable.. is there any different way to solve this problem then?