[wxGTK2] Move wxFontRefData::SetStyle/SetWeight to wxNativeFontInfo
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -494,24 +494,7 @@ void wxFontRefData::SetStyle(int style)
|
|||||||
m_style = style;
|
m_style = style;
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
// Get native info
|
m_nativeFontInfo.SetStyle((wxFontStyle)style);
|
||||||
PangoFontDescription *desc = m_nativeFontInfo.description;
|
|
||||||
|
|
||||||
switch ( style )
|
|
||||||
{
|
|
||||||
case wxFONTSTYLE_ITALIC:
|
|
||||||
pango_font_description_set_style( desc, PANGO_STYLE_ITALIC );
|
|
||||||
break;
|
|
||||||
case wxFONTSTYLE_SLANT:
|
|
||||||
pango_font_description_set_style( desc, PANGO_STYLE_OBLIQUE );
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
wxFAIL_MSG( _T("unknown font style") );
|
|
||||||
// fall through
|
|
||||||
case wxFONTSTYLE_NORMAL:
|
|
||||||
pango_font_description_set_style( desc, PANGO_STYLE_NORMAL );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
if ( HasNativeFont() )
|
if ( HasNativeFont() )
|
||||||
{
|
{
|
||||||
@@ -544,25 +527,7 @@ void wxFontRefData::SetWeight(int weight)
|
|||||||
m_weight = weight;
|
m_weight = weight;
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
PangoFontDescription *desc = m_nativeFontInfo.description;
|
m_nativeFontInfo.SetWeight((wxFontWeight)weight);
|
||||||
switch ( weight )
|
|
||||||
{
|
|
||||||
case wxFONTWEIGHT_BOLD:
|
|
||||||
pango_font_description_set_weight(desc, PANGO_WEIGHT_BOLD);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case wxFONTWEIGHT_LIGHT:
|
|
||||||
pango_font_description_set_weight(desc, PANGO_WEIGHT_LIGHT);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
wxFAIL_MSG( _T("unknown font weight") );
|
|
||||||
// fall through
|
|
||||||
|
|
||||||
case wxFONTWEIGHT_NORMAL:
|
|
||||||
// unspecified
|
|
||||||
pango_font_description_set_weight(desc, PANGO_WEIGHT_NORMAL);
|
|
||||||
}
|
|
||||||
#else //!__WXGTK20__
|
#else //!__WXGTK20__
|
||||||
if ( HasNativeFont() )
|
if ( HasNativeFont() )
|
||||||
{
|
{
|
||||||
|
@@ -494,24 +494,7 @@ void wxFontRefData::SetStyle(int style)
|
|||||||
m_style = style;
|
m_style = style;
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
// Get native info
|
m_nativeFontInfo.SetStyle((wxFontStyle)style);
|
||||||
PangoFontDescription *desc = m_nativeFontInfo.description;
|
|
||||||
|
|
||||||
switch ( style )
|
|
||||||
{
|
|
||||||
case wxFONTSTYLE_ITALIC:
|
|
||||||
pango_font_description_set_style( desc, PANGO_STYLE_ITALIC );
|
|
||||||
break;
|
|
||||||
case wxFONTSTYLE_SLANT:
|
|
||||||
pango_font_description_set_style( desc, PANGO_STYLE_OBLIQUE );
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
wxFAIL_MSG( _T("unknown font style") );
|
|
||||||
// fall through
|
|
||||||
case wxFONTSTYLE_NORMAL:
|
|
||||||
pango_font_description_set_style( desc, PANGO_STYLE_NORMAL );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
if ( HasNativeFont() )
|
if ( HasNativeFont() )
|
||||||
{
|
{
|
||||||
@@ -544,25 +527,7 @@ void wxFontRefData::SetWeight(int weight)
|
|||||||
m_weight = weight;
|
m_weight = weight;
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
PangoFontDescription *desc = m_nativeFontInfo.description;
|
m_nativeFontInfo.SetWeight((wxFontWeight)weight);
|
||||||
switch ( weight )
|
|
||||||
{
|
|
||||||
case wxFONTWEIGHT_BOLD:
|
|
||||||
pango_font_description_set_weight(desc, PANGO_WEIGHT_BOLD);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case wxFONTWEIGHT_LIGHT:
|
|
||||||
pango_font_description_set_weight(desc, PANGO_WEIGHT_LIGHT);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
wxFAIL_MSG( _T("unknown font weight") );
|
|
||||||
// fall through
|
|
||||||
|
|
||||||
case wxFONTWEIGHT_NORMAL:
|
|
||||||
// unspecified
|
|
||||||
pango_font_description_set_weight(desc, PANGO_WEIGHT_NORMAL);
|
|
||||||
}
|
|
||||||
#else //!__WXGTK20__
|
#else //!__WXGTK20__
|
||||||
if ( HasNativeFont() )
|
if ( HasNativeFont() )
|
||||||
{
|
{
|
||||||
|
@@ -207,14 +207,41 @@ void wxNativeFontInfo::SetPointSize(int WXUNUSED(pointsize))
|
|||||||
wxFAIL_MSG( _T("not implemented") );
|
wxFAIL_MSG( _T("not implemented") );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxNativeFontInfo::SetStyle(wxFontStyle WXUNUSED(style))
|
void wxNativeFontInfo::SetStyle(wxFontStyle style)
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( _T("not implemented") );
|
switch (style)
|
||||||
|
{
|
||||||
|
case wxFONTSTYLE_ITALIC:
|
||||||
|
pango_font_description_set_style( description, PANGO_STYLE_ITALIC );
|
||||||
|
break;
|
||||||
|
case wxFONTSTYLE_SLANT:
|
||||||
|
pango_font_description_set_style( description, PANGO_STYLE_OBLIQUE );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
wxFAIL_MSG( _T("unknown font style") );
|
||||||
|
// fall through
|
||||||
|
case wxFONTSTYLE_NORMAL:
|
||||||
|
pango_font_description_set_style( description, PANGO_STYLE_NORMAL );
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxNativeFontInfo::SetWeight(wxFontWeight WXUNUSED(weight))
|
void wxNativeFontInfo::SetWeight(wxFontWeight weight)
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( _T("not implemented") );
|
switch (weight)
|
||||||
|
{
|
||||||
|
case wxFONTWEIGHT_BOLD:
|
||||||
|
pango_font_description_set_weight(description, PANGO_WEIGHT_BOLD);
|
||||||
|
break;
|
||||||
|
case wxFONTWEIGHT_LIGHT:
|
||||||
|
pango_font_description_set_weight(description, PANGO_WEIGHT_LIGHT);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
wxFAIL_MSG( _T("unknown font weight") );
|
||||||
|
// fall through
|
||||||
|
case wxFONTWEIGHT_NORMAL:
|
||||||
|
pango_font_description_set_weight(description, PANGO_WEIGHT_NORMAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxNativeFontInfo::SetUnderlined(bool WXUNUSED(underlined))
|
void wxNativeFontInfo::SetUnderlined(bool WXUNUSED(underlined))
|
||||||
|
Reference in New Issue
Block a user