1

I was wondering if there is anything in PHP that will get me different properties of a font like ascent, descent, leading, height, etc.

Something similar to FontMetrics class in java fount at:

http://docs.oracle.com/javase/6/docs/api/java/awt/FontMetrics.html

I looked into imagettfbbox function (GD Library) but it wont give me all the properties I am looking for.

Romit
  • 96
  • 2
  • 13

2 Answers2

1

A bit late, but this function => http://php.net/manual/fr/imagick.queryfontmetrics.php

Bast
  • 369
  • 2
  • 12
  • 1
    It would be good if you could give a short example of the function in question and use the English link for [php.net](http://php.net/manual/en/imagick.queryfontmetrics.php). – Jakob Runge Sep 09 '15 at 09:27
0

No, there is no built-in function that gives you that info. Have to get it by parsing the font file. Try googling "TTF parser PHP".

cleong
  • 7,242
  • 4
  • 31
  • 40