OLD | NEW |
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 "core/fxge/apple/apple_int.h" | 7 #include "core/fxge/apple/apple_int.h" |
8 #include "core/fxge/include/fx_ge.h" | 8 #include "core/fxge/include/fx_ge.h" |
9 | 9 |
10 #if _FX_OS_ == _FX_MACOSX_ | 10 #if _FX_OS_ == _FX_MACOSX_ |
11 static const struct { | 11 static const struct { |
12 const FX_CHAR* m_pName; | 12 const FX_CHAR* m_pName; |
13 const FX_CHAR* m_pSubstName; | 13 const FX_CHAR* m_pSubstName; |
14 } Base14Substs[] = { | 14 } Base14Substs[] = { |
15 {"Courier", "Courier New"}, | 15 {"Courier", "Courier New"}, |
16 {"Courier-Bold", "Courier New Bold"}, | 16 {"Courier-Bold", "Courier New Bold"}, |
17 {"Courier-BoldOblique", "Courier New Bold Italic"}, | 17 {"Courier-BoldOblique", "Courier New Bold Italic"}, |
18 {"Courier-Oblique", "Courier New Italic"}, | 18 {"Courier-Oblique", "Courier New Italic"}, |
19 {"Helvetica", "Arial"}, | 19 {"Helvetica", "Arial"}, |
20 {"Helvetica-Bold", "Arial Bold"}, | 20 {"Helvetica-Bold", "Arial Bold"}, |
21 {"Helvetica-BoldOblique", "Arial Bold Italic"}, | 21 {"Helvetica-BoldOblique", "Arial Bold Italic"}, |
22 {"Helvetica-Oblique", "Arial Italic"}, | 22 {"Helvetica-Oblique", "Arial Italic"}, |
23 {"Times-Roman", "Times New Roman"}, | 23 {"Times-Roman", "Times New Roman"}, |
24 {"Times-Bold", "Times New Roman Bold"}, | 24 {"Times-Bold", "Times New Roman Bold"}, |
25 {"Times-BoldItalic", "Times New Roman Bold Italic"}, | 25 {"Times-BoldItalic", "Times New Roman Bold Italic"}, |
26 {"Times-Italic", "Times New Roman Italic"}, | 26 {"Times-Italic", "Times New Roman Italic"}, |
27 }; | 27 }; |
| 28 |
28 class CFX_MacFontInfo : public CFX_FolderFontInfo { | 29 class CFX_MacFontInfo : public CFX_FolderFontInfo { |
29 public: | 30 public: |
30 virtual void* MapFont(int weight, | 31 // CFX_FolderFontInfo |
31 FX_BOOL bItalic, | 32 void* MapFont(int weight, |
32 int charset, | 33 FX_BOOL bItalic, |
33 int pitch_family, | 34 int charset, |
34 const FX_CHAR* family, | 35 int pitch_family, |
35 int& iExact); | 36 const FX_CHAR* family, |
| 37 int& iExact) override; |
36 }; | 38 }; |
| 39 |
37 #define JAPAN_GOTHIC "Hiragino Kaku Gothic Pro W6" | 40 #define JAPAN_GOTHIC "Hiragino Kaku Gothic Pro W6" |
38 #define JAPAN_MINCHO "Hiragino Mincho Pro W6" | 41 #define JAPAN_MINCHO "Hiragino Mincho Pro W6" |
39 static void GetJapanesePreference(CFX_ByteString& face, | 42 static void GetJapanesePreference(CFX_ByteString& face, |
40 int weight, | 43 int weight, |
41 int picth_family) { | 44 int picth_family) { |
42 if (face.Find("Gothic") >= 0) { | 45 if (face.Find("Gothic") >= 0) { |
43 face = JAPAN_GOTHIC; | 46 face = JAPAN_GOTHIC; |
44 return; | 47 return; |
45 } | 48 } |
46 if (!(picth_family & FXFONT_FF_ROMAN) && weight > 400) { | 49 if (!(picth_family & FXFONT_FF_ROMAN) && weight > 400) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 110 |
108 void CFX_GEModule::InitPlatform() { | 111 void CFX_GEModule::InitPlatform() { |
109 m_pPlatformData = new CApplePlatform; | 112 m_pPlatformData = new CApplePlatform; |
110 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault(nullptr)); | 113 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault(nullptr)); |
111 } | 114 } |
112 void CFX_GEModule::DestroyPlatform() { | 115 void CFX_GEModule::DestroyPlatform() { |
113 delete (CApplePlatform*)m_pPlatformData; | 116 delete (CApplePlatform*)m_pPlatformData; |
114 m_pPlatformData = nullptr; | 117 m_pPlatformData = nullptr; |
115 } | 118 } |
116 #endif | 119 #endif |
OLD | NEW |