Difference between revisions of "Unit Font"
Line 4: | Line 4: | ||
=== Description === | === Description === | ||
---- | ---- | ||
+ | |||
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. | ||
Line 328: | Line 329: | ||
</div></div> | </div></div> | ||
<br /> | <br /> | ||
− | |||
Return to [[Unit_Reference|Unit Reference]] | Return to [[Unit_Reference|Unit Reference]] |
Revision as of 01:16, 19 August 2016
Return to Unit Reference
Contents
[hide]Description
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 change 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
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
Font functions
function FontLoad(Header:PFontHeader; Data:PFontData; Size:LongWord):TFontHandle;
function FontLoadEx(Header:PFontHeader; Data:PFontData; Unicode:PFontUnicode; Size:LongWord; Properties:PFontProperties):TFontHandle;
function FontGetProperties(Handle:TFontHandle; Properties:PFontProperties):LongWord;
function FontCharWidth(Handle:TFontHandle; Character:Word):LongWord;
function FontCharHeight(Handle:TFontHandle; Character:Word):LongWord;
function FontTextWidth(Handle:TFontHandle; const Text:String):LongWord;
function FontTextHeight(Handle:TFontHandle; const Text:String):LongWord;
function FontFindByDescription(const Description:String):TFontHandle;
function FontEnumerate(Callback:TFontEnumerate; Data:Pointer):LongWord;
PSF font functions
function PSFFontLoadEx(Data:Pointer;Size:LongWord):TFontHandle;
Font helper functions
function FontSetDefault(Handle:TFontHandle):LongWord;
function FontCheck(Font:PFontEntry):PFontEntry;
Return to Unit Reference