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/SkFontHost_FreeType.cpp

Issue 2246903002: SkPDF: SkPDFFont class changes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-08-15 (Monday) 12:00:31 EDT 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
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkAdvancedTypefaceMetrics.h" 8 #include "SkAdvancedTypefaceMetrics.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 AutoFTAccess fta(this); 459 AutoFTAccess fta(this);
460 FT_Face face = fta.face(); 460 FT_Face face = fta.face();
461 if (!face) { 461 if (!face) {
462 return nullptr; 462 return nullptr;
463 } 463 }
464 464
465 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics; 465 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics;
466 info->fFontName.set(FT_Get_Postscript_Name(face)); 466 info->fFontName.set(FT_Get_Postscript_Name(face));
467 info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag; 467 info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag;
468 if (FT_HAS_MULTIPLE_MASTERS(face)) { 468 if (FT_HAS_MULTIPLE_MASTERS(face)) {
469 info->fFlags = SkTBitOr<SkAdvancedTypefaceMetrics::FontFlags>( 469 info->fFlags |= SkAdvancedTypefaceMetrics::kMultiMaster_FontFlag;
470 info->fFlags, SkAdvancedTypefaceMetrics::kMultiMaster_FontFlag);
471 } 470 }
472 if (!canEmbed(face)) { 471 if (!canEmbed(face)) {
473 info->fFlags = SkTBitOr<SkAdvancedTypefaceMetrics::FontFlags>( 472 info->fFlags |= SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag;
474 info->fFlags,
475 SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag);
476 } 473 }
477 if (!canSubset(face)) { 474 if (!canSubset(face)) {
478 info->fFlags = SkTBitOr<SkAdvancedTypefaceMetrics::FontFlags>( 475 info->fFlags |= SkAdvancedTypefaceMetrics::kNotSubsettable_FontFlag;
479 info->fFlags,
480 SkAdvancedTypefaceMetrics::kNotSubsettable_FontFlag);
481 } 476 }
482 info->fLastGlyphID = face->num_glyphs - 1; 477 info->fLastGlyphID = face->num_glyphs - 1;
483 info->fEmSize = 1000; 478 info->fEmSize = 1000;
484 479
485 const char* fontType = FT_Get_X11_Font_Format(face); 480 const char* fontType = FT_Get_X11_Font_Format(face);
486 if (strcmp(fontType, "Type 1") == 0) { 481 if (strcmp(fontType, "Type 1") == 0) {
487 info->fType = SkAdvancedTypefaceMetrics::kType1_Font; 482 info->fType = SkAdvancedTypefaceMetrics::kType1_Font;
488 } else if (strcmp(fontType, "CID Type 1") == 0) { 483 } else if (strcmp(fontType, "CID Type 1") == 0) {
489 info->fType = SkAdvancedTypefaceMetrics::kType1CID_Font; 484 info->fType = SkAdvancedTypefaceMetrics::kType1CID_Font;
490 } else if (strcmp(fontType, "CFF") == 0) { 485 } else if (strcmp(fontType, "CFF") == 0) {
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 SkDEBUGF(("Requested font axis not found: %s '%c%c%c%c'\n", 1766 SkDEBUGF(("Requested font axis not found: %s '%c%c%c%c'\n",
1772 name.c_str(), 1767 name.c_str(),
1773 (skTag >> 24) & 0xFF, 1768 (skTag >> 24) & 0xFF,
1774 (skTag >> 16) & 0xFF, 1769 (skTag >> 16) & 0xFF,
1775 (skTag >> 8) & 0xFF, 1770 (skTag >> 8) & 0xFF,
1776 (skTag) & 0xFF)); 1771 (skTag) & 0xFF));
1777 } 1772 }
1778 } 1773 }
1779 ) 1774 )
1780 } 1775 }
OLDNEW
« src/pdf/SkPDFFont.cpp ('K') | « src/pdf/SkPDFFont.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698