Re: Bezier Text Container
Re: Bezier Text Container
- Subject: Re: Bezier Text Container
- From: Gordon Apple <email@hidden>
- Date: Thu, 22 Feb 2007 11:40:13 -0600
I certainly would be interested in seeing the article. I haven't really
explicitly done anything with editing. I'm simply using what is available
in NSTextView and let the layout manager and my text container handle it.
It seems to work seamlessly and quickly re-flows the text after an edit. I
kind of wish I had done the examples by modifying the TextEdit program, but
for simplicity sake, I started with the Hillegass DocBooker program from the
book. I added PDF saving (also mostly from the book) to produce the images
for the website, which GoLive converted to GIFs. My view is a subclass of
NSTextView, subclassed mainly to generate the Bezier examples and load the
selected one into the text container. (If you don't load a Bexier path into
the container, it simply reverts to functioning as a standard
NSTextContainer.)
I ran into quite a few subtleties in both the text handling and in the
Bezier paths that I had to work around. I tried to layout the code to
optimize computation, but there is nothing magic here, just a systematic
approach with a lot of work, a lot of case logic, and some use of "fuzzy"
decisions. For example, it turns out that there is a plethora of articles
on the net on the simple subject of what does "equality" mean when comparing
floating point numbers, especially when they have been through a few
calculations.
I know what is happening in the split-line multi-font case. I just
don't know if it can be solved totally in the text container. The problem
case I showed was somewhat contrived by adjusting the font slider until the
layout line-spacing malfunctioned occurred as shown.
--
Gordon Apple
Ed4U
Little Rock, AR
email@hidden
> Date: Thu, 22 Feb 2007 07:23:37 -0800 (PST)
> From: Erik Buck <email@hidden>
> Subject: Re: Bezier Text Container
> To: email@hidden
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=iso-8859-1
>
> Very interesting! I wrote an article for Stepwise on the very same subject.
> The article will probably appear shortly. Scott Anguish is editing and
> beautifying it.
>
> You may be farther along and have a more comprehensive example than I have.
> Are you interested in swapping war stories and/or sharing credit on the
> article ? I am curious how you solved problems related to efficiently
> calculating rectangle and path intersections. Have you optimized for
> interactive editing speed at all yet ? I ended up reconstructing the Bezier
> path using the open source libArt library so that I could get the data needed
> from the path (sorted vector paths and intersection logic). I submitted some
> feature requests to Apple on this subject.
>
> Interestingly, I did not encounter the exact layout issues with multiple-fonts
> that you encountered. I wonder why ? I encountered different issues such as
> stale drawing left behind after deleting a range of text or using undo/redo.
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden