Skip to content

FPDF.bezier() to render quadratic and cubic Bézier curves, and many improvements

Compare
Choose a tag to compare
@Lucas-C Lucas-C released this 04 Oct 12:05
· 49 commits to master since this release

Note: a temporary 2.8.0 version was released but then erroneously removed on Pypi.
Versions 2.8.0 & 2.8.1 are exactly the same.

Added

  • support for quadratic and cubic Bézier curves with FPDF.bezier() - thanks to @awmc000
  • support for escape character for markers in markdown text issue #1215
  • Wrapping words on spaces now considers all common space symbols in addition to regular spaces (' '), addressing issues with word-wrapping for languages like Thai, as per #1190 and #1191.
  • Templates can now be also defined in JSON files.
  • support to optionally set wrapmode in templates (default "WORD" can optionally be set to "CHAR" to support wrapping on characters for scripts like Chinese or Japanese) - cf. #1159 - thanks to @carlhiggs
  • documentation on how to use fpdf2 with Rough.js: link to docs
  • documentation on how to use fpdf2 with gunicorn: link to docs
  • new translation of the tutorial in Türkçe, thanks to @Natgho: Türkçe
  • feature to identify the Unicode script of the input text and break it into fragments when different scripts are used, improving text shaping results
  • FPDF.image(): now handles keep_aspect_ratio in combination with an enum value provided to x
  • FPDF.write_html(): now supports CSS page breaks properties : documentation
  • FPDF.write_html(): new optional font_family parameter to set the default font family
  • FPDF.write_html(): spacing before lists can now be adjusted via the tag_styles attribute - thanks to @lcgeneralprojects
  • file names are mentioned in errors when fpdf2 fails to parse a SVG image

Fixed

Removed

  • support for Python 3.7, that reached end-of-life in 2023
  • an obscure and undocumented feature of FPDF.write_html(), which used to magically pass instance attributes as arguments.

Deprecated

  • fpdf.TitleStyle has been renamed into fpdf.TextStyle
  • FPDF.write_html(): tag_indents introduced in the last version - Now the indentation can be provided through the tag_styles parameter, using the .l_margin of TextStyle instances

Changed

  • FPDF.local_context() used to treat font_size as a value in points. Now this is the role of font_size_pt, whereas font_size allows to set the font size into chosen document units (specified with FPDF(unit=)) - MR: #1207
  • FPDF.circle() : the previous r parameter, that in fact defined the diameter, has been replaced by a new radius paremeter. The x & y parameters now define the circle center, instead of its top-left corner as it used to be - issue #1245
  • FPDF.table() now raises an error when a single row is too high to be rendered on a single page
  • FPDF.write_html(): indentation of HTML elements can now be non-integer (float), and is now independent of font size and bullet strings.
  • improved performance of font glyph selection by using functools cache
  • Clarified usage of the style attribute in FPDF.add_font()