Skip to content

Commit e3e2d1f

Browse files
committed
Update edition to 2024
1 parent 9db1714 commit e3e2d1f

File tree

6 files changed

+44
-32
lines changed

6 files changed

+44
-32
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "wgpu_glyph"
33
version = "0.23.0"
44
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
5-
edition = "2021"
5+
edition = "2024"
66
description = "A fast text renderer for wgpu, powered by glyph_brush"
77
license = "MIT"
88
keywords = ["font", "ttf", "truetype", "wgpu", "text"]

examples/clipping.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::error::Error;
22
use wgpu::CompositeAlphaMode;
3-
use wgpu_glyph::{ab_glyph, GlyphBrushBuilder, Region, Section, Text};
3+
use wgpu_glyph::{GlyphBrushBuilder, Region, Section, Text, ab_glyph};
44

55
fn main() -> Result<(), Box<dyn Error>> {
66
env_logger::init();
@@ -143,9 +143,11 @@ fn main() -> Result<(), Box<dyn Error>> {
143143
glyph_brush.queue(Section {
144144
screen_position: (30.0, 30.0),
145145
bounds: (size.width as f32, size.height as f32),
146-
text: vec![Text::new("Hello wgpu_glyph!")
147-
.with_color([0.0, 0.0, 0.0, 1.0])
148-
.with_scale(40.0)],
146+
text: vec![
147+
Text::new("Hello wgpu_glyph!")
148+
.with_color([0.0, 0.0, 0.0, 1.0])
149+
.with_scale(40.0),
150+
],
149151
..Section::default()
150152
});
151153

@@ -164,9 +166,11 @@ fn main() -> Result<(), Box<dyn Error>> {
164166
glyph_brush.queue(Section {
165167
screen_position: (30.0, 90.0),
166168
bounds: (size.width as f32, size.height as f32),
167-
text: vec![Text::new("Hello wgpu_glyph!")
168-
.with_color([1.0, 1.0, 1.0, 1.0])
169-
.with_scale(40.0)],
169+
text: vec![
170+
Text::new("Hello wgpu_glyph!")
171+
.with_color([1.0, 1.0, 1.0, 1.0])
172+
.with_scale(40.0),
173+
],
170174
..Section::default()
171175
});
172176

examples/depth.rs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::error::Error;
22
use wgpu::CompositeAlphaMode;
3-
use wgpu_glyph::{ab_glyph, GlyphBrushBuilder, Section, Text};
3+
use wgpu_glyph::{GlyphBrushBuilder, Section, Text, ab_glyph};
44

55
const FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Bgra8UnormSrgb;
66

@@ -133,11 +133,13 @@ fn main() -> Result<(), Box<dyn Error>> {
133133
// Depth buffer will make it appear on top.
134134
glyph_brush.queue(Section {
135135
screen_position: (30.0, 30.0),
136-
text: vec![Text::default()
137-
.with_text("On top")
138-
.with_scale(95.0)
139-
.with_color([0.8, 0.8, 0.8, 1.0])
140-
.with_z(0.9)],
136+
text: vec![
137+
Text::default()
138+
.with_text("On top")
139+
.with_scale(95.0)
140+
.with_color([0.8, 0.8, 0.8, 1.0])
141+
.with_z(0.9),
142+
],
141143
..Section::default()
142144
});
143145

@@ -146,15 +148,17 @@ fn main() -> Result<(), Box<dyn Error>> {
146148
// previous queued text.
147149
glyph_brush.queue(Section {
148150
bounds: (size.width as f32, size.height as f32),
149-
text: vec![Text::default()
150-
.with_text(
151-
&include_str!("lipsum.txt")
152-
.replace("\n\n", "")
153-
.repeat(10),
154-
)
155-
.with_scale(30.0)
156-
.with_color([0.05, 0.05, 0.1, 1.0])
157-
.with_z(0.2)],
151+
text: vec![
152+
Text::default()
153+
.with_text(
154+
&include_str!("lipsum.txt")
155+
.replace("\n\n", "")
156+
.repeat(10),
157+
)
158+
.with_scale(30.0)
159+
.with_color([0.05, 0.05, 0.1, 1.0])
160+
.with_z(0.2),
161+
],
158162
..Section::default()
159163
});
160164

examples/hello.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::error::Error;
22
use wgpu::CompositeAlphaMode;
3-
use wgpu_glyph::{ab_glyph, GlyphBrushBuilder, Section, Text};
3+
use wgpu_glyph::{GlyphBrushBuilder, Section, Text, ab_glyph};
44

55
fn main() -> Result<(), Box<dyn Error>> {
66
env_logger::init();
@@ -143,18 +143,22 @@ fn main() -> Result<(), Box<dyn Error>> {
143143
glyph_brush.queue(Section {
144144
screen_position: (30.0, 30.0),
145145
bounds: (size.width as f32, size.height as f32),
146-
text: vec![Text::new("Hello wgpu_glyph!")
147-
.with_color([0.0, 0.0, 0.0, 1.0])
148-
.with_scale(40.0)],
146+
text: vec![
147+
Text::new("Hello wgpu_glyph!")
148+
.with_color([0.0, 0.0, 0.0, 1.0])
149+
.with_scale(40.0),
150+
],
149151
..Section::default()
150152
});
151153

152154
glyph_brush.queue(Section {
153155
screen_position: (30.0, 90.0),
154156
bounds: (size.width as f32, size.height as f32),
155-
text: vec![Text::new("Hello wgpu_glyph!")
156-
.with_color([1.0, 1.0, 1.0, 1.0])
157-
.with_scale(40.0)],
157+
text: vec![
158+
Text::new("Hello wgpu_glyph!")
159+
.with_color([1.0, 1.0, 1.0, 1.0])
160+
.with_scale(40.0),
161+
],
158162
..Section::default()
159163
});
160164

src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use core::hash::BuildHasher;
22

3+
use glyph_brush::DefaultSectionHasher;
34
use glyph_brush::ab_glyph::Font;
45
use glyph_brush::delegate_glyph_brush_builder_fns;
5-
use glyph_brush::DefaultSectionHasher;
66

77
use super::GlyphBrush;
88

src/pipeline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use cache::Cache;
55

66
use bytemuck::{Pod, Zeroable};
77
use core::num::NonZeroU64;
8-
use glyph_brush::ab_glyph::{point, Rect};
8+
use glyph_brush::ab_glyph::{Rect, point};
99
use std::marker::PhantomData;
1010
use std::mem;
1111

0 commit comments

Comments
 (0)