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 "xfa/fgas/font/fgas_fontutils.h" | 7 #include "xfa/fgas/font/fgas_fontutils.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 #include "xfa/fgas/font/fgas_font.h" | 10 #include "xfa/fgas/font/fgas_font.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 uint32_t dwFontStyles, | 35 uint32_t dwFontStyles, |
36 uint16_t wCodePage) { | 36 uint16_t wCodePage) { |
37 CFX_WideString wsFont(pszFontFamily); | 37 CFX_WideString wsFont(pszFontFamily); |
38 if (dwFontStyles & FX_FONTSTYLE_Bold) { | 38 if (dwFontStyles & FX_FONTSTYLE_Bold) { |
39 wsFont += L"Bold"; | 39 wsFont += L"Bold"; |
40 } | 40 } |
41 if (dwFontStyles & FX_FONTSTYLE_Italic) { | 41 if (dwFontStyles & FX_FONTSTYLE_Italic) { |
42 wsFont += L"Italic"; | 42 wsFont += L"Italic"; |
43 } | 43 } |
44 wsFont += wCodePage; | 44 wsFont += wCodePage; |
45 return FX_HashCode_String_GetW((const FX_WCHAR*)wsFont, wsFont.GetLength()); | 45 return FX_HashCode_String_GetW(wsFont.c_str(), wsFont.GetLength()); |
46 } | 46 } |
47 static const FGAS_FONTUSB g_FXGdiFontUSBTable[] = { | 47 static const FGAS_FONTUSB g_FXGdiFontUSBTable[] = { |
48 {0x0000, 0x007F, 0, 1252}, {0x0080, 0x00FF, 1, 1252}, | 48 {0x0000, 0x007F, 0, 1252}, {0x0080, 0x00FF, 1, 1252}, |
49 {0x0100, 0x017F, 2, 1250}, {0x0180, 0x024F, 3, 1250}, | 49 {0x0100, 0x017F, 2, 1250}, {0x0180, 0x024F, 3, 1250}, |
50 {0x0250, 0x02AF, 4, 0xFFFF}, {0x02B0, 0x02FF, 5, 0xFFFF}, | 50 {0x0250, 0x02AF, 4, 0xFFFF}, {0x02B0, 0x02FF, 5, 0xFFFF}, |
51 {0x0300, 0x036F, 6, 0xFFFF}, {0x0370, 0x03FF, 7, 1253}, | 51 {0x0300, 0x036F, 6, 0xFFFF}, {0x0370, 0x03FF, 7, 1253}, |
52 {0x0400, 0x04FF, 9, 1251}, {0x0500, 0x052F, 9, 0xFFFF}, | 52 {0x0400, 0x04FF, 9, 1251}, {0x0500, 0x052F, 9, 0xFFFF}, |
53 {0x0530, 0x058F, 10, 0xFFFF}, {0x0590, 0x05FF, 11, 1255}, | 53 {0x0530, 0x058F, 10, 0xFFFF}, {0x0590, 0x05FF, 11, 1255}, |
54 {0x0600, 0x06FF, 13, 1256}, {0x0700, 0x074F, 71, 0xFFFF}, | 54 {0x0600, 0x06FF, 13, 1256}, {0x0700, 0x074F, 71, 0xFFFF}, |
55 {0x0750, 0x077F, 13, 0xFFFF}, {0x0780, 0x07BF, 72, 0xFFFF}, | 55 {0x0750, 0x077F, 13, 0xFFFF}, {0x0780, 0x07BF, 72, 0xFFFF}, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 if (wUnicode < usb.wStartUnicode) { | 144 if (wUnicode < usb.wStartUnicode) { |
145 iEnd = iMid - 1; | 145 iEnd = iMid - 1; |
146 } else if (wUnicode > usb.wEndUnicode) { | 146 } else if (wUnicode > usb.wEndUnicode) { |
147 iStart = iMid + 1; | 147 iStart = iMid + 1; |
148 } else { | 148 } else { |
149 return &usb; | 149 return &usb; |
150 } | 150 } |
151 } while (iStart <= iEnd); | 151 } while (iStart <= iEnd); |
152 return NULL; | 152 return NULL; |
153 } | 153 } |
OLD | NEW |