-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Make FontData importable resource. Add multi-channel SDF font rendering. #51908
Conversation
I would probably rename the image font importer to clearly denote that it supports fixed-width fonts only. For instance, this could be done by changing its visible name to Font Data (Image, Fixed Width Only). |
Using a rich text node and a font corrupts the tscn on load. The rich text is below.
|
Update:
Demo (includes imported font data): |
Note: overlapping outlines is an unrelated regression, and is fixed by #52012 |
af9dc88
to
3cf096c
Compare
The main crash I was hitting is fixed now.! I took a .ttf and tried messing with the import settings to see what would happen but I ran into a crash. Steps to reproduce: I understand this probably wasn't how it was intended to be used, but I didn't know how to use it so I assumed "en" was the name of a language.
I also tried Advanced... but the languages section doesn't seem to work (I can add languages, checked or unchecked, but after clicking Reimport they get forgotten)
Suffice it to say that the import UI probably needs a bit of work. but that needs to be a separate PR. I'd love to see this one get merged. |
b88d8a8
to
72e666d
Compare
2a39857
to
c20c00a
Compare
Update: Added some improvements to the BMFont importer:
Test project: bmfont_test.zip (include BMFont source config files). |
Adds multi-channel SDF font texture generation and rendering support. Adds per-font oversampling support. Adds FontData import plugins (for dynamic fonts, BMFonts and monospaced image fonts), font texture cache pre-generation and loading. Adds BMFont binary format and outline support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The msdf feature is great from a design standpoint.
The last concern was from reduz about the non-resource binary but that was resolved.
This pr is getting bigger, is it possible merge this and add future work in new prs?
@@ -377,6 +377,11 @@ Comment: YUV2RGB | |||
Copyright: 2008-2011, Robin Watts | |||
License: BSD-2-clause | |||
|
|||
Files: ./thirdparty/msdfgen/ | |||
Comment: Multi-channel signed distance field generator | |||
Copyright: 2016, Viktor Chlumsky |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the year correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it is in the upstream license - https://github.com/Chlumsky/msdfgen/blob/d07fa1d2c8088f87463182a05cab9bee29844e70/LICENSE.txt#L3
Thanks! |
amazing work. thx so much for this! |
@DrCanvas It's surely a bug. Could you create a new issue and upload a minimal reproduction project that includes the font? If the font's license does not allow redistribution, you can try reproducing this with another font. |
Can you double or triple your MSDF pixel range? |
It's most likely an issue with the specific font. msdfgen is not good with handling self intersecting shapes when it's built without Skia (Skia is huge, and probably won't be integrated into Godot unless it's used for much more stuff than just MSDF generation), see Chlumsky/msdfgen#110. |
Should be fixed by #52292 |
[TextServer] Fix regression from #51908, HarfBuzz handle init and MinGW build.
Make
FontData
importable resource.Add multi-channel(+ true) SDF font texture generation and rendering support.
Add
FontData
import plugins, font texture cache pre-generation and loading.Supersede #44772
Screen.Recording.2021-08-23.at.18.40.11.mov
ThreadWorkPool
instead of OpenMP), it's still too slow to use without pre-rendering.FontData
is stored as normal resource.FontData
from scripts.FontData
resource):Sample of generated M(T)SDF texture (source size = 40, pixel range = 8):
![DroidSansJapanese2 ttf-90b7fe9422b191f0409ec9ac1f23ab2e_0_40_0_0](https://user-images.githubusercontent.com/7645683/130621903-8dfd51a7-7541-40c5-875e-e8975e88743f.png)