Opened 7 years ago
Closed 2 years ago
#29122 closed New feature (fixed)
Add a better font for Persian/Farsi to the admin
Reported by: | Mohammad Hossein Mojtahedi | Owned by: | |
---|---|---|---|
Component: | contrib.admin | Version: | 2.0 |
Severity: | Normal | Keywords: | Persian, font, Farsi |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | yes |
Description
Hi,
By every definition of design, Tahoma, Arial, Times New Roman and other default fonts are horrible in Persian (Farsi) script and can't be read properly.
There is this fantastic font called Vazir which has become the industry standard in open-source fonts.
Should we fix this in Django admin? How?
Should it be like this:
html[lang='fa-IR']{ font-family: 'Vazir', tahoma, Arial !important; } html[lang='fa-IR'] code, html[lang='fa-IR'] pre, html[lang='fa-IR'] kbd{ font-family: 'Vazir-code', "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; // Vazir-Code is a monospace font based on Vazir }
And have a @font-face block before it or a <link>
in HTML?
I'm looking for an approach that considers performance, font load time, multilingual.
Or even more options for the future. Maybe even a SETTING variable which people could easily load a font for their admin, regardless of language.
Change History (6)
comment:1 by , 7 years ago
Easy pickings: | unset |
---|---|
Summary: | A better font for Persian/Farsi → Add a better font for Persian/Farsi to the admin |
Triage Stage: | Unreviewed → Someday/Maybe |
comment:2 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 7 years ago
Hi Kelly, I think it's a bit premature to assign the ticket as it has "someday/maybe" status. The first step is to propose a solution (if a change in Django needs to be made at all) on the DevelopersMailingList as I suggested in comment 1.
comment:4 by , 7 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:5 by , 7 years ago
Thanks for reaching out Tim! My group and I are new to contributing to Django. We will take this approach with tickets that have a "someday/maybe" status in the future.
comment:6 by , 2 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Triage Stage: | Someday/Maybe → Accepted |
This should be resolved by #33878 (for Django 4.2) which added --font-family-primary
and --font-family-monospace
variables that can be overridden as per Theming support docs.
A possible solution is to override the
{% extrastyle %}
block of thebase_site.html
template to add the styles you mentioned. I'm not sure if there would be consensus to vendor the extra font in Django. Discussion for ideas like this usually happens more readily on the DevelopersMailingList. If you have colleagues who may have an opinion, please ask them to chime in.