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

Side by Side Diff: core/fxge/ge/fx_ge_linux.cpp

Issue 2240863002: Change g_LinuxGpFontList format (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | 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 #ifndef _SKIA_SUPPORT_ 7 #ifndef _SKIA_SUPPORT_
8 #include "core/fxge/agg/fx_agg_driver.h" 8 #include "core/fxge/agg/fx_agg_driver.h"
9 #endif 9 #endif
10 10
(...skipping 13 matching lines...) Expand all
24 FX_BOOL bItalic, 24 FX_BOOL bItalic,
25 int charset, 25 int charset,
26 int pitch_family, 26 int pitch_family,
27 const FX_CHAR* family, 27 const FX_CHAR* family,
28 int& iExact) override; 28 int& iExact) override;
29 FX_BOOL ParseFontCfg(const char** pUserPaths); 29 FX_BOOL ParseFontCfg(const char** pUserPaths);
30 }; 30 };
31 31
32 const size_t kLinuxGpNameSize = 6; 32 const size_t kLinuxGpNameSize = 6;
33 33
34 const struct { 34 const FX_CHAR* const g_LinuxGpFontList[][kLinuxGpNameSize] = {
35 const FX_CHAR* NameArr[kLinuxGpNameSize]; 35 {"TakaoPGothic", "VL PGothic", "IPAPGothic", "VL Gothic", "Kochi Gothic",
36 } g_LinuxGpFontList[] = { 36 "VL Gothic regular"},
37 {{"TakaoPGothic", "VL PGothic", "IPAPGothic", "VL Gothic", "Kochi Gothic", 37 {"TakaoGothic", "VL Gothic", "IPAGothic", "Kochi Gothic", nullptr,
38 "VL Gothic regular"}}, 38 "VL Gothic regular"},
39 {{"TakaoGothic", "VL Gothic", "IPAGothic", "Kochi Gothic", nullptr, 39 {"TakaoPMincho", "IPAPMincho", "VL Gothic", "Kochi Mincho", nullptr,
40 "VL Gothic regular"}}, 40 "VL Gothic regular"},
41 {{"TakaoPMincho", "IPAPMincho", "VL Gothic", "Kochi Mincho", nullptr, 41 {"TakaoMincho", "IPAMincho", "VL Gothic", "Kochi Mincho", nullptr,
42 "VL Gothic regular"}}, 42 "VL Gothic regular"},
43 {{"TakaoMincho", "IPAMincho", "VL Gothic", "Kochi Mincho", nullptr,
44 "VL Gothic regular"}},
45 }; 43 };
46 44
47 const FX_CHAR* const g_LinuxGbFontList[] = { 45 const FX_CHAR* const g_LinuxGbFontList[] = {
48 "AR PL UMing CN Light", "WenQuanYi Micro Hei", "AR PL UKai CN", 46 "AR PL UMing CN Light", "WenQuanYi Micro Hei", "AR PL UKai CN",
49 }; 47 };
50 48
51 const FX_CHAR* const g_LinuxB5FontList[] = { 49 const FX_CHAR* const g_LinuxB5FontList[] = {
52 "AR PL UMing TW Light", "WenQuanYi Micro Hei", "AR PL UKai TW", 50 "AR PL UMing TW Light", "WenQuanYi Micro Hei", "AR PL UKai TW",
53 }; 51 };
54 52
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 if (font) { 91 if (font) {
94 iExact = 1; 92 iExact = 1;
95 return font; 93 return font;
96 } 94 }
97 FX_BOOL bCJK = TRUE; 95 FX_BOOL bCJK = TRUE;
98 switch (charset) { 96 switch (charset) {
99 case FXFONT_SHIFTJIS_CHARSET: { 97 case FXFONT_SHIFTJIS_CHARSET: {
100 size_t index = GetJapanesePreference(cstr_face, weight, pitch_family); 98 size_t index = GetJapanesePreference(cstr_face, weight, pitch_family);
101 ASSERT(index < FX_ArraySize(g_LinuxGpFontList)); 99 ASSERT(index < FX_ArraySize(g_LinuxGpFontList));
102 for (size_t i = 0; i < kLinuxGpNameSize; i++) { 100 for (size_t i = 0; i < kLinuxGpNameSize; i++) {
103 auto it = m_FontList.find(g_LinuxGpFontList[index].NameArr[i]); 101 auto it = m_FontList.find(g_LinuxGpFontList[index][i]);
104 if (it != m_FontList.end()) { 102 if (it != m_FontList.end()) {
105 return it->second; 103 return it->second;
106 } 104 }
107 } 105 }
108 break; 106 break;
109 } 107 }
110 case FXFONT_GB2312_CHARSET: { 108 case FXFONT_GB2312_CHARSET: {
111 for (size_t i = 0; i < FX_ArraySize(g_LinuxGbFontList); ++i) { 109 for (size_t i = 0; i < FX_ArraySize(g_LinuxGbFontList); ++i) {
112 auto it = m_FontList.find(g_LinuxGbFontList[i]); 110 auto it = m_FontList.find(g_LinuxGbFontList[i]);
113 if (it != m_FontList.end()) { 111 if (it != m_FontList.end()) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 return TRUE; 160 return TRUE;
163 } 161 }
164 162
165 void CFX_GEModule::InitPlatform() { 163 void CFX_GEModule::InitPlatform() {
166 m_pFontMgr->SetSystemFontInfo( 164 m_pFontMgr->SetSystemFontInfo(
167 IFX_SystemFontInfo::CreateDefault(m_pUserFontPaths)); 165 IFX_SystemFontInfo::CreateDefault(m_pUserFontPaths));
168 } 166 }
169 167
170 void CFX_GEModule::DestroyPlatform() {} 168 void CFX_GEModule::DestroyPlatform() {}
171 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ 169 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698