Re: Pango API extension: pango_font_matches_description



On 12 Mar 2001, Sven Neumann wrote:

> > First of all a glyph cache on the level you seem to suggest here does not
> > fit the pango API at all. If you need a glyph cache you should do so in
> > the pango module (i.e. in pangoft2). There was actually a glyph cache in
> > the old GtkFB pango/freetype module, but i haven't moved that over to
> > pangoft2 when i made that switch.
>
> I'd need to create an entirely new pango module then since the cache I'm
> talking about here caches the glyphs in the graphics hardware. Alternatively
> there could be a glyph cache in the FT2 module that provides hooks to add
> your own implementation of bitmap creation and storage. This would however
> need significant changes to the pango API.

 Not to the Pango API per se, but possibly to the PangoFT2 API.

> > Second, there is no-one-to one correspondance between PangoFonts and
> > PangoFontDescriptions. There can be aliases, and several fonts may match a
> > PangoFontDescription. How would you match "Comic Sans MS, Arial, Helvetica
> > 18 bold" to a PangoFT2 font that represents arial for instance?
>
> I'm speaking about checking if a certain font matches a font_description,
> not the other way around.
>
> What is the use of the existing API calls pango_font_describe() and
> pango_font_desription_equal() then? A PangoFontDescription is never
> something like "Comic Sans MS, Arial, Helvetica 18 bold". It's a struct
> containing enums for style, variant, weight, stretch and size as well
> as a string holding the family_name. This string seems to be always a
> single name, at least if the PangoFontDescription originates from a
> call to pango_font_describe (font).
>
> If you consider my approach broken, could you hint me into the correct
> direction how to decide if two calls to pango_ft2_render() try to access
> glyphs from the same font?

Comparing pango_ft2_get_face() and glyph index seems like an exellent way.

/ Alex






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