Skip to content

new_x/new_y, highlight annotations, text_mode & blend_mode

Compare
Choose a tag to compare
@Lucas-C Lucas-C released this 13 Apr 21:22
· 645 commits to master since this release

Added

  • new parameters new_x and new_y for cell() and multi_cell(), replacing ln=0, thanks to @gmischler
  • new add_highlight() method to insert highlight annotations: documentation
  • new offset_rendering() method: documentation
  • new .text_mode property: documentation
  • the page structure of the documentation has been revised, with a new page about adding text, thanks to @gmischler
  • a warning is now raised if a context manager is used inside an unbreakable() section, which is not supported

Changed

  • local_context() can now "scope" even more properties, like blend_mode: documentation

Fixed

  • No font properties should be leaked anymore after using markdown or in any other situations (cf. #359), thanks to @gmischler
  • If multi_cell(align="J") is given text with multiple paragraphs (text followed by an empty line) at once, it now renders the last line of each paragraph left-aligned,
    instead of just the very last line (cf. #364), thanks to @gmischler
  • a regression: now again multi_cell() always renders a cell, even if txt is an empty string - cf. #349
  • a bug with string width calculation when Markdown is enabled - cf. #351
  • a few bugs when parsing some SVG files - cf. #356, #358 & #376
  • a bug when using multi_cell(..., split_only=True) inside an unbreakable section - cf. #359

Deprecated

  • The parameter ln to cell() and multi_cell() is now deprecated, use new_x and new_y instead.
  • The parameter center to cell() is now deprecated, use align="C" instead.

Displaying deprecation warnings

DeprecationWarnings are not displayed by Python by default.

Hence, every time you use a newer version of fpdf2, we strongly encourage you to execute your scripts
with the -Wd option (cf. documentation)
in order to get warned about deprecated features used in your code.

This can also be enabled programmatically with warnings.simplefilter('default', DeprecationWarning).