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:
Vadim Zeitlin
2018-09-05 22:28:38 +02:00
parent 08e5acedcc
commit e05a732666
8 changed files with 40 additions and 48 deletions

View File

@@ -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);