3.2 KiB
3.2 KiB
v0.2.0 (2021-06-17)
This release improves the font handling, adds support for embedding images and contains many small improvements and bugfixes.
Thanks to Alexander Dean-Kennedy for implementing the images support and to Scott Steele for contributing a bug fix.
Breaking Changes
- Improve the font handling:
- Make
FontFamilygeneric over the font data type. - Make the fields of the
FontFamilystruct public. - Load the PDF font in
Renderer::load_fontfrom bytes instead of a path. - Separate font loading and font caching:
- Replace the
load_fontandload_font_familymethods of theFontCachestruct withadd_fontandadd_font_family, and theload_font_familymethod ofDocumentwithadd_font_family. - Add the
FontData::loadmethod and thefonts::load_from_filesfunction. - Change the arguments of the
FontCache::newandDecorator::newmethods.
- Replace the
- Make the
Document::new,Document::add_font_family,FontCache::new,FontCache::add_font,FontCache::add_font_familyandFont::newmethods infallible. - Add support for built-in fonts.
- Added the
Error::UnsupportedEncodingvariant. - Change the return type of the
Area::print_strandTextSection::print_strmethods to return aResult.
- Added the
- Make
- Move the
FontCacheinstance used during the rendering process to the newContextstruct. - Remove the
Document::set_marginsmethod (use aPageDecoratorinstead). - Replace the
PdfprintErrorvariant ofErrorKindwithPdfErrorandPdfIndexError. - Change the return type of
render::Area::text_sectionfromResult<_, ()>toOption<_>. - Bump the MSRV to 1.45.0.
- Move
Alignmentstruct out ofelementsmodule.
Non-Breaking Changes
- Add the
StyledCow<'s>struct that contains aCow<'s, str>with aStyleannotation. - Derive
CopyforStyledStr. - Add support for hyphenation (enabled by the
hyphenationfeature). - Add the
PageBreakelement. - Implement
From<Vec<StyledString>>forParagraph. - Add the
PageDecoratortrait, theSimplePageDecoratorimplementation and theDocument::set_page_decoratormethod to allow customization of all document pages. - Add support for kerning and add the
Font::kerningandFont::glyph_idsmethods. - Add the
error::Contexttrait for easier error generation. - Add support for
Imageas a possible insertable element.
Bug Fixes
- Always use the configured paper size when adding new pages to a
Document.
v0.1.1 (2020-10-16)
This patch release adds some trait implementations and utility functions and improves the crate documentation.
Thanks to Matteo Bertini for contributions.
- Implement
From<&String>forStyledString. - Derive
Add,AddAssign,SubandSubAssignforPositionandSize. - Implement
From<Position>forprintpdf::Point. - Add
split_horizontallymethod toArea. - Add
widthmethod toStyledStringandStyledStr. - Add
font_cachemethod toDocument.
v0.1.0 (2020-10-15)
Initial release with support for formatted text, text wrapping and basic shapes.