You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Local glyph generation should include support for fallback fonts. A developer should be able to pass in an array of fonts should they choose to set the font(s) for local glyph generation.
In #10522 we added support in core for using locally-generated glyphs. Per @tobrun, the core implementation accepts a single string and needs to be modified to accept an array of fonts in order to support fallbacks. cc/ @tmpsantos
I noticed that iOS is handling this differently, they check the font array on the binding side and pass only 1 value to core. I believe that handling this on core side would align it more with the other APIs we have that use fonts (eg text-font)
@tobrun, I believe the way iOS handles fallback fonts for localIdeographFontFamily matches the implementation they use for passing in fonts for all text, including text-font.
Theoretically speaking, is a comparable approach possible on Android, if we wanted to refactor the way that Android passes fonts to core? I'm not sure whether it'd be desirable or whether we've previously had a conversation about the pros/cons of both approaches. cc @1ec5
@tmpsantos, how big is the change needed in core to support this? it would be extremely valuable to get this into release-picklejuice so that Android gets to parity with iOS
Capturing from chat between @tmpsantos, @alexshalamov and me. We are going to add same logic as iOS. Note however that on Android this kind of a hack as we on one end don't have a clear Android API to retrieve system fonts. We can't try/catch creating fonts from names as these factory methods always return non-null even if the font is unusable.
I initially thought it would be a bit more easy for going with the core heavy implementation but that would result in going back and forth between core and the SDK. Having #15255 is much simpler and matches iOS setup.
Activity
chloekraw commentedon Jun 17, 2019
In #10522 we added support in core for using locally-generated glyphs. Per @tobrun, the core implementation accepts a single string and needs to be modified to accept an array of fonts in order to support fallbacks. cc/ @tmpsantos
tobrun commentedon Jun 24, 2019
I noticed that iOS is handling this differently, they check the font array on the binding side and pass only 1 value to core. I believe that handling this on core side would align it more with the other APIs we have that use fonts (eg text-font)
chloekraw commentedon Jun 25, 2019
@tobrun, I believe the way iOS handles fallback fonts for
localIdeographFontFamilymatches the implementation they use for passing in fonts for all text, includingtext-font.Theoretically speaking, is a comparable approach possible on Android, if we wanted to refactor the way that Android passes fonts to core? I'm not sure whether it'd be desirable or whether we've previously had a conversation about the pros/cons of both approaches. cc @1ec5
chloekraw commentedon Jul 10, 2019
@tmpsantos, how big is the change needed in core to support this? it would be extremely valuable to get this into
release-picklejuiceso that Android gets to parity with iOStmpsantos commentedon Jul 19, 2019
Not big, most of the work here is writing render/unit tests.
tobrun commentedon Jul 30, 2019
Capturing from chat between @tmpsantos, @alexshalamov and me. We are going to add same logic as iOS. Note however that on Android this kind of a hack as we on one end don't have a clear Android API to retrieve system fonts. We can't try/catch creating fonts from names as these factory methods always return non-null even if the font is unusable.
chloekraw commentedon Jul 30, 2019
@tobrun thank you for the update! Could you explain why this decision was made? Is there a technical blocker with implementing this in core?
I want to make sure we're fully considering the implications of this decision and alternatives before proceeding.
cc @zugaldia
tobrun commentedon Jul 31, 2019
I initially thought it would be a bit more easy for going with the core heavy implementation but that would result in going back and forth between core and the SDK. Having #15255 is much simpler and matches iOS setup.
chloekraw commentedon Jul 31, 2019
@tobrun ok, sounds good!
chloekraw commentedon Aug 12, 2019
Closed by #15255