API 参考
正在准备搜索索引…

ImGui.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF

  • 从 Base85 编码的压缩 TrueType 数据添加字体。

    参数

    self

    此方法操作的 ImFontAtlas 句柄。

    compressed_font_data_base85
    string | Uint8Array

    以 NUL 结尾、编码 stb 压缩字体数据的 Base85 文本。

    size_pixels
    number

    请求的字体像素高度。

    font_cfg
    null | ImFontConfig = null

    字体加载配置;可选版本接受 null 使用默认值,所有权和合并设置会影响字体数据的保留方式。

    glyph_ranges
    null | Uint16Array = null

    包含首尾的 [first, last] 范围对 Uint16Array,末尾须加 0。getGlyphRanges* 不含终止零值, 须用 new Uint16Array([...getGlyphRangesDefault(atlas), 0]) 显式补上。 图集构建前须保持输入有效;null 选择默认范围。

    返回值

    null | ImFont

    图集拥有的字体句柄,合并模式下为目标字体。图集构建后字形才可用;无效输入可能触发原生断言。

    'compressed_font_data_base85' 仍由调用方持有。

    使用 binary_to_compressed_c.cpp 并传入 -base85 参数压缩。

    源码与继承

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