wxMaxima
Loading...
Searching...
No Matches
pdffontfallback.h
Go to the documentation of this file.
1/*
2** Name: pdffontfallback.h
3** Purpose: Internal state of the font fallback (glyph substitution) feature
4** Author: wxPdfDocument contributors
5** Created: 2026-11-23
6** Copyright: (c) 2026 wxPdfDocument contributors
7** Licence: wxWindows licence
8** SPDX-License-Identifier: LGPL-3.0+ WITH WxWindows-exception-3.1
9*/
10
14
15#ifndef _PDF_FONT_FALLBACK_H_
16#define _PDF_FONT_FALLBACK_H_
17
18#include <map>
19#include <vector>
20
21#include <wx/string.h>
22
23#include "wx/pdffont.h"
24#include "wx/pdffontextended.h"
25
27
32{
33 wxString m_text;
34 int m_slot;
35};
36
37typedef std::vector<wxPdfFontFallbackRun> wxPdfFontFallbackRuns;
38
40
46{
47public:
49
52 {
53 m_cache.clear();
54 }
55
57 bool IsEnabled() const
58 {
59 return m_useSystemFonts || !m_fonts.empty();
60 }
61
63 std::vector<wxPdfFont> m_fonts;
64
67
69
74 std::vector<wxPdfFontExtended> m_resolved;
75
77 std::vector<wxPdfFont> m_resolvedFonts;
78
80 std::map<wxString, int> m_slotByKey;
81
83 std::map<wxUint64, int> m_cache;
84};
85
86#endif
Internal state of the font fallback feature of one wxPdfDocument instance.
Definition: pdffontfallback.h:46
std::map< wxString, int > m_slotByKey
Maps a font key (name + encoding) to its index in m_resolved.
Definition: pdffontfallback.h:80
std::vector< wxPdfFont > m_resolvedFonts
The user level font object belonging to each entry of m_resolved.
Definition: pdffontfallback.h:77
void ClearCache()
Forget all cached lookup results (called whenever the configuration changes)
Definition: pdffontfallback.h:51
std::vector< wxPdfFontExtended > m_resolved
Concrete fonts that were selected for at least one character ("slots")
Definition: pdffontfallback.h:74
bool IsEnabled() const
Check whether fallback is configured at all.
Definition: pdffontfallback.h:57
std::vector< wxPdfFont > m_fonts
Fonts explicitly added by the user via wxPdfDocument::AddFallbackFont(), in priority order.
Definition: pdffontfallback.h:63
std::map< wxUint64, int > m_cache
Lookup cache: (style << 32 | code point) -> slot index, or -1 if no font has the glyph.
Definition: pdffontfallback.h:83
bool m_useSystemFonts
Flag whether the fonts installed on the system should be searched after m_fonts.
Definition: pdffontfallback.h:66
Interface of wxPdfFont class.
Interface of wxPdfFontExtended class.
A piece of text that is rendered with a single font.
Definition: pdffontfallback.h:32
wxString m_text
The characters of the run (complete surrogate pairs only)
Definition: pdffontfallback.h:33
int m_slot
Index into wxPdfFontFallback::m_resolved, or -1 for the current font.
Definition: pdffontfallback.h:34