34 if (runs_.size() > 1) {
37 auto glyph_positions = runs_[0].GetGlyphPositions();
38 if (glyph_positions.size() > 10) {
41 if (glyph_positions.size() == 1) {
47 auto first_position = glyph_positions[0];
49 first_position.position + first_position.glyph.bounds.GetOrigin(),
50 first_position.glyph.bounds.GetSize());
51 for (
auto i = 1u; i < glyph_positions.size(); i++) {
52 auto glyph_position = glyph_positions[i];
54 glyph_position.position + glyph_position.glyph.bounds.GetOrigin(),
55 glyph_position.glyph.bounds.GetSize());
56 auto intersection = glyph_rect.Intersection(overlapping_rect);
57 if (intersection.has_value()) {
60 overlapping_rect = overlapping_rect.Union(glyph_rect);
Rect GetBounds() const
The conservative bounding box for this text frame.
static Scalar RoundScaledFontSize(Scalar scale, Scalar point_size)
GlyphAtlas::Type GetAtlasType() const
The type of atlas this run should be emplaced in.
void CollectUniqueFontGlyphPairs(FontGlyphMap &glyph_map, Scalar scale) const
bool MaybeHasOverlapping() const
Whether any of the glyphs of this run are potentially overlapping.
size_t GetRunCount() const
The number of runs in this text frame.
const std::vector< TextRun > & GetRuns() const
Returns a reference to all the text runs in this frame.
Represents a collection of positioned glyphs from a specific font.