diff --git a/addons/web/static/src/fonts/twitter_x_only.woff b/addons/web/static/src/fonts/twitter_x_only.woff new file mode 100644 index 0000000000000..ed88d97d5422e Binary files /dev/null and b/addons/web/static/src/fonts/twitter_x_only.woff differ diff --git a/addons/web/static/src/scss/fontawesome_overridden.scss b/addons/web/static/src/scss/fontawesome_overridden.scss index a234dbc9f81f9..eecced44a1c0e 100644 --- a/addons/web/static/src/scss/fontawesome_overridden.scss +++ b/addons/web/static/src/scss/fontawesome_overridden.scss @@ -35,4 +35,19 @@ transform: rotate(180deg); } } -} \ No newline at end of file +} +// This is a patch of the font awesome library to add the new "Twitter" X icon. +@font-face { + font-family: 'FontAwesome-twitter-x-only'; + src: url('../../src/fonts/twitter_x_only.woff'); + font-weight: normal; + font-style: normal; + font-display: block; +} +.fa.fa-x-twitter { + font-family: 'FontAwesome-twitter-x-only' !important; + + &:before { + content: '\e61b'; + } +} diff --git a/addons/web_editor/controllers/main.py b/addons/web_editor/controllers/main.py index 76d748377e648..ad544a9447071 100644 --- a/addons/web_editor/controllers/main.py +++ b/addons/web_editor/controllers/main.py @@ -37,6 +37,10 @@ def export_icon_to_png(self, icon, color='#000', size=100, alpha=255, font='/web :returns PNG image converted from given font """ + # If the icon is the new twitter X logo, then use the corresponding custom font. + if icon.isdigit(): + if int(icon) == 58907: + font = "/web/static/src/fonts/twitter_x_only.woff" # Make sure we have at least size=1 size = max(1, min(size, 512)) # Initialize font