diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc index 31aa00a1110..8885cfe7304 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc @@ -111,7 +111,7 @@ static void release_data (void *info, const void *data, size_t size) { assert (hb_blob_get_length ((hb_blob_t *) info) == size && - hb_blob_get_data ((hb_blob_t *) info, nullptr) == data); + hb_blob_get_data ((hb_blob_t *) info, nullptr) == data); hb_blob_destroy ((hb_blob_t *) info); } @@ -233,21 +233,21 @@ create_ct_font (CGFontRef cg_font, CGFloat font_size) atsFont = CTFontGetPlatformFont (new_ct_font, NULL); status = ATSFontGetFileReference (atsFont, &fsref); if (status == noErr) - new_url = CFURLCreateFromFSRef (NULL, &fsref); + new_url = CFURLCreateFromFSRef (NULL, &fsref); #else new_url = (CFURLRef) CTFontCopyAttribute (new_ct_font, kCTFontURLAttribute); #endif // Keep reconfigured font if URL cannot be retrieved (seems to be the case // on Mac OS 10.12 Sierra), speculative fix for crbug.com/625606 if (!original_url || !new_url || CFEqual (original_url, new_url)) { - CFRelease (ct_font); - ct_font = new_ct_font; + CFRelease (ct_font); + ct_font = new_ct_font; } else { - CFRelease (new_ct_font); - DEBUG_MSG (CORETEXT, ct_font, "Discarding reconfigured CTFont, location changed."); + CFRelease (new_ct_font); + DEBUG_MSG (CORETEXT, ct_font, "Discarding reconfigured CTFont, location changed."); } if (new_url) - CFRelease (new_url); + CFRelease (new_url); } else DEBUG_MSG (CORETEXT, ct_font, "Font copy with empty cascade list failed"); @@ -302,7 +302,7 @@ _hb_coretext_shaper_font_data_create (hb_font_t *font) if (unlikely (!face_data)) return nullptr; CGFontRef cg_font = (CGFontRef) (const void *) face->data.coretext; - CGFloat font_size = font->ptem <= 0.f ? HB_CORETEXT_DEFAULT_FONT_SIZE : font->ptem; + CGFloat font_size = (CGFloat) (font->ptem <= 0.f ? HB_CORETEXT_DEFAULT_FONT_SIZE : font->ptem); CTFontRef ct_font = create_ct_font (cg_font, font_size); if (unlikely (!ct_font)) @@ -327,7 +327,7 @@ retry: const hb_coretext_font_data_t *data = font->data.coretext; if (unlikely (!data)) return nullptr; - if (fabs (CTFontGetSize ((CTFontRef) data) - font->ptem) > .5) + if (fabs (CTFontGetSize ((CTFontRef) data) - (CGFloat) font->ptem) > .5) { /* XXX-MT-bug * Note that evaluating condition above can be dangerous if another thread @@ -433,9 +433,9 @@ struct range_record_t { hb_bool_t _hb_coretext_shape (hb_shape_plan_t *shape_plan, hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features) + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features) { hb_face_t *face = font->face; CGFontRef cg_font = (CGFontRef) (const void *) face->data.coretext; @@ -477,7 +477,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, { const hb_aat_feature_mapping_t * mapping = hb_aat_layout_find_feature_mapping (features[i].tag); if (!mapping) - continue; + continue; active_feature_t feature; feature.rec.feature = mapping->aatFeatureType; @@ -519,7 +519,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, if (event->index != last_index) { - /* Save a snapshot of active features and the range. */ + /* Save a snapshot of active features and the range. */ range_record_t *range = range_records.push (); if (active_features.length) @@ -580,9 +580,9 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, if (event->start) { - active_features.push (event->feature); + active_features.push (event->feature); } else { - active_feature_t *feature = active_features.find (&event->feature); + active_feature_t *feature = active_features.find (&event->feature); if (feature) active_features.remove (feature - active_features.arrayZ); } @@ -700,15 +700,15 @@ resize_and_retry: #if !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) && MAC_OS_X_VERSION_MIN_REQUIRED < 1090 # define kCTLanguageAttributeName CFSTR ("NSLanguage") #endif - CFStringRef lang = CFStringCreateWithCStringNoCopy (kCFAllocatorDefault, + CFStringRef lang = CFStringCreateWithCStringNoCopy (kCFAllocatorDefault, hb_language_to_string (buffer->props.language), kCFStringEncodingUTF8, kCFAllocatorNull); if (unlikely (!lang)) - { + { CFRelease (attr_string); FAIL ("CFStringCreateWithCStringNoCopy failed"); - } + } CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len), kCTLanguageAttributeName, lang); CFRelease (lang); @@ -757,7 +757,7 @@ resize_and_retry: feature.start < chars_len && feature.start < feature.end) { CFRange feature_range = CFRangeMake (feature.start, - hb_min (feature.end, chars_len) - feature.start); + hb_min (feature.end, chars_len) - feature.start); if (feature.value) CFAttributedStringRemoveAttribute (attr_string, feature_range, kCTKernAttributeName); else @@ -781,8 +781,8 @@ resize_and_retry: CFRelease (level_number); if (unlikely (!options)) { - CFRelease (attr_string); - FAIL ("CFDictionaryCreate failed"); + CFRelease (attr_string); + FAIL ("CFDictionaryCreate failed"); } CTTypesetterRef typesetter = CTTypesetterCreateWithAttributedStringAndOptions (attr_string, options); @@ -893,7 +893,7 @@ resize_and_retry: if (!matched) { CFRange range = CTRunGetStringRange (run); - DEBUG_MSG (CORETEXT, run, "Run used fallback font: %ld..%ld", + DEBUG_MSG (CORETEXT, run, "Run used fallback font: %ld..%ld", range.location, range.location + range.length); if (!buffer->ensure_inplace (buffer->len + range.length)) goto resize_and_retry; @@ -921,7 +921,7 @@ resize_and_retry: continue; } if (buffer->unicode->is_default_ignorable (ch)) - continue; + continue; info->codepoint = notdef; info->cluster = log_clusters[j]; @@ -966,7 +966,7 @@ resize_and_retry: scratch = scratch_saved { /* Setup glyphs */ - SCRATCH_SAVE(); + SCRATCH_SAVE(); const CGGlyph* glyphs = USE_PTR ? CTRunGetGlyphsPtr (run) : nullptr; if (!glyphs) { ALLOCATE_ARRAY (CGGlyph, glyph_buf, num_glyphs, goto resize_and_retry); @@ -989,12 +989,12 @@ resize_and_retry: SCRATCH_RESTORE(); } { - /* Setup positions. + /* Setup positions. * Note that CoreText does not return advances for glyphs. As such, * for all but last glyph, we use the delta position to next glyph as * advance (in the advance direction only), and for last glyph we set * whatever is needed to make the whole run's advance add up. */ - SCRATCH_SAVE(); + SCRATCH_SAVE(); const CGPoint* positions = USE_PTR ? CTRunGetPositionsPtr (run) : nullptr; if (!positions) { ALLOCATE_ARRAY (CGPoint, position_buf, num_glyphs, goto resize_and_retry); |