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

Side by Side Diff: fpdfsdk/src/fpdf_sysfontinfo.cpp

Issue 1268323004: Allow external font-path configuration from pdfium_test. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Remove python driver changes Created 5 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
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 #include "../../public/fpdf_sysfontinfo.h" 7 #include "../../public/fpdf_sysfontinfo.h"
8 #include "../include/fsdk_define.h" 8 #include "../include/fsdk_define.h"
9 #include "../include/pdfwindow/PWL_FontMap.h" 9 #include "../include/pdfwindow/PWL_FontMap.h"
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 ->m_pFontInfo->GetFontCharset(hFont, charset)) 161 ->m_pFontInfo->GetFontCharset(hFont, charset))
162 return 0; 162 return 0;
163 return charset; 163 return charset;
164 } 164 }
165 165
166 static void DefaultDeleteFont(struct _FPDF_SYSFONTINFO* pThis, void* hFont) { 166 static void DefaultDeleteFont(struct _FPDF_SYSFONTINFO* pThis, void* hFont) {
167 ((FPDF_SYSFONTINFO_DEFAULT*)pThis)->m_pFontInfo->DeleteFont(hFont); 167 ((FPDF_SYSFONTINFO_DEFAULT*)pThis)->m_pFontInfo->DeleteFont(hFont);
168 } 168 }
169 169
170 DLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo() { 170 DLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo() {
171 IFX_SystemFontInfo* pFontInfo = IFX_SystemFontInfo::CreateDefault(); 171 IFX_SystemFontInfo* pFontInfo = IFX_SystemFontInfo::CreateDefault(nullptr);
172 if (pFontInfo == NULL) 172 if (pFontInfo == NULL)
173 return NULL; 173 return NULL;
174 174
175 FPDF_SYSFONTINFO_DEFAULT* pFontInfoExt = 175 FPDF_SYSFONTINFO_DEFAULT* pFontInfoExt =
176 FX_Alloc(FPDF_SYSFONTINFO_DEFAULT, 1); 176 FX_Alloc(FPDF_SYSFONTINFO_DEFAULT, 1);
177 pFontInfoExt->DeleteFont = DefaultDeleteFont; 177 pFontInfoExt->DeleteFont = DefaultDeleteFont;
178 pFontInfoExt->EnumFonts = DefaultEnumFonts; 178 pFontInfoExt->EnumFonts = DefaultEnumFonts;
179 pFontInfoExt->GetFaceName = DefaultGetFaceName; 179 pFontInfoExt->GetFaceName = DefaultGetFaceName;
180 pFontInfoExt->GetFont = DefaultGetFont; 180 pFontInfoExt->GetFont = DefaultGetFont;
181 pFontInfoExt->GetFontCharset = DefaultGetFontCharset; 181 pFontInfoExt->GetFontCharset = DefaultGetFontCharset;
182 pFontInfoExt->GetFontData = DefaultGetFontData; 182 pFontInfoExt->GetFontData = DefaultGetFontData;
183 pFontInfoExt->MapFont = DefaultMapFont; 183 pFontInfoExt->MapFont = DefaultMapFont;
184 pFontInfoExt->Release = DefaultRelease; 184 pFontInfoExt->Release = DefaultRelease;
185 pFontInfoExt->version = 1; 185 pFontInfoExt->version = 1;
186 pFontInfoExt->m_pFontInfo = pFontInfo; 186 pFontInfoExt->m_pFontInfo = pFontInfo;
187 return pFontInfoExt; 187 return pFontInfoExt;
188 } 188 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698