Pango tab stops


I want to use a PangoTabArray to pass tab stop settings to a print function
along with text to be sent to a printer. The idea is that the caller passes
the pre-set PangoTabArray, and the print function then calls
pango_layout_set_tabs to add it to the PangoLayout created via

But there seems to be a problem with setting the tabs correctly for the
resolution (dpi) of the printer. With a PangoTabArray the tabs are specified
in either pixels or Pango units, and to use either to set tag stops at fixed
distances requires knowledge of the resolution of the device, but the code
requesting the print cannot know that (the user has not even selected a
printer yet).

Two solutions that I can see are 1) define the API to accept tabs set for a
300 dpi printer and have it internally multiple them up or down if necessary
once the print device has been selected, or 2) pass the tab settings in a
generic array or list and create the PangoTabArray internally once the print
device has been selected.

Neither is particularly neat, so I'm wondering if there may be some existing
structure or API somewhere in GTK or the other components for passing tab
stops in units such as inches, mm, etc.?


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