sdl3/sdl_ttf library

Functions

sdlTtfVersionAtleast(int x, int y, int z) bool
const SDL_TTF_VERSION_ATLEAST = (X, Y, Z) \ (SDL_TTF_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z));
ttfAddFallbackFont(Pointer<TtfFont> font, Pointer<TtfFont> fallback) bool ttf
Add a fallback font.
ttfAppendTextString(Pointer<TtfText> text, String? string, int length) bool ttf
Append UTF-8 text to a text object.
ttfClearFallbackFonts(Pointer<TtfFont> font) → void ttf
Remove all fallback fonts.
ttfCloseFont(Pointer<TtfFont> font) → void ttf
Dispose of a previously-created font.
ttfCopyFont(Pointer<TtfFont> existingFont) Pointer<TtfFont> ttf
Create a copy of an existing font.
ttfCreateGpuTextEngine(Pointer<SdlGpuDevice> device) Pointer<TtfTextEngine> ttf
Create a text engine for drawing text with the SDL GPU API.
ttfCreateGpuTextEngineWithProperties(int props) Pointer<TtfTextEngine> ttf
Create a text engine for drawing text with the SDL GPU API, with the specified properties.
ttfCreateRendererTextEngine(Pointer<SdlRenderer> renderer) Pointer<TtfTextEngine> ttf
Create a text engine for drawing text on an SDL renderer.
ttfCreateRendererTextEngineWithProperties(int props) Pointer<TtfTextEngine> ttf
Create a text engine for drawing text on an SDL renderer, with the specified properties.
ttfCreateSurfaceTextEngine() Pointer<TtfTextEngine> ttf
Create a text engine for drawing text on SDL surfaces.
ttfCreateText(Pointer<TtfTextEngine> engine, Pointer<TtfFont> font, String? text, int length) Pointer<TtfText> ttf
Create a text object from UTF-8 text and a text engine.
ttfDeleteTextString(Pointer<TtfText> text, int offset, int length) bool ttf
Delete UTF-8 text from a text object.
ttfDestroyGpuTextEngine(Pointer<TtfTextEngine> engine) → void ttf
Destroy a text engine created for drawing text with the SDL GPU API.
ttfDestroyRendererTextEngine(Pointer<TtfTextEngine> engine) → void ttf
Destroy a text engine created for drawing text on an SDL renderer.
ttfDestroySurfaceTextEngine(Pointer<TtfTextEngine> engine) → void ttf
Destroy a text engine created for drawing text on SDL surfaces.
ttfDestroyText(Pointer<TtfText> text) → void ttf
Destroy a text object created by a text engine.
ttfDrawRendererText(Pointer<TtfText> text, double x, double y) bool ttf
Draw text to an SDL renderer.
ttfDrawSurfaceText(Pointer<TtfText> text, int x, int y, Pointer<SdlSurface> surface) bool ttf
Draw text to an SDL surface.
ttfFontHasGlyph(Pointer<TtfFont> font, int ch) bool ttf
Check whether a glyph is provided by the font for a UNICODE codepoint.
ttfFontIsFixedWidth(Pointer<TtfFont> font) bool ttf
Query whether a font is fixed-width.
ttfFontIsScalable(Pointer<TtfFont> font) bool ttf
Query whether a font is scalable or not.
ttfGetError() String?
const TTF_GetError = SDL_GetError;
ttfGetFontAscent(Pointer<TtfFont> font) int ttf
Query the offset from the baseline to the top of a font.
ttfGetFontCharSpacing(Pointer<TtfFont> font) int ttf
Get the additional character spacing in pixels to be applied between any two rendered characters.
ttfGetFontDescent(Pointer<TtfFont> font) int ttf
Query the offset from the baseline to the bottom of a font.
ttfGetFontDirection(Pointer<TtfFont> font) int ttf
Get the direction to be used for text shaping by a font.
ttfGetFontDpi(Pointer<TtfFont> font, Pointer<Int32> hdpi, Pointer<Int32> vdpi) bool ttf
Get font target resolutions, in dots per inch.
ttfGetFontFamilyName(Pointer<TtfFont> font) String? ttf
Query a font's family name.
ttfGetFontGeneration(Pointer<TtfFont> font) int ttf
Get the font generation.
ttfGetFontHeight(Pointer<TtfFont> font) int ttf
Query the total height of a font.
ttfGetFontHinting(Pointer<TtfFont> font) int ttf
Query a font's current FreeType hinter setting.
ttfGetFontKerning(Pointer<TtfFont> font) bool ttf
Query whether or not kerning is enabled for a font.
ttfGetFontLineSkip(Pointer<TtfFont> font) int ttf
Query the spacing between lines of text for a font.
ttfGetFontOutline(Pointer<TtfFont> font) int ttf
Query a font's current outline.
ttfGetFontProperties(Pointer<TtfFont> font) int ttf
Get the properties associated with a font.
ttfGetFontScript(Pointer<TtfFont> font) int ttf
Get the script used for text shaping a font.
ttfGetFontSdf(Pointer<TtfFont> font) bool ttf
Query whether Signed Distance Field rendering is enabled for a font.
ttfGetFontSize(Pointer<TtfFont> font) double ttf
Get the size of a font.
ttfGetFontStyle(Pointer<TtfFont> font) int ttf
Query a font's current style.
ttfGetFontStyleName(Pointer<TtfFont> font) String? ttf
Query a font's style name.
ttfGetFontWeight(Pointer<TtfFont> font) int ttf
Query a font's weight, in terms of the lightness/heaviness of the strokes.
ttfGetFontWrapAlignment(Pointer<TtfFont> font) int ttf
Query a font's current wrap alignment option.
ttfGetFreeTypeVersion(Pointer<Int32> major, Pointer<Int32> minor, Pointer<Int32> patch) → void ttf
Query the version of the FreeType library in use.
ttfGetGlyphImage(Pointer<TtfFont> font, int ch, Pointer<Int32> imageType) Pointer<SdlSurface> ttf
Get the pixel image for a UNICODE codepoint.
ttfGetGlyphImageForIndex(Pointer<TtfFont> font, int glyphIndex, Pointer<Int32> imageType) Pointer<SdlSurface> ttf
Get the pixel image for a character index.
ttfGetGlyphKerning(Pointer<TtfFont> font, int previousCh, int ch, Pointer<Int32> kerning) bool ttf
Query the kerning size between the glyphs of two UNICODE codepoints.
ttfGetGlyphMetrics(Pointer<TtfFont> font, int ch, Pointer<Int32> minx, Pointer<Int32> maxx, Pointer<Int32> miny, Pointer<Int32> maxy, Pointer<Int32> advance) bool ttf
Query the metrics (dimensions) of a font's glyph for a UNICODE codepoint.
ttfGetGlyphScript(int ch) int ttf
Get the script used by a 32-bit codepoint.
ttfGetGpuTextDrawData(Pointer<TtfText> text) Pointer<TtfGpuAtlasDrawSequence> ttf
Get the geometry data needed for drawing the text.
ttfGetGpuTextEngineWinding(Pointer<TtfTextEngine> engine) int ttf
Get the winding order of the vertices returned by TTF_GetGPUTextDrawData for a particular GPU text engine
ttfGetHarfBuzzVersion(Pointer<Int32> major, Pointer<Int32> minor, Pointer<Int32> patch) → void ttf
Query the version of the HarfBuzz library in use.
ttfGetNextTextSubString(Pointer<TtfText> text, Pointer<TtfSubString> substring, Pointer<TtfSubString> next) bool ttf
Get the next substring in a text object
ttfGetNumFontFaces(Pointer<TtfFont> font) int ttf
Query the number of faces of a font.
ttfGetPreviousTextSubString(Pointer<TtfText> text, Pointer<TtfSubString> substring, Pointer<TtfSubString> previous) bool ttf
Get the previous substring in a text object
ttfGetStringSize(Pointer<TtfFont> font, String? text, int length, Pointer<Int32> w, Pointer<Int32> h) bool ttf
Calculate the dimensions of a rendered string of UTF-8 text.
ttfGetStringSizeWrapped(Pointer<TtfFont> font, String? text, int length, int wrapWidth, Pointer<Int32> w, Pointer<Int32> h) bool ttf
Calculate the dimensions of a rendered string of UTF-8 text.
ttfGetTextColor(Pointer<TtfText> text, Pointer<Uint8> r, Pointer<Uint8> g, Pointer<Uint8> b, Pointer<Uint8> a) bool ttf
Get the color of a text object.
ttfGetTextColorFloat(Pointer<TtfText> text, Pointer<Float> r, Pointer<Float> g, Pointer<Float> b, Pointer<Float> a) bool ttf
Get the color of a text object.
ttfGetTextDirection(Pointer<TtfText> text) int ttf
Get the direction to be used for text shaping a text object.
ttfGetTextEngine(Pointer<TtfText> text) Pointer<TtfTextEngine> ttf
Get the text engine used by a text object.
ttfGetTextFont(Pointer<TtfText> text) Pointer<TtfFont> ttf
Get the font used by a text object.
ttfGetTextPosition(Pointer<TtfText> text, Pointer<Int32> x, Pointer<Int32> y) bool ttf
Get the position of a text object.
ttfGetTextProperties(Pointer<TtfText> text) int ttf
Get the properties associated with a text object.
ttfGetTextScript(Pointer<TtfText> text) int ttf
Get the script used for text shaping a text object.
ttfGetTextSize(Pointer<TtfText> text, Pointer<Int32> w, Pointer<Int32> h) bool ttf
Get the size of a text object.
ttfGetTextSubString(Pointer<TtfText> text, int offset, Pointer<TtfSubString> substring) bool ttf
Get the substring of a text object that surrounds a text offset.
ttfGetTextSubStringForLine(Pointer<TtfText> text, int line, Pointer<TtfSubString> substring) bool ttf
Get the substring of a text object that contains the given line.
ttfGetTextSubStringForPoint(Pointer<TtfText> text, int x, int y, Pointer<TtfSubString> substring) bool ttf
Get the portion of a text string that is closest to a point.
ttfGetTextSubStringsForRange(Pointer<TtfText> text, int offset, int length, Pointer<Int32> count) Pointer<Pointer<TtfSubString>> ttf
Get the substrings of a text object that contain a range of text.
ttfGetTextWrapWidth(Pointer<TtfText> text, Pointer<Int32> wrapWidth) bool ttf
Get whether wrapping is enabled on a text object.
ttfInit() bool ttf
Initialize SDL_ttf.
ttfInsertTextString(Pointer<TtfText> text, int offset, String? string, int length) bool ttf
Insert UTF-8 text into a text object.
ttfMeasureString(Pointer<TtfFont> font, String? text, int length, int maxWidth, Pointer<Int32> measuredWidth, Pointer<Uint32> measuredLength) bool ttf
Calculate how much of a UTF-8 string will fit in a given width.
ttfOpenFont(String? file, double ptsize) Pointer<TtfFont> ttf
Create a font from a file, using a specified point size.
ttfOpenFontIo(Pointer<SdlIoStream> src, bool closeio, double ptsize) Pointer<TtfFont> ttf
Create a font from an SDL_IOStream, using a specified point size.
ttfOpenFontWithProperties(int props) Pointer<TtfFont> ttf
Create a font with the specified properties.
ttfQuit() → void ttf
Deinitialize SDL_ttf.
ttfRemoveFallbackFont(Pointer<TtfFont> font, Pointer<TtfFont> fallback) → void ttf
Remove a fallback font.
ttfRenderGlyphBlended(Pointer<TtfFont> font, int ch, SdlColor fg) Pointer<SdlSurface> ttf
Render a single UNICODE codepoint at high quality to a new ARGB surface.
ttfRenderGlyphLcd(Pointer<TtfFont> font, int ch, SdlColor fg, SdlColor bg) Pointer<SdlSurface> ttf
Render a single UNICODE codepoint at LCD subpixel quality to a new ARGB surface.
ttfRenderGlyphShaded(Pointer<TtfFont> font, int ch, SdlColor fg, SdlColor bg) Pointer<SdlSurface> ttf
Render a single UNICODE codepoint at high quality to a new 8-bit surface.
ttfRenderGlyphSolid(Pointer<TtfFont> font, int ch, SdlColor fg) Pointer<SdlSurface> ttf
Render a single 32-bit glyph at fast quality to a new 8-bit surface.
ttfRenderTextBlended(Pointer<TtfFont> font, String? text, int length, SdlColor fg) Pointer<SdlSurface> ttf
Render UTF-8 text at high quality to a new ARGB surface.
ttfRenderTextBlendedWrapped(Pointer<TtfFont> font, String? text, int length, SdlColor fg, int wrapWidth) Pointer<SdlSurface> ttf
Render word-wrapped UTF-8 text at high quality to a new ARGB surface.
ttfRenderTextLcd(Pointer<TtfFont> font, String? text, int length, SdlColor fg, SdlColor bg) Pointer<SdlSurface> ttf
Render UTF-8 text at LCD subpixel quality to a new ARGB surface.
ttfRenderTextLcdWrapped(Pointer<TtfFont> font, String? text, int length, SdlColor fg, SdlColor bg, int wrapWidth) Pointer<SdlSurface> ttf
Render word-wrapped UTF-8 text at LCD subpixel quality to a new ARGB surface.
ttfRenderTextShaded(Pointer<TtfFont> font, String? text, int length, SdlColor fg, SdlColor bg) Pointer<SdlSurface> ttf
Render UTF-8 text at high quality to a new 8-bit surface.
ttfRenderTextShadedWrapped(Pointer<TtfFont> font, String? text, int length, SdlColor fg, SdlColor bg, int wrapWidth) Pointer<SdlSurface> ttf
Render word-wrapped UTF-8 text at high quality to a new 8-bit surface.
ttfRenderTextSolid(Pointer<TtfFont> font, String? text, int length, SdlColor fg) Pointer<SdlSurface> ttf
Render UTF-8 text at fast quality to a new 8-bit surface.
ttfRenderTextSolidWrapped(Pointer<TtfFont> font, String? text, int length, SdlColor fg, int wrapLength) Pointer<SdlSurface> ttf
Render word-wrapped UTF-8 text at fast quality to a new 8-bit surface.
ttfSetError(String fmt) bool
// c // const TTF_RenderText = (font, text, fg, bg) \ TTF_RenderText_Shaded(font, text, fg, bg); // // c // const TTF_RenderUTF8 = (font, text, fg, bg) \ TTF_RenderUTF8_Shaded(font, text, fg, bg); // // c // const TTF_RenderUNICODE = (font, text, fg, bg) \ TTF_RenderUNICODE_Shaded(font, text, fg, bg); // ```
ttfSetFontCharSpacing(Pointer<TtfFont> font, int spacing) bool ttf
Set additional space in pixels to be applied between any two rendered characters.
ttfSetFontDirection(Pointer<TtfFont> font, int direction) bool ttf
Set the direction to be used for text shaping by a font.
ttfSetFontHinting(Pointer<TtfFont> font, int hinting) → void ttf
Set a font's current hinter setting.
ttfSetFontKerning(Pointer<TtfFont> font, bool enabled) → void ttf
Set if kerning is enabled for a font.
ttfSetFontLanguage(Pointer<TtfFont> font, String? languageBcp47) bool ttf
Set language to be used for text shaping by a font.
ttfSetFontLineSkip(Pointer<TtfFont> font, int lineskip) → void ttf
Set the spacing between lines of text for a font.
ttfSetFontOutline(Pointer<TtfFont> font, int outline) bool ttf
Set a font's current outline.
ttfSetFontScript(Pointer<TtfFont> font, int script) bool ttf
Set the script to be used for text shaping by a font.
ttfSetFontSdf(Pointer<TtfFont> font, bool enabled) bool ttf
Enable Signed Distance Field rendering for a font.
ttfSetFontSize(Pointer<TtfFont> font, double ptsize) bool ttf
Set a font's size dynamically.
ttfSetFontSizeDpi(Pointer<TtfFont> font, double ptsize, int hdpi, int vdpi) bool ttf
Set font size dynamically with target resolutions, in dots per inch.
ttfSetFontStyle(Pointer<TtfFont> font, int style) → void ttf
Set a font's current style.
ttfSetFontWrapAlignment(Pointer<TtfFont> font, int align) → void ttf
Set a font's current wrap alignment option.
ttfSetGpuTextEngineWinding(Pointer<TtfTextEngine> engine, int winding) → void ttf
Sets the winding order of the vertices returned by TTF_GetGPUTextDrawData for a particular GPU text engine.
ttfSetTextColor(Pointer<TtfText> text, int r, int g, int b, int a) bool ttf
Set the color of a text object.
ttfSetTextColorFloat(Pointer<TtfText> text, double r, double g, double b, double a) bool ttf
Set the color of a text object.
ttfSetTextDirection(Pointer<TtfText> text, int direction) bool ttf
Set the direction to be used for text shaping a text object.
ttfSetTextEngine(Pointer<TtfText> text, Pointer<TtfTextEngine> engine) bool ttf
Set the text engine used by a text object.
ttfSetTextFont(Pointer<TtfText> text, Pointer<TtfFont> font) bool ttf
Set the font used by a text object.
ttfSetTextPosition(Pointer<TtfText> text, int x, int y) bool ttf
Set the position of a text object.
ttfSetTextScript(Pointer<TtfText> text, int script) bool ttf
Set the script to be used for text shaping a text object.
ttfSetTextString(Pointer<TtfText> text, String? string, int length) bool ttf
Set the UTF-8 text used by a text object.
ttfSetTextWrapWhitespaceVisible(Pointer<TtfText> text, bool visible) bool ttf
Set whether whitespace should be visible when wrapping a text object.
ttfSetTextWrapWidth(Pointer<TtfText> text, int wrapWidth) bool ttf
Set whether wrapping is enabled on a text object.
ttfStringToTag(String? string) int ttf
Convert from a 4 character string to a 32-bit tag.
ttfTagToString(int tag, Pointer<Int8> string, int size) → void ttf
Convert from a 32-bit tag to a 4 character string.
ttfTextWrapWhitespaceVisible(Pointer<TtfText> text) bool ttf
Return whether whitespace is shown when wrapping a text object.
ttfUpdateText(Pointer<TtfText> text) bool ttf
Update the layout of a text object.
ttfVersion() int ttf
This function gets the version of the dynamically linked SDL_ttf library.
ttfWasInit() int ttf
Check if SDL_ttf is initialized.