Current status of NSTextStorage/NSLayoutManager/NSTextContainer?

View: New views
4 Messages — Rating Filter:   Alert me  

Current status of NSTextStorage/NSLayoutManager/NSTextContainer?

by Derek Fawcus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What is the view of the current status of the above?  I cobbled together
a simple app using just those,  together with a NSWindow holding an NSView
(note not NSTextView) as mentioned here:

http://zathras.de/angelweb/blog-cocoa-text-system-everywhere.htm

which simply displays the text "This is the text string.", and found it did
not display correctly,  whereas the same files compiled on a Mac (10.4.11) did.

The corruption being that the text line 'wrapped' too early,  and overwrote
the start of text,  such that "This is the text" had "string." written on
top of the same line (i.e. "This is" was overritten).

Now this was on a Mandriva 2009.1 distribution,  so its not the latest and
greatest version of the libraries:

   base 1.18.0
   gui  0.16.0
   back 0.16.0
   make 2.0.8

Before I try compiling the current versions of the libraries,  I'd appreciate
it if anyone can recall if any fixes have been done in this area since the
above versions.

The obvious guess would be that the NSTextContainer is not managing to
initialise to the correct width of the NSView.

(I can make the source available if anyone is interested)

Thanks,

DF


_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: Current status of NSTextStorage/NSLayoutManager/NSTextContainer?

by Fred Kiefer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes please, send me the source and I have a look.

Fred

-------- Original-Nachricht --------
> Datum: Thu, 17 Sep 2009 11:34:09 +0100
> Von: Derek Fawcus <dfawcus@...>
> An: gnustep-dev@...
> Betreff: Current status of NSTextStorage/NSLayoutManager/NSTextContainer?

> What is the view of the current status of the above?  I cobbled together
> a simple app using just those,  together with a NSWindow holding an NSView
> (note not NSTextView) as mentioned here:
>
> http://zathras.de/angelweb/blog-cocoa-text-system-everywhere.htm
>
> which simply displays the text "This is the text string.", and found it
> did
> not display correctly,  whereas the same files compiled on a Mac (10.4.11)
> did.
>
> The corruption being that the text line 'wrapped' too early,  and
> overwrote
> the start of text,  such that "This is the text" had "string." written on
> top of the same line (i.e. "This is" was overritten).
>
> Now this was on a Mandriva 2009.1 distribution,  so its not the latest and
> greatest version of the libraries:
>
>    base 1.18.0
>    gui  0.16.0
>    back 0.16.0
>    make 2.0.8
>
> Before I try compiling the current versions of the libraries,  I'd
> appreciate
> it if anyone can recall if any fixes have been done in this area since the
> above versions.
>
> The obvious guess would be that the NSTextContainer is not managing to
> initialise to the correct width of the NSView.
>
> (I can make the source available if anyone is interested)
>
> Thanks,
>
> DF
>
>
> _______________________________________________
> Gnustep-dev mailing list
> Gnustep-dev@...
> http://lists.gnu.org/mailman/listinfo/gnustep-dev

--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser


_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: Current status of NSTextStorage/NSLayoutManager/NSTextContainer?

by Fred Kiefer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you for you example code, you really should have send it to the
list, as it make such a great example of using the text system
components by themselves without an NSTextView. The issue you had with
GNUstep was easy to track down, you didn't set a paragraph style for
your string and GNUstep wasn't handling that gracefully. I changed
GNUstep SVN to use the default paragraph style when none is set, now
your example runs correctly for me. You either will have to update to
GNUstep SVN to see this or use an explicit paragraph style in your code.

Cheers
Fred

Fred Kiefer schrieb:

> Yes please, send me the source and I have a look.
>
> Fred
>
> -------- Original-Nachricht --------
>> Datum: Thu, 17 Sep 2009 11:34:09 +0100
>> Von: Derek Fawcus <dfawcus@...>
>> An: gnustep-dev@...
>> Betreff: Current status of NSTextStorage/NSLayoutManager/NSTextContainer?
>
>> What is the view of the current status of the above?  I cobbled together
>> a simple app using just those,  together with a NSWindow holding an NSView
>> (note not NSTextView) as mentioned here:
>>
>> http://zathras.de/angelweb/blog-cocoa-text-system-everywhere.htm
>>
>> which simply displays the text "This is the text string.", and found it
>> did
>> not display correctly,  whereas the same files compiled on a Mac (10.4.11)
>> did.
>>
>> The corruption being that the text line 'wrapped' too early,  and
>> overwrote
>> the start of text,  such that "This is the text" had "string." written on
>> top of the same line (i.e. "This is" was overritten).
>>
>> Now this was on a Mandriva 2009.1 distribution,  so its not the latest and
>> greatest version of the libraries:
>>
>>    base 1.18.0
>>    gui  0.16.0
>>    back 0.16.0
>>    make 2.0.8
>>
>> Before I try compiling the current versions of the libraries,  I'd
>> appreciate
>> it if anyone can recall if any fixes have been done in this area since the
>> above versions.
>>
>> The obvious guess would be that the NSTextContainer is not managing to
>> initialise to the correct width of the NSView.
>>
>> (I can make the source available if anyone is interested)
>>
>> Thanks,
>>
>> DF
>>
>>
>> _______________________________________________
>> Gnustep-dev mailing list
>> Gnustep-dev@...
>> http://lists.gnu.org/mailman/listinfo/gnustep-dev
>



_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: Current status of NSTextStorage/NSLayoutManager/NSTextContainer?

by Derek Fawcus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Sep 19, 2009 at 05:32:56PM +0200, Fred Kiefer wrote:
> Thank you for you example code, you really should have send it to the
> list, as it make such a great example of using the text system
> components by themselves without an NSTextView.

I didn't think it'd be of general interest.  However,  there is nothing
special in there,  so feel free to do whatever you wish with the code.

> The issue you had with
> GNUstep was easy to track down, you didn't set a paragraph style for
> your string and GNUstep wasn't handling that gracefully.

Aha.  Thanks.

I'd started debugging,  but didn't get too far, having got burried in
the GSTextLayout stuff.

> I changed
> GNUstep SVN to use the default paragraph style when none is set, now
> your example runs correctly for me. You either will have to update to
> GNUstep SVN to see this or use an explicit paragraph style in your code.

Well the final program needs to use non default styles anyway...

BTW - From reading the source,  it seemed to me that NSTextContainer
could do with the addition of a method like:

- (id)init
{
    return initWithContainerSize: NSZeroSize;
}

simply to ensure that the instance variables get initialised to
something sensible if/when code does:

        textContainer = [[NSTextContainer alloc] init];

(or uses the 'new' method).   This in spite of the comment
in the code about zero sized containers.

From observing the class contents under OSX (10.4.11) I noticed
that it does initialise all of its instance variables when
-init is used - picking an NSSize of (10000000,10000000).

DF


_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev