Twitter RTL Support

By benleevolk Last update May 5, 2009 — Installed 285 times.

How to show persian twitts in Tahoma font?

in
Subscribe to How to show persian twitts in Tahoma font? 3 posts, 2 voices



Alireza User
FirefoxWindows

Hi
Thanks for your really nice script. I love it !

I want your help. I want this style to show persian (only persian, not english) texts (twitts) in Tahoma font with 12 pixel size.
I added the bellow code to end of script code:
GM_addStyle("body { font-family:tahoma; font-size:6px; }");

but it affects english twitts, too. I want it to affect only on persian twitts.

What i must add to the code?

Thanks for yur helping!
Alireza

 
Alireza User
FirefoxWindows

Oh god !
I was wrong! I was testing this scrip on my profile twitts!
The code wich I added works well on the twitter's Homepage.

 
benleevolk Script's Author
FirefoxX11

Hi Alireza!
Glad you liked the script.

I didn't quite understand whether you're happy with your solution right now.

I'm not aware of a way to really apply language-specific styles without explicitly marking the language, using the lang XHTML attribute and css pseudo class.

A simple workaround would be to change the style of each tweet which is changed to RTL, i.e adding:

tweets[i].style.fontFamily="tahoma";
tweets[i].style.fontSize="12px";

right after the tweets[i].style.display="block"; line (in the same block). This, however, will change the style of all characters in this tweet (including English ones).

Using Firefox's preferences window (Edit -> Preferences -> Content -> Fonts and Colors -> Advances) you can also define language specific font families and sizes, and prevent web pages from changing those selections. However, these settings apply for all websites, not just twitter.

I hope that helps, somehow... :)

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel