Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Text Measuring Issue



Hi all,

I am using TXNDrawCFStringTextBox to generate a page for printing
(DrawThemeTextBox doesn't print), which works very well for most
purposes. I'm printing out strings from a database, so I have no
page-layout storage; instead this is generated on the fly by
pre-calculating the layout of all the rectangles within the printable
area based on the text's GetThemeTextDimensions.

One problem that I'm facing is when the text dimensions are larger than
what will fit on the page. I need to determine where in a body of text a
rectangle will break the text; then I would need to split the string and
render a new rectangle (on a new page) to handle the rest of the text
(probably by doing a CFStringCreateWithSubstring).

So, all knowledgeable Carbon developers, does anyone know of a method to
determine how much text (character offset, CFRange, lines, etc) fits in
a fixed-size rectangle? A search of the usual headers (Appearance.h,
CFString.h, MacTextEditor.h) aren't giving me the "Aha!" that I'm
longing for.

Thanks in advance,
brian

******************
Brian M. Criscuolo
DataViz, Inc. Engineering
email@hidden
203.874.0085 x3065
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.