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
cfx_folderfontinfo.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_CFX_FOLDERFONTINFO_H_
8#define CORE_FXGE_CFX_FOLDERFONTINFO_H_
9
10#include <map>
11#include <memory>
12#include <vector>
13
14#include "core/fxcrt/fx_codepage_forward.h"
15#include "core/fxcrt/unowned_ptr.h"
16#include "core/fxge/cfx_fontmapper.h"
17#include "core/fxge/systemfontinfo_iface.h"
18
19#define CHARSET_FLAG_ANSI (1 << 0)
20#define CHARSET_FLAG_SYMBOL (1 << 1)
21#define CHARSET_FLAG_SHIFTJIS (1 << 2)
22#define CHARSET_FLAG_BIG5 (1 << 3)
23#define CHARSET_FLAG_GB (1 << 4)
24#define CHARSET_FLAG_KOREAN (1 << 5)
25
27 public:
29 ~CFX_FolderFontInfo() override;
30
31 void AddPath(const ByteString& path);
32
33 // SystemFontInfoIface:
34 bool EnumFontList(CFX_FontMapper* pMapper) override;
35 void* MapFont(int weight,
36 bool bItalic,
37 FX_Charset charset,
38 int pitch_family,
39 const ByteString& face) override;
40 void* GetFont(const ByteString& face) override;
41 size_t GetFontData(void* hFont,
42 uint32_t table,
43 pdfium::span<uint8_t> buffer) override;
44 void DeleteFont(void* hFont) override;
45 bool GetFaceName(void* hFont, ByteString* name) override;
46 bool GetFontCharset(void* hFont, FX_Charset* charset) override;
47
48 protected:
50
52 public:
53 FontFaceInfo(ByteString filePath,
54 ByteString faceName,
55 ByteString fontTables,
56 uint32_t fontOffset,
57 uint32_t fileSize);
58
59 const ByteString m_FilePath;
60 const ByteString m_FaceName;
61 const ByteString m_FontTables;
62 const uint32_t m_FontOffset;
63 const uint32_t m_FileSize;
64 uint32_t m_Styles = 0;
65 uint32_t m_Charsets = 0;
66 };
67
68 void ScanPath(const ByteString& path);
69 void ScanFile(const ByteString& path);
70 void ReportFace(const ByteString& path,
71 FILE* pFile,
72 FX_FILESIZE filesize,
73 uint32_t offset);
74 void* GetSubstFont(const ByteString& face);
75 void* FindFont(int weight,
76 bool bItalic,
77 FX_Charset charset,
78 int pitch_family,
79 const ByteString& family,
80 bool bMatchName);
81
85};
86
87#endif // CORE_FXGE_CFX_FOLDERFONTINFO_H_
void Init() override
std::unique_ptr< SystemFontInfoIface > CreateDefaultSystemFontInfo() override
void * CreatePlatformFont(pdfium::span< const uint8_t > font_span) override
~CApplePlatform() override
FontFaceInfo(ByteString filePath, ByteString faceName, ByteString fontTables, uint32_t fontOffset, uint32_t fileSize)
~CFX_FolderFontInfo() override
void ScanFile(const ByteString &path)
bool GetFontCharset(void *hFont, FX_Charset *charset) override
std::vector< ByteString > m_PathList
size_t GetFontData(void *hFont, uint32_t table, pdfium::span< uint8_t > buffer) override
void * GetSubstFont(const ByteString &face)
void DeleteFont(void *hFont) override
UnownedPtr< CFX_FontMapper > m_pMapper
void * FindFont(int weight, bool bItalic, FX_Charset charset, int pitch_family, const ByteString &family, bool bMatchName)
void ReportFace(const ByteString &path, FILE *pFile, FX_FILESIZE filesize, uint32_t offset)
bool GetFaceName(void *hFont, ByteString *name) override
void ScanPath(const ByteString &path)
void * MapFont(int weight, bool bItalic, FX_Charset charset, int pitch_family, const ByteString &face) override
void AddPath(const ByteString &path)
void * GetFont(const ByteString &face) override
std::map< ByteString, std::unique_ptr< FontFaceInfo > > m_FontList
bool EnumFontList(CFX_FontMapper *pMapper) override
static CFX_GEModule * Get()
const char ** GetUserFontPaths() const
void * CreateFont(pdfium::span< const uint8_t > pFontData)
ByteString & operator+=(const char *str)
ByteString & operator=(const char *str)
ByteString & operator=(const ByteString &that)
ByteString & operator=(ByteString &&that) noexcept
FX_Charset
Definition fx_codepage.h:70
@ kChineseTraditional
@ kChineseSimplified
bool FontFamilyIsFixedPitch(uint32_t family)
Definition fx_font.h:84
bool FontFamilyIsRoman(uint32_t family)
Definition fx_font.h:87
#define FX_FILESIZE
Definition fx_types.h:19