1
- //! Creating and using fonts.
1
+ //! Creating and using OpenType fonts.
2
+ //!
3
+ //! krilla has extensive support for OpenType fonts. It supports CFF-based as well
4
+ //! as glyf-based font OpenType fonts. In addition to that, krilla also supports
5
+ //! all of the major tables used in color fonts, including the `SVG`, `COLR`, `sbix`,
6
+ //! `CBDT`/`EBDT` tables, something that, to the best of my knowledge, no other
7
+ //! Rust crates provides.
8
+ //!
9
+ //! Even better is the fact that you do not need to take care of choosing the right
10
+ //! table for drawing glyphs: All you need to do is to provide the `Font` object with
11
+ //! an appropriate index and variation coordinates,
12
+ //!
13
+ //! krilla, in principle, also supports variable fonts. However, at the moment, variable
14
+ //! fonts are not encoded in the most efficient way (they are stored as Type3 fonts instead
15
+ //! of embedded TTF/CFF fonts, due to the lack of an instancing crate in the Rust ecosystem),
16
+ //! so if possible you should prefer static versions of font. But in principle, using fonts
17
+ //! with non-default variation coordinates should work, too.
2
18
3
19
use crate :: error:: KrillaResult ;
4
20
use crate :: serialize:: SvgSettings ;
@@ -22,6 +38,8 @@ pub(crate) mod colr;
22
38
pub ( crate ) mod outline;
23
39
pub ( crate ) mod svg;
24
40
41
+ // TODO: Test TrueType collection
42
+
25
43
/// An OpenType font. Can be a TrueType, OpenType fonts or TrueType collections.
26
44
/// It holds a reference to the underlying data as well as some basic information
27
45
/// about the font.
0 commit comments