[cairo] How to check if a font exists in Cairo and Pango?

Bill Spitzak spitzak at gmail.com
Thu Apr 11 11:22:04 PDT 2013


On 04/11/2013 04:55 AM, Ken Resander wrote:
> Many thanks Bill for the very useful information.
>
> I will use it to check that family, style and weight are available for a
> choice. Would have liked to include size (in pts) too, but it (psz) was
> always returned as 0 by:
>
> pfd = pango_font_face_describe(face);
> pstyle = pango_font_description_get_style( pfd ); //ok
> pwt = pango_font_description_get_weight( pfd ); //ok
> psz = pango_font_description_get_size( pfd ); // 0 - not ok
>
> Your dump_stuff function also did not return any size-list information.
> What might be the cause?

I think this indicates that the font can be scaled arbitrarily. I did 
not see any sizes when I ran it either, which makes sense as all the 
fonts are scalable outlines. Not sure if pango can ever produce this 
information, or what would happen if it did and you asked for a font 
size not in the list.



More information about the cairo mailing list