265 lines
82 KiB
HTML
265 lines
82 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A font face handle."><title>Face in rustybuzz - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rustybuzz" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rustybuzz/index.html">rustybuzz</a><span class="version">0.14.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Face</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.from_face" title="from_face">from_face</a></li><li><a href="#method.from_slice" title="from_slice">from_slice</a></li><li><a href="#method.set_pixels_per_em" title="set_pixels_per_em">set_pixels_per_em</a></li><li><a href="#method.set_points_per_em" title="set_points_per_em">set_points_per_em</a></li><li><a href="#method.set_variations" title="set_variations">set_variations</a></li><li><a href="#method.units_per_em" title="units_per_em">units_per_em</a></li></ul><h3><a href="#deref-methods-Face%3C'a%3E">Methods from Deref<<wbr>Target=<wbr>Face<'a>></a></h3><ul class="block deref-methods"><li><a href="#method.ascender" title="ascender">ascender</a></li><li><a href="#method.capital_height" title="capital_height">capital_height</a></li><li><a href="#method.color_palettes" title="color_palettes">color_palettes</a></li><li><a href="#method.descender" title="descender">descender</a></li><li><a href="#method.global_bounding_box" title="global_bounding_box">global_bounding_box</a></li><li><a href="#method.glyph_bounding_box" title="glyph_bounding_box">glyph_bounding_box</a></li><li><a href="#method.glyph_hor_advance" title="glyph_hor_advance">glyph_hor_advance</a></li><li><a href="#method.glyph_hor_side_bearing" title="glyph_hor_side_bearing">glyph_hor_side_bearing</a></li><li><a href="#method.glyph_index" title="glyph_index">glyph_index</a></li><li><a href="#method.glyph_index_by_name" title="glyph_index_by_name">glyph_index_by_name</a></li><li><a href="#method.glyph_name" title="glyph_name">glyph_name</a></li><li><a href="#method.glyph_raster_image" title="glyph_raster_image">glyph_raster_image</a></li><li><a href="#method.glyph_svg_image" title="glyph_svg_image">glyph_svg_image</a></li><li><a href="#method.glyph_variation_index" title="glyph_variation_index">glyph_variation_index</a></li><li><a href="#method.glyph_ver_advance" title="glyph_ver_advance">glyph_ver_advance</a></li><li><a href="#method.glyph_ver_side_bearing" title="glyph_ver_side_bearing">glyph_ver_side_bearing</a></li><li><a href="#method.glyph_y_origin" title="glyph_y_origin">glyph_y_origin</a></li><li><a href="#method.has_non_default_variation_coordinates" title="has_non_default_variation_coordinates">has_non_default_variation_coordinates</a></li><li><a href="#method.height" title="height">height</a></li><li><a href="#method.is_bold" title="is_bold">is_bold</a></li><li><a href="#method.is_color_glyph" title="is_color_glyph">is_color_glyph</a></li><li><a href="#method.is_italic" title="is_italic">is_italic</a></li><li><a href="#method.is_monospaced" title="is_monospaced">is_monospaced</a></li><li><a href="#method.is_oblique" title="is_oblique">is_oblique</a></li><li><a href="#method.is_outline_embedding_allowed" title="is_outline_embedding_allowed">is_outline_embedding_allowed</a></li><li><a href="#method.is_regular" title="is_regular">is_regular</a></li><li><a href="#method.is_subsetting_allowed" title="is_subsetting_allowed">is_subsetting_allowed</a></li><li><a href="#method.is_variable" title="is_variable">is_variable</a></li><li><a href="#method.italic_angle" title="italic_angle">italic_angle</a></li><li><a href="#method.line_gap" title="line_gap">line_gap</a></li><li><a href="#method.names" title="names">names</a></li><li><a href="#method.number_of_glyphs" title="number_of_glyphs">number_of_glyphs</a></li><li><a href="#method.outline_glyph" title="outline_glyph">outline_glyph</a></li><li><a href="#method.paint_color_glyph" title="paint_color_glyph">paint_color_glyph</a></li><li><a href="#method.permissions" title="permissions">permissions</a></li><li><a href="#method.raw_face" title="raw_face">raw_face</a></li><li><a href="#method.set_variation" title="set_variation">set_variation</a></li><li><a href="#method.strikeout_metrics" title="strikeout_metrics">strikeout_metrics</a></li><li><a href="#method.style" title="style">style</a></li><li><a href="#method.subscript_metrics" title="subscript_metrics">subscript_metrics</a></li><li><a href="#method.superscript_metrics" title="superscript_metrics">superscript_metrics</a></li><li><a href="#method.table_data" title="table_data">table_data</a></li><li><a href="#method.tables" title="tables">tables</a></li><li><a href="#method.typographic_ascender" title="typographic_ascender">typographic_ascender</a></li><li><a href="#method.typographic_descender" title="typographic_descender">typographic_descender</a></li><li><a href="#method.typographic_line_gap" title="typographic_line_gap">typographic_line_gap</a></li><li><a href="#method.underline_metrics" title="underline_metrics">underline_metrics</a></li><li><a href="#method.unicode_ranges" title="unicode_ranges">unicode_ranges</a></li><li><a href="#method.units_per_em-1" title="units_per_em">units_per_em</a></li><li><a href="#method.variation_axes" title="variation_axes">variation_axes</a></li><li><a href="#method.variation_coordinates" title="variation_coordinates">variation_coordinates</a></li><li><a href="#method.vertical_ascender" title="vertical_ascender">vertical_ascender</a></li><li><a href="#method.vertical_descender" title="vertical_descender">vertical_descender</a></li><li><a href="#method.vertical_height" title="vertical_height">vertical_height</a></li><li><a href="#method.vertical_line_gap" title="vertical_line_gap">vertical_line_gap</a></li><li><a href="#method.weight" title="weight">weight</a></li><li><a href="#method.width" title="width">width</a></li><li><a href="#method.x_height" title="x_height">x_height</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-AsMut%3CFace%3C'a%3E%3E-for-hb_font_t%3C'a%3E" title="AsMut<Face<'a>>">AsMut<Face<'a>></a></li><li><a href="#impl-AsRef%3CFace%3C'a%3E%3E-for-hb_font_t%3C'a%3E" title="AsRef<Face<'a>>">AsRef<Face<'a>></a></li><li><a href="#impl-Clone-for-hb_font_t%3C'a%3E" title="Clone">Clone</a></li><li><a href="#impl-Deref-for-hb_font_t%3C'a%3E" title="Deref">Deref</a></li><li><a href="#impl-DerefMut-for-hb_font_t%3C'a%3E" title="DerefMut">DerefMut</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-hb_font_t%3C'a%3E" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-hb_font_t%3C'a%3E" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-hb_font_t%3C'a%3E" title="Send">Send</a></li><li><a href="#impl-Sync-for-hb_font_t%3C'a%3E" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-hb_font_t%3C'a%3E" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-hb_font_t%3C'a%3E" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-CloneToUninit-for-T" title="CloneToUninit">CloneToUninit</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-Receiver-for-P" title="Receiver">Receiver</a></li><li><a href="#impl-ToOwned-for-T" title="ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate rustybuzz</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">rustybuzz</a></span><h1>Struct <span class="struct">Face</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/rustybuzz/hb/face.rs.html#26-34">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Face<'a> { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A font face handle.</p>
|
||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-hb_font_t%3C'a%3E" class="impl"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#66-313">Source</a><a href="#impl-hb_font_t%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from_slice" class="method"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#70-73">Source</a><h4 class="code-header">pub fn <a href="#method.from_slice" class="fn">from_slice</a>(data: &'a [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>], face_index: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u32.html">u32</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self></h4></section></summary><div class="docblock"><p>Creates a new <code>Face</code> from data.</p>
|
||
<p>Data will be referenced, not owned.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_face" class="method"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#78-88">Source</a><h4 class="code-header">pub fn <a href="#method.from_face" class="fn">from_face</a>(face: Face<'a>) -> Self</h4></section></summary><div class="docblock"><p>Creates a new [<code>Face</code>] from [<code>ttf_parser::Face</code>].</p>
|
||
<p>Data will be referenced, not owned.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.units_per_em" class="method"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#93-95">Source</a><h4 class="code-header">pub fn <a href="#method.units_per_em" class="fn">units_per_em</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i32.html">i32</a></h4></section></summary><div class="docblock"><p>Returns face’s units per EM.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_pixels_per_em" class="method"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#108-110">Source</a><h4 class="code-header">pub fn <a href="#method.set_pixels_per_em" class="fn">set_pixels_per_em</a>(&mut self, ppem: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u16.html">u16</a>, <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u16.html">u16</a>)>)</h4></section></summary><div class="docblock"><p>Sets pixels per EM.</p>
|
||
<p>Used during raster glyphs processing and hinting.</p>
|
||
<p><code>None</code> by default.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_points_per_em" class="method"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#118-120">Source</a><h4 class="code-header">pub fn <a href="#method.set_points_per_em" class="fn">set_points_per_em</a>(&mut self, ptem: <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>>)</h4></section></summary><div class="docblock"><p>Sets point size per EM.</p>
|
||
<p>Used for optical-sizing in Apple fonts.</p>
|
||
<p><code>None</code> by default.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_variations" class="method"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#123-127">Source</a><h4 class="code-header">pub fn <a href="#method.set_variations" class="fn">set_variations</a>(&mut self, variations: &[<a class="struct" href="struct.Variation.html" title="struct rustybuzz::Variation">Variation</a>])</h4></section></summary><div class="docblock"><p>Sets font variations.</p>
|
||
</div></details></div></details></div><details class="toggle big-toggle" open><summary><h2 id="deref-methods-Face%3C'a%3E" class="section-header"><span>Methods from <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = Face<'a>></span><a href="#deref-methods-Face%3C'a%3E" class="anchor">§</a></h2></summary><div id="deref-methods-Face%3C'a%3E-1" class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.tables" class="method"><h4 class="code-header">pub fn <a href="#method.tables" class="fn">tables</a>(&self) -> &FaceTables<'a></h4></section></summary><div class="docblock"><p>Returns low-level face tables.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.raw_face" class="method"><h4 class="code-header">pub fn <a href="#method.raw_face" class="fn">raw_face</a>(&self) -> &RawFace<'a></h4></section></summary><div class="docblock"><p>Returns the <code>RawFace</code> used to create this <code>Face</code>.</p>
|
||
<p>Useful if you want to parse the data manually.</p>
|
||
<p>Available only for faces created using <a href="struct.Face.html#method.parse"><code>Face::parse()</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.table_data" class="method"><h4 class="code-header">pub fn <a href="#method.table_data" class="fn">table_data</a>(&self, tag: Tag) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&'a [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.16.0: use <code>self.raw_face().table()</code> instead</span></div></span></summary><div class="docblock"><p>Returns the raw data of a selected table.</p>
|
||
<p>Useful if you want to parse the data manually.</p>
|
||
<p>Available only for faces created using <a href="struct.Face.html#method.parse"><code>Face::parse()</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.names" class="method"><h4 class="code-header">pub fn <a href="#method.names" class="fn">names</a>(&self) -> Names<'a></h4></section></summary><div class="docblock"><p>Returns a list of names.</p>
|
||
<p>Contains face name and other strings.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_regular" class="method"><h4 class="code-header">pub fn <a href="#method.is_regular" class="fn">is_regular</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks that face is marked as <em>Regular</em>.</p>
|
||
<p>Returns <code>false</code> when OS/2 table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_italic" class="method"><h4 class="code-header">pub fn <a href="#method.is_italic" class="fn">is_italic</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks that face is marked as <em>Italic</em>.</p>
|
||
<p>Returns <code>false</code> when OS/2 table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_bold" class="method"><h4 class="code-header">pub fn <a href="#method.is_bold" class="fn">is_bold</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks that face is marked as <em>Bold</em>.</p>
|
||
<p>Returns <code>false</code> when OS/2 table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_oblique" class="method"><h4 class="code-header">pub fn <a href="#method.is_oblique" class="fn">is_oblique</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks that face is marked as <em>Oblique</em>.</p>
|
||
<p>Returns <code>false</code> when OS/2 table is not present or when its version is < 4.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.style" class="method"><h4 class="code-header">pub fn <a href="#method.style" class="fn">style</a>(&self) -> Style</h4></section></summary><div class="docblock"><p>Returns face style.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_monospaced" class="method"><h4 class="code-header">pub fn <a href="#method.is_monospaced" class="fn">is_monospaced</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks that face is marked as <em>Monospaced</em>.</p>
|
||
<p>Returns <code>false</code> when <code>post</code> table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_variable" class="method"><h4 class="code-header">pub fn <a href="#method.is_variable" class="fn">is_variable</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks that face is variable.</p>
|
||
<p>Simply checks the presence of a <code>fvar</code> table.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.weight" class="method"><h4 class="code-header">pub fn <a href="#method.weight" class="fn">weight</a>(&self) -> Weight</h4></section></summary><div class="docblock"><p>Returns face’s weight.</p>
|
||
<p>Returns <code>Weight::Normal</code> when OS/2 table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.width" class="method"><h4 class="code-header">pub fn <a href="#method.width" class="fn">width</a>(&self) -> Width</h4></section></summary><div class="docblock"><p>Returns face’s width.</p>
|
||
<p>Returns <code>Width::Normal</code> when OS/2 table is not present or when value is invalid.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.italic_angle" class="method"><h4 class="code-header">pub fn <a href="#method.italic_angle" class="fn">italic_angle</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>></h4></section></summary><div class="docblock"><p>Returns face’s italic angle.</p>
|
||
<p>Returns <code>None</code> when <code>post</code> table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.ascender" class="method"><h4 class="code-header">pub fn <a href="#method.ascender" class="fn">ascender</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a></h4></section></summary><div class="docblock"><p>Returns a horizontal face ascender.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.descender" class="method"><h4 class="code-header">pub fn <a href="#method.descender" class="fn">descender</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a></h4></section></summary><div class="docblock"><p>Returns a horizontal face descender.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.height" class="method"><h4 class="code-header">pub fn <a href="#method.height" class="fn">height</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a></h4></section></summary><div class="docblock"><p>Returns face’s height.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.line_gap" class="method"><h4 class="code-header">pub fn <a href="#method.line_gap" class="fn">line_gap</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a></h4></section></summary><div class="docblock"><p>Returns a horizontal face line gap.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.typographic_ascender" class="method"><h4 class="code-header">pub fn <a href="#method.typographic_ascender" class="fn">typographic_ascender</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a>></h4></section></summary><div class="docblock"><p>Returns a horizontal typographic face ascender.</p>
|
||
<p>Prefer <code>Face::ascender</code> unless you explicitly want this. This is a more
|
||
low-level alternative.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
<p>Returns <code>None</code> when OS/2 table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.typographic_descender" class="method"><h4 class="code-header">pub fn <a href="#method.typographic_descender" class="fn">typographic_descender</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a>></h4></section></summary><div class="docblock"><p>Returns a horizontal typographic face descender.</p>
|
||
<p>Prefer <code>Face::descender</code> unless you explicitly want this. This is a more
|
||
low-level alternative.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
<p>Returns <code>None</code> when OS/2 table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.typographic_line_gap" class="method"><h4 class="code-header">pub fn <a href="#method.typographic_line_gap" class="fn">typographic_line_gap</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a>></h4></section></summary><div class="docblock"><p>Returns a horizontal typographic face line gap.</p>
|
||
<p>Prefer <code>Face::line_gap</code> unless you explicitly want this. This is a more
|
||
low-level alternative.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
<p>Returns <code>None</code> when OS/2 table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.vertical_ascender" class="method"><h4 class="code-header">pub fn <a href="#method.vertical_ascender" class="fn">vertical_ascender</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a>></h4></section></summary><div class="docblock"><p>Returns a vertical face ascender.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.vertical_descender" class="method"><h4 class="code-header">pub fn <a href="#method.vertical_descender" class="fn">vertical_descender</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a>></h4></section></summary><div class="docblock"><p>Returns a vertical face descender.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.vertical_height" class="method"><h4 class="code-header">pub fn <a href="#method.vertical_height" class="fn">vertical_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a>></h4></section></summary><div class="docblock"><p>Returns a vertical face height.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.vertical_line_gap" class="method"><h4 class="code-header">pub fn <a href="#method.vertical_line_gap" class="fn">vertical_line_gap</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a>></h4></section></summary><div class="docblock"><p>Returns a vertical face line gap.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.units_per_em-1" class="method"><h4 class="code-header">pub fn <a href="#method.units_per_em-1" class="fn">units_per_em</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u16.html">u16</a></h4></section></summary><div class="docblock"><p>Returns face’s units per EM.</p>
|
||
<p>Guarantee to be in a 16..=16384 range.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.x_height" class="method"><h4 class="code-header">pub fn <a href="#method.x_height" class="fn">x_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a>></h4></section></summary><div class="docblock"><p>Returns face’s x height.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
<p>Returns <code>None</code> when OS/2 table is not present or when its version is < 2.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.capital_height" class="method"><h4 class="code-header">pub fn <a href="#method.capital_height" class="fn">capital_height</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a>></h4></section></summary><div class="docblock"><p>Returns face’s capital height.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
<p>Returns <code>None</code> when OS/2 table is not present or when its version is < 2.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.underline_metrics" class="method"><h4 class="code-header">pub fn <a href="#method.underline_metrics" class="fn">underline_metrics</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><LineMetrics></h4></section></summary><div class="docblock"><p>Returns face’s underline metrics.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
<p>Returns <code>None</code> when <code>post</code> table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.strikeout_metrics" class="method"><h4 class="code-header">pub fn <a href="#method.strikeout_metrics" class="fn">strikeout_metrics</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><LineMetrics></h4></section></summary><div class="docblock"><p>Returns face’s strikeout metrics.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
<p>Returns <code>None</code> when OS/2 table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.subscript_metrics" class="method"><h4 class="code-header">pub fn <a href="#method.subscript_metrics" class="fn">subscript_metrics</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><ScriptMetrics></h4></section></summary><div class="docblock"><p>Returns face’s subscript metrics.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
<p>Returns <code>None</code> when OS/2 table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.superscript_metrics" class="method"><h4 class="code-header">pub fn <a href="#method.superscript_metrics" class="fn">superscript_metrics</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><ScriptMetrics></h4></section></summary><div class="docblock"><p>Returns face’s superscript metrics.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
<p>Returns <code>None</code> when OS/2 table is not present.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.permissions" class="method"><h4 class="code-header">pub fn <a href="#method.permissions" class="fn">permissions</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Permissions></h4></section></summary><div class="docblock"><p>Returns face permissions.</p>
|
||
<p>Returns <code>None</code> in case of a malformed value.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_subsetting_allowed" class="method"><h4 class="code-header">pub fn <a href="#method.is_subsetting_allowed" class="fn">is_subsetting_allowed</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks if the face allows embedding a subset, further restricted by [<code>Self::permissions</code>].</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_outline_embedding_allowed" class="method"><h4 class="code-header">pub fn <a href="#method.is_outline_embedding_allowed" class="fn">is_outline_embedding_allowed</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks if the face allows outline data to be embedded.</p>
|
||
<p>If false, only bitmaps may be embedded in accordance with [<code>Self::permissions</code>].</p>
|
||
<p>If the font contains no bitmaps and this flag is not set, it implies no embedding is allowed.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.unicode_ranges" class="method"><h4 class="code-header">pub fn <a href="#method.unicode_ranges" class="fn">unicode_ranges</a>(&self) -> UnicodeRanges</h4></section></summary><div class="docblock"><p>Returns <a href="https://docs.microsoft.com/en-us/typography/opentype/spec/os2#ur">Unicode Ranges</a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.number_of_glyphs" class="method"><h4 class="code-header">pub fn <a href="#method.number_of_glyphs" class="fn">number_of_glyphs</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u16.html">u16</a></h4></section></summary><div class="docblock"><p>Returns a total number of glyphs in the face.</p>
|
||
<p>Never zero.</p>
|
||
<p>The value was already parsed, so this function doesn’t involve any parsing.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_index" class="method"><h4 class="code-header">pub fn <a href="#method.glyph_index" class="fn">glyph_index</a>(&self, code_point: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.char.html">char</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><GlyphId></h4></section></summary><div class="docblock"><p>Resolves a Glyph ID for a code point.</p>
|
||
<p>Returns <code>None</code> instead of <code>0</code> when glyph is not found.</p>
|
||
<p>All subtable formats except Mixed Coverage (8) are supported.</p>
|
||
<p>If you need a more low-level control, prefer <code>Face::tables().cmap</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_index_by_name" class="method"><h4 class="code-header">pub fn <a href="#method.glyph_index_by_name" class="fn">glyph_index_by_name</a>(&self, name: &<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><GlyphId></h4></section></summary><div class="docblock"><p>Resolves a Glyph ID for a glyph name.</p>
|
||
<p>Uses the <code>post</code> and <code>CFF</code> tables as sources.</p>
|
||
<p>Returns <code>None</code> when no name is associated with a <code>glyph</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_variation_index" class="method"><h4 class="code-header">pub fn <a href="#method.glyph_variation_index" class="fn">glyph_variation_index</a>(
|
||
&self,
|
||
code_point: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.char.html">char</a>,
|
||
variation: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.char.html">char</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><GlyphId></h4></section></summary><div class="docblock"><p>Resolves a variation of a Glyph ID from two code points.</p>
|
||
<p>Implemented according to
|
||
<a href="https://docs.microsoft.com/en-us/typography/opentype/spec/cmap#format-14-unicode-variation-sequences">Unicode Variation Sequences</a>.</p>
|
||
<p>Returns <code>None</code> instead of <code>0</code> when glyph is not found.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_hor_advance" class="method"><h4 class="code-header">pub fn <a href="#method.glyph_hor_advance" class="fn">glyph_hor_advance</a>(&self, glyph_id: GlyphId) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u16.html">u16</a>></h4></section></summary><div class="docblock"><p>Returns glyph’s horizontal advance.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_ver_advance" class="method"><h4 class="code-header">pub fn <a href="#method.glyph_ver_advance" class="fn">glyph_ver_advance</a>(&self, glyph_id: GlyphId) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u16.html">u16</a>></h4></section></summary><div class="docblock"><p>Returns glyph’s vertical advance.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_hor_side_bearing" class="method"><h4 class="code-header">pub fn <a href="#method.glyph_hor_side_bearing" class="fn">glyph_hor_side_bearing</a>(&self, glyph_id: GlyphId) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a>></h4></section></summary><div class="docblock"><p>Returns glyph’s horizontal side bearing.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_ver_side_bearing" class="method"><h4 class="code-header">pub fn <a href="#method.glyph_ver_side_bearing" class="fn">glyph_ver_side_bearing</a>(&self, glyph_id: GlyphId) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a>></h4></section></summary><div class="docblock"><p>Returns glyph’s vertical side bearing.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_y_origin" class="method"><h4 class="code-header">pub fn <a href="#method.glyph_y_origin" class="fn">glyph_y_origin</a>(&self, glyph_id: GlyphId) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.i16.html">i16</a>></h4></section></summary><div class="docblock"><p>Returns glyph’s vertical origin according to
|
||
<a href="https://docs.microsoft.com/en-us/typography/opentype/spec/vorg">Vertical Origin Table</a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_name" class="method"><h4 class="code-header">pub fn <a href="#method.glyph_name" class="fn">glyph_name</a>(&self, glyph_id: GlyphId) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>Returns glyph’s name.</p>
|
||
<p>Uses the <code>post</code> and <code>CFF</code> tables as sources.</p>
|
||
<p>Returns <code>None</code> when no name is associated with a <code>glyph</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.outline_glyph" class="method"><h4 class="code-header">pub fn <a href="#method.outline_glyph" class="fn">outline_glyph</a>(
|
||
&self,
|
||
glyph_id: GlyphId,
|
||
builder: &mut dyn OutlineBuilder,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Rect></h4></section></summary><div class="docblock"><p>Outlines a glyph and returns its tight bounding box.</p>
|
||
<p><strong>Warning</strong>: since <code>ttf-parser</code> is a pull parser,
|
||
<code>OutlineBuilder</code> will emit segments even when outline is partially malformed.
|
||
You must check <code>outline_glyph()</code> result before using
|
||
<code>OutlineBuilder</code>’s output.</p>
|
||
<p><code>gvar</code>, <code>glyf</code>, <code>CFF</code> and <code>CFF2</code> tables are supported.
|
||
And they will be accesses in this specific order.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
<p>Returns <code>None</code> when glyph has no outline or on error.</p>
|
||
<h5 id="example"><a class="doc-anchor" href="#example">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::fmt::Write;
|
||
<span class="kw">use </span>ttf_parser;
|
||
|
||
<span class="kw">struct </span>Builder(String);
|
||
|
||
<span class="kw">impl </span>ttf_parser::OutlineBuilder <span class="kw">for </span>Builder {
|
||
<span class="kw">fn </span>move_to(<span class="kw-2">&mut </span><span class="self">self</span>, x: f32, y: f32) {
|
||
<span class="macro">write!</span>(<span class="kw-2">&mut </span><span class="self">self</span>.<span class="number">0</span>, <span class="string">"M {} {} "</span>, x, y).unwrap();
|
||
}
|
||
|
||
<span class="kw">fn </span>line_to(<span class="kw-2">&mut </span><span class="self">self</span>, x: f32, y: f32) {
|
||
<span class="macro">write!</span>(<span class="kw-2">&mut </span><span class="self">self</span>.<span class="number">0</span>, <span class="string">"L {} {} "</span>, x, y).unwrap();
|
||
}
|
||
|
||
<span class="kw">fn </span>quad_to(<span class="kw-2">&mut </span><span class="self">self</span>, x1: f32, y1: f32, x: f32, y: f32) {
|
||
<span class="macro">write!</span>(<span class="kw-2">&mut </span><span class="self">self</span>.<span class="number">0</span>, <span class="string">"Q {} {} {} {} "</span>, x1, y1, x, y).unwrap();
|
||
}
|
||
|
||
<span class="kw">fn </span>curve_to(<span class="kw-2">&mut </span><span class="self">self</span>, x1: f32, y1: f32, x2: f32, y2: f32, x: f32, y: f32) {
|
||
<span class="macro">write!</span>(<span class="kw-2">&mut </span><span class="self">self</span>.<span class="number">0</span>, <span class="string">"C {} {} {} {} {} {} "</span>, x1, y1, x2, y2, x, y).unwrap();
|
||
}
|
||
|
||
<span class="kw">fn </span>close(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||
<span class="macro">write!</span>(<span class="kw-2">&mut </span><span class="self">self</span>.<span class="number">0</span>, <span class="string">"Z "</span>).unwrap();
|
||
}
|
||
}
|
||
|
||
<span class="kw">let </span>data = std::fs::read(<span class="string">"tests/fonts/demo.ttf"</span>).unwrap();
|
||
<span class="kw">let </span>face = ttf_parser::Face::parse(<span class="kw-2">&</span>data, <span class="number">0</span>).unwrap();
|
||
<span class="kw">let </span><span class="kw-2">mut </span>builder = Builder(String::new());
|
||
<span class="kw">let </span>bbox = face.outline_glyph(ttf_parser::GlyphId(<span class="number">1</span>), <span class="kw-2">&mut </span>builder).unwrap();
|
||
<span class="macro">assert_eq!</span>(builder.<span class="number">0</span>, <span class="string">"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 "</span>);
|
||
<span class="macro">assert_eq!</span>(bbox, ttf_parser::Rect { x_min: <span class="number">6</span>, y_min: <span class="number">0</span>, x_max: <span class="number">541</span>, y_max: <span class="number">656 </span>});</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_bounding_box" class="method"><h4 class="code-header">pub fn <a href="#method.glyph_bounding_box" class="fn">glyph_bounding_box</a>(&self, glyph_id: GlyphId) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Rect></h4></section></summary><div class="docblock"><p>Returns a tight glyph bounding box.</p>
|
||
<p>This is just a shorthand for <code>outline_glyph()</code> since only the <code>glyf</code> table stores
|
||
a bounding box. We ignore <code>glyf</code> 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.</p>
|
||
<p>When a glyph is defined by a raster or a vector image,
|
||
that can be obtained via <code>glyph_image()</code>,
|
||
the bounding box must be calculated manually and this method will return <code>None</code>.</p>
|
||
<p>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.</p>
|
||
<p>This method is affected by variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.global_bounding_box" class="method"><h4 class="code-header">pub fn <a href="#method.global_bounding_box" class="fn">global_bounding_box</a>(&self) -> Rect</h4></section></summary><div class="docblock"><p>Returns a bounding box that large enough to enclose any glyph from the face.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_raster_image" class="method"><h4 class="code-header">pub fn <a href="#method.glyph_raster_image" class="fn">glyph_raster_image</a>(
|
||
&self,
|
||
glyph_id: GlyphId,
|
||
pixels_per_em: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u16.html">u16</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><RasterGlyphImage<'_>></h4></section></summary><div class="docblock"><p>Returns a reference to a glyph’s raster image.</p>
|
||
<p>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.</p>
|
||
<p><code>pixels_per_em</code> 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 <code>pixels_per_em</code>
|
||
is set to 72, 96px image will be returned.
|
||
To get the largest image simply use <code>std::u16::MAX</code>.</p>
|
||
<p>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.</p>
|
||
<p>Also, a font can contain both: images and outlines. So when this method returns <code>None</code>
|
||
you should also try <code>outline_glyph()</code> afterwards.</p>
|
||
<p>There are multiple ways an image can be stored in a TrueType font
|
||
and this method supports most of them.
|
||
This includes <code>sbix</code>, <code>bloc</code> + <code>bdat</code>, <code>EBLC</code> + <code>EBDT</code>, <code>CBLC</code> + <code>CBDT</code>.
|
||
And font’s tables will be accesses in this specific order.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_svg_image" class="method"><h4 class="code-header">pub fn <a href="#method.glyph_svg_image" class="fn">glyph_svg_image</a>(&self, glyph_id: GlyphId) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><SvgDocument<'a>></h4></section></summary><div class="docblock"><p>Returns a reference to a glyph’s SVG image.</p>
|
||
<p>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.</p>
|
||
<p>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.</p>
|
||
<p>Also, a font can contain both: images and outlines. So when this method returns <code>None</code>
|
||
you should also try <code>outline_glyph()</code> afterwards.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_color_glyph" class="method"><h4 class="code-header">pub fn <a href="#method.is_color_glyph" class="fn">is_color_glyph</a>(&self, glyph_id: GlyphId) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the glyph can be colored/painted using the <code>COLR</code>+<code>CPAL</code> tables.</p>
|
||
<p>See <a href="Face::paint_color_glyph"><code>paint_color_glyph</code></a> for details.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.color_palettes" class="method"><h4 class="code-header">pub fn <a href="#method.color_palettes" class="fn">color_palettes</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.84.0/core/num/nonzero/struct.NonZero.html" title="struct core::num::nonzero::NonZero">NonZero</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u16.html">u16</a>>></h4></section></summary><div class="docblock"><p>Returns the number of palettes stored in the <code>COLR</code>+<code>CPAL</code> tables.</p>
|
||
<p>See <a href="Face::paint_color_glyph"><code>paint_color_glyph</code></a> for details.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.paint_color_glyph" class="method"><h4 class="code-header">pub fn <a href="#method.paint_color_glyph" class="fn">paint_color_glyph</a>(
|
||
&self,
|
||
glyph_id: GlyphId,
|
||
palette: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u16.html">u16</a>,
|
||
foreground_color: RgbaColor,
|
||
painter: &mut dyn Painter<'a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Paints a color glyph from the <code>COLR</code> table.</p>
|
||
<p>A font can have multiple palettes, which you can check via
|
||
<a href="Face::color_palettes"><code>color_palettes</code></a>.
|
||
If unsure, just pass 0 to the <code>palette</code> argument, which is the default.</p>
|
||
<p>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 <code>COLR</code> table.</p>
|
||
<p>Also, a font can contain both: a layered definition and outlines. So
|
||
when this method returns <code>None</code> you should also try
|
||
<a href="Face::outline_glyph"><code>outline_glyph</code></a> afterwards.</p>
|
||
<p>Returns <code>None</code> if the glyph has no <code>COLR</code> definition or if the glyph
|
||
definition is malformed.</p>
|
||
<p>See <code>examples/font2svg.rs</code> for usage examples.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.variation_axes" class="method"><h4 class="code-header">pub fn <a href="#method.variation_axes" class="fn">variation_axes</a>(&self) -> LazyArray16<'a, VariationAxis></h4></section></summary><div class="docblock"><p>Returns an iterator over variation axes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_variation" class="method"><h4 class="code-header">pub fn <a href="#method.set_variation" class="fn">set_variation</a>(&mut self, axis: Tag, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Sets a variation axis coordinate.</p>
|
||
<p>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.</p>
|
||
<p>Since coordinates are stored on the stack, we allow only 64 of them.</p>
|
||
<p>Returns <code>None</code> when face is not variable or doesn’t have such axis.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.variation_coordinates" class="method"><h4 class="code-header">pub fn <a href="#method.variation_coordinates" class="fn">variation_coordinates</a>(&self) -> &[NormalizedCoordinate]</h4></section></summary><div class="docblock"><p>Returns the current normalized variation coordinates.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_non_default_variation_coordinates" class="method"><h4 class="code-header">pub fn <a href="#method.has_non_default_variation_coordinates" class="fn">has_non_default_variation_coordinates</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks that face has non-default variation coordinates.</p>
|
||
</div></details></div></details><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-AsMut%3CFace%3C'a%3E%3E-for-hb_font_t%3C'a%3E" class="impl"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#43-48">Source</a><a href="#impl-AsMut%3CFace%3C'a%3E%3E-for-hb_font_t%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.AsMut.html" title="trait core::convert::AsMut">AsMut</a><Face<'a>> for <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_mut" class="method trait-impl"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#45-47">Source</a><a href="#method.as_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.AsMut.html#tymethod.as_mut" class="fn">as_mut</a>(&mut self) -> &mut Face<'a></h4></section></summary><div class='docblock'>Converts this type into a mutable reference of the (usually inferred) input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsRef%3CFace%3C'a%3E%3E-for-hb_font_t%3C'a%3E" class="impl"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#36-41">Source</a><a href="#impl-AsRef%3CFace%3C'a%3E%3E-for-hb_font_t%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><Face<'a>> for <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_ref" class="method trait-impl"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#38-40">Source</a><a href="#method.as_ref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.AsRef.html#tymethod.as_ref" class="fn">as_ref</a>(&self) -> &Face<'a></h4></section></summary><div class='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-hb_font_t%3C'a%3E" class="impl"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#25">Source</a><a href="#impl-Clone-for-hb_font_t%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#25">Source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&self) -> <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.0/src/core/clone.rs.html#174">Source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&mut self, source: &Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Deref-for-hb_font_t%3C'a%3E" class="impl"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#50-57">Source</a><a href="#impl-Deref-for-hb_font_t%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target" class="associatedtype trait-impl"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#51">Source</a><a href="#associatedtype.Target" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = Face<'a></h4></section></summary><div class='docblock'>The resulting type after dereferencing.</div></details><details class="toggle method-toggle" open><summary><section id="method.deref" class="method trait-impl"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#54-56">Source</a><a href="#method.deref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/ops/deref/trait.Deref.html#tymethod.deref" class="fn">deref</a>(&self) -> &Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/ops/deref/trait.Deref.html#associatedtype.Target" title="type core::ops::deref::Deref::Target">Target</a></h4></section></summary><div class='docblock'>Dereferences the value.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-DerefMut-for-hb_font_t%3C'a%3E" class="impl"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#59-64">Source</a><a href="#impl-DerefMut-for-hb_font_t%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.deref_mut" class="method trait-impl"><a class="src rightside" href="../src/rustybuzz/hb/face.rs.html#61-63">Source</a><a href="#method.deref_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut" class="fn">deref_mut</a>(&mut self) -> &mut Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/ops/deref/trait.Deref.html#associatedtype.Target" title="type core::ops::deref::Deref::Target">Target</a></h4></section></summary><div class='docblock'>Mutably dereferences the value.</div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-hb_font_t%3C'a%3E" class="impl"><a href="#impl-Freeze-for-hb_font_t%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h3></section><section id="impl-RefUnwindSafe-for-hb_font_t%3C'a%3E" class="impl"><a href="#impl-RefUnwindSafe-for-hb_font_t%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h3></section><section id="impl-Send-for-hb_font_t%3C'a%3E" class="impl"><a href="#impl-Send-for-hb_font_t%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h3></section><section id="impl-Sync-for-hb_font_t%3C'a%3E" class="impl"><a href="#impl-Sync-for-hb_font_t%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h3></section><section id="impl-Unpin-for-hb_font_t%3C'a%3E" class="impl"><a href="#impl-Unpin-for-hb_font_t%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h3></section><section id="impl-UnwindSafe-for-hb_font_t%3C'a%3E" class="impl"><a href="#impl-UnwindSafe-for-hb_font_t%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Face.html" title="struct rustybuzz::Face">hb_font_t</a><'a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.84.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-CloneToUninit-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/clone.rs.html#273">Source</a><a href="#impl-CloneToUninit-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.CloneToUninit.html" title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone_to_uninit" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/clone.rs.html#275">Source</a><a href="#method.clone_to_uninit" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit" class="fn">clone_to_uninit</a>(&self, dst: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>clone_to_uninit</code>)</span></div></span><div class='docblock'>Performs copy-assignment from <code>self</code> to <code>dst</code>. <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||
<p>That is, this conversion is whatever the implementation of
|
||
<code><a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Receiver-for-P" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/ops/deref.rs.html#374-376">Source</a><a href="#impl-Receiver-for-P" class="anchor">§</a><h3 class="code-header">impl<P, T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/deref/trait.Receiver.html" title="trait core::ops::deref::Receiver">Receiver</a> for P<div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = T> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/ops/deref.rs.html#378">Source</a><a href="#associatedtype.Target-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/ops/deref/trait.Receiver.html#associatedtype.Target" class="associatedtype">Target</a> = T</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>arbitrary_self_types</code>)</span></div></span><div class='docblock'>The target type on which the method may be called.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#82-84">Source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#86">Source</a><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#87">Source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#91">Source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html> |