Font

Struct Font 

Source
pub struct Font {
Show 27 fields pub m_Ascent: f32, pub m_AsciiStartOffset: i32, pub m_CharacterRects: Vec<CharacterInfo>, pub m_ConvertCase: i32, pub m_DefaultMaterial: PPtr, pub m_DefaultStyle: u32, pub m_FontData: Vec<char>, pub m_FontNames: Vec<String>, pub m_FontSize: f32, pub m_KerningValues: Vec<((u16, u16), f32)>, pub m_LineSpacing: f32, pub m_Name: String, pub m_Texture: PPtr, pub m_CharacterPadding: Option<i32>, pub m_CharacterSpacing: Option<i32>, pub m_Descent: Option<f32>, pub m_FallbackFonts: Option<Vec<PPtr>>, pub m_FontCountX: Option<i32>, pub m_FontCountY: Option<i32>, pub m_FontRenderingMode: Option<i32>, pub m_GridFont: Option<bool>, pub m_Kerning: Option<f32>, pub m_PerCharacterKerning: Option<Vec<(i32, f32)>>, pub m_PixelScale: Option<f32>, pub m_ShouldRoundAdvanceValue: Option<bool>, pub m_Tracking: Option<f32>, pub m_UseLegacyBoundsCalculation: Option<bool>,
}
Expand description

Font is a class of the Unity engine since version 3.4.0. Exert from Unity’s scripting documentation: Script interface for font assets. You can use this class to dynamically switch fonts on Text Meshes.See Also: TextMesh.

Fields§

§m_Ascent: f32

The ascent of the font.

§m_AsciiStartOffset: i32§m_CharacterRects: Vec<CharacterInfo>§m_ConvertCase: i32§m_DefaultMaterial: PPtr

PPtr<Material>: (3.4.0 - 2022.3.2f1)

§m_DefaultStyle: u32§m_FontData: Vec<char>§m_FontNames: Vec<String>§m_FontSize: f32

The default size of the font.

§m_KerningValues: Vec<((u16, u16), f32)>§m_LineSpacing: f32§m_Name: String

The name of the object.

§m_Texture: PPtr

PPtr<Texture>: (3.4.0 - 2022.3.2f1)

§m_CharacterPadding: Option<i32>

i32: (4.0.0 - 2022.3.2f1)

§m_CharacterSpacing: Option<i32>

i32: (4.0.0 - 2022.3.2f1)

§m_Descent: Option<f32>

f32: (5.4.0f3 - 2022.3.2f1)

§m_FallbackFonts: Option<Vec<PPtr>>

Vec<PPtr<Font>>: (4.0.0 - 2022.3.2f1)

§m_FontCountX: Option<i32>

i32: (3.4.0 - 3.5.7)

§m_FontCountY: Option<i32>

i32: (3.4.0 - 3.5.7)

§m_FontRenderingMode: Option<i32>

i32: (4.0.0 - 2022.3.2f1)

§m_GridFont: Option<bool>

bool: (3.4.0 - 3.5.7)

§m_Kerning: Option<f32>

f32: (3.4.0 - 5.2.5f1)

§m_PerCharacterKerning: Option<Vec<(i32, f32)>>

Vec<(i32, f32)>: (3.4.0 - 3.5.7)

§m_PixelScale: Option<f32>

f32: (4.0.0 - 2022.3.2f1)

§m_ShouldRoundAdvanceValue: Option<bool>

bool: (2018.1.0b2 - 2022.3.2f1)

§m_Tracking: Option<f32>

f32: (5.3.0f1 - 2022.3.2f1)

§m_UseLegacyBoundsCalculation: Option<bool>

bool: (5.6.5f1 - 2022.3.2f1)

Trait Implementations§

Source§

impl Debug for Font

Source§

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

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

impl<'de> Deserialize<'de> for Font

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Font

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Font

§

impl RefUnwindSafe for Font

§

impl Send for Font

§

impl Sync for Font

§

impl Unpin for Font

§

impl UnwindSafe for Font

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>,

Source§

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>,

Source§

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,