Pango and consistent scaling of fonts



We're working on porting Dia[2] to GTK+ 2.0, and we have great success so
far[1].  However, one of the things I was hoping to get with Pango was
consistent font scaling.  This doesn't seem to happen -- I'm hoping we've
but missed some option or API part.  If not, it will be a serious problem.

The background:  In Dia, we can have boxes containing text.  The box
resizes dependning on the size of the text.  To avoid text running over the
end of the box or being ridiculously short, we need the text to scale
consistently.  That is, a text string rendered at size 10 should be exactly
half the size of the same string rendered at size 20.  This doesn't seem to
be the case in GDK 1.2 rendering, with Freetype 2.1 rendering and with
Pango rendering.  See example PNGs:

<URL:http://shasta.cs.uiuc.edu/~lrclause/Dia/BrownFox-gdk.png>
<URL:http://shasta.cs.uiuc.edu/~lrclause/Dia/BrownFox-nohint.png>
<URL:http://shasta.cs.uiuc.edu/~lrclause/Dia/BrownFox.png>

These strings are rendered with linearly increasing font size, but they end
up with non-linear sizes.  Is there some way to force Pango to do consistent
scaling?  The legibility of fonts at small sizes are of secondary
importance next to having the proper size.

If Pango can't do this, we will end up having to render the fonts in large
format and then shrink them by bitmap scaling, a most unsatisfactory
solution.  I hope somebody can point me at a better way to do it.

Thanks,
-Lars

[1] Only major bug was in gtk_color_selection_[sg]et_color, the new
versions work fine.

[2] http://www.lysator.liu.se/~alla/dia/dia.html

-- 
Lars Clausen (http://shasta.cs.uiuc.edu/~lrclause)| 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]