The typed, hashable contract that replaces (family_string, size) throughout the font subsystem. More...
#include <font_options.hpp>
Public Member Functions | |
| bool | operator== (const FontOptions &) const =default |
| std::size_t | hash () const noexcept |
| Hash combining all fields. | |
Public Attributes | |
| std::vector< std::string > | family_stack |
| Full CSS-style cascade. | |
| float | weight = 400.0f |
| CSS scalar 100..900 (or variable-axis value when the resolved face has a wght axis). | |
| float | width = 100.0f |
| CSS font-stretch scalar 50..200, also used as wdth axis value when present. | |
| FontSlant | slant = FontSlant::Normal |
| float | oblique_angle = 0.0f |
| Slant angle in degrees. | |
| float | size = 14.0f |
| Pixel size at the canvas's current device scale. | |
| std::vector< FontFeature > | features |
| std::vector< VariationAxis > | variation_axes |
| Each entry: (axis tag, value). | |
| std::string | locale |
| BCP-47 language tag ("", "en", "ja-JP", "zh-Hans"). | |
| BaseDirection | direction = BaseDirection::Auto |
| float | letter_spacing = 0.0f |
| Extra letter spacing in px (post-shaping, between clusters). | |
| float | word_spacing = 0.0f |
| Extra word spacing in px (applied at whitespace cluster boundaries). | |
| HintingMode | hinting_mode = HintingMode::PlatformDefault |
| AntiAliasMode | aa_mode = AntiAliasMode::Default |
| ColorFontMode | color_font_mode = ColorFontMode::Auto |
| FontSynthesisPolicy | font_synthesis |
| FallbackMode | fallback_mode = FallbackMode::Hybrid |
| FontScopeId | scope = FontScopeId::global() |
| std::uint64_t | registry_generation = 0 |
| Set by the resolver before returning a ResolvedFont. | |
The typed, hashable contract that replaces (family_string, size) throughout the font subsystem.
Every resolver, shaper, line-layout, and paint cache keys on this whole structure.
|
noexcept |
Hash combining all fields.
Slow-path acceptable; cache keys take the hash once and reuse it for the lifetime of the lookup. Stable across process runs for the same input.
|
default |
| AntiAliasMode pulp::canvas::FontOptions::aa_mode = AntiAliasMode::Default |
| ColorFontMode pulp::canvas::FontOptions::color_font_mode = ColorFontMode::Auto |
| BaseDirection pulp::canvas::FontOptions::direction = BaseDirection::Auto |
| FallbackMode pulp::canvas::FontOptions::fallback_mode = FallbackMode::Hybrid |
| std::vector<std::string> pulp::canvas::FontOptions::family_stack |
Full CSS-style cascade.
Order is significant; the resolver walks front-to-back. Empty vector falls through to platform default. An entry may keep its CSS quotes: a quoted entry is a literal family name, never a generic keyword (see split_css_font_family_list).
| std::vector<FontFeature> pulp::canvas::FontOptions::features |
| FontSynthesisPolicy pulp::canvas::FontOptions::font_synthesis |
| HintingMode pulp::canvas::FontOptions::hinting_mode = HintingMode::PlatformDefault |
| float pulp::canvas::FontOptions::letter_spacing = 0.0f |
Extra letter spacing in px (post-shaping, between clusters).
| std::string pulp::canvas::FontOptions::locale |
BCP-47 language tag ("", "en", "ja-JP", "zh-Hans").
Drives ICU locale-aware shaping and line-break behavior.
| float pulp::canvas::FontOptions::oblique_angle = 0.0f |
Slant angle in degrees.
Used when slant == Oblique; ignored otherwise.
| std::uint64_t pulp::canvas::FontOptions::registry_generation = 0 |
Set by the resolver before returning a ResolvedFont.
Baked into every downstream cache key so stale resolutions become eligible for collection on the next lookup after a registration. Never set by the caller — exposed as a public field so caches that don't have access to the resolver (e.g. SkiaCanvas typeface cache) can still observe and bake it in.
| FontScopeId pulp::canvas::FontOptions::scope = FontScopeId::global() |
| float pulp::canvas::FontOptions::size = 14.0f |
Pixel size at the canvas's current device scale.
Always in device-independent pixels (px); the canvas is responsible for any DPR/transform application.
| FontSlant pulp::canvas::FontOptions::slant = FontSlant::Normal |
| std::vector<VariationAxis> pulp::canvas::FontOptions::variation_axes |
Each entry: (axis tag, value).
The resolver consults these for axis instancing. Ordering is irrelevant for resolution but preserved for trace fidelity.
| float pulp::canvas::FontOptions::weight = 400.0f |
CSS scalar 100..900 (or variable-axis value when the resolved face has a wght axis).
Defaults to 400 (Regular).
| float pulp::canvas::FontOptions::width = 100.0f |
CSS font-stretch scalar 50..200, also used as wdth axis value when present.
Defaults to 100 (Normal).
| float pulp::canvas::FontOptions::word_spacing = 0.0f |
Extra word spacing in px (applied at whitespace cluster boundaries).