Skip to content

Commit 6aa979a

Browse files
committed
touch up docs for fonts
1 parent 35e1372 commit 6aa979a

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/font/mod.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
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.
218
319
use crate::error::KrillaResult;
420
use crate::serialize::SvgSettings;
@@ -22,6 +38,8 @@ pub(crate) mod colr;
2238
pub(crate) mod outline;
2339
pub(crate) mod svg;
2440

41+
// TODO: Test TrueType collection
42+
2543
/// An OpenType font. Can be a TrueType, OpenType fonts or TrueType collections.
2644
/// It holds a reference to the underlying data as well as some basic information
2745
/// about the font.

src/object/page.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Working with pages of a PDF document.
1+
//! Working with pages in a PDF document.
22
33
use crate::document::PageSettings;
44
use crate::error::KrillaResult;

0 commit comments

Comments
 (0)