Re: Glyph range in textContainers
Re: Glyph range in textContainers
- Subject: Re: Glyph range in textContainers
- From: Reza Farhad <email@hidden>
- Date: Fri, 15 Nov 2002 12:26:38 +0000
here are two example one showing my problem and the other, potentially
a work around.
in both examples a text in the textStorage that is larger than the
space allowed in the text containers are set to be laid out, and as it
is being laid out the range of text that in the textcontainer is
queried and printed to the consul.
in the first example "TextInBits textContaier" the call to get the
range of glyphs in the first text container is limited to the end of
the complete paragraph, and even more oddly, in the second container
the paragraph that runs beyond the end of the container is not even
drawn and hence the text is truncated.
In the second example "TextInBits textContaier2" I create a dummy
textcontainer that is large enough to hold all the text, which will not
be displayed, and it does not even have a textView, to hold a the text.
Then all the textContainers that are to be displayed are setup and
slotted in front of the dummy text container. this seem to display
everything as one would expect and even returns the right text range
for the textcontainers as it is queried in the process of being laid
out.
Is there going to be any issues with this second method
Reza
[demime 0.98b removed an attachment of type application/mac-binhex40 which had a name of problem examples.hqx]
On Wednesday, November 13, 2002, at 08:30 pm, Douglas Davidson wrote:
>
On Wednesday, November 13, 2002, at 05:34 AM, Reza Farhad wrote:
>
>
> I have a textstorage that is associated with a number of text
>
> containers, and I am trying to find out the range of text in each
>
> container.
>
>
>
> I have been using the call
>
> "-textContainerForGlyphAtIndex:effectiveRange:" as the documentation
>
> indicates that it is the preferred option to
>
> "-glyphRangeForTextContainer: " as it is more efficient.
>
>
>
> oddly, using "-textContainerForGlyphAtIndex:effectiveRange:" I have
>
> got the range of up to whole paragraphs only and it has ignored any
>
> incomplete paragraphs at the end of the textcontainer. This is not
>
> the case if I use "glyphRangeForTextContainer".
>
>
>
> Can anybody shed some light on to this, and also why one call is
>
> recommended over the other, as in the documentation it does imply
>
> that both calls "Performs glyph generation and layout if needed".
>
>
Can you make a small example app that demonstrates this? That sounds
>
odd to me; I suspect there might be some other difference that would
>
account for this.
>
>
Douglas Davidson
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
>
.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.