m17n ライブラリ 1.8.20
読み取り中…
検索中…
一致する文字列を見つけられません
MFLTFont 構造体

FLT ドライバが使うフォントの型. [詳解]

#include <m17n-flt.h>

フィールド

MSymbol family
int x_ppem
int y_ppem
int(*) get_glyph_id (struct _MFLTFont *font, MFLTGlyphString *gstring, int from, int to)
int(*) get_metrics (struct _MFLTFont *font, MFLTGlyphString *gstring, int from, int to)
int(*) check_otf (struct _MFLTFont *font, MFLTOtfSpec *spec)
int(*) drive_otf (struct _MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, int from, int to, MFLTGlyphString *out, MFLTGlyphAdjustment *adjustment)
void * internal

詳解

FLT ドライバが使うフォントの型.

型 MFLTFont は、FLTドライバが使うフォントに関する情報を格納するた めの構造体である。通常アプリケーションは最初の要素が MFLTFont で、 残りの要素にcallback関数が利用するフォント情報を持った、より大きな 構造体を用意し、それを MFLTFont に coerce して mflt の各関数に渡す。 各callback関数は MFLTFont を元の構造体に coerce し直すことができる ことが保証されている。

フィールド詳解

◆ family

MSymbol MFLTFont::family

フォントのファミリー名。フォントに適した FLTを探す際に重要でな い場合 (たとえば OpenTypeフォントの場合など) は、#Mnil でよい。

◆ x_ppem

int MFLTFont::x_ppem

フォントの水平サイズを pixels per EM で表現したもの。

◆ y_ppem

int MFLTFont::y_ppem

フォントの垂直サイズを pixels per EM で表現したもの。

◆ get_glyph_id

int(*) MFLTFont::get_glyph_id(struct _MFLTFont *font, MFLTGlyphString *gstring, int from, int to)

GSTRING 内の FROM から TO 直前までの各グリフに対応するグリフ IDを取得するための callback 関数。もしあるグリフのメンバー <encoded>がゼロならば、そのグリフのメンバー <code> は文字コードで ある。この関数はその文字コードを FONT のグリフ IDに変換しなくては ならない。

◆ get_metrics

int(*) MFLTFont::get_metrics(struct _MFLTFont *font, MFLTGlyphString *gstring, int from, int to)

GSTRING 内の FROM から TO直前までの各グリフに対応するメトリッ クを取得するための callback 関数。もしあるグリフのメンバー <measured>がゼロならば、この関数はそのグリフのメンバー <xadv>, <yadv>, <ascent>, <descent>, <lbearing>, および <rbearing>をセッ トしなければならない。

◆ check_otf

int(*) MFLTFont::check_otf(struct _MFLTFont *font, MFLTOtfSpec *spec)

フォントがある特定のスクリプト/言語に対する GSUB/GPOS OpenTypeフィーチャーを持つか否かを調べる callback 関数。この関数 はフォントがSPEC を満たすときは 1 を、そうでないときは 0を返さな ければならない。フォントが OpenType テーブルを持たないときはNULL でなければならない。

◆ drive_otf

int(*) MFLTFont::drive_otf(struct _MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, int from, int to, MFLTGlyphString *out, MFLTGlyphAdjustment *adjustment)

IN 内の FROM から TO 直前までの各グリフに SPEC内の各 OpenType フィーチャーを適用するための callback 関数。適用結果のグリフ列は OUT の末尾に追加される。OUT が短か過ぎて結果を追加し切れない場合 は -2 を返さなくてはならない。フォントが OpenType テーブルを持た ない場合は NULLでなければならない。

◆ internal

void* MFLTFont::internal

m17n-lib の内部作業用。NULL に初値化される。


m17n-lib Home