以下の内容はhttps://www.weblio.jp/content/imageloadfontより取得しました。


PHP Documentation GroupPHP Documentation Group

imageloadfont

(PHP 4, PHP 5)
imageloadfont — 新しいフォントを読み込む

説明

int imageloadfont ( string file )
imageloadfont() はユーザが定義したビットマップを読み込み、 その ID を返します。

パラメータ

file
フォントファイル形式は現在はバイナリで、アーキクチャに依存します。 このため、PHP を実行するマシーンと同一の型の CPU 上でフォントファイルを 生成する必要があります。

表 135. フォントファイルのフォーマット
バイト位置C 言語のデータ型説明
0-3 バイト目intフォント中の文字の数
4-7 バイト目int フォント中の最初の文字の値(しばしば 空白を表す 32 となります)
8-11 バイト目int各文字のピクセル幅
12-15 バイト目int各文字のピクセル高さ
16 バイト目からchar 文字データの配列、各文字のピクセルにつき1バイトで、 総数は(文字数*幅*高さ)バイトです。



返り値

フォント ID を返します。これは常に 5 より大きくなり、 組み込みのフォントと衝突することはありません。 エラー時には FALSE を返します。

例 938. imageloadfont の使用法
<?php
header("Content-type: image/png");
$im = imagecreatetruecolor(50, 20);
$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);
imagefilledrectangle($im, 0, 0, 49, 19, $white);
$font = imageloadfont("04b.gdf");
imagestring($im, $font, 0, 0, "Hello", $black);
imagepng($im);
?>


参考

imagefontwidth()
imagefontheight()





固有名詞の分類

PHP stristr  filegroup  imageloadfont  serialize  ocifreestatement



以上の内容はhttps://www.weblio.jp/content/imageloadfontより取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14