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 "../../../include/fxge/fx_freetype.h" | 8 #include "../../../include/fxge/fx_freetype.h" |
9 #include "text_int.h" | 9 #include "text_int.h" |
10 #define GET_TT_SHORT(w) (FX_WORD)(((w)[0] << 8) | (w)[1]) | 10 #define GET_TT_SHORT(w) (FX_WORD)(((w)[0] << 8) | (w)[1]) |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 {"ZapfDingbats", 13}, | 280 {"ZapfDingbats", 13}, |
281 }; | 281 }; |
282 extern "C" { | 282 extern "C" { |
283 static int compareString(const void* key, const void* element) | 283 static int compareString(const void* key, const void* element) |
284 { | 284 { |
285 return FXSYS_stricmp((FX_LPCSTR)key, ((_AltFontName*)element)->m_pName); | 285 return FXSYS_stricmp((FX_LPCSTR)key, ((_AltFontName*)element)->m_pName); |
286 } | 286 } |
287 } | 287 } |
288 int _PDF_GetStandardFontName(CFX_ByteString& name) | 288 int _PDF_GetStandardFontName(CFX_ByteString& name) |
289 { | 289 { |
290 _AltFontName* found = (_AltFontName*)FXSYS_bsearch((FX_LPCSTR)name, g_AltFon
tNames, | 290 _AltFontName* found = (_AltFontName*)FXSYS_bsearch(name.c_str(), g_AltFontNa
mes, |
291 sizeof g_AltFontNames / sizeof (_AltFontName), sizeof
(_AltFontName), compareString); | 291 sizeof g_AltFontNames / sizeof (_AltFontName), sizeof
(_AltFontName), compareString); |
292 if (found == NULL) { | 292 if (found == NULL) { |
293 return -1; | 293 return -1; |
294 } | 294 } |
295 name = g_Base14FontNames[found->m_Index]; | 295 name = g_Base14FontNames[found->m_Index]; |
296 return found->m_Index; | 296 return found->m_Index; |
297 } | 297 } |
298 int GetTTCIndex(FX_LPCBYTE pFontData, FX_DWORD ttc_size, FX_DWORD font_offset) | 298 int GetTTCIndex(FX_LPCBYTE pFontData, FX_DWORD ttc_size, FX_DWORD font_offset) |
299 { | 299 { |
300 int face_index = 0; | 300 int face_index = 0; |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 fontName = "ScriptMTBold"; | 831 fontName = "ScriptMTBold"; |
832 } else if (fontName.Find("Palace") >= 0) { | 832 } else if (fontName.Find("Palace") >= 0) { |
833 fontName = "PalaceScriptMT"; | 833 fontName = "PalaceScriptMT"; |
834 } else if (fontName.Find("French") >= 0) { | 834 } else if (fontName.Find("French") >= 0) { |
835 fontName = "FrenchScriptMT"; | 835 fontName = "FrenchScriptMT"; |
836 } else if (fontName.Find("FreeStyle") >= 0) { | 836 } else if (fontName.Find("FreeStyle") >= 0) { |
837 fontName = "FreeStyleScript"; | 837 fontName = "FreeStyleScript"; |
838 } | 838 } |
839 return fontName; | 839 return fontName; |
840 } | 840 } |
841 _AltFontFamily* found = (_AltFontFamily*)FXSYS_bsearch((FX_LPCSTR)fontName,
g_AltFontFamilies, | 841 _AltFontFamily* found = (_AltFontFamily*)FXSYS_bsearch(fontName.c_str(), g_A
ltFontFamilies, |
842 sizeof g_AltFontFamilies / sizeof (_AltFontFamily),
sizeof (_AltFontFamily), compareFontFamilyString); | 842 sizeof g_AltFontFamilies / sizeof (_AltFontFamily),
sizeof (_AltFontFamily), compareFontFamilyString); |
843 if (found == NULL) { | 843 if (found == NULL) { |
844 return fontName; | 844 return fontName; |
845 } | 845 } |
846 return found->m_pFontFamily; | 846 return found->m_pFontFamily; |
847 }; | 847 }; |
848 typedef struct _FX_FontStyle { | 848 typedef struct _FX_FontStyle { |
849 FX_LPCSTR style; | 849 FX_LPCSTR style; |
850 FX_INT32 len; | 850 FX_INT32 len; |
851 } FX_FontStyle; | 851 } FX_FontStyle; |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1539 return FALSE; | 1539 return FALSE; |
1540 } | 1540 } |
1541 CFontFaceInfo* pFont = (CFontFaceInfo*)hFont; | 1541 CFontFaceInfo* pFont = (CFontFaceInfo*)hFont; |
1542 name = pFont->m_FaceName; | 1542 name = pFont->m_FaceName; |
1543 return TRUE; | 1543 return TRUE; |
1544 } | 1544 } |
1545 FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset) | 1545 FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset) |
1546 { | 1546 { |
1547 return FALSE; | 1547 return FALSE; |
1548 } | 1548 } |
OLD | NEW |