wxMaxima
Loading...
Searching...
No Matches
pdffontdatatype0.h
Go to the documentation of this file.
1
2// Name: pdffontdatatype0.h
3// Purpose: Definition of font data for Type0 fonts
4// Author: Ulrich Telle
5// Created: 2009-05-15
6// Copyright: (c) Ulrich Telle
7// Licence: wxWindows licence
9
11
12#ifndef _PDF_FONT_DATA_TYPE0_H_
13#define _PDF_FONT_DATA_TYPE0_H_
14
15// Type0 fonts are only available in Unicode build
16#if wxUSE_UNICODE
17
18// wxWidgets headers
19#include <wx/strconv.h>
20#include <wx/string.h>
21#include <wx/xml/xml.h>
22
23// wxPdfDocument headers
24#include "wx/pdfdocdef.h"
25#include "wx/pdfarraytypes.h"
26#include "wx/pdffontdata.h"
27
30class WXDLLIMPEXP_PDFDOC wxPdfFontDataType0 : public wxPdfFontData
31{
32public:
34 wxPdfFontDataType0();
35
37
47 wxPdfFontDataType0(const wxString& family, const wxString& name,
48 const wxString& encoding, const wxString& ordering,
49 const wxString& supplement, const wxString& cmap,
50 short* cwArray, const wxPdfFontDescription& desc);
51
53 virtual ~wxPdfFontDataType0();
54
56
62 virtual wxString GetWidthsAsString(bool subset, wxPdfSortedArrayInt* usedGlyphs = NULL, wxPdfChar2GlyphMap* subsetGlyphs = NULL) const;
63
65
72 virtual double GetStringWidth(const wxString& s, const wxPdfEncoding* encoding = NULL, bool withKerning = false, double charSpacing = 0) const;
73
75
80 virtual bool CanShow(const wxString& s, const wxPdfEncoding* encoding = NULL) const;
81
83
90 virtual wxString ConvertCID2GID(const wxString& s, const wxPdfEncoding* encoding = NULL,
91 wxPdfSortedArrayInt* usedGlyphs = NULL,
92 wxPdfChar2GlyphMap* subsetGlyphs = NULL) const;
93
95
99 virtual bool LoadFontMetrics(wxXmlNode* root);
100
102
105 virtual wxMBConv* GetEncodingConv() const { return m_conv; }
106
108 virtual void CreateDefaultEncodingConv();
109
110 // Set half-width ranges (ie for Japan)
116 void SetHalfWidthRanges(bool hwRange, wxUniChar hwFirst, wxUniChar hwLast);
117
118protected:
120 bool HasHalfWidthRange() const { return m_hwRange; }
121
123 wxUniChar HalfWidthRangeFirst() const { return m_hwFirst; }
124
126 wxUniChar HalfWidthRangeLast() const { return m_hwLast; }
127
128 bool m_hwRange;
129 wxUniChar m_hwFirst;
130 wxUniChar m_hwLast;
131
132 wxMBConv* m_conv;
133};
134
135#endif // wxUSE_UNICODE
136
137#endif
Class representing a font encoding.
Definition: pdfencoding.h:25
Base class for all fonts. (For internal use only)
Definition: pdffontdata.h:55
virtual wxString GetWidthsAsString(bool subset=false, wxPdfSortedArrayInt *usedGlyphs=NULL, wxPdfChar2GlyphMap *subsetGlyphs=NULL) const
Get the character width array as string.
Definition: pdffontdata.cpp:691
virtual double GetStringWidth(const wxString &s, const wxPdfEncoding *encoding=NULL, bool withKerning=false, double charSpacing=0) const
Get the width of a string.
Definition: pdffontdata.cpp:700
virtual bool CanShow(const wxString &s, const wxPdfEncoding *encoding=NULL) const
Check whether the font can show all characters of a given string.
Definition: pdffontdata.cpp:778
virtual wxString ConvertCID2GID(const wxString &s, const wxPdfEncoding *encoding=NULL, wxPdfSortedArrayInt *usedGlyphs=NULL, wxPdfChar2GlyphMap *subsetGlyphs=NULL) const
Convert character codes to glyph numbers.
Definition: pdffontdata.cpp:821
virtual bool LoadFontMetrics(wxXmlNode *root)
Load the font metrics XML file.
Definition: pdffontdata.cpp:771
Class representing a font description.
Definition: pdffontdescription.h:24
Definition of array types.
Compile time switches for the wxPdfDocument component.
Definition of font data.