wxMaxima
Loading...
Searching...
No Matches
pdffontmanager.h
Go to the documentation of this file.
1
2// Name: pdffontmanager.h
3// Purpose:
4// Author: Ulrich Telle
5// Created: 2008-08-10
6// Copyright: (c) Ulrich Telle
7// Licence: wxWindows licence
9
11
12#ifndef _PDF_FONT_MANAGER_H_
13#define _PDF_FONT_MANAGER_H_
14
15// wxWidgets headers
16#include <wx/arrstr.h>
17#include <wx/string.h>
18
19// wxPdfDocument headers
20#include "wx/pdfdocdef.h"
21#include "wx/pdffont.h"
22
23class WXDLLIMPEXP_FWD_PDFDOC wxPdfFontData;
25
27class WXDLLIMPEXP_PDFDOC wxPdfFontManager
28{
29public:
31
34 static wxPdfFontManager* GetFontManager();
35
37
40 void AddSearchPath(const wxString& path);
41
43
46 void AddSearchPath(const wxArrayString& pathArray);
47
49
63 bool SetDefaultEmbed(bool embed);
64
66
69 bool GetDefaultEmbed();
70
72
82 bool SetDefaultSubset(bool subset);
83
85
88 bool GetDefaultSubset();
89
91
99 wxPdfFont RegisterFont(const wxString& fontFileName, const wxString& aliasName = wxEmptyString, int fontIndex = 0);
100
102
108 wxPdfFont RegisterFont(const wxFont& font, const wxString& aliasName = wxEmptyString);
109
111
122 wxPdfFont RegisterFont(const char* fontData, size_t fontDataSize, const wxString& aliasName = wxEmptyString);
123
125
131 int RegisterFontCollection(const wxString& fontCollectionFileName);
132
134
147 bool RegisterFontCJK(const wxString& family);
148
150 /*
151 * This method tries to register all installed fonts. On Windows platforms the registry
152 * is searched to identify installed fonts, on Linux platforms the fontconfig library
153 * is used to identify installed fonts.
154 *
155 * \note This method is currently implemented only for wxMSW and wxGTK.
156 * \return the number of registered fonts
157 */
158 int RegisterSystemFonts();
159
161
166 int RegisterFontDirectory(const wxString& directory, bool recursive = false);
167
169
180 wxPdfFont GetFont(const wxString& fontName, int fontStyle = wxPDF_FONTSTYLE_REGULAR) const;
181
183
194 wxPdfFont GetFont(const wxString& fontName, const wxString& fontStyle) const;
195
197
220 wxPdfFont GetFontForWxFont(const wxFont& font);
221
223
229 wxPdfFont GetFont(size_t fontIndex) const;
230
232
251 wxPdfFont FindFallbackFont(wxUint32 unicodeChar, int fontStyle = wxPDF_FONTSTYLE_REGULAR);
252
254
257 size_t GetFontCount() const;
258
260
267 bool InitializeFontData(const wxPdfFont& font);
268
270
275 bool RegisterEncoding(const wxPdfEncoding& encoding);
276
278
282 const wxPdfEncoding* GetEncoding(const wxString& encodingName);
283
285
314 void SetEmbeddableFontReplacement(const wxString& fontFamily, const wxString& replacementFamily);
315
317
322 wxString GetEmbeddableFontReplacement(const wxString& fontFamily) const;
323
325
352 wxPdfFont GetEmbeddableFont(const wxPdfFont& font, int fontStyle = wxPDF_FONTSTYLE_REGULAR,
353 bool useBuiltInReplacements = true);
354
356
366 wxPdfFont GetEmbeddableFont(const wxString& fontFamily, int fontStyle = wxPDF_FONTSTYLE_REGULAR);
367
368private:
371
374
377
379 wxPdfFontManager& operator=(const wxPdfFontManager&);
380
381private:
382 wxPdfFontManagerBase* m_fontManagerBase;
383
384 static wxPdfFontManager* ms_fontManager;
385
386 friend class wxPdfDocumentModule;
387};
388
389#endif
Definition: pdffontmanager.cpp:2534
Class representing a font encoding.
Definition: pdfencoding.h:25
Base class for all fonts. (For internal use only)
Definition: pdffontdata.h:55
Definition: pdffontmanager.cpp:301
Class representing the font manager.
Definition: pdffontmanager.h:28
Class representing a font providing a basic interface.
Definition: pdffont.h:29
Compile time switches for the wxPdfDocument component.
Interface of wxPdfFont class.
@ wxPDF_FONTSTYLE_REGULAR
Regular font style.
Definition: pdfproperties.h:55