Re: pango_font_description_better_match background and documentation
- From: Behdad Esfahbod <behdad behdad org>
- To: smirnov ispras ru
- Cc: gtk-i18n-list gnome org
- Subject: Re: pango_font_description_better_match background and documentation
- Date: Mon, 15 Dec 2008 13:48:18 -0500
Michael Smirnov wrote:
> Hello Behdad,
Hi,
>> Oh, is there any way that we can host those tests in pango itself?
>> That would
>> be freaking awesome.
>
> Binary packages of our tests (test framework and the tests themselves)
> are here:
> ftp://ftp.linux-foundation.org/pub/lsb/snapshots/t2c-desktop-tests/
>
> There are only rpm at this time, but soon there'll be deb as well.
>
> Tests source code will be placed at:
> http://bzr.linux-foundation.org/lsb/devel/t2c-desktop-tests
>
> At the meantime tests for pango library are under development. As soon
> as they ready they will appear in both these places.
>
> Also pango test suite version will be released that do not depend on any
> of our specialized tools, so it will be easier to use pango test on your
> end.
I'm only interested in the source, and in a state that I can include them in
pango itself. Please let me know when they are available.
>> Well, it says "Approximate matching is done for weight and style".
>> Again,
>> docs can be improved to say that that approximate always creates a match.
>> Again, feel free to reword.
>
> Right, I thought so too, that approximate always creates a match. But
> it's not:
>
> PangoFontDescription *desc = pango_font_description_new();
> PangoFontDescription *new_match = pango_font_description_new();
>
> pango_font_description_set_style(new_match, PANGO_STYLE_ITALIC);
>
> pango_font_description_better_match(desc, NULL, new_match) will not
> return TRUE, although only style is different in these structures
> (PANGO_STYLE_ITALIC in desc and PANGO_STYLE_ITALIC in new_match).
>
> The thing is why you need in compute_distance function:
>
> else if (a->style != PANGO_STYLE_NORMAL &&
> b->style != PANGO_STYLE_NORMAL)
> {
> /* Equate oblique and italic, but with a big penalty
> */
> return 1000000 + abs (a->weight - b->weight);
> }
> else
> return G_MAXINT;
>
> Why not just:
>
> else
> {
> return 1000000 + abs (a->weight - b->weight);
> }
>
> IMHO, I'd sort like this: Normal, Oblique (as it's just like Normal but
> slants to the right) and then Italic (as it's just like Oblique but
> looks handwritten (different glyphs)).
Oh, so style must be equal, except that Oblique and Italic match too, with a
high penalty.
behdad
> Thank you.
>
> Regards,
> Michael
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]