Difference between revisions of "Unit Font"
(14 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
=== Description === | === Description === | ||
---- | ---- | ||
+ | |||
+ | '''Ultibo Font Interface unit''' | ||
The fonts supported by Ultibo are a bitmap format that contains a block of data where each character is represented by a number of consecutive bytes. | The fonts supported by Ultibo are a bitmap format that contains a block of data where each character is represented by a number of consecutive bytes. | ||
− | Fonts can either be statically compiled as a pascal unit and loaded during startup or can be dynamically loaded by passing a header and data block to the FontLoad() function. A Font Builder tool is available to | + | Fonts can either be statically compiled as a pascal unit and loaded during startup or can be dynamically loaded by passing a header and data block to the FontLoad() function. A Font Builder tool is available to convert common bitmap font formats into a pascal unit for compiling with a project. |
For an 8x16 (8 pixels wide and 16 pixels high) font the data contains 8 bits (1 byte) for each of the 16 rows that make up a character and each character would be 16 bytes long. | For an 8x16 (8 pixels wide and 16 pixels high) font the data contains 8 bits (1 byte) for each of the 16 rows that make up a character and each character would be 16 bytes long. | ||
Line 19: | Line 21: | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Font specific constants''' <code> FONT_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>FONT_MIN_COUNT = 256;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FONT_MIN_WIDTH = 8;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FONT_MAX_WIDTH = 32;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FONT_MIN_HEIGHT = 6;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FONT_MAX_HEIGHT = 64;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Font signature''' <code> FONT_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>FONT_SIGNATURE = $77DE1BBC;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Font name''' <code> FONT_*_LENGTH </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>FONT_NAME_LENGTH = SIZE_64;</code> | ||
+ | | Length of font name | ||
+ | |- | ||
+ | | <code>FONT_DESC_LENGTH = SIZE_128;</code> | ||
+ | | Length of font description | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Font mode''' <code> FONT_MODE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>FONT_MODE_NONE = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FONT_MODE_PIXEL = 1;</code> | ||
+ | | A font with 1 bit per pixel in the character data | ||
+ | |- | ||
+ | | <code>FONT_MODE_ALPHA8 = 2;</code> | ||
+ | | A font with 8 bits of alpha blending per pixel in the character data | ||
+ | |- | ||
+ | | <code>FONT_MODE_RGBA32 = 3;</code> | ||
+ | | A font with 32 bits RGBA per pixel in the character data | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Font flag''' <code> FONT_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>FONT_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FONT_FLAG_UNICODE = $00000001;</code> | ||
+ | | Font includes a unicode translation table | ||
+ | |- | ||
+ | | <code>FONT_FLAG_CODEPAGE = $00000002;</code> | ||
+ | | Font has a specified codepage | ||
+ | |- | ||
+ | | <code>FONT_FLAG_BIGENDIAN = $00000004;</code> | ||
+ | | Font characters are in big endian order (Only applies to characters larger than one byte) | ||
+ | |- | ||
+ | | <code>FONT_FLAG_RIGHTALIGN = $00000008;</code> | ||
+ | | Font characters are right aligned, no need to shift during load | ||
+ | |- | ||
+ | | <code>FONT_FLAG_VARIABLE = $00000010;</code> | ||
+ | | Font characters are variable width rather than fixed | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === | ||
---- | ---- | ||
− | '' | + | |
+ | '''Font header''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontHeader = ^TFontHeader;</code> | ||
+ | |||
+ | <code>TFontHeader = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Width:LongWord;</code> | ||
+ | | Width of each character in pixels | ||
+ | |- | ||
+ | | <code>Height:LongWord;</code> | ||
+ | | Height of each character in pixels | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Number of character glyphs in data | ||
+ | |- | ||
+ | | <code>Mode:LongWord;</code> | ||
+ | | Font mode (eg FONT_MODE_PIXEL) | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Font flags (eg FONT_FLAG_UNICODE) | ||
+ | |- | ||
+ | | <code>Mask:LongWord;</code> | ||
+ | | Transparency mask for a bitmap font | ||
+ | |- | ||
+ | | <code>CodePage:LongWord;</code> | ||
+ | | Font codepage (CP_ACP if not specified) | ||
+ | |- | ||
+ | | <code>Name:String[63];</code> | ||
+ | | Font name | ||
+ | |- | ||
+ | | <code>Description:String[127];</code> | ||
+ | | Font description | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData = ^TFontData;</code> | ||
+ | |||
+ | <code>TFontData = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Data:array[0..0] of Byte;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 8x6''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData8x6 = ^TFontData8x6;</code> | ||
+ | |||
+ | <code>TFontData8x6 = record Data:array[0..255,0..5] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 8 bit width (Byte) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 8x7''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData8x7 = ^TFontData8x7;</code> | ||
+ | |||
+ | <code>TFontData8x7 = record Data:array[0..255,0..6] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 8 bit width (Byte) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 8x8''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData8x8 = ^TFontData8x8;</code> | ||
+ | |||
+ | <code>TFontData8x8 = record Data:array[0..255,0..7] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 8 bit width (Byte) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 8x9''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData8x9 = ^TFontData8x9;</code> | ||
+ | |||
+ | <code>TFontData8x9 = record Data:array[0..255,0..8] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 8 bit width (Byte) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 8x10''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData8x10 = ^TFontData8x10;</code> | ||
+ | |||
+ | <code>TFontData8x10 = record Data:array[0..255,0..9] of Byte; </code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 8 bit width (Byte) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 8x11''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData8x11 = ^TFontData8x11;</code> | ||
+ | |||
+ | <code>TFontData8x11 = record Data:array[0..255,0..10] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 8 bit width (Byte) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 8x12''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData8x12 = ^TFontData8x12;</code> | ||
+ | |||
+ | <code>TFontData8x12 = record Data:array[0..255,0..11] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 8 bit width (Byte) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 8x13''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData8x13 = ^TFontData8x13;</code> | ||
+ | |||
+ | <code>TFontData8x13 = record Data:array[0..255,0..12] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 8 bit width (Byte) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 8x14''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData8x14 = ^TFontData8x14;</code> | ||
+ | |||
+ | <code>TFontData8x14 = record Data:array[0..255,0..13] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 8 bit width (Byte) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 8x15''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData8x15 = ^TFontData8x15;</code> | ||
+ | |||
+ | <code>TFontData8x15 = record Data:array[0..255,0..14] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 8 bit width (Byte) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 8x16''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData8x16 = ^TFontData8x16;</code> | ||
+ | |||
+ | <code>TFontData8x16 = record Data:array[0..255,0..15] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 8 bit width (Byte) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 12x12''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData12x12 = ^TFontData12x12;</code> | ||
+ | |||
+ | <code>TFontData12x12 = record Data:array[0..255,0..11] of Word;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 12 bit width (Word) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 12x14''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData12x14 = ^TFontData12x14;</code> | ||
+ | |||
+ | <code>TFontData12x14 = record Data:array[0..255,0..13] of Word;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 12 bit width (Word) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 12x16''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData12x16 = ^TFontData12x16;</code> | ||
+ | |||
+ | <code>TFontData12x16 = record Data:array[0..255,0..15] of Word;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 12 bit width (Word) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 12x18''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData12x18 = ^TFontData12x18;</code> | ||
+ | |||
+ | <code>TFontData12x18 = record Data:array[0..255,0..17] of Word;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 12 bit width (Word) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 12x20''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData12x20 = ^TFontData12x20;</code> | ||
+ | |||
+ | <code>TFontData12x20 = record Data:array[0..255,0..19] of Word;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 12 bit width (Word) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 12x22''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData12x22 = ^TFontData12x22;</code> | ||
+ | |||
+ | <code>TFontData12x22 = record Data:array[0..255,0..21] of Word;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 12 bit width (Word) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 16x16''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData16x16 = ^TFontData16x16;</code> | ||
+ | |||
+ | <code>TFontData16x16 = record Data:array[0..255,0..15] of Word;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 16 bit width (Word) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 16x24''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData16x24 = ^TFontData16x24;</code> | ||
+ | |||
+ | <code>TFontData16x24 = record Data:array[0..255,0..23] of Word;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 16 bit width (Word) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 16x32''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData16x32 = ^TFontData16x32;</code> | ||
+ | |||
+ | <code>TFontData16x32 = record Data:array[0..255,0..31] of Word;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 16 bit width (Word) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 32x32''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData32x32 = ^TFontData32x32;</code> | ||
+ | |||
+ | <code>TFontData32x32 = record Data:array[0..255,0..31] of LongWord;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 32 bit width (LongWord) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 32x48''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData32x48 = ^TFontData32x48;</code> | ||
+ | |||
+ | <code>TFontData32x48 = record Data:array[0..255,0..47] of LongWord;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 32 bit width (LongWord) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font data 32x64''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontData32x64 = ^TFontData32x64;</code> | ||
+ | |||
+ | <code>TFontData32x64 = record Data:array[0..255,0..63] of LongWord; </code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: 32 bit width (LongWord) | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font chars 8''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontChars8 = ^TFontChars8;</code> | ||
+ | |||
+ | <code>TFontChars8 = array[0..0] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font chars 16''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontChars16 = ^TFontChars16; </code> | ||
+ | |||
+ | <code>TFontChars16 = array[0..0] of Word;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font chars 32''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontChars32 = ^TFontChars32;</code> | ||
+ | |||
+ | <code>TFontChars32 = array[0..0] of LongWord;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font unicode''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontUnicode = ^TFontUnicode;</code> | ||
+ | |||
+ | <code>TFontUnicode = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font properties''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontProperties = ^TFontProperties;</code> | ||
+ | |||
+ | <code>TFontProperties = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>FontMode:LongWord;</code> | ||
+ | | Font mode (eg FONT_MODE_PIXEL) | ||
+ | |- | ||
+ | | <code>FontFlags:LongWord;</code> | ||
+ | | Font flags (eg FONT_FLAG_UNICODE) | ||
+ | |- | ||
+ | | <code>FontName:array[0..FONT_NAME_LENGTH - 1] of Char;</code> | ||
+ | | Font name | ||
+ | |- | ||
+ | | <code>FontDescription:array[0..FONT_DESC_LENGTH - 1] of Char;</code> | ||
+ | | Font description | ||
+ | |- | ||
+ | | <code>CharWidth:LongWord;</code> | ||
+ | | Font character width in pixels | ||
+ | |- | ||
+ | | <code>CharHeight:LongWord;</code> | ||
+ | | Font character height in pixels | ||
+ | |- | ||
+ | | <code>CharCount:LongWord;</code> | ||
+ | | Number of glyphs in font character table | ||
+ | |- | ||
+ | | <code>CharMask:LongWord;</code> | ||
+ | | Transparency mask for a bitmap font (Not used for a pixel font) | ||
+ | |- | ||
+ | | <code>CodePage:LongWord;</code> | ||
+ | | Font codepage (CP_ACP if not specified) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Font enumeration callback''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TFontEnumerate = function(Handle:TFontHandle; Data:Pointer):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Font entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFontEntry = ^TFontEntry;</code> | ||
+ | |||
+ | <code>TFontEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Font Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>FontMode:LongWord;</code> | ||
+ | | Font mode (eg FONT_MODE_PIXEL) | ||
+ | |- | ||
+ | | <code>FontFlags:LongWord;</code> | ||
+ | | Font flags (eg FONT_FLAG_UNICODE) | ||
+ | |- | ||
+ | | <code>FontName:array[0..FONT_NAME_LENGTH - 1] of Char;</code> | ||
+ | | Font name | ||
+ | |- | ||
+ | | <code>FontDescription:array[0..FONT_DESC_LENGTH - 1] of Char;</code> | ||
+ | | Font description | ||
+ | |- | ||
+ | |colspan="2"|''Driver Properties'' | ||
+ | |- | ||
+ | | <code>CharWidth:LongWord;</code> | ||
+ | | Font character width in pixels | ||
+ | |- | ||
+ | | <code>CharHeight:LongWord;</code> | ||
+ | | Font character height in pixels | ||
+ | |- | ||
+ | | <code>CharCount:LongWord;</code> | ||
+ | | Number of glyphs in font character table | ||
+ | |- | ||
+ | | <code>CharMask:LongWord;</code> | ||
+ | | Transparency mask for a bitmap font (Not used for a pixel font) | ||
+ | |- | ||
+ | | <code>CodePage:LongWord;</code> | ||
+ | | Font codepage (CP_ACP if not specified) | ||
+ | |- | ||
+ | | <code>CharData:Pointer;</code> | ||
+ | | Font character pixel or bitmap data | ||
+ | |- | ||
+ | | <code>UnicodeData:PFontUnicode;</code> | ||
+ | | Font unicode translation data (Only if FONT_FLAG_UNICODE) | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PFontEntry;</code> | ||
+ | | Previous entry in Font table | ||
+ | |- | ||
+ | | <code>Next:PFontEntry;</code> | ||
+ | | Next entry in Font table | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Public variables === | === Public variables === | ||
---- | ---- | ||
− | '' | + | ''None defined'' |
=== Function declarations === | === Function declarations === | ||
---- | ---- | ||
− | + | ||
'''Initialization functions''' | '''Initialization functions''' | ||
Line 43: | Line 756: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 58: | Line 771: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Header |
| Pointer to the font header | | Pointer to the font header | ||
|- | |- | ||
− | ! | + | ! Data |
| Pointer to the font data | | Pointer to the font data | ||
|- | |- | ||
− | ! | + | ! Size |
| Size of the font data | | Size of the font data | ||
|- | |- | ||
Line 76: | Line 789: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Header |
| Pointer to the font header | | Pointer to the font header | ||
|- | |- | ||
− | ! | + | ! Data |
| Pointer to the font data | | Pointer to the font data | ||
|- | |- | ||
− | ! | + | ! Unicode |
| Pointer to the unicode translation table (Optional) | | Pointer to the unicode translation table (Optional) | ||
|- | |- | ||
− | ! | + | ! Size |
| Size of the font data | | Size of the font data | ||
|- | |- | ||
− | ! | + | ! Properties |
| Pointer to a font properties record to use instead of the header (Optional) | | Pointer to a font properties record to use instead of the header (Optional) | ||
|- | |- | ||
Line 100: | Line 813: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 112: | Line 825: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 124: | Line 837: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 136: | Line 849: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 148: | Line 861: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 160: | Line 873: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 172: | Line 885: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 184: | Line 897: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 196: | Line 909: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 208: | Line 921: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 220: | Line 933: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 232: | Line 945: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 244: | Line 957: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 259: | Line 972: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 271: | Line 984: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 281: | Line 994: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function FontGetCount:LongWord | + | <pre style="border: 0; padding-bottom:0px;">function FontGetCount:LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current font count</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current font count</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 293: | Line 1,006: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function FontGetDefault:TFontHandle | + | <pre style="border: 0; padding-bottom:0px;">function FontGetDefault:TFontHandle;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default font</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default font</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 310: | Line 1,023: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
Line 322: | Line 1,035: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | None documented |
|- | |- | ||
|} | |} | ||
</div></div> | </div></div> | ||
<br /> | <br /> | ||
− | |||
Return to [[Unit_Reference|Unit Reference]] | Return to [[Unit_Reference|Unit Reference]] |
Latest revision as of 04:58, 21 June 2023
Return to Unit Reference
Description
Ultibo Font Interface unit
The fonts supported by Ultibo are a bitmap format that contains a block of data where each character is represented by a number of consecutive bytes.
Fonts can either be statically compiled as a pascal unit and loaded during startup or can be dynamically loaded by passing a header and data block to the FontLoad() function. A Font Builder tool is available to convert common bitmap font formats into a pascal unit for compiling with a project.
For an 8x16 (8 pixels wide and 16 pixels high) font the data contains 8 bits (1 byte) for each of the 16 rows that make up a character and each character would be 16 bytes long.
For a 12x22 font the data contains 12 bits padded to 16 bits (2 bytes) for each of the 22 rows that make up a character. Therefore each character would be 44 bytes in length.
This unit can support any size font from 8x6 to 32x64 including every combination in between. For fonts where the bits per row is greater than one byte both little endian and big endian format is supported. Allowance has been made for including a Unicode translation table with each font so that writing of Unicode text to the console can be supported as well as an extended bitmap format where character data includes alpha or color information or both. These features are yet to be fully implemented.
Constants
FONT_*
FONT_MIN_COUNT = 256;
|
|
FONT_MIN_WIDTH = 8;
|
|
FONT_MAX_WIDTH = 32;
|
|
FONT_MIN_HEIGHT = 6;
|
|
FONT_MAX_HEIGHT = 64;
|
FONT_SIGNATURE_*
FONT_SIGNATURE = $77DE1BBC;
|
FONT_*_LENGTH
FONT_NAME_LENGTH = SIZE_64;
|
Length of font name |
FONT_DESC_LENGTH = SIZE_128;
|
Length of font description |
FONT_MODE_*
FONT_MODE_NONE = 0;
|
|
FONT_MODE_PIXEL = 1;
|
A font with 1 bit per pixel in the character data |
FONT_MODE_ALPHA8 = 2;
|
A font with 8 bits of alpha blending per pixel in the character data |
FONT_MODE_RGBA32 = 3;
|
A font with 32 bits RGBA per pixel in the character data |
FONT_FLAG_*
FONT_FLAG_NONE = $00000000;
|
|
FONT_FLAG_UNICODE = $00000001;
|
Font includes a unicode translation table |
FONT_FLAG_CODEPAGE = $00000002;
|
Font has a specified codepage |
FONT_FLAG_BIGENDIAN = $00000004;
|
Font characters are in big endian order (Only applies to characters larger than one byte) |
FONT_FLAG_RIGHTALIGN = $00000008;
|
Font characters are right aligned, no need to shift during load |
FONT_FLAG_VARIABLE = $00000010;
|
Font characters are variable width rather than fixed |
Type definitions
Font header
PFontHeader = ^TFontHeader;
TFontHeader = record
Width:LongWord;
|
Width of each character in pixels |
Height:LongWord;
|
Height of each character in pixels |
Count:LongWord;
|
Number of character glyphs in data |
Mode:LongWord;
|
Font mode (eg FONT_MODE_PIXEL) |
Flags:LongWord;
|
Font flags (eg FONT_FLAG_UNICODE) |
Mask:LongWord;
|
Transparency mask for a bitmap font |
CodePage:LongWord;
|
Font codepage (CP_ACP if not specified) |
Name:String[63];
|
Font name |
Description:String[127];
|
Font description |
Font data
PFontData = ^TFontData;
TFontData = record
Data:array[0..0] of Byte;
|
Font data 8x6
PFontData8x6 = ^TFontData8x6;
TFontData8x6 = record Data:array[0..255,0..5] of Byte;
Note: 8 bit width (Byte) | |
Font data 8x7
PFontData8x7 = ^TFontData8x7;
TFontData8x7 = record Data:array[0..255,0..6] of Byte;
Note: 8 bit width (Byte) | |
Font data 8x8
PFontData8x8 = ^TFontData8x8;
TFontData8x8 = record Data:array[0..255,0..7] of Byte;
Note: 8 bit width (Byte) | |
Font data 8x9
PFontData8x9 = ^TFontData8x9;
TFontData8x9 = record Data:array[0..255,0..8] of Byte;
Note: 8 bit width (Byte) | |
Font data 8x10
PFontData8x10 = ^TFontData8x10;
TFontData8x10 = record Data:array[0..255,0..9] of Byte;
Note: 8 bit width (Byte) | |
Font data 8x11
PFontData8x11 = ^TFontData8x11;
TFontData8x11 = record Data:array[0..255,0..10] of Byte;
Note: 8 bit width (Byte) | |
Font data 8x12
PFontData8x12 = ^TFontData8x12;
TFontData8x12 = record Data:array[0..255,0..11] of Byte;
Note: 8 bit width (Byte) | |
Font data 8x13
PFontData8x13 = ^TFontData8x13;
TFontData8x13 = record Data:array[0..255,0..12] of Byte;
Note: 8 bit width (Byte) | |
Font data 8x14
PFontData8x14 = ^TFontData8x14;
TFontData8x14 = record Data:array[0..255,0..13] of Byte;
Note: 8 bit width (Byte) | |
Font data 8x15
PFontData8x15 = ^TFontData8x15;
TFontData8x15 = record Data:array[0..255,0..14] of Byte;
Note: 8 bit width (Byte) | |
Font data 8x16
PFontData8x16 = ^TFontData8x16;
TFontData8x16 = record Data:array[0..255,0..15] of Byte;
Note: 8 bit width (Byte) | |
Font data 12x12
PFontData12x12 = ^TFontData12x12;
TFontData12x12 = record Data:array[0..255,0..11] of Word;
Note: 12 bit width (Word) | |
Font data 12x14
PFontData12x14 = ^TFontData12x14;
TFontData12x14 = record Data:array[0..255,0..13] of Word;
Note: 12 bit width (Word) | |
Font data 12x16
PFontData12x16 = ^TFontData12x16;
TFontData12x16 = record Data:array[0..255,0..15] of Word;
Note: 12 bit width (Word) | |
Font data 12x18
PFontData12x18 = ^TFontData12x18;
TFontData12x18 = record Data:array[0..255,0..17] of Word;
Note: 12 bit width (Word) | |
Font data 12x20
PFontData12x20 = ^TFontData12x20;
TFontData12x20 = record Data:array[0..255,0..19] of Word;
Note: 12 bit width (Word) | |
Font data 12x22
PFontData12x22 = ^TFontData12x22;
TFontData12x22 = record Data:array[0..255,0..21] of Word;
Note: 12 bit width (Word) | |
Font data 16x16
PFontData16x16 = ^TFontData16x16;
TFontData16x16 = record Data:array[0..255,0..15] of Word;
Note: 16 bit width (Word) | |
Font data 16x24
PFontData16x24 = ^TFontData16x24;
TFontData16x24 = record Data:array[0..255,0..23] of Word;
Note: 16 bit width (Word) | |
Font data 16x32
PFontData16x32 = ^TFontData16x32;
TFontData16x32 = record Data:array[0..255,0..31] of Word;
Note: 16 bit width (Word) | |
Font data 32x32
PFontData32x32 = ^TFontData32x32;
TFontData32x32 = record Data:array[0..255,0..31] of LongWord;
Note: 32 bit width (LongWord) | |
Font data 32x48
PFontData32x48 = ^TFontData32x48;
TFontData32x48 = record Data:array[0..255,0..47] of LongWord;
Note: 32 bit width (LongWord) | |
Font data 32x64
PFontData32x64 = ^TFontData32x64;
TFontData32x64 = record Data:array[0..255,0..63] of LongWord;
Note: 32 bit width (LongWord) | |
Font chars 8
PFontChars8 = ^TFontChars8;
TFontChars8 = array[0..0] of Byte;
Font chars 16
PFontChars16 = ^TFontChars16;
TFontChars16 = array[0..0] of Word;
Font chars 32
PFontChars32 = ^TFontChars32;
TFontChars32 = array[0..0] of LongWord;
Font unicode
PFontUnicode = ^TFontUnicode;
TFontUnicode = record
Font properties
PFontProperties = ^TFontProperties;
TFontProperties = record
FontMode:LongWord;
|
Font mode (eg FONT_MODE_PIXEL) |
FontFlags:LongWord;
|
Font flags (eg FONT_FLAG_UNICODE) |
FontName:array[0..FONT_NAME_LENGTH - 1] of Char;
|
Font name |
FontDescription:array[0..FONT_DESC_LENGTH - 1] of Char;
|
Font description |
CharWidth:LongWord;
|
Font character width in pixels |
CharHeight:LongWord;
|
Font character height in pixels |
CharCount:LongWord;
|
Number of glyphs in font character table |
CharMask:LongWord;
|
Transparency mask for a bitmap font (Not used for a pixel font) |
CodePage:LongWord;
|
Font codepage (CP_ACP if not specified) |
Font enumeration callback
TFontEnumerate = function(Handle:TFontHandle; Data:Pointer):LongWord;
|
Font entry
PFontEntry = ^TFontEntry;
TFontEntry = record
Font Properties | |
Signature:LongWord;
|
Signature for entry validation |
FontMode:LongWord;
|
Font mode (eg FONT_MODE_PIXEL) |
FontFlags:LongWord;
|
Font flags (eg FONT_FLAG_UNICODE) |
FontName:array[0..FONT_NAME_LENGTH - 1] of Char;
|
Font name |
FontDescription:array[0..FONT_DESC_LENGTH - 1] of Char;
|
Font description |
Driver Properties | |
CharWidth:LongWord;
|
Font character width in pixels |
CharHeight:LongWord;
|
Font character height in pixels |
CharCount:LongWord;
|
Number of glyphs in font character table |
CharMask:LongWord;
|
Transparency mask for a bitmap font (Not used for a pixel font) |
CodePage:LongWord;
|
Font codepage (CP_ACP if not specified) |
CharData:Pointer;
|
Font character pixel or bitmap data |
UnicodeData:PFontUnicode;
|
Font unicode translation data (Only if FONT_FLAG_UNICODE) |
Internal Properties | |
Prev:PFontEntry;
|
Previous entry in Font table |
Next:PFontEntry;
|
Next entry in Font table |
Public variables
None defined
Function declarations
Initialization functions
procedure FontInit;
Note | None documented |
---|
Font functions
function FontLoad(Header:PFontHeader; Data:PFontData; Size:LongWord):TFontHandle;
Header | Pointer to the font header |
---|---|
Data | Pointer to the font data |
Size | Size of the font data |
function FontLoadEx(Header:PFontHeader; Data:PFontData; Unicode:PFontUnicode; Size:LongWord; Properties:PFontProperties):TFontHandle;
Header | Pointer to the font header |
---|---|
Data | Pointer to the font data |
Unicode | Pointer to the unicode translation table (Optional) |
Size | Size of the font data |
Properties | Pointer to a font properties record to use instead of the header (Optional) |
function FontUnload(Handle:TFontHandle):LongWord;
Note | None documented |
---|
function FontGetName(Handle:TFontHandle):String;
Note | None documented |
---|
function FontGetDescription(Handle:TFontHandle):String;
Note | None documented |
---|
function FontGetWidth(Handle:TFontHandle):LongWord;
Note | None documented |
---|
function FontGetHeight(Handle:TFontHandle):LongWord;
Note | None documented |
---|
function FontGetProperties(Handle:TFontHandle; Properties:PFontProperties):LongWord;
Note | None documented |
---|
function FontCharWidth(Handle:TFontHandle; Character:Word):LongWord;
Note | None documented |
---|
function FontCharHeight(Handle:TFontHandle; Character:Word):LongWord;
Note | None documented |
---|
function FontTextWidth(Handle:TFontHandle; const Text:String):LongWord;
Note | None documented |
---|
function FontTextHeight(Handle:TFontHandle; const Text:String):LongWord;
Note | None documented |
---|
function FontFindByName(const Name:String):TFontHandle;
Note | None documented |
---|
function FontFindByDescription(const Description:String):TFontHandle;
Note | None documented |
---|
function FontEnumerate(Callback:TFontEnumerate; Data:Pointer):LongWord;
Note | None documented |
---|
PSF font functions
function PSFFontLoad(const FileName:String):TFontHandle;
Note | None documented |
---|
function PSFFontLoadEx(Data:Pointer;Size:LongWord):TFontHandle;
Note | None documented |
---|
Font helper functions
function FontGetCount:LongWord;
Note | None documented |
---|
function FontGetDefault:TFontHandle;
Note | None documented |
---|
function FontSetDefault(Handle:TFontHandle):LongWord;
Note | None documented |
---|
function FontCheck(Font:PFontEntry):PFontEntry;
Note | None documented |
---|
Return to Unit Reference