]> Shamusworld >> Repos - ardour-manual/blobdiff - build.py
Two new prefs options in 7.1 + section update
[ardour-manual] / build.py
index 16a01f91feb5ee5645bc188a22080cea7b7701c9..fdead7edd4922f2131469c9ff8305221f20554a4 100755 (executable)
--- a/build.py
+++ b/build.py
@@ -718,8 +718,11 @@ if pdf:
        pdfpageFile.close()
 
        # Generating the actual PDF with weasyprint (https://weasyprint.org/)
-       from weasyprint import HTML
-       from weasyprint.text.fonts import FontConfiguration
+       from weasyprint import HTML, __version__
+       if float(__version__) < 53.0: # handle an API change
+               from weasyprint.fonts import FontConfiguration
+       else:
+               from weasyprint.text.fonts import FontConfiguration
        
        html_font_config = FontConfiguration()
        doc = HTML(string = pdfpage, base_url = global_site_dir)