GtkTextView中文本不对齐的问题

在stdout下用printf等输出很好的,到了GtkTextView就不对劲了,经过检查,是字体的问题。

默认使用中文字体,就会出现不对齐的情况。

如下解决:

PangoFontDescription *mFontText;
mFontText = pango_font_description_from_string("Monospace 10");//设置字体
gtk_widget_modify_font(mText, mFontText);

Leave a Reply

Your email address will not be published. Required fields are marked *