From b048f791a15f2da781a01eba5b09eb9d389f9c11 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 4 Aug 2015 12:19:10 -0700 Subject: clang-format all pdfium code. No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163' | \ xargs ../../buildtools/mac/clang-format -i See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1265503005 . --- core/src/fxge/android/fx_android_font.cpp | 131 +++++++++++++++--------------- 1 file changed, 64 insertions(+), 67 deletions(-) (limited to 'core/src/fxge/android/fx_android_font.cpp') diff --git a/core/src/fxge/android/fx_android_font.cpp b/core/src/fxge/android/fx_android_font.cpp index fd72e47478..f4dfc290a3 100644 --- a/core/src/fxge/android/fx_android_font.cpp +++ b/core/src/fxge/android/fx_android_font.cpp @@ -6,82 +6,79 @@ #include "fx_fpf.h" #if _FX_OS_ == _FX_ANDROID_ -CFX_AndroidFontInfo::CFX_AndroidFontInfo() - : m_pFontMgr(NULL) -{ -} -FX_BOOL CFX_AndroidFontInfo::Init(IFPF_FontMgr *pFontMgr) -{ - if (!pFontMgr) { - return FALSE; - } - pFontMgr->LoadSystemFonts(); - m_pFontMgr = pFontMgr; - return TRUE; -} -FX_BOOL CFX_AndroidFontInfo::EnumFontList(CFX_FontMapper* pMapper) -{ +CFX_AndroidFontInfo::CFX_AndroidFontInfo() : m_pFontMgr(NULL) {} +FX_BOOL CFX_AndroidFontInfo::Init(IFPF_FontMgr* pFontMgr) { + if (!pFontMgr) { return FALSE; + } + pFontMgr->LoadSystemFonts(); + m_pFontMgr = pFontMgr; + return TRUE; } -void* CFX_AndroidFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, int& iExact) -{ - if (!m_pFontMgr) { - return NULL; - } - FX_DWORD dwStyle = 0; - if (weight >= 700) { - dwStyle |= FXFONT_BOLD; - } - if (bItalic) { - dwStyle |= FXFONT_ITALIC; - } - if (pitch_family & FXFONT_FF_FIXEDPITCH) { - dwStyle |= FXFONT_FIXED_PITCH; - } - if (pitch_family & FXFONT_FF_SCRIPT) { - dwStyle |= FXFONT_SCRIPT; - } - if (pitch_family & FXFONT_FF_ROMAN) { - dwStyle |= FXFONT_SERIF; - } - return m_pFontMgr->CreateFont(face, charset, dwStyle, FPF_MATCHFONT_REPLACEANSI); +FX_BOOL CFX_AndroidFontInfo::EnumFontList(CFX_FontMapper* pMapper) { + return FALSE; } -void* CFX_AndroidFontInfo::GetFont(const FX_CHAR* face) -{ +void* CFX_AndroidFontInfo::MapFont(int weight, + FX_BOOL bItalic, + int charset, + int pitch_family, + const FX_CHAR* face, + int& iExact) { + if (!m_pFontMgr) { return NULL; + } + FX_DWORD dwStyle = 0; + if (weight >= 700) { + dwStyle |= FXFONT_BOLD; + } + if (bItalic) { + dwStyle |= FXFONT_ITALIC; + } + if (pitch_family & FXFONT_FF_FIXEDPITCH) { + dwStyle |= FXFONT_FIXED_PITCH; + } + if (pitch_family & FXFONT_FF_SCRIPT) { + dwStyle |= FXFONT_SCRIPT; + } + if (pitch_family & FXFONT_FF_ROMAN) { + dwStyle |= FXFONT_SERIF; + } + return m_pFontMgr->CreateFont(face, charset, dwStyle, + FPF_MATCHFONT_REPLACEANSI); } -FX_DWORD CFX_AndroidFontInfo::GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size) -{ - if (!hFont) { - return 0; - } - return ((IFPF_Font*)hFont)->GetFontData(table, buffer, size); +void* CFX_AndroidFontInfo::GetFont(const FX_CHAR* face) { + return NULL; } -FX_BOOL CFX_AndroidFontInfo::GetFaceName(void* hFont, CFX_ByteString& name) -{ - if (!hFont) { - return FALSE; - } - name = ((IFPF_Font*)hFont)->GetFamilyName(); - return TRUE; +FX_DWORD CFX_AndroidFontInfo::GetFontData(void* hFont, + FX_DWORD table, + uint8_t* buffer, + FX_DWORD size) { + if (!hFont) { + return 0; + } + return ((IFPF_Font*)hFont)->GetFontData(table, buffer, size); } -FX_BOOL CFX_AndroidFontInfo::GetFontCharset(void* hFont, int& charset) -{ - if (!hFont) { - return FALSE; - } - charset = ((IFPF_Font*)hFont)->GetCharset(); +FX_BOOL CFX_AndroidFontInfo::GetFaceName(void* hFont, CFX_ByteString& name) { + if (!hFont) { return FALSE; + } + name = ((IFPF_Font*)hFont)->GetFamilyName(); + return TRUE; } -void CFX_AndroidFontInfo::DeleteFont(void* hFont) -{ - if (!hFont) { - return; - } - ((IFPF_Font*)hFont)->Release(); +FX_BOOL CFX_AndroidFontInfo::GetFontCharset(void* hFont, int& charset) { + if (!hFont) { + return FALSE; + } + charset = ((IFPF_Font*)hFont)->GetCharset(); + return FALSE; } -void* CFX_AndroidFontInfo::RetainFont(void* hFont) -{ - return NULL; +void CFX_AndroidFontInfo::DeleteFont(void* hFont) { + if (!hFont) { + return; + } + ((IFPF_Font*)hFont)->Release(); +} +void* CFX_AndroidFontInfo::RetainFont(void* hFont) { + return NULL; } #endif -- cgit v1.2.3