5 #ifndef FLUTTER_IMPELLER_TYPOGRAPHER_TEXT_FRAME_H_
6 #define FLUTTER_IMPELLER_TYPOGRAPHER_TEXT_FRAME_H_
11 #include "flutter/display_list/geometry/dl_path.h"
12 #include "fml/status_or.h"
20 using PathCreator = std::function<fml::StatusOr<flutter::DlPath>()>;
66 const std::vector<TextRun>&
GetRuns()
const;
93 fml::StatusOr<flutter::DlPath>
GetPath()
const;
102 enable_gamma_correction_ =
value;
105 return enable_gamma_correction_;
109 std::vector<TextRun> runs_;
113 std::optional<bool> enable_gamma_correction_ = std::nullopt;
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.
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 whether any glyph in any run in this TextFrame is colored and so would be cached with color a...
std::optional< bool > GetEnableGammaCorrection() const
const Font & GetFont() const
Return the font of the first glyph run.
void SetEnableGammaCorrection(std::optional< bool > value)
Toggle the platform-specific contrast and gamma correction in the fragment shader.
size_t GetRunCount() const
The number of runs in this text frame.
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.