Commit 3a99957
committed
fonts: fix CJK fallback font loading
Clearing font charset restrictions by copying a font descriptor's attributes and re-creating it sometimes doesn't work; with 'PingFang SC Regular' (derived from '.AppleSystemUIFontMonospaced' in `CoreText.discoverCodepoint(...)`), `face.hasCodepoint(cp, p_mode)` will erroneously return false after copying, causing the font to be rejected.
We should only be clearing charset restrictions if we applied them first (ie in `CoreText.discover(...)`); doing so lets us avoid this bug, but I'm not sure how fragile the charset restriction clearing is for other scenarios.1 parent e7c1b4d commit 3a99957
1 file changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| 375 | + | |
375 | 376 | | |
376 | 377 | | |
377 | 378 | | |
| |||
409 | 410 | | |
410 | 411 | | |
411 | 412 | | |
| 413 | + | |
412 | 414 | | |
413 | 415 | | |
414 | 416 | | |
| |||
433 | 435 | | |
434 | 436 | | |
435 | 437 | | |
| 438 | + | |
436 | 439 | | |
437 | 440 | | |
438 | 441 | | |
| |||
828 | 831 | | |
829 | 832 | | |
830 | 833 | | |
| 834 | + | |
| 835 | + | |
831 | 836 | | |
832 | 837 | | |
833 | 838 | | |
| |||
849 | 854 | | |
850 | 855 | | |
851 | 856 | | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
852 | 861 | | |
853 | 862 | | |
854 | 863 | | |
| |||
0 commit comments