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 "core/fxcrt/include/fx_system.h" | 7 #include "core/fxcrt/include/fx_system.h" |
8 | 8 |
9 #if _FX_OS_ == _FX_ANDROID_ | 9 #if _FX_OS_ == _FX_ANDROID_ |
10 | 10 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 if (m_bLoaded) { | 243 if (m_bLoaded) { |
244 return; | 244 return; |
245 } | 245 } |
246 ScanPath("/system/fonts"); | 246 ScanPath("/system/fonts"); |
247 OutputSystemFonts(); | 247 OutputSystemFonts(); |
248 m_bLoaded = TRUE; | 248 m_bLoaded = TRUE; |
249 } | 249 } |
250 void CFPF_SkiaFontMgr::LoadPrivateFont(IFX_FileRead* pFontFile) {} | 250 void CFPF_SkiaFontMgr::LoadPrivateFont(IFX_FileRead* pFontFile) {} |
251 void CFPF_SkiaFontMgr::LoadPrivateFont(const CFX_ByteStringC& bsFileName) {} | 251 void CFPF_SkiaFontMgr::LoadPrivateFont(const CFX_ByteStringC& bsFileName) {} |
252 void CFPF_SkiaFontMgr::LoadPrivateFont(void* pBuffer, size_t szBuffer) {} | 252 void CFPF_SkiaFontMgr::LoadPrivateFont(void* pBuffer, size_t szBuffer) {} |
253 IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, | 253 CFPF_SkiaFont* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, |
254 uint8_t uCharset, | 254 uint8_t uCharset, |
255 uint32_t dwStyle, | 255 uint32_t dwStyle, |
256 uint32_t dwMatch) { | 256 uint32_t dwMatch) { |
257 uint32_t dwHash = FPF_SKIAGetFamilyHash(bsFamilyname, dwStyle, uCharset); | 257 uint32_t dwHash = FPF_SKIAGetFamilyHash(bsFamilyname, dwStyle, uCharset); |
258 auto it = m_FamilyFonts.find(dwHash); | 258 auto it = m_FamilyFonts.find(dwHash); |
259 if (it != m_FamilyFonts.end() && it->second) | 259 if (it != m_FamilyFonts.end() && it->second) |
260 return it->second->Retain(); | 260 return it->second->Retain(); |
261 | 261 |
262 uint32_t dwFaceName = FPF_SKIANormalizeFontName(bsFamilyname); | 262 uint32_t dwFaceName = FPF_SKIANormalizeFontName(bsFamilyname); |
263 uint32_t dwSubst = FPF_SkiaGetSubstFont(dwFaceName); | 263 uint32_t dwSubst = FPF_SkiaGetSubstFont(dwFaceName); |
264 uint32_t dwSubstSans = FPF_SkiaGetSansFont(dwFaceName); | 264 uint32_t dwSubstSans = FPF_SkiaGetSansFont(dwFaceName); |
265 FX_BOOL bMaybeSymbol = FPF_SkiaMaybeSymbol(bsFamilyname); | 265 FX_BOOL bMaybeSymbol = FPF_SkiaMaybeSymbol(bsFamilyname); |
266 if (uCharset != FXFONT_ARABIC_CHARSET && FPF_SkiaMaybeArabic(bsFamilyname)) { | 266 if (uCharset != FXFONT_ARABIC_CHARSET && FPF_SkiaMaybeArabic(bsFamilyname)) { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 } | 515 } |
516 if (pOS2 && (pOS2->ulCodePageRange1 & (1 << 31))) { | 516 if (pOS2 && (pOS2->ulCodePageRange1 & (1 << 31))) { |
517 pFontDesc->m_dwStyle |= FXFONT_SYMBOLIC; | 517 pFontDesc->m_dwStyle |= FXFONT_SYMBOLIC; |
518 } | 518 } |
519 pFontDesc->m_dwCharsets = FPF_SkiaGetFaceCharset(pOS2); | 519 pFontDesc->m_dwCharsets = FPF_SkiaGetFaceCharset(pOS2); |
520 pFontDesc->m_iFaceIndex = face->face_index; | 520 pFontDesc->m_iFaceIndex = face->face_index; |
521 pFontDesc->m_iGlyphNum = face->num_glyphs; | 521 pFontDesc->m_iGlyphNum = face->num_glyphs; |
522 } | 522 } |
523 void CFPF_SkiaFontMgr::OutputSystemFonts() {} | 523 void CFPF_SkiaFontMgr::OutputSystemFonts() {} |
524 #endif | 524 #endif |
OLD | NEW |