Drawing unicode glpyhs

  • Hi all,

    I'm having an issue with drawing text via CGContextShowGlyphs, whereby it doesn't draw cyrilic (and presumably a variety of other exciting) characters.

    The code at https://github.com/beelsebob/OpenStreetPad/blob/master/OpenStreetPad/OSPMet
    aTileView.m#L710
    (which goes via CTLineDraw) successfully renders all characters, correctly.
    Meanwhile, the code at https://github.com/beelsebob/OpenStreetPad/blob/master/OpenStreetPad/OSPMet
    aTileView.m#L797
    (which use CGContextShowGlyphs to draw the glyphs on a path) does not draw them correctly (instead outputting "Helvetica-Light: FT_Load_Glyph failed: error 6").

    It appears that this text path doesn't deal with font fallbacks correctly; the docs for CTLineDraw though say that it's just an alias for repeatedly calling CGContextShowGlyphs.

    Anyone got any ideas what I could have ballsed up?

    Thanks

    Tom Davie
    if (*ra4 != 0xffc78948) { return false; }
  • On May 3, 2012, at 8:04 AM, Thomas Davie <tom.davie...> wrote:

    > It appears that this text path doesn't deal with font fallbacks correctly; the docs for CTLineDraw though say that it's just an alias for repeatedly calling CGContextShowGlyphs.

    That's not precisely what the docs say:

    "This is a convenience function because the line could be drawn run-by-run by getting the glyph runs, getting the glyphs out of them, and calling a function such as CGContextShowGlyphsAtPositions."

    You might get better results asking on the coretext-dev mailing list.

    --Kyle Sluder
previous month may 2012 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today