Commit 5fead54 1 parent bc180a6 commit 5fead54 Copy full SHA for 5fead54
File tree 2 files changed +2
-11
lines changed
2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -179,8 +179,7 @@ impl CachingShaper {
179
179
180
180
let bare_font_height = ( metrics. ascent + metrics. descent + metrics. leading ) . ceil ( ) ;
181
181
let font_height = bare_font_height as i64 + self . linespace ;
182
- let font_width =
183
- ( glyph_advance + ( self . options . width - self . options . size + 0.5 ) ) . floor ( ) as u64 ;
182
+ let font_width = ( glyph_advance + self . options . width + 0.5 ) . floor ( ) as u64 ;
184
183
185
184
(
186
185
font_width,
Original file line number Diff line number Diff line change @@ -32,8 +32,6 @@ impl FontOptions {
32
32
}
33
33
}
34
34
35
- let mut width_set = false ;
36
-
37
35
for part in parts {
38
36
if let Some ( hinting_string) = part. strip_prefix ( "#h-" ) {
39
37
font_options. hinting = FontHinting :: parse ( hinting_string) ;
@@ -45,16 +43,10 @@ impl FontOptions {
45
43
}
46
44
if let Ok ( parsed_size) = part[ 1 ..] . parse :: < f32 > ( ) {
47
45
font_options. size = points_to_pixels ( parsed_size) ;
48
-
49
- // if the width has not been set via "w" operator set it to the font size
50
- if !width_set {
51
- font_options. width = font_options. size ;
52
- }
53
46
}
54
47
} else if part. starts_with ( 'w' ) && part. len ( ) > 1 {
55
48
if let Ok ( parsed_size) = part[ 1 ..] . parse :: < f32 > ( ) {
56
49
font_options. width = points_to_pixels ( parsed_size) ;
57
- width_set = true ;
58
50
}
59
51
} else if part == "b" {
60
52
font_options. bold = true ;
@@ -79,7 +71,7 @@ impl Default for FontOptions {
79
71
italic : false ,
80
72
allow_float_size : false ,
81
73
size : points_to_pixels ( DEFAULT_FONT_SIZE ) ,
82
- width : points_to_pixels ( DEFAULT_FONT_SIZE ) ,
74
+ width : 0.0 ,
83
75
hinting : FontHinting :: default ( ) ,
84
76
edging : FontEdging :: default ( ) ,
85
77
}
You can’t perform that action at this time.
0 commit comments