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 <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "core/fxge/fontdata/chromefontdata/chromefontdata.h" | 11 #include "core/fxge/fontdata/chromefontdata/chromefontdata.h" |
12 #include "core/fxge/ge/fx_text_int.h" | 12 #include "core/fxge/ge/fx_text_int.h" |
13 #include "core/include/fxge/fx_freetype.h" | 13 #include "core/fxge/include/fx_freetype.h" |
14 #include "core/include/fxge/fx_ge.h" | 14 #include "core/fxge/include/fx_ge.h" |
15 #include "third_party/base/stl_util.h" | 15 #include "third_party/base/stl_util.h" |
16 | 16 |
17 #define GET_TT_SHORT(w) (uint16_t)(((w)[0] << 8) | (w)[1]) | 17 #define GET_TT_SHORT(w) (uint16_t)(((w)[0] << 8) | (w)[1]) |
18 #define GET_TT_LONG(w) \ | 18 #define GET_TT_LONG(w) \ |
19 (uint32_t)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3]) | 19 (uint32_t)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3]) |
20 | 20 |
21 #define FX_FONT_STYLE_None 0x00 | 21 #define FX_FONT_STYLE_None 0x00 |
22 #define FX_FONT_STYLE_Bold 0x01 | 22 #define FX_FONT_STYLE_Bold 0x01 |
23 #define FX_FONT_STYLE_Italic 0x02 | 23 #define FX_FONT_STYLE_Italic 0x02 |
24 #define FX_FONT_STYLE_BoldBold 0x04 | 24 #define FX_FONT_STYLE_BoldBold 0x04 |
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1644 int PDF_GetStandardFontName(CFX_ByteString* name) { | 1644 int PDF_GetStandardFontName(CFX_ByteString* name) { |
1645 AltFontName* found = static_cast<AltFontName*>( | 1645 AltFontName* found = static_cast<AltFontName*>( |
1646 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), | 1646 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), |
1647 sizeof(AltFontName), CompareString)); | 1647 sizeof(AltFontName), CompareString)); |
1648 if (!found) | 1648 if (!found) |
1649 return -1; | 1649 return -1; |
1650 | 1650 |
1651 *name = g_Base14FontNames[found->m_Index]; | 1651 *name = g_Base14FontNames[found->m_Index]; |
1652 return found->m_Index; | 1652 return found->m_Index; |
1653 } | 1653 } |
OLD | NEW |