John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 1 | // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Lei Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 4 | |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
Lei Zhang | b4e7f30 | 2015-11-06 15:52:32 -0800 | [diff] [blame] | 7 | #include "public/fpdf_sysfontinfo.h" |
| 8 | |
Dan Sinclair | 85c8e7f | 2016-11-21 13:50:32 -0500 | [diff] [blame] | 9 | #include <memory> |
| 10 | |
Dan Sinclair | f51a02a | 2017-04-19 12:46:53 -0400 | [diff] [blame] | 11 | #include "core/fxcrt/fx_codepage.h" |
dsinclair | 74a34fc | 2016-09-29 16:41:42 -0700 | [diff] [blame] | 12 | #include "core/fxge/cfx_fontmapper.h" |
| 13 | #include "core/fxge/cfx_gemodule.h" |
| 14 | #include "core/fxge/fx_font.h" |
| 15 | #include "core/fxge/ifx_systemfontinfo.h" |
dsinclair | 114e46a | 2016-09-29 17:18:21 -0700 | [diff] [blame] | 16 | #include "fpdfsdk/fsdk_define.h" |
Dan Sinclair | c411eb9 | 2017-07-25 09:39:30 -0400 | [diff] [blame] | 17 | #include "fpdfsdk/pwl/cpwl_font_map.h" |
Tom Sepez | fe91c6c | 2017-05-16 15:33:20 -0700 | [diff] [blame] | 18 | #include "third_party/base/ptr_util.h" |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 19 | |
Dan Sinclair | f51a02a | 2017-04-19 12:46:53 -0400 | [diff] [blame] | 20 | static_assert(FXFONT_ANSI_CHARSET == FX_CHARSET_ANSI, "Charset must match"); |
| 21 | static_assert(FXFONT_DEFAULT_CHARSET == FX_CHARSET_Default, |
| 22 | "Charset must match"); |
| 23 | static_assert(FXFONT_SYMBOL_CHARSET == FX_CHARSET_Symbol, "Charset must match"); |
| 24 | static_assert(FXFONT_SHIFTJIS_CHARSET == FX_CHARSET_ShiftJIS, |
| 25 | "Charset must match"); |
| 26 | static_assert(FXFONT_HANGEUL_CHARSET == FX_CHARSET_Hangul, |
| 27 | "Charset must match"); |
| 28 | static_assert(FXFONT_GB2312_CHARSET == FX_CHARSET_ChineseSimplified, |
| 29 | "Charset must match"); |
| 30 | static_assert(FXFONT_CHINESEBIG5_CHARSET == FX_CHARSET_ChineseTraditional, |
| 31 | "Charset must match"); |
| 32 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 33 | class CFX_ExternalFontInfo final : public IFX_SystemFontInfo { |
| 34 | public: |
Lei Zhang | 2b1a2d5 | 2015-08-14 22:16:22 -0700 | [diff] [blame] | 35 | explicit CFX_ExternalFontInfo(FPDF_SYSFONTINFO* pInfo) : m_pInfo(pInfo) {} |
thestig | 24508df | 2016-05-27 15:14:20 -0700 | [diff] [blame] | 36 | ~CFX_ExternalFontInfo() override { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 37 | if (m_pInfo->Release) |
| 38 | m_pInfo->Release(m_pInfo); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 39 | } |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 40 | |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 41 | bool EnumFontList(CFX_FontMapper* pMapper) override { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 42 | if (m_pInfo->EnumFonts) { |
| 43 | m_pInfo->EnumFonts(m_pInfo, pMapper); |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 44 | return true; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 45 | } |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 46 | return false; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 47 | } |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 48 | |
Lei Zhang | 2b1a2d5 | 2015-08-14 22:16:22 -0700 | [diff] [blame] | 49 | void* MapFont(int weight, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 50 | bool bItalic, |
Lei Zhang | 2b1a2d5 | 2015-08-14 22:16:22 -0700 | [diff] [blame] | 51 | int charset, |
| 52 | int pitch_family, |
Dan Sinclair | 812e96c | 2017-03-13 16:43:37 -0400 | [diff] [blame] | 53 | const char* family, |
Lei Zhang | 2b1a2d5 | 2015-08-14 22:16:22 -0700 | [diff] [blame] | 54 | int& iExact) override { |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 55 | if (!m_pInfo->MapFont) |
| 56 | return nullptr; |
| 57 | return m_pInfo->MapFont(m_pInfo, weight, bItalic, charset, pitch_family, |
| 58 | family, &iExact); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 59 | } |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 60 | |
Dan Sinclair | 812e96c | 2017-03-13 16:43:37 -0400 | [diff] [blame] | 61 | void* GetFont(const char* family) override { |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 62 | if (!m_pInfo->GetFont) |
| 63 | return nullptr; |
| 64 | return m_pInfo->GetFont(m_pInfo, family); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 65 | } |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 66 | |
tsepez | c3255f5 | 2016-03-25 14:52:27 -0700 | [diff] [blame] | 67 | uint32_t GetFontData(void* hFont, |
| 68 | uint32_t table, |
Lei Zhang | 2b1a2d5 | 2015-08-14 22:16:22 -0700 | [diff] [blame] | 69 | uint8_t* buffer, |
tsepez | c3255f5 | 2016-03-25 14:52:27 -0700 | [diff] [blame] | 70 | uint32_t size) override { |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 71 | if (!m_pInfo->GetFontData) |
| 72 | return 0; |
| 73 | return m_pInfo->GetFontData(m_pInfo, hFont, table, buffer, size); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 74 | } |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 75 | |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 76 | bool GetFaceName(void* hFont, ByteString* name) override { |
Lei Zhang | 412e908 | 2015-12-14 18:34:00 -0800 | [diff] [blame] | 77 | if (!m_pInfo->GetFaceName) |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 78 | return false; |
thestig | 1cd352e | 2016-06-07 17:53:06 -0700 | [diff] [blame] | 79 | uint32_t size = m_pInfo->GetFaceName(m_pInfo, hFont, nullptr, 0); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 80 | if (size == 0) |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 81 | return false; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 82 | char* buffer = FX_Alloc(char, size); |
| 83 | size = m_pInfo->GetFaceName(m_pInfo, hFont, buffer, size); |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 84 | *name = ByteString(buffer, size); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 85 | FX_Free(buffer); |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 86 | return true; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 87 | } |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 88 | |
Tom Sepez | ec8ff7d | 2017-04-07 16:58:00 -0700 | [diff] [blame] | 89 | bool GetFontCharset(void* hFont, int* charset) override { |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 90 | if (!m_pInfo->GetFontCharset) |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 91 | return false; |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 92 | |
Tom Sepez | ec8ff7d | 2017-04-07 16:58:00 -0700 | [diff] [blame] | 93 | *charset = m_pInfo->GetFontCharset(m_pInfo, hFont); |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 94 | return true; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 95 | } |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 96 | |
Lei Zhang | 2b1a2d5 | 2015-08-14 22:16:22 -0700 | [diff] [blame] | 97 | void DeleteFont(void* hFont) override { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 98 | if (m_pInfo->DeleteFont) |
| 99 | m_pInfo->DeleteFont(m_pInfo, hFont); |
| 100 | } |
Tom Sepez | e5b59ca | 2015-01-09 11:46:17 -0800 | [diff] [blame] | 101 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 102 | private: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 103 | FPDF_SYSFONTINFO* const m_pInfo; |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 104 | }; |
| 105 | |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 106 | FPDF_EXPORT void FPDF_CALLCONV FPDF_AddInstalledFont(void* mapper, |
| 107 | const char* name, |
| 108 | int charset) { |
Nicolas Pena | 46abb66 | 2017-05-17 17:23:22 -0400 | [diff] [blame] | 109 | CFX_FontMapper* pMapper = static_cast<CFX_FontMapper*>(mapper); |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 110 | pMapper->AddInstalledFont(name, charset); |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 111 | } |
| 112 | |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 113 | FPDF_EXPORT void FPDF_CALLCONV |
| 114 | FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfoExt) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 115 | if (pFontInfoExt->version != 1) |
| 116 | return; |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 117 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 118 | CFX_GEModule::Get()->GetFontMgr()->SetSystemFontInfo( |
Tom Sepez | fe91c6c | 2017-05-16 15:33:20 -0700 | [diff] [blame] | 119 | pdfium::MakeUnique<CFX_ExternalFontInfo>(pFontInfoExt)); |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 120 | } |
| 121 | |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 122 | FPDF_EXPORT const FPDF_CharsetFontMap* FPDF_CALLCONV FPDF_GetDefaultTTFMap() { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 123 | return CPWL_FontMap::defaultTTFMap; |
Tom Sepez | 2a0bb3b | 2015-05-12 12:37:14 -0700 | [diff] [blame] | 124 | } |
| 125 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 126 | struct FPDF_SYSFONTINFO_DEFAULT : public FPDF_SYSFONTINFO { |
Dan Sinclair | aee0db0 | 2017-09-21 16:53:58 -0400 | [diff] [blame] | 127 | UnownedPtr<IFX_SystemFontInfo> m_pFontInfo; |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 128 | }; |
| 129 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 130 | static void DefaultRelease(struct _FPDF_SYSFONTINFO* pThis) { |
thestig | 24508df | 2016-05-27 15:14:20 -0700 | [diff] [blame] | 131 | auto* pDefault = static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pThis); |
Tom Sepez | d0409af | 2017-05-25 15:53:57 -0700 | [diff] [blame] | 132 | delete pDefault->m_pFontInfo.Release(); |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 133 | } |
| 134 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 135 | static void DefaultEnumFonts(struct _FPDF_SYSFONTINFO* pThis, void* pMapper) { |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 136 | auto* pDefault = static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pThis); |
| 137 | pDefault->m_pFontInfo->EnumFontList((CFX_FontMapper*)pMapper); |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 138 | } |
| 139 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 140 | static void* DefaultMapFont(struct _FPDF_SYSFONTINFO* pThis, |
| 141 | int weight, |
| 142 | int bItalic, |
| 143 | int charset, |
| 144 | int pitch_family, |
| 145 | const char* family, |
| 146 | int* bExact) { |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 147 | auto* pDefault = static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pThis); |
tsepez | 95e5834 | 2016-10-28 11:34:42 -0700 | [diff] [blame] | 148 | return pDefault->m_pFontInfo->MapFont(weight, !!bItalic, charset, |
| 149 | pitch_family, family, *bExact); |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 150 | } |
| 151 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 152 | void* DefaultGetFont(struct _FPDF_SYSFONTINFO* pThis, const char* family) { |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 153 | auto* pDefault = static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pThis); |
| 154 | return pDefault->m_pFontInfo->GetFont(family); |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 155 | } |
| 156 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 157 | static unsigned long DefaultGetFontData(struct _FPDF_SYSFONTINFO* pThis, |
| 158 | void* hFont, |
| 159 | unsigned int table, |
| 160 | unsigned char* buffer, |
| 161 | unsigned long buf_size) { |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 162 | auto* pDefault = static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pThis); |
| 163 | return pDefault->m_pFontInfo->GetFontData(hFont, table, buffer, buf_size); |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 164 | } |
| 165 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 166 | static unsigned long DefaultGetFaceName(struct _FPDF_SYSFONTINFO* pThis, |
| 167 | void* hFont, |
| 168 | char* buffer, |
| 169 | unsigned long buf_size) { |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 170 | ByteString name; |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 171 | auto* pDefault = static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pThis); |
Tom Sepez | ec8ff7d | 2017-04-07 16:58:00 -0700 | [diff] [blame] | 172 | if (!pDefault->m_pFontInfo->GetFaceName(hFont, &name)) |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 173 | return 0; |
Ryan Harrison | 875e98c | 2017-09-27 10:53:11 -0400 | [diff] [blame] | 174 | if (name.GetLength() >= static_cast<size_t>(buf_size)) |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 175 | return name.GetLength() + 1; |
Dan Sinclair | 7e7c649 | 2017-04-03 14:50:05 -0400 | [diff] [blame] | 176 | |
| 177 | strncpy(buffer, name.c_str(), |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 178 | (name.GetLength() + 1) * sizeof(ByteString::CharType)); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 179 | return name.GetLength() + 1; |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 180 | } |
| 181 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 182 | static int DefaultGetFontCharset(struct _FPDF_SYSFONTINFO* pThis, void* hFont) { |
| 183 | int charset; |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 184 | auto* pDefault = static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pThis); |
Tom Sepez | ec8ff7d | 2017-04-07 16:58:00 -0700 | [diff] [blame] | 185 | if (!pDefault->m_pFontInfo->GetFontCharset(hFont, &charset)) |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 186 | return 0; |
| 187 | return charset; |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 188 | } |
| 189 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 190 | static void DefaultDeleteFont(struct _FPDF_SYSFONTINFO* pThis, void* hFont) { |
thestig | 907a522 | 2016-06-21 14:38:27 -0700 | [diff] [blame] | 191 | auto* pDefault = static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pThis); |
| 192 | pDefault->m_pFontInfo->DeleteFont(hFont); |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 193 | } |
| 194 | |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 195 | FPDF_EXPORT FPDF_SYSFONTINFO* FPDF_CALLCONV FPDF_GetDefaultSystemFontInfo() { |
thestig | 24508df | 2016-05-27 15:14:20 -0700 | [diff] [blame] | 196 | std::unique_ptr<IFX_SystemFontInfo> pFontInfo = |
| 197 | IFX_SystemFontInfo::CreateDefault(nullptr); |
Lei Zhang | 412e908 | 2015-12-14 18:34:00 -0800 | [diff] [blame] | 198 | if (!pFontInfo) |
thestig | 24508df | 2016-05-27 15:14:20 -0700 | [diff] [blame] | 199 | return nullptr; |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 200 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 201 | FPDF_SYSFONTINFO_DEFAULT* pFontInfoExt = |
| 202 | FX_Alloc(FPDF_SYSFONTINFO_DEFAULT, 1); |
| 203 | pFontInfoExt->DeleteFont = DefaultDeleteFont; |
| 204 | pFontInfoExt->EnumFonts = DefaultEnumFonts; |
| 205 | pFontInfoExt->GetFaceName = DefaultGetFaceName; |
| 206 | pFontInfoExt->GetFont = DefaultGetFont; |
| 207 | pFontInfoExt->GetFontCharset = DefaultGetFontCharset; |
| 208 | pFontInfoExt->GetFontData = DefaultGetFontData; |
| 209 | pFontInfoExt->MapFont = DefaultMapFont; |
| 210 | pFontInfoExt->Release = DefaultRelease; |
| 211 | pFontInfoExt->version = 1; |
thestig | 24508df | 2016-05-27 15:14:20 -0700 | [diff] [blame] | 212 | pFontInfoExt->m_pFontInfo = pFontInfo.release(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 213 | return pFontInfoExt; |
John Abd-El-Malek | 5110c47 | 2014-05-17 22:33:34 -0700 | [diff] [blame] | 214 | } |
npm | 788217d | 2016-11-08 16:48:36 -0800 | [diff] [blame] | 215 | |
Dan Sinclair | 00d2ad1 | 2017-08-10 14:13:02 -0400 | [diff] [blame] | 216 | FPDF_EXPORT void FPDF_CALLCONV |
Dan Sinclair | 4bb4e84 | 2017-07-18 09:58:58 -0400 | [diff] [blame] | 217 | FPDF_FreeDefaultSystemFontInfo(FPDF_SYSFONTINFO* pDefaultFontInfo) { |
npm | be6b148 | 2016-11-10 10:12:30 -0800 | [diff] [blame] | 218 | FX_Free(static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pDefaultFontInfo)); |
npm | 788217d | 2016-11-08 16:48:36 -0800 | [diff] [blame] | 219 | } |