| 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 "../../../include/fxge/fx_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
| 8 #include "../agg/include/fx_agg_driver.h" | 8 #include "../agg/include/fx_agg_driver.h" |
| 9 #include "text_int.h" | 9 #include "text_int.h" |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 {"Helvetica-BoldOblique", "Arial Bold Italic"}, | 23 {"Helvetica-BoldOblique", "Arial Bold Italic"}, |
| 24 {"Helvetica-Oblique", "Arial Italic"}, | 24 {"Helvetica-Oblique", "Arial Italic"}, |
| 25 {"Times-Roman", "Times New Roman"}, | 25 {"Times-Roman", "Times New Roman"}, |
| 26 {"Times-Bold", "Times New Roman Bold"}, | 26 {"Times-Bold", "Times New Roman Bold"}, |
| 27 {"Times-BoldItalic", "Times New Roman Bold Italic"}, | 27 {"Times-BoldItalic", "Times New Roman Bold Italic"}, |
| 28 {"Times-Italic", "Times New Roman Italic"}, | 28 {"Times-Italic", "Times New Roman Italic"}, |
| 29 }; | 29 }; |
| 30 class CFX_LinuxFontInfo : public CFX_FolderFontInfo | 30 class CFX_LinuxFontInfo : public CFX_FolderFontInfo |
| 31 { | 31 { |
| 32 public: | 32 public: |
| 33 virtual void*» » MapFont(int weight, FX_BOOL bItalic, int charset
, int pitch_family, const FX_CHAR* family, FX_BOOL& bExact); | 33 void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, co
nst FX_CHAR* family, int& iExact) override; |
| 34 FX_BOOL ParseFontCfg(); | 34 FX_BOOL ParseFontCfg(); |
| 35 void* FindFont(int weight, FX_BOOL bItalic, in
t charset, int pitch_family, const FX_CHAR* family, FX_BOOL bMatchName); | 35 void* FindFont(int weight, FX_BOOL bItalic, in
t charset, int pitch_family, const FX_CHAR* family, FX_BOOL bMatchName); |
| 36 }; | 36 }; |
| 37 #define LINUX_GPNAMESIZE 6 | 37 #define LINUX_GPNAMESIZE 6 |
| 38 static const struct { | 38 static const struct { |
| 39 const FX_CHAR* NameArr[LINUX_GPNAMESIZE]; | 39 const FX_CHAR* NameArr[LINUX_GPNAMESIZE]; |
| 40 } | 40 } |
| 41 LinuxGpFontList[] = { | 41 LinuxGpFontList[] = { |
| 42 {{"TakaoPGothic", "VL PGothic", "IPAPGothic", "VL Gothic", "Kochi Gothic", "
VL Gothic regular"}}, | 42 {{"TakaoPGothic", "VL PGothic", "IPAPGothic", "VL Gothic", "Kochi Gothic", "
VL Gothic regular"}}, |
| 43 {{"TakaoGothic", "VL Gothic", "IPAGothic", "Kochi Gothic", NULL, "VL Gothic
regular"}}, | 43 {{"TakaoGothic", "VL Gothic", "IPAGothic", "Kochi Gothic", NULL, "VL Gothic
regular"}}, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 70 if (face.Find("PMincho") >= 0 || face.Find("\x82\x6f\x96\xbe\x92\xa9") >
= 0) { | 70 if (face.Find("PMincho") >= 0 || face.Find("\x82\x6f\x96\xbe\x92\xa9") >
= 0) { |
| 71 return 2; | 71 return 2; |
| 72 } | 72 } |
| 73 return 3; | 73 return 3; |
| 74 } | 74 } |
| 75 if (!(picth_family & FXFONT_FF_ROMAN) && weight > 400) { | 75 if (!(picth_family & FXFONT_FF_ROMAN) && weight > 400) { |
| 76 return 0; | 76 return 0; |
| 77 } | 77 } |
| 78 return 2; | 78 return 2; |
| 79 } | 79 } |
| 80 void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
itch_family, const FX_CHAR* cstr_face, FX_BOOL& bExact) | 80 void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
itch_family, const FX_CHAR* cstr_face, int& iExact) |
| 81 { | 81 { |
| 82 CFX_ByteString face = cstr_face; | 82 CFX_ByteString face = cstr_face; |
| 83 int iBaseFont; | 83 int iBaseFont; |
| 84 for (iBaseFont = 0; iBaseFont < 12; iBaseFont ++) | 84 for (iBaseFont = 0; iBaseFont < 12; iBaseFont ++) |
| 85 if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) { | 85 if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) { |
| 86 face = Base14Substs[iBaseFont].m_pSubstName; | 86 face = Base14Substs[iBaseFont].m_pSubstName; |
| 87 bExact = TRUE; | 87 iExact = 1; |
| 88 break; | 88 break; |
| 89 } | 89 } |
| 90 if (iBaseFont < 12) { | 90 if (iBaseFont < 12) { |
| 91 return GetFont(face); | 91 return GetFont(face); |
| 92 } | 92 } |
| 93 void* p = NULL; | 93 void* p = NULL; |
| 94 FX_BOOL bCJK = TRUE; | 94 FX_BOOL bCJK = TRUE; |
| 95 switch (charset) { | 95 switch (charset) { |
| 96 case FXFONT_SHIFTJIS_CHARSET: { | 96 case FXFONT_SHIFTJIS_CHARSET: { |
| 97 int32_t index = GetJapanesePreference(cstr_face, weight, pitch_f
amily); | 97 int32_t index = GetJapanesePreference(cstr_face, weight, pitch_f
amily); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 return FALSE; | 225 return FALSE; |
| 226 } | 226 } |
| 227 void CFX_GEModule::InitPlatform() | 227 void CFX_GEModule::InitPlatform() |
| 228 { | 228 { |
| 229 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault()); | 229 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault()); |
| 230 } | 230 } |
| 231 void CFX_GEModule::DestroyPlatform() | 231 void CFX_GEModule::DestroyPlatform() |
| 232 { | 232 { |
| 233 } | 233 } |
| 234 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ | 234 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ |
| OLD | NEW |