NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #822 most downloaded on crates.io
A high-level, safe, zero-allocation font parser for TrueType, OpenType, and AAT.
Last release 2 years ago
no release in 18 months
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 49 of 49 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
49 releases · first in 2019
Fix typos. by @waywardmonkeys in #176
clippy::doc_lazy_continuation lint by @waywardmonkeys in #177Full Changelog: v0.25.0...v0.25.1
One column per quarter.
STAT table parsing. Thanks to inferiorhumanorgans.
STAT table parsing. Thanks to inferiorhumanorgans.UnicodeRanges internal field is public now.cargo-c metadata to C API. Thanks to lu-zero.Face::is_italic checks for italic angle as well.Face::italic_angle returns just a f32 and not Option<f32> now.avar table to the variation axis being set.
Thanks to maxmelander.(glyf) glyf::Table::bbox. Thanks to LaurenzV.
Make core_maths dependency optional. When building for no_std one must enable no-std-float build feature now.
core_maths dependency optional.
When building for no_std one must enable no-std-float build feature now.Use core_maths instead of libm. Should simplify the build process. Thanks to LaurenzV.
core_maths instead of libm. Should simplify the build process.
Thanks to LaurenzV.no-std-float build flag. Should be handled automatically now.hvar::Table::right_side_bearing_offset. Thanks to LaurenzV.
Face::glyph_phantom_pointshvar::Table::right_side_bearing_offset. Thanks to LaurenzV.vvar::Table::advance_offset. Thanks to LaurenzV.vvar::Table::top_side_bearing_offset. Thanks to LaurenzV.vvar::Table::bottom_side_bearing_offset. Thanks to LaurenzV.vvar::Table::vertical_origin_offset. Thanks to LaurenzV.colr::Table::clip_box. Thanks to LaurenzV.no_std build of ttf-parser requires --features=no-std-float now.
This is because we need trigonometry functions to flatten transforms in COLR.
Thanks to LaurenzV.colr::Painter no longer has push_translate, push_scale, push_rotate and push_skew.
Only push_transform left.
Thanks to LaurenzV.hvar::Table into hvar::Table and vvar::Table.
Previously, we treated both HVAR and VVAR tables as identical,
but VVAR actually has additional fields.
Thanks to LaurenzV.hvar::Table::side_bearing_offset into hvar::Table::left_side_bearing_offset.
Thanks to LaurenzV.Face::glyph_hor_advance and Face::glyph_ver_advance include gvar's phantom points
when HVAR/VVAR tables are missing. Affects only variable fonts.CFF) Allow MoveTo with width commands in nested subroutines.opentype_layout::LookupFlags::mark_attachment_type parsing.CFF) Allow empty charsets in cff::parse_charset.
Thanks to LaurenzV.gvar) Empty sub-glyphs/components is no longer an error.
Thanks to LaurenzV.GSUB/GPOS) Allow NULL offsets in ChainedContextLookup Format2 subtables.
Thanks to LaurenzV.Face::glyph_y_origin properly handles variable fonts now.
Thanks to LaurenzV.kerx) Fix AnchorPoints parsing.
Thanks to LaurenzV.push_translate, push_scale, push_rotate and push_skew from colr::Painter.
Use colr::Painter::push_transform instead.
Thanks to LaurenzV.Delta set length calculation in variable fonts. Thanks to LaurenzV. Got broken in the previous version.
COLR / CPAL v1 support. Thanks to LaurenzV.
COLR / CPAL v1 support.
Thanks to LaurenzV.Face::is_bitmap_embedding_allowed with Face::is_outline_embedding_allowed.
The old one had a bool flag flipped.
Thanks to Fuzzyzilla.COLR / CPAL v0 support. Thanks to laurmaedje.
COLR / CPAL v0 support.
Thanks to laurmaedje.Face::is_color_glyphFace::color_palettescpal::Table::palettessvg::SvgDocumentsList returns svg::SvgDocument and not just &[u8] now.
Thanks to wjian23.Face::set_variation allows duplicated axes now.cpal::Color is called cpal::BgraColor now, and cpal::Table::get returns it.### Added - cff::Table::glyph_cid
cff::Table::glyph_cidcff::Table::glyph_width returns a correct width when subroutines are present.
cff::Table::glyph_width returns a correct width when subroutines are present.bdat, bloc, EBDT and EBLC tables support. Thanks to dzamkov.
(MATH) Handle NULL offsets. Thanks to laurmaedje.
MATH) Handle NULL offsets.
Thanks to laurmaedje.Language enum with all Windows languages.
name::Name::languageLanguage enum with all Windows languages.Face::is_bitmap_embedding_allowed
Face::permissionsFace::is_subsetting_allowedFace::is_bitmap_embedding_allowedFace::unicode_rangesos2::Table::permissionsos2::Table::is_subsetting_allowedos2::Table::is_bitmap_embedding_allowedos2::Table::unicode_rangesFace::parse for a regular font will return
FaceParsingError::FaceIndexOutOfBounds now. Thanks to Pietrek14.MATH table support. Thanks to ruifengx and laurmaedje.
cff::Table::glyph_index_by_name
cff::Table::glyph_indexcff::Table::glyph_index_by_namecff::Table::glyph_widthcff::Table::number_of_glyphscff::Table::matrixpost::Table::glyph_namepost::Table::glyph_index_by_namepost::Table::namesFace::glyph_index_by_nameRawFace fields and TableRecord struct are public now.Face::from_slice was replaced by Face::parse.RawFace::from_slice was replaced by RawFace::parse.post::Table::names is a method and not a field now.post::Table::glyph_name instead of post::Table::names.get().post::Names::len was returning a wrong value. Now this method is gone completely.
You can use post::Table::names().count() instead.Missing advance and side bearing offsets in HVAR/VVAR is not an error. Simply ignore them.
HVAR/VVAR is not an error. Simply ignore them.(cmap) cmap::Subtable4::glyph_index correctly handles malformed glyph offsets now.
cmap::Subtable4::glyph_index correctly handles malformed glyph offsets now.cmap::Subtable4::codepoints no longer includes 0xFFFF codepoint.ankr, feat, kerx, morx and trak tables.
apple-layout build feature.ankr, feat, kerx, morx and trak tables.kern AAT subtable format 1.RawFaceparser module is private now again.(cmap) cmap::Subtable::glyph_index and cmap::Subtable::glyph_variation_index accept u32 instead of char now.
cmap::Subtable::glyph_index and cmap::Subtable::glyph_variation_index accept
u32 instead of char now.(CFF) Panic during seac resolving.
seac resolving.seac resolving.(glyf) Endless loop during malformed file parsing.
gvar-alloc build feature that unlocks gvar table limits by using heap. Thanks to OrionNebula
gvar-alloc build feature that unlocks gvar table limits by using heap.
Thanks to OrionNebula### Fixed - Face::line_gap logic.
Face::line_gap logic.Complete GSUB and GPOS tables support. Available under the opentype-layout feature.
opentype-layout feature.Style enum and Face::style method.Face::glyph_name can be disabled via the glyph-names feature to reduce binary size.Face methods: has_glyph_classes, glyph_class, glyph_mark_attachment_class,
is_mark_glyph and glyph_variation_delta are moved to gdef::Table.Names struct is no longer an iterator, but a container.
You have to call into_iter() manually.VariationAxes struct is no longer an iterator, but a container.
You have to call into_iter() manually.Name struct methods become public fields.Face::units_per_em no longer returns Option.cmap) Improved subtable 12 performance. Thanks to xnukttfp_glyph_class, ttfp_get_glyph_class, ttfp_get_glyph_mark_attachment_class,
ttfp_is_mark_glyph, ttfp_glyph_variation_delta and ttfp_has_table.TableName enum and Face::has_table. Tables can be access directly now.Face::character_mapping_subtables. Use Face::tables().cmap instead.Face::kerning_subtables. Use Face::tables().kern instead.Iterator::count implementation for cmap::Subtables, name::Names and LazyArrayIter32.(glyf) Always use a calculated bbox.
glyf) Always use a calculated bbox.Face::glyph_bounding_box for variable glyf.
Face::glyph_bounding_box for variable glyf.glyf) Do not skip glyphs with zero-sized bbox.Support Format 13 subtables in cmap::Subtable::is_unicode. Thanks to csmulhern
Face::ascender and Face::descender will use usWinAscent and usWinDescent when USE_TYPO_METRICS flag is not set in OS/2 table. Previously, those values
Face::ascender and Face::descender will use
usWinAscent and
usWinDescent
when USE_TYPO_METRICS flag is not set in OS/2 table.
Previously, those values were ignored and
hhea::ascender and
hhea::descender
were used. Now hhea table values will be used only when OS/2 table is not present.Face::outline_glyph and Face::glyph_bounding_box in case of a glyf table
can fallback to a calculated bbox when the embedded bbox is malformed now.FaceTables, which allowed to load Face not only from a single chunk of data, but also in a per-table way. Which is useful for WOFF parsing. No changes
FaceTables, which allowed to load Face not only from a single chunk of data,
but also in a per-table way. Which is useful for WOFF parsing.
No changes to the API.
Thanks to fschutt### Changed - Update a font used for tests.
variable-fonts build feature. Enabled by default. By disabling it you can reduce ttf-parser binary size overhead almost twice.
variable-fonts build feature. Enabled by default.
By disabling it you can reduce ttf-parser binary size overhead almost twice.gvar) Increase the maximum number of variation tuples from 16 to 32.
Increases stack usage and makes gvar parsing 10% slower now.CFF) Fix seac processing. Thanks to wezmkern AAT subtable 1 aka kern::state_machine. Mainly because it's useless without a proper shaping.
kern AAT subtable 1 aka kern::state_machine.
Mainly because it's useless without a proper shaping.The parser module is public now. Made private again in 0.15.0.
Face::glyph_variation_deltaparser module is public now. Made private again in 0.15.0.ttfp_glyph_variation_deltaIterator::nth implementation for cmap::Subtables and Names.(cmap) Incorrectly returning glyph ID 0 instead of None for format 0
cmap::Subtable::codepoints0 instead of None for format 0### Added - Face::is_monospaced - Face::italic_angle - Face::typographic_ascender - Face::typographic_descender - Face::typographic_line_gap - Face::c
Face::is_monospacedFace::italic_angleFace::typographic_ascenderFace::typographic_descenderFace::typographic_line_gapFace::capital_heightFace::has_non_default_variation_coordinates
true magic.FaceParsingErrorNormalizedCoordinateFace::variation_coordinatesFace::has_non_default_variation_coordinatesFace::glyph_name can lookup CFF names too.Face::table_dataFace::character_mapping_subtablesFace::from_slice returns Result now.Name::platform_id returns PlatformId instead of Option<PlatformId> now.cmap module became public.Face::width parsing.Face::from_slice.Face::glyph_variation_index processing when the encoding table has only one glyph.Rename Font to Face, because this is what it actually is.
seac support.Font::global_bounding_boxFont to Face, because this is what it actually is.Font::from_data to Font::from_slice to match serde and other libraries.Name::name_utf8 to Name::to_string.Font::family_name and Font::post_script_name. They were a bit confusing.
Prefer:face.names().find(|name| name.name_id() == name_id::FULL_NAME).and_then(|name| name.to_string())
Font::family_name will load names with Windows Symbol encoding now.
Name::is_unicodeFont::family_name will load names with Windows Symbol encoding now.Font::glyph_bounding_box will apply variation in case of gvar fonts.(kern) Support fonts that ignore the subtable size limit.
kern) Support fonts that ignore the subtable size limit.sbix, CBLC, CBDT and SVG tables support.
sbix, CBLC, CBDT and SVG tables support.Font::glyph_raster_image and Font::glyph_svg_image.Font::kerning_subtables with subtable formats 0..3 support.ttfp_font anymore. All allocations should be
handled by the caller from now.Font::glyphs_kerning. Use Font::kerning_subtables instead.ttfp_create_font and ttfp_destroy_font.
Use ttfp_font_size_of + ttfp_font_init instead.ttfp_font *font = (ttfp_font*)alloca(ttfp_font_size_of());
ttfp_font_init(font_data, font_data_size, 0, font);
gvar) Integer overflow.cmap) Integer overflow during subtable format 2 parsing.CFF, CFF2) DICT number parsing.Font::glyph_*_advance will return None when glyph ID
is larger than the number of metrics in the table.Font::glyph_*_advance and Font::glyph_*_side_bearing
when HVAR/VVAR tables are missing.
Previously returned None which is incorrect.gvar, CFF2, avar, fvar, HVAR, VVAR and MVAR tables support.
gvar, CFF2, avar, fvar, HVAR, VVAR and MVAR tables support.Font::variation_axesFont::set_variationFont::is_variableTag type.Font::glyph_mark_attachment_class
A major rewrite.
Font::glyph_bounding_boxFont::glyph_nameFont::has_glyph_classesFont::glyph_classFont::glyph_mark_attachment_classFont::is_mark_glyphFont::glyph_y_originFont::vertical_ascenderFont::vertical_descenderFont::vertical_heightFont::vertical_line_gaplog dependency.Font::outline_glyph now accepts &mut dyn OutlineBuilder and not &mut impl OutlineBuilder.Font::ascender, Font::descender and Font::line_gap will check USE_TYPO_METRICS
flag in OS/2 table now.glyph_hor_metrics was split into glyph_hor_advance and glyph_hor_side_bearing.glyph_ver_metrics was split into glyph_ver_advance and glyph_ver_side_bearing.CFFError is no longer public.Error enum. All methods will return Option<T> now.unsafe.glyph_hor_side_bearing parsing when the number of metrics is less than the total number of glyphs.The library has one unsafe block now.
no_std compatibility.unsafe block now.family_name() method.from_data() method for TrueType fonts.Name struct has a new API. Public fields became public functions
and data is parsed on demand and not beforehand.Allow format 12 subtables with *Unicode full repertoire* in cmap.
cmap.Check that cmap subtable encoding is Unicode.
cmap subtable encoding is Unicode.All cmap subtable formats except Mixed Coverage (8) are supported.
cmap subtable formats except Mixed Coverage (8) are supported.vmtx table.GlyphId instead of u16.GDEF table parsing.Initial release. Parsing of cmap, glyf, head, hhea, hmtx, loca, maxp, name, OS/2, post, vhea and vmtx, with GDEF and font-collection support.
cmap, glyf, head, hhea, hmtx, loca, maxp, name,
OS/2, post, vhea and vmtx, with GDEF and font-collection support.Your coding agent can read these notes before it upgrades. Set up the MCP server →