From c3e0e6d5bd0531a039429605167e1ab156dd359d Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Tue, 21 Nov 2023 18:44:16 +0000 Subject: [PATCH] move nullable attribute to where it belongs --- read-fonts/generated/generated_stat.rs | 4 ++-- resources/codegen_inputs/stat.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/read-fonts/generated/generated_stat.rs b/read-fonts/generated/generated_stat.rs index 8e66cc0e7..5351dc5a2 100644 --- a/read-fonts/generated/generated_stat.rs +++ b/read-fonts/generated/generated_stat.rs @@ -121,13 +121,13 @@ impl<'a> Stat<'a> { /// start of the design axes value offsets array. If axisValueCount /// is zero, set to zero; if axisValueCount is greater than zero, /// must be greater than zero. - pub fn offset_to_axis_value_offsets(&self) -> Offset32 { + pub fn offset_to_axis_value_offsets(&self) -> Nullable { let range = self.shape.offset_to_axis_value_offsets_byte_range(); self.data.read_at(range.start).unwrap() } /// Attempt to resolve [`offset_to_axis_value_offsets`][Self::offset_to_axis_value_offsets]. - pub fn offset_to_axis_values(&self) -> Result, ReadError> { + pub fn offset_to_axis_values(&self) -> Option, ReadError>> { let data = self.data; let args = self.axis_value_count(); self.offset_to_axis_value_offsets() diff --git a/resources/codegen_inputs/stat.rs b/resources/codegen_inputs/stat.rs index 97f19e11d..b2a07c9da 100644 --- a/resources/codegen_inputs/stat.rs +++ b/resources/codegen_inputs/stat.rs @@ -24,15 +24,15 @@ table Stat { #[read_offset_with($design_axis_count)] design_axes_offset: Offset32<[AxisRecord]>, /// The number of axis value tables. - #[nullable] #[compile(array_len($offset_to_axis_value_offsets))] axis_value_count: u16, /// Offset in bytes from the beginning of the STAT table to the /// start of the design axes value offsets array. If axisValueCount /// is zero, set to zero; if axisValueCount is greater than zero, /// must be greater than zero. + #[nullable] #[read_offset_with($axis_value_count)] - #[compile_type(OffsetMarker>, WIDTH_32>)] + #[compile_type(NullableOffsetMarker>, WIDTH_32>)] #[to_owned(convert_axis_value_offsets(obj.offset_to_axis_values()))] offset_to_axis_value_offsets: Offset32, /// Name ID used as fallback when projection of names into a