Enum read_fonts::traversal::FieldType

source ·
pub enum FieldType<'a> {
Show 24 variants I8(i8), U8(u8), I16(i16), U16(u16), I32(i32), U32(u32), U24(Uint24), Tag(Tag), FWord(FWord), UfWord(UfWord), MajorMinor(MajorMinor), Version16Dot16(Version16Dot16), F2Dot14(F2Dot14), Fixed(Fixed), LongDateTime(LongDateTime), GlyphId(GlyphId), NameId(NameId), BareOffset(OffsetType), ResolvedOffset(ResolvedOffset<'a>), StringOffset(StringOffset<'a>), ArrayOffset(ArrayOffset<'a>), Record(RecordResolver<'a>), Array(Box<dyn SomeArray<'a> + 'a>), Unknown,
}
Expand description

Types of fields in font tables.

Fields can either be scalars, offsets to tables, or arrays.

Variants§

§

I8(i8)

§

U8(u8)

§

I16(i16)

§

U16(u16)

§

I32(i32)

§

U32(u32)

§

U24(Uint24)

§

Tag(Tag)

§

FWord(FWord)

§

UfWord(UfWord)

§

MajorMinor(MajorMinor)

§

Version16Dot16(Version16Dot16)

§

F2Dot14(F2Dot14)

§

Fixed(Fixed)

§

LongDateTime(LongDateTime)

§

GlyphId(GlyphId)

§

NameId(NameId)

§

BareOffset(OffsetType)

§

