[−][src]Struct wgpu_glyph::GlyphBrushBuilder
Builder for a GlyphBrush
.
Methods
impl<'a> GlyphBrushBuilder<'a, ()>
[src]
pub fn using_font_bytes<B: Into<SharedBytes<'a>>>(font_0_data: B) -> Self
[src]
Specifies the default font data used to render glyphs.
Referenced with FontId(0)
, which is default.
pub fn using_fonts_bytes<B, V>(font_data: V) -> Self where
B: Into<SharedBytes<'a>>,
V: Into<Vec<B>>,
[src]
B: Into<SharedBytes<'a>>,
V: Into<Vec<B>>,
pub fn using_font(font_0: Font<'a>) -> Self
[src]
Specifies the default font used to render glyphs.
Referenced with FontId(0)
, which is default.
pub fn using_fonts<V: Into<Vec<Font<'a>>>>(fonts: V) -> Self
[src]
impl<'a, D, H: BuildHasher> GlyphBrushBuilder<'a, D, H>
[src]
pub fn add_font_bytes<B: Into<SharedBytes<'a>>>(
&mut self,
font_data: B
) -> FontId
&mut self,
font_data: B
) -> FontId
Adds additional fonts to the one added in using_font
/
using_font_bytes
.
Returns a FontId
to reference this font.
pub fn add_font(&mut self, font_data: Font<'a>) -> FontId
Adds additional fonts to the one added in using_font
/
using_font_bytes
.
Returns a FontId
to reference this font.
pub fn initial_cache_size(self, size: (u32, u32)) -> Self
Initial size of 2D texture used as a gpu cache, pixels (width, height). The GPU cache will dynamically quadruple in size whenever the current size is insufficient.
Defaults to (256, 256)
pub fn gpu_cache_scale_tolerance(self, tolerance: f32) -> Self
Sets the maximum allowed difference in scale used for judging whether to reuse an existing glyph in the GPU cache.
Defaults to 0.5
See rusttype docs for rusttype::gpu_cache::Cache
pub fn gpu_cache_position_tolerance(self, tolerance: f32) -> Self
Sets the maximum allowed difference in subpixel position used for judging whether to reuse an existing glyph in the GPU cache. Anything greater than or equal to 1.0 means "don't care".
Defaults to 0.1
See rusttype docs for rusttype::gpu_cache::Cache
pub fn gpu_cache_align_4x4(self, b: bool) -> Self
Align glyphs in texture cache to 4x4 texel boundaries.
If your backend requires texture updates to be aligned to 4x4 texel
boundaries (e.g. WebGL), this should be set to true
.
Defaults to false
See rusttype docs for rusttype::gpu_cache::Cache
pub fn cache_glyph_positioning(self, cache: bool) -> Self
Sets whether perform the calculation of glyph positioning according to the layout
every time, or use a cached result if the input Section
and GlyphPositioner
are the
same hash as a previous call.
Improves performance. Should only disable if using a custom GlyphPositioner that is
impure according to it's inputs, so caching a previous call is not desired. Disabling
also disables cache_glyph_drawing
.
Defaults to true
pub fn cache_glyph_drawing(self, cache: bool) -> Self
Sets optimising drawing by reusing the last draw requesting an identical draw queue.
Improves performance. Is disabled if
cache_glyph_positioning
is disabled.
Defaults to true
pub fn texture_filter_method(self, filter_method: FilterMode) -> Self
[src]
Sets the texture filtering method.
pub fn section_hasher<T: BuildHasher>(
self,
section_hasher: T
) -> GlyphBrushBuilder<'a, D, T>
[src]
self,
section_hasher: T
) -> GlyphBrushBuilder<'a, D, T>
Sets the section hasher. GlyphBrush
cannot handle absolute section
hash collisions so use a good hash algorithm.
This hasher is used to distinguish sections, rather than for hashmap internal use.
Defaults to seahash.
pub fn depth_stencil_state(
self,
depth_stencil_state: DepthStencilStateDescriptor
) -> GlyphBrushBuilder<'a, DepthStencilStateDescriptor, H>
[src]
self,
depth_stencil_state: DepthStencilStateDescriptor
) -> GlyphBrushBuilder<'a, DepthStencilStateDescriptor, H>
Sets the depth stencil.
impl<'a, H: BuildHasher> GlyphBrushBuilder<'a, (), H>
[src]
pub fn build(
self,
device: &mut Device,
render_format: TextureFormat
) -> GlyphBrush<'a, (), H>
[src]
self,
device: &mut Device,
render_format: TextureFormat
) -> GlyphBrush<'a, (), H>
Builds a GlyphBrush
using the given wgpu::Device
that can render
text for texture views with the given render_format
.
impl<'a, H: BuildHasher> GlyphBrushBuilder<'a, DepthStencilStateDescriptor, H>
[src]
pub fn build(
self,
device: &mut Device,
render_format: TextureFormat
) -> GlyphBrush<'a, DepthStencilStateDescriptor, H>
[src]
self,
device: &mut Device,
render_format: TextureFormat
) -> GlyphBrush<'a, DepthStencilStateDescriptor, H>
Builds a GlyphBrush
using the given wgpu::Device
that can render
text for texture views with the given render_format
.
Trait Implementations
impl<'a, H> From<GlyphBrushBuilder<'a, H>> for GlyphBrushBuilder<'a, (), H>
[src]
fn from(inner: GlyphBrushBuilder<'a, H>) -> Self
[src]
Auto Trait Implementations
impl<'a, D, H> Send for GlyphBrushBuilder<'a, D, H> where
D: Send,
H: Send,
D: Send,
H: Send,
impl<'a, D, H> Sync for GlyphBrushBuilder<'a, D, H> where
D: Sync,
H: Sync,
D: Sync,
H: Sync,
impl<'a, D, H> Unpin for GlyphBrushBuilder<'a, D, H> where
D: Unpin,
H: Unpin,
D: Unpin,
H: Unpin,
impl<'a, D, H> UnwindSafe for GlyphBrushBuilder<'a, D, H> where
D: UnwindSafe,
H: UnwindSafe,
D: UnwindSafe,
H: UnwindSafe,
impl<'a, D, H> RefUnwindSafe for GlyphBrushBuilder<'a, D, H> where
D: RefUnwindSafe,
H: RefUnwindSafe,
D: RefUnwindSafe,
H: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,