pub struct TextStyle {
pub absolute_x: Option<StyleValue>,
pub absolute_y: Option<StyleValue>,
pub relative_x: Option<StyleValue>,
pub relative_y: Option<StyleValue>,
pub font_family: Option<Vec<String>>,
pub font_size: Option<StyleValue>,
pub color: Option<String>,
/* private fields */
}Expand description
Where a piece of text stands and how it is drawn: music21’s
TextStyle, the part of it MusicXML’s print style, alignment and
justification say.
Fields§
§absolute_x: Option<StyleValue>Across from where it is placed, in tenths: absoluteX,
MusicXML’s default-x.
absolute_y: Option<StyleValue>Up from where it is placed: absoluteY, default-y.
relative_x: Option<StyleValue>Across from its default place: relativeX, relative-x.
relative_y: Option<StyleValue>Up from its default place: relativeY, relative-y.
font_family: Option<Vec<String>>The fonts it may be set in, first choice first: fontFamily.
font_size: Option<StyleValue>Its size, in points or as a CSS size: fontSize.
color: Option<String>Its colour, as written: color.
Implementations§
Source§impl TextStyle
impl TextStyle
Sourcepub fn font_style(&self) -> Option<&str>
pub fn font_style(&self) -> Option<&str>
italic, normal, bold or bolditalic: music21’s fontStyle.
Sourcepub fn font_weight(&self) -> Option<&str>
pub fn font_weight(&self) -> Option<&str>
normal or bold: music21’s fontWeight.
Sourcepub fn align_horizontal(&self) -> Option<&str>
pub fn align_horizontal(&self) -> Option<&str>
left, right or center: music21’s alignHorizontal, MusicXML’s
halign.
Sourcepub fn align_vertical(&self) -> Option<&str>
pub fn align_vertical(&self) -> Option<&str>
top, middle, bottom or baseline: music21’s alignVertical,
MusicXML’s valign.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TextStyle
Available on crate feature serde only.
impl<'de> Deserialize<'de> for TextStyle
Available on crate feature
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for TextStyle
Auto Trait Implementations§
impl Freeze for TextStyle
impl RefUnwindSafe for TextStyle
impl Send for TextStyle
impl Sync for TextStyle
impl Unpin for TextStyle
impl UnsafeUnpin for TextStyle
impl UnwindSafe for TextStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more