Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios, macos] Use constant for 1 em
Browse files Browse the repository at this point in the history
  • Loading branch information
1ec5 committed Apr 20, 2020
1 parent dfc4b15 commit e473571
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions platform/darwin/src/local_glyph_rasterizer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ CTFontDescriptorRef createFontDescriptor(const FontStack& fontStack) {
CFMutableArrayRefHandle fontDescriptors(CFArrayCreateMutable(kCFAllocatorDefault, fontNames.count, &kCFTypeArrayCallBacks));
for (NSString *name in fontNames) {
NSDictionary *fontAttributes = @{
(NSString *)kCTFontSizeAttribute: @(24.0),
(NSString *)kCTFontSizeAttribute: @(util::ONE_EM),
(NSString *)kCTFontNameAttribute: name,
(NSString *)kCTFontDisplayNameAttribute: name,
(NSString *)kCTFontFamilyNameAttribute: name,
Expand All @@ -89,8 +89,8 @@ CTFontDescriptorRef createFontDescriptor(const FontStack& fontStack) {
CFArrayAppendValue(*fontDescriptors, *descriptor);
}

CFStringRef keys[] = { kCTFontSizeAttribute, kCTFontCascadeListAttribute };
CFTypeRef values[] = { (__bridge CFNumberRef)@(24.0), *fontDescriptors };
CFStringRef keys[] = { kCTFontSizeAttribute, kCTFontCascadeListAttribute };
CFTypeRef values[] = { (__bridge CFNumberRef)@(util::ONE_EM), *fontDescriptors };

CFDictionaryRefHandle attributes(
CFDictionaryCreate(kCFAllocatorDefault, (const void**)&keys,
Expand Down

0 comments on commit e473571

Please sign in to comment.