Skip to content

Commit

Permalink
Add 'serde' feature to read/write-fonts
Browse files Browse the repository at this point in the history
This is intended to be used to serialize test cases in write-fonts; it
is also added in read-fonts since write-fonts reuses flags and enums
declared in write-fonts.

One funny thing: (I think) this hit a serde bug around using
non-literals to provide default values for const generics, which we do
in the OffsetMarker types in write-fonts.
  • Loading branch information
cmyr committed Sep 5, 2023
1 parent 94baa49 commit 0af4ac3
Show file tree
Hide file tree
Showing 59 changed files with 293 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

# test all packages individually to ensure deterministic resolution
# of dependencies for each package

- name: cargo test font-types
run: cargo test -p font-types --all-targets --all-features

Expand All @@ -65,6 +65,9 @@ jobs:
- name: cargo test write-fonts
run: cargo test -p write-fonts --all-targets --all-features

- name: cargo test write-fonts default features
run: cargo test -p write-fonts --all-targets

- name: cargo test skrifa
run: cargo test -p skrifa --all-targets --all-features

Expand Down
2 changes: 2 additions & 0 deletions font-codegen/src/flags_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub(crate) fn generate_flags(raw: &BitFlags) -> proc_macro2::TokenStream {
quote! {
#( #docs )*
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct #name { bits: #typ }
impl #name {
#( #variant_decls )*
Expand Down Expand Up @@ -339,6 +340,7 @@ pub(crate) fn generate_raw_enum(raw: &RawEnum) -> TokenStream {
quote! {
#( #docs )*
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(#typ)]
pub enum #name {
#( #variants )*
Expand Down
1 change: 1 addition & 0 deletions font-codegen/src/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ pub(crate) fn generate_compile_impl(
Ok(quote! {
#( #docs )*
#[derive(Clone, Debug, #maybe_derive_default PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct #name <#generic_param> {
#( #field_decls, )*
}
Expand Down
2 changes: 2 additions & 0 deletions font-codegen/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ pub(crate) fn generate_group_compile(
Ok(quote! {
#( #docs)*
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum #name {
#( #variant_decls, )*
}
Expand Down Expand Up @@ -498,6 +499,7 @@ pub(crate) fn generate_format_compile(
Ok(quote! {
#( #docs )*
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum #name {
#( #variants ),*
}
Expand Down
2 changes: 2 additions & 0 deletions read-fonts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ codegen_test = []
scaler_test = []
traversal = ["std"]
default = ["traversal"]
serde = ["dep:serde", "font-types/serde"]

[dependencies]
font-types = { version = "0.3.4", path = "../font-types" }
serde = { version = "1.0", features = ["derive"], optional = true }

[dev-dependencies]
font-test-data = { path = "../font-test-data" }
1 change: 1 addition & 0 deletions read-fonts/generated/generated_cmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ impl<'a> SomeRecord<'a> for EncodingRecord {

/// <https://docs.microsoft.com/en-us/typography/opentype/spec/cmap#platform-ids>
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(u16)]
pub enum PlatformId {
#[default]
Expand Down
2 changes: 2 additions & 0 deletions read-fonts/generated/generated_colr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,7 @@ impl<'a> std::fmt::Debug for VarColorLine<'a> {

/// [Extend](https://learn.microsoft.com/en-us/typography/opentype/spec/colr#color-references-colorstop-and-colorline) enumeration
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(u8)]
pub enum Extend {
#[default]
Expand Down Expand Up @@ -5510,6 +5511,7 @@ impl<'a> std::fmt::Debug for PaintComposite<'a> {

/// [CompositeMode](https://learn.microsoft.com/en-us/typography/opentype/spec/colr#format-32-paintcomposite) enumeration
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(u8)]
pub enum CompositeMode {
Clear = 0,
Expand Down
1 change: 1 addition & 0 deletions read-fonts/generated/generated_gdef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ impl<'a> std::fmt::Debug for Gdef<'a> {

/// Used in the [Glyph Class Definition Table](https://docs.microsoft.com/en-us/typography/opentype/spec/gdef#glyph-class-definition-table)
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(u16)]
pub enum GlyphClassDef {
#[default]
Expand Down
2 changes: 2 additions & 0 deletions read-fonts/generated/generated_glyf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ impl<'a> std::fmt::Debug for SimpleGlyph<'a> {

/// Flags used in [SimpleGlyph]
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct SimpleGlyphFlags {
bits: u8,
}
Expand Down Expand Up @@ -726,6 +727,7 @@ impl<'a> std::fmt::Debug for CompositeGlyph<'a> {

/// Flags used in [CompositeGlyph]
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct CompositeGlyphFlags {
bits: u16,
}
Expand Down
1 change: 1 addition & 0 deletions read-fonts/generated/generated_gpos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ impl<'a> SomeTable<'a> for PositionLookup<'a> {

/// See [ValueRecord]
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ValueFormat {
bits: u16,
}
Expand Down
1 change: 1 addition & 0 deletions read-fonts/generated/generated_gvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ impl<'a> std::fmt::Debug for Gvar<'a> {
}

#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct GvarFlags {
bits: u16,
}
Expand Down
1 change: 1 addition & 0 deletions read-fonts/generated/generated_head.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::codegen_prelude::*;

/// The `macStyle` field for the head table.
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct MacStyle {
bits: u16,
}
Expand Down
1 change: 1 addition & 0 deletions read-fonts/generated/generated_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3525,6 +3525,7 @@ impl<'a> SomeTable<'a> for ChainedSequenceContext<'a> {
/// [Device](https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#device-and-variationindex-tables)
/// delta formats
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(u16)]
pub enum DeltaFormat {
/// Signed 2-bit value, 8 values per uint16
Expand Down
1 change: 1 addition & 0 deletions read-fonts/generated/generated_os2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::codegen_prelude::*;

/// OS/2 [selection flags](https://learn.microsoft.com/en-us/typography/opentype/spec/os2#fsselection)
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct SelectionFlags {
bits: u16,
}
Expand Down
1 change: 1 addition & 0 deletions read-fonts/generated/generated_stat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ impl<'a> SomeRecord<'a> for AxisValueRecord {

/// [Axis value table flags](https://docs.microsoft.com/en-us/typography/opentype/spec/stat#flags).
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct AxisValueTableFlags {
bits: u16,
}
Expand Down
2 changes: 2 additions & 0 deletions read-fonts/generated/generated_test_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use crate::codegen_prelude::*;

#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(u16)]
pub enum MyEnum1 {
/// doc me baby
Expand Down Expand Up @@ -49,6 +50,7 @@ impl<'a> From<MyEnum1> for FieldType<'a> {
}

#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(u16)]
pub enum MyEnum2 {
ItsATwo = 2,
Expand Down
1 change: 1 addition & 0 deletions read-fonts/generated/generated_test_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::codegen_prelude::*;

/// Some flags!
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ValueFormat {
bits: u16,
}
Expand Down
1 change: 1 addition & 0 deletions read-fonts/generated/generated_variations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ impl<'a> SomeTable<'a> for DeltaSetIndexMap<'a> {

/// Entry format for a [DeltaSetIndexMap].
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct EntryFormat {
bits: u8,
}
Expand Down
1 change: 1 addition & 0 deletions read-fonts/src/tables/lookupflag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/// The [LookupFlag](https://learn.microsoft.com/en-us/typography/opentype/spec/chapter2#lookupFlag) bit enumeration.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct LookupFlag(u16);

impl LookupFlag {
Expand Down
2 changes: 2 additions & 0 deletions read-fonts/src/tables/variations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub struct DeltaSetIndex {
}

#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct TupleIndex(u16);

impl TupleIndex {
Expand Down Expand Up @@ -97,6 +98,7 @@ impl types::Scalar for TupleIndex {
///
/// [header]: https://learn.microsoft.com/en-us/typography/opentype/spec/otvarcommonformats#tuple-variation-store-header
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct TupleVariationCount(u16);

impl TupleVariationCount {
Expand Down
3 changes: 3 additions & 0 deletions write-fonts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ categories = ["text-processing", "parsing", "graphics"]
[features]
default = ["dot2"]
read = []
serde = ["dep:serde", "font-types/serde", "read-fonts/serde"]

[dependencies]
font-types = { version = "0.3.4", path = "../font-types" }
read-fonts = { version = "0.10.0", path = "../read-fonts" }
log = "0.4"
kurbo = "0.9.4"
dot2 = { version = "1.0", optional = true }
serde = { version = "1.0", features = ["derive"], optional = true }

[dev-dependencies]
diff = "0.1.12"
Expand All @@ -27,3 +29,4 @@ read-fonts = { version = "0.10.0", path = "../read-fonts", features = [ "codegen
env_logger = "0.10.0"
rstest = "0.18.0"
pretty_assertions.workspace = true
bincode = "1.0"
3 changes: 3 additions & 0 deletions write-fonts/generated/generated_avar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::codegen_prelude::*;

/// The [avar (Axis Variations)](https://docs.microsoft.com/en-us/typography/opentype/spec/avar) table
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Avar {
/// The segment maps array — one segment map for each axis, in the order of axes specified in the 'fvar' table.
pub axis_segment_maps: Vec<SegmentMaps>,
Expand Down Expand Up @@ -69,6 +70,7 @@ impl<'a> FontRead<'a> for Avar {

/// [SegmentMaps](https://learn.microsoft.com/en-us/typography/opentype/spec/avar#table-formats) record
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct SegmentMaps {
/// The array of axis value map records for this axis.
pub axis_value_maps: Vec<AxisValueMap>,
Expand Down Expand Up @@ -117,6 +119,7 @@ impl FromObjRef<read_fonts::tables::avar::SegmentMaps<'_>> for SegmentMaps {

/// [AxisValueMap](https://learn.microsoft.com/en-us/typography/opentype/spec/avar#table-formats) record
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct AxisValueMap {
/// A normalized coordinate value obtained using default normalization.
pub from_coordinate: F2Dot14,
Expand Down
14 changes: 14 additions & 0 deletions write-fonts/generated/generated_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::codegen_prelude::*;

/// The [BASE](https://learn.microsoft.com/en-us/typography/opentype/spec/base) (Baseline) table
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Base {
/// Offset to horizontal Axis table, from beginning of BASE table (may be NULL)
pub horiz_axis: NullableOffsetMarker<Axis>,
Expand Down Expand Up @@ -83,6 +84,7 @@ impl<'a> FontRead<'a> for Base {

/// [Axis Table](https://learn.microsoft.com/en-us/typography/opentype/spec/base#axis-tables-horizaxis-and-vertaxis)
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Axis {
/// Offset to BaseTagList table, from beginning of Axis table (may
/// be NULL)
Expand Down Expand Up @@ -143,6 +145,7 @@ impl<'a> FontRead<'a> for Axis {

/// [BaseTagList Table](https://learn.microsoft.com/en-us/typography/opentype/spec/base#basetaglist-table)
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct BaseTagList {
/// Array of 4-byte baseline identification tags — must be in
/// alphabetical order
Expand Down Expand Up @@ -200,6 +203,7 @@ impl<'a> FontRead<'a> for BaseTagList {

/// [BaseScriptList Table](https://learn.microsoft.com/en-us/typography/opentype/spec/base#basescriptlist-table)
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct BaseScriptList {
/// Array of BaseScriptRecords, in alphabetical order by
/// baseScriptTag
Expand Down Expand Up @@ -259,6 +263,7 @@ impl<'a> FontRead<'a> for BaseScriptList {

/// [BaseScriptRecord](https://learn.microsoft.com/en-us/typography/opentype/spec/base#basescriptrecord)
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct BaseScriptRecord {
/// 4-byte script identification tag
pub base_script_tag: Tag,
Expand Down Expand Up @@ -310,6 +315,7 @@ impl FromObjRef<read_fonts::tables::base::BaseScriptRecord> for BaseScriptRecord

/// [BaseScript Table](https://learn.microsoft.com/en-us/typography/opentype/spec/base#basescript-table)
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct BaseScript {
/// Offset to BaseValues table, from beginning of BaseScript table (may be NULL)
pub base_values: NullableOffsetMarker<BaseValues>,
Expand Down Expand Up @@ -388,6 +394,7 @@ impl<'a> FontRead<'a> for BaseScript {

/// [BaseLangSysRecord](https://learn.microsoft.com/en-us/typography/opentype/spec/base#baselangsysrecord)
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct BaseLangSysRecord {
/// 4-byte language system identification tag
pub base_lang_sys_tag: Tag,
Expand Down Expand Up @@ -439,6 +446,7 @@ impl FromObjRef<read_fonts::tables::base::BaseLangSysRecord> for BaseLangSysReco

/// [BaseValues](https://learn.microsoft.com/en-us/typography/opentype/spec/base#basevalues-table) table
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct BaseValues {
/// Index number of default baseline for this script — equals
/// index position of baseline tag in baselineTags array of the
Expand Down Expand Up @@ -504,6 +512,7 @@ impl<'a> FontRead<'a> for BaseValues {

/// [MinMax](https://learn.microsoft.com/en-us/typography/opentype/spec/base#minmax-table) table
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct MinMax {
/// Offset to BaseCoord table that defines the minimum extent
/// value, from the beginning of MinMax table (may be NULL)
Expand Down Expand Up @@ -584,6 +593,7 @@ impl<'a> FontRead<'a> for MinMax {

/// [FeatMinMaxRecord](https://learn.microsoft.com/en-us/typography/opentype/spec/base#baselangsysrecord)
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct FeatMinMaxRecord {
/// 4-byte feature identification tag — must match feature tag in
/// FeatureList
Expand Down Expand Up @@ -649,6 +659,7 @@ impl FromObjRef<read_fonts::tables::base::FeatMinMaxRecord> for FeatMinMaxRecord
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum BaseCoord {
Format1(BaseCoordFormat1),
Format2(BaseCoordFormat2),
Expand Down Expand Up @@ -748,6 +759,7 @@ impl From<BaseCoordFormat3> for BaseCoord {

/// [BaseCoordFormat1](https://learn.microsoft.com/en-us/typography/opentype/spec/base#basecoord-format-1)
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct BaseCoordFormat1 {
/// X or Y value, in design units
pub coordinate: i16,
Expand Down Expand Up @@ -794,6 +806,7 @@ impl<'a> FontRead<'a> for BaseCoordFormat1 {

/// [BaseCoordFormat2](https://learn.microsoft.com/en-us/typography/opentype/spec/base#basecoord-format-2)
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct BaseCoordFormat2 {
/// X or Y value, in design units
pub coordinate: i16,
Expand Down Expand Up @@ -852,6 +865,7 @@ impl<'a> FontRead<'a> for BaseCoordFormat2 {

/// [BaseCoordFormat3](https://learn.microsoft.com/en-us/typography/opentype/spec/base#basecoord-format-3)
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct BaseCoordFormat3 {
/// X or Y value, in design units
pub coordinate: i16,
Expand Down
1 change: 1 addition & 0 deletions write-fonts/generated/generated_cff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::codegen_prelude::*;

/// [Compact Font Format](https://learn.microsoft.com/en-us/typography/opentype/spec/cff) table header
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct CffHeader {
/// Header size (bytes).
pub hdr_size: u8,
Expand Down
1 change: 1 addition & 0 deletions write-fonts/generated/generated_cff2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::codegen_prelude::*;

/// [Compact Font Format (CFF) version 2](https://learn.microsoft.com/en-us/typography/opentype/spec/cff2) table header
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Cff2Header {
/// Header size (bytes).
pub header_size: u8,
Expand Down
Loading

0 comments on commit 0af4ac3

Please sign in to comment.