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
cfgas_pdffontmgr.h
Go to the documentation of this file.
1// Copyright 2017 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 XFA_FGAS_FONT_CFGAS_PDFFONTMGR_H_
8#define XFA_FGAS_FONT_CFGAS_PDFFONTMGR_H_
9
10#include <map>
11#include <utility>
12
13#include "core/fxcrt/fx_string.h"
14#include "core/fxcrt/retain_ptr.h"
15#include "core/fxcrt/unowned_ptr.h"
16#include "xfa/fgas/font/cfgas_fontmgr.h"
17
18class CFGAS_GEFont;
19class CPDF_Document;
20
21class CFGAS_PDFFontMgr final {
22 public:
23 explicit CFGAS_PDFFontMgr(const CPDF_Document* pDoc);
25
26 RetainPtr<CFGAS_GEFont> GetFont(const WideString& wsFontFamily,
27 uint32_t dwFontStyles,
28 bool bStrictMatch);
29
30 private:
31 RetainPtr<CFGAS_GEFont> FindFont(const ByteString& strFamilyName,
32 bool bBold,
33 bool bItalic,
34 bool bStrictMatch);
35 ByteString PsNameToFontName(const ByteString& strPsName,
36 bool bBold,
37 bool bItalic);
38 bool PsNameMatchDRFontName(ByteStringView bsPsName,
39 bool bBold,
40 bool bItalic,
41 const ByteString& bsDRFontName,
42 bool bStrictMatch);
43
44 UnownedPtr<const CPDF_Document> const m_pDoc;
45 std::map<std::pair<WideString, uint32_t>, RetainPtr<CFGAS_GEFont>> m_FontMap;
46};
47
48#endif // XFA_FGAS_FONT_CFGAS_PDFFONTMGR_H_
RetainPtr< CFGAS_GEFont > GetFont(const WideString &wsFontFamily, uint32_t dwFontStyles, bool bStrictMatch)
CFGAS_PDFFontMgr(const CPDF_Document *pDoc)
bool operator==(const char *ptr) const
WideString(const WideString &other)
ByteString ToDefANSI() const
bool FontStyleIsItalic(uint32_t style)
Definition fx_font.h:62
bool FontStyleIsForceBold(uint32_t style)
Definition fx_font.h:59