core-foundation-rs
core-foundation-rs copied to clipboard
fix: new_from_descriptor lose font variations, such as font-weight
If we create CTFont
from font descriptor, we will lose font variations, and use new_from_name
instead will fix it.
CTFontDescriptor is essentially a dictionary of font attributes.
Can you add a test?
@jrmuizel I have to add CTFontManagerCreateFontDescriptorsFromData
, because it happens when loading font from 'otc/ttc'.
I encountered the issue when using font-kit, font-kit manually unpack 'otc/ttc', I suppose it won't make any difference here.
The test failed on xcode 7.3/9.2 and passed others.
I also add an api called new_from_arc_buffer
, so maybe font-kit
can benefit from it : )
:umbrella: The latest upstream changes (presumably #485) made this pull request unmergeable. Please resolve the merge conflicts.