Fontset

Stores the letters and all the data associated with the font, also has functions related to text lenght and line formatting. Supports variable letter width. TODO: Add ability to load from dpk files through the use of vfiles.

Constructors

this
this()

Empty constructor, primarily for testing purposes

this
this(std.stdio.File file, string basepath)

Loads a fontset from disk.

Members

Aliases

CharMap
alias CharMap = Font.Char[]
Undocumented in source.
KerningMap
alias KerningMap = KerningInfo[]
Undocumented in source.

Functions

breakTextIntoMultipleLines
dstring[] breakTextIntoMultipleLines(dstring input, int maxWidth, bool ignoreNewLineChars)

Breaks the input text into multiple lines according to the parameters.

chars
Font.Char chars(dchar c)

Returns the character info if present, or a substitute from either a fallback font if it found in them or the default substitute character (0xFFFD)

getKerning
short getKerning(dchar first, dchar second)

Returns the kerning for the given character pair if there's any, or 0. Should be called through CharacterFormattingInfo, which can bypass it if formatting flag is enabled.

getName
string getName()

Returns the name of the font

getTextLength
int getTextLength(dstring text)

Returns the width of the text in pixels.

size
int size()

returns the height of the font.

Structs

KerningInfo
struct KerningInfo
Undocumented in source.

Variables

_chars
CharMap _chars;

Contains character information in a fast lookup form

_kerning
KerningMap _kerning;

Contains kerning information

pages
T[] pages;

Character pages

Meta