Re: Drawing custom text attributes
Re: Drawing custom text attributes
- Subject: Re: Drawing custom text attributes
- From: Jonathan Jackel <email@hidden>
- Date: Sun, 21 Dec 2003 14:15:13 -0500
A quick and dirty (and very limited) way of controlling some appearance
features is by applying a link attribute to the text and using
NSTextView's setLinkTextAttributes to change the appearance of the
text. This will not help you draw an "overline" instead of an
underline, however.
I'd also be interested in an example on this topic. A quick look at
the docs suggests working with
drawUnderlineForGlyphRange:underlineType:baselineOffset:
lineFragmentRect:lineFragmentGlyphRange:containerOrigin:
and
underlineGlyphRange:underlineType:lineFragmentRect:
lineFragmentGlyphRange:containerOrigin:
in NSLayoutManager.
Jonathan
On Dec 21, 2003, at 12:31 PM, Reni Puls wrote:
>
Hi,
>
>
does anyone have some quick examples how to use custom attributes with
>
the Cocoa text system? I know that I can just set arbitrary attributes
>
on an NSAttributedString, but where do I go if I want these attributes
>
to actually change the appearance of my text in an NSTextView?
>
>
For example, how would I implement an attribute similar to
>
NSUnderlineStyleAttributeName, but which draws a line *above* the text
>
instead of below? (Never mind if there is already such a thing, I just
>
want to know how it is done.)
>
>
I think that I need to subclass NSLayoutManager and override some of
>
the drawing methods; but they all look totally esoteric to me. A
>
simple-and-stupid example would be most welcome. :-)
>
>
Kind regards,
>
Reni Puls
>
_______________________________________________
>
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.