mono/xwt — pull request #91 by lytico (2012-03-29 01:55:33+00:00)
Title: added TextLayout.Heigth and TextLayout.Trimming

implemented Wpf and Gtk-Backends (PangoContextBackendHandler, in CairoTextLayoutBackendHandler without ellipsis-trimming)
added sample in DrawingTexts (Height, Trimming.WordEllipsis)

added stubs in Mac-Backend (I don't have a mac, I hope it compiles)

mono.mac - hints:
trimming and heigth:
should be very similar to Wpf, as there is:

MonoMac.Foundation.NSAttributedString.DrawString(System.Drawing.RectangleF, NSStringDrawingOptions)
(http://docs.go-mono.com/?link=M%3aMonoMac.Foundation.NSAttributedString.DrawString%28System.Drawing.RectangleF%2cMonoMac.Foundation.NSStringDrawingOptions%29)

Trimming:
NSStringDrawingOptions.TruncatesLastVisibleLine
Truncates and adds the ellipsis character to the last visible line if the text doesn't fit into the bounds specified.
This option is ignored if NSStringDrawingUsesLineFragmentOrigin is not also set. In addition, the line break mode must be either NSLineBreakByWordWrapping or NSLineBreakByCharWrapping for this option to take effect. The line break mode can be specified in a paragraph style passed in the attributes dictionary argument of the drawing methods.
NSStringDrawingOptions.UsesLineFragmentOrigin
The specified origin is the line fragment origin, not the baseline origin.
(http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/AttributedStrings/AttributedStrings.html#//apple_ref/doc/uid/10000036i)

If someone borows me a mac 2 or 3 hours (remote desktop? teamviewer?) I would implement it.