Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is it possible to measure in pixels a character outputed from putText()?

I know this is a bit weird question but i actually came to a situation where i would need this. So I appreciate the patience if someone knows the answer =)

From these parameteres:

int fontFace, 
double fontScale
int fontThickness 
int fontLineType

Is it possible to calculate the width of a character in pixels?

Note: If the font is not of fixed width, one can assume it is the letter 'a' or do any other assumption.

Is it possible to measure in pixels a character outputed from putText()?

I know this is a bit weird question but i actually came to a situation where i would need this. So I appreciate the patience if someone knows the answer =)

From these parameteres:

int fontFace, 
double fontScale
int fontThickness 
int fontLineType

Is it possible to calculate the width of a character in pixels?

Note: Note 1: If the font is not of fixed width, one can assume it is the letter 'a' or do any other assumption.

Note 2:The idea is not to have some image processing doing this, the idea is just to do some math with the putText() parameters.