Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't display text with big font size #7766

Closed
xingyun86 opened this issue Jul 4, 2024 · 5 comments
Closed

Can't display text with big font size #7766

xingyun86 opened this issue Jul 4, 2024 · 5 comments

Comments

@xingyun86
Copy link

Version/Branch of Dear ImGui:

Version 1.90.9, Branch: all (master/docking/etc.)

Back-ends:

imgui_impl_all.cpp + imgui_impl_all.cpp

Compiler, OS:

windows 10 + msvc

Full config/build information:

cmake build

Details:

My Issue/Question:

//set font size to 88 or great size
ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 88.0f, nullptr, io.Fonts->GetGlyphRangesChineseFull());

Screenshots/Video:

图片

Minimal, Complete and Verifiable Example code:

//set font size to 88 or great size
ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 88.0f, nullptr, io.Fonts->GetGlyphRangesChineseFull());
@ocornut
Copy link
Owner

ocornut commented Jul 4, 2024

See https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#4-font-atlas-texture-fails-to-upload-to-gpu

With the current system it is unlikely you can use GetGlyphRangesChineseFull() with such a big size. See link above for workarounds.

@xingyun86
Copy link
Author

See https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#4-font-atlas-texture-fails-to-upload-to-gpu

With the current system it is unlikely you can use GetGlyphRangesChineseFull() with such a big size. See link above for workarounds.

When I use freetype2.xx, 360 or greater font size also ok!. But I don't know how replace it with freetype in imgui.

@xingyun86
Copy link
Author

See https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#4-font-atlas-texture-fails-to-upload-to-gpu
With the current system it is unlikely you can use GetGlyphRangesChineseFull() with such a big size. See link above for workarounds.

When I use freetype2.xx, 360 or greater font size also ok!. But I don't know how replace it with freetype in imgui.

Ok. I did it now. Use freetype. Thanks a lot!

@xingyun86
Copy link
Author

See https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#4-font-atlas-texture-fails-to-upload-to-gpu
With the current system it is unlikely you can use GetGlyphRangesChineseFull() with such a big size. See link above for workarounds.

When I use freetype2.xx, 360 or greater font size also ok!. But I don't know how replace it with freetype in imgui.

Ok. I did it now. Use freetype. Thanks a lot!
image

@xingyun86
Copy link
Author

See https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#4-font-atlas-texture-fails-to-upload-to-gpu

With the current system it is unlikely you can use GetGlyphRangesChineseFull() with such a big size. See link above for workarounds.

I think font control: When I draw string, alloc texture with string。Now when I add ttf, and Imgui create all texture。But I real use
a little。

@ocornut ocornut closed this as completed Jul 8, 2024
@ocornut ocornut changed the title Cann't display text with big font size Can't display text with big font size Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants