Extending wxFont API & OSX Core Text Implementation (#877)

* Switch to pure Core Text Implementation, Start extended Font API

* mac fixes

* First msw implementation

* Fixing paste error

* fixing typo

* Rearranging lines to former fallthrough order

* Blind fixes for covering new abstract methods

* Blind gtk implementations

* Fixing according to travis ..

* Removing method defined in base

* formatting adaptions

* Extending the schema definition for new weights

* fixing typo, using wxRound, other fixes according to comments

* changes according to suggestions

* fixing init order, before the init of m_info was overridden by Init()

* redo

* redo

* redo

* Cleanup

Removing obsolete code snippets, proper traces for font names

* Moving common code

Only the Get/SetNumericWeight calls should now be implemented in the native part, the ‚old‘ Get/SetWeight are common code and use the numeric counterparts.

* Updating docs

* commit wa missing changes.txt

* Doc fixes

* Full stops added
This commit is contained in:
Stefan Csomor
2018-09-01 19:42:18 +02:00
committed by GitHub
parent d2c77146db
commit 4580cdb9ad
22 changed files with 1210 additions and 800 deletions

View File

@@ -53,7 +53,7 @@ static QFont::StyleHint ConvertFontFamily(wxFontFamily family)
return QFont::AnyStyle;
}
static QFont::Weight ConvertFontWeight(wxFontWeight weight)
static QFont::Weight ConvertFontWeight(int weight)
{
switch (weight)
{
@@ -66,6 +66,12 @@ static QFont::Weight ConvertFontWeight(wxFontWeight weight)
case wxFONTWEIGHT_BOLD:
return QFont::Bold;
case wxFONTWEIGHT_SEMIBOLD:
return QFont::DemiBold;
case wxFONTWEIGHT_HEAVY:
return QFont::Black;
case wxFONTWEIGHT_MAX:
wxFAIL_MSG( "Invalid font weight value" );
break;
@@ -328,7 +334,7 @@ wxFontStyle wxNativeFontInfo::GetStyle() const
return wxFontStyle();
}
wxFontWeight wxNativeFontInfo::GetWeight() const
int wxNativeFontInfo::GetNumericWeight() const
{
switch ( m_qtFont.weight() )
{
@@ -339,12 +345,16 @@ wxFontWeight wxNativeFontInfo::GetWeight() const
return wxFONTWEIGHT_LIGHT;
case QFont::DemiBold:
return wxFONTWEIGHT_SEMIBOLD;
case QFont::Black:
return wxFONTWEIGHT_HEAVY;
case QFont::Bold:
return wxFONTWEIGHT_BOLD;
}
wxFAIL_MSG( "Invalid font weight value" );
return wxFontWeight();
return wxFONTWEIGHT_NORMAL;
}
bool wxNativeFontInfo::GetUnderlined() const
@@ -411,7 +421,7 @@ void wxNativeFontInfo::SetStyle(wxFontStyle style)
//case wxFONTSTYLE_NORMAL:
}
void wxNativeFontInfo::SetWeight(wxFontWeight weight)
void wxNativeFontInfo::SetNumericWeight(int weight)
{
m_qtFont.setWeight(ConvertFontWeight(weight));
}