Class Font
D class that wraps TTF_Font
enclosing a font object to render text from
class Font
;
Constructors
Name | Description |
---|---|
this
(ttfFont, isOwner, userRef)
|
Constructs a Font from a vanilla TTF_Font* from bindbc-sdl
|
this
(file, size)
|
Loads a Font from a font file, which wraps TTF_OpenFont
|
this
(file, size, index)
|
Loads a Font from a font file with a face index, which wraps TTF_OpenFontIndex
|
this
(data, size)
|
Loads a Font from a buffer, which wraps TTF_OpenFontRW
|
this
(data, size, index)
|
Loads a Font from a buffer with a face index, which wraps TTF_OpenFontIndexRW
|
this
(file, size, hdpi, vdpi)
|
Loads a Font from a font file with DPI, which wraps TTF_OpenFontDPI (from SDL_ttf 2.0.18)
|
this
(file, size, index, hdpi, vdpi)
|
Loads a Font from a font file with DPI and face index, which wraps TTF_OpenFontIndexDPI (from
SDL_ttf 2.0.18)
|
this
(data, size, hdpi, vdpi)
|
Loads a Font from a buffer with DPI, which wraps TTF_OpenFontDPIRW (from SDL_ttf 2.0.18)
|
this
(data, size, index, hdpi, vdpi)
|
Loads a Font from a buffer with DPI and face index, which wraps TTF_OpenFontIndexDPIRW (from
SDL_ttf 2.0.18)
|
Fields
Name | Type | Description |
---|---|---|
ttfFont
|
sdl_ttf | Internal TTF_Font pointer
|
Properties
Name | Type | Description |
---|---|---|
ascent [get]
|
int | Wraps TTF_FontAscent to get the Font 's ascent
|
bold [get]
|
bool | Wraps TTF_GetFontStyle to get whether the Font style is bold
|
bold [set]
|
bool | Wraps TTF_SetFontStyle to set the Font style to be bold
|
descent [get]
|
int | Wraps TTF_FontDescent to get the Font 's descent
|
direction [set]
|
Direction | Wraps TTF_SetFontDirection (from SDL_ttf 2.20) to set the Font 's script direction
|
faces [get]
|
ulong | Wraps TTF_FontFaces to get the Font 's number of font faces
|
familyName [get]
|
string | Wraps TTF_FontFaceFamilyName to get the Font family name
|
fixedWidth [get]
|
bool | Wraps TTF_FontFaceIsFixedWidth to check whether the Font 's font face is fixed width
|
height [get]
|
int | Wraps TTF_FontHeight to get the Font 's height
|
hinting [get]
|
Hinting | Wraps TTF_GetFontHinting to get the Font hinting
|
hinting [set]
|
Hinting | Wraps TTF_SetFontHinting to set the Font hinting
|
italic [get]
|
bool | Wraps TTF_GetFontStyle to get whether the Font style is italic
|
italic [set]
|
bool | Wraps TTF_SetFontStyle to set the Font style to be italic
|
kerning [get]
|
bool | Wraps TTF_GetFontKerning to get the Font 's kerning
|
kerning [set]
|
bool | Wraps TTF_SetFontKerning to set the Font 's kerning
|
lineSkip [get]
|
int | Wraps TTF_FontLineSkip to get the Font 's line skip
|
outline [get]
|
uint | Wraps TTF_GetFontOutline to get the Font outline value
|
outline [set]
|
uint | Wraps TTF_SetFontOutline to set the Font outline value
|
scriptName [set]
|
string | Wraps TTF_SetFontScriptName (from SDL_ttf 2.20) to set the Font 's script name
|
sdf [get]
|
bool | Wraps TTF_GetFontSDF (from SDL_ttf 2.0.18) to get whether the Font has signed distance field
|
sdf [set]
|
bool | Wraps TTF_SetFontSDF (from SDL_ttf 2.0.18) to set signed distance field
|
size [set]
|
uint | Wraps TTF_SetFontSize (from SDL_ttf 2.0.18) to set the Font 's size
|
sizeDPI [set]
|
std | Wraps TTF_SetFontSizeDPI (from SDL_ttf 2.0.18) to set the Font 's size in DPI
|
strikethrough [get]
|
bool | Wraps TTF_GetFontStyle to get whether the Font style is strikethrough
|
strikethrough [set]
|
bool | Wraps TTF_SetFontStyle to set the Font style to be strikethrough
|
styleName [get]
|
string | Wraps TTF_FontFaceStyleName to get the Font style name
|
underline [get]
|
bool | Wraps TTF_GetFontStyle to get whether the Font style is underlined
|
underline [set]
|
bool | Wraps TTF_SetFontStyle to set the Font style to be underlined
|
wrappedAlign [get]
|
WrappedAlign | Wraps TTF_GetFontWrappedAlign (from SDL_ttf 2.20) to get the Font 's wrap alignment mode
|
wrappedAlign [set]
|
WrappedAlign | Wraps TTF_SetFontWrappedAlign (from SDL_ttf 2.20) to set the Font 's wrap alignment mode
|
Methods
Name | Description |
---|---|
glyphKerning
(prevGlyph, glyph)
|
Wraps TTF_GetFontKerningSize (from SDL_ttf 2.0.14) to get the kerning between two glyphs in the
Font
|
glyphKerning
(prevGlyph, glyph)
|
Wraps TTF_GetFontKerningSize (from SDL_ttf 2.0.18) to get the kerning between two glyphs in the
Font
|
glyphMetrics
(glyph)
|
Wraps TTF_GlyphMetrics to the metrics of a glyph in the Font
|
glyphMetrics
(glyph)
|
Wraps TTF_GlyphMetrics32 (from SDL_ttf 2.0.18) to the metrics of a glyph in the Font
|
measureText
(text, measureWidth)
|
Wraps TTF_MeasureUTF8 (from SDL_ttf 2.0.18) to calculate the maximum number of characters from a text that
can be rendered given a maximum fitting width
|
measureText
(text, measureWidth)
|
Wraps TTF_MeasureUNICODE (from SDL_ttf 2.0.18) to calculate the maximum number of characters from a text
that can be rendered given a maximum fitting width
|
opEquals
(rhs)
|
Equality operator overload |
providesGlyph
(glyph)
|
Wraps TTF_GlyphIsProvided to check whether the Font provides a glyph
|
providesGlyph
(glyph)
|
Wraps TTF_GlyphIsProvided32 (from SDL_ttf 2.0.18) to check whether the Font provides a glyph
|
render
(glyph, foreground, background, quality)
|
Wraps TTF_RenderGlyph_Solid , TTF_RenderGlyph_Shaded , TTF_RenderGlyph_Blended , and additionally
TTF_RenderGlyph_LCD (from SDL_ttf 2.20) to render a glyph in the Font
|
render
(glyph, foreground, background, quality)
|
Wraps TTF_RenderGlyph32_Solid , TTF_RenderGlyph32_Shaded , TTF_RenderGlyph32_Blended (from SDL_ttf
2.0.18), and additionally TTF_RenderGlyph32_LCD (from SDL_ttf 2.20) to render a glyph in the
Font
|
render
(text, foreground, background, quality, wrapLength)
|
Wraps TTF_RenderUTF8_Solid , TTF_RenderUTF8_Shaded , TTF_RenderUTF8_Blended , and additionally
TTF_RenderUTF8_LCD (from SDL_ttf 2.20), as well as TTF_RenderUTF8_Solid_Wrapped ,
TTF_RenderUTF8_Shaded_Wrapped , TTF_RenderUTF8_Blended_Wrapped (from SDL_ttf 2.0.18),
and TTF_RenderUTF8_LCD_Wrapped (from SDL_ttf 2.20) to render a text string in the Font
|
render
(text, foreground, background, quality, wrapLength)
|
Wraps TTF_RenderUNICODE_Solid , TTF_RenderUNICODE_Shaded , TTF_RenderUNICODE_Blended , and additionally
TTF_RenderUNICODE_LCD (from SDL_ttf 2.20), as well as TTF_RenderUNICODE_Solid_Wrapped ,
TTF_RenderUNICODE_Shaded_Wrapped , TTF_RenderUNICODE_Blended_Wrapped (from SDL_ttf 2.0.18),
and TTF_RenderUNICODE_LCD_Wrapped (from SDL_ttf 2.20) to render a text string in the Font
|
textSize
(text)
|
Wraps TTF_SizeUTF8 to get the size of a rendered text in the Font
|
textSize
(text)
|
Wraps TTF_SizeUNICODE to get the size of a rendered text in the Font
|
toHash
()
|
Gets the hash of the Font
|
toString
()
|
Formats the Font into its construction representation: "dsdl2.ttf.Font(<ttfFont>)"
|