Draft Font type and implement Text::font

This commit is contained in:
Héctor Ramón Jiménez 2019-11-13 07:22:21 +01:00
parent f0b1e65ba4
commit 6857829dc3
10 changed files with 96 additions and 31 deletions

View file

@ -147,6 +147,7 @@ impl Renderer {
bounds,
size,
color,
font,
horizontal_alignment,
vertical_alignment,
} => {
@ -179,6 +180,7 @@ impl Renderer {
bounds: (bounds.width, bounds.height),
scale: wgpu_glyph::Scale { x: *size, y: *size },
color: color.into_linear(),
font_id: self.text_pipeline.find_font(*font),
layout: wgpu_glyph::Layout::default()
.h_align(match horizontal_alignment {
iced_native::text::HorizontalAlignment::Left => {