summaryrefslogtreecommitdiff
path: root/core/fxge/android/fx_android_font.cpp
diff options
context:
space:
mode:
authornpm <npm@chromium.org>2016-10-25 14:26:39 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-25 14:26:39 -0700
commitcfcc11e53a60b3f56a9bbe13718ecb9b997384da (patch)
tree7ac6fc6f1bf8f180769021f51c7235db21da4eb1 /core/fxge/android/fx_android_font.cpp
parent4ee6139e8cfecab9e181115894b26131ad6de09a (diff)
downloadpdfium-cfcc11e53a60b3f56a9bbe13718ecb9b997384da.tar.xz
Name core/fxge/android files appropriately and use one file per class
- Rename files so that they correspond to class names. - Remove OS_Android ifs, since they are unneeded. - Split fpf_skiafontmgr.h into classes, one per file. Review-Url: https://codereview.chromium.org/2448293002
Diffstat (limited to 'core/fxge/android/fx_android_font.cpp')
-rw-r--r--core/fxge/android/fx_android_font.cpp91
1 files changed, 0 insertions, 91 deletions
diff --git a/core/fxge/android/fx_android_font.cpp b/core/fxge/android/fx_android_font.cpp
deleted file mode 100644
index 2ffc897332..0000000000
--- a/core/fxge/android/fx_android_font.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "core/fxcrt/fx_system.h"
-
-#if _FX_OS_ == _FX_ANDROID_
-
-#include "core/fxge/android/fpf_skiafont.h"
-#include "core/fxge/android/fpf_skiafontmgr.h"
-#include "core/fxge/android/fx_android_font.h"
-#include "core/fxge/cfx_fontmapper.h"
-
-CFX_AndroidFontInfo::CFX_AndroidFontInfo() : m_pFontMgr(nullptr) {}
-CFX_AndroidFontInfo::~CFX_AndroidFontInfo() {}
-FX_BOOL CFX_AndroidFontInfo::Init(CFPF_SkiaFontMgr* pFontMgr) {
- if (!pFontMgr)
- return FALSE;
-
- pFontMgr->LoadSystemFonts();
- m_pFontMgr = pFontMgr;
- return TRUE;
-}
-
-FX_BOOL CFX_AndroidFontInfo::EnumFontList(CFX_FontMapper* pMapper) {
- return FALSE;
-}
-
-void* CFX_AndroidFontInfo::MapFont(int weight,
- FX_BOOL bItalic,
- int charset,
- int pitch_family,
- const FX_CHAR* face,
- int& iExact) {
- if (!m_pFontMgr)
- return nullptr;
-
- uint32_t 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);
-}
-
-void* CFX_AndroidFontInfo::GetFont(const FX_CHAR* face) {
- return nullptr;
-}
-
-uint32_t CFX_AndroidFontInfo::GetFontData(void* hFont,
- uint32_t table,
- uint8_t* buffer,
- uint32_t size) {
- if (!hFont)
- return 0;
- return static_cast<CFPF_SkiaFont*>(hFont)->GetFontData(table, buffer, size);
-}
-
-FX_BOOL CFX_AndroidFontInfo::GetFaceName(void* hFont, CFX_ByteString& name) {
- if (!hFont)
- return FALSE;
-
- name = static_cast<CFPF_SkiaFont*>(hFont)->GetFamilyName();
- return TRUE;
-}
-
-FX_BOOL CFX_AndroidFontInfo::GetFontCharset(void* hFont, int& charset) {
- if (!hFont)
- return FALSE;
-
- charset = static_cast<CFPF_SkiaFont*>(hFont)->GetCharset();
- return FALSE;
-}
-
-void CFX_AndroidFontInfo::DeleteFont(void* hFont) {
- if (!hFont)
- return;
-
- static_cast<CFPF_SkiaFont*>(hFont)->Release();
-}
-
-#endif // _FX_OS_ == _FX_ANDROID_