Switch to using float for point size in wxNativeFontInfo
Use float as the fundamental type for the font size and implement wxNativeFontInfo::{Set,Get}PointSize() as wrappers around the new {Set,Get}FractionalPointSize(). Update wxNativeFontInfo for all platforms and replace the use of its SetPointSize() method with SetFractionalPointSize() in wxFont for the platforms already supporting fractional point sizes (don't change the others just yet). Note that wxNativeFontInfo::{Get,Set}PointSize() are preserved for backwards compatibility but shouldn't be used in any code inside the library itself any more (again, this is not the case yet, but will be soon).
This commit is contained in:
@@ -185,7 +185,7 @@ public :
|
||||
//
|
||||
#define wxNO_NATIVE_FONTINFO
|
||||
|
||||
int pointSize;
|
||||
float pointSize;
|
||||
wxFontFamily family;
|
||||
wxFontStyle style;
|
||||
wxFontWeight weight;
|
||||
@@ -236,9 +236,9 @@ public:
|
||||
if ( font.IsUsingSizeInPixels() )
|
||||
SetPixelSize(font.GetPixelSize());
|
||||
else
|
||||
SetPointSize(font.GetPointSize());
|
||||
SetFractionalPointSize(font.GetFractionalPointSize());
|
||||
#else
|
||||
SetPointSize(font.GetPointSize());
|
||||
SetFractionalPointSize(font.GetFractionalPointSize());
|
||||
#endif
|
||||
|
||||
// set the family/facename
|
||||
@@ -268,7 +268,8 @@ public:
|
||||
wxFontFamily GetFamily() const;
|
||||
wxFontEncoding GetEncoding() const;
|
||||
|
||||
void SetPointSize(float pointsize);
|
||||
void SetPointSize(int pointsize);
|
||||
void SetFractionalPointSize(float pointsize);
|
||||
void SetPixelSize(const wxSize& pixelSize);
|
||||
void SetStyle(wxFontStyle style);
|
||||
void SetNumericWeight(int weight);
|
||||
|
Reference in New Issue
Block a user