Re: Text at a certain width
- From: Behdad Esfahbod <behdad cs toronto edu>
- To: Lars Ræder <larsrc gmail com>
- Cc: gtk-i18n-list gnome org
- Subject: Re: Text at a certain width
- Date: Sat, 25 Mar 2006 02:01:01 -0500 (EST)
On Sat, 25 Mar 2006, [ISO-8859-1] Lars R�r wrote:
> Hi!
>
> In Dia, we render text with Pango, and typically the text is within boxes
> just big enough to fit the text. This means that when zooming in and out,
> we want the text to be rendered with the same relative width, i.e.
> stretching or compressing it a little when font scaling isn't linear. How
> can we do that with Pango?
>
> There's mention in pango_layout_set_justify (which would somewhat solve it)
> that it's not implemented in 1.10. Am I missing some other way to set the
> width? This functionality is critical to the looks and performance of Dia
> -- currently we tweak the font size every time we render a string at
> non-100% zoom, which is *horribly* slow, but works. I may have to give
> damn-all about the good looks and just stretch the rendered bitmap. I don't
> really care if it looks a little funny in certain fonts, as long as it looks
> reasonable in the most frequently used cases.
Hello,
If you are using PangoCairo, there are a whole lot of
possibilies. Changing your cairo transformation matrix behind
Pango's back (not calling pango_cairo_update_layout) is one such
way (not recommended though), turning off metrics hinting
(CAIRO_HINT_METRICS_OFF) is another, with degraded rendering
quality.
> -Lars
--behdad
http://behdad.org/
"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
-- Dan Bern, "New American Language"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]