Ответ 1
Я не знаю способ использования imagemagik, но вы можете использовать библиотеку php-font-parser отсюда:
https://github.com/Pomax/PHP-Font-Parser
В частности, вы можете разобрать шрифт для каждой буквы в нужной строке и проверить возвращаемое значение:
$fonts = array("myfont.ttf");
/**
* For this test, we'll print the header information for the
* loaded font, and try to find the letter "g".
*/
$letter = "g";
$json = false;
while($json === false && count($fonts)>0) {
$font = new OTTTFont(array_pop($fonts));
echo "font header data:\n" . $font->toString() . "\n";
$data = $font->get_glyph($letter);
if($data!==false) {
$json = $data->toJSON(); }}
if($json===false) { die("the letter '$letter' could not be found!"); }
echo "glyph information for '$letter':\n" . $json;
Выше кода поступает из проектов parser font fontstest.php:
https://github.com/Pomax/PHP-Font-Parser/blob/master/fonttest.php