File tree 2 files changed +12
-1
lines changed 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,13 @@ impl Font {
77
77
self . atlas = atlas;
78
78
}
79
79
80
+ pub ( crate ) fn set_characters (
81
+ & mut self ,
82
+ characters : Arc < Mutex < HashMap < ( char , u16 ) , CharacterInfo > > > ,
83
+ ) {
84
+ self . characters = characters;
85
+ }
86
+
80
87
pub ( crate ) fn ascent ( & self , font_size : f32 ) -> f32 {
81
88
self . font . horizontal_line_metrics ( font_size) . unwrap ( ) . ascent
82
89
}
Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ use crate::{
10
10
Error ,
11
11
} ;
12
12
13
- use std:: sync:: { Arc , Mutex } ;
13
+ use std:: {
14
+ collections:: HashMap ,
15
+ sync:: { Arc , Mutex } ,
16
+ } ;
14
17
15
18
pub struct StyleBuilder {
16
19
atlas : Arc < Mutex < Atlas > > ,
@@ -60,6 +63,7 @@ impl StyleBuilder {
60
63
pub fn with_font ( self , font : & Font ) -> Result < StyleBuilder , Error > {
61
64
let mut font = font. clone ( ) ;
62
65
font. set_atlas ( self . atlas . clone ( ) ) ;
66
+ font. set_characters ( Arc :: new ( Mutex :: new ( HashMap :: new ( ) ) ) ) ;
63
67
Ok ( StyleBuilder {
64
68
font : Arc :: new ( Mutex :: new ( font) ) ,
65
69
..self
You can’t perform that action at this time.
0 commit comments