| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 static uint32_t FPF_SkiaGetCharset(uint8_t uCharset) { | 140 static uint32_t FPF_SkiaGetCharset(uint8_t uCharset) { |
| 141 switch (uCharset) { | 141 switch (uCharset) { |
| 142 case FXFONT_ANSI_CHARSET: | 142 case FXFONT_ANSI_CHARSET: |
| 143 return FPF_SKIACHARSET_Ansi; | 143 return FPF_SKIACHARSET_Ansi; |
| 144 case FXFONT_DEFAULT_CHARSET: | 144 case FXFONT_DEFAULT_CHARSET: |
| 145 return FPF_SKIACHARSET_Default; | 145 return FPF_SKIACHARSET_Default; |
| 146 case FXFONT_SYMBOL_CHARSET: | 146 case FXFONT_SYMBOL_CHARSET: |
| 147 return FPF_SKIACHARSET_Symbol; | 147 return FPF_SKIACHARSET_Symbol; |
| 148 case FXFONT_SHIFTJIS_CHARSET: | 148 case FXFONT_SHIFTJIS_CHARSET: |
| 149 return FPF_SKIACHARSET_ShiftJIS; | 149 return FPF_SKIACHARSET_ShiftJIS; |
| 150 case FXFONT_HANGEUL_CHARSET: | 150 case FXFONT_HANGUL_CHARSET: |
| 151 return FPF_SKIACHARSET_Korean; | 151 return FPF_SKIACHARSET_Korean; |
| 152 case FXFONT_GB2312_CHARSET: | 152 case FXFONT_GB2312_CHARSET: |
| 153 return FPF_SKIACHARSET_GB2312; | 153 return FPF_SKIACHARSET_GB2312; |
| 154 case FXFONT_CHINESEBIG5_CHARSET: | 154 case FXFONT_CHINESEBIG5_CHARSET: |
| 155 return FPF_SKIACHARSET_BIG5; | 155 return FPF_SKIACHARSET_BIG5; |
| 156 case FXFONT_GREEK_CHARSET: | 156 case FXFONT_GREEK_CHARSET: |
| 157 return FPF_SKIACHARSET_Greek; | 157 return FPF_SKIACHARSET_Greek; |
| 158 case FXFONT_TURKISH_CHARSET: | 158 case FXFONT_TURKISH_CHARSET: |
| 159 return FPF_SKIACHARSET_Turkish; | 159 return FPF_SKIACHARSET_Turkish; |
| 160 case FXFONT_HEBREW_CHARSET: | 160 case FXFONT_HEBREW_CHARSET: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } | 197 } |
| 198 if (dwStyle & FXFONT_SERIF) { | 198 if (dwStyle & FXFONT_SERIF) { |
| 199 bsFont += "Serif"; | 199 bsFont += "Serif"; |
| 200 } | 200 } |
| 201 bsFont += uCharset; | 201 bsFont += uCharset; |
| 202 return FPF_GetHashCode_StringA(bsFont.c_str(), bsFont.GetLength(), TRUE); | 202 return FPF_GetHashCode_StringA(bsFont.c_str(), bsFont.GetLength(), TRUE); |
| 203 } | 203 } |
| 204 static FX_BOOL FPF_SkiaIsCJK(uint8_t uCharset) { | 204 static FX_BOOL FPF_SkiaIsCJK(uint8_t uCharset) { |
| 205 return (uCharset == FXFONT_GB2312_CHARSET) || | 205 return (uCharset == FXFONT_GB2312_CHARSET) || |
| 206 (uCharset == FXFONT_CHINESEBIG5_CHARSET) || | 206 (uCharset == FXFONT_CHINESEBIG5_CHARSET) || |
| 207 (uCharset == FXFONT_HANGEUL_CHARSET) || | 207 (uCharset == FXFONT_HANGUL_CHARSET) || |
| 208 (uCharset == FXFONT_SHIFTJIS_CHARSET); | 208 (uCharset == FXFONT_SHIFTJIS_CHARSET); |
| 209 } | 209 } |
| 210 static FX_BOOL FPF_SkiaMaybeSymbol(const CFX_ByteStringC& bsFacename) { | 210 static FX_BOOL FPF_SkiaMaybeSymbol(const CFX_ByteStringC& bsFacename) { |
| 211 CFX_ByteString bsName(bsFacename); | 211 CFX_ByteString bsName(bsFacename); |
| 212 bsName.MakeLower(); | 212 bsName.MakeLower(); |
| 213 return bsName.Find("symbol") > -1; | 213 return bsName.Find("symbol") > -1; |
| 214 } | 214 } |
| 215 static FX_BOOL FPF_SkiaMaybeArabic(const CFX_ByteStringC& bsFacename) { | 215 static FX_BOOL FPF_SkiaMaybeArabic(const CFX_ByteStringC& bsFacename) { |
| 216 CFX_ByteString bsName(bsFacename); | 216 CFX_ByteString bsName(bsFacename); |
| 217 bsName.MakeLower(); | 217 bsName.MakeLower(); |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 } | 514 } |
| 515 if (pOS2 && (pOS2->ulCodePageRange1 & (1 << 31))) { | 515 if (pOS2 && (pOS2->ulCodePageRange1 & (1 << 31))) { |
| 516 pFontDesc->m_dwStyle |= FXFONT_SYMBOLIC; | 516 pFontDesc->m_dwStyle |= FXFONT_SYMBOLIC; |
| 517 } | 517 } |
| 518 pFontDesc->m_dwCharsets = FPF_SkiaGetFaceCharset(pOS2); | 518 pFontDesc->m_dwCharsets = FPF_SkiaGetFaceCharset(pOS2); |
| 519 pFontDesc->m_iFaceIndex = face->face_index; | 519 pFontDesc->m_iFaceIndex = face->face_index; |
| 520 pFontDesc->m_iGlyphNum = face->num_glyphs; | 520 pFontDesc->m_iGlyphNum = face->num_glyphs; |
| 521 } | 521 } |
| 522 void CFPF_SkiaFontMgr::OutputSystemFonts() {} | 522 void CFPF_SkiaFontMgr::OutputSystemFonts() {} |
| 523 #endif | 523 #endif |
| OLD | NEW |