|
typeset 0.1.0
縦書き・横書きの日本語組版ライブラリ(JLReq 水準、ラスタ / PDF / SVG)
|
dl — 表示リスト(Display List) [詳解]
クラス | |
| struct | Bookmark |
| しおり(PDF のアウトライン)。描画はしない [詳解] | |
| struct | DisplayList |
| 1 ページ分の表示リスト [詳解] | |
| struct | Glyph |
| 配置済みグリフ 1 個 [詳解] | |
| struct | GlyphRun |
| 同じ face・サイズ・塗りのグリフ列 [詳解] | |
| struct | Group |
| 変形・クリップ・不透明度のスコープ [詳解] | |
| struct | Image |
| 画像(RGBA8888、非前乗算) [詳解] | |
| struct | ImageItem |
| struct | PathItem |
| パス(罫線・下線・吹き出し・図形) [詳解] | |
| struct | RectItem |
| 塗り矩形(背景・網かけ)。PathItem でも書けるが頻出なので専用に持つ [詳解] | |
型定義 | |
| using | Item = std::variant< GlyphRun, PathItem, RectItem, ImageItem, Group, Bookmark > |
関数 | |
| Rect | bounds (const DisplayList &list) |
| 全要素のバウンディングボックス(グリフは em box で概算) | |
| Rect | runBounds (const GlyphRun &run) |
| GlyphRun の外接矩形(グリフは em box で概算。グラデーションの BoundingBox 座標に使う) | |
| Mat2 | glyphMatrix (float rotation, float scaleX=1.0f, float scaleY=1.0f, float skewX=0.0f, float fakeScaleX=1.0f) |
| グリフ固有の変形を 1 つの 2x2 へ畳む(ペン原点・y-down) | |
| Pt | fakeBoldWidth (Pt fontSize) |
| フェイクボールドのストローク幅(フォントサイズの 1/24) | |
変数 | |
| constexpr uint32_t | kNoChar = std::numeric_limits<uint32_t>::max() |
| constexpr float | kFakeItalicSkew = -0.25f |
| フェイクイタリックのシアー係数(Android と同じ -0.25 ≒ 14度) | |
dl — 表示リスト(Display List)
glyph_transform — グリフ固有の変形の組み立て
レイアウト層の出力であり、backend(ラスタ / PDF / SVG)の入力。 ページごとに 1 本。座標はページ左上原点・y-down・pt。
richtext の「組版結果は配置済みグリフ列で切る」を一般化したもので、 グリフのほかに罫線・吹き出し(Path)、矩形、画像、グループを持つ。 backend はこれを解釈するだけで、組版の知識を持たない。
ラスタ・PDF・SVG の 3 backend が同じ行列を使うために 1 箇所に置く (richtext の GlyphTransform.hpp と同じ理由。分かれていると斜体や横倒しが 出力先ごとにずれる)。
| using typeset::dl::Item = typedef std::variant<GlyphRun, PathItem, RectItem, ImageItem, Group, Bookmark> |
display_list.hpp の 109 行目に定義があります。
| Rect typeset::dl::bounds | ( | const DisplayList & | list | ) |
全要素のバウンディングボックス(グリフは em box で概算)
GlyphRun の外接矩形(グリフは em box で概算。グラデーションの BoundingBox 座標に使う)
|
inline |
グリフ固有の変形を 1 つの 2x2 へ畳む(ペン原点・y-down)
順序は「フェイク幅/斜体 → スケール → 回転」。
| rotation | ラジアン。数学慣習(y-up)の反時計回りが正。横倒しは -90° |
| scaleX | 平体・長体・縦中横の圧縮(行方向) |
| scaleY | 同(行送り方向) |
| skewX | シアー。フェイクイタリックなら kFakeItalicSkew |
| fakeScaleX | フォント幅のうち wdth 軸で吸収できない分の水平スケール |
glyph_transform.hpp の 31 行目に定義があります。
参照先 typeset::multiply(), typeset::Mat2::xx, typeset::Mat2::xy, typeset::Mat2::yx, typeset::Mat2::yy.
フェイクボールドのストローク幅(フォントサイズの 1/24)
glyph_transform.hpp の 59 行目に定義があります。
|
constexpr |
display_list.hpp の 28 行目に定義があります。
|
inlineconstexpr |
フェイクイタリックのシアー係数(Android と同じ -0.25 ≒ 14度)
glyph_transform.hpp の 18 行目に定義があります。