Rightpoint / BonMot

Beautiful, easy attributed strings in Swift
MIT License
3.56k stars 197 forks source link

Debug mode to draw guide lines on a font label #63

Open graiz opened 9 years ago

graiz commented 9 years ago

Example:

Image of Yaktocat

The text would perhaps be drawn on tap or selection.

ZevEisenberg commented 9 years ago

Nice graphic :stuck_out_tongue_winking_eye:

I like this idea. It could be on a subclass of UILabel, or perhaps a category with runtime magic (swizzling -drawTextInRect:). If a subclass, we could also add an IBDesignable to draw these lines in IB. unfortunately, you still can't align things by x-height or cap height directly in IB, so I don't know how useful that would be, but it would at least be a useful visualization tool.

Also: this should work on multi-line labels.