ResolvedOffset(ResolvedOffset<'a>)

§

StringOffset(StringOffset<'a>)

Used in tables like name/post so we can actually print the strings

§

ArrayOffset(ArrayOffset<'a>)

Used in COLR/CPAL

§

Record(RecordResolver<'a>)

§

Array(Box<dyn SomeArray<'a> + 'a>)

§

Unknown

Implementations§

source§

impl<'a> FieldType<'a>

source

pub fn array_of_records<T>( type_name: &'static str, records: &'a [T], data: FontData<'a> ) -> FieldType<'a>
where T: Clone + SomeRecord<'a> + 'a,

makes a field, handling the case where this array may not be present in all versions

source

pub fn computed_array<T>( type_name: &'static str, array: ComputedArray<'a, T>, data: FontData<'a> ) -> FieldType<'a>
where T: FontReadWithArgs<'a> + ComputeSize + SomeRecord<'a> + 'a, T::Args: Copy + 'static,

source

pub fn var_array<T>( type_name: &'static str, array: VarLenArray<'a, T>, data: FontData<'a> ) -> FieldType<'a>
where T: FontRead<'a> + VarSize + SomeRecord<'a> + 'a,

source

pub fn array_of_offsets<O>( type_name: &'static str, offsets: &'a [O], resolver: impl Fn(&O) -> FieldType<'a> + 'a ) -> Self

Convenience method for creating a FieldType from an array of offsets.

The resolver argument is a function that takes an offset and resolves it.

source

pub fn offset_to_array_of_scalars<T: SomeArray<'a> + 'a>( offset: impl Into<OffsetType>, result: impl Into<Option<Result<T, ReadError>>> ) -> Self

Convenience method for creating a FieldType from an offset to an array.

source

pub fn offset_to_array_of_records<T: Clone + SomeRecord<'a> + 'a>( offset: impl Into<OffsetType>, result: impl Into<Option<Result<&'a [T], ReadError>>>, type_name: &'static str, data: FontData<'a> ) -> Self

Convenience method for creating a FieldType from an offset to an array.

source

pub fn offset<T: SomeTable<'a> + 'a>( offset: impl Into<OffsetType>, result: impl Into<Option<Result<T, ReadError>>> ) -> Self

Convenience method for creating a FieldType for a resolved offset.

This handles cases where offsets are nullable, in which case the result argument may be None.

source

pub fn unknown_offset(offset: impl Into<OffsetType>) -> Self

Convenience method for creating a FieldType from an unknown offset.

Trait Implementations§

source§

impl<'a> Debug for FieldType<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<AxisValueTableFlags> for FieldType<'a>

source§

fn from(src: AxisValueTableFlags) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<BitmapFlags> for FieldType<'a>

source§

fn from(src: BitmapFlags) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<CompositeGlyphFlags> for FieldType<'a>

source§

fn from(src: CompositeGlyphFlags) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<CompositeMode> for FieldType<'a>

source§

fn from(src: CompositeMode) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<DeltaFormat> for FieldType<'a>

source§

fn from(src: DeltaFormat) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<EntryFormat> for FieldType<'a>

source§

fn from(src: EntryFormat) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<Extend> for FieldType<'a>

source§

fn from(src: Extend) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<F2Dot14> for FieldType<'a>

source§

fn from(src: F2Dot14) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<FWord> for FieldType<'a>

source§

fn from(src: FWord) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<Fixed> for FieldType<'a>

source§

fn from(src: Fixed) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<GaspRangeBehavior> for FieldType<'a>

source§

fn from(src: GaspRangeBehavior) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<GlyphClassDef> for FieldType<'a>

source§

fn from(src: GlyphClassDef) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<GlyphId> for FieldType<'a>

source§

fn from(src: GlyphId) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<GvarFlags> for FieldType<'a>

source§

fn from(src: GvarFlags) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<HeaderFlags> for FieldType<'a>

source§

fn from(src: HeaderFlags) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<LongDateTime> for FieldType<'a>

source§

fn from(src: LongDateTime) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<MacStyle> for FieldType<'a>

source§

fn from(src: MacStyle) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<MajorMinor> for FieldType<'a>

source§

fn from(src: MajorMinor) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<NameId> for FieldType<'a>

source§

fn from(src: NameId) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<Offset16> for FieldType<'a>

source§

fn from(src: Offset16) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<Offset24> for FieldType<'a>

source§

fn from(src: Offset24) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<Offset32> for FieldType<'a>

source§

fn from(src: Offset32) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<PaletteType> for FieldType<'a>

source§

fn from(src: PaletteType) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<PlatformId> for FieldType<'a>

source§

fn from(src: PlatformId) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<RecordResolver<'a>> for FieldType<'a>

source§

fn from(src: RecordResolver<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<SelectionFlags> for FieldType<'a>

source§

fn from(src: SelectionFlags) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<SimpleGlyphFlags> for FieldType<'a>

source§

fn from(src: SimpleGlyphFlags) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a, T: SomeArray<'a> + 'a> From<T> for FieldType<'a>

source§

fn from(src: T) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Tag> for FieldType<'a>

source§

fn from(src: Tag) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<UfWord> for FieldType<'a>

source§

fn from(src: UfWord) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<Uint24> for FieldType<'a>

source§

fn from(src: Uint24) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<ValueFormat> for FieldType<'a>

source§

fn from(src: ValueFormat) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<Version16Dot16> for FieldType<'a>

source§

fn from(src: Version16Dot16) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<i16> for FieldType<'a>

source§

fn from(src: i16) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<i32> for FieldType<'a>

source§

fn from(src: i32) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<i8> for FieldType<'a>

source§

fn from(src: i8) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<u16> for FieldType<'a>

source§

fn from(src: u16) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<u32> for FieldType<'a>

source§

fn from(src: u32) -> FieldType<'a>

Converts to this type from the input type.
source§

impl<'a> From<u8> for FieldType<'a>

source§

fn from(src: u8) -> FieldType<'a>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for FieldType<'a>

§

impl<'a> !RefUnwindSafe for FieldType<'a>

§

impl<'a> !Send for FieldType<'a>

§

impl<'a> !Sync for FieldType<'a>

§

impl<'a> Unpin for FieldType<'a>

§

impl<'a> !UnwindSafe for FieldType<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.