SPMA082 August 2021 TM4C1230C3PM , TM4C1230D5PM , TM4C1230E6PM , TM4C1230H6PM , TM4C1231C3PM , TM4C1231D5PM , TM4C1231D5PZ , TM4C1231E6PM , TM4C1231E6PZ , TM4C1231H6PGE , TM4C1231H6PM , TM4C1231H6PZ , TM4C1232C3PM , TM4C1232D5PM , TM4C1232E6PM , TM4C1232H6PM , TM4C1233C3PM , TM4C1233D5PM , TM4C1233D5PZ , TM4C1233E6PM , TM4C1233E6PZ , TM4C1233H6PGE , TM4C1233H6PM , TM4C1233H6PZ , TM4C1236D5PM , TM4C1236E6PM , TM4C1236H6PM , TM4C1237D5PM , TM4C1237D5PZ , TM4C1237E6PM , TM4C1237E6PZ , TM4C1237H6PGE , TM4C1237H6PM , TM4C1237H6PZ , TM4C123AE6PM , TM4C123AH6PM , TM4C123BE6PM , TM4C123BE6PZ , TM4C123BH6PGE , TM4C123BH6PM , TM4C123BH6PZ , TM4C123BH6ZRB , TM4C123FE6PM , TM4C123FH6PM , TM4C123GE6PM , TM4C123GE6PZ , TM4C123GH6PGE , TM4C123GH6PM , TM4C123GH6PZ , TM4C123GH6ZRB , TM4C1290NCPDT , TM4C1290NCZAD , TM4C1292NCPDT , TM4C1292NCZAD , TM4C1294KCPDT , TM4C1294NCPDT , TM4C1294NCZAD , TM4C1297NCZAD , TM4C1299KCZAD , TM4C1299NCZAD , TM4C129CNCPDT , TM4C129CNCZAD , TM4C129DNCPDT , TM4C129DNCZAD , TM4C129EKCPDT , TM4C129ENCPDT , TM4C129ENCZAD , TM4C129LNCZAD , TM4C129XKCZAD , TM4C129XNCZAD
The strings for the application example described in Section 5.1 is saved in the language.csv file (encoded in UTF8 format) to allow accented characters and Asian language ideographs to be included. The mkstringtable tool is used to generate two versions of the string table, one which remains encoded in UTF8 format and the other one that is remapped to a custom codepage allowing the table to be reduce in size compared to the original UTF8 text. The tool also produces character map files listing each character used in the string table. These are then provided as input to the ftrasterize tool which generates two custom fonts for the application, one indexed using Unicode and a smaller one indexed using the custom codepage generated for this string table. The command line parameters required for mkstringtable and ftrasterize can be found in the Makefile in C:\ti\TivaWare_C_Series-2.2.0.295\third_party\fonts\lang_demo.
The ftrasterize utility uses the FreeType font rendering package to convert a font into the format that is recognized by the graphics library. Any font that is recognized by FreeType can be used, which includes TrueType®, OpenType®, PostScript® Type 1, and Windows® FNT fonts. A complete list of supported font formats can be found on the FreeType web site at http://www.freetype.org.
There is an already a language.csv file in the existing \third_party\fonts\lang_demo directory which is created for the lang_demo example described in Table 3-1. The file can be modified for the string table to be used in the example shown in Section 5.1.
#
# Build our string table from the CSV file.
#
language.c: language.csv
../../../tools/bin/mkstringtable -u -f language.csv -b language -s utf8 -t
#
# Build our remapped string table from the CSV file.
#
langremap.c: language.csv
../../../tools/bin/mkstringtable -u -c 0x8000 -f language.csv -b langremap -s utf8 -r
#
# Build the custom font used by the application based on the output of the
# mkstringtable step. We build 2 fonts, one for use with the remapped
# string table and the other indexed using normal Unicode codepoints.
#
fontcustom14pt.c: language.c AndBasR.ttf fireflysung.ttf NanumMyeongjo-Regular.ttf sazanami-gothic.ttf
../../../tools/bin/ftrasterize -u -c language.txt -r -f custom -s 14 AndBasR.ttf fireflysung.ttf NanumMyeongjo-Regular.ttf sazanami-gothic.ttf
fontcustomr14pt.c: langremap.c AndBasR.ttf fireflysung.ttf NanumMyeongjo-Regular.ttf sazanami-gothic.ttf
../../../tools/bin/ftrasterize -u -c langremap.txt -r -z 0x8000 -f customr -s 14 AndBasR.ttf fireflysung.ttf NanumMyeongjo-Regular.ttf sazanami-gothic.ttf
fontcustom20pt.c: language.c AndBasR.ttf fireflysung.ttf NanumMyeongjo-Regular.ttf sazanami-gothic.ttf
../../../tools/bin/ftrasterize -u -c language.txt -r -f custom -s 20 AndBasR.ttf fireflysung.ttf NanumMyeongjo-Regular.ttf sazanami-gothic.ttf
fontcustomr20pt.c: langremap.c AndBasR.ttf fireflysung.ttf NanumMyeongjo-Regular.ttf sazanami-gothic.ttf
../../../tools/bin/ftrasterize -u -c langremap.txt -r -z 0x8000 -f customr -s 20 AndBasR.ttf fireflysung.ttf NanumMyeongjo-Regular.ttf sazanami-gothic.ttf