API reference
Preparing search index…

ImGui.ImFontAtlas_AddFontFromFileTTF

  • Load a TTF or OTF font file and register it for atlas building.

    Parameters

    self

    ImFontAtlas handle on which this method operates.

    filename
    string | Uint8Array

    Filesystem path of the TTF/OTF font file.

    size_pixels
    number

    Requested font height in pixels.

    font_cfg
    null | ImFontConfig = null

    Font-loading configuration; optional variants accept null for defaults. Ownership and merge settings affect how font data is retained.

    glyph_ranges
    null | Uint16Array = null

    Uint16Array of inclusive [first, last] pairs followed by 0. getGlyphRanges* helpers omit that terminator: append it explicitly with new Uint16Array([...getGlyphRangesDefault(atlas), 0]). Keep this input alive until atlas build; null selects default ranges.

    Returns

    null | ImFont

    Atlas-owned font handle, or null if the font file cannot be loaded. Glyphs become available after atlas building.

    Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0