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