How to know the bounds of a single character?
Posted: 2015-06-19T09:20:25-07:00
Hello,
I am using a monoapaced font (DejaVu-Sans-Mono) to render some text on an image. I know the size of the image, its density, and its font point size. Since I am using a monospaced font, I assume that all the symbols reserve the same size. Is it possible to figure out this size?
Basically, I want to know the starting position of the nth character before even drawing it. And I think I can calculate this if I know the bounds of a single character.
Thanks in advance!
I am using a monoapaced font (DejaVu-Sans-Mono) to render some text on an image. I know the size of the image, its density, and its font point size. Since I am using a monospaced font, I assume that all the symbols reserve the same size. Is it possible to figure out this size?
Basically, I want to know the starting position of the nth character before even drawing it. And I think I can calculate this if I know the bounds of a single character.
Thanks in advance!