Add support for stricken-through fonts.

Support stricken-through fonts in wxMSW and wxGTK (including special support
in wxStaticText and wxTextCtrl).

Closes #9907.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70446 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-01-23 11:28:28 +00:00
parent 0634700a96
commit c7a49742ec
18 changed files with 361 additions and 101 deletions

View File

@@ -1738,24 +1738,13 @@ void wxGtkPrinterDCImpl::DoDrawRotatedText(const wxString& text, wxCoord x, wxCo
angle = -angle;
bool underlined = m_font.IsOk() && m_font.GetUnderlined();
const wxScopedCharBuffer data = text.utf8_str();
size_t datalen = strlen(data);
pango_layout_set_text( m_layout, data, datalen);
if (underlined)
{
PangoAttrList *attrs = pango_attr_list_new();
PangoAttribute *a = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
a->start_index = 0;
a->end_index = datalen;
pango_attr_list_insert(attrs, a);
pango_layout_set_attributes(m_layout, attrs);
pango_attr_list_unref(attrs);
}
const bool
setAttrs = wxGTKPrivate::SetPangoAttrsForFont(m_font, m_layout, datalen);
if (m_textForegroundColour.IsOk())
{
unsigned char red = m_textForegroundColour.Red();
@@ -1816,7 +1805,7 @@ void wxGtkPrinterDCImpl::DoDrawRotatedText(const wxString& text, wxCoord x, wxCo
cairo_restore( m_cairo );
if (underlined)
if (setAttrs)
{
// Undo underline attributes setting
pango_layout_set_attributes(m_layout, NULL);