1#ifndef TYPESET_INL_LINE_BREAKER_HPP
2#define TYPESET_INL_LINE_BREAKER_HPP
42 : base_(base), offsets_(offsets), first_(firstLineIndex) {}
43 LineShape at(
int lineIndex)
const override {
return at(lineIndex, 0.0f); }
45 const int i = lineIndex - first_;
46 const Pt extra = (i >= 0 &&
static_cast<size_t>(i) < offsets_.size()) ? offsets_[
static_cast<size_t>(i)]
47 : (offsets_.empty() ? 0.0f : offsets_.back());
48 return base_.
at(lineIndex, extraBlock + extra);
52 const std::vector<Pt>& offsets_;
70 : base_(base), indentLine_(indentLine), indent_(indent) {}
71 LineShape at(
int lineIndex)
const override {
return at(lineIndex, 0.0f); }
74 if (lineIndex == indentLine_) {
103std::vector<BreakLine>
breakLines(
const std::vector<LineItem>& items,
106 int firstLineIndex = 0);
LineShape at(int) const override
lineIndex 行目の形(段落の先頭を 0 とは限らない。呼び出し側が firstLineIndex を渡す)
ConstantLineShape(Pt length, Pt indent=0.0f)
LineShape at(int lineIndex) const override
lineIndex 行目の形(段落の先頭を 0 とは限らない。呼び出し側が firstLineIndex を渡す)
LineShape at(int lineIndex, Pt extraBlock) const override
行送りが広がった行の後ろでの形。extraBlock は「行番号 × 行送り」に対して実際の行位置が ずれている量(前の行までの追加の送り)。排除領域を見る実装だけが使う。既定は at(lineInde...
IndentedLineShape(const LineShapeProvider &base, int indentLine, Pt indent)
virtual LineShape at(int lineIndex, Pt) const
行送りが広がった行の後ろでの形。extraBlock は「行番号 × 行送り」に対して実際の行位置が ずれている量(前の行までの追加の送り)。排除領域を見る実装だけが使う。既定は at(lineInde...
virtual ~LineShapeProvider()=default
virtual LineShape at(int lineIndex) const =0
lineIndex 行目の形(段落の先頭を 0 とは限らない。呼び出し側が firstLineIndex を渡す)
行ごとの実際の位置のずれを base に渡す(段落レイアウタが行送りの広がりを反映するのに使う)
LineShape at(int lineIndex) const override
lineIndex 行目の形(段落の先頭を 0 とは限らない。呼び出し側が firstLineIndex を渡す)
OffsetLineShape(const LineShapeProvider &base, const std::vector< Pt > &offsets, int firstLineIndex)
LineShape at(int lineIndex, Pt extraBlock) const override
行送りが広がった行の後ろでの形。extraBlock は「行番号 × 行送り」に対して実際の行位置が ずれている量(前の行までの追加の送り)。排除領域を見る実装だけが使う。既定は at(lineInde...
inl/annotation — 行内に組み込む注記
std::vector< BreakLine > breakLines(const std::vector< LineItem > &items, const LineShapeProvider &shape, const BreakOptions &opts, int firstLineIndex=0)
行分割を実行する
int lineIndex
LineShapeProvider に渡した行番号
uint32_t itemEnd
同・終端(ブレーク位置。この位置は含まない)
uint32_t itemStart
行を構成するアイテムの開始
float ratio
グルーの調整比。>0 で伸ばす、<0 で縮める