Re: [gtk-osx-users] Monospace font and underscore character

Hi John!

That's pretty cool. Monospace only? Replicatable in gtk-demo? With unstable 
It's probably Pango, but file a bug with Gtk and it can be changed to Pango 
if that turns out to be the case. If it doesn't replicate in gtk-demo, try 
to make a minimal program that demonstrates the problem (look in tests for a 
starting point).

Here is a patch to gtk-demo/textview.c that illustrates the problem:

bash-3.2$ diff -u textview-orig.c textview.c
--- textview-orig.c2013-03-09 14:05:50.000000000 -0800
+++ textview.c2013-03-09 14:04:27.000000000 -0800
@@ -444,6 +444,14 @@
        * a view widget.
       view1 = gtk_text_view_new ();
+      // begin Monospace modification
+      PangoFontDescription *pfd = pango_font_description_new();
+      pango_font_description_set_family(pfd, "Monospace");
+      gtk_widget_modify_font(view1, pfd);
+      pango_font_description_free(pfd);
+      // end Monospace modification
       buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view1));
       view2 = gtk_text_view_new_with_buffer (buffer);
I also attach a screenshot that shows the "Text Widget/Multiple Views" demo of gtk-demo with this change and 
a line of underscores inserted.  It only happens with the Monospace font (top GtkTextView) and not with the 
default one (bottom GtkTextView).

This is with gtk2 stable.  I am not able to compile gtk2 unstable.  When compiling gopbject-introspection it 
misses some symbols in libffi.  But maybe you can verify that this problem still exists in the latest build?

Best regards,


Attachment: Monospace-underscores.png
Description: PNG image

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]