Struct riddle_font::ImgFontGenerator [−][src]
pub struct ImgFontGenerator { /* fields omitted */ }
A utility for generating ImgFont
s from TTFont
s.
Example
let ttf_font = TTFont::load(&font_bytes[..])?; let img_font = ImgFontGenerator::new("ABCDEF", 32).generate(&ttf_font)?; assert_eq!(6, img_font.glyphs().len());
Implementations
impl ImgFontGenerator
[src]
pub fn new(chars: &str, pixel_height: u32) -> Self
[src]
Create a new generator, specifying the set of characters to generate and the pixel height at which the font will be rendered.
pub fn packing_size_policy(
&mut self,
policy: ImagePackerSizePolicy
) -> &mut Self
[src]
&mut self,
policy: ImagePackerSizePolicy
) -> &mut Self
Override the packing rule which controls how the individual glyph images are combined in to
the final image. See riddle_image::packer::ImagePackerSizePolicy
.
The default is riddle_image::packer::ImagePackerSizePolicy::Pow2Square
.
pub fn generate(&self, ttfont: &TTFont) -> Result<ImgFont, FontError>
[src]
Build the ImgFont for the given TTFont
using the parameters specified in the generator.
Trait Implementations
impl Clone for ImgFontGenerator
[src]
fn clone(&self) -> ImgFontGenerator
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for ImgFontGenerator
[src]
fn default() -> ImgFontGenerator
[src]
Auto Trait Implementations
impl RefUnwindSafe for ImgFontGenerator
impl Send for ImgFontGenerator
impl Sync for ImgFontGenerator
impl Unpin for ImgFontGenerator
impl UnwindSafe for ImgFontGenerator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut 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.
pub 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>,