Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.0][IMP] web: add new twitter logo #88

Draft
wants to merge 1 commit into
base: 13.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added addons/web/static/src/fonts/twitter_x_only.woff
Binary file not shown.
17 changes: 16 additions & 1 deletion addons/web/static/src/scss/fontawesome_overridden.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,19 @@
transform: rotate(180deg);
}
}
}
}
// 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';
}
}
4 changes: 4 additions & 0 deletions addons/web_editor/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down