29class InternalLineMetrics;
50 bool isLeftToRight()
const {
return start <= end; }
98 size_t index()
const {
return fIndex; }
140 template<
typename Visitor>
165 fJustificationShifts.
clear();
181 size_t fPlaceholderIndex;
196 std::shared_ptr<GlyphData> fGlyphData;
207 const bool fUseHalfLeading;
217template<
typename Visitor>
224 for (
size_t glyph = 1; glyph <= this->
size(); ++glyph) {
226 if (nextCluster <= cluster) {
232 fClusterStart + cluster,
233 fClusterStart + nextCluster,
238 cluster = nextCluster;
241 size_t glyph = this->
size();
242 size_t cluster = this->fUtf8Range.
begin();
246 if (nextCluster <= cluster) {
252 fClusterStart + cluster,
253 fClusterStart + nextCluster,
258 cluster = nextCluster;
281 , fHalfLetterSpacing(0.0) {}
320 size_t size()
const {
return fEnd - fStart; }
361 bool fIsWhiteSpaceBreak;
362 bool fIsIntraWordBreak;
377 fForceStrut = forceStrut;
402 font.getMetrics(&metrics);
409 fForceStrut = forceStrut;
417 fDescent =
std::max(fDescent,
run->correctDescent());
418 fLeading =
std::max(fLeading,
run->correctLeading());
421 fRawDescent =
std::max(fRawDescent,
run->descent());
422 fRawLeading =
std::max(fRawLeading,
run->leading());
426 fAscent =
std::min(fAscent, other.fAscent);
427 fDescent =
std::max(fDescent, other.fDescent);
428 fLeading =
std::max(fLeading, other.fLeading);
429 fRawAscent =
std::min(fRawAscent, other.fRawAscent);
430 fRawDescent =
std::max(fRawDescent, other.fRawDescent);
431 fRawLeading =
std::max(fRawLeading, other.fRawLeading);
455 if (metrics.fForceStrut) {
456 metrics.fAscent = fAscent;
457 metrics.fDescent = fDescent;
458 metrics.fLeading = fLeading;
459 metrics.fRawAscent = fRawAscent;
460 metrics.fRawDescent = fRawDescent;
461 metrics.fRawLeading = fRawLeading;
464 metrics.fAscent =
std::min(metrics.fAscent, fAscent - fLeading / 2.0f);
465 metrics.fDescent =
std::max(metrics.fDescent, fDescent + fLeading / 2.0f);
466 metrics.fRawAscent =
std::min(metrics.fRawAscent, fRawAscent - fRawLeading / 2.0f);
467 metrics.fRawDescent =
std::max(metrics.fRawDescent, fRawDescent + fRawLeading / 2.0f);
472 return fLeading / 2 - fAscent +
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static void round(SkPoint *p)
bool isIntraWordBreak() const
SkScalar trimmedWidth(size_t pos) const
ParagraphImpl * getOwner() const
bool isIdeographic() const
void setOwner(ParagraphImpl *owner)
size_t roundPos(SkScalar s) const
SkScalar sizeFromChar(TextIndex ch) const
SkScalar getHalfLetterSpacing() const
bool isGraphemeBreak() const
SkScalar sizeToChar(TextIndex ch) const
TextRange textRange() const
bool canBreakLineAfter() const
bool contains(TextIndex ch) const
ParagraphImpl * owner() const
bool startsIn(TextRange text) const
RunIndex runIndex() const
Cluster(const Cluster &)=default
bool belongs(TextRange text) const
void space(SkScalar shift)
void setHalfLetterSpacing(SkScalar halfLetterSpacing)
Cluster(TextRange textRange)
bool isWhitespaceBreak() const
bool getForceStrut() const
void updateRawData(SkScalar ra, SkScalar rd)
InternalLineMetrics(SkScalar a, SkScalar d, SkScalar l)
InternalLineMetrics(SkScalar a, SkScalar d, SkScalar l, SkScalar ra, SkScalar rd, SkScalar rl)
void add(InternalLineMetrics other)
SkScalar rawAscent() const
void updateLineMetrics(InternalLineMetrics &metrics)
SkScalar alphabeticBaseline() const
SkScalar ideographicBaseline() const
void setForceStrut(bool value)
SkScalar baseline() const
SkScalar rawDescent() const
void update(SkScalar a, SkScalar d, SkScalar l)
SkScalar runTop(const Run *run, LineMetricStyle ascentStyle) const
InternalLineMetrics(const SkFont &font, bool forceStrut)
InternalLineMetrics(bool forceStrut)
SkScalar deltaBaselines() const
SkSpan< const uint32_t > clusterIndexes() const
SkScalar calculateHeight(LineMetricStyle ascentStyle, LineMetricStyle descentStyle) const
void updateMetrics(InternalLineMetrics *endlineMetrics)
void copyTo(SkTextBlobBuilder &builder, size_t pos, size_t size) const
ClusterRange clusterRange() const
bool isPlaceholder() const
TextRange textRange() const
size_t globalClusterIndex(size_t pos) const
SkSpan< const SkGlyphID > glyphs() const
void setWidth(SkScalar width)
SkShaper::RunHandler::Buffer newRunBuffer()
void setClusterRange(size_t from, size_t to)
size_t clusterIndex(size_t pos) const
SkScalar correctDescent() const
std::tuple< bool, TextIndex, TextIndex > findLimitingGlyphClusters(TextRange text) const
SkScalar positionX(size_t pos) const
void shift(SkScalar shiftX, SkScalar shiftY)
SkScalar posY(size_t index) const
bool useHalfLeading() const
std::tuple< bool, TextIndex, TextIndex > findLimitingGraphemes(TextRange text) const
void addX(size_t index, SkScalar shift)
void setOwner(ParagraphImpl *owner)
SkSpan< const SkPoint > offsets() const
Run & operator=(Run &&)=delete
std::tuple< bool, ClusterIndex, ClusterIndex > findLimitingClusters(TextRange text) const
void setHeight(SkScalar height)
const SkFont & font() const
SkScalar correctLeading() const
void resetJustificationShifts()
Run & operator=(const Run &)=delete
SkScalar baselineShift() const
SkScalar calculateWidth(size_t start, size_t end, bool clip) const
std::function< void(Cluster *cluster)> ClusterVisitor
SkScalar correctAscent() const
Run(ParagraphImpl *owner, const SkShaper::RunHandler::RunInfo &info, size_t firstChar, SkScalar heightMultiplier, bool useHalfLeading, SkScalar baselineShift, size_t index, SkScalar shiftX)
ParagraphImpl * owner() const
SkScalar heightMultiplier() const
void iterateThroughClustersInTextOrder(Visitor visitor)
void addSpacesAtTheEnd(SkScalar space, Cluster *cluster)
TextDirection getTextDirection() const
SkSpan< const SkPoint > positions() const
void extend(const Cluster *cluster, SkScalar offset)
void iterateThroughClusters(const ClusterVisitor &visitor)
PlaceholderStyle * placeholderStyle() const
SkScalar addSpacesEvenly(SkScalar space, Cluster *cluster)
SkScalar posX(size_t index) const
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Dart_NativeFunction function
static float max(float r, float g, float b)
static float min(float r, float g, float b)
Visitor(Ts...) -> Visitor< Ts... >
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir
font
Font Metadata and Metrics.
const SkRange< size_t > EMPTY_CLUSTERS
const size_t EMPTY_CLUSTER
const SkRange< size_t > EMPTY_TEXT
SkRange< size_t > ClusterRange
const SkRange< size_t > EMPTY_RANGE
SkRange< GlyphIndex > GlyphRange
SkRange< GraphemeIndex > GraphemeRange
SkScalar fLeading
distance to add between lines, typically positive or zero
SkScalar fAscent
distance to reserve above baseline, typically negative
SkScalar fDescent
distance to reserve below baseline, typically positive
static constexpr SkPoint Make(float x, float y)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
constexpr size_t begin() const
constexpr size_t end() const