diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-01-05 14:14:41 -0800 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-01-24 19:40:40 +0000 |
commit | c1cece8e546a138609c974be94588ba4e72c6fb1 (patch) | |
tree | a355ec5cc99bd1b8ab48ff490afb66fc63d27d7b /src/platformsupport/fontdatabases | |
parent | ffc9d27d7eb5c6779c6bf3963bac2dafb2a828cf (diff) |
Fix deprecated API usage
Change-Id: I62448507f80daf6be72994ee99f0fb1aa107eb78
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/platformsupport/fontdatabases')
-rw-r--r-- | src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm | 42 | ||||
-rw-r--r-- | src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm | 8 |
2 files changed, 25 insertions, 25 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 1e29b12ec4..6466db59ce 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -708,71 +708,71 @@ static CTFontUIFontType fontTypeFromTheme(QPlatformTheme::Font f) { switch (f) { case QPlatformTheme::SystemFont: - return kCTFontSystemFontType; + return kCTFontUIFontSystem; case QPlatformTheme::MenuFont: case QPlatformTheme::MenuBarFont: case QPlatformTheme::MenuItemFont: - return kCTFontMenuItemFontType; + return kCTFontUIFontMenuItem; case QPlatformTheme::MessageBoxFont: - return kCTFontEmphasizedSystemFontType; + return kCTFontUIFontEmphasizedSystem; case QPlatformTheme::LabelFont: - return kCTFontSystemFontType; + return kCTFontUIFontSystem; case QPlatformTheme::TipLabelFont: return kCTFontToolTipFontType; case QPlatformTheme::StatusBarFont: - return kCTFontSystemFontType; + return kCTFontUIFontSystem; case QPlatformTheme::TitleBarFont: - return kCTFontWindowTitleFontType; + return kCTFontUIFontWindowTitle; case QPlatformTheme::MdiSubWindowTitleFont: case QPlatformTheme::DockWidgetTitleFont: - return kCTFontSystemFontType; + return kCTFontUIFontSystem; case QPlatformTheme::PushButtonFont: - return kCTFontPushButtonFontType; + return kCTFontUIFontPushButton; case QPlatformTheme::CheckBoxFont: case QPlatformTheme::RadioButtonFont: - return kCTFontSystemFontType; + return kCTFontUIFontSystem; case QPlatformTheme::ToolButtonFont: - return kCTFontSmallToolbarFontType; + return kCTFontUIFontSmallToolbar; case QPlatformTheme::ItemViewFont: - return kCTFontSystemFontType; + return kCTFontUIFontSystem; case QPlatformTheme::ListViewFont: - return kCTFontViewsFontType; + return kCTFontUIFontViews; case QPlatformTheme::HeaderViewFont: - return kCTFontSmallSystemFontType; + return kCTFontUIFontSmallSystem; case QPlatformTheme::ListBoxFont: - return kCTFontViewsFontType; + return kCTFontUIFontViews; case QPlatformTheme::ComboMenuItemFont: - return kCTFontSystemFontType; + return kCTFontUIFontSystem; case QPlatformTheme::ComboLineEditFont: - return kCTFontViewsFontType; + return kCTFontUIFontViews; case QPlatformTheme::SmallFont: - return kCTFontSmallSystemFontType; + return kCTFontUIFontSmallSystem; case QPlatformTheme::MiniFont: - return kCTFontMiniSystemFontType; + return kCTFontUIFontMiniSystem; case QPlatformTheme::FixedFont: - return kCTFontUserFixedPitchFontType; + return kCTFontUIFontUserFixedPitch; default: - return kCTFontSystemFontType; + return kCTFontUIFontSystem; } } @@ -848,7 +848,7 @@ QFont *QCoreTextFontDatabase::themeFont(QPlatformTheme::Font f) const QFont QCoreTextFontDatabase::defaultFont() const { if (defaultFontName.isEmpty()) { - QCFType<CTFontRef> font = CTFontCreateUIFontForLanguage(kCTFontSystemFontType, 12.0, NULL); + QCFType<CTFontRef> font = CTFontCreateUIFontForLanguage(kCTFontUIFontSystem, 12.0, NULL); defaultFontName = (QString) QCFString(CTFontCopyFullName(font)); } diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm index 7a06d5f1c9..1f152a3d32 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm @@ -141,7 +141,7 @@ static void loadAdvancesForGlyphs(CTFontRef ctfont, { Q_UNUSED(flags); QVarLengthArray<CGSize> advances(len); - CTFontGetAdvancesForGlyphs(ctfont, kCTFontHorizontalOrientation, cgGlyphs.data(), advances.data(), len); + CTFontGetAdvancesForGlyphs(ctfont, kCTFontOrientationHorizontal, cgGlyphs.data(), advances.data(), len); for (int i = 0; i < len; ++i) { if (glyphs->glyphs[i] & 0xff000000) @@ -320,7 +320,7 @@ bool QCoreTextFontEngine::stringToCMap(const QChar *str, int len, QGlyphLayout * return true; QVarLengthArray<CGSize> advances(glyph_pos); - CTFontGetAdvancesForGlyphs(ctfont, kCTFontHorizontalOrientation, cgGlyphs.data(), advances.data(), glyph_pos); + CTFontGetAdvancesForGlyphs(ctfont, kCTFontOrientationHorizontal, cgGlyphs.data(), advances.data(), glyph_pos); for (int i = 0; i < glyph_pos; ++i) { if (glyphs->glyphs[i] & 0xff000000) @@ -351,7 +351,7 @@ glyph_metrics_t QCoreTextFontEngine::boundingBox(glyph_t glyph) { glyph_metrics_t ret; CGGlyph g = glyph; - CGRect rect = CTFontGetBoundingRectsForGlyphs(ctfont, kCTFontHorizontalOrientation, &g, 0, 1); + CGRect rect = CTFontGetBoundingRectsForGlyphs(ctfont, kCTFontOrientationHorizontal, &g, 0, 1); if (synthesisFlags & QFontEngine::SynthesizedItalic) { rect.size.width += rect.size.height * SYNTHETIC_ITALIC_SKEW; } @@ -360,7 +360,7 @@ glyph_metrics_t QCoreTextFontEngine::boundingBox(glyph_t glyph) ret.x = QFixed::fromReal(rect.origin.x); ret.y = -QFixed::fromReal(rect.origin.y) - ret.height; CGSize advances[1]; - CTFontGetAdvancesForGlyphs(ctfont, kCTFontHorizontalOrientation, &g, advances, 1); + CTFontGetAdvancesForGlyphs(ctfont, kCTFontOrientationHorizontal, &g, advances, 1); ret.xoff = QFixed::fromReal(advances[0].width); ret.yoff = QFixed::fromReal(advances[0].height); |