Adjusting width of rendered string


In Dia, we need to render our strings with the same width at different zoom
levels.  This doesn't automatically happen because fonts don't scale
linearly.  So far, we've been tweaking the size by scaling a little bit to
at least make the string fit, but a) it's slow, b) it's ugly, c) it's slow,
d) it doesn't always work, and e) it's ugly and slow.

I was hoping there would be an easy way to adjust the spacing between
letters to account for this (yes, I know letterspacing is evil, but it
should be small enough amounts to not be noticable).

I looked through the Pango docs, but didn't find any way to do this short
of doing my own run, which I'd rather avoid.  Is there any way to tell
Pango 'add this much total space to the line with letterspacing'?  Can
anybody show me examples of doing this either way?

Thanks in advance,

Lars Clausen (| HÃ¥rdgrim of Numenor
"I do not agree with a word that you say, but I   |----------------------------
will defend to the death your right to say it."   | Where are we going, and
    --Evelyn Beatrice Hall paraphrasing Voltaire  | what's with the handbasket?

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