summaryrefslogtreecommitdiffstats
path: root/glow/src/backend.rs
diff options
context:
space:
mode:
Diffstat (limited to 'glow/src/backend.rs')
-rw-r--r--glow/src/backend.rs23
1 files changed, 12 insertions, 11 deletions
diff --git a/glow/src/backend.rs b/glow/src/backend.rs
index c98aa5fe..6bd443ad 100644
--- a/glow/src/backend.rs
+++ b/glow/src/backend.rs
@@ -101,7 +101,6 @@ impl Backend {
for text in layer.text.iter() {
// Target physical coordinates directly to avoid blurry text
let text = glow_glyph::Section {
- text: text.content,
// TODO: We `round` here to avoid rerasterizing text when
// its position changes slightly. This can make text feel a
// bit "jumpy". We may be able to do better once we improve
@@ -123,12 +122,18 @@ impl Backend {
(text.bounds.width * scale_factor).ceil(),
(text.bounds.height * scale_factor).ceil(),
),
- scale: glow_glyph::Scale {
- x: text.size * scale_factor,
- y: text.size * scale_factor,
- },
- color: text.color,
- font_id: self.text_pipeline.find_font(text.font),
+ text: vec![glow_glyph::Text {
+ text: text.content,
+ scale: glow_glyph::ab_glyph::PxScale {
+ x: text.size * scale_factor,
+ y: text.size * scale_factor,
+ },
+ font_id: self.text_pipeline.find_font(text.font),
+ extra: glow_glyph::Extra {
+ color: text.color,
+ z: 0.0,
+ },
+ }],
layout: glow_glyph::Layout::default()
.h_align(match text.horizontal_alignment {
HorizontalAlignment::Left => {
@@ -191,10 +196,6 @@ impl backend::Text for Backend {
) -> (f32, f32) {
self.text_pipeline.measure(contents, size, font, bounds)
}
-
- fn space_width(&self, size: f32) -> f32 {
- self.text_pipeline.space_width(size)
- }
}
#[cfg(feature = "image")]