Difference between revisions of "Unit Font"

From Ultibo.org
Jump to: navigation, search
Line 44: Line 44:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 101: Line 101:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 113: Line 113:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 125: Line 125:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 137: Line 137:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 149: Line 149:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 161: Line 161:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 173: Line 173:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 185: Line 185:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 197: Line 197:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 209: Line 209:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 221: Line 221:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 233: Line 233:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 245: Line 245:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 260: Line 260:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 272: Line 272:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 287: Line 287:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 299: Line 299:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 311: Line 311:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 323: Line 323:
 
|-
 
|-
 
! '''Note'''
 
! '''Note'''
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}

Revision as of 05:55, 26 September 2016

Return to Unit Reference


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

procedure FontInit;
Description: To be documented
Note None documented


Font functions

function FontLoad(Header:PFontHeader; Data:PFontData; Size:LongWord):TFontHandle;
Description: Load a Font from a font data block and add to the Font table
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;
Description: Load a Font from a font data block and add to the Font table
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;
Description: To be documented
Note None documented


function FontGetName(Handle:TFontHandle):String;
Description: To be documented
Note None documented


function FontGetDescription(Handle:TFontHandle):String;
Description: To be documented
Note None documented


function FontGetWidth(Handle:TFontHandle):LongWord;
Description: To be documented
Note None documented


function FontGetHeight(Handle:TFontHandle):LongWord;
Description: To be documented
Note None documented


function FontGetProperties(Handle:TFontHandle; Properties:PFontProperties):LongWord;
Description: To be documented
Note None documented


function FontCharWidth(Handle:TFontHandle; Character:Word):LongWord;
Description: To be documented
Note None documented


function FontCharHeight(Handle:TFontHandle; Character:Word):LongWord;
Description: To be documented
Note None documented


function FontTextWidth(Handle:TFontHandle; const Text:String):LongWord;
Description: To be documented
Note None documented


function FontTextHeight(Handle:TFontHandle; const Text:String):LongWord;
Description: To be documented
Note None documented


function FontFindByName(const Name:String):TFontHandle;
Description: To be documented
Note None documented


function FontFindByDescription(const Description:String):TFontHandle; 
Description: To be documented
Note None documented


function FontEnumerate(Callback:TFontEnumerate; Data:Pointer):LongWord;
Description: To be documented
Note None documented


PSF font functions

function PSFFontLoad(const FileName:String):TFontHandle;
Description: To be documented
Note None documented


function PSFFontLoadEx(Data:Pointer;Size:LongWord):TFontHandle;
Description: To be documented
Note None documented


Font helper functions

function FontGetCount:LongWord; inline;
Description: Get the current font count
Note None documented


function FontGetDefault:TFontHandle; inline;
Description: Get the current default font
Note None documented


function FontSetDefault(Handle:TFontHandle):LongWord;
Description: Set the current default font
Note None documented


function FontCheck(Font:PFontEntry):PFontEntry;
Description: Check if the supplied Font is in the Font table
Note None documented


Return to Unit Reference