File tree 3 files changed +25
-1
lines changed
3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -575,6 +575,20 @@ impl ContextImpl {
575
575
match family. priority {
576
576
FontPriority :: Highest => fam. insert ( 0 , font. name . clone ( ) ) ,
577
577
FontPriority :: Lowest => fam. push ( font. name . clone ( ) ) ,
578
+ FontPriority :: Above ( name) => {
579
+ let position = fam
580
+ . iter ( )
581
+ . position ( |f| f == name. as_ref ( ) )
582
+ . unwrap_or ( fam. len ( ) ) ;
583
+ fam. insert ( position, font. name . clone ( ) ) ;
584
+ }
585
+ FontPriority :: Below ( name) => {
586
+ let position = fam
587
+ . iter ( )
588
+ . position ( |f| f == name. as_ref ( ) )
589
+ . unwrap_or ( fam. len ( ) - 1 ) ;
590
+ fam. insert ( position + 1 , font. name . clone ( ) ) ;
591
+ }
578
592
}
579
593
}
580
594
font_definitions
Original file line number Diff line number Diff line change @@ -209,6 +209,16 @@ pub enum FontPriority {
209
209
///
210
210
/// This font will only be used if the glyph is not found in any of the previously installed fonts.
211
211
Lowest ,
212
+
213
+ /// Insert this font above the given family in the priority stack.
214
+ ///
215
+ /// If the given family cannot be found, this font will be placed at the lowest priority.
216
+ Above ( Cow < ' static , str > ) ,
217
+
218
+ /// Insert this font below the given family in the priority stack.
219
+ ///
220
+ /// If the given family cannot be found, this font will be placed at the lowest priority.
221
+ Below ( Cow < ' static , str > ) ,
212
222
}
213
223
214
224
impl FontInsert {
Original file line number Diff line number Diff line change @@ -599,7 +599,7 @@ pub mod named_variants {
599
599
/// Enables display of font-specific alternate annotation forms.
600
600
pub annotation : u16 ,
601
601
/// Selects the way East Asian glyphs are rendered.
602
- east_asian_variant : EastAsianVariant ,
602
+ pub east_asian_variant : EastAsianVariant ,
603
603
/// Selects the width variants of East Asian glyphs.
604
604
pub east_asian_width : Option < EastAsianWidth > ,
605
605
/// Enables display of ruby (superscript-like annotations) variant glyphs.
You can’t perform that action at this time.
0 commit comments