Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfpf_skiafontmgr.h
Go to the documentation of this file.
1// Copyright 2016 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FXGE_ANDROID_CFPF_SKIAFONTMGR_H_
8#define CORE_FXGE_ANDROID_CFPF_SKIAFONTMGR_H_
9
10#include <map>
11#include <memory>
12#include <vector>
13
14#include "core/fxcrt/bytestring.h"
15#include "core/fxcrt/fx_codepage_forward.h"
16#include "core/fxcrt/retain_ptr.h"
17#include "core/fxge/cfx_face.h"
18#include "core/fxge/freetype/fx_freetype.h"
19
20class CFPF_SkiaFont;
22
24 public:
27
28 void LoadFonts(const char** user_paths);
30 FX_Charset charset,
31 uint32_t style);
32
33 bool InitFTLibrary();
34 RetainPtr<CFX_Face> GetFontFace(ByteStringView path, int32_t face_index);
35
36 private:
37 void ScanPath(const ByteString& path);
38 void ScanFile(const ByteString& file);
39 std::unique_ptr<CFPF_SkiaPathFont> ReportFace(RetainPtr<CFX_Face> face,
40 const ByteString& file);
41
42 bool loaded_fonts_ = false;
43 ScopedFXFTLibraryRec ft_library_;
44 std::vector<std::unique_ptr<CFPF_SkiaPathFont>> font_faces_;
45 // Key is a hash based on CreateFont() parameters.
46 std::map<uint32_t, std::unique_ptr<CFPF_SkiaFont>> family_font_map_;
47};
48
49#endif // CORE_FXGE_ANDROID_CFPF_SKIAFONTMGR_H_
fxcrt::ByteString ByteString
Definition bytestring.h:180
CFPF_SkiaDeviceModule * CFPF_GetSkiaDeviceModule()
CFPF_SkiaFontMgr * GetFontMgr()
std::unique_ptr< CFPF_SkiaFontMgr > m_pFontMgr
void LoadFonts(const char **user_paths)
RetainPtr< CFX_Face > GetFontFace(ByteStringView path, int32_t face_index)
CFPF_SkiaFont * CreateFont(ByteStringView family_name, FX_Charset charset, uint32_t style)
FX_Charset
Definition fx_codepage.h:71
std::unique_ptr< FXFT_LibraryRec, FXFTLibraryRecDeleter > ScopedFXFTLibraryRec
Definition fx_freetype.h:40
fxcrt::ByteStringView ByteStringView