Make FreeType select a size for fixed sized fonts#9012
Make FreeType select a size for fixed sized fonts#9012Green-Sky wants to merge 7 commits intoocornut:masterfrom
Conversation
8f1ace7 to
3ec8f95
Compare
|
I know this is unfinished but please make sure you follow the local coding style (brace placement, c-style cast, uppercase first letter in comment, etc.) as this really facilitate me looking at PRs. Thank you. |
Ofc, I will do that. I am used to telling others the same thing. :)
So I should use |
Yes! Thank you! |
8ba0592 to
f8e941e
Compare
|
I have now also added downscaling using Point Sampling / Nearest Neighbor. Any TODOs left in the code now need to be resolved, before this pr is ready. Feel free to address them. The biggest TODO is https://en.wikipedia.org/wiki/Image_scaling#Box_sampling . The placement sometimes seems odd, especially mixing fonts, but I guess that relates to #8857 , which I have not yet reviewed/tested this code with. There will probably be light conflicts. edit: I also updated the images in the OP. |
|
Downscaling should use bilinear filtering, should be done using its own dedicated function. It doesn't need to be fancy/optimized. |
No, bilinear looks bad when downscaling. (see https://stackoverflow.com/a/49883346 ) |
|
|
I've been looking for this! |
and scale it down before adding it to atlas to save on atlas space.
Looks more correct and more in line with other parts of the code.
08fa252 to
0fb0054
Compare
|
Thanks for maintaining list. I don't know when I will have time to look at that but I'm hoping to nail most font-related changes before reaching 1.93.0. |
|
Naturally, I have been testing my code ever since. I also found, and forgot to report, blenders scaling decisions:
With the usecase I have with mostly oversized emojies, often larger than 2x the desired resolution, they also chose boxsampling. But it is not perfect for all scenarios, but having just boxsampling, should be the simplest and cover our downsampling needs. |
|
|
We are treating the memory allocated by edit: |
It is true. Dear ImGui won't work on 16-bit platforms anyhow. |


















This PR implements:
This enables imgui+freetype to just use the system provided emojie fonts. (NotoColorEmoji and AppleColorEmoji)
TODO:
This should make CBDT fonts like NotoColorEmoji and AppleColorEmoji play nice. Bitmap fonts are often preferred by distributors over COLRv1, because they are more universally supported, while also being smaller than SVGinOT fonts.
see #6302
built-in font + system provided NotoColorEmoji (109px) at font size 13:
built-in font + system provided NotoColorEmoji (109px) at font size 26:
Old images
built-in font + system provided NotoColorEmoji (109px) at font size 13:
built-in font + system provided NotoColorEmoji (109px) at font size 26:
Old Old images
built-in font + system provided NotoColorEmoji (109px) at font size 13:
built-in font + system provided NotoColorEmoji (109px) at font size 26: