All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
0.25.0 - 2024-10-04
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 af32
and notOption<f32>
now.- Bump MSRV to 1.59
- Only apply
avar
table to the variation axis being set. Thanks to maxmelander.
0.24.1 - 2024-08-05
- (
glyf
)glyf::Table::bbox
. Thanks to LaurenzV.
- (
kerx
)kerx::SubtablesIter
wasn't updating the current subtable index. - (
GPOS
)gpos::AnchorMatrix
allows nullable/optional matrices now. Thanks to LaurenzV.
0.24.0 - 2024-07-02
- Make
core_maths
dependency optional. When building forno_std
one must enableno-std-float
build feature now.
0.23.0 - 2024-07-02
- Use
core_maths
instead oflibm
. Should simplify the build process. Thanks to LaurenzV.
no-std-float
build flag. Should be handled automatically now.
0.22.0 - 2024-06-29
Face::glyph_phantom_points
hvar::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 ofttf-parser
requires--features=no-std-float
now. This is because we need trigonometry functions to flatten transforms inCOLR
. Thanks to LaurenzV.colr::Painter
no longer haspush_translate
,push_scale
,push_rotate
andpush_skew
. Onlypush_transform
left. Thanks to LaurenzV.- Split
hvar::Table
intohvar::Table
andvvar::Table
. Previously, we treated bothHVAR
andVVAR
tables as identical, butVVAR
actually has additional fields. Thanks to LaurenzV. - Rename
hvar::Table::side_bearing_offset
intohvar::Table::left_side_bearing_offset
. Thanks to LaurenzV.
Face::glyph_hor_advance
andFace::glyph_ver_advance
includegvar
's phantom points whenHVAR
/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 incff::parse_charset
. Thanks to LaurenzV. - (
gvar
) Empty sub-glyphs/components is no longer an error. Thanks to LaurenzV. - (
GSUB
/GPOS
) AllowNULL
offsets inChainedContextLookup
Format2 subtables. Thanks to LaurenzV. Face::glyph_y_origin
properly handles variable fonts now. Thanks to LaurenzV.- (
kerx
) FixAnchorPoints
parsing. Thanks to LaurenzV.
push_translate
,push_scale
,push_rotate
andpush_skew
fromcolr::Painter
. Usecolr::Painter::push_transform
instead. Thanks to LaurenzV.
0.21.1 - 2024-05-11
- Delta set length calculation in variable fonts.
Thanks to LaurenzV.
Got broken in the previous version.
0.21.0 - 2024-05-10
COLR
/CPAL
v1 support. Thanks to LaurenzV.
- Replace
Face::is_bitmap_embedding_allowed
withFace::is_outline_embedding_allowed
. The old one had a bool flag flipped. Thanks to Fuzzyzilla. - Increase lenience of embed permissions for older OS/2 versions. Thanks to Fuzzyzilla.
- Bump MSRV to 1.51
0.20.0 - 2023-10-15
COLR
/CPAL
v0 support. Thanks to laurmaedje.
svg::SvgDocumentsList
returnssvg::SvgDocument
and not just&[u8]
now. Thanks to wjian23.Face::set_variation
allows duplicated axes now.
0.19.2 - 2023-09-13
cff::Table::glyph_cid
0.19.1 - 2023-06-20
cff::Table::glyph_width
returns a correct width when subroutines are present.
0.19.0 - 2023-04-17
bdat
,bloc
,EBDT
andEBLC
tables support. Thanks to dzamkov.BitmapMono
,BitmapMonoPacked
,BitmapGray2
,BitmapGray2Packed
,BitmapGray4
,BitmapGray4Packed
,BitmapGray8
andBitmapPremulBgra32
variants toRasterImageFormat
.
CBLC
table parsing. Thanks to dzamkov.
0.18.1 - 2023-01-10
- (
MATH
) Handle NULL offsets. Thanks to laurmaedje.
0.18.0 - 2022-12-25
Face::permissions
Face::is_subsetting_allowed
Face::is_bitmap_embedding_allowed
Face::unicode_ranges
os2::Table::permissions
os2::Table::is_subsetting_allowed
os2::Table::is_bitmap_embedding_allowed
os2::Table::unicode_ranges
name::Name::language
Language
enum with all Windows languages.
- Using a non-zero index in
Face::parse
for a regular font will returnFaceParsingError::FaceIndexOutOfBounds
now. Thanks to Pietrek14.
0.17.0 - 2022-09-28
MATH
table support. Thanks to ruifengx and laurmaedje.
- (CFF) Fix large tables parsing.
0.16.0 - 2022-09-18
- CFF Encoding support.
cff::Table::glyph_index
cff::Table::glyph_index_by_name
cff::Table::glyph_width
cff::Table::number_of_glyphs
cff::Table::matrix
post::Table::glyph_name
post::Table::glyph_index_by_name
post::Table::names
Face::glyph_index_by_name
RawFace
fields andTableRecord
struct are public now.
Face::from_slice
was replaced byFace::parse
.RawFace::from_slice
was replaced byRawFace::parse
.post::Table::names
is a method and not a field now.- Use
post::Table::glyph_name
instead ofpost::Table::names.get()
.
- (hmtx/vmtx) Allow missing additional side bearings.
- (loca) Allow incomplete table.
- Reduce strictness of some table length checks.
- (post)
post::Names::len
was returning a wrong value. Now this method is gone completely. You can usepost::Table::names().count()
instead.
0.15.2 - 2022-06-17
- Missing advance and side bearing offsets in
HVAR
/VVAR
is not an error. Simply ignore them.
0.15.1 - 2022-06-04
- (cmap)
cmap::Subtable4::glyph_index
correctly handles malformed glyph offsets now. - (cmap)
cmap::Subtable4::codepoints
no longer includes0xFFFF
codepoint. - (SVG) Fixed table parsing. Thanks to Shubhamj280
0.15.0 - 2022-02-20
apple-layout
build feature.ankr
,feat
,kerx
,morx
andtrak
tables.kern
AAT subtable format 1.RawFace
- The
parser
module is private now again.
0.14.0 - 2021-12-28
- (cmap)
cmap::Subtable::glyph_index
andcmap::Subtable::glyph_variation_index
acceptu32
instead ofchar
now. - (glyf) ~7% faster outline parsing.
0.13.4 - 2021-11-23
- (CFF) Panic during
seac
resolving. - (CFF) Stack overflow during
seac
resolving.
0.13.3 - 2021-11-19
- (glyf) Endless loop during malformed file parsing.
0.13.2 - 2021-10-28
gvar-alloc
build feature that unlocksgvar
table limits by using heap. Thanks to OrionNebula
0.13.1 - 2021-10-27
Face::line_gap
logic.
0.13.0 - 2021-10-24
- Complete GSUB and GPOS tables support. Available under the
opentype-layout
feature. - Public access to all supported TrueType tables. This allows a low-level, but still safe, access to internal data layout, which can be used for performance optimization, like caching.
Style
enum andFace::style
method.Face::glyph_name
can be disabled via theglyph-names
feature to reduce binary size.
- Improved ascender/descender/line_gap resolving logic.
Face
methods:has_glyph_classes
,glyph_class
,glyph_mark_attachment_class
,is_mark_glyph
andglyph_variation_delta
are moved togdef::Table
.- The
Names
struct is no longer an iterator, but a container. You have to callinto_iter()
manually. - The
VariationAxes
struct is no longer an iterator, but a container. You have to callinto_iter()
manually. - Most of the
Name
struct methods become public fields. Face::units_per_em
no longer returnsOption
.- (
cmap
) Improved subtable 12 performance. Thanks to xnuk
- (c-api)
ttfp_glyph_class
,ttfp_get_glyph_class
,ttfp_get_glyph_mark_attachment_class
,ttfp_is_mark_glyph
,ttfp_glyph_variation_delta
andttfp_has_table
. TableName
enum andFace::has_table
. Tables can be access directly now.Face::character_mapping_subtables
. UseFace::tables().cmap
instead.Face::kerning_subtables
. UseFace::tables().kern
instead.
Iterator::count
implementation forcmap::Subtables
,name::Names
andLazyArrayIter32
.
0.12.3 - 2021-06-27
- (
glyf
) Always use a calculated bbox.
0.12.2 - 2021-06-11
Face::glyph_bounding_box
for variableglyf
.- (
glyf
) Do not skip glyphs with zero-sized bbox.
0.12.1 - 2021-05-24
- Support Format 13 subtables in
cmap::Subtable::is_unicode
. Thanks to csmulhern - Derive more traits by default. Thanks to dhardy
0.12.0 - 2021-02-14
Face::ascender
andFace::descender
will use usWinAscent and usWinDescent whenUSE_TYPO_METRICS
flag is not set inOS/2
table. Previously, those values were ignored and hhea::ascender and hhea::descender were used. Nowhhea
table values will be used only whenOS/2
table is not present.Face::outline_glyph
andFace::glyph_bounding_box
in case of aglyf
table can fallback to a calculated bbox when the embedded bbox is malformed now.
0.11.0 - 2021-02-04
FaceTables
, which allowed to loadFace
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
0.10.1 - 2021-01-21
- Update a font used for tests.
0.10.0 - 2021-01-16
variable-fonts
build feature. Enabled by default. By disabling it you can reducettf-parser
binary size overhead almost twice.
- (
gvar
) Increase the maximum number of variation tuples from 16 to 32. Increases stack usage and makesgvar
parsing 10% slower now.
- (
CFF
) Fixseac
processing. Thanks to wezm
0.9.0 - 2020-12-05
kern
AAT subtable 1 akakern::state_machine
. Mainly because it's useless without a proper shaping.
0.8.3 - 2020-11-15
Face::glyph_variation_delta
Iterator::nth
implementation forcmap::Subtables
andNames
.
0.8.2 - 2020-07-31
cmap::Subtable::codepoints
- (cmap) Incorrectly returning glyph ID
0
instead ofNone
for format 0 - (cmap) Possible invalid glyph mapping for format 2
0.8.1 - 2020-07-29
Face::is_monospaced
Face::italic_angle
Face::typographic_ascender
Face::typographic_descender
Face::typographic_line_gap
Face::capital_height
0.8.0 - 2020-07-21
- Allow
true
magic. FaceParsingError
NormalizedCoordinate
Face::variation_coordinates
Face::has_non_default_variation_coordinates
Face::glyph_name
can lookup CFF names too.Face::table_data
Face::character_mapping_subtables
- (CFF,CFF2) 10% faster parsing.
Face::from_slice
returnsResult
now.Name::platform_id
returnsPlatformId
instead ofOption<PlatformId>
now.- The
cmap
module became public.
Face::width
parsing.- Possible u32 overflow on 32-bit platforms during
Face::from_slice
. - (cmap)
Face::glyph_variation_index
processing when the encoding table has only one glyph.
0.7.0 - 2020-07-16
- (CFF) CID fonts support.
- (CFF)
seac
support. Font::global_bounding_box
- Rename
Font
toFace
, because this is what it actually is. - Rename
Font::from_data
toFont::from_slice
to match serde and other libraries. - Rename
Name::name_utf8
toName::to_string
.
Font::family_name
andFont::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())
0.6.2 - 2020-07-02
Name::is_unicode
Font::family_name
will load names with Windows Symbol encoding now.
Font::glyph_bounding_box
will apply variation in case ofgvar
fonts.
0.6.1 - 2020-05-19
- (
kern
) Support fonts that ignore the subtable size limit.
0.6.0 - 2020-05-18
sbix
,CBLC
,CBDT
andSVG
tables support.Font::glyph_raster_image
andFont::glyph_svg_image
.Font::kerning_subtables
with subtable formats 0..3 support.
- (c-api) The library doesn't allocate
ttfp_font
anymore. All allocations should be handled by the caller from now.
Font::glyphs_kerning
. UseFont::kerning_subtables
instead.- (c-api)
ttfp_create_font
andttfp_destroy_font
. Usettfp_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);
- Logging support. We haven't used it anyway.
- (
gvar
) Integer overflow. - (
cmap
) Integer overflow during subtable format 2 parsing. - (
CFF
,CFF2
) DICT number parsing. Font::glyph_*_advance
will returnNone
when glyph ID is larger than the number of metrics in the table.- Ignore variation offset in
Font::glyph_*_advance
andFont::glyph_*_side_bearing
whenHVAR
/VVAR
tables are missing. Previously returnedNone
which is incorrect.
0.5.0 - 2020-03-19
- Variable fonts support.
- C API.
gvar
,CFF2
,avar
,fvar
,HVAR
,VVAR
andMVAR
tables support.Font::variation_axes
Font::set_variation
Font::is_variable
Tag
type.
- Multiple issues due to arithmetic overflow.
0.4.0 - 2020-02-24
A major rewrite.
Font::glyph_bounding_box
Font::glyph_name
Font::has_glyph_classes
Font::glyph_class
Font::glyph_mark_attachment_class
Font::is_mark_glyph
Font::glyph_y_origin
Font::vertical_ascender
Font::vertical_descender
Font::vertical_height
Font::vertical_line_gap
- Optional
log
dependency.
Font::outline_glyph
now accepts&mut dyn OutlineBuilder
and not&mut impl OutlineBuilder
.Font::ascender
,Font::descender
andFont::line_gap
will checkUSE_TYPO_METRICS
flag in OS/2 table now.glyph_hor_metrics
was split intoglyph_hor_advance
andglyph_hor_side_bearing
.glyph_ver_metrics
was split intoglyph_ver_advance
andglyph_ver_side_bearing
.CFFError
is no longer public.
Error
enum. All methods will returnOption<T>
now.- All
unsafe
.
glyph_hor_side_bearing
parsing when the number of metrics is less than the total number of glyphs.- Multiple CFF parsing fixes. The parser is more strict now.
0.3.0 - 2019-09-26
no_std
compatibility.
- The library has one
unsafe
block now. - 35% faster
family_name()
method. - 25% faster
from_data()
method for TrueType fonts. - The
Name
struct has a new API. Public fields became public functions and data is parsed on demand and not beforehand.
0.2.2 - 2019-08-12
- Allow format 12 subtables with Unicode full repertoire in
cmap
.
0.2.1 - 2019-08-12
- Check that
cmap
subtable encoding is Unicode.
0.2.0 - 2019-07-10
- CFF support.
- Basic kerning support.
- All
cmap
subtable formats except Mixed Coverage (8) are supported. - Vertical metrics querying from the
vmtx
table. - OpenType fonts are allowed now.
- A major rewrite. TrueType tables are no longer public.
- Use
GlyphId
instead ofu16
.
GDEF
table parsing.