5 #ifndef FLUTTER_IMPELLER_TYPOGRAPHER_TEXT_FRAME_H_
6 #define FLUTTER_IMPELLER_TYPOGRAPHER_TEXT_FRAME_H_
10 #include "flutter/display_list/geometry/dl_path.h"
11 #include "fml/status_or.h"
19 using PathCreator = std::function<fml::StatusOr<flutter::DlPath>()>;
68 const std::vector<TextRun>&
GetRuns()
const;
104 std::optional<GlyphProperties> properties);
116 fml::StatusOr<flutter::DlPath>
GetPath()
const;
126 std::optional<GlyphProperties> GetProperties()
const;
128 void AppendFrameBounds(
const FrameBounds& frame_bounds);
130 void ClearFrameBounds();
132 void SetAtlasGeneration(
size_t value, intptr_t atlas_id);
134 std::vector<TextRun> runs_;
141 std::vector<FrameBounds> bound_values_;
143 size_t generation_ = 0;
144 intptr_t atlas_id_ = 0;
146 std::optional<GlyphProperties> properties_;
Describes a typeface along with any modifications to its intrinsic properties.
Type
Describes how the glyphs are represented in the texture.
Represents a collection of shaped text runs.
static Rational RoundScaledFontSize(Scalar scale)
Rect GetBounds() const
The conservative bounding box for this text frame.
bool IsFrameComplete() const
Verifies that all glyphs in this text frame have computed bounds information.
GlyphAtlas::Type GetAtlasType() const
The type of atlas this run should be place in.
std::optional< Glyph > AsSingleGlyph() const
If this text frame contains a single glyph (such as for an Icon), then return it, otherwise std::null...
bool HasColor() const
Returns the paint color this text frame was recorded with.
Rational GetScale() const
const FrameBounds & GetFrameBounds(size_t index) const
Retrieve the frame bounds for the glyph at [index].
const Matrix & GetTransform() const
const Font & GetFont() const
Return the font of the first glyph run.
std::pair< size_t, intptr_t > GetAtlasGenerationAndID() const
size_t GetRunCount() const
The number of runs in this text frame.
void SetPerFrameData(Rational scale, Point offset, const Matrix &transform, std::optional< GlyphProperties > properties)
Store text frame scale, offset, and properties for hashing in th glyph atlas.
Matrix GetOffsetTransform() const
fml::StatusOr< flutter::DlPath > GetPath() const
static SubpixelPosition ComputeSubpixelPosition(const TextRun::GlyphPosition &glyph_position, AxisAlignment alignment, const Matrix &transform)
const std::vector< TextRun > & GetRuns() const
Returns a reference to all the text runs in this frame.
AxisAlignment
Determines the axis along which there is subpixel positioning.
std::function< fml::StatusOr< flutter::DlPath >()> PathCreator
A 4x4 matrix using column-major storage.