« ps_show2
ps_stringwidth »

ps_string_geometry

(PECL ps >= 1.2.0)

ps_string_geometry — 文字列のジオメトリを取得する

説明

function ps_string_geometry(
    resource $psdoc,
    string $text,
    int $fontid = 0,
    float $size = 0.0
): array

この関数は ps_stringwidth() と似ていますが、 戻り値は、テキストの幅、ascender および descender を含む配列形式になります。

パラメータ

psdoc

ps_new() が返す、postscript ファイルのリソース ID。

text

ジオメトリを計算するテキスト。

fontid

使用するフォントの ID。フォントが指定されていない場合は、 現在のフォントが使用されます。

size

フォントのサイズ。指定されていない場合は現在のサイズが使用されます。

戻り値

文字の寸法を格納した配列です。'width' には ps_stringwidth() で返される文字列の幅が入ります。 下に突き出している部分の長さの最大値が 'descender' に、 また上に突き出している部分の長さの最大値が 'ascender' に入ります。

参考

関連キーワード:
ジオメトリ   stringwidth   フォント   geometry   text   テキスト   psdoc   fontid   size   ascender   descender   最大値   show   resource   float   postscript   リソース   計算   寸法   格納   width   参考   continue
関連する関数・ページ:
function.ps-stringwidth   function.ps-setfont   function.ps-show2   imagick.transformimage   imagick.getimagepage   function.ps-continue-text