[cairo] cairo/quartz on iPhone

Vladimir Vukicevic vladimir at pobox.com
Fri Mar 7 09:45:37 PST 2008

On Mar 7, 2008, at 1:27 AM, Behdad Esfahbod wrote:

> On Fri, 2008-03-07 at 03:52 -0500, Vladimir Vukicevic wrote:
>> The Quartz backend works as-is; the only issue there is that it was
>> including Carbon.h, when it really should just be including
>> CoreGraphics.h.  The bigger issue is that the iPhone does not have
>> ATSUI (which is fine -- ATS is being deprecated on OSX overall), so
>> I
>> wrote a start of a CGFont backend.  This really should be the main
>> backend for Quartz; we can main compat with the old ATSUI font_face
>> creation function pretty easily, but the ATSUI internals should go
>> away.  I might try to do this before we release 1.6, as I'd like to
>> see Quartz become a supported backend in 1.6 and these are really
>> general non-iPhone specific issues.
> Min elaborating a bit for an Apple-illiterate like me?  ATSUI is being
> deprecated?  What will do text layout in the future then?  What's the
> different between CGFont and ATS, functionality-wise?  Those kind of
> things...

ATSUI does complex text layout for OSX; it's roughly equivalent to  
Pango.  It's been deprecated (it has a horrid API and is slow for many  
things), and at least on desktop OSX, is being replaced with Core  
Text.  CT is much nicer to work with, and I'm pretty sure these days  
ATSUI is using a lot of CT under the hood.  I'm not sure what the  
complex text layout replacement is on the iPhone, but I don't think  
that matters for cairo's purposes.

CGFont is just a handle to a native (unscaled) font; you can do things  
like render glyphs, convert unicode chars to glyph ids, get glyph  
bounds, etc., but it doesn't do any complex text layout; it's also  
sticking around, unlike ATSUI :)  This is the right level for cairo to  
be hooking into anyway -- it maps pretty directly to the font_face/ 
scaled_font operations.

> Also, getting quartz as supported in 1.6 may not be very realistic.   
> If
> you are serious about it, you may want to move the quartz_image stuff
> into a separate header file for now.  Without those, the cairo- 
> quartz.h
> API looks solid.  Same about cairo-atsui.h, even if atsui will be
> deprecated, that function is still useful, and we can add other
> font-face constructors in the future.  Or should the CGFont stuff be
> done as a new font backend with a new type?

Sure, if it's just the quartz image stuff you object to, that's an  
easy fix :)  I'll move those into a separate header, do you want a  
separate configure option for it as well?  The CGFont backend is a new  
font backend, but the current atsui entry point can easily be  
implemented in terms of it (there's a straightforward way to go from  
an ATSFontRef to a CGFontRef).

     - Vlad

More information about the cairo mailing list