linebender / parley

Rich text layout library
Apache License 2.0
209 stars 24 forks source link

Add support for language/script fallback with a specific GenericFamily if available. #30

Open xorgy opened 5 months ago

xorgy commented 5 months ago

It is typical for a font stack to include a GenericFamily. Android and CoreText both have information about ‘UI’ type fonts in fallback, differentiated from general text fonts; and Android has support for setting fallback families for generic familes. We should be able to support preferentially matching system-ui to variant="compact" when available on Android, and matching serif (or ui-serif) to fallback fonts with fallbackFor="serif".

This information probably belongs in FallbackKey but it would need to be wired through the style resolver.