Implement CanvasRenderingContext2D.font property

This commit is contained in:
Utsav Oza 2020-06-04 01:32:25 +05:30
parent 15fd256302
commit c21fde3751
11 changed files with 68 additions and 6 deletions

View file

@ -80,6 +80,8 @@ impl ToAnimatedValue for FontWeight {
ToAnimatedZero,
ToCss,
ToResolvedValue,
Serialize,
Deserialize,
)]
/// The computed value of font-size
pub struct FontSize {
@ -179,7 +181,7 @@ impl ToAnimatedValue for FontSize {
}
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToResolvedValue)]
#[cfg_attr(feature = "servo", derive(Hash, MallocSizeOf))]
#[cfg_attr(feature = "servo", derive(Hash, MallocSizeOf, Serialize, Deserialize))]
/// Specifies a prioritized list of font family names or generic family names.
pub struct FontFamily {
/// The actual list of family names.
@ -445,7 +447,17 @@ impl SingleFontFamily {
#[cfg(feature = "servo")]
#[derive(
Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem,
Clone,
Debug,
Eq,
Hash,
MallocSizeOf,
PartialEq,
ToComputedValue,
ToResolvedValue,
ToShmem,
Serialize,
Deserialize,
)]
/// A list of SingleFontFamily
pub struct FontFamilyList(Box<[SingleFontFamily]>);

View file

@ -496,6 +496,8 @@ impl ToComputedValue for FontStretch {
ToCss,
ToResolvedValue,
ToShmem,
Serialize,
Deserialize,
)]
#[allow(missing_docs)]
pub enum KeywordSize {
@ -540,6 +542,8 @@ impl Default for KeywordSize {
ToCss,
ToResolvedValue,
ToShmem,
Serialize,
Deserialize,
)]
/// Additional information for keyword-derived font sizes.
pub struct KeywordInfo {