Re: pango_font_description_better_match background and documentation



Michael Smirnov wrote:
> Hello guys,

Hi Michael,

> My name is Michael, I'm working at ISP RAS on Linux verification. The
> work is being done within LSB Infrastructure project by the contract
> with Linux Foundation.
> 
> Currently my task is writing tests for pango library. If you've got some
> time, I would really appreciate if you answer a few questions.

Oh, is there any way that we can host those tests in pango itself?  That would
be freaking awesome.

> 1. The documentation for pango_font_description_better_match function
> (http://library.gnome.org/devel/pango/unstable/pango-Fonts.html#pango-font-description-better-match)
> states that "Approximate matching is done for weight and style; other
> attributes must match exactly". But as far as I can see from source code
> it is not checked if family name field, size field and its absoluteness
> match. Is the documentation not complete or is this a bug in the
> implementation of the function?

I think you should interpret that sentence in the context introduced by the
sentence before it: "Determines if the style attributes of @new_match are a
closer match...".  So, "other attributes" here really refers to "other style
attributes".  With "style attributes" implicitly meaning all attributes sans
family and size.  The docs can improved for sure.  Feel free to open a bug and
submit a patch.


> 2. It is not clear from the documentation how to tell from the
> circumstances if one font description would be a match for another. Say,
> you cannot tell that if style of one font description is
> PANGO_STYLE_NORMAL and style of another is PANGO_STYLE_OBLIQUE, than
> they do not match. Do you rely on some font matching standard or is it
> something internal?

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.

This is not implementing any standard, no.

Cheers,

behdad

> I'm looking forward to hearing back from you.
> 
> Thank you.
> 
> With best regards,
> Michael
> 


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