+
+
+class WXDLLEXPORT wxFontRefData: public wxGDIRefData
+{
+public:
+ wxFontRefData()
+ {
+ Init(10, wxDEFAULT, wxNORMAL, wxNORMAL,
+ false, wxT("applicationfont"), wxFONTENCODING_DEFAULT);
+ }
+
+ wxFontRefData(const wxFontRefData& data)
+ {
+ Init(data.m_pointSize, data.m_family, data.m_style, data.m_weight,
+ data.m_underlined, data.m_faceName, data.m_encoding);
+ }
+
+ wxFontRefData(int size,
+ int family,
+ int style,
+ int weight,
+ bool underlined,
+ const wxString& faceName,
+ wxFontEncoding encoding)
+ {
+ Init(size, family, style, weight, underlined, faceName, encoding);
+ }
+
+#if wxMAC_USE_CORE_TEXT
+ wxFontRefData( wxUint32 coreTextFontType );
+ wxFontRefData( CTFontRef font );
+ wxFontRefData( CTFontDescriptorRef fontdescriptor, int size );
+#endif
+
+ virtual ~wxFontRefData();
+
+ void SetNoAntiAliasing( bool no = true ) { m_noAA = no; }
+
+ bool GetNoAntiAliasing() const { return m_noAA; }
+
+ void SetPointSize( int size )
+ {
+ m_pointSize = size;
+ MacInvalidateNativeFont();
+ }
+
+ int GetPointSize() const { return m_pointSize; }
+
+ void SetFamily( int family )
+ {
+ m_family = family;
+ MacInvalidateNativeFont();
+ }
+
+
+ int GetFamily() const { return m_family; }
+
+ void SetStyle( int style )
+ {
+ m_style = style;
+ MacInvalidateNativeFont();
+ }
+
+
+ int GetStyle() const { return m_style; }
+
+ void SetWeight( int weight )
+ {
+ m_weight = weight;
+ MacInvalidateNativeFont();
+ }
+
+
+ int GetWeight() const { return m_weight; }
+
+ void SetUnderlined( bool u )
+ {
+ m_underlined = u;
+ MacInvalidateNativeFont();
+ }
+
+ bool GetUnderlined() const { return m_underlined; }
+
+ void SetFaceName( const wxString& facename )
+ {
+ m_faceName = facename;
+ MacInvalidateNativeFont();
+ }
+
+ const wxString& GetFaceName() const { return m_faceName; }
+
+ void SetEncoding( wxFontEncoding encoding )
+ {
+ m_encoding = encoding;
+ MacInvalidateNativeFont();
+ }
+
+ wxFontEncoding GetEncoding() const { return m_encoding; }
+
+ void MacInvalidateNativeFont();
+
+ void MacFindFont();
+
+protected:
+ // common part of all ctors
+ void Init(int size,
+ int family,
+ int style,
+ int weight,
+ bool underlined,
+ const wxString& faceName,
+ wxFontEncoding encoding);
+
+#if wxMAC_USE_CORE_TEXT
+ void Init( CTFontRef font );
+#endif
+ // font characterstics
+ int m_pointSize;
+ int m_family;
+ int m_style;
+ int m_weight;
+ bool m_underlined;
+ wxString m_faceName;
+ wxFontEncoding m_encoding;
+ bool m_noAA; // No anti-aliasing
+
+public:
+#if wxMAC_USE_ATSU_TEXT
+ FMFontFamily m_macFontFamily;
+ FMFontSize m_macFontSize;
+ FMFontStyle m_macFontStyle;
+
+ // ATSU Font Information
+
+ // this is split into an ATSU font id that may
+ // contain some styles (special bold fonts etc) and
+ // these are the additional qd styles that are not
+ // included in the ATSU font id
+ ATSUFontID m_macATSUFontID;
+ FMFontStyle m_macATSUAdditionalQDStyles ;
+
+ // for true themeing support we must store the correct font
+ // information here, as this speeds up and optimizes rendering
+ ThemeFontID m_macThemeFontID ;