WordPress.org

Making WordPress.org

Opened 12 months ago

Last modified 3 months ago

#3933 new enhancement

Optimize fonts for Persian language

Reported by: parsmizban Owned by:
Milestone: Priority: high
Component: General Keywords: has-screenshots needs-patch
Cc:

Description

Hi,
We need some font optimization for Persian language on O2 theme and other wp.org themes,
How we can coordinate it?

I think we can add a font family for every language (if need) in CSS files, like this:

html[lang="fa-IR"] body{
    font-family: Tahoma, Arial, Arial, sans-serif;
}

Although we have a specific web font which we can provide to include it in the theme
if it is possible for meta team to add such things
Waiting for a response
Thank you for any help

Attachments (2)

Font.zip (289.8 KB) - added by dedidata 4 months ago.
Font Pack
wp-iransans-font.jpg (85.4 KB) - added by dedidata 4 months ago.
screenshot

Download all attachments as: .zip

Change History (14)

#2 @dd32
11 months ago

Hey @parsmizban,

I think I'd prefer us to simply copy what WordPress itself does, which is defined here:
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/css/l10n.css

in short, that would result in:

body.rtl {
     font-family: Tahoma, Arial, sans-serif;
}
html[lang="he-IL"] body.rtl {
     font-family: Arial, sans-serif;
}

Would that be enough to make the fonts more legible?
It looks like it'll need to be added to quite a few of the w.org themes, as there isn't any shared stylesheets for everything.

#3 @parsmizban
11 months ago

@dd32

Hi,

Yes, It works too, and it will fix that
I think my solution may be is better, Because other RTL languages may be don't like Tahoma, Arial
as their default
But:

html[lang="fa-IR"] body.rtl {
     font-family: Tahoma, Arial, Arial, sans-serif;
}

is same as :

html[lang="fa-IR"] body {
     font-family: Tahoma, Arial, Arial, sans-serif;
}

Because Persian language should be in RTL always, But you can check for RTL again too
It's ok

Last edited 11 months ago by parsmizban (previous) (diff)

#4 @parsmizban
11 months ago

I prefer to have this font for Persian, if it is possible, it will be very nice:
https://github.com/ParsMizban/Yekan-Font

#5 @dedidata
4 months ago

@dd32
Hi,
Could you please use this font for Persian language on O2 theme?
The license for the font is allowed for whole wordpress.org site by fontiran.com
IranSans font is a suitable font for Persian
I attached the font pack, license and a shot

@font-face {
	font-family: IRANSans;
	font-style: normal;
	font-weight: normal;
	src: url('../fonts/IRANSansWeb.eot');
	src: url('../fonts/IRANSansWeb.eot?#iefix') format('embedded-opentype'),  /* IE6-8 */
		url('../fonts/IRANSansWeb.woff2') format('woff2'),  /* FF39+,Chrome36+, Opera24+*/
		url('../fonts/IRANSansWeb.woff') format('woff'),  /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
		url('../fonts/IRANSansWeb.ttf') format('truetype');
}
@font-face {
	font-family: IRANSans;
	font-style: normal;
	font-weight: bold;
	src: url('../fonts/IRANSansWeb_Bold.eot');
	src: url('../fonts/IRANSansWeb_Bold.eot?#iefix') format('embedded-opentype'),  /* IE6-8 */
		url('../fonts/IRANSansWeb_Bold.woff2') format('woff2'),  /* FF39+,Chrome36+, Opera24+*/
		url('../fonts/IRANSansWeb_Bold.woff') format('woff'),  /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
		url('../fonts/IRANSansWeb_Bold.ttf') format('truetype');
}
html[lang="fa-IR"] body {
	font-family: IRANSans, Tahoma, Arial, Arial, sans-serif !important;
}

CC @tobifjellner

Version 0, edited 4 months ago by dedidata (next)

@dedidata
4 months ago

Font Pack

@dedidata
4 months ago

screenshot

#6 @dedidata
4 months ago

  • Keywords has-patch has-screenshots added
  • Priority changed from normal to high
  • Type changed from defect to enhancement

#7 @dd32
3 months ago

  • Keywords needs-patch added; has-patch removed

I'm not going to add any custom font stacks for languages, although I'll happily update it to match what's inside WordPress itself if it's not already the same.

That's the same result as as I said above in comment #2. If you'd like the font stack to be better, please open a discussion with WordPress core directly to get better fonts in there for everyone.

If someone can go through the existing sites and locate which sites need their font stacks updated to match WordPress, that's be greatly appreciated.

Last edited 3 months ago by dd32 (previous) (diff)

#8 follow-up: @dedidata
3 months ago

@dd32
All advanced Persian sites (Powered by WordPress) don't use default fonts
All of them install a plugin to change the fonts
So think the wp.org itself has a bad font for Persian
So when everybody visits the fa.wp.org, they don't like that and they will go to other advanced web sites, and So we lose visitors
There are many other web sites out there which are providing things
As we can't install our desire plugins on wp.org, So how we can change the font on wp.org?
You mean we should change the default font on the core of WordPress in the first step?
It is a thing related to themes
Typography for default preinstalled English fonts (sans serif, Arial, ...) is much much better than Persian
That means which an English web site using preinstalled fonts will be advanced in look and feel
But it is not true for Persian using default preinstalled fonts

Last edited 3 months ago by dedidata (previous) (diff)

#9 in reply to: ↑ 8 @dd32
3 months ago

Replying to dedidata:

All advanced Persian sites (Powered by WordPress) don't use default fonts
All of them install a plugin to change the fonts

Like I said, get better fonts in WordPress core, focus on not needing that plugin.
I'm not enabling a plugin unless there's been a good faith effort on improving it and I can see there's a significant benefit.

This ticket was mentioned in Slack in #meta by dedidata. View the logs.


3 months ago

#11 @SergeyBiryukov
3 months ago

Let's start with implementing comment:2, seems like that would be an improvement over the current font stack.

WordPress core historically uses Tahoma for all RTL languages except Hebrew, which uses Arial.

#12 @dedidata
3 months ago

@SergeyBiryukov
For Persian, Tahoma is suitable for normal and small sizes, And Arial Bold is suitable for headings
But the combination of these 2 fonts will not perfect totally for Persian
The typography of Tahoma and Arial fonts may be good for English or some other languages, but not enough for Persian
Using those fonts, the site will look like an old site in Persian,
That's the reason I mentioned to include IranSans font, I granted a license for whole wp.org
I think this is related to the theme to choose its font, Not related to WordPress core
Many advanced Persian themes and sites use IranSans font for their theme
I don't see any popular Persian sites which use Tahoma or Arial as their font
So we have a theme on WP.org web site which it has its rules, We can define its rules
So we can decide to have an old feel and looking site for Persian, Or an advanced!
I really don't like to lose our visitors by displaying an old looking site

Note: See TracTickets for help on using tickets.