[cairo] First implementation of font Changes

Owen Taylor otaylor at redhat.com
Fri Apr 8 13:58:31 PDT 2005


On Wed, 2005-04-06 at 09:41 -0400, Owen Taylor wrote:
> Here's a first implementation of the font name changes I proposed a few
> weeks ago.
> 
> Remaining blocking items:
> 
>  - Find a final name for cairo_font_name_t. My suggestion is 
>    cairo_face_t.
> 
>  - Test the win32 part of the patch. It's very straightforward
>    but I haven't even tried compiling it yet.

Done, done.

> Remaining non-blocking items:
> 
>  - Add a cache for toy API 
> 
>      family/slant/weight => font_name_t
> 
>  - Add a font_name_t/matrix/ctm => font_t cache to make setting
>    an existing font name onto a cairo_t more efficient.
> 
>  - Implement my proposal for cairo_set_font_size, 
>    cairo_set_font_matrix
> 
>  - Split the cairo_unscaled_font_t bits out of 
>    cairo_font_backend_t ... having the two mashed together is
>    just ugly.

Done, done, done, done.

>  - Think about the problem of hinting for finite DPI for fonts in
>    the PDF backend ... should hinted vs. non-hinted be part of the
>    font_name_t or part of the font_t? In either case, how do we 
>    get that information from the surface to the font?

Not done.

Everything is committed and in CVS now. As far as I know, font and
text handling should be in pretty good shape now. I wouldn't be
surprised if fixing up the ATSUI backend reveals some additional
backend needs. Performance testing could help.

We're still not doing very well on the case of displaying a single
font rotated at continuous angles via the toy API, since we do the
fontconfig matching separately for each font matrix. If you go
beyond MAX_CACHED_FONTS then you pay a heavy fontconfig matching
penalty.

We could do better in various ways:

 - Ignore effects of font size on fontconfig matching and keep
   a font/slant/weight => file/id cache in the FreeType backend.
   (What's one more cache?) 

   (Or we could arrange the internal interfaces to allow 
   caching the data on the CairoSimpleFontFace structure)

 - Extend fontconfig to tell us *if* font size mattered for 
   a particular match. (Since Cairo doesn't fontset, it usually
   doesn't matter. If you fontset, then it usually does matter
   for some bitmap font far down the fontset)
 
 - Factor out size from other elements of the matrix and keep
   a font/slant/weight/size => file/id cache in the FreeType
   backend. (Basically, what Pango does or tries to do)

   Doesn't help for scaling, but would help for rotation.

Regards,
						Owen

Ian: the magic number of angles is currently 24.... if you can
make roadster use less than that number of angles at once when
panning around, the toy API cache will work efficiently.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050408/092225e6/attachment.pgp


More information about the cairo mailing list