1 ///////////////////////////////////////////////////////////////////////////////
2 // Name:        pdffontdata.h
3 // Purpose:
4 // Author:      Ulrich Telle
5 // Created:     2008-08-08
6 // Copyright:   (c) Ulrich Telle
7 // Licence:     wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
9 
10 /// \file pdffontdata.h Definition of font data
11 
12 #ifndef _PDF_FONT_DATA_H_
13 #define _PDF_FONT_DATA_H_
14 
15 // wxWidgets headers
16 #include <wx/dynarray.h>
17 #include <wx/hashmap.h>
18 #include <wx/mstream.h>
19 #include <wx/object.h>
20 #include <wx/xml/xml.h>
21 
22 // wxPdfDocument headers
23 #include "wx/pdfdocdef.h"
24 #include "wx/pdfarraytypes.h"
25 #include "wx/pdffontdescription.h"
26 
27 class WXDLLIMPEXP_FWD_PDFDOC wxPdfEncoding;
28 class WXDLLIMPEXP_FWD_PDFDOC wxPdfEncodingChecker;
29 
30 WX_DECLARE_HASH_MAP_WITH_DECL(wxUint32, int, wxIntegerHash, wxIntegerEqual, wxPdfKernWidthMap, class WXDLLIMPEXP_PDFDOC);
31 WX_DECLARE_HASH_MAP_WITH_DECL(wxUint32, wxPdfKernWidthMap*, wxIntegerHash, wxIntegerEqual, wxPdfKernPairMap, class WXDLLIMPEXP_PDFDOC);
32 
33 WX_DECLARE_HASH_MAP_WITH_DECL(wxUint32, wxUint16, wxIntegerHash, wxIntegerEqual, wxPdfGlyphWidthMap, class WXDLLIMPEXP_PDFDOC);
34 WX_DECLARE_HASH_MAP_WITH_DECL(wxUint32, wxUint32, wxIntegerHash, wxIntegerEqual, wxPdfChar2GlyphMap, class WXDLLIMPEXP_PDFDOC);
35 
36 /// Class representing a glyph list entry
37 class WXDLLIMPEXP_PDFDOC wxPdfGlyphListEntry
38 {
39 public:
40   /// Default constructor
wxPdfGlyphListEntry()41   wxPdfGlyphListEntry() {};
42 
43   /// Destructor
~wxPdfGlyphListEntry()44   ~wxPdfGlyphListEntry() {};
45 
46   int m_gid; ///< glyph number
47   int m_uid; ///< unicode character
48 };
49 
50 WX_DEFINE_SORTED_USER_EXPORTED_ARRAY(wxPdfGlyphListEntry*, wxPdfGlyphList, WXDLLIMPEXP_PDFDOC);
51 
52 /// Base class for all fonts. (For internal use only)
53 class WXDLLIMPEXP_PDFDOC wxPdfFontData
54 {
55 public:
56   /// Default constructor
57   wxPdfFontData();
58 
59   /// Default destructor
60   virtual ~wxPdfFontData();
61 
62   /// Check initialization state
63   /**
64   * \return TRUE if the font data are initialized, FALSE otherwise
65   */
IsInitialized()66   bool IsInitialized() const { return m_initialized; }
67 
68   /// Set initialization state
69   /**
70   * \param initialized state of initialization to set
71   */
72   void SetInitialized(bool initialized);
73 
74   /// Set font type
75   /**
76   * \param type type of the font
77   * \note Valid types are
78   * \li core - Adobe Standard font (i.e. Courier, Helvetica, ...)
79   * \li OpenTypeUnicode - TrueType/OpenType font using the compact font format (CFF)
80   * \li TrueType - TrueType/OpenType font using the TrueType font format and standard encoding
81   * \li TrueTypeUnicode - TrueType/OpenType font using the TrueType font format and Unicode encoding
82   * \li Type0 - Type0 font, usually a CJK font
83   * \li Type1 - PostScript font
84   */
85   void SetType(const wxString& type);
86 
87   /// Get font type
88   /**
89   * \return type of the font
90   * \see SetType()
91   */
92   wxString GetType() const;
93 
94   /// Set font family name
95   /**
96   * \param name the name of the font family
97   */
98   void SetFamily(const wxString& name);
99 
100   /// Get font family name
101   /**
102   * \return the name of the font family
103   */
104   wxString GetFamily() const;
105 
106   /// Set font family alias
107   /**
108   * \param alias the alias name of the font family
109   */
110   void SetAlias(const wxString& alias);
111 
112   /// Get font family alias
113   /**
114   * \return the alias of the font family name or an empty string
115   */
116   wxString GetAlias() const;
117 
118   /// Set font name
119   /**
120   * \param name the full name of the font, usually the PostScript name
121   */
122   void SetName(const wxString& name);
123 
124   /// Get font name
125   /**
126   * \return the full name of the font, usually the PostScript name
127   */
128   wxString GetName() const;
129 
130   /// Set list of full font names
131   /**
132   * \param fullNames a list of full font names
133   */
134   void SetFullNames(const wxArrayString& fullNames);
135 
136   /// Get list of full font names
137   /**
138   * \return a list of full names of the font
139   */
140   wxArrayString GetFullNames() const;
141 
142   /// Set font style
143   /**
144   * \param style the style of the font. Vaild values are
145   *   \li wxPDF_FONTSTYLE_REGULAR
146   *   \li wxPDF_FONTSTYLE_BOLD
147   *   \li wxPDF_FONTSTYLE_ITALIC
148   *   \li wxPDF_FONTSTYLE_BOLDITALIC
149   */
150   void SetStyle(int style);
151 
152   /// Set font style
153   /**
154   * \param style the style of the font. If the style string
155   *   \li contains "bold" or "black" the style is set to bold
156   *   \li contains "italic" or "oblique" the style is set to italic
157   *   \li equals "b" the style is set to bold
158   *   \li equals "i" the style is set to italic
159   *   \li equals "bi" or "ib" �the style is set to bolditalic
160   */
161   void SetStyle(const wxString& style);
162 
163   /// Set font style based on font name
164   /**
165   * The font's full name is searched for substrings "regular", "bold", "black", "italic" and "oblique".
166   * Depending on the findings the style is set.
167   */
168   void SetStyleFromName();
169 
170   /// Get font style
171   /**
172   * \return the font style
173   * \see SetStyle()
174   */
175   int GetStyle() const;
176 
177   /// Set embed support flag
178   /**
179   * \return TRUE if embedding of this font is required, FALSE otherwise
180   */
EmbedRequired()181   bool EmbedRequired() { return m_embedRequired; }
182 
183   /// Check whether the font embedding is required
184   /**
185   * \return TRUE if embedding of this font is supported/allowed, FALSE otherwise
186   */
EmbedSupported()187   bool EmbedSupported() const { return m_embedSupported; }
188 
189   /// Check whether the font subsetting is supported
190   /**
191   * \return TRUE if subsetting of this font is supported/allowed, FALSE otherwise
192   */
SubsetSupported()193   bool SubsetSupported() const { return m_subsetSupported; }
194 
195   /// Set embed support flag
196   /**
197   * \param embedSupported flag whether the font supports embedding
198   */
SetEmbedSupported(bool embedSupported)199   void SetEmbedSupported(bool embedSupported) { m_embedSupported = embedSupported; }
200 
201   /// Set subset support flag
202   /**
203   * \param subsetSupported flag whether the font supports subsetting
204   */
SetSubsetSupported(bool subsetSupported)205   void SetSubsetSupported(bool subsetSupported) { m_subsetSupported = subsetSupported; }
206 
207 #if defined(__WXMSW__) || defined(__WXMAC__)
208   /// Set associated wxFont object
209   /**
210   * \param font the wxFont to be associated with the font
211   */
SetFont(const wxFont & font)212   void SetFont(const wxFont& font) { m_font = font; }
213 
214   /// Get associated wxFont object
215   /**
216   * \return the associated wxFont
217   */
GetFont()218   wxFont GetFont() const { return m_font; }
219 #endif
220 
221   /// Set fully qualified font file name
222   /**
223   * \param fontFileName the fully qualified name of the font file
224   */
SetFontFileName(const wxString & fontFileName)225   void SetFontFileName(const wxString& fontFileName) { m_fontFileName = fontFileName; }
226 
227   /// Get fully qualified font file name
228   /**
229   * \return the fully qualified name of the font file
230   */
GetFontFileName()231   wxString GetFontFileName() const { return m_fontFileName; }
232 
233   /// Set font index in case the font is member of a font collection
234   /**
235   * \param fontIndex the index of the font if it is a member of a font collection
236   */
SetFontIndex(int fontIndex)237   void SetFontIndex(int fontIndex) { m_fontIndex = fontIndex; }
238 
239   /// Get font index
240   /**
241   * \return the index of the font within a font collection
242   */
GetFontIndex()243   int GetFontIndex() const { return m_fontIndex; }
244 
245   /// Check whether the font is in compact font format
246   /**
247   * \return TRUE if the font is in CFF format, FALSE otherwise
248   */
HasCff()249   bool HasCff() const { return m_cff; }
250 
251   /// Get the offset of the CFF section within the font file
252   /**
253   * \return the offset of the CFF section
254   */
GetCffOffset()255   size_t GetCffOffset() const { return m_cffOffset; }
256 
257   /// Get the length of the CFF section
258   /**
259   * \return the length of the CFF section
260   */
GetCffLength()261   size_t GetCffLength() const { return m_cffLength; }
262 
263   /// Set underline position
264   /**
265   * \param up the position of the underline decoration
266   */
267   void SetUnderlinePosition(int up);
268 
269   /// Get underline position
270   /**
271   * \return the position of the underline decoration
272   */
273   int  GetUnderlinePosition() const;
274 
275   /// Set underline thickness
276   /**
277   * \param ut the thickness of the underline decoration
278   */
279   void SetUnderlineThickness(int ut);
280 
281   /// Get underline thickness
282   /**
283   * \return the thickness of the underline decoration
284   */
285   int  GetUnderlineThickness() const;
286 
287   /// Get bounding box top position
288   /**
289   * \return the top position from the bounding box
290   */
291   int GetBBoxTopPosition() const;
292 
293   /// Set encoding
294   /**
295   * \param encoding the name of the font encoding
296   */
297   void SetEncoding(const wxString& encoding);
298 
299   /// Get encoding
300   /**
301   * \return the name of the font encoding
302   */
303   wxString GetEncoding() const;
304 
305   /// Get encoding
306   /**
307   * \return the name of the font encoding
308   */
309   const wxPdfEncoding* GetBaseEncoding() const;
310 
311   /// Check whether the font has differences to WinAnsi encoding
312   /**
313   * \return TRUE if the font has differences to the WinAnsi encoding, FALSE otherwise
314   */
315   bool HasDiffs() const;
316 
317   /// Set encoding differences
318   /**
319   * \param diffs the string describing the differences to the WinAnsi encoding
320   */
321   void SetDiffs(const wxString& diffs);
322 
323   /// Get encoding differences
324   /**
325   * \return the string describing the differences to the WinAnsi encoding
326   */
327   wxString GetDiffs() const;
328 
329   /// Set path of font files
330   /**
331   * \param path the path where the font file is located
332   */
333   void SetFilePath(const wxString& path);
334 
335   /// Get path of font files
336   /**
337   * \return the path where the font file is located
338   */
339   wxString GetFilePath() const;
340 
341   /// Check whether the font has an associated font file
342   /**
343   * \return TRUE if the font has an associated font file, FALSE otherwise
344   */
345   bool HasFile() const;
346 
347   /// Set the name of the font file created by MakeFont
348   /**
349   * \param file the name of the font file created by the MakeFont utility
350   */
351   void SetFontFile(const wxString& file);
352 
353   /// Get the name of the associated font file
354   /**
355   * \return the name of the font file created by the MakeFont utility
356   */
357   wxString GetFontFile() const;
358 
359   /// Set the name of the character to glyph mapping file created by MakeFont
360   /**
361   * \param ctg the name of the character to glyph mapping file created by the MakeFont utility
362   */
363   void SetCtgFile(const wxString& ctg);
364 
365   /// Get the name of the character to glyph mapping file created by MakeFont
366   /**
367   * \return the name of the character to glyph mapping file created by the MakeFont utility
368   */
369   wxString GetCtgFile() const;
370 
371   /// Get font file size 1
372   /**
373   * \param size1 the size of the font file
374   * \note For Type1 fonts this represents the size of the ASCII section.
375   */
376   void SetSize1(size_t size1);
377 
378   /// Get font file size 1
379   /**
380   * \return the size of the font file
381   */
382   size_t  GetSize1() const;
383 
384   /// Check whether the file has a size 2
385   /**
386   * \return TRUE if the font has a second size associated, FALSE otherwise
387   * \note Usually only Type1 fonts have a second size entry.
388   */
389   bool HasSize2() const;
390 
391   /// Set font file size 2
392   /**
393   * \param size2 the second size of the font file
394   * \note For Type1 fonts this represents the size of the BINARY section.
395   */
396   void SetSize2(size_t size2);
397 
398   /// Get font file size 2 (Type 1 only)
399   /**
400   * \return the second size of the font file
401   */
402   size_t  GetSize2() const;
403 
404   /// Set font CMap
405   /**
406   * \param cmap the CMap descriptor
407   * \note For Type0 fonts only
408   */
409   void SetCMap(const wxString& cmap);
410 
411   /// Get the font's CMap (Type 0 only)
412   /**
413   * return the font's CMap descriptor
414   */
415   wxString GetCMap() const;
416 
417   /// Set font ordering
418   /**
419   * \param ordering the font's ordering descriptor
420   */
421   void SetOrdering(const wxString& ordering);
422 
423   /// Get font ordering
424   /**
425   * \return the font's ordering descriptor
426   */
427   wxString GetOrdering() const;
428 
429   /// Set font supplement
430   /**
431   * \param supplement the font's supplement descriptor
432   * \note For Type0 fonts only
433   */
434   void SetSupplement(const wxString& supplement);
435 
436   /// Get font supplement (Type 0 only)
437   /**
438   * \return the font's supplement descriptor
439   * \note For Type0 fonts only
440   */
441   wxString GetSupplement() const;
442 
443   /// Set glyph width map
444   /**
445   * \param cw the glyph width map
446   */
447   void SetGlyphWidthMap(wxPdfGlyphWidthMap* cw);
448 
449   /// Get glyph width map
450   /**
451   * \return the glyph width map
452   */
453   const wxPdfGlyphWidthMap* GetGlyphWidthMap() const;
454 
455   /// Set character to glyph number map
456   /**
457   * \param gn the character to glyph number map
458   */
459   void SetChar2GlyphMap(wxPdfChar2GlyphMap* gn);
460 
461   /// Get character to glyph number map
462   /**
463   * \return the character to glyph number map
464   */
465   const wxPdfChar2GlyphMap* GetChar2GlyphMap() const;
466 
467   /// Set kerning pair map
468   /**
469   * \param kp the kerning pair map
470   */
471   void SetKernPairMap(wxPdfKernPairMap* kp);
472 
473   /// Get kerning pair map
474   /**
475   * \return the kerning pair map
476   */
477   const wxPdfKernPairMap* GetKernPairMap() const;
478 
479   /// Get width of string taking kerning into account
480   /**
481   * \param s the string which's width is to be calculated
482   * \return the width of the string with kerning taken into account
483   */
484   int GetKerningWidth(const wxString& s) const;
485 
486   /// Get kerning width array
487   /**
488   * \param s the string for which kerning information should be provided
489   * \return an array with indices and kerning width of the found kerning pairs.
490   * The array consists of information pairs: the first item (even indices) represents the index
491   * of the first character of a kerning pair within the string and the second item (odd indices)
492   * represents the kerning value.
493   */
494   wxArrayInt GetKerningWidthArray(const wxString& s) const;
495 
496   /// Set subset flag if font subsetting is supported
497   /**
498   * \param subset flag whether subsetting should be used
499   */
500   void SetSubset(bool subset);
501 
502   /// Initialize font data
503   /**
504   * \return TRUE if the font data has been initialized successfully, FALSE otherwise
505   */
506   virtual bool Initialize();
507 
508   /// Check whether VOLT data are available
509   /**
510   * \return TRUE if the font data contain VOLT data, FALSE otherwise
511   */
HasVoltData()512   virtual bool HasVoltData() const { return false; }
513 
514   /// Applay VOLT data
515   /**
516   * \param s text string for which VOLT data should be applied
517   * \return text string modified according to the VOLT data
518   */
ApplyVoltData(const wxString & s)519   virtual wxString ApplyVoltData(const wxString& s) const { return s; }
520 
521   /// Get the width of a string
522   /**
523   * \param s the string for which the width should be calculated
524   * \param encoding the character to glyph mapping
525   * \param withKerning flag indicating whether kerning should be taken into account
526   * \return the width of the string
527   */
528   virtual double GetStringWidth(const wxString& s, const wxPdfEncoding* encoding = NULL, bool withKerning = false) const;
529 
530   /// Check whether the font can show all characters of a given string
531   /**
532   * \param s the string to be checked
533   * \param encoding the character to glyph mapping
534   * \return TRUE if the font can show all characters of the string, FALSE otherwise
535   */
536   virtual bool CanShow(const wxString& s, const wxPdfEncoding* encoding = NULL) const;
537 
538   /// Force string to valid string in respect of the current font encoding
539   /**
540   * The given string is converted in such a way that it contains only characters
541   * available in the current font encoding
542   * \param s the string to be converted
543   * \param replace the character used to replace invalid characters
544   * \return converted string
545   */
546   virtual wxString ConvertToValid(const wxString& s, wxChar replace = wxS('?')) const;
547 
548   /// Convert character codes to glyph numbers
549   /**
550   * \param s the string to be converted
551   * \param encoding the character to glyph mapping
552   * \param usedGlyphs the list of used glyphs
553   * \param subsetGlyphs the mapping of glyphs to subset glyphs
554   * \return the converted string
555   */
556   virtual wxString ConvertCID2GID(const wxString& s, const wxPdfEncoding* encoding = NULL,
557                                   wxPdfSortedArrayInt* usedGlyphs = NULL,
558                                   wxPdfChar2GlyphMap* subsetGlyphs = NULL) const;
559 
560   /// Convert glyph number to string
561   /**
562   * \param glyph the glyph to be converted
563   * \param encoding the character to glyph mapping
564   * \param usedGlyphs the list of used glyphs
565   * \param subsetGlyphs the mapping of glyphs to subset glyphs
566   * \return the converted string
567   */
568   virtual wxString ConvertGlyph(wxUint32 glyph, const wxPdfEncoding* encoding = NULL,
569                                 wxPdfSortedArrayInt* usedGlyphs = NULL,
570                                 wxPdfChar2GlyphMap* subsetGlyphs = NULL) const;
571 
572   /// Get the character width array as string
573   /**
574   * \param subset flag whether subsetting is enabled
575   * \param usedGlyphs the list of used glyphs
576   * \param subsetGlyphs the mapping of glyphs to subset glyphs
577   * \return the string representation of the character widths
578   */
579   virtual wxString GetWidthsAsString(bool subset = false,
580                                      wxPdfSortedArrayInt* usedGlyphs = NULL,
581                                      wxPdfChar2GlyphMap* subsetGlyphs = NULL) const;
582 
583   /// Get list of glyph names supported by this font
584   /**
585   * \param[out] glyphNames a list of glyph names
586   * \return TRUE if the list of glyph names is available, FALSE otherwise
587   */
588   virtual bool GetGlyphNames(wxArrayString& glyphNames) const;
589 
590   /// Write font data
591   /**
592   * \param fontData the output stream
593   * \param usedGlyphs the list of used glyphs
594   * \param subsetGlyphs the mapping of glyphs to subset glyphs
595   * \return the size of the written font data
596   */
597   virtual size_t WriteFontData(wxOutputStream* fontData,
598                                wxPdfSortedArrayInt* usedGlyphs = NULL,
599                                wxPdfChar2GlyphMap* subsetGlyphs = NULL);
600 
601   /// Write character/glyph to unicode mapping
602   /**
603   * \param mapData the output stream
604   * \param encoding the character to glyph mapping
605   * \param usedGlyphs the list of used glyphs
606   * \param subsetGlyphs the mapping of glyphs to subset glyphs
607   * \return the size of the written data
608   */
609   virtual size_t WriteUnicodeMap(wxOutputStream* mapData,
610                                  const wxPdfEncoding* encoding = NULL,
611                                  wxPdfSortedArrayInt* usedGlyphs = NULL,
612                                  wxPdfChar2GlyphMap* subsetGlyphs = NULL);
613 
614   /// Set the font description
615   /**
616   * \param desc the font description
617   */
618   void SetDescription(const wxPdfFontDescription& desc);
619 
620   /// Get the font description
621   /**
622   * \return the font description
623   */
624   virtual const wxPdfFontDescription& GetDescription() const;
625 
626   /// Load the font metrics XML file
627   /**
628   * \param root the root node of the XML font metric file
629   * \return TRUE if the metric file could be processed successfully, FALSE otherwise
630   */
631   virtual bool LoadFontMetrics(wxXmlNode* root);
632 
633 #if wxUSE_UNICODE
634   /// Get the associated encoding converter
635   /**
636   * \return the encoding converter associated with this font
637   */
638   virtual wxMBConv* GetEncodingConv() const;
639 
640   /// Create the associated default encoding converter
641   virtual void CreateDefaultEncodingConv();
642 #endif
643 
644   /// Set the glyph widths
645   /**
646   * \param glyphWidths array with glyph widths
647   */
648   virtual void SetGlyphWidths(const wxPdfArrayUint16& glyphWidths);
649 
650   /// Get the font description from XML
651   /**
652   * \param node root node of the XML font description
653   * \param[out] fontDescription the resulting font description
654   * \return TRUE if the font description could be processed successfully, FALSE otherwise
655   */
656   bool GetFontDescription(const wxXmlNode *node, wxPdfFontDescription& fontDescription);
657 
658   /// Get the default WinAnsi encoding converter
659   /**
660   * \return the default WinAnsi converter
661   */
662   static wxMBConv* GetWinEncodingConv();
663 
664   /// Get the content of an XML node
665   /**
666   * \param node the XML node containing content
667   * \return the content of the XML node
668   */
669   static wxString GetNodeContent(const wxXmlNode *node);
670 
671 protected:
672   /// Find the encoding map to be used for character to glyph conversion
673   const wxPdfChar2GlyphMap* FindEncodingMap(const wxPdfEncoding* encoding) const;
674 
675   /// Determine font style from font name
676   static int FindStyleFromName(const wxString& name);
677 
678   /// Compare glyph list entries
679   static int CompareGlyphListEntries(wxPdfGlyphListEntry* item1, wxPdfGlyphListEntry* item2);
680 
681   /// Write a buffer to a stream
682   static void WriteStreamBuffer(wxOutputStream& stream, const char* buffer);
683 
684   /// Write a mapping from glyphs to unicode to a stream
685   static void WriteToUnicode(wxPdfGlyphList& glyphs, wxMemoryOutputStream& toUnicode, bool simple = false);
686 
687   wxString              m_type;      ///< Font type
688   wxString              m_family;    ///< Font family
689   wxString              m_alias;     ///< Font family alias
690   wxString              m_name;      ///< Font name
691   wxArrayString         m_fullNames; ///< List of full font names
692   int                   m_style;     ///< Font style flags
693 
694   bool                  m_initialized;     ///< Flag whether the font has been initialized
695   bool                  m_embedRequired;   ///< Flag whether embedding of the font is allowed and supported
696   bool                  m_embedSupported;  ///< Flag whether embedding of the font is allowed and supported
697   bool                  m_subsetSupported; ///< Flag whether subsetting of the font is allowed and supported
698 
699   wxString              m_fontFileName; ///< Qualified name of the font file
700   int                   m_fontIndex;    ///< Index of the font in case of a font collection
701   wxFont                m_font;         ///< Associated wxFont object (currently used by wxMSW only)
702 
703   wxPdfGlyphWidthMap*   m_cw;    ///< Mapping of character ids to character widths
704   wxPdfChar2GlyphMap*   m_gn;    ///< Mapping of character ids to glyph numbers
705   wxPdfKernPairMap*     m_kp;    ///< Kerning pair map
706 
707   wxPdfFontDescription  m_desc;  ///< Font description
708 
709   wxString              m_enc;   ///< Encoding
710   wxString              m_diffs; ///< Encoding differences
711 
712   wxString              m_path;  ///< Path of font files
713   wxString              m_file;  ///< Filename of font program
714   wxString              m_ctg;   ///< Filename of char to glyph mapping
715   size_t                m_size1; ///< TrueType file size or Type1 file size 1
716   size_t                m_size2; ///< Type1 file size 2
717 
718   bool                  m_cff;             ///< Flag whether the font has a CFF table
719   size_t                m_cffOffset;       ///< Offset of the CFF table of a TrueType/OpenType font
720   size_t                m_cffLength;       ///< Lenght of the CFF table of a TrueType/OpenType font
721 
722   wxString              m_cmap;            ///< CMap of a CID font
723   wxString              m_ordering;        ///< Ordering of a CID font
724   wxString              m_supplement;      ///< Supplement of a CID font
725 
726   wxPdfEncoding*        m_encoding;        ///< Encoding
727   wxPdfEncodingChecker* m_encodingChecker; ///< Encoding checker
728   static wxMBConv*      ms_winEncoding;    ///< WinAnsi converter
729 
730 private:
731   /// Thread safe increment of the reference count
732   int IncrementRefCount();
733 
734   /// Thread safe decrement of the reference count
735   int DecrementRefCount();
736 
737   int                   m_refCount;        ///< Reference count
738 
739   void SetEncoding(wxPdfEncoding* encoding);
740   void SetEncodingChecker(wxPdfEncodingChecker* encodingChecker);
741   wxPdfEncodingChecker* GetEncodingChecker() const;
742 
743   friend class WXDLLIMPEXP_FWD_PDFDOC wxPdfFont;
744   friend class WXDLLIMPEXP_FWD_PDFDOC wxPdfFontExtended;
745   friend class WXDLLIMPEXP_FWD_PDFDOC wxPdfFontListEntry;
746   friend class                        wxPdfFontManagerBase;
747 };
748 
749 #endif
750