Re: Get widest character of font?
Posted: Tue Feb 21, 2017 10:19 pm
To be absolutely sure, i'd go over either the 26 basic latin letters and compare all to the first, for example; or if possible, i'd check for the ones the user(s) actually used.
Then again, instead of rejecting non-monospaced fonts, you could still do the route i mentioned above, even if it would be a tad more wasteful... or you could use a canvas; depending on a few things, with that, even non-monospaced symbol placement can be "optimized". (Only drawing everything once / when a symbol changes in a specific location; at all other times, you'd just have one draw call to draw the whole canvas... and this would also be useable with monospaced fonts as well.)
Then again, instead of rejecting non-monospaced fonts, you could still do the route i mentioned above, even if it would be a tad more wasteful... or you could use a canvas; depending on a few things, with that, even non-monospaced symbol placement can be "optimized". (Only drawing everything once / when a symbol changes in a specific location; at all other times, you'd just have one draw call to draw the whole canvas... and this would also be useable with monospaced fonts as well.)