简体   繁体   中英

Getting Font Metrics in PHP

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.

有点晚了,但是这个功能=> http://php.net/manual/fr/imagick.queryfontmetrics.php

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".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM