0

I'm having a bit of trouble right now trying to implement word wrapping for non-monospaced fonts (The font can be different). I've tried searching for this everywhere but couldn't find a solution. Any tips?

skaffman
  • 398,947
  • 96
  • 818
  • 769
fieryrage
  • 69
  • 6

1 Answers1

1

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
thejh
  • 44,854
  • 16
  • 96
  • 107