typeset 0.1.0
縦書き・横書きの日本語組版ライブラリ(JLReq 水準、ラスタ / PDF / SVG)
読み取り中…
検索中…
一致する文字列を見つけられません
shaped.hpp
[詳解]
1#ifndef TYPESET_INL_SHAPED_HPP
2#define TYPESET_INL_SHAPED_HPP
3
4#include <cstdint>
5#include <memory>
6#include <string>
7#include <vector>
8
9#include <glyphware/Face.h>
10
13#include "typeset/geom.hpp"
14#include "typeset/style.hpp"
16
24namespace typeset::inl {
25
30 std::shared_ptr<glyphware::Face> face;
31 uint32_t gid = 0;
32 Pt inline_ = 0.0f;
33 Pt block = 0.0f;
34 Pt advance = 0.0f;
38 Pt boxBefore = 0.0f;
39 Pt boxAfter = 0.0f;
41 Pt size = 0.0f;
42 uint32_t charIndex = 0;
43 Pt embolden = 0.0f;
44 uint32_t styleIndex = 0;
46 bool annotation = false;
48 bool placeholder = false;
50 bool monochrome = false;
51
53 std::shared_ptr<const dl::Image> image;
57 std::shared_ptr<const obj::ObjectResult> object;
58};
59
67 uint32_t glyphStart = 0;
68 uint32_t glyphCount = 0;
69 size_t charStart = 0;
70 size_t charEnd = 0;
71 Pt origin = 0.0f;
72 Pt advance = 0.0f;
74 bool upright = true;
75 uint32_t styleIndex = 0;
76 bool object = false;
77 uint8_t level = 0;
78};
79
80struct ShapedText {
81 std::u16string sourceText;
82 std::vector<PlacedGlyph> glyphs;
83 std::vector<ShapedCluster> clusters;
84 Pt advance = 0.0f;
85 Pt blockMin = 0.0f;
86 Pt blockMax = 0.0f;
88 bool bidi = false;
89};
90
94struct StyleRun {
95 size_t start = 0;
96 size_t end = 0;
97 uint32_t styleIndex = 0;
98};
99
100} // namespace typeset::inl
101
102#endif // TYPESET_INL_SHAPED_HPP
inl/annotation — 行内に組み込む注記
CharClass
文字クラス(コメントの cl-NN は JLReq の文字クラス番号)
@ Unknown
上記に該当しないもの(和字扱い)
float Pt
Definition geom.hpp:17
2x2 行列(平行移動なし)。グリフ固有の変形に使う。 x' = xx*x + xy*y y' = yx*x + yy*y
Definition geom.hpp:54
配置済みグリフ 1 個(論理座標)
Definition shaped.hpp:29
Pt block
ペン位置(中心線からのずれ)
Definition shaped.hpp:33
Mat2 xform
物理空間でのグリフ固有の変形(回転・平体長体・斜体)
Definition shaped.hpp:40
Pt embolden
フェイクボールドの太らせ幅
Definition shaped.hpp:43
std::shared_ptr< glyphware::Face > face
Definition shaped.hpp:30
std::shared_ptr< const dl::Image > image
行内画像(グリフではなく画像を置く)。block は画像中心の中心線からのずれ
Definition shaped.hpp:53
uint32_t styleIndex
色・縁取りを引くためのスタイル番号
Definition shaped.hpp:44
bool monochrome
カラーフォントでもモノクロのアウトラインとして描く(EmojiPresentation::Text / VS15)
Definition shaped.hpp:50
Pt size
フォントサイズ
Definition shaped.hpp:41
bool placeholder
行内プレースホルダ(大きさだけの空箱。描かない。imageSize が箱の大きさ)
Definition shaped.hpp:48
Pt inline_
ペン位置(送り方向)
Definition shaped.hpp:32
std::shared_ptr< const obj::ObjectResult > object
行内オブジェクト(数式など)。block はオブジェクトの行送り方向の始端(横組み: 上端)の中心線からのずれ。 縦組みでは横倒し(時計回りに 90°)で置く
Definition shaped.hpp:57
Pt boxBefore
グリフの箱(送り方向): 始端は inline_ - boxBefore、終端は inline_ + boxAfter。 正立の縦組みではペン(水平原点)が箱の始端からアセント分進んだ所にあるので in...
Definition shaped.hpp:38
uint32_t charIndex
元テキストでの位置(UTF-16)
Definition shaped.hpp:42
bool annotation
注記のグリフ(ルビ文字・圏点・割注の内容)。charIndex は親文字の位置。取り出し口(charBoxes / hitTest)は本文と区別する
Definition shaped.hpp:46
シェイピング結果のクラスタ(組版の最小単位)
Definition shaped.hpp:66
Pt advance
シェイパーが返した送り
Definition shaped.hpp:72
text::CharClass charClass
Definition shaped.hpp:73
bool upright
正立か横倒しか(横組みでは常に true)
Definition shaped.hpp:74
uint8_t level
UAX #9 の埋め込みレベル(奇数が RTL)。行を確定したあとの並べ替えに使う
Definition shaped.hpp:77
Pt origin
ベタ組みでの inline 位置
Definition shaped.hpp:71
int paragraphLevel
UAX #9 の段落レベル(1 なら RTL の段落)
Definition shaped.hpp:87
std::vector< PlacedGlyph > glyphs
Definition shaped.hpp:82
bool bidi
レベル 0 以外のクラスタがある(行の並べ替えが要る)
Definition shaped.hpp:88
std::u16string sourceText
Definition shaped.hpp:81
Pt blockMax
同(正側)
Definition shaped.hpp:86
Pt blockMin
中心線からの張り出し(負側)
Definition shaped.hpp:85
std::vector< ShapedCluster > clusters
Definition shaped.hpp:83
スタイル区間([start, end) は UTF-16 位置)
Definition shaped.hpp:94