| 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 "fx_fpf.h" | 7 #include "fx_fpf.h" |
| 8 #if _FX_OS_ == _FX_ANDROID_ | 8 #if _FX_OS_ == _FX_ANDROID_ |
| 9 CFX_AndroidFontInfo::CFX_AndroidFontInfo() | 9 CFX_AndroidFontInfo::CFX_AndroidFontInfo() |
| 10 : m_pFontMgr(NULL) | 10 : m_pFontMgr(NULL) |
| 11 { | 11 { |
| 12 } | 12 } |
| 13 FX_BOOL CFX_AndroidFontInfo::Init(IFPF_FontMgr *pFontMgr) | 13 bool CFX_AndroidFontInfo::Init(IFPF_FontMgr *pFontMgr) |
| 14 { | 14 { |
| 15 if (!pFontMgr) { | 15 if (!pFontMgr) { |
| 16 return FALSE; | 16 return false; |
| 17 } | 17 } |
| 18 pFontMgr->LoadSystemFonts(); | 18 pFontMgr->LoadSystemFonts(); |
| 19 m_pFontMgr = pFontMgr; | 19 m_pFontMgr = pFontMgr; |
| 20 return TRUE; | 20 return true; |
| 21 } | 21 } |
| 22 FX_BOOL CFX_AndroidFontInfo::EnumFontList(CFX_FontMapper* pMapper) | 22 bool CFX_AndroidFontInfo::EnumFontList(CFX_FontMapper* pMapper) |
| 23 { | 23 { |
| 24 return FALSE; | 24 return false; |
| 25 } | 25 } |
| 26 void* CFX_AndroidFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int
pitch_family, const FX_CHAR* face, FX_BOOL& bExact) | 26 void* CFX_AndroidFontInfo::MapFont(int weight, bool bItalic, int charset, int pi
tch_family, const FX_CHAR* face, bool& bExact) |
| 27 { | 27 { |
| 28 if (!m_pFontMgr) { | 28 if (!m_pFontMgr) { |
| 29 return NULL; | 29 return NULL; |
| 30 } | 30 } |
| 31 FX_DWORD dwStyle = 0; | 31 FX_DWORD dwStyle = 0; |
| 32 if (weight >= 700) { | 32 if (weight >= 700) { |
| 33 dwStyle |= FXFONT_BOLD; | 33 dwStyle |= FXFONT_BOLD; |
| 34 } | 34 } |
| 35 if (bItalic) { | 35 if (bItalic) { |
| 36 dwStyle |= FXFONT_ITALIC; | 36 dwStyle |= FXFONT_ITALIC; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 50 { | 50 { |
| 51 return NULL; | 51 return NULL; |
| 52 } | 52 } |
| 53 FX_DWORD CFX_AndroidFontInfo::GetFontData(void* hFont, FX_DWORD table, uint8_t*
buffer, FX_DWORD size) | 53 FX_DWORD CFX_AndroidFontInfo::GetFontData(void* hFont, FX_DWORD table, uint8_t*
buffer, FX_DWORD size) |
| 54 { | 54 { |
| 55 if (!hFont) { | 55 if (!hFont) { |
| 56 return 0; | 56 return 0; |
| 57 } | 57 } |
| 58 return ((IFPF_Font*)hFont)->GetFontData(table, buffer, size); | 58 return ((IFPF_Font*)hFont)->GetFontData(table, buffer, size); |
| 59 } | 59 } |
| 60 FX_BOOL CFX_AndroidFontInfo::GetFaceName(void* hFont, CFX_ByteString& name) | 60 bool CFX_AndroidFontInfo::GetFaceName(void* hFont, CFX_ByteString& name) |
| 61 { | 61 { |
| 62 if (!hFont) { | 62 if (!hFont) { |
| 63 return FALSE; | 63 return false; |
| 64 } | 64 } |
| 65 name = ((IFPF_Font*)hFont)->GetFamilyName(); | 65 name = ((IFPF_Font*)hFont)->GetFamilyName(); |
| 66 return TRUE; | 66 return true; |
| 67 } | 67 } |
| 68 FX_BOOL CFX_AndroidFontInfo::GetFontCharset(void* hFont, int& charset) | 68 bool CFX_AndroidFontInfo::GetFontCharset(void* hFont, int& charset) |
| 69 { | 69 { |
| 70 if (!hFont) { | 70 if (!hFont) { |
| 71 return FALSE; | 71 return false; |
| 72 } | 72 } |
| 73 charset = ((IFPF_Font*)hFont)->GetCharset(); | 73 charset = ((IFPF_Font*)hFont)->GetCharset(); |
| 74 return FALSE; | 74 return false; |
| 75 } | 75 } |
| 76 void CFX_AndroidFontInfo::DeleteFont(void* hFont) | 76 void CFX_AndroidFontInfo::DeleteFont(void* hFont) |
| 77 { | 77 { |
| 78 if (!hFont) { | 78 if (!hFont) { |
| 79 return; | 79 return; |
| 80 } | 80 } |
| 81 ((IFPF_Font*)hFont)->Release(); | 81 ((IFPF_Font*)hFont)->Release(); |
| 82 } | 82 } |
| 83 void* CFX_AndroidFontInfo::RetainFont(void* hFont) | 83 void* CFX_AndroidFontInfo::RetainFont(void* hFont) |
| 84 { | 84 { |
| 85 return NULL; | 85 return NULL; |
| 86 } | 86 } |
| 87 #endif | 87 #endif |
| OLD | NEW |