GNOME Bugzilla – Bug 559014
Blank lines are not shown in a GtkLabel that has a Pango font family attribute
Last modified: 2009-11-04 17:57:04 UTC
Please describe the problem: This happens with Pango 1.22.0 but not with 1.20.5, and it only happens in Windows, not in Linux. If a GtkLabel has a Pango attributes list with an attribute to set the font family with certain fonts (added using pango_attr_family_new) then any blank lines in the text do not display, and it displays the text all squeezed up together. I tried calling pango_attr_family_new() with "Courier" and Veranda" and these both showed this problem, but calling it with "Arial" did not. Steps to reproduce: 1. Compile and run the test application (which I will attach) with Pango 1.22.0 and the text displays incorrectly. 2. Compile and run the test application with Pango 1.20.5 and the text displays as expected. Actual results: The label displaying text with the default font has blank lines, but the label displaying the same text with Courer font does not. Expected results: Blank lines should be shown in both labels. Does this happen every time? Yep. Other information: Note I was also using 2.14.4 and GLib 2.18.2.
Created attachment 121838 [details] A simple program that demonstrates the problem Attached a simple program that demonstrates the problem, with a make file - just type make to build it. Build and run this with Pango 2.22.0 in Windows to see the problem.
A bit more information. I notice that Courier New works OK where Courier does not. I then ran both cases with Pango debug messages turned on and compared the output, and found they differ significantly only here: With Courier: text_is_simple: Pango 1.22 (12 wchar_t): YES pango_win32_font_map_load_font:624 name=Courier pango_win32_font_map_load_font:624 name=Courier pango_win32_font_map_load_font:624 name=Courier pango_win32_font_map_load_font:624 name=dejavu sans With Courier New: text_is_simple: Pango 1.22 (12 wchar_t): YES pango_win32_font_map_load_font:624 name=Courier New pango_win32_font_map_load_font:632 got win32family pango_win32_font_map_load_font:624 name=Courier New pango_win32_font_map_load_font:632 got win32family text_is_simple: The quick (44 wchar_t): YES pango_win32_font_map_load_font:624 name=Courier New pango_win32_font_map_load_font:632 got win32family text_is_simple: 0123456789 (10 wchar_t): YES pango_win32_font_map_load_font:624 name=Courier New pango_win32_font_map_load_font:632 got win32family pango_win32_font_map_load_font:624 name=Courier New pango_win32_font_map_load_font:632 got win32family pango_win32_font_map_load_font:624 name=dejavu sans And that same section of debug output with Courier from Pango 1.20.5 (which displays it OK) is: text_is_simple: Pango 1.20 (12 wchar_t): YES pango_win32_font_map_load_font:513 name=Courier pango_win32_font_map_load_font:521 got win32family pango_win32_font_map_load_font:513 name=Courier New pango_win32_font_map_load_font:521 got win32family text_is_simple: English He (13 wchar_t): YES pango_win32_font_map_load_font:513 name=Courier New pango_win32_font_map_load_font:521 got win32family text_is_simple: 0123456789 (10 wchar_t): YES pango_win32_font_map_load_font:513 name=Courier pango_win32_font_map_load_font:521 got win32family pango_win32_font_map_load_font:513 name=Courier pango_win32_font_map_load_font:521 got win32family pango_win32_font_map_load_font:513 name=dejavu sans So it would appear that Pango 1.22 is not recognizing Courier as a Win32 family font.
This seems to be the same as Bug 455940.
Just attaching the test program as a single source file would be enough, people who are capable of debugging and helping have no problem building it. Anyway, resolving as duplicate. *** This bug has been marked as a duplicate of bug 455940 ***
Btw, are you sure you mean "Veranda" and not "Verdana"?
Verdana sorry - my mistake. Don't want to get into an argument about it, but the makefile is all of 250 bytes and it was there so I saw no reason not to include it.