Replace kCTFontXXXOrientation with kCTFontOrientationXXX.

English has a quite complex order of adjectives, and adjectives come
before the noun.  However, this order often clashes with the desire for
clear hierarchy in naming. In the kingdom of nouns the nouns come first.
A great eye at Apple noticed a lack of dicipline in the naming of the
orientation constants and ranamed them to conform, deprecating the
original names. To avoid warnings which become errors, Skia must now
use the new names for these constants.

BUG=chromium:408571

Change-Id: I5ccce4a3353157e1e8780c3a169099cec76b7637
Reviewed-on: https://skia-review.googlesource.com/8300
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This commit is contained in:
bungeman 2017-02-09 17:15:59 -05:00 committed by Skia Commit-Bot
parent e037d12625
commit 18ec7b9581

View File

@ -705,9 +705,9 @@ private:
* unrotated glyph, and then the rotation is applied separately.
*
* CT vertical metrics are pre-rotated (in em space, before transform) 90deg clock-wise.
* This makes kCTFontDefaultOrientation dangerous, because the metrics from
* kCTFontHorizontalOrientation are in a different space from kCTFontVerticalOrientation.
* With kCTFontVerticalOrientation the advances must be unrotated.
* This makes kCTFontOrientationDefault dangerous, because the metrics from
* kCTFontOrientationHorizontal are in a different space from kCTFontOrientationVertical.
* With kCTFontOrientationVertical the advances must be unrotated.
*
* Sometimes, creating a copy of a CTFont with the same size but different trasform will select
* different underlying font data. As a result, avoid ever creating more than one CTFont per
@ -962,13 +962,13 @@ void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
// The following block produces cgAdvance in CG units (pixels, y up).
CGSize cgAdvance;
if (fVertical) {
CTFontGetAdvancesForGlyphs(fCTFont.get(), kCTFontVerticalOrientation,
CTFontGetAdvancesForGlyphs(fCTFont.get(), kCTFontOrientationVertical,
&cgGlyph, &cgAdvance, 1);
// Vertical advances are returned as widths instead of heights.
SkTSwap(cgAdvance.height, cgAdvance.width);
cgAdvance.height = -cgAdvance.height;
} else {
CTFontGetAdvancesForGlyphs(fCTFont.get(), kCTFontHorizontalOrientation,
CTFontGetAdvancesForGlyphs(fCTFont.get(), kCTFontOrientationHorizontal,
&cgGlyph, &cgAdvance, 1);
}
cgAdvance = CGSizeApplyAffineTransform(cgAdvance, fTransform);
@ -987,7 +987,7 @@ void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
{
// CTFontGetBoundingRectsForGlyphs produces cgBounds in CG units (pixels, y up).
CGRect cgBounds;
CTFontGetBoundingRectsForGlyphs(fCTFont.get(), kCTFontHorizontalOrientation,
CTFontGetBoundingRectsForGlyphs(fCTFont.get(), kCTFontOrientationHorizontal,
&cgGlyph, &cgBounds, 1);
cgBounds = CGRectApplyAffineTransform(cgBounds, fTransform);
@ -1520,7 +1520,7 @@ SkAdvancedTypefaceMetrics* SkTypeface_Mac::onGetAdvancedTypefaceMetrics(
CGGlyph glyphs[count];
CGRect boundingRects[count];
if (CTFontGetGlyphsForCharacters(ctFont.get(), stem_chars, glyphs, count)) {
CTFontGetBoundingRectsForGlyphs(ctFont.get(), kCTFontHorizontalOrientation,
CTFontGetBoundingRectsForGlyphs(ctFont.get(), kCTFontOrientationHorizontal,
glyphs, boundingRects, count);
for (size_t i = 0; i < count; i++) {
int16_t width = (int16_t) boundingRects[i].size.width;