Castle Game Engine: CastleOutlineFonts

# Unit CastleOutlineFonts
Description | Uses | Classes, Interfaces, Objects and Records | Functions and Procedures | Types | Constants | Variables
## Description Outline fonts types. Outline fonts are composed from lines and curves. They may be represented using types in this unit. We also have CastleFont2Pascal unit that can even convert such fonts to Pascal units, to embed fonts inside Pascal code. Basic concepts: Font (TOutlineFont) is an array of characters. Character (TOutlineChar) contains a basic character information (size and such) and a sequence of polygons to render this character. A polygon is a closed sequence of lines. It's defined inside TOutlineCharItem array, with `Kind = pkNewPolygon` indicating start of a new polygon. A line is a sequence of points. These points should be rendered as either a sequence of straight line segments, or a Bezier (cubic) curve. Line is defined inside TOutlineCharItem array, with `Kind = pkLines or pkBezier` indicating start of a new line. Note: unless you're going to see the font from a really close distance, a simple renderer may be OK with treating Bezier curves just like a sequence of straight line segments. Since characters may have holes inside, some polygons have to define the outline of the hole. Consider for example an "o" letter, that needs two polygons: one for the outer circle, one for the inner circle. For a given point on a 2D plane, it is part of the letter (e.g. should be drawn with font color) when it's inside an odd number of polygons. If it's inside an even number of polygons (0, or maybe 2, etc.) then it's not part of the letter (should be drawn with background color). The above definition makes it also natural to draw a font outline using OpenGL GLU tesselator. Simply use GLU_TESS_WINDING_ODD and pass all the polygons. ## Overview ### Classes, Interfaces, Objects and Records
Name | Description
--- | ---
packed record `TOutlineCharItem` |
record `TOutlineCharInfo` |
packed record `TOutlineChar` | Character information.
Class `TOutlineFont` |
### Types
`TPolygonKind = (...);`
`POutlineCharItem = ˆTOutlineCharItem;`
`POutlineChar = ˆTOutlineChar;`
`TOutlineFontArray = array [char] of POutlineChar;`
## Description ### Types
`TPolygonKind = (...);`
###### Values pkNewPolygon: pkLines: pkBezier: pkPoint:
`POutlineCharItem = ˆTOutlineCharItem;`
`POutlineChar = ˆTOutlineChar;`
`TOutlineFontArray = array [char] of POutlineChar;`
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:13