Vertical line in NSTextView

I want to create a rich text editor such as the one used in Mail.app. NSTextView basically supports everything I need except one. I cannot figure out how to create vertical lines, such as Mail.app, for quoted text.

For reference, this is a screenshot of a multi-threaded discussion that illustrates what I'm talking about:

Threaded discussion in Mail.app

I mean two vertical lines on the left side of the image. Any pointers would be greatly appreciated.

+4
source share
1 answer

CoreText is probably the answer. See the documentation at https://developer.apple.com/library/mac/documentation/StringsTextFonts/Conceptual/CoreText_Programming/LayoutOperations/LayoutOperations.html especially in lists 2.3 and 2.4, which show how to lay out text in a column and do this is in drawRect: where you also draw a vertical line or line up on the left side of the rectangle.

CoreText lets you do anything with text and layout. I highly recommend the recent series of 5 videos on CoreText at http://www.nsscreencast.com/episodes

0
source

Source: https://habr.com/ru/post/1442276/


All Articles