(PHP 4, PHP 5, PHP 7, PHP 8)
imagefontheight — 获取字体高度
font
取值对于内建的 latin2 编码字体可以是:1、2、3、4、5(更高的数字对应更大的字体), 或是通过 imageloadfont() 返回的 GdFont 实例。
返回字体的像素高度。
示例 #1 在内置字体上使用 imagefontheight()
<?php
echo 'Font height: ' . imagefontheight(4);
?>
以上示例的输出类似于:
Font height: 16
示例 #2 将 imagefontheight() 与 imageloadfont() 一起使用
<?php
// Load a .gdf font
$font = imageloadfont('anonymous.gdf');
echo 'Font height: ' . imagefontheight($font);
?>
以上示例的输出类似于:
Font height: 43