-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Chinese font problem #1434
Comments
The font file is 9 MB. Which is compressed. To make efficient use out of the font it needs to be decompressed. IMO it is not unsurprising that a font file converted to usable data structure explodes 30-fold especially when the render method is bitmap based. |
With the current system of baking full ranges into a texture atlas, if I load a test font at 18 px size with full Chinese range + default oversampling setting, I get a 4096x4096 texture. You can see it in the Demo Window under Windows Options > Font. A 4096x4096 texture in RGBA with will be 64 MB of RAM + Alpha texture currently stays stored that's 16 MB. Total 80 MB. It's way too much but it's not 300 MB. The four solutions are:
Texture becomes 4096x1024 so 4 MB alpha and 16 MB RGBA.
|
@ocornut i use 1nd solution, thanks for answers |
@ratchetfreak how to do i uncompress it? |
@jingjinghack that's what AddFontFromFileTTF does, it decompresses the file into a usable format and then adds the required data structures to the text renderer. |
FYI, work on |
This takes up a lot of memory(300MB)

it just a font...
The text was updated successfully, but these errors were encountered: