typeset 0.1.0
縦書き・横書きの日本語組版ライブラリ(JLReq 水準、ラスタ / PDF / SVG)
読み取り中…
検索中…
一致する文字列を見つけられません
item_builder.hpp
[詳解]
1#ifndef TYPESET_INL_ITEM_BUILDER_HPP
2#define TYPESET_INL_ITEM_BUILDER_HPP
3
4#include <vector>
5
11#include "typeset/style.hpp"
13
25namespace typeset::inl {
26
31 const std::vector<TextStyle>* styles = nullptr;
33 const TextStyle* baseStyle = nullptr;
35 float letterSpacing = 0.0f;
37 bool preserveSpaces = false;
41 const std::vector<TabStop>* tabStops = nullptr;
42 int tabWidth = 4;
45 float hyphenPenalty = 50.0f;
48};
49
53std::vector<LineItem> buildLineItems(const ShapedText& shaped,
54 const std::vector<Annotation>& annotations,
55 const SpacingOptions& opts,
56 const ItemBuildContext& ctx);
57
59inline float annotationSide(WritingMode wm) { return isVertical(wm) ? 1.0f : -1.0f; }
60
61} // namespace typeset::inl
62
63#endif // TYPESET_INL_ITEM_BUILDER_HPP
言語ごとのパターン。TextStyle::language(BCP47)で引く。 完全一致 → 主言語("en-GB" なら "en")→ 既定の言語(setDefaultLanguage)の順に探す。
inl/annotation — 行内に組み込む注記
float annotationSide(WritingMode wm)
注記の付く側(縦組み: +1 = 右、横組み: −1 = 上)
std::vector< LineItem > buildLineItems(const ShapedText &shaped, const std::vector< Annotation > &annotations, const SpacingOptions &opts, const ItemBuildContext &ctx)
アイテム列を組み立てる。末尾には段落終端(無限に伸びる Glue + 強制ブレーク)を付ける
WrapMode
折返しの方式
Definition style.hpp:214
TextOrientation
縦組み中の文字の正立/横倒し(CSS text-orientation 相当)
@ Mixed
和文は正立、欧文は横倒し(既定)
bool isVertical(WritingMode wm)
@ HorizontalTb
横組み
文字スタイル
Definition style.hpp:86
const std::vector< TabStop > * tabStops
タブストップ(空なら tabWidth × em ごと)
const std::vector< TextStyle > * styles
styleIndex → TextStyle
const text::HyphenationDictionary * hyphenation
欧文のハイフネーション(BreakOptions から。nullptr ならソフトハイフンだけ)
const TextStyle * baseStyle
本文のスタイル(注記の子テキストを組む基準。styles[0] 相当)
bool preserveSpaces
欧文間隔を固定幅の箱にする(ParagraphStyle::preserveSpaces)
float letterSpacing
字間(em)。クラスタ間の Glue に足す
WrapMode wrap
折返しの方式(BreakOptions::wrap)