37#include "include/core/SkFontStyle.h"
38#include "include/core/SkRefCnt.h"
81 const std::string& family_override =
"");
88 const std::string& family_override =
"");
101 const std::string& scope = {});
179 const std::string& family_override =
"");
205 const std::string& family_override =
"");
224 bool forward = true);
233 std::
size_t byte_offset,
234 const
std::
string& locale =
"",
235 bool forward = true);
243 const
std::
string& locale =
"");
251sk_sp<SkFontMgr> platform_font_manager();
275sk_sp<SkTypeface> match_bundled_typeface(SkFontMgr* mgr,
276 const std::string& family,
290sk_sp<SkTypeface> match_registered_typeface(
const std::string& family,
304bool face_wght_axis(
const SkTypeface* face,
305 float& out_min,
float& out_max,
float& out_default);
309struct RegisteredTypeface {
311 sk_sp<SkTypeface> typeface;
329std::vector<RegisteredTypeface> registered_typefaces_snapshot();
337std::vector<RegisteredTypeface> bundled_typefaces_snapshot();
350bool platform_font_db_usable();
358sk_sp<SkTypeface> bundled_fallback_typeface();
364std::size_t bundled_font_count();
378 std::uint32_t codepoint = 0;
379 bool family_resolved =
false;
380 bool glyph_present =
false;
381 std::string resolved_family;
384FontProbe probe_font_glyph(
const std::string& family,
385 int weight,
int slant,
386 std::uint32_t codepoint);
Definition affine_transform.hpp:24
std::size_t word_break_step(const std::string &text, std::size_t byte_offset, const std::string &locale="", bool forward=true)
Locale-aware word break iterator.
bool has_declared_font_face_weights(const std::string &family)
Whether any @font-face weight range has been declared for family.
void declare_font_face_weight_range(const std::string &family, int weight_min, int weight_max, const std::string &scope={})
Records that an @font-face rule bound family at a declared weight range for scope.
bool is_font_registered(const std::string &family)
Returns true iff the requested family name was previously registered via register_font / register_fon...
bool register_font_woff2(const std::uint8_t *woff2_data, std::size_t size, const std::string &family_override="")
Register a WOFF2-compressed font at runtime.
void clear_declared_font_face_weight_ranges(const std::string &scope)
Remove all declared ranges owned by scope.
std::vector< std::size_t > line_break_opportunities(const std::string &text, const std::string &locale="")
Find line-break opportunities in text.
bool register_font_file(const std::string &path, const std::string &family_override="")
Convenience overload: register a font from a file on disk.
bool register_font(const std::uint8_t *data, std::size_t size, const std::string &family_override="")
Register a font from raw TTF/OTF bytes.
FontState
Async font lifecycle state.
Definition bundled_fonts.hpp:150
@ Pending
Definition bundled_fonts.hpp:151
@ Loaded
Definition bundled_fonts.hpp:152
@ Substituted
Definition bundled_fonts.hpp:154
@ Failed
Definition bundled_fonts.hpp:153
std::uint64_t font_registration_generation() noexcept
Monotonic counter that bumps every time a typeface registration mutates process-global font state.
bool validate_font_bytes(const std::uint8_t *data, std::size_t size)
Validate font bytes before handing them to Skia.
std::optional< bool > declared_face_synthesizes_bold(const std::string &family, int requested_weight)
Whether Chromium synthesizes bold for requested_weight text in family: it does exactly when the reque...
std::uint64_t woff2_file_routes() noexcept
How many register_font_file calls this process has routed to register_font_woff2 because the file sta...
std::future< FontState > register_font_url(const std::string &url, const std::string &family_override="")
Schedule a font registration from a URL or filesystem path and return a future that resolves to the f...
bool woff2_decoder_available() noexcept
Runtime check for WOFF2 decoder availability.
std::size_t cluster_step(const std::string &text, std::size_t byte_offset, bool forward=true)
Grapheme-aware cursor step for TextEditor.
void bump_font_registration_generation() noexcept
Force-bump the registration generation.
@ text
Definition scene_node.hpp:96
@ path
Definition scene_node.hpp:93
int css_match_declared_weight(const std::vector< DeclaredWeightRange > &ranges, int desired_weight)
The declared range CSS font matching picks for desired_weight (CSS Fonts 4 section 5....
One CSS @font-face rule's declared font-weight range (a single weight has min == max).
Definition bundled_fonts.hpp:93
int min
Definition bundled_fonts.hpp:94
int max
Definition bundled_fonts.hpp:95