After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 584586 - pango_layout_set_width does not seem to work in properly Windows
pango_layout_set_width does not seem to work in properly Windows
Status: RESOLVED NOTABUG
Product: pango
Classification: Platform
Component: cairo
1.22.x
Other All
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2009-06-02 05:06 UTC by Ian Puleston
Modified: 2009-07-20 18:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ian Puleston 2009-06-02 05:06:54 UTC
Please describe the problem:
The following call to pango_layout_set_width() to set the width to 7.5" (for 8.5" paper with 0.5" left and right margins) works great in Linux, but in Windows the text is wrapped at about 1.7 inches:

    gdouble leftMargin = 0.5;
    gdouble rightMargin = 0.5;
    gdouble widthAvail = 8.5 - leftMargin - rightMargin;
    pango_layout_set_width(layout, (int)(widthAvail * PANGO_SCALE * 72));

This can be seen with the small test application attached with http://bugzilla.gnome.org/show_bug.cgi?id=584585. The call to pango_layout_set_width() is in function setupPrintLayout() in tstPrint.c. It has a fixed page width of 8.5" and margins are set to 0.5" in tstApp.c so the text should wrap at 7.5".

Steps to reproduce:
1. Execute the test application attached to http://bugzilla.gnome.org/show_bug.cgi?id=584585.
2. Enter a long string of short words, click Print and look at the printed text.


Actual results:
In Windows the printed text is wrapped at about 1.7". In Linux it wraps at 7.5".

Expected results:
It should wrap at 7.5" in all cases.

Does this happen every time?
Yes

Other information:
Comment 1 Behdad Esfahbod 2009-07-20 18:05:29 UTC
Your code has a section in "#ifdef _WIN32" which is clearly changing the margins on win32.  How do you expect it to work like on Linux then?!