[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) <rde@odoo.com>
This commit is contained in:
Laurent Stukkens
2024-03-20 18:29:23 +00:00
committed by Romain Derie
parent 1a54ee3c91
commit 12c327ad94
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -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
+1
View File
@@ -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