Skip to content

Feat: register custom font for Dear ImGui #977

@MeowKatee

Description

@MeowKatee

Purpose

I want to include CJK characters in my figure name

Image

The text inside control UI menu was messed up

Current workaround

I did set font for pygfx to enforce it render CJK with a local font file

from pygfx.utils.text import font_manager, FontProps

font = font_manager.add_font_file(
    "fonts/fusion-pixel-12px-proportional-zh_hans.ttf"
)
font_manager._default_font_props = FontProps(
    font.family,
    style="normal",
    weight="regular",
)

But looking into the source code, I think I cannot set default font for ImGui similarly, it must be passed to Figure.__init__

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions