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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 }; | 56 }; |
57 static const FX_CHAR* const g_LinuxHGFontList[] = { | 57 static const FX_CHAR* const g_LinuxHGFontList[] = { |
58 "UnDotum", | 58 "UnDotum", |
59 }; | 59 }; |
60 static int32_t GetJapanesePreference(const FX_CHAR* facearr, int weight, int pic
th_family) | 60 static int32_t GetJapanesePreference(const FX_CHAR* facearr, int weight, int pic
th_family) |
61 { | 61 { |
62 CFX_ByteString face = facearr; | 62 CFX_ByteString face = facearr; |
63 if (face.Find("Gothic") >= 0 || face.Find("\x83\x53\x83\x56\x83\x62\x83\x4e"
) >= 0) { | 63 if (face.Find("Gothic") >= 0 || face.Find("\x83\x53\x83\x56\x83\x62\x83\x4e"
) >= 0) { |
64 if (face.Find("PGothic") >= 0 || face.Find("\x82\x6f\x83\x53\x83\x56\x83
\x62\x83\x4e") >= 0) { | 64 if (face.Find("PGothic") >= 0 || face.Find("\x82\x6f\x83\x53\x83\x56\x83
\x62\x83\x4e") >= 0) { |
65 return 0; | 65 return 0; |
66 } else { | |
67 return 1; | |
68 } | 66 } |
69 } else if (face.Find("Mincho") >= 0 || face.Find("\x96\xbe\x92\xa9") >= 0) { | 67 return 1; |
| 68 } |
| 69 if (face.Find("Mincho") >= 0 || face.Find("\x96\xbe\x92\xa9") >= 0) { |
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 } else { | |
73 return 3; | |
74 } | 72 } |
| 73 return 3; |
75 } | 74 } |
76 if (!(picth_family & FXFONT_FF_ROMAN) && weight > 400) { | 75 if (!(picth_family & FXFONT_FF_ROMAN) && weight > 400) { |
77 return 0; | 76 return 0; |
78 } | 77 } |
79 return 2; | 78 return 2; |
80 } | 79 } |
81 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, FX_BOOL& bExact) |
82 { | 81 { |
83 CFX_ByteString face = cstr_face; | 82 CFX_ByteString face = cstr_face; |
84 int iBaseFont; | 83 int iBaseFont; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 return FALSE; | 222 return FALSE; |
224 } | 223 } |
225 void CFX_GEModule::InitPlatform() | 224 void CFX_GEModule::InitPlatform() |
226 { | 225 { |
227 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault()); | 226 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault()); |
228 } | 227 } |
229 void CFX_GEModule::DestroyPlatform() | 228 void CFX_GEModule::DestroyPlatform() |
230 { | 229 { |
231 } | 230 } |
232 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ | 231 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ |
OLD | NEW |