diff --git a/CHANGELOG.md b/CHANGELOG.md index ba67534a9..bfd094392 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,8 @@ This can also be enabled programmatically with `warnings.simplefilter('default', ## [2.7.7] - Not released yet ### Added -* basic support for `` elements in SVG vector graphics inserted -* SVG importing now supports clipping paths, and `defs` tags anywhere in the SVG file +* Basic support for `` elements in SVG vector graphics inserted +* SVG importing now supports clipping paths, and `` tags anywhere in the SVG file * [`FPDF.fonts.FontFace`](https://py-pdf.github.io/fpdf2/fpdf/fonts.html#fpdf.fonts.FontFace): Now has a static `combine` method that allows overriding a default FontFace (e.g. for specific cells in a table). Unspecified properties of the override FontFace retain the values of the default. * [`TextColumns()`](https://py-pdf.github.io/fpdf2/TextColumns.html) can now have images inserted (both raster and vector). * [`TextColumns()`](https://py-pdf.github.io/fpdf2/TextColumns.html) can now advance to the next column with the new `new_column()` method or a FORM_FEED character (`\u000c`) in the text. diff --git a/fpdf/__init__.py b/fpdf/__init__.py index dc78b10cb..2a384f1c7 100644 --- a/fpdf/__init__.py +++ b/fpdf/__init__.py @@ -15,7 +15,7 @@ * `fpdf.template.FlexTemplate` """ -import sys +import warnings, sys from .enums import Align, TextMode, XPos, YPos from .errors import FPDFException @@ -31,6 +31,19 @@ from .template import Template, FlexTemplate from .deprecation import WarnOnDeprecatedModuleAttributes +try: + # This module only exists in PyFPDF, it has been removed in fpdf2 since v2.5.7: + # pylint: disable=import-self + from . import ttfonts + + warnings.warn( + "You have both PyFPDF & fpdf2 installed. " + "Both packages cannot be installed at the same time as they share the same module namespace. " + "To only keep fpdf2, run: pip uninstall --yes pypdf && pip install --upgrade fpdf2" + ) +except ImportError: + pass # no PyFPDF installation detected + FPDF_VERSION = _FPDF_VERSION "Current fpdf2 version, also available as `__version__`"