Enum tfm::pl::ast::FontDimension
source · pub enum FontDimension {
NamedParam(NamedParameter, SingleValue<FixWord>),
IndexedParam(TupleValue<ParameterNumber, FixWord>),
Comment(String),
}
Expand description
An element of a FONTDIMEN
property list.
The property names allowed in a FONTDIMEN
property list correspond to various TeX parameters,
each of which has a (real) numeric value.
All of the parameters except SLANT
are in design units.
The documentation on each variant is based on the documentation in PFtoTF.2014.11.
Variants§
NamedParam(NamedParameter, SingleValue<FixWord>)
A named parameters like (SLANT R -.25)
.
IndexedParam(TupleValue<ParameterNumber, FixWord>)
The notation PARAMETER n
provides another way to specify the nth parameter;
for example, (PARAMETER D 1 R −.25)
is another way to specify that the SLANT
is −0.25.
The value of n must be strictly positive and less than max param words.
Comment(String)
A comment that is ignored.
Implementations§
source§impl FontDimension
impl FontDimension
pub const SLANT: &'static str = "SLANT"
pub const SPACE: &'static str = "SPACE"
pub const STRETCH: &'static str = "STRETCH"
pub const SHRINK: &'static str = "SHRINK"
pub const X_HEIGHT: &'static str = "XHEIGHT"
pub const QUAD: &'static str = "QUAD"
pub const EXTRA_SPACE: &'static str = "EXTRASPACE"
pub const NUM_1: &'static str = "NUM1"
pub const NUM_2: &'static str = "NUM2"
pub const NUM_3: &'static str = "NUM3"
pub const DENOM_1: &'static str = "DENOM1"
pub const DENOM_2: &'static str = "DENOM2"
pub const SUP_1: &'static str = "SUP1"
pub const SUP_2: &'static str = "SUP2"
pub const SUP_3: &'static str = "SUP3"
pub const SUB_1: &'static str = "SUB1"
pub const SUB_2: &'static str = "SUB2"
pub const SUP_DROP: &'static str = "SUPDROP"
pub const SUB_DROP: &'static str = "SUBDROP"
pub const DELIM_1: &'static str = "DELIM1"
pub const DELIM_2: &'static str = "DELIM2"
pub const AXIS_HEIGHT: &'static str = "AXISHEIGHT"
pub const DEFAULT_RULE_THICKNESS: &'static str = "DEFAULTRULETHICKNESS"
pub const BIG_OP_SPACING_1: &'static str = "BIGOPSPACING1"
pub const BIG_OP_SPACING_2: &'static str = "BIGOPSPACING2"
pub const BIG_OP_SPACING_3: &'static str = "BIGOPSPACING3"
pub const BIG_OP_SPACING_4: &'static str = "BIGOPSPACING4"
pub const BIG_OP_SPACING_5: &'static str = "BIGOPSPACING5"
pub const PARAMETER: &'static str = "PARAMETER"
pub const ALL_PROPERTY_NAMES: &'static [&'static str] = _
source§impl FontDimension
impl FontDimension
pub fn lower(self, char_display_format: CharDisplayFormat) -> Node
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for FontDimension
impl<'arbitrary> Arbitrary<'arbitrary> for FontDimension
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read moresource§impl Debug for FontDimension
impl Debug for FontDimension
source§impl PartialEq for FontDimension
impl PartialEq for FontDimension
impl Eq for FontDimension
impl StructuralPartialEq for FontDimension
Auto Trait Implementations§
impl Freeze for FontDimension
impl RefUnwindSafe for FontDimension
impl Send for FontDimension
impl Sync for FontDimension
impl Unpin for FontDimension
impl UnwindSafe for FontDimension
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
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute
] value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
[Quirk
] value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition
] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);