Problem with pango_tab_array_new_with_positions?



Hi,

I think I may have discovered a problem with
pango_tab_array_new_with_positions:

I was previously creating a PangoTabArray using pixels like this which
worked fine:
tabArray = pango_tab_array_new_with_positions(5, TRUE,
                   PANGO_TAB_LEFT, 30,       /* 0.1" x 300 dpi */
                   PANGO_TAB_LEFT, 150,      /* 0.5" x 300 dpi */
                   PANGO_TAB_LEFT, 990,      /* 3.3" x 300 dpi */
                   PANGO_TAB_LEFT, 1260,     /* 4.2" x 300 dpi */
                   PANGO_TAB_LEFT, 1800);    /* 6.0" x 300 dpi */

Then I changed it to use Pango units and it changed to this:
#define PANGO_CAIRO_INCHES(n) (n * 72 * PANGO_SCALE)
tabArray = pango_tab_array_new_with_positions(5, FALSE,
                   PANGO_TAB_LEFT, PANGO_CAIRO_INCHES(0.1),
                   PANGO_TAB_LEFT, PANGO_CAIRO_INCHES(0.5),
                   PANGO_TAB_LEFT, PANGO_CAIRO_INCHES(3.3),
                   PANGO_TAB_LEFT, PANGO_CAIRO_INCHES(4.2),
                   PANGO_TAB_LEFT, PANGO_CAIRO_INCHES(6.0));

But with that no text from the 2nd tab stop on got printed. For example if I
printed "a\tb\tc\td" the "a" and "b" would print, but the "c" and "d" would
not appear. At first I suspected something wrong in my code somewhere, but
then found that if I changed the above to as follows the text at all the tab
positions gets printed as it should:
tabArray = pango_tab_array_new(5, FALSE);
pango_tab_array_set_tab(tabArray, 0, PANGO_TAB_LEFT,
PANGO_CAIRO_INCHES(0.1));
pango_tab_array_set_tab(tabArray, 1, PANGO_TAB_LEFT,
PANGO_CAIRO_INCHES(0.5));
pango_tab_array_set_tab(tabArray, 2, PANGO_TAB_LEFT,
PANGO_CAIRO_INCHES(3.3));
pango_tab_array_set_tab(tabArray, 3, PANGO_TAB_LEFT,
PANGO_CAIRO_INCHES(4.2));
pango_tab_array_set_tab(tabArray, 4, PANGO_TAB_LEFT,
PANGO_CAIRO_INCHES(6.0));

Theoretically the effect of these should be identical. Anyone know if this
is a known problem (I can't find any references to
pango_tab_array_new_with_positions in bugzilla)?

Ian




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