Skip to content

can be auto-load all fonts from OS installed? #4800

@ccpwcn

Description

@ccpwcn

When written a bigger than normal application (like hello word), I need copy a or more(in more cases, need copy more) font file into project directory, then, application need to be published with the font file, that's more large.
开发一个稍等大一点的应用程序(至少比hello world的demo要大的时候),通常需要一个或多个字体文件,如果把字体文件打到包中或者随包发行,只会让应用程序更大,这不太友好。

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

If the framework can auto-load all fonts from OS, include non-english fonts, in most instances, application will be running nice.
note: The non-english charactors must be show normal, It can't be garbled.
如果框架能自动从操作系统加载已经安装的字体文件,那就会运行起来很好,因为这样开发者可以使用各操作系统中自带的字体直接使用而不必自己拷贝字体文件到代码工程中去。
特别需要注意的是: 非英文字符必须得正常展示,不能是乱码,不支持非英文语言UI,这真的是太糟糕了。

Describe alternatives you've considered

Additional context

Activity

YgorSouza

YgorSouza commented on Jul 8, 2024

@YgorSouza
Contributor

The fontdb crate lets you scan the installed system fonts, which you should be able to add to egui like in the custom_font example. I haven't tried that, though.

emilk

emilk commented on Jul 8, 2024

@emilk
Owner

There's nothing built-in to egui for loading fonts from the OS, but once we switch to Cosmic Text it should be a lot easier:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @emilk@ccpwcn@YgorSouza

        Issue actions

          can be auto-load all fonts from OS installed? · Issue #4800 · emilk/egui