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

Side by Side Diff: core/src/fxge/ge/fx_ge_fontmap.cpp

Issue 1511613005: Add CFX_FontMapper::IsBuiltinFace() in master branch (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years 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 | « core/include/fxge/fx_font.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "core/include/fxge/fx_freetype.h" 9 #include "core/include/fxge/fx_freetype.h"
10 #include "core/include/fxge/fx_ge.h" 10 #include "core/include/fxge/fx_ge.h"
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 if (italic_angle == 0) { 1207 if (italic_angle == 0) {
1208 italic_angle = -12; 1208 italic_angle = -12;
1209 } else if (FXSYS_abs(italic_angle) < 5) { 1209 } else if (FXSYS_abs(italic_angle) < 5) {
1210 italic_angle = 0; 1210 italic_angle = 0;
1211 } 1211 }
1212 pSubstFont->m_ItalicAngle = italic_angle; 1212 pSubstFont->m_ItalicAngle = italic_angle;
1213 } 1213 }
1214 m_pFontInfo->DeleteFont(hFont); 1214 m_pFontInfo->DeleteFont(hFont);
1215 return face; 1215 return face;
1216 } 1216 }
1217 FX_BOOL CFX_FontMapper::IsBuiltinFace(const FXFT_Face face) const {
1218 for (int i = 0; i < MM_FACE_COUNT; ++i) {
1219 if (m_MMFaces[i] == face)
1220 return TRUE;
1221 }
1222 for (int i = 0; i < FOXIT_FACE_COUNT; ++i) {
1223 if (m_FoxitFaces[i] == face)
1224 return TRUE;
1225 }
1226 return FALSE;
1227 }
1217 extern "C" { 1228 extern "C" {
1218 unsigned long _FTStreamRead(FXFT_Stream stream, 1229 unsigned long _FTStreamRead(FXFT_Stream stream,
1219 unsigned long offset, 1230 unsigned long offset,
1220 unsigned char* buffer, 1231 unsigned char* buffer,
1221 unsigned long count); 1232 unsigned long count);
1222 void _FTStreamClose(FXFT_Stream stream); 1233 void _FTStreamClose(FXFT_Stream stream);
1223 }; 1234 };
1224 #if _FX_OS_ == _FX_ANDROID_ 1235 #if _FX_OS_ == _FX_ANDROID_
1225 IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault(const char** pUnused) { 1236 IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault(const char** pUnused) {
1226 return NULL; 1237 return NULL;
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 int PDF_GetStandardFontName(CFX_ByteString* name) { 1508 int PDF_GetStandardFontName(CFX_ByteString* name) {
1498 AltFontName* found = static_cast<AltFontName*>( 1509 AltFontName* found = static_cast<AltFontName*>(
1499 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), 1510 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames),
1500 sizeof(AltFontName), CompareString)); 1511 sizeof(AltFontName), CompareString));
1501 if (!found) 1512 if (!found)
1502 return -1; 1513 return -1;
1503 1514
1504 *name = g_Base14FontNames[found->m_Index]; 1515 *name = g_Base14FontNames[found->m_Index];
1505 return found->m_Index; 1516 return found->m_Index;
1506 } 1517 }
OLDNEW
« no previous file with comments | « core/include/fxge/fx_font.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698