google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.87k stars 1.9k forks source link

Have an option to control UI/font size for image_viewer or gltf_viewer #7294

Open z3moon opened 1 year ago

z3moon commented 1 year ago

Is your feature request related to a problem? Please describe. Currently the filament UI doesn't provide options to scale or magnify UI/font.

Describe the solution you'd like I'd like to have control over the size of UI/font for a certain set of sample apps.

romainguy commented 1 year ago

These are just sample/test apps, our goal is not to support them like real apps.

z3moon commented 1 year ago

In ImGuiHelper.cpp, we can pass a different value via io.Fonts->AddFontFromFileTTF(fontPath.c_str(), 16.0f); to change the font.

To do this dynamically, we may want to call ClearFonts() before readd the font again, which might also have to call ClearTexData() and ClearInputData() from ImFontAtlas.