pypi fpdf2 2.5.1
Support for soft-hyphens - image() can now insert .svg files - deprecating font caching

latest releases: 2.8.1, 2.7.9, 2.7.8...
2 years ago

Added

Changed

  • write() now supports soft hyphen characters, thanks to @gmischler
  • fname is now a required parameter for FPDF.add_font()
  • image() method now insert .svg images as PDF paths
  • the defusedxml package was added as dependency in order to make SVG parsing safer
  • log level of _substitute_page_number() has been lowered from INFO to DEBUG

Fixed

  • a bug when rendering Markdown and setting a custom text_color or fill_color
  • a bug in get_string_width() with unicode fonts and Markdown enabled,
    resulting in calls to cell() / multi_cell() with align="R" to display nothing - thanks @mcerveny for the fix!
  • a bug with incorrect width calculation of markdown text

Deprecated

  • the font caching mechanism, that used the pickle module, has been removed, for security reasons,
    and because it provided little performance gain, and only for specific use cases - cf. issue #345.
    That means that the font_cache_dir optional parameter of fpdf.FPDF constructor
    and the uni optional argument of FPDF.add_font() are deprecated.
    The fpdf.fpdf.load_cache function has also been removed.

To be extra clear: uni=True can now be removed from all calls to FPDF.add_font().
If the value of the fname argument passed to add_font() ends with .ttf, it is considered a TrueType font.

Don't miss a new fpdf2 release

NewReleases is sending notifications on new releases.