Struct cosmic::iced_winit::graphics::text::cosmic_text::rustybuzz::Face
source · pub struct Face<'a> { /* private fields */ }
Expand description
A font face handle.
Implementations§
source§impl<'a> hb_font_t<'a>
impl<'a> hb_font_t<'a>
sourcepub fn from_slice(data: &'a [u8], face_index: u32) -> Option<hb_font_t<'a>>
pub fn from_slice(data: &'a [u8], face_index: u32) -> Option<hb_font_t<'a>>
Creates a new Face
from data.
Data will be referenced, not owned.
sourcepub fn from_face(face: Face<'a>) -> hb_font_t<'a>
pub fn from_face(face: Face<'a>) -> hb_font_t<'a>
Creates a new [Face
] from ttf_parser::Face
.
Data will be referenced, not owned.
sourcepub fn units_per_em(&self) -> i32
pub fn units_per_em(&self) -> i32
Returns face’s units per EM.
sourcepub fn set_pixels_per_em(&mut self, ppem: Option<(u16, u16)>)
pub fn set_pixels_per_em(&mut self, ppem: Option<(u16, u16)>)
Sets pixels per EM.
Used during raster glyphs processing and hinting.
None
by default.
sourcepub fn set_points_per_em(&mut self, ptem: Option<f32>)
pub fn set_points_per_em(&mut self, ptem: Option<f32>)
Sets point size per EM.
Used for optical-sizing in Apple fonts.
None
by default.
sourcepub fn set_variations(&mut self, variations: &[Variation])
pub fn set_variations(&mut self, variations: &[Variation])
Sets font variations.
Methods from Deref<Target = Face<'a>>§
sourcepub fn tables(&self) -> &FaceTables<'a>
pub fn tables(&self) -> &FaceTables<'a>
Returns low-level face tables.
sourcepub fn raw_face(&self) -> &RawFace<'a>
pub fn raw_face(&self) -> &RawFace<'a>
Returns the RawFace
used to create this Face
.
Useful if you want to parse the data manually.
Available only for faces created using Face::parse()
.
sourcepub fn table_data(&self, tag: Tag) -> Option<&'a [u8]>
👎Deprecated since 0.16.0: use self.raw_face().table()
instead
pub fn table_data(&self, tag: Tag) -> Option<&'a [u8]>
self.raw_face().table()
insteadReturns the raw data of a selected table.
Useful if you want to parse the data manually.
Available only for faces created using Face::parse()
.
sourcepub fn names(&self) -> Names<'a>
pub fn names(&self) -> Names<'a>
Returns a list of names.
Contains face name and other strings.
sourcepub fn is_regular(&self) -> bool
pub fn is_regular(&self) -> bool
Checks that face is marked as Regular.
Returns false
when OS/2 table is not present.
sourcepub fn is_italic(&self) -> bool
pub fn is_italic(&self) -> bool
Checks that face is marked as Italic.
Returns false
when OS/2 table is not present.
sourcepub fn is_bold(&self) -> bool
pub fn is_bold(&self) -> bool
Checks that face is marked as Bold.
Returns false
when OS/2 table is not present.
sourcepub fn is_oblique(&self) -> bool
pub fn is_oblique(&self) -> bool
Checks that face is marked as Oblique.
Returns false
when OS/2 table is not present or when its version is < 4.
sourcepub fn is_monospaced(&self) -> bool
pub fn is_monospaced(&self) -> bool
Checks that face is marked as Monospaced.
Returns false
when post
table is not present.
sourcepub fn is_variable(&self) -> bool
pub fn is_variable(&self) -> bool
Checks that face is variable.
Simply checks the presence of a fvar
table.
sourcepub fn weight(&self) -> Weight
pub fn weight(&self) -> Weight
Returns face’s weight.
Returns Weight::Normal
when OS/2 table is not present.
sourcepub fn width(&self) -> Width
pub fn width(&self) -> Width
Returns face’s width.
Returns Width::Normal
when OS/2 table is not present or when value is invalid.
sourcepub fn italic_angle(&self) -> Option<f32>
pub fn italic_angle(&self) -> Option<f32>
Returns face’s italic angle.
Returns None
when post
table is not present.
sourcepub fn ascender(&self) -> i16
pub fn ascender(&self) -> i16
Returns a horizontal face ascender.
This method is affected by variation axes.
sourcepub fn descender(&self) -> i16
pub fn descender(&self) -> i16
Returns a horizontal face descender.
This method is affected by variation axes.
sourcepub fn line_gap(&self) -> i16
pub fn line_gap(&self) -> i16
Returns a horizontal face line gap.
This method is affected by variation axes.
sourcepub fn typographic_ascender(&self) -> Option<i16>
pub fn typographic_ascender(&self) -> Option<i16>
Returns a horizontal typographic face ascender.
Prefer Face::ascender
unless you explicitly want this. This is a more
low-level alternative.
This method is affected by variation axes.
Returns None
when OS/2 table is not present.
sourcepub fn typographic_descender(&self) -> Option<i16>
pub fn typographic_descender(&self) -> Option<i16>
Returns a horizontal typographic face descender.
Prefer Face::descender
unless you explicitly want this. This is a more
low-level alternative.
This method is affected by variation axes.
Returns None
when OS/2 table is not present.
sourcepub fn typographic_line_gap(&self) -> Option<i16>
pub fn typographic_line_gap(&self) -> Option<i16>
Returns a horizontal typographic face line gap.
Prefer Face::line_gap
unless you explicitly want this. This is a more
low-level alternative.
This method is affected by variation axes.
Returns None
when OS/2 table is not present.
sourcepub fn vertical_ascender(&self) -> Option<i16>
pub fn vertical_ascender(&self) -> Option<i16>
Returns a vertical face ascender.
This method is affected by variation axes.
sourcepub fn vertical_descender(&self) -> Option<i16>
pub fn vertical_descender(&self) -> Option<i16>
Returns a vertical face descender.
This method is affected by variation axes.
sourcepub fn vertical_height(&self) -> Option<i16>
pub fn vertical_height(&self) -> Option<i16>
Returns a vertical face height.
This method is affected by variation axes.
sourcepub fn vertical_line_gap(&self) -> Option<i16>
pub fn vertical_line_gap(&self) -> Option<i16>
Returns a vertical face line gap.
This method is affected by variation axes.
sourcepub fn units_per_em(&self) -> u16
pub fn units_per_em(&self) -> u16
Returns face’s units per EM.
Guarantee to be in a 16..=16384 range.
sourcepub fn x_height(&self) -> Option<i16>
pub fn x_height(&self) -> Option<i16>
Returns face’s x height.
This method is affected by variation axes.
Returns None
when OS/2 table is not present or when its version is < 2.
sourcepub fn capital_height(&self) -> Option<i16>
pub fn capital_height(&self) -> Option<i16>
Returns face’s capital height.
This method is affected by variation axes.
Returns None
when OS/2 table is not present or when its version is < 2.
sourcepub fn underline_metrics(&self) -> Option<LineMetrics>
pub fn underline_metrics(&self) -> Option<LineMetrics>
Returns face’s underline metrics.
This method is affected by variation axes.
Returns None
when post
table is not present.
sourcepub fn strikeout_metrics(&self) -> Option<LineMetrics>
pub fn strikeout_metrics(&self) -> Option<LineMetrics>
Returns face’s strikeout metrics.
This method is affected by variation axes.
Returns None
when OS/2 table is not present.
sourcepub fn subscript_metrics(&self) -> Option<ScriptMetrics>
pub fn subscript_metrics(&self) -> Option<ScriptMetrics>
Returns face’s subscript metrics.
This method is affected by variation axes.
Returns None
when OS/2 table is not present.
sourcepub fn superscript_metrics(&self) -> Option<ScriptMetrics>
pub fn superscript_metrics(&self) -> Option<ScriptMetrics>
Returns face’s superscript metrics.
This method is affected by variation axes.
Returns None
when OS/2 table is not present.
sourcepub fn permissions(&self) -> Option<Permissions>
pub fn permissions(&self) -> Option<Permissions>
Returns face permissions.
Returns None
in case of a malformed value.
sourcepub fn is_subsetting_allowed(&self) -> bool
pub fn is_subsetting_allowed(&self) -> bool
Checks if the face allows embedding a subset, further restricted by Self::permissions
.
sourcepub fn is_outline_embedding_allowed(&self) -> bool
pub fn is_outline_embedding_allowed(&self) -> bool
Checks if the face allows outline data to be embedded.
If false, only bitmaps may be embedded in accordance with Self::permissions
.
If the font contains no bitmaps and this flag is not set, it implies no embedding is allowed.
sourcepub fn unicode_ranges(&self) -> UnicodeRanges
pub fn unicode_ranges(&self) -> UnicodeRanges
Returns Unicode Ranges.
sourcepub fn number_of_glyphs(&self) -> u16
pub fn number_of_glyphs(&self) -> u16
Returns a total number of glyphs in the face.
Never zero.
The value was already parsed, so this function doesn’t involve any parsing.
sourcepub fn glyph_index(&self, code_point: char) -> Option<GlyphId>
pub fn glyph_index(&self, code_point: char) -> Option<GlyphId>
Resolves a Glyph ID for a code point.
Returns None
instead of 0
when glyph is not found.
All subtable formats except Mixed Coverage (8) are supported.
If you need a more low-level control, prefer Face::tables().cmap
.
sourcepub fn glyph_index_by_name(&self, name: &str) -> Option<GlyphId>
pub fn glyph_index_by_name(&self, name: &str) -> Option<GlyphId>
Resolves a Glyph ID for a glyph name.
Uses the post
and CFF
tables as sources.
Returns None
when no name is associated with a glyph
.
sourcepub fn glyph_variation_index(
&self,
code_point: char,
variation: char,
) -> Option<GlyphId>
pub fn glyph_variation_index( &self, code_point: char, variation: char, ) -> Option<GlyphId>
Resolves a variation of a Glyph ID from two code points.
Implemented according to Unicode Variation Sequences.
Returns None
instead of 0
when glyph is not found.
sourcepub fn glyph_hor_advance(&self, glyph_id: GlyphId) -> Option<u16>
pub fn glyph_hor_advance(&self, glyph_id: GlyphId) -> Option<u16>
Returns glyph’s horizontal advance.
This method is affected by variation axes.
sourcepub fn glyph_ver_advance(&self, glyph_id: GlyphId) -> Option<u16>
pub fn glyph_ver_advance(&self, glyph_id: GlyphId) -> Option<u16>
Returns glyph’s vertical advance.
This method is affected by variation axes.
sourcepub fn glyph_hor_side_bearing(&self, glyph_id: GlyphId) -> Option<i16>
pub fn glyph_hor_side_bearing(&self, glyph_id: GlyphId) -> Option<i16>
Returns glyph’s horizontal side bearing.
This method is affected by variation axes.
sourcepub fn glyph_ver_side_bearing(&self, glyph_id: GlyphId) -> Option<i16>
pub fn glyph_ver_side_bearing(&self, glyph_id: GlyphId) -> Option<i16>
Returns glyph’s vertical side bearing.
This method is affected by variation axes.
sourcepub fn glyph_y_origin(&self, glyph_id: GlyphId) -> Option<i16>
pub fn glyph_y_origin(&self, glyph_id: GlyphId) -> Option<i16>
Returns glyph’s vertical origin according to Vertical Origin Table.
sourcepub fn glyph_name(&self, glyph_id: GlyphId) -> Option<&str>
pub fn glyph_name(&self, glyph_id: GlyphId) -> Option<&str>
Returns glyph’s name.
Uses the post
and CFF
tables as sources.
Returns None
when no name is associated with a glyph
.
sourcepub fn outline_glyph(
&self,
glyph_id: GlyphId,
builder: &mut dyn OutlineBuilder,
) -> Option<Rect>
pub fn outline_glyph( &self, glyph_id: GlyphId, builder: &mut dyn OutlineBuilder, ) -> Option<Rect>
Outlines a glyph and returns its tight bounding box.
Warning: since ttf-parser
is a pull parser,
OutlineBuilder
will emit segments even when outline is partially malformed.
You must check outline_glyph()
result before using
OutlineBuilder
’s output.
gvar
, glyf
, CFF
and CFF2
tables are supported.
And they will be accesses in this specific order.
This method is affected by variation axes.
Returns None
when glyph has no outline or on error.
§Example
use std::fmt::Write;
use ttf_parser;
struct Builder(String);
impl ttf_parser::OutlineBuilder for Builder {
fn move_to(&mut self, x: f32, y: f32) {
write!(&mut self.0, "M {} {} ", x, y).unwrap();
}
fn line_to(&mut self, x: f32, y: f32) {
write!(&mut self.0, "L {} {} ", x, y).unwrap();
}
fn quad_to(&mut self, x1: f32, y1: f32, x: f32, y: f32) {
write!(&mut self.0, "Q {} {} {} {} ", x1, y1, x, y).unwrap();
}
fn curve_to(&mut self, x1: f32, y1: f32, x2: f32, y2: f32, x: f32, y: f32) {
write!(&mut self.0, "C {} {} {} {} {} {} ", x1, y1, x2, y2, x, y).unwrap();
}
fn close(&mut self) {
write!(&mut self.0, "Z ").unwrap();
}
}
let data = std::fs::read("tests/fonts/demo.ttf").unwrap();
let face = ttf_parser::Face::parse(&data, 0).unwrap();
let mut builder = Builder(String::new());
let bbox = face.outline_glyph(ttf_parser::GlyphId(1), &mut builder).unwrap();
assert_eq!(builder.0, "M 173 267 L 369 267 L 270 587 L 173 267 Z M 6 0 L 224 656 \
L 320 656 L 541 0 L 452 0 L 390 200 L 151 200 L 85 0 L 6 0 Z ");
assert_eq!(bbox, ttf_parser::Rect { x_min: 6, y_min: 0, x_max: 541, y_max: 656 });
sourcepub fn glyph_bounding_box(&self, glyph_id: GlyphId) -> Option<Rect>
pub fn glyph_bounding_box(&self, glyph_id: GlyphId) -> Option<Rect>
Returns a tight glyph bounding box.
This is just a shorthand for outline_glyph()
since only the glyf
table stores
a bounding box. We ignore glyf
table bboxes because they can be malformed.
In case of CFF and variable fonts we have to actually outline
a glyph to find it’s bounding box.
When a glyph is defined by a raster or a vector image,
that can be obtained via glyph_image()
,
the bounding box must be calculated manually and this method will return None
.
Note: the returned bbox is not validated in any way. A font file can have a glyph bbox set to zero/negative width and/or height and this is perfectly ok. For calculated bboxes, zero width and/or height is also perfectly fine.
This method is affected by variation axes.
sourcepub fn global_bounding_box(&self) -> Rect
pub fn global_bounding_box(&self) -> Rect
Returns a bounding box that large enough to enclose any glyph from the face.
sourcepub fn glyph_raster_image(
&self,
glyph_id: GlyphId,
pixels_per_em: u16,
) -> Option<RasterGlyphImage<'_>>
pub fn glyph_raster_image( &self, glyph_id: GlyphId, pixels_per_em: u16, ) -> Option<RasterGlyphImage<'_>>
Returns a reference to a glyph’s raster image.
A font can define a glyph using a raster or a vector image instead of a simple outline. Which is primarily used for emojis. This method should be used to access raster images.
pixels_per_em
allows selecting a preferred image size. The chosen size will
be closer to an upper one. So when font has 64px and 96px images and pixels_per_em
is set to 72, 96px image will be returned.
To get the largest image simply use std::u16::MAX
.
Note that this method will return an encoded image. It should be decoded by the caller. We don’t validate or preprocess it in any way.
Also, a font can contain both: images and outlines. So when this method returns None
you should also try outline_glyph()
afterwards.
There are multiple ways an image can be stored in a TrueType font
and this method supports most of them.
This includes sbix
, bloc
+ bdat
, EBLC
+ EBDT
, CBLC
+ CBDT
.
And font’s tables will be accesses in this specific order.
sourcepub fn glyph_svg_image(&self, glyph_id: GlyphId) -> Option<SvgDocument<'a>>
pub fn glyph_svg_image(&self, glyph_id: GlyphId) -> Option<SvgDocument<'a>>
Returns a reference to a glyph’s SVG image.
A font can define a glyph using a raster or a vector image instead of a simple outline. Which is primarily used for emojis. This method should be used to access SVG images.
Note that this method will return just an SVG data. It should be rendered or even decompressed (in case of SVGZ) by the caller. We don’t validate or preprocess it in any way.
Also, a font can contain both: images and outlines. So when this method returns None
you should also try outline_glyph()
afterwards.
sourcepub fn is_color_glyph(&self, glyph_id: GlyphId) -> bool
pub fn is_color_glyph(&self, glyph_id: GlyphId) -> bool
Returns true
if the glyph can be colored/painted using the COLR
+CPAL
tables.
See paint_color_glyph
for details.
sourcepub fn color_palettes(&self) -> Option<NonZero<u16>>
pub fn color_palettes(&self) -> Option<NonZero<u16>>
Returns the number of palettes stored in the COLR
+CPAL
tables.
See paint_color_glyph
for details.
sourcepub fn paint_color_glyph(
&self,
glyph_id: GlyphId,
palette: u16,
foreground_color: RgbaColor,
painter: &mut dyn Painter<'a>,
) -> Option<()>
pub fn paint_color_glyph( &self, glyph_id: GlyphId, palette: u16, foreground_color: RgbaColor, painter: &mut dyn Painter<'a>, ) -> Option<()>
Paints a color glyph from the COLR
table.
A font can have multiple palettes, which you can check via
color_palettes
.
If unsure, just pass 0 to the palette
argument, which is the default.
A font can define a glyph using layers of colored shapes instead of a
simple outline. Which is primarily used for emojis. This method should
be used to access glyphs defined in the COLR
table.
Also, a font can contain both: a layered definition and outlines. So
when this method returns None
you should also try
outline_glyph
afterwards.
Returns None
if the glyph has no COLR
definition or if the glyph
definition is malformed.
See examples/font2svg.rs
for usage examples.
sourcepub fn variation_axes(&self) -> LazyArray16<'a, VariationAxis>
pub fn variation_axes(&self) -> LazyArray16<'a, VariationAxis>
Returns an iterator over variation axes.
sourcepub fn set_variation(&mut self, axis: Tag, value: f32) -> Option<()>
pub fn set_variation(&mut self, axis: Tag, value: f32) -> Option<()>
Sets a variation axis coordinate.
This is one of the two only mutable methods in the library. We can simplify the API a lot by storing the variable coordinates in the face object itself.
Since coordinates are stored on the stack, we allow only 64 of them.
Returns None
when face is not variable or doesn’t have such axis.
sourcepub fn variation_coordinates(&self) -> &[NormalizedCoordinate]
pub fn variation_coordinates(&self) -> &[NormalizedCoordinate]
Returns the current normalized variation coordinates.
sourcepub fn has_non_default_variation_coordinates(&self) -> bool
pub fn has_non_default_variation_coordinates(&self) -> bool
Checks that face has non-default variation coordinates.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for hb_font_t<'a>
impl<'a> RefUnwindSafe for hb_font_t<'a>
impl<'a> Send for hb_font_t<'a>
impl<'a> Sync for hb_font_t<'a>
impl<'a> Unpin for hb_font_t<'a>
impl<'a> UnwindSafe for hb_font_t<'a>
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
source§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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
source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters
when converting.source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle
.source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other
into Self
, while performing the appropriate scaling,
rounding and clamping.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
source§fn into_angle(self) -> U
fn into_angle(self) -> U
T
.source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters
when converting.source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
source§fn into_color(self) -> U
fn into_color(self) -> U
source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
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> ⓘ
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> ⓘ
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 moresource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self
into T
, while performing the appropriate scaling,
rounding and clamping.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors
fails to cast.source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more