Enum read_fonts::traversal::FieldType
source · [−]pub enum FieldType<'a> {
Show 22 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),
BareOffset(OffsetType),
ResolvedOffset(ResolvedOffset<'a>),
StringOffset(StringOffset<'a>),
Record(RecordResolver<'a>),
ValueRecord(ValueRecord),
Array(Box<dyn SomeArray<'a> + 'a>),
}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)
BareOffset(OffsetType)
ResolvedOffset(ResolvedOffset<'a>)
StringOffset(StringOffset<'a>)
Used in tables like name/post so we can actually print the strings
Record(RecordResolver<'a>)
ValueRecord(ValueRecord)
Array(Box<dyn SomeArray<'a> + 'a>)
Implementations
sourceimpl<'a> FieldType<'a>
impl<'a> FieldType<'a>
sourcepub fn array_of_records<T>(
type_name: &'static str,
records: &'a [T],
data: FontData<'a>
) -> FieldType<'a>where
T: Clone + SomeRecord<'a> + 'a,
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
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,
sourcepub fn offset_array<O>(
type_name: &'static str,
offsets: &'a [O],
resolver: impl Fn(&O) -> FieldType<'a> + 'a
) -> Self
pub fn offset_array<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 offests.
The resolver argument is a function that takes an offset and resolves
it.
sourcepub fn offset<T: SomeTable<'a> + 'a>(
offset: impl Into<OffsetType>,
result: impl Into<Option<Result<T, ReadError>>>
) -> Self
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.
sourcepub fn unknown_offset(offset: impl Into<OffsetType>) -> Self
pub fn unknown_offset(offset: impl Into<OffsetType>) -> Self
Convenience method for creating a FieldType from an unknown offset.
Trait Implementations
sourceimpl<'a> From<CompositeGlyphFlags> for FieldType<'a>
impl<'a> From<CompositeGlyphFlags> for FieldType<'a>
sourcefn from(src: CompositeGlyphFlags) -> FieldType<'a>
fn from(src: CompositeGlyphFlags) -> FieldType<'a>
Converts to this type from the input type.
sourceimpl<'a> From<DeltaFormat> for FieldType<'a>
impl<'a> From<DeltaFormat> for FieldType<'a>
sourcefn from(src: DeltaFormat) -> FieldType<'a>
fn from(src: DeltaFormat) -> FieldType<'a>
Converts to this type from the input type.
sourceimpl<'a> From<GlyphClassDef> for FieldType<'a>
impl<'a> From<GlyphClassDef> for FieldType<'a>
sourcefn from(src: GlyphClassDef) -> FieldType<'a>
fn from(src: GlyphClassDef) -> FieldType<'a>
Converts to this type from the input type.
sourceimpl<'a> From<LongDateTime> for FieldType<'a>
impl<'a> From<LongDateTime> for FieldType<'a>
sourcefn from(src: LongDateTime) -> FieldType<'a>
fn from(src: LongDateTime) -> FieldType<'a>
Converts to this type from the input type.
sourceimpl<'a> From<MajorMinor> for FieldType<'a>
impl<'a> From<MajorMinor> for FieldType<'a>
sourcefn from(src: MajorMinor) -> FieldType<'a>
fn from(src: MajorMinor) -> FieldType<'a>
Converts to this type from the input type.
sourceimpl<'a> From<PlatformId> for FieldType<'a>
impl<'a> From<PlatformId> for FieldType<'a>
sourcefn from(src: PlatformId) -> FieldType<'a>
fn from(src: PlatformId) -> FieldType<'a>
Converts to this type from the input type.
sourceimpl<'a> From<RecordResolver<'a>> for FieldType<'a>
impl<'a> From<RecordResolver<'a>> for FieldType<'a>
sourcefn from(src: RecordResolver<'a>) -> Self
fn from(src: RecordResolver<'a>) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<SimpleGlyphFlags> for FieldType<'a>
impl<'a> From<SimpleGlyphFlags> for FieldType<'a>
sourcefn from(src: SimpleGlyphFlags) -> FieldType<'a>
fn from(src: SimpleGlyphFlags) -> FieldType<'a>
Converts to this type from the input type.
sourceimpl<'a> From<ValueFormat> for FieldType<'a>
impl<'a> From<ValueFormat> for FieldType<'a>
sourcefn from(src: ValueFormat) -> FieldType<'a>
fn from(src: ValueFormat) -> FieldType<'a>
Converts to this type from the input type.
sourceimpl<'a> From<ValueRecord> for FieldType<'a>
impl<'a> From<ValueRecord> for FieldType<'a>
sourcefn from(src: ValueRecord) -> Self
fn from(src: ValueRecord) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<Version16Dot16> for FieldType<'a>
impl<'a> From<Version16Dot16> for FieldType<'a>
sourcefn from(src: Version16Dot16) -> FieldType<'a>
fn from(src: Version16Dot16) -> FieldType<'a>
Converts to this type from the input type.
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more