开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