[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cairo
Subject:    Re: [cairo] [PATCH] Re: cairo-quartz-font.c: Non-public CGFontGetGlyphPath now deprecated
From:       Simon Cozens <simon () simon-cozens ! org>
Date:       2014-07-11 14:50:07
Message-ID: 53BFF99F.5000200 () simon-cozens ! org
[Download RAW message or body]

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
cairo@cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic