Make converters between wxFontWeight and raw values public

These functions can be useful outside of src/common/fontcmn.cpp and,
potentially, even in the user code, so make them public methods of
wxFont.

No real changes, just add asserts verifying input argument value to
GetWeightClosestToNumericValue().
This commit is contained in:
Vadim Zeitlin
2018-09-07 03:05:34 +02:00
parent 4e0b4e5939
commit 6dd9f4208e
3 changed files with 81 additions and 51 deletions

View File

@@ -413,6 +413,10 @@ public:
static wxFontEncoding GetDefaultEncoding() { return ms_encodingDefault; }
static void SetDefaultEncoding(wxFontEncoding encoding);
// Convert between symbolic and numeric font weights.
static int GetNumericWeightOf(wxFontWeight weight);
static wxFontWeight GetWeightClosestToNumericValue(int numWeight);
// this doesn't do anything and is kept for compatibility only
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED_INLINE(void SetNoAntiAliasing(bool no = true), wxUnusedVar(no);)