SetTextJustification

機能
テキストを出力時に均等寄せする
Declare Function SetTextJustification Lib "gdi32.dll" _
(ByVal hdc As Long, ByVal nBreakExtra As Long, ByVal nBreakCount As Long) As Long
Declare Function SetTextJustification Lib "gdi32.dll" _
(ByVal hdc As Integer, ByVal nBreakExtra As Integer, ByVal nBreakCount As Integer) As Integer

BOOL SetTextJustification(
HDC hdc,
int nBreakExtra,
int nBreakCount
);

引数
hdc

デバイスコンテキストのハンドル
nBreakExtra
追加するスペースの合計(単位:ピクセル)
nBreakCount
ブレーク文字の数
戻り値
正常終了のとき                          0以外
エラーのとき                            0
備考
「ブレーク文字」とは英文の各ワードを区切る文字のこと。
通常はスペースを使うが、ほかの文字を指定することもできる。

複数行のテキストを均等寄せする場合、均等寄せ処理に伴う計算誤差が生じる可能性がある。