Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/ports/SkTypeface_win_dw.cpp

Issue 2253543004: Move FamilyClass and Panose enums to enum class. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Windows. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/sfnt/SkIBMFamilyClass.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkTypes.h" 8 #include "SkTypes.h"
9 #if defined(SK_BUILD_FOR_WIN32) 9 #if defined(SK_BUILD_FOR_WIN32)
10 10
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 bool fixedWidth = (postTable->isFixedPitch && 376 bool fixedWidth = (postTable->isFixedPitch &&
377 (1 == SkEndian_SwapBE16(hheaTable->numberOfHMetrics))); 377 (1 == SkEndian_SwapBE16(hheaTable->numberOfHMetrics)));
378 //Monospace 378 //Monospace
379 if (fixedWidth) { 379 if (fixedWidth) {
380 info->fStyle |= SkAdvancedTypefaceMetrics::kFixedPitch_Style; 380 info->fStyle |= SkAdvancedTypefaceMetrics::kFixedPitch_Style;
381 } 381 }
382 //Italic 382 //Italic
383 if (os2Table->version.v0.fsSelection.field.Italic) { 383 if (os2Table->version.v0.fsSelection.field.Italic) {
384 info->fStyle |= SkAdvancedTypefaceMetrics::kItalic_Style; 384 info->fStyle |= SkAdvancedTypefaceMetrics::kItalic_Style;
385 } 385 }
386 //Serif
387 using SerifStyle = SkPanose::Data::TextAndDisplay::SerifStyle;
388 SerifStyle serifStyle = os2Table->version.v0.panose.data.textAndDisplay.bSer ifStyle;
389 if (SkPanose::FamilyType::TextAndDisplay == os2Table->version.v0.panose.bFam ilyType) {
390 if (SerifStyle::Cove == serifStyle ||
391 SerifStyle::ObtuseCove == serifStyle ||
392 SerifStyle::SquareCove == serifStyle ||
393 SerifStyle::ObtuseSquareCove == serifStyle ||
394 SerifStyle::Square == serifStyle ||
395 SerifStyle::Thin == serifStyle ||
396 SerifStyle::Bone == serifStyle ||
397 SerifStyle::Exaggerated == serifStyle ||
398 SerifStyle::Triangle == serifStyle)
399 {
400 info->fStyle |= SkAdvancedTypefaceMetrics::kSerif_Style;
401 }
386 //Script 402 //Script
387 if (SkPanose::FamilyType::Script == os2Table->version.v0.panose.bFamilyType. value) { 403 } else if (SkPanose::FamilyType::Script == os2Table->version.v0.panose.bFami lyType) {
388 info->fStyle |= SkAdvancedTypefaceMetrics::kScript_Style; 404 info->fStyle |= SkAdvancedTypefaceMetrics::kScript_Style;
389 //Serif
390 } else if (SkPanose::FamilyType::TextAndDisplay == os2Table->version.v0.pano se.bFamilyType.value &&
391 SkPanose::Data::TextAndDisplay::SerifStyle::Triangle <= os2Table- >version.v0.panose.data.textAndDisplay.bSerifStyle.value &&
392 SkPanose::Data::TextAndDisplay::SerifStyle::NoFit != os2Table->ve rsion.v0.panose.data.textAndDisplay.bSerifStyle.value) {
393 info->fStyle |= SkAdvancedTypefaceMetrics::kSerif_Style;
394 } 405 }
395 406
396 info->fItalicAngle = SkEndian_SwapBE32(postTable->italicAngle) >> 16; 407 info->fItalicAngle = SkEndian_SwapBE32(postTable->italicAngle) >> 16;
397 408
398 info->fAscent = SkToS16(dwfm.ascent); 409 info->fAscent = SkToS16(dwfm.ascent);
399 info->fDescent = SkToS16(dwfm.descent); 410 info->fDescent = SkToS16(dwfm.descent);
400 info->fCapHeight = SkToS16(dwfm.capHeight); 411 info->fCapHeight = SkToS16(dwfm.capHeight);
401 412
402 info->fBBox = SkIRect::MakeLTRB((int32_t)SkEndian_SwapBE16((uint16_t)headTab le->xMin), 413 info->fBBox = SkIRect::MakeLTRB((int32_t)SkEndian_SwapBE16((uint16_t)headTab le->xMin),
403 (int32_t)SkEndian_SwapBE16((uint16_t)headTab le->yMax), 414 (int32_t)SkEndian_SwapBE16((uint16_t)headTab le->yMax),
404 (int32_t)SkEndian_SwapBE16((uint16_t)headTab le->xMax), 415 (int32_t)SkEndian_SwapBE16((uint16_t)headTab le->xMax),
405 (int32_t)SkEndian_SwapBE16((uint16_t)headTab le->yMin)); 416 (int32_t)SkEndian_SwapBE16((uint16_t)headTab le->yMin));
406 return info; 417 return info;
407 } 418 }
408 #endif//defined(SK_BUILD_FOR_WIN32) 419 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« no previous file with comments | « no previous file | src/sfnt/SkIBMFamilyClass.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698