close
INT imagefontheight(INT $font)
參數
font
可以是1,2,3,4,5在拉丁文2編碼內置字體(在相當於較大的字體更高的數字)或任何與註冊自己的字體標識符imageloadfont() 。
返回值
返回字體的像素的高度。
Example #1 Using imagefontheight() on built-in fonts
<?php
echo '字體高度: ' . imagefontheight(4);
?>
The above example will output something similar to:
Font height: 16
Example #2 Using imagefontheight() together with imageloadfont()
<?php
// Load a .gdf font
$font = imageloadfont('anonymous.gdf');
echo '字體高度: ' . imagefontheight($font);
?>
The above example will output something similar to:
Font height: 43
全站熱搜