From 3e8f9ccbc16f2007dbd330e21f5fb2ca02050a86 Mon Sep 17 00:00:00 2001 From: Guillaume-gdi Date: Thu, 14 Mar 2024 15:31:58 +0100 Subject: [PATCH] [FIX] website: make font import consistent [This other commit] introduced a method to serve Google fonts from the local server. Then it has been back-ported to previous versions with [this commit]. Unfortunately, the font was not identical when the user chose to load the font from Google servers versus from the local server. This discrepancy was due to a missing parameter when downloading the font file to serve it from the local server. This commit fixes the issue by adding the missing parameter. Steps to reproduce the issue fixed by this commit: - Drop a text block onto a website page. - Make the text bold. - Go to the theme tab. - Change the font to https://fonts.google.com/specimen/Poppins => The text style changes depending on whether you checked the "Serve font from Google servers" option or not. [This other commit]: https://github.com/odoo/odoo/commit/b06ce21eba6388ce34bbffffadcb489f0e8557dd [this commit]: https://github.com/odoo/odoo/commit/04ab4e255b7fef1608ee2c70a3a005f3064bc4f3 opw-3775683 closes odoo/odoo#157800 X-original-commit: be2d27e69d7928a46d49a7ef0a3c4b93932a36b8 Signed-off-by: Romain Derie (rde) Signed-off-by: Guillaume Dieleman (gdi) --- addons/website/models/assets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/models/assets.py b/addons/website/models/assets.py index 96ca6fc44d4..c8a3f00ab33 100644 --- a/addons/website/models/assets.py +++ b/addons/website/models/assets.py @@ -74,7 +74,7 @@ class Assets(models.AbstractModel): else: font_family_attachments = IrAttachment font_content = requests.get( - f'https://fonts.googleapis.com/css?family={font_name}&display=swap', + f'https://fonts.googleapis.com/css?family={font_name}:300,300i,400,400i,700,700i&display=swap', timeout=5, headers=headers_woff2, ).content.decode()