|
typeset 0.1.0
縦書き・横書きの日本語組版ライブラリ(JLReq 水準、ラスタ / PDF / SVG)
|
geom — 単位と幾何 [詳解]
名前空間 | |
| namespace | backend |
| backend/pdf_writer — 表示リストを PDF へ | |
| namespace | block |
| block — ブロック(段落・見出し・罫線・ラベル付き段落・アキ・セクション) | |
| namespace | dl |
| dl — 表示リスト(Display List) | |
| namespace | font |
| font — フォント層(glyphware の薄い包み) | |
| namespace | image |
| image — 画像の読み込みとエンコード | |
| namespace | inl |
| inl/annotation — 行内に組み込む注記 | |
| namespace | obj |
| obj — 外部生成オブジェクト(数式・グラフ・図など)の差し込み口 | |
| namespace | page |
| page/flow_layouter — Flow をページ列へ流し込む | |
| namespace | text |
| text/char_class — JLReq の文字クラス | |
クラス | |
| struct | BreakOptions |
| struct | Color |
| 色(非前乗算 RGBA) [詳解] | |
| struct | FontSpec |
| フォントの論理指定 [詳解] | |
| struct | GradientStop |
| グラデーションの停止点 [詳解] | |
| struct | LogicalPoint |
| 論理座標。inline_ は行頭からの送り、block は行の中心線からのずれ (block 正方向は横組みで下、縦組み(rl)で左、縦組み(lr)で右…ではなく、 **縦組みでは常に右を正**とする。richtext の u 軸と同じ。行送りの向きとは独立) [詳解] | |
| struct | Mat2 |
| 2x2 行列(平行移動なし)。グリフ固有の変形に使う。 x' = xx*x + xy*y y' = yx*x + yy*y [詳解] | |
| struct | Matrix |
| 2x3 アフィン行列(行優先) x' = xx*x + xy*y + dx y' = yx*x + yy*y + dy [詳解] | |
| struct | Paint |
| 塗り — 単色または線形/放射グラデーション [詳解] | |
| struct | ParagraphStyle |
| 段落スタイル [詳解] | |
| struct | Path |
| パス(moveTo / lineTo / quadTo / cubicTo / close) [詳解] | |
| struct | Point |
| struct | Rect |
| struct | Size |
| struct | SpacingOptions |
| struct | Stroke |
| 線の描き方 [詳解] | |
| struct | TabStop |
| struct | TextDecoration |
| 下線・打消し線(TextStyle::underline / strikethrough) [詳解] | |
| struct | TextLayer |
| 文字の外観の 1 層(塗り・縁取り・影) [詳解] | |
| struct | TextShadow |
| 影(TextStyle::shadow)。層の一番下に「塗り = color、offset、blur」の 1 層として置く糖衣 [詳解] | |
| struct | TextStyle |
| 文字スタイル [詳解] | |
型定義 | |
| using | Pt = float |
列挙型 | |
| enum class | PaintKind : uint8_t { Solid , Linear , Radial } |
| enum class | PaintUnits : uint8_t { BoundingBox , UserSpace } |
| グラデーションの座標系 [詳解] | |
| enum class | StrokeJoin : uint8_t { Miter , Round , Bevel } |
| enum class | StrokeCap : uint8_t { Butt , Round , Square } |
| enum class | EmojiPresentation : uint8_t { Auto , Text , Emoji } |
| 絵文字の表示形式 [詳解] | |
| enum class | KinsokuLevel : uint8_t { Strict , Normal , Loose } |
| 約物の詰め・和欧間・ぶら下げ [詳解] | |
| enum class | LineBreakStrategy : uint8_t { Greedy , KnuthPlass } |
| enum class | WrapMode : uint8_t { Mixed , Char , Word , None } |
| 折返しの方式 [詳解] | |
| enum class | Align : uint8_t { Start , End , Center , Justify } |
| enum class | BlockAlign : uint8_t { Start , Center , End } |
| 行送り方向の揃え(箱の中での段落の位置。inl::originInBox) [詳解] | |
| enum class | TabAlign : uint8_t { Left , Center , Right , Decimal } |
| タブストップの揃え [詳解] | |
| enum class | Direction : uint8_t { Auto , Ltr , Rtl } |
| 段落の基底方向(UAX #9)。Auto は最初の強い文字で決める(和文・欧文は LTR) [詳解] | |
| enum class | WritingMode : uint8_t { HorizontalTb , VerticalRl , VerticalLr } |
| enum class | TextOrientation : uint8_t { Mixed , Upright , Sideways } |
| 縦組み中の文字の正立/横倒し(CSS text-orientation 相当) [詳解] | |
関数 | |
| Matrix | multiply (const Matrix &a, const Matrix &b) |
| a を後から適用する合成(結果 = a ∘ b。b で写してから a) | |
| Mat2 | multiply (const Mat2 &a, const Mat2 &b) |
| Matrix | invert (const Matrix &m, bool *ok=nullptr) |
| 逆行列。特異なら単位行列を返し ok=false | |
| std::vector< std::vector< Point > > | flattenPath (const Path &path, float tolerance, std::vector< bool > *closedFlags=nullptr) |
| 曲線を折れ線に平坦化した閉/開多角形列を得る(tolerance は pt) | |
| bool | isVertical (WritingMode wm) |
| Point | toPhysical (WritingMode wm, LogicalPoint p, Point lineOrigin) |
| 論理座標 → 物理座標 | |
| LogicalPoint | toLogical (WritingMode wm, Point p, Point lineOrigin) |
| 物理座標 → 論理座標(toPhysical の逆) | |
変数 | |
| constexpr Pt | kInch = 72.0f |
| constexpr Pt | kMm = 72.0f / 25.4f |
| constexpr Pt | kCm = kMm * 10.0f |
| constexpr float | kSidewaysRotation = -1.5707963267948966f |
| 横倒しグリフの回転角(ラジアン) | |
geom — 単位と幾何
writing_mode — 書字方向と論理座標
style — 文字・段落のスタイル
文書内部の長さはすべて pt(1/72 inch)の float。ラスタ backend が dpi/72 を 掛けてピクセルにする。座標はページ左上原点・y-down。
CSS エンジンにはしない。明示フィールドの構造体で、継承は親からのコピー。
行内は「インライン軸(行の進む方向=送り)」と「ブロック軸(行に直交)」の 2 軸で組む。richtext 縦組みの (u, v) をすべての書字方向へ一般化したもの。
横組み inline = +x(右) block = +y(下) 縦組み(rl) inline = +y(下) block = −x(左) ※行は右から左へ進む 縦組み(lr) inline = +y(下) block = +x(右)
ブロック軸の原点は「行の中心線」(縦組みなら列の中心線、横組みなら行の中心線)。 文字の仮想ボディ(em box)の中心をここへ合わせるのが全書字方向共通の規則。
| using typeset::Pt = typedef float |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
| 列挙値 | |
|---|---|
| HorizontalTb | 横組み |
| VerticalRl | 縦組み・行は右から左へ(日本語の既定) |
| VerticalLr | 縦組み・行は左から右へ |
writing_mode.hpp の 21 行目に定義があります。
|
strong |
縦組み中の文字の正立/横倒し(CSS text-orientation 相当)
| 列挙値 | |
|---|---|
| Mixed | 和文は正立、欧文は横倒し(既定) |
| Upright | すべて正立 |
| Sideways | すべて横倒し |
writing_mode.hpp の 32 行目に定義があります。
a を後から適用する合成(結果 = a ∘ b。b で写してから a)
| std::vector< std::vector< Point > > typeset::flattenPath | ( | const Path & | path, |
| float | tolerance, | ||
| std::vector< bool > * | closedFlags = nullptr |
||
| ) |
曲線を折れ線に平坦化した閉/開多角形列を得る(tolerance は pt)
|
inline |
|
inline |
論理座標 → 物理座標
| wm | 書字方向 |
| p | 論理座標(inline_ = 行頭からの送り、block = 中心線からのずれ) |
| lineOrigin | 行頭の物理位置(行の中心線上の点) |
writing_mode.hpp の 54 行目に定義があります。
参照先 typeset::LogicalPoint::block, HorizontalTb, typeset::LogicalPoint::inline_, typeset::Point::x, typeset::Point::y.
|
inline |
物理座標 → 論理座標(toPhysical の逆)
writing_mode.hpp の 63 行目に定義があります。
|
inlineconstexpr |
横倒しグリフの回転角(ラジアン)
角度は数学慣習(y-up)の反時計回りが正。描画先は y-down なので、画面上では 時計回りに 90 度倒れる(欧文の天が右を向く)。
writing_mode.hpp の 76 行目に定義があります。