-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[android] POC: implementation of LocalGlyphRasterizer #10608
Conversation
… drawn area, better align to baseline. Includes code to extract glyph metrics, but the results don't match anything I'd expect so I'm not using them.
…izer. Thin C++ wrappers on C calls.
… set, it doesn't rasterize glyphs locally.
…y" string, plumb it out as far as the Renderer constructor.
Add pragma once Move instantiations of CFHandle down to where they're used (although a few are duplicated).
In my tests so far, I have yet to get CoreText to render anything differently based on the font weight changes.
🔥 |
@ChrisLoer this is looking amazing, thank you for running with it.
Per chat with @ivovandongen, he can give the current approach a pass next week (if he still has the bandwidth). cc: @LukasPaczos fyi. |
Add support for "bold" font stacks Somewhat rationalize class names, add comments.
OK, latest implementation has support for "Bold" (as far as I know, |
a7e5181
to
a648a9b
Compare
I believe that the direction translation would be adding a new key to the Android Manifest file, but I think that in this case it'd be better to introduce instead an XML attribute that could look something like:
This'd also be exposed through the |
@zugaldia Sorry, I think I introduced some confusion talking about two separate issues in that comment. We derive the font weight from the font stack that's being used, so it doesn't need to be part of the manifest (although this is a hack, and a per layer configuration might be better). The second part of my comment was about choosing the font family to use locally (i.e. the main entry point for turning this feature on). I squashed/re-wrote #10522 and as part of that cherry picked these changes onto the new base -- we can continue discussion on that PR (and try to keep Android and iOS in sync). |
This is an initial implementation of local glyph CJK glyph generation for Android. The namespaces/class names are weird because this is my first time using the JNI and I was figuring everything out through aggressive copy-pasting. 😅
Basic rendering seems to work, although the glyph metrics could use some tweaking.
TODOs:
My biggest concern is that the glyphs do not look as good as they do on the iOS/macOS side. Since we're pretty sure that's not TinySDF's fault, I'll try looking into whether it's something in the "Noto Sans" that's getting loaded, or maybe there's some kind of lossy down-sampling in drawing to a 35x35px bitmap?
Android using "Noto Sans":

vs. mbgl-glfw using "Noto Sans":

/cc @zugaldia @tobrun @ivovandongen @chriswu42 @lilykaiser