+ return sFaceName;
+ }
+
+ inline wxFontEncoding GetEncoding(void) const
+ {
+ return m_bNativeFontInfoOk ? m_vNativeFontInfo.GetEncoding()
+ : m_vEncoding;
+ }
+
+ inline WXHFONT GetHFONT(void) const { return m_hFont; }
+ inline HPS GetPS(void) const { return m_hPS; }
+ inline PFONTMETRICS GetFM(void) const { return m_pFM; }
+ inline int GetNumFonts(void) const { return m_nNumFonts; }
+
+ // ... and setters
+ inline void SetPointSize(int nPointSize)
+ {
+ if (m_bNativeFontInfoOk)
+ m_vNativeFontInfo.SetPointSize(nPointSize);
+ else
+ m_nPointSize = nPointSize;
+ }
+
+ inline void SetFamily(wxFontFamily nFamily)
+ {
+ m_nFamily = nFamily;
+ }
+
+ inline void SetStyle(wxFontStyle nStyle)
+ {
+ if (m_bNativeFontInfoOk)
+ m_vNativeFontInfo.SetStyle(nStyle);
+ else
+ m_nStyle = nStyle;
+ }
+
+ inline void SetWeight(wxFontWeight nWeight)
+ {
+ if (m_bNativeFontInfoOk)
+ m_vNativeFontInfo.SetWeight(nWeight);
+ else
+ m_nWeight = nWeight;
+ }
+
+ inline bool SetFaceName(const wxString& sFaceName)
+ {
+ if (m_bNativeFontInfoOk)
+ return m_vNativeFontInfo.SetFaceName(sFaceName);
+ else
+ m_sFaceName = sFaceName;
+ return true;
+ }
+
+ inline void SetUnderlined(bool bUnderlined)
+ {
+ if (m_bNativeFontInfoOk)
+ m_vNativeFontInfo.SetUnderlined(bUnderlined);
+ else
+ m_bUnderlined = bUnderlined;
+ }
+
+ inline void SetEncoding(wxFontEncoding vEncoding)
+ {
+ if (m_bNativeFontInfoOk)
+ m_vNativeFontInfo.SetEncoding(vEncoding);
+ else
+ m_vEncoding = vEncoding;
+ }
+
+ inline void SetPS(HPS hPS)
+ {
+ m_hPS = hPS;
+ }
+
+ inline void SetFM(PFONTMETRICS pFM)
+ {
+ m_pFM = pFM;
+ }
+
+ inline void SetNumFonts(int nNumFonts)
+ {
+ m_nNumFonts = nNumFonts;
+ }
+
+ //
+ // Native font info tests
+ //
+ bool HasNativeFontInfo() const { return m_bNativeFontInfoOk; }
+
+ const wxNativeFontInfo& GetNativeFontInfo() const
+ { return m_vNativeFontInfo; }
+
+protected:
+ //
+ // Common part of all ctors
+ //
+ void Init( int nSize
+ ,wxFontFamily nFamily
+ ,wxFontStyle nStyle
+ ,wxFontWeight nWeight
+ ,bool bUnderlined
+ ,const wxString& rsFaceName
+ ,wxFontEncoding vEncoding
+ );
+
+ void Init( const wxNativeFontInfo& rInfo
+ ,WXHFONT hFont = 0
+ ,WXHANDLE hPS = 0
+ );
+ //
+ // If true, the pointer to the actual font is temporary and SHOULD NOT BE
+ // DELETED by destructor
+ //
+ bool m_bTemporary;
+ int m_nFontId;
+
+ //
+ // Font characterstics
+ //
+ int m_nPointSize;
+ wxFontFamily m_nFamily;
+ wxFontStyle m_nStyle;
+ wxFontWeight m_nWeight;
+ bool m_bUnderlined;
+ wxString m_sFaceName;
+ wxFontEncoding m_vEncoding;
+ WXHFONT m_hFont;
+
+ //
+ // Native font info
+ //
+ wxNativeFontInfo m_vNativeFontInfo;
+ bool m_bNativeFontInfoOk;
+
+ //
+ // Some PM specific stuff
+ //
+ PFONTMETRICS m_pFM; // array of FONTMETRICS structs
+ int m_nNumFonts; // number of fonts in array
+ HPS m_hPS; // PS handle this font belongs to
+ FATTRS m_vFattrs; // Current fattrs struct
+ FACENAMEDESC m_vFname; // Current facename struct
+ bool m_bInternalPS; // Internally generated PS?
+}; // end of CLASS wxFontRefData
+
+#define M_FONTDATA ((wxFontRefData*)m_refData)