FROM : Milen Dzhumerov
DATE : Sat Jun 14 20:57:05 2008
Hi all,
I've been looking for ways to draw text in a CALayer and it seems that
the new Core Text framework is the best way to do so (it supports
64bit and it's up to twice as fast as ATSUI). But I'm having a bit of
trouble determining the height of the text before drawing it (I know
the width beforehand). When I create a CTFrame from CTFramesetter, I
need to provide a path into which it will get drawn but I did not find
a straightforward way to calculate that path such that the text fits
in perfectly. My only option at the moment is generating a CTFrame
with a huge rectangular path so that all CTLines are generated and
then doing my own layout of the lines. Is there another simpler way to
do it (either using Core Text or drawing with some other API)?
Thanks,
M
DATE : Sat Jun 14 20:57:05 2008
Hi all,
I've been looking for ways to draw text in a CALayer and it seems that
the new Core Text framework is the best way to do so (it supports
64bit and it's up to twice as fast as ATSUI). But I'm having a bit of
trouble determining the height of the text before drawing it (I know
the width beforehand). When I create a CTFrame from CTFramesetter, I
need to provide a path into which it will get drawn but I did not find
a straightforward way to calculate that path such that the text fits
in perfectly. My only option at the moment is generating a CTFrame
with a huge rectangular path so that all CTLines are generated and
then doing my own layout of the lines. Is there another simpler way to
do it (either using Core Text or drawing with some other API)?
Thanks,
M
| Related mails | Author | Date |
|---|---|---|
| No related mails found. | ||






Cocoa mail archive

