Is there a trick for word wrapping with non-monospaced fonts?
I'm having a bit of trouble right now trying to implement word wr开发者_运维技巧apping for non-monospaced fonts (The font can be different). I've tried searching for this everywhere but couldn't find a solution. Any tips?
How about this?
- store length in pixels of every word
- store pixel-offset of every word
- when text gets inserted in a line, update the offsets and, if necessary, break the line
精彩评论