/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Generic types for font stuff.
usecrate::parser::{Parse, ParserContext}; usecrate::values::animated::ToAnimatedZero; usecrate::One; use byteorder::{BigEndian, ReadBytesExt}; use cssparser::Parser; use std::fmt::{self, Write}; use std::io::Cursor; use style_traits::{CssWriter, ParseError}; use style_traits::{StyleParseErrorKind, ToCss};
/// A trait for values that are labelled with a FontTag (for feature and /// variation settings). pubtrait TaggedFontValue { /// The value's tag. fn tag(&self) -> FontTag;
}
/// https://drafts.csswg.org/css-fonts-4/#feature-tag-value #[derive(
Clone,
Debug,
Eq,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToAnimatedValue,
ToComputedValue,
ToResolvedValue,
ToShmem,
)] pubstruct FeatureTagValue<Integer> { /// A four-character tag, packed into a u32 (one byte per character). pub tag: FontTag, /// The actual value. pub value: Integer,
}
/// A value both for font-variation-settings and font-feature-settings. #[derive(
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToCss, ToResolvedValue, ToShmem,
)] #[css(comma)] pubstruct FontSettings<T>(#[css(if_empty = "normal", iterable)] pubBox<[T]>);
impl<T> FontSettings<T> { /// Default value of font settings as `normal`. #[inline] pubfn normal() -> Self {
FontSettings(vec![].into_boxed_slice())
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.