Rendering text with specified width


We're trying in Dia to render text at a specifc width (to fit within
boxes) regardless of zoom factor.  Since fonts don't scale linearly,
this is kinda tricky.  Is there a standard way in Pango now to say
"render this text at this width exactly" (possibly just for a single
line at a time)?

I was hoping to use pango_layout_set_width(layout, my_width) and
pango_layout_justify(layout, TRUE), but with
pango_layout_set_wrap(layout, -1).  Would this force the width, or is
it bogus?  Which version of Pango would be required for it to work
(>1.4, it seems from the API docs)?

I know forcing a width will mess with all kinds of kerneling and pixel
aligning and stuff, but if Pango can't do it for us, we'll end up with
worse things like rendering to a bitmap and scaling that.  So I really
hope Pango can help us.


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