SPMA082 August   2021

1.   Trademarks
2. 1TFT LCD Overview
3. 2LCD Controller Overview
1. 2.1 Block Diagram
4. 3TivaWare Graphics Library (grlib)
1. 3.1 Graphics Library Structure
5. 4Display Driver Adaptation
1. 4.1 Off-Screen Display Drivers
2. 4.2 Individual Display Driver Functions
6. 5Fonts
7. 6Useful Utilities
8. 7References
9.   A Appendix A

# 5 Fonts

Understanding the graphics library text handling functions will be easier if the following terminology is known:

• ASCII

American Standard Code for information Interchange. ASCII is a 7-bit code-page with codepoints in the range 0x00-0x7F. It contains the basic upper and lower-case Latin alphabet, numeric digits, common punctuation marks and terminal control codes. It is in common use in English-speaking countries but offers no way to encode accented characters or non-Latin alphabets.

• codepage

A character encoding scheme mapping between codepoints and glyphs within a font. The codepage determines which character a given codepoint (character number) represents. For example, when using the ASCII codepage, codepoint 0x20 represents the space character.

• codepoint

A single entry in a codepage. A number identifying a character in a font. Knowing the codepage in use, the codepoint (or character code) defines a single character.

• glyph

A graphical representation of a single character in a font.

• font

A collection of character glyphs in a particular typeface and size each represented by a codepoint.

• UTF-8

Unicode Transformation Format(8). A variable length encoding system for Unicode text where any given character can be represented by 1 to 6 bytes depending upon the character. UTF-8 has the advantage that it is backwards compatible with ASCII and is commonly used in text file processing.

The are a large range of fonts supplied with the grlib that can be used for rendering text on the screen. Additional fonts can be created by using the ftrasterize utility to compress font files into the format required by the grlib. For a full list of available fonts, see the Font Reference section in the TivaWare™ Graphics Library User's Guide.

Below is an example of specifying an 18-pt computer modern sans-serif font when drawing the “hello world” string using the grlib primitive functions.

GrContextFontSet(psContext, g_psFontCmss18b);
GrStringDrawCentered(psContext, "hello world", -1, 160, 8, false);

Step 5 in Figure 3-3 shows another example specifying a 40-pt computer modern serif font for a widget declaration.