Text
In your Kanzi applications you can display text in languages that write right-to-left, use line breaks according to the Unicode line breaking algorithm, or use ligatures. For example, in your Kanzi applications you can use Chinese, Japanese, Korean, Hindi, and right-to-left languages, such as Arabic and Hebrew.
Kanzi uses vector and bitmap fonts to display text:
- Vector fonts are rendered without the size restrictions and produce high quality output. Kanzi uses TrueType (.ttf) font format. The drawback of vector fonts is that rendering vector fonts requires more resources than bitmap fonts do. See Preventing pixelization of vector fonts.
- Bitmap fonts are created for text of a fixed-pixel size. This means that scaling the font to other sizes can result in poor quality output. Kanzi supports bitmap font format used by the Bitmap Font Generator created by AngelCode (.fnt). You can use AngelCode’s utility to convert TrueType fonts into bitmap fonts. One bitmap font consists of the .fnt file and one or more image files. In order for the bitmap font to work, the image files that the .fnt file refers to must be present in the Fonts directory of your project.
The advantage of bitmap fonts is that rendering bitmap fonts requires less resources than vector fonts do.
Kanzi Studio comes with sample fonts in both vector and bitmap formats. You can find the fonts in the <KanziInstallation>/Studio/Asset Library/Fonts. See Importing fonts.
Note that in order to properly render text you have to use a font that supports the languages you want to include in your Kanzi application.
Kanzi Studio provides the following ways for displaying text in your applications:
- Text block displays text in 3D space. It uses fonts to render text and has a location and orientation in 3D space just as all the other objects do. See Using text blocks.
- Text layer is used for displaying the text as a 2D overlay. For example, use a text layer to show text in a head-up display. See Using text layers.
See also
Using text blocks
Using text layers
Importing fonts
Internationalization
Preventing pixelization of vector fonts
Open topic with navigation