Well, I need it to be super fast so I need to draw it directly.
This is a command and output for drawing the character H.
Code: Select all
convert -debug annotate "-font" "./assets/impact.ttf" -pointsize 150 -gravity Center label:H +write info: x.png
2016-07-07T11:44:47+03:00 0:00.000 0.000u 6.9.4 Annotate convert[48251]: annotate.c/RenderFreetype/1421/Annotate
Font ./assets/impact.ttf; font-encoding none; text-encoding none; pointsize 150
2016-07-07T11:44:47+03:00 0:00.000 0.000u 6.9.4 Annotate convert[48251]: annotate.c/GetTypeMetrics/843/Annotate
Metrics: text: H; width: 83; height: 183; ascent: 151; descent: -32; max advance: 193; bounds: 6.15625,0.359375 77.0469,119; origin: 83,0; pixels per em: 150,150; underline position: -4; underline thickness: 1.59375
2016-07-07T11:44:47+03:00 0:00.000 0.000u 6.9.4 Annotate convert[48251]: annotate.c/RenderFreetype/1421/Annotate
Font ./assets/impact.ttf; font-encoding none; text-encoding none; pointsize 150
2016-07-07T11:44:47+03:00 0:00.000 0.000u 6.9.4 Annotate convert[48251]: annotate.c/GetTypeMetrics/843/Annotate
Metrics: text: H; width: 83; height: 183; ascent: 151; descent: -32; max advance: 193; bounds: 6.15625,0.359375 77.0469,119; origin: 83,0; pixels per em: 150,150; underline position: -4; underline thickness: 1.59375
2016-07-07T11:44:47+03:00 0:00.000 0.000u 6.9.4 Annotate convert[48251]: annotate.c/RenderFreetype/1421/Annotate
Font ./assets/impact.ttf; font-encoding none; text-encoding none; pointsize 150
2016-07-07T11:44:47+03:00 0:00.000 0.000u 6.9.4 Annotate convert[48251]: annotate.c/GetTypeMetrics/843/Annotate
Metrics: text: H; width: 83; height: 183; ascent: 151; descent: -32; max advance: 193; bounds: 6.15625,0.359375 77.0469,119; origin: 83,0; pixels per em: 150,150; underline position: -4; underline thickness: 1.59375
2016-07-07T11:44:47+03:00 0:00.000 0.000u 6.9.4 Annotate convert[48251]: annotate.c/RenderFreetype/1421/Annotate
Font ./assets/impact.ttf; font-encoding none; text-encoding none; pointsize 150
label:H LABEL 84x184 84x184+0+0 16-bit sRGB 0.000u 0:00.000
This is the image that was created:
How can I calculate and find the gap from the top (16 pixels) and the bottom (49 pixels)?
*** EDIT ***
I know that I'm using here gravity center. This is because I'm using gravity center when drawing the text.