Added FontFromPixelSize
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29459 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -155,45 +155,45 @@ enum wxFontEncoding
|
|||||||
wxFONTENCODING_UTF32LE, // UTF-32 Little Endian Unicode encoding
|
wxFONTENCODING_UTF32LE, // UTF-32 Little Endian Unicode encoding
|
||||||
|
|
||||||
wxFONTENCODING_MACROMAN, // the standard mac encodings
|
wxFONTENCODING_MACROMAN, // the standard mac encodings
|
||||||
wxFONTENCODING_MACJAPANESE,
|
wxFONTENCODING_MACJAPANESE,
|
||||||
wxFONTENCODING_MACCHINESETRAD,
|
wxFONTENCODING_MACCHINESETRAD,
|
||||||
wxFONTENCODING_MACKOREAN,
|
wxFONTENCODING_MACKOREAN,
|
||||||
wxFONTENCODING_MACARABIC,
|
wxFONTENCODING_MACARABIC,
|
||||||
wxFONTENCODING_MACHEBREW,
|
wxFONTENCODING_MACHEBREW,
|
||||||
wxFONTENCODING_MACGREEK,
|
wxFONTENCODING_MACGREEK,
|
||||||
wxFONTENCODING_MACCYRILLIC,
|
wxFONTENCODING_MACCYRILLIC,
|
||||||
wxFONTENCODING_MACDEVANAGARI,
|
wxFONTENCODING_MACDEVANAGARI,
|
||||||
wxFONTENCODING_MACGURMUKHI,
|
wxFONTENCODING_MACGURMUKHI,
|
||||||
wxFONTENCODING_MACGUJARATI,
|
wxFONTENCODING_MACGUJARATI,
|
||||||
wxFONTENCODING_MACORIYA,
|
wxFONTENCODING_MACORIYA,
|
||||||
wxFONTENCODING_MACBENGALI,
|
wxFONTENCODING_MACBENGALI,
|
||||||
wxFONTENCODING_MACTAMIL,
|
wxFONTENCODING_MACTAMIL,
|
||||||
wxFONTENCODING_MACTELUGU,
|
wxFONTENCODING_MACTELUGU,
|
||||||
wxFONTENCODING_MACKANNADA,
|
wxFONTENCODING_MACKANNADA,
|
||||||
wxFONTENCODING_MACMALAJALAM,
|
wxFONTENCODING_MACMALAJALAM,
|
||||||
wxFONTENCODING_MACSINHALESE,
|
wxFONTENCODING_MACSINHALESE,
|
||||||
wxFONTENCODING_MACBURMESE,
|
wxFONTENCODING_MACBURMESE,
|
||||||
wxFONTENCODING_MACKHMER,
|
wxFONTENCODING_MACKHMER,
|
||||||
wxFONTENCODING_MACTHAI,
|
wxFONTENCODING_MACTHAI,
|
||||||
wxFONTENCODING_MACLAOTIAN,
|
wxFONTENCODING_MACLAOTIAN,
|
||||||
wxFONTENCODING_MACGEORGIAN,
|
wxFONTENCODING_MACGEORGIAN,
|
||||||
wxFONTENCODING_MACARMENIAN,
|
wxFONTENCODING_MACARMENIAN,
|
||||||
wxFONTENCODING_MACCHINESESIMP,
|
wxFONTENCODING_MACCHINESESIMP,
|
||||||
wxFONTENCODING_MACTIBETAN,
|
wxFONTENCODING_MACTIBETAN,
|
||||||
wxFONTENCODING_MACMONGOLIAN,
|
wxFONTENCODING_MACMONGOLIAN,
|
||||||
wxFONTENCODING_MACETHIOPIC,
|
wxFONTENCODING_MACETHIOPIC,
|
||||||
wxFONTENCODING_MACCENTRALEUR,
|
wxFONTENCODING_MACCENTRALEUR,
|
||||||
wxFONTENCODING_MACVIATNAMESE,
|
wxFONTENCODING_MACVIATNAMESE,
|
||||||
wxFONTENCODING_MACARABICEXT,
|
wxFONTENCODING_MACARABICEXT,
|
||||||
wxFONTENCODING_MACSYMBOL,
|
wxFONTENCODING_MACSYMBOL,
|
||||||
wxFONTENCODING_MACDINGBATS,
|
wxFONTENCODING_MACDINGBATS,
|
||||||
wxFONTENCODING_MACTURKISH,
|
wxFONTENCODING_MACTURKISH,
|
||||||
wxFONTENCODING_MACCROATIAN,
|
wxFONTENCODING_MACCROATIAN,
|
||||||
wxFONTENCODING_MACICELANDIC,
|
wxFONTENCODING_MACICELANDIC,
|
||||||
wxFONTENCODING_MACROMANIAN,
|
wxFONTENCODING_MACROMANIAN,
|
||||||
wxFONTENCODING_MACCELTIC,
|
wxFONTENCODING_MACCELTIC,
|
||||||
wxFONTENCODING_MACGAELIC,
|
wxFONTENCODING_MACGAELIC,
|
||||||
wxFONTENCODING_MACKEYBOARD,
|
wxFONTENCODING_MACKEYBOARD,
|
||||||
|
|
||||||
wxFONTENCODING_MACMIN = wxFONTENCODING_MACROMAN ,
|
wxFONTENCODING_MACMIN = wxFONTENCODING_MACROMAN ,
|
||||||
wxFONTENCODING_MACMAX = wxFONTENCODING_MACKEYBOARD ,
|
wxFONTENCODING_MACMAX = wxFONTENCODING_MACKEYBOARD ,
|
||||||
@@ -240,6 +240,7 @@ public:
|
|||||||
|
|
||||||
// accessors and modifiers for the font elements
|
// accessors and modifiers for the font elements
|
||||||
int GetPointSize() const;
|
int GetPointSize() const;
|
||||||
|
wxSize GetPixelSize() const;
|
||||||
wxFontStyle GetStyle() const;
|
wxFontStyle GetStyle() const;
|
||||||
wxFontWeight GetWeight() const;
|
wxFontWeight GetWeight() const;
|
||||||
bool GetUnderlined() const;
|
bool GetUnderlined() const;
|
||||||
@@ -248,6 +249,7 @@ public:
|
|||||||
wxFontEncoding GetEncoding() const;
|
wxFontEncoding GetEncoding() const;
|
||||||
|
|
||||||
void SetPointSize(int pointsize);
|
void SetPointSize(int pointsize);
|
||||||
|
void SetPixelSize(const wxSize& pixelSize);
|
||||||
void SetStyle(wxFontStyle style);
|
void SetStyle(wxFontStyle style);
|
||||||
void SetWeight(wxFontWeight weight);
|
void SetWeight(wxFontWeight weight);
|
||||||
void SetUnderlined(bool underlined);
|
void SetUnderlined(bool underlined);
|
||||||
@@ -283,7 +285,7 @@ struct wxNativeEncodingInfo
|
|||||||
|
|
||||||
wxNativeEncodingInfo();
|
wxNativeEncodingInfo();
|
||||||
~wxNativeEncodingInfo();
|
~wxNativeEncodingInfo();
|
||||||
|
|
||||||
// this struct is saved in config by wxFontMapper, so it should know to
|
// this struct is saved in config by wxFontMapper, so it should know to
|
||||||
// serialise itself (implemented in platform-specific code)
|
// serialise itself (implemented in platform-specific code)
|
||||||
bool FromString(const wxString& s);
|
bool FromString(const wxString& s);
|
||||||
@@ -314,7 +316,7 @@ bool wxTestFontEncoding(const wxNativeEncodingInfo& info);
|
|||||||
%inline %{
|
%inline %{
|
||||||
wxNativeEncodingInfo* wxGetNativeFontEncoding(wxFontEncoding encoding)
|
wxNativeEncodingInfo* wxGetNativeFontEncoding(wxFontEncoding encoding)
|
||||||
{ wxPyRaiseNotImplemented(); return NULL; }
|
{ wxPyRaiseNotImplemented(); return NULL; }
|
||||||
|
|
||||||
bool wxTestFontEncoding(const wxNativeEncodingInfo& info)
|
bool wxTestFontEncoding(const wxNativeEncodingInfo& info)
|
||||||
{ wxPyRaiseNotImplemented(); return false; }
|
{ wxPyRaiseNotImplemented(); return false; }
|
||||||
%}
|
%}
|
||||||
@@ -460,6 +462,23 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// There is a real ctor for this on wxMSW, but not the others, so just use
|
||||||
|
// the factory funciton in all cases.
|
||||||
|
%extend {
|
||||||
|
%name(FontFromPixelSize) wxFont(const wxSize& pixelSize,
|
||||||
|
int family,
|
||||||
|
int style,
|
||||||
|
int weight,
|
||||||
|
bool underlined = false,
|
||||||
|
const wxString& face = wxEmptyString,
|
||||||
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) {
|
||||||
|
return wxFontBase::New(pixelSize, family,
|
||||||
|
style, weight, underlined,
|
||||||
|
face, encoding);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// was the font successfully created?
|
// was the font successfully created?
|
||||||
bool Ok() const;
|
bool Ok() const;
|
||||||
@@ -473,6 +492,8 @@ public:
|
|||||||
|
|
||||||
// accessors: get the font characteristics
|
// accessors: get the font characteristics
|
||||||
virtual int GetPointSize() const;
|
virtual int GetPointSize() const;
|
||||||
|
virtual wxSize GetPixelSize() const;
|
||||||
|
virtual bool IsUsingSizeInPixels() const;
|
||||||
virtual int GetFamily() const;
|
virtual int GetFamily() const;
|
||||||
virtual int GetStyle() const;
|
virtual int GetStyle() const;
|
||||||
virtual int GetWeight() const;
|
virtual int GetWeight() const;
|
||||||
@@ -488,6 +509,7 @@ public:
|
|||||||
|
|
||||||
// change the font characteristics
|
// change the font characteristics
|
||||||
virtual void SetPointSize( int pointSize );
|
virtual void SetPointSize( int pointSize );
|
||||||
|
virtual void SetPixelSize( const wxSize& pixelSize );
|
||||||
virtual void SetFamily( int family );
|
virtual void SetFamily( int family );
|
||||||
virtual void SetStyle( int style );
|
virtual void SetStyle( int style );
|
||||||
virtual void SetWeight( int weight );
|
virtual void SetWeight( int weight );
|
||||||
@@ -512,7 +534,7 @@ public:
|
|||||||
// encoding parameter
|
// encoding parameter
|
||||||
static wxFontEncoding GetDefaultEncoding() { return ms_encodingDefault; }
|
static wxFontEncoding GetDefaultEncoding() { return ms_encodingDefault; }
|
||||||
static void SetDefaultEncoding(wxFontEncoding encoding);
|
static void SetDefaultEncoding(wxFontEncoding encoding);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user