pop-os / cosmic-text

Pure Rust multi-line text handling
https://pop-os.github.io/cosmic-text/cosmic_text/
Apache License 2.0
1.62k stars 107 forks source link

Font Fallback Regression with Thaana script #277

Open CryZe opened 5 months ago

CryZe commented 5 months ago

When upgrading from 0.10 to 0.12, I noticed that the fallback for text written in the Thaana script like "ދިވެހި" stopped working. On Windows the fallback is configured to be "MV Boli", but starting with 0.11.0 the font fallback algorithm seems to have changed and the "MV Boli" font now gets rejected because it's an italic font, which does not match the font style of the surrounding text, which is not italic.

Update 1: What may or may not be a problem is that the font itself considers itself to be of "Regular" style in the OS/2 table, but there's a non-zero italic angle, so fontdb considers it italic anyway:

https://github.com/RazrFalcon/fontdb/blob/fd24f8c9d7b57f30a6f6ba560c697a7854c94858/src/lib.rs#L959-L963

Update 2: The change in fontdb got added in 0.16.1, which was not used by cosmic-text until its 0.11.0, so this may have never been a font fallback algorithm change on cosmic-text's side.

jackpot51 commented 3 months ago

This may be resolved by 0.12.1

CryZe commented 3 months ago

It is not