@@ -44,16 +44,16 @@ struct Args {
44
44
font_file : Option < PathBuf > ,
45
45
face_index : u32 ,
46
46
font_ptem : Option < f32 > ,
47
- variations : Vec < rustybuzz :: Variation > ,
47
+ variations : Vec < harfruzz :: Variation > ,
48
48
text : Option < String > ,
49
49
text_file : Option < PathBuf > ,
50
50
unicodes : Option < String > ,
51
- direction : Option < rustybuzz :: Direction > ,
52
- language : rustybuzz :: Language ,
53
- script : Option < rustybuzz :: Script > ,
51
+ direction : Option < harfruzz :: Direction > ,
52
+ language : harfruzz :: Language ,
53
+ script : Option < harfruzz :: Script > ,
54
54
utf8_clusters : bool ,
55
- cluster_level : rustybuzz :: BufferClusterLevel ,
56
- features : Vec < rustybuzz :: Feature > ,
55
+ cluster_level : harfruzz :: BufferClusterLevel ,
56
+ features : Vec < harfruzz :: Feature > ,
57
57
no_glyph_names : bool ,
58
58
no_positions : bool ,
59
59
no_advances : bool ,
@@ -145,7 +145,7 @@ fn main() {
145
145
}
146
146
147
147
let font_data = std:: fs:: read ( font_path) . unwrap ( ) ;
148
- let mut face = rustybuzz :: Face :: from_slice ( & font_data, args. face_index ) . unwrap ( ) ;
148
+ let mut face = harfruzz :: Face :: from_slice ( & font_data, args. face_index ) . unwrap ( ) ;
149
149
150
150
face. set_points_per_em ( args. font_ptem ) ;
151
151
@@ -175,7 +175,7 @@ fn main() {
175
175
} ;
176
176
177
177
for text in lines {
178
- let mut buffer = rustybuzz :: UnicodeBuffer :: new ( ) ;
178
+ let mut buffer = harfruzz :: UnicodeBuffer :: new ( ) ;
179
179
buffer. push_str ( & text) ;
180
180
181
181
if let Some ( d) = args. direction {
@@ -194,31 +194,31 @@ fn main() {
194
194
buffer. reset_clusters ( ) ;
195
195
}
196
196
197
- let glyph_buffer = rustybuzz :: shape ( & face, & args. features , buffer) ;
197
+ let glyph_buffer = harfruzz :: shape ( & face, & args. features , buffer) ;
198
198
199
- let mut format_flags = rustybuzz :: SerializeFlags :: default ( ) ;
199
+ let mut format_flags = harfruzz :: SerializeFlags :: default ( ) ;
200
200
if args. no_glyph_names {
201
- format_flags |= rustybuzz :: SerializeFlags :: NO_GLYPH_NAMES ;
201
+ format_flags |= harfruzz :: SerializeFlags :: NO_GLYPH_NAMES ;
202
202
}
203
203
204
204
if args. no_clusters || args. ned {
205
- format_flags |= rustybuzz :: SerializeFlags :: NO_CLUSTERS ;
205
+ format_flags |= harfruzz :: SerializeFlags :: NO_CLUSTERS ;
206
206
}
207
207
208
208
if args. no_positions {
209
- format_flags |= rustybuzz :: SerializeFlags :: NO_POSITIONS ;
209
+ format_flags |= harfruzz :: SerializeFlags :: NO_POSITIONS ;
210
210
}
211
211
212
212
if args. no_advances || args. ned {
213
- format_flags |= rustybuzz :: SerializeFlags :: NO_ADVANCES ;
213
+ format_flags |= harfruzz :: SerializeFlags :: NO_ADVANCES ;
214
214
}
215
215
216
216
if args. show_extents {
217
- format_flags |= rustybuzz :: SerializeFlags :: GLYPH_EXTENTS ;
217
+ format_flags |= harfruzz :: SerializeFlags :: GLYPH_EXTENTS ;
218
218
}
219
219
220
220
if args. show_flags {
221
- format_flags |= rustybuzz :: SerializeFlags :: GLYPH_FLAGS ;
221
+ format_flags |= harfruzz :: SerializeFlags :: GLYPH_FLAGS ;
222
222
}
223
223
224
224
println ! ( "{}" , glyph_buffer. serialize( & face, format_flags) ) ;
@@ -239,39 +239,39 @@ fn parse_unicodes(s: &str) -> Result<String, String> {
239
239
Ok ( text)
240
240
}
241
241
242
- fn parse_features ( s : & str ) -> Result < Vec < rustybuzz :: Feature > , String > {
242
+ fn parse_features ( s : & str ) -> Result < Vec < harfruzz :: Feature > , String > {
243
243
let mut features = Vec :: new ( ) ;
244
244
for f in s. split ( ',' ) {
245
- features. push ( rustybuzz :: Feature :: from_str ( & f) ?) ;
245
+ features. push ( harfruzz :: Feature :: from_str ( & f) ?) ;
246
246
}
247
247
248
248
Ok ( features)
249
249
}
250
250
251
- fn parse_variations ( s : & str ) -> Result < Vec < rustybuzz :: Variation > , String > {
251
+ fn parse_variations ( s : & str ) -> Result < Vec < harfruzz :: Variation > , String > {
252
252
let mut variations = Vec :: new ( ) ;
253
253
for v in s. split ( ',' ) {
254
- variations. push ( rustybuzz :: Variation :: from_str ( & v) ?) ;
254
+ variations. push ( harfruzz :: Variation :: from_str ( & v) ?) ;
255
255
}
256
256
257
257
Ok ( variations)
258
258
}
259
259
260
- fn parse_cluster ( s : & str ) -> Result < rustybuzz :: BufferClusterLevel , String > {
260
+ fn parse_cluster ( s : & str ) -> Result < harfruzz :: BufferClusterLevel , String > {
261
261
match s {
262
- "0" => Ok ( rustybuzz :: BufferClusterLevel :: MonotoneGraphemes ) ,
263
- "1" => Ok ( rustybuzz :: BufferClusterLevel :: MonotoneCharacters ) ,
264
- "2" => Ok ( rustybuzz :: BufferClusterLevel :: Characters ) ,
262
+ "0" => Ok ( harfruzz :: BufferClusterLevel :: MonotoneGraphemes ) ,
263
+ "1" => Ok ( harfruzz :: BufferClusterLevel :: MonotoneCharacters ) ,
264
+ "2" => Ok ( harfruzz :: BufferClusterLevel :: Characters ) ,
265
265
_ => Err ( format ! ( "invalid cluster level" ) ) ,
266
266
}
267
267
}
268
268
269
- fn system_language ( ) -> rustybuzz :: Language {
269
+ fn system_language ( ) -> harfruzz :: Language {
270
270
unsafe {
271
271
libc:: setlocale ( libc:: LC_ALL , b"\0 " as * const _ as * const i8 ) ;
272
272
let s = libc:: setlocale ( libc:: LC_CTYPE , std:: ptr:: null ( ) ) ;
273
273
let s = std:: ffi:: CStr :: from_ptr ( s) ;
274
274
let s = s. to_str ( ) . expect ( "locale must be ASCII" ) ;
275
- rustybuzz :: Language :: from_str ( s) . unwrap ( )
275
+ harfruzz :: Language :: from_str ( s) . unwrap ( )
276
276
}
277
277
}
0 commit comments