I'm creating a font converter (ttf to C array) using PHP and imagettftext. It works well but when I convert letters with accent (e.g. Á) the accent is out of the area. In the example I convert some letters with Arial font with 20 px height. (letter, y top coordinate, y bottom coordinate).
- A: 0 15
- Á: -4 15
- y: 4 20
- Y: 0 15
- h: 0 15
- _: 17 20
Generated by this code:
$co = imagettftext($im, $h_pt, 0, 0, $h_pt, $white, $font, $letter);
echo($letter . ": " .$co[7] . " " . $co[1]. "<br>");
The top coordinate of 'Á' is -4 so it not fits to the 0 .. 20 range. How is it possible? I thought the font should fit into its height.
So my question is how to "force" imagettftext to put accents into the given height?