Re: Get text with hyphenation

2014-10-09 Thread Martin Wierschin
Hello Leonardo, You are correct that your dirty workaround is not very good, since it won't handle many cases. Since the typesetter inserts a hyphen glyph into the glyph stream whenever hyphenation occurs, perhaps you should check for the presence of that glyph at the end of each line fragment

Re: Get text with hyphenation

2014-10-09 Thread Martin Wierschin
A correction: Another potential approach: you might subclass the typesetter and override -[NSTypesetter shouldBreakLineByHyphenatingBeforeCharacterAtIndex:] and record the instances where super returns YES. I forgot that NSTypesetter itself does not actually implement this method, so you

Get text with hyphenation

2014-10-08 Thread Leonardo
Hi, I have to draw several lines of text, one by one, to an HTML page. I get the text from an NSTextView, iterating throught the text lines: lineRect = [layoutManager lineFragmentRectForGlyphAtIndex:index effectiveRange:lineGlyphRange]; index =