How to draw Truncated text with ATSUI.
How do i draw truncated text with ATSUI?? I have a legacy app which uses QuickDraw API. it uses StringWidth , TruncString and DrawString functions. I could replace the StringWidth and DrawString with ATSUI's ATSUMeasureTextImage and ATSUDrawText. However i could not find a way to truncate a string so that it fits into a rect.

I used Quartz with QuickDraw before choosing ATSUI. Quartz does not provide any functions to estimate the size (in pixels) of the drawn text.

> CGContextSelectFont(cgContext,
> "Geneva", 12.0, kCGEncodingMacRoman);
>  CGContextSetTextMatrix(cgContext,
> CGAffineTransformMake(1.0,0.0, 0.0,
> -1.0, 0.0, 0.0));  CGContextShowTextAtPoint(cgContext,
> inPoint.h, inPoint.v + 12.00, (const
> char*)&(inString[1]), inString[0]);

Is there any function in ATSUI that does string truncation like TruncString...?? if not how do i draw a string truncated to a rect.

Thanks,
Abhinay.
How to draw Truncated text with ATSUI.
===

How do i draw truncated text with ATSUI?? I have a legacy app which uses QuickDraw API. it uses StringWidth , TruncString and DrawString functions. I could replace the StringWidth and DrawString with ATSUI's ATSUMeasureTextImage and ATSUDrawText. However i could not find a way to truncate a string so that it fits into a rect.

I used Quartz with QuickDraw before choosing ATSUI. Quartz does not provide any functions to estimate the size (in pixels) of the drawn text.

> CGContextSelectFont(cgContext,
> "Geneva", 12.0, kCGEncodingMacRoman);
>  CGContextSetTextMatrix(cgContext,
> CGAffineTransformMake(1.0,0.0, 0.0,
> -1.0, 0.0, 0.0));  CGContextShowTextAtPoint(cgContext,
> inPoint.h, inPoint.v + 12.00, (const
> char*)&(inString[1]), inString[0]);

Is there any function in ATSUI that does string truncation like TruncString...?? if not how do i draw a string truncated to a rect.

Thanks,
Abhinay.