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

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

Issue 1299963002: Extern in .cpp files is a code smell. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 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 // 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 "../../../include/fxge/fx_ge.h" 9 #include "../../../include/fxge/fx_ge.h"
10 #include "../../../include/fxge/fx_freetype.h" 10 #include "../../../include/fxge/fx_freetype.h"
11 #include "../fontdata/chromefontdata/chromefontdata.h"
11 #include "text_int.h" 12 #include "text_int.h"
12 13
13 #define GET_TT_SHORT(w) (FX_WORD)(((w)[0] << 8) | (w)[1]) 14 #define GET_TT_SHORT(w) (FX_WORD)(((w)[0] << 8) | (w)[1])
14 #define GET_TT_LONG(w) \ 15 #define GET_TT_LONG(w) \
15 (FX_DWORD)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3]) 16 (FX_DWORD)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3])
16 17
17 namespace { 18 namespace {
18 19
19 CFX_ByteString KeyNameFromFace(const CFX_ByteString& face_name, 20 CFX_ByteString KeyNameFromFace(const CFX_ByteString& face_name,
20 int weight, 21 int weight,
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 return; 386 return;
386 } 387 }
387 auto it = m_FaceMap.begin(); 388 auto it = m_FaceMap.begin();
388 while (it != m_FaceMap.end()) { 389 while (it != m_FaceMap.end()) {
389 auto temp = it++; 390 auto temp = it++;
390 if (temp->second->ReleaseFace(face)) { 391 if (temp->second->ReleaseFace(face)) {
391 m_FaceMap.erase(temp); 392 m_FaceMap.erase(temp);
392 } 393 }
393 } 394 }
394 } 395 }
395 extern "C" {
396 extern const unsigned char g_FoxitFixedItalicFontData[18746];
397 extern const unsigned char g_FoxitFixedFontData[17597];
398 extern const unsigned char g_FoxitSansItalicFontData[16339];
399 extern const unsigned char g_FoxitSansFontData[15025];
400 extern const unsigned char g_FoxitSerifItalicFontData[21227];
401 extern const unsigned char g_FoxitSerifFontData[19469];
402 extern const unsigned char g_FoxitFixedBoldItalicFontData[19151];
403 extern const unsigned char g_FoxitFixedBoldFontData[18055];
404 extern const unsigned char g_FoxitSansBoldItalicFontData[16418];
405 extern const unsigned char g_FoxitSansBoldFontData[16344];
406 extern const unsigned char g_FoxitSerifBoldItalicFontData[20733];
407 extern const unsigned char g_FoxitSerifBoldFontData[19395];
408 extern const unsigned char g_FoxitSymbolFontData[16729];
409 extern const unsigned char g_FoxitDingbatsFontData[29513];
410 extern const unsigned char g_FoxitSerifMMFontData[113417];
411 extern const unsigned char g_FoxitSansMMFontData[66919];
412 };
413 const FoxitFonts g_FoxitFonts[14] = { 396 const FoxitFonts g_FoxitFonts[14] = {
414 {g_FoxitFixedFontData, 17597}, 397 {g_FoxitFixedFontData, 17597},
415 {g_FoxitFixedBoldFontData, 18055}, 398 {g_FoxitFixedBoldFontData, 18055},
416 {g_FoxitFixedBoldItalicFontData, 19151}, 399 {g_FoxitFixedBoldItalicFontData, 19151},
417 {g_FoxitFixedItalicFontData, 18746}, 400 {g_FoxitFixedItalicFontData, 18746},
418 {g_FoxitSansFontData, 15025}, 401 {g_FoxitSansFontData, 15025},
419 {g_FoxitSansBoldFontData, 16344}, 402 {g_FoxitSansBoldFontData, 16344},
420 {g_FoxitSansBoldItalicFontData, 16418}, 403 {g_FoxitSansBoldItalicFontData, 16418},
421 {g_FoxitSansItalicFontData, 16339}, 404 {g_FoxitSansItalicFontData, 16339},
422 {g_FoxitSerifFontData, 19469}, 405 {g_FoxitSerifFontData, 19469},
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 if (hFont == NULL) { 1476 if (hFont == NULL) {
1494 return FALSE; 1477 return FALSE;
1495 } 1478 }
1496 CFX_FontFaceInfo* pFont = (CFX_FontFaceInfo*)hFont; 1479 CFX_FontFaceInfo* pFont = (CFX_FontFaceInfo*)hFont;
1497 name = pFont->m_FaceName; 1480 name = pFont->m_FaceName;
1498 return TRUE; 1481 return TRUE;
1499 } 1482 }
1500 FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset) { 1483 FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset) {
1501 return FALSE; 1484 return FALSE;
1502 } 1485 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698