9#include "flutter/fml/logging.h"
43 auto typeface = std::make_shared<TypefaceSkia>(
font.refTypeface());
46 font.getMetrics(&sk_metrics);
54 return Font{std::move(typeface), metrics, alignment};
63 bool has_color =
false;
64 std::vector<TextRun> runs;
71 if (
run.font().isSubpixel()) {
76 const auto glyph_count =
run.glyphCount();
78 switch (
run.positioning()) {
80 std::vector<TextRun::GlyphPosition> positions;
81 positions.reserve(glyph_count);
82 for (
auto i = 0u;
i < glyph_count;
i++) {
85 const SkPoint* point = glyph_points +
i;
87 ? Glyph::Type::kBitmap
89 has_color |=
type == Glyph::Type::kBitmap;
90 positions.emplace_back(
97 runs.emplace_back(text_run);
105 return std::make_shared<TextFrame>(runs,
ToRect(blob->
bounds()), has_color);
static SkStrikeSpec MakeWithNoDevice(const SkFont &font, const SkPaint *paint=nullptr)
std::unique_ptr< SkScalerContext > createScalerContext() const
const SkRect & bounds() const
Describes a typeface along with any modifications to its intrinsic properties.
Represents a collection of positioned glyphs from a specific font.
#define FML_DLOG(severity)
#define FML_UNREACHABLE()
sk_sp< SkBlender > blender SkRect rect
font
Font Metadata and Metrics.
static Font ToFont(const SkTextBlobRunIterator &run, AxisAlignment alignment)
static Rect ToRect(const SkRect &rect)
AxisAlignment
Determines the axis along which there is subpixel positioning.
static AxisAlignment ToAxisAligment(SkAxisAlignment aligment)
Convert a Skia axis alignment into an Impeller alignment.
std::shared_ptr< TextFrame > MakeTextFrameFromTextBlobSkia(const sk_sp< SkTextBlob > &blob)
constexpr float y() const
constexpr float x() const
Describes the modifications made to the intrinsic properties of a typeface.
The glyph index in the typeface.
static constexpr TRect MakeLTRB(Type left, Type top, Type right, Type bottom)