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