176 lines
52 KiB
HTML
176 lines
52 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="Functionality required from font data."><title>Font in ab_glyph - 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="ab_glyph" 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 trait"><!--[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="../ab_glyph/index.html">ab_<wbr>glyph</a><span class="version">0.2.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Font</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#units" title="Units">Units</a></li><li><a href="#glyph-layout-concepts" title="Glyph layout concepts">Glyph layout concepts</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.ascent_unscaled" title="ascent_unscaled">ascent_unscaled</a></li><li><a href="#tymethod.codepoint_ids" title="codepoint_ids">codepoint_ids</a></li><li><a href="#tymethod.descent_unscaled" title="descent_unscaled">descent_unscaled</a></li><li><a href="#tymethod.glyph_count" title="glyph_count">glyph_count</a></li><li><a href="#tymethod.glyph_id" title="glyph_id">glyph_id</a></li><li><a href="#tymethod.glyph_raster_image2" title="glyph_raster_image2">glyph_raster_image2</a></li><li><a href="#tymethod.h_advance_unscaled" title="h_advance_unscaled">h_advance_unscaled</a></li><li><a href="#tymethod.h_side_bearing_unscaled" title="h_side_bearing_unscaled">h_side_bearing_unscaled</a></li><li><a href="#tymethod.kern_unscaled" title="kern_unscaled">kern_unscaled</a></li><li><a href="#tymethod.line_gap_unscaled" title="line_gap_unscaled">line_gap_unscaled</a></li><li><a href="#tymethod.outline" title="outline">outline</a></li><li><a href="#tymethod.units_per_em" title="units_per_em">units_per_em</a></li><li><a href="#tymethod.v_advance_unscaled" title="v_advance_unscaled">v_advance_unscaled</a></li><li><a href="#tymethod.v_side_bearing_unscaled" title="v_side_bearing_unscaled">v_side_bearing_unscaled</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.as_scaled" title="as_scaled">as_scaled</a></li><li><a href="#method.font_data" title="font_data">font_data</a></li><li><a href="#method.glyph_bounds" title="glyph_bounds">glyph_bounds</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.height_unscaled" title="height_unscaled">height_unscaled</a></li><li><a href="#method.into_scaled" title="into_scaled">into_scaled</a></li><li><a href="#method.outline_glyph" title="outline_glyph">outline_glyph</a></li><li><a href="#method.pt_to_px_scale" title="pt_to_px_scale">pt_to_px_scale</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Font-for-%26F" title="&F">&F</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate ab_<wbr>glyph</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">ab_glyph</a></span><h1>Trait <span class="trait">Font</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/ab_glyph/font.rs.html#39-301">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Font {
|
||
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 23 methods</span></summary> // Required methods
|
||
fn <a href="#tymethod.units_per_em" class="fn">units_per_em</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>>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.ascent_unscaled" class="fn">ascent_unscaled</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.descent_unscaled" class="fn">descent_unscaled</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.line_gap_unscaled" class="fn">line_gap_unscaled</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.glyph_id" class="fn">glyph_id</a>(&self, c: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.char.html">char</a>) -> <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.h_advance_unscaled" class="fn">h_advance_unscaled</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.h_side_bearing_unscaled" class="fn">h_side_bearing_unscaled</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.v_advance_unscaled" class="fn">v_advance_unscaled</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.v_side_bearing_unscaled" class="fn">v_side_bearing_unscaled</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.kern_unscaled" class="fn">kern_unscaled</a>(&self, first: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>, second: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.outline" class="fn">outline</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</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="struct" href="struct.Outline.html" title="struct ab_glyph::Outline">Outline</a>>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.glyph_count" class="fn">glyph_count</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.codepoint_ids" class="fn">codepoint_ids</a>(&self) -> <a class="struct" href="struct.CodepointIdIter.html" title="struct ab_glyph::CodepointIdIter">CodepointIdIter</a><'_> <a href="#" class="tooltip" data-notable-ty="CodepointIdIter<'_>">ⓘ</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.glyph_raster_image2" class="fn">glyph_raster_image2</a>(
|
||
&self,
|
||
id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>,
|
||
pixel_size: <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><<a class="struct" href="v2/struct.GlyphImage.html" title="struct ab_glyph::v2::GlyphImage">GlyphImage</a><'_>>;
|
||
|
||
// Provided methods
|
||
fn <a href="#method.pt_to_px_scale" class="fn">pt_to_px_scale</a>(&self, pt_size: <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="struct" href="struct.PxScale.html" title="struct ab_glyph::PxScale">PxScale</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.height_unscaled" class="fn">height_unscaled</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.glyph_raster_image" class="fn">glyph_raster_image</a>(
|
||
&self,
|
||
id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>,
|
||
pixel_size: <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><<a class="struct" href="struct.GlyphImage.html" title="struct ab_glyph::GlyphImage">GlyphImage</a><'_>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.glyph_svg_image" class="fn">glyph_svg_image</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</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="struct" href="struct.GlyphSvg.html" title="struct ab_glyph::GlyphSvg">GlyphSvg</a><'_>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.glyph_bounds" class="fn">glyph_bounds</a>(&self, glyph: &<a class="struct" href="struct.Glyph.html" title="struct ab_glyph::Glyph">Glyph</a>) -> <a class="struct" href="struct.Rect.html" title="struct ab_glyph::Rect">Rect</a>
|
||
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.outline_glyph" class="fn">outline_glyph</a>(&self, glyph: <a class="struct" href="struct.Glyph.html" title="struct ab_glyph::Glyph">Glyph</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="struct" href="struct.OutlinedGlyph.html" title="struct ab_glyph::OutlinedGlyph">OutlinedGlyph</a>>
|
||
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.as_scaled" class="fn">as_scaled</a><S: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="struct.PxScale.html" title="struct ab_glyph::PxScale">PxScale</a>>>(&self, scale: S) -> <a class="struct" href="struct.PxScaleFont.html" title="struct ab_glyph::PxScaleFont">PxScaleFont</a><&Self>
|
||
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.into_scaled" class="fn">into_scaled</a><S: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="struct.PxScale.html" title="struct ab_glyph::PxScale">PxScale</a>>>(self, scale: S) -> <a class="struct" href="struct.PxScaleFont.html" title="struct ab_glyph::PxScaleFont">PxScaleFont</a><Self>
|
||
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.font_data" class="fn">font_data</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a> { ... }
|
||
</details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Functionality required from font data.</p>
|
||
<p>See also <a href="struct.FontArc.html" title="struct ab_glyph::FontArc"><code>FontArc</code></a>, <a href="struct.FontRef.html" title="struct ab_glyph::FontRef"><code>FontRef</code></a>
|
||
and <a href="struct.FontVec.html" title="struct ab_glyph::FontVec"><code>FontVec</code></a>.</p>
|
||
<h3 id="units"><a class="doc-anchor" href="#units">§</a>Units</h3>
|
||
<p>Units of unscaled accessors are “font units”, which is an arbitrary unit
|
||
defined by the font. See <a href="trait.Font.html#tymethod.units_per_em" title="method ab_glyph::Font::units_per_em"><code>Font::units_per_em</code></a>.</p>
|
||
<p>ab_glyph uses a non-standard scale <a href="struct.PxScale.html" title="struct ab_glyph::PxScale"><code>PxScale</code></a> which is the pixel height
|
||
of the text. See <a href="trait.Font.html#method.pt_to_px_scale" title="method ab_glyph::Font::pt_to_px_scale"><code>Font::pt_to_px_scale</code></a> to convert standard point sizes.</p>
|
||
<h3 id="glyph-layout-concepts"><a class="doc-anchor" href="#glyph-layout-concepts">§</a>Glyph layout concepts</h3>
|
||
<p>Fonts provide several properties to inform layout of glyphs.</p>
|
||
<div class="example-wrap"><pre class="language-text"><code> ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||
| .:x++++== |
|
||
| .#+ |
|
||
| :@ =++=++x=: |
|
||
ascent | +# x: +x x+ |
|
||
| =# #: :#:---:#: | height
|
||
| -@- #: .#--:-- |
|
||
| =#:-.-==#: #x+===:. |
|
||
baseline ____________ .-::-. .. #: .:@. |
|
||
| #+--..-=#. |
|
||
descent | -::=::- |
|
||
____________________________________
|
||
| | | | line_gap
|
||
| | h_advance | ‾
|
||
^
|
||
h_side_bearing</code></pre></div></div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.units_per_em" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#49">Source</a><h4 class="code-header">fn <a href="#tymethod.units_per_em" class="fn">units_per_em</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>Get the size of the font unit</p>
|
||
<p>This returns “font units per em”, where 1em is a base unit of font scale
|
||
(typically the width of a capital ‘M’).</p>
|
||
<p>Returns <code>None</code> in case the font unit size exceeds the expected range.
|
||
See <a href="https://docs.rs/ttf-parser/latest/ttf_parser/struct.Face.html#method.units_per_em"><code>Face::units_per_em</code></a>.</p>
|
||
<p>May be used to calculate <a href="struct.PxScale.html" title="struct ab_glyph::PxScale"><code>PxScale</code></a> from pt size, see <a href="trait.Font.html#method.pt_to_px_scale" title="method ab_glyph::Font::pt_to_px_scale"><code>Font::pt_to_px_scale</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.ascent_unscaled" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#83">Source</a><h4 class="code-header">fn <a href="#tymethod.ascent_unscaled" class="fn">ascent_unscaled</a>(&self) -> <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>Unscaled glyph ascent. See <a href="trait.Font.html#glyph-layout-concepts" title="trait ab_glyph::Font">glyph layout concepts</a>.</p>
|
||
<p>Scaling can be done with <a href="trait.Font.html#method.as_scaled"><code>as_scaled</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.descent_unscaled" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#88">Source</a><h4 class="code-header">fn <a href="#tymethod.descent_unscaled" class="fn">descent_unscaled</a>(&self) -> <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>Unscaled glyph descent. See <a href="trait.Font.html#glyph-layout-concepts" title="trait ab_glyph::Font">glyph layout concepts</a>.</p>
|
||
<p>Scaling can be done with <a href="trait.Font.html#method.as_scaled"><code>as_scaled</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.line_gap_unscaled" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#101">Source</a><h4 class="code-header">fn <a href="#tymethod.line_gap_unscaled" class="fn">line_gap_unscaled</a>(&self) -> <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>Unscaled line gap. See <a href="trait.Font.html#glyph-layout-concepts" title="trait ab_glyph::Font">glyph layout concepts</a>.</p>
|
||
<p>Scaling can be done with <a href="trait.Font.html#method.as_scaled"><code>as_scaled</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.glyph_id" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#106">Source</a><h4 class="code-header">fn <a href="#tymethod.glyph_id" class="fn">glyph_id</a>(&self, c: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.char.html">char</a>) -> <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a></h4></section></summary><div class="docblock"><p>Lookup a <code>GlyphId</code> matching a given <code>char</code>.</p>
|
||
<p>Scaling can be done with <a href="trait.Font.html#method.as_scaled"><code>as_scaled</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.h_advance_unscaled" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#114">Source</a><h4 class="code-header">fn <a href="#tymethod.h_advance_unscaled" class="fn">h_advance_unscaled</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</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>Unscaled horizontal advance for a given glyph id.
|
||
See <a href="trait.Font.html#glyph-layout-concepts" title="trait ab_glyph::Font">glyph layout concepts</a>.</p>
|
||
<p>Returns <code>0.0</code> if the font does not define this value.</p>
|
||
<p>Scaling can be done with <a href="trait.Font.html#method.as_scaled"><code>as_scaled</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.h_side_bearing_unscaled" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#122">Source</a><h4 class="code-header">fn <a href="#tymethod.h_side_bearing_unscaled" class="fn">h_side_bearing_unscaled</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</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>Unscaled horizontal side bearing for a given glyph id.
|
||
See <a href="trait.Font.html#glyph-layout-concepts" title="trait ab_glyph::Font">glyph layout concepts</a>.</p>
|
||
<p>Returns <code>0.0</code> if the font does not define this value.</p>
|
||
<p>Scaling can be done with <a href="trait.Font.html#method.as_scaled"><code>as_scaled</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.v_advance_unscaled" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#129">Source</a><h4 class="code-header">fn <a href="#tymethod.v_advance_unscaled" class="fn">v_advance_unscaled</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</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>Unscaled vertical advance for a given glyph id.</p>
|
||
<p>Returns <code>0.0</code> if the font does not define this value.</p>
|
||
<p>Scaling can be done with <a href="trait.Font.html#method.as_scaled"><code>as_scaled</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.v_side_bearing_unscaled" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#136">Source</a><h4 class="code-header">fn <a href="#tymethod.v_side_bearing_unscaled" class="fn">v_side_bearing_unscaled</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</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>Unscaled vertical side bearing for a given glyph id.</p>
|
||
<p>Returns <code>0.0</code> if the font does not define this value.</p>
|
||
<p>Scaling can be done with <a href="trait.Font.html#method.as_scaled"><code>as_scaled</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.kern_unscaled" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#141">Source</a><h4 class="code-header">fn <a href="#tymethod.kern_unscaled" class="fn">kern_unscaled</a>(&self, first: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>, second: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</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 additional unscaled kerning to apply for a particular pair of glyph ids.</p>
|
||
<p>Scaling can be done with <a href="trait.Font.html#method.as_scaled"><code>as_scaled</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.outline" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#144">Source</a><h4 class="code-header">fn <a href="#tymethod.outline" class="fn">outline</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</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="struct" href="struct.Outline.html" title="struct ab_glyph::Outline">Outline</a>></h4></section></summary><div class="docblock"><p>Compute unscaled glyph outline curves & bounding box.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.glyph_count" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#148">Source</a><h4 class="code-header">fn <a href="#tymethod.glyph_count" class="fn">glyph_count</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>The number of glyphs present in this font. Glyph identifiers for this
|
||
font will always be in the range <code>0..self.glyph_count()</code></p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.codepoint_ids" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#171">Source</a><h4 class="code-header">fn <a href="#tymethod.codepoint_ids" class="fn">codepoint_ids</a>(&self) -> <a class="struct" href="struct.CodepointIdIter.html" title="struct ab_glyph::CodepointIdIter">CodepointIdIter</a><'_> <a href="#" class="tooltip" data-notable-ty="CodepointIdIter<'_>">ⓘ</a></h4></section></summary><div class="docblock"><p>Returns an iterator of all distinct <code>(GlyphId, char)</code> pairs. Not ordered.</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">let </span>font = FontRef::try_from_slice(<span class="macro">include_bytes!</span>(<span class="string">"../../dev/fonts/Exo2-Light.otf"</span>))<span class="question-mark">?</span>;
|
||
|
||
<span class="comment">// Iterate over pairs, each id will appear at most once.
|
||
</span><span class="kw">let </span><span class="kw-2">mut </span>codepoint_ids = font.codepoint_ids();
|
||
<span class="macro">assert_eq!</span>(codepoint_ids.next(), <span class="prelude-val">Some</span>((GlyphId(<span class="number">408</span>), <span class="string">'\r'</span>)));
|
||
<span class="macro">assert_eq!</span>(codepoint_ids.next(), <span class="prelude-val">Some</span>((GlyphId(<span class="number">1</span>), <span class="string">' '</span>)));
|
||
<span class="macro">assert_eq!</span>(codepoint_ids.next(), <span class="prelude-val">Some</span>((GlyphId(<span class="number">75</span>), <span class="string">'!'</span>)));
|
||
|
||
<span class="comment">// Build a lookup map for all ids
|
||
</span><span class="kw">let </span>map: HashMap<<span class="kw">_</span>, <span class="kw">_</span>> = font.codepoint_ids().collect();
|
||
<span class="macro">assert_eq!</span>(map.get(<span class="kw-2">&</span>GlyphId(<span class="number">75</span>)), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">'!'</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.glyph_raster_image2" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#202">Source</a><h4 class="code-header">fn <a href="#tymethod.glyph_raster_image2" class="fn">glyph_raster_image2</a>(
|
||
&self,
|
||
id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>,
|
||
pixel_size: <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><<a class="struct" href="v2/struct.GlyphImage.html" title="struct ab_glyph::v2::GlyphImage">GlyphImage</a><'_>></h4></section></summary><div class="docblock"><p>Returns a pre-rendered image of the glyph.</p>
|
||
<p>This is normally only present when an outline is not sufficient to describe the glyph, such
|
||
as emojis (particularly color ones). The <code>pixel_size</code> parameter is in pixels per em, and will be
|
||
used to select between multiple possible images (if present); the returned image will
|
||
likely not match this value, requiring you to scale it to match the target resolution.
|
||
To get the largest image use <code>u16::MAX</code>.</p>
|
||
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.pt_to_px_scale" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#73-78">Source</a><h4 class="code-header">fn <a href="#method.pt_to_px_scale" class="fn">pt_to_px_scale</a>(&self, pt_size: <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="struct" href="struct.PxScale.html" title="struct ab_glyph::PxScale">PxScale</a>></h4></section></summary><div class="docblock"><p>Converts pt units into <a href="struct.PxScale.html" title="struct ab_glyph::PxScale"><code>PxScale</code></a>.</p>
|
||
<p>Note: To handle a screen scale factor multiply it to the <code>pt_size</code> argument.</p>
|
||
<p>Returns <code>None</code> in case the <a href="trait.Font.html#tymethod.units_per_em" title="method ab_glyph::Font::units_per_em"><code>Font::units_per_em</code></a> unit size exceeds the expected range.</p>
|
||
<h6 id="point-size-pt"><a class="doc-anchor" href="#point-size-pt">§</a>Point size (pt)</h6>
|
||
<p>Font sizes are typically specified in “points”. According to the modern
|
||
standard, 1pt = 1/72in. The “point size” of a font is the number of points
|
||
per em.</p>
|
||
<p>The DPI (dots-per-inch) of a screen depends on the screen in question;
|
||
96 DPI is often considered the “standard”. For high-DPI displays the
|
||
DPI may be specified directly or one may multiply 96 by a scale-factor.</p>
|
||
<p>Thus, for example, a 10pt font on a 96 pixels-per-inch display has
|
||
10 / 72 * 96 = 13.333… pixels-per-em. If we divide this number by
|
||
<code>units_per_em</code> we then get a scaling factor: pixels-per-font-unit.</p>
|
||
<p>Note however that since <a href="struct.PxScale.html" title="struct ab_glyph::PxScale"><code>PxScale</code></a> values are relative to the text height,
|
||
one further step is needed: multiply by <a href="trait.Font.html#method.height_unscaled" title="method ab_glyph::Font::height_unscaled"><code>Font::height_unscaled</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.height_unscaled" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#94-96">Source</a><h4 class="code-header">fn <a href="#method.height_unscaled" class="fn">height_unscaled</a>(&self) -> <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>Unscaled height <code>ascent - descent</code>. See <a href="trait.Font.html#glyph-layout-concepts" title="trait ab_glyph::Font">glyph layout concepts</a>.</p>
|
||
<p>Scaling can be done with <a href="trait.Font.html#method.as_scaled"><code>as_scaled</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_raster_image" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#185-193">Source</a><h4 class="code-header">fn <a href="#method.glyph_raster_image" class="fn">glyph_raster_image</a>(
|
||
&self,
|
||
id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>,
|
||
pixel_size: <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><<a class="struct" href="struct.GlyphImage.html" title="struct ab_glyph::GlyphImage">GlyphImage</a><'_>></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.2.22: Deprecated in favor of <code>glyph_raster_image2</code></span></div></span></summary><div class="docblock"><p>Returns a pre-rendered image of the glyph.</p>
|
||
<p>This is normally only present when an outline is not sufficient to describe the glyph, such
|
||
as emojis (particularly color ones). The <code>pixel_size</code> parameter is in pixels per em, and will be
|
||
used to select between multiple possible images (if present); the returned image will
|
||
likely not match this value, requiring you to scale it to match the target resolution.
|
||
To get the largest image use <code>u16::MAX</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_svg_image" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#209-212">Source</a><h4 class="code-header">fn <a href="#method.glyph_svg_image" class="fn">glyph_svg_image</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</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="struct" href="struct.GlyphSvg.html" title="struct ab_glyph::GlyphSvg">GlyphSvg</a><'_>></h4></section></summary><div class="docblock"><p>Returns raw SVG data of a range of glyphs which includes this one.</p>
|
||
<p>Some fonts define their images as SVG rather than a raster format. SVG data here is raw and
|
||
should be rendered and/or decompressed by the caller, and scaled appropriately. The SVG file
|
||
might include a series of glyphs as nodes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.glyph_bounds" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#223-233">Source</a><h4 class="code-header">fn <a href="#method.glyph_bounds" class="fn">glyph_bounds</a>(&self, glyph: &<a class="struct" href="struct.Glyph.html" title="struct ab_glyph::Glyph">Glyph</a>) -> <a class="struct" href="struct.Rect.html" title="struct ab_glyph::Rect">Rect</a><div class="where">where
|
||
Self: <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></h4></section></summary><div class="docblock"><p>Returns the layout bounds of this glyph.</p>
|
||
<p>Horizontally: Glyph position +/- h_advance/h_side_bearing.
|
||
Vertically: Glyph position +/- ascent/descent.</p>
|
||
<p>These are <em>not</em> the same as <a href="struct.OutlinedGlyph.html#method.px_bounds" title="method ab_glyph::OutlinedGlyph::px_bounds"><code>OutlinedGlyph::px_bounds</code></a>. If you are drawing pixels
|
||
you should use <code>px_bounds</code> and not this method as outlines are not bound by layout
|
||
values.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.outline_glyph" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#237-244">Source</a><h4 class="code-header">fn <a href="#method.outline_glyph" class="fn">outline_glyph</a>(&self, glyph: <a class="struct" href="struct.Glyph.html" title="struct ab_glyph::Glyph">Glyph</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="struct" href="struct.OutlinedGlyph.html" title="struct ab_glyph::OutlinedGlyph">OutlinedGlyph</a>><div class="where">where
|
||
Self: <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></h4></section></summary><div class="docblock"><p>Compute glyph outline ready for drawing.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_scaled" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#261-269">Source</a><h4 class="code-header">fn <a href="#method.as_scaled" class="fn">as_scaled</a><S: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="struct.PxScale.html" title="struct ab_glyph::PxScale">PxScale</a>>>(&self, scale: S) -> <a class="struct" href="struct.PxScaleFont.html" title="struct ab_glyph::PxScaleFont">PxScaleFont</a><&Self><div class="where">where
|
||
Self: <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></h4></section></summary><div class="docblock"><p>Construct a <a href="struct.PxScaleFont.html" title="struct ab_glyph::PxScaleFont"><code>PxScaleFont</code></a> by associating with the given pixel <code>scale</code>.</p>
|
||
<h5 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>font = FontRef::try_from_slice(<span class="macro">include_bytes!</span>(<span class="string">"../../dev/fonts/Exo2-Light.otf"</span>))<span class="question-mark">?</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(font.descent_unscaled(), -<span class="number">201.0</span>);
|
||
|
||
<span class="macro">assert_eq!</span>(font.as_scaled(<span class="number">24.0</span>).descent(), -<span class="number">4.02</span>);
|
||
<span class="macro">assert_eq!</span>(font.as_scaled(<span class="number">50.0</span>).descent(), -<span class="number">8.375</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_scaled" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#273-281">Source</a><h4 class="code-header">fn <a href="#method.into_scaled" class="fn">into_scaled</a><S: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="struct.PxScale.html" title="struct ab_glyph::PxScale">PxScale</a>>>(self, scale: S) -> <a class="struct" href="struct.PxScaleFont.html" title="struct ab_glyph::PxScaleFont">PxScaleFont</a><Self><div class="where">where
|
||
Self: <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></h4></section></summary><div class="docblock"><p>Move into a <a href="struct.PxScaleFont.html" title="struct ab_glyph::PxScaleFont"><code>PxScaleFont</code></a> associated with the given pixel <code>scale</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.font_data" class="method"><a class="src rightside" href="../src/ab_glyph/font.rs.html#297-300">Source</a><h4 class="code-header">fn <a href="#method.font_data" class="fn">font_data</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a></h4></section></summary><div class="docblock"><p>Extracts a slice containing the data passed into e.g. <a href="struct.FontArc.html#method.try_from_slice" title="associated function ab_glyph::FontArc::try_from_slice"><code>FontArc::try_from_slice</code></a>.</p>
|
||
<h5 id="example-2"><a class="doc-anchor" href="#example-2">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>font = FontArc::try_from_slice(owned_font_data)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(font.font_data(), owned_font_data);</code></pre></div>
|
||
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Font-for-%26F" class="impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#303-383">Source</a><a href="#impl-Font-for-%26F" class="anchor">§</a><h3 class="code-header">impl<F: <a class="trait" href="trait.Font.html" title="trait ab_glyph::Font">Font</a>> <a class="trait" href="trait.Font.html" title="trait ab_glyph::Font">Font</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&F</a></h3></section></summary><div class="impl-items"><section id="method.units_per_em" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#305-307">Source</a><a href="#method.units_per_em" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.units_per_em" class="fn">units_per_em</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><section id="method.ascent_unscaled" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#310-312">Source</a><a href="#method.ascent_unscaled" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.ascent_unscaled" class="fn">ascent_unscaled</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section><section id="method.descent_unscaled" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#315-317">Source</a><a href="#method.descent_unscaled" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.descent_unscaled" class="fn">descent_unscaled</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section><section id="method.line_gap_unscaled" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#320-322">Source</a><a href="#method.line_gap_unscaled" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.line_gap_unscaled" class="fn">line_gap_unscaled</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section><section id="method.glyph_id" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#325-327">Source</a><a href="#method.glyph_id" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.glyph_id" class="fn">glyph_id</a>(&self, c: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.char.html">char</a>) -> <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a></h4></section><section id="method.h_advance_unscaled" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#330-332">Source</a><a href="#method.h_advance_unscaled" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.h_advance_unscaled" class="fn">h_advance_unscaled</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section><section id="method.h_side_bearing_unscaled" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#335-337">Source</a><a href="#method.h_side_bearing_unscaled" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.h_side_bearing_unscaled" class="fn">h_side_bearing_unscaled</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section><section id="method.v_advance_unscaled" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#340-342">Source</a><a href="#method.v_advance_unscaled" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.v_advance_unscaled" class="fn">v_advance_unscaled</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section><section id="method.v_side_bearing_unscaled" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#345-347">Source</a><a href="#method.v_side_bearing_unscaled" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.v_side_bearing_unscaled" class="fn">v_side_bearing_unscaled</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section><section id="method.kern_unscaled" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#350-352">Source</a><a href="#method.kern_unscaled" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.kern_unscaled" class="fn">kern_unscaled</a>(&self, first: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>, second: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.f32.html">f32</a></h4></section><section id="method.outline" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#355-357">Source</a><a href="#method.outline" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.outline" class="fn">outline</a>(&self, glyph: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</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="struct" href="struct.Outline.html" title="struct ab_glyph::Outline">Outline</a>></h4></section><section id="method.glyph_count" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#360-362">Source</a><a href="#method.glyph_count" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.glyph_count" class="fn">glyph_count</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section><section id="method.codepoint_ids" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#365-367">Source</a><a href="#method.codepoint_ids" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.codepoint_ids" class="fn">codepoint_ids</a>(&self) -> <a class="struct" href="struct.CodepointIdIter.html" title="struct ab_glyph::CodepointIdIter">CodepointIdIter</a><'_> <a href="#" class="tooltip" data-notable-ty="CodepointIdIter<'_>">ⓘ</a></h4></section><section id="method.glyph_raster_image2" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#370-372">Source</a><a href="#method.glyph_raster_image2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.glyph_raster_image2" class="fn">glyph_raster_image2</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</a>, size: <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><<a class="struct" href="v2/struct.GlyphImage.html" title="struct ab_glyph::v2::GlyphImage">GlyphImage</a><'_>></h4></section><section id="method.glyph_svg_image-1" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#375-377">Source</a><a href="#method.glyph_svg_image-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.glyph_svg_image" class="fn">glyph_svg_image</a>(&self, id: <a class="struct" href="struct.GlyphId.html" title="struct ab_glyph::GlyphId">GlyphId</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="struct" href="struct.GlyphSvg.html" title="struct ab_glyph::GlyphSvg">GlyphSvg</a><'_>></h4></section><section id="method.font_data-1" class="method trait-impl"><a class="src rightside" href="../src/ab_glyph/font.rs.html#380-382">Source</a><a href="#method.font_data-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.font_data" class="fn">font_data</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Font-for-FontArc" class="impl"><a class="src rightside" href="../src/ab_glyph/font_arc.rs.html#73-153">Source</a><a href="#impl-Font-for-FontArc" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Font.html" title="trait ab_glyph::Font">Font</a> for <a class="struct" href="struct.FontArc.html" title="struct ab_glyph::FontArc">FontArc</a></h3></section><section id="impl-Font-for-FontRef%3C'_%3E" class="impl"><a class="src rightside" href="../src/ab_glyph/ttfp.rs.html#364">Source</a><a href="#impl-Font-for-FontRef%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Font.html" title="trait ab_glyph::Font">Font</a> for <a class="struct" href="struct.FontRef.html" title="struct ab_glyph::FontRef">FontRef</a><'_></h3></section><section id="impl-Font-for-FontVec" class="impl"><a class="src rightside" href="../src/ab_glyph/ttfp.rs.html#365">Source</a><a href="#impl-Font-for-FontVec" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Font.html" title="trait ab_glyph::Font">Font</a> for <a class="struct" href="struct.FontVec.html" title="struct ab_glyph::FontVec">FontVec</a></h3></section></div><script src="../trait.impl/ab_glyph/font/trait.Font.js" async></script><script type="text/json" id="notable-traits-data">{"&[u8]":"<h3>Notable traits for <code>&[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.84.0/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.0/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.84.0/std/primitive.u8.html\">u8</a>]</div>","CodepointIdIter<'_>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.CodepointIdIter.html\" title=\"struct ab_glyph::CodepointIdIter\">CodepointIdIter</a><'a></code></h3><pre><code><div class=\"where\">impl<'a> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.CodepointIdIter.html\" title=\"struct ab_glyph::CodepointIdIter\">CodepointIdIter</a><'a></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = (<a class=\"struct\" href=\"struct.GlyphId.html\" title=\"struct ab_glyph::GlyphId\">GlyphId</a>, <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.84.0/std/primitive.char.html\">char</a>);</div>"}</script></section></div></main></body></html> |