pub struct Metadata {
pub font_name: String,
pub engraving_defaults: EngravingDefaults,
pub advance_widths: GlyphAdvanceWidths,
pub anchors: GlyphAnchors,
pub bounding_boxes: GlyphBoundingBoxes,
}
Expand description
Representation of the metadata file provided with a SMuFL font.
See the SMuFL documentation.
Fields§
§font_name: String
The name of the font to which the metadata applies.
engraving_defaults: EngravingDefaults
Recommended defaults for line widths, etc.
See the SMuFL documentation.
advance_widths: GlyphAdvanceWidths
Advance widths for glyphs.
See the SMuFL documentation.
anchors: GlyphAnchors
Anchor data for glyphs.
See the SMuFL documentation.
bounding_boxes: GlyphBoundingBoxes
Bounding boxes for glyphs.
See the SMuFL documentation
Implementations§
source§impl Metadata
impl Metadata
sourcepub fn from_reader(reader: impl Read) -> Result<Self, Error>
pub fn from_reader(reader: impl Read) -> Result<Self, Error>
Deserializes Metadata
from JSON data.
If any unknown glyphs are encountered, they will be logged at the WARN level.
sourcepub fn with_defaults(self, defaults: Self) -> Self
pub fn with_defaults(self, defaults: Self) -> Self
Returns a new Metadata
which combines self
and defaults
, using
values from defaults
wherever self
does not have data.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Metadata
impl<'de> Deserialize<'de> for Metadata
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more