From 12c327ad94f59678def2ff89e49ed6efafedc915 Mon Sep 17 00:00:00 2001 From: Laurent Stukkens Date: Fri, 15 Mar 2024 18:07:58 +0000 Subject: [PATCH] [FIX] web_editor: ensure correct fonts are used Since commit [1], the new tiktok icon is added to odoo but the conversion of the css class into an image is not supported. This commit ensures that the conversion is correctly handled. Steps to reproduce: - Open the mail marketing app - Create a new mass mailing - Insert an icon in the template, for instance type /image in the text and select the "Pictogram" tab - Search for tiktok icon and insert it - Send the mass mailing - The icon will not be found in the mail [1]: https://github.com/odoo/odoo/commit/515915b9 closes odoo/odoo#158266 X-original-commit: 0fa2ce8212077facace67a0072aa4ddebc9b55f0 Signed-off-by: Romain Derie (rde) --- addons/web_editor/controllers/main.py | 5 +++++ doc/cla/corporate/acsone.md | 1 + 2 files changed, 6 insertions(+) diff --git a/addons/web_editor/controllers/main.py b/addons/web_editor/controllers/main.py index f72adff467c..411eb3f0482 100644 --- a/addons/web_editor/controllers/main.py +++ b/addons/web_editor/controllers/main.py @@ -85,6 +85,11 @@ class Web_Editor(http.Controller): :returns PNG image converted from given font """ + # For custom icons, use the corresponding custom font + if icon.isdigit(): + if int(icon) == 57467: + font = "/web/static/fonts/tiktok_only.woff" + size = max(width, height, 1) if width else size width = width or size height = height or size diff --git a/doc/cla/corporate/acsone.md b/doc/cla/corporate/acsone.md index 90d46d7a86d..f135056e49d 100644 --- a/doc/cla/corporate/acsone.md +++ b/doc/cla/corporate/acsone.md @@ -35,3 +35,4 @@ Xavier Bouquiaux xavier.bouquiaux@acsone.eu https://github.com/xavier-bouquiaux Maxime Franco maxime.franco@acsone.eu https://github.com/FrancoMaxime Marie Lejeune marie.lejeune@acsone.eu https://github.com/marielejeune Justine Doutreloux justine.doutreloux@acsone.eu https://github.com/jdoutreloux +Laurent Stukkens laurent.stukkens@acsone.eu https://github.com/it-ideas