Re: [PATCH] Re: cairo-quartz-font.c: Non-public CGFontGetGlyphPath now deprecated

Simon Cozens <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On 11/07/2014 08:16, Andrea Canciani wrote:
> Is this also going to work on 10.4?
> IIRC the CoreText API has been introduced in 10.5, so we should avoid linking it.
>         else
>           quartz_LIBS="-Xlinker -framework -Xlinker ApplicationServices"
>         fi

If you want to remain compatible with 10.4 (about 2% of installs) then yes, we 
should do a separate test for CoreText; my configure-fu is not strong enough 
to separate them.

> An alternative which should also work on 10.4 looks like this: ...
> Assuming the new check in the ensure function, you could do:
> if (CTFontCreateWithGraphicsFontPtr && CTFontCreatePathForGlyphPtr) {
>    CTFontRef ctFont = CTFontCreateWithGraphicsFontPtr (font_face->cgFont);
>    glyphPath = CTFontCreatePathForGlyphPtr (ctFont, glyph, &textMatrix);
>    CFRelease(ctFont);
> } else {
>    glyphPath = CGFontGetGlyphPathPtr (font_face->cgFont, &textMatrix, 0, glyph);
> }

Yes, that looks tidier.

> I added CFRelease() because all of the examples of use of CTFont seem to
> release it in this way.

Good catch.

I feel my patch is a bit of a half-way house, though; if we're going to go 
with CT, we should probably be constructing CTFontRefs directly instead of 
going through CoreGraphics. Again it depends how important it is to maintain 
compatibility for older versions.
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.