Macro webgl2_glyph::glyph_brush::delegate_glyph_brush_builder_fns [−][src]
macro_rules! delegate_glyph_brush_builder_fns {
($inner : ident) => { ... };
}
Expand description
Macro to delegate builder methods to an inner glyph_brush::GlyphBrushBuilder
Implements:
add_font_bytes
add_font
initial_cache_size
draw_cache_scale_tolerance
draw_cache_position_tolerance
draw_cache_align_4x4
cache_glyph_positioning
cache_redraws
Example
use glyph_brush::{ab_glyph::*, *};
use std::hash::BuildHasher;
pub struct DownstreamGlyphBrushBuilder<F, H> {
inner: glyph_brush::GlyphBrushBuilder<F, H>,
some_config: bool,
}
impl<F: Font, H: BuildHasher> DownstreamGlyphBrushBuilder<F, H> {
delegate_glyph_brush_builder_fns!(inner);
/// Sets some downstream configuration
pub fn some_config(mut self, some_config: bool) -> Self {
self.some_config = some_config;
self
}
// Must be manually delegated
pub fn section_hasher<T: BuildHasher>(
self,
section_hasher: T,
) -> DownstreamGlyphBrushBuilder<F, T> {
DownstreamGlyphBrushBuilder {
inner: self.inner.section_hasher(section_hasher),
some_config: self.some_config,
}
}
pub fn build(self) -> DownstreamGlyphBrush {
// ...
}
}