7 replies [Last post]
robtomorrow
robtomorrow's picture
Offline
newbie
Seattle
Last seen: 3 years 3 weeks ago
Seattle
Timezone: GMT-7
Joined: 2011-09-27
Posts: 4
Points: 5

I am working on a website that will have both English and Russian text, I don't speak Russian the text is given to me by the client. I copied and pasted the text into the html document, and tagged it appropriately.

I am using Charset utf-8, the text is showing up in Russian OK, but I am unable to change the font-family,
I am using a Russian font that I found on the web and added it in the css using @font-face.

If I type a sentence in English it is styled in the Russian font, which is what I expected because I specified the Russian font for the sentence, but the actual Russian stays in some default font.

Here is a link to the test site, http://robfenwick.com/kolibri/

Does anyone know what I need to do to be able to choose the font-family for both the English and Russian?

Thanks in advance,

Rob

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 8 hours 37 min ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5125
Points: 2722

Hi Rob, Around your text on

Hi Rob,
Around your text on that page you have

<div class="russian">

So you should be able to make use of that as long as it is not there when you have English text.

body{
 font-family:'some english font';
}
.russian{
  font-family:'my russian font';
}

robtomorrow
robtomorrow's picture
Offline
newbie
Seattle
Last seen: 3 years 3 weeks ago
Seattle
Timezone: GMT-7
Joined: 2011-09-27
Posts: 4
Points: 5

Hi Tony, Thank you for your

Hi Tony,

Thank you for your suggestion, that is what I had planned to do, but that isn't the problem, the Russian isn't getting the intended font, the English sentence is there just as a test.

If you notice on the page that I linked to, the first sentence has a different font than the rest.
it says in the html "just something simple in English" the rest is in Russian in the html, but it isn't in the same font as the English when rendered to the page.

In other words the English is picking up the Russian font, and the Russian isn't, even though they are both assigned the Russian font in the css. The Russian is in some default font, I can't change the Russian font, and I would like to.

Rob

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 8 hours 37 min ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5125
Points: 2722

Ok now I am starting to

Ok now I am starting to understand.
I think one issue is the way you are specifying the font family

font-family:RusnishHelveticaRegular;
I think should be:
font-family:'Rusnish Helvetica Regular';

If that is the font you want and can't edit that file then just use specificity to override it in a css file you can edit.

body div.russian{
font-family:'Rusnish Helvetica Regular';
}

robtomorrow
robtomorrow's picture
Offline
newbie
Seattle
Last seen: 3 years 3 weeks ago
Seattle
Timezone: GMT-7
Joined: 2011-09-27
Posts: 4
Points: 5

Hi Tony,I can edit any file,

Hi Tony,

I can edit any file.

Let me explain it another way, I can't change the Russian font because the browser isn't rendering the Russian in the font I want.

edit:

I just tested what would happen if I used Arial as the font, it turns out that when I use Arial both languages are in Arial. So maybe it's a problem with the font I'm trying to use.

Rob

diml0rd
diml0rd's picture
Offline
newbie
iran
Last seen: 3 years 2 weeks ago
iran
Timezone: GMT+3.5
Joined: 2011-09-26
Posts: 8
Points: 9

hey rob

i'm working on this project of mine i have to use persian font...maybe your answer will help me somehow so i'm not solving any problem here...
by any chance do you get different results in different browsers?

robtomorrow
robtomorrow's picture
Offline
newbie
Seattle
Last seen: 3 years 3 weeks ago
Seattle
Timezone: GMT-7
Joined: 2011-09-27
Posts: 4
Points: 5

Hi dimlOrd,What I found is

Hi dimlOrd,

What I found is that if you set the charset as UTF-8 and encode the page in "UTF-8 without BOM" you can use any font you want, I even tested an odd font "New Century Shoolbook" in Persian for you.

My original problem was that I was trying to use a Russian specific font, for some reason that didn't work.

IE is always a pain in the ass, for IE8 you have to have the languages installed on your operating system, and using @fontface in css you have to have a eot version of the font listed as a source.

I don't know if there has been any improvement with IE9.

Rob

diml0rd
diml0rd's picture
Offline
newbie
iran
Last seen: 3 years 2 weeks ago
iran
Timezone: GMT+3.5
Joined: 2011-09-26
Posts: 8
Points: 9

hey rob

hey rob,
i always use utf-8, the problem is when i use this specific font (which i've uploaded) they are shown separated from each other,persian letters are stick together something like :"چسبیده" but when using a custom font they get separated
so when i want: چسبیده
i get : چ س ب ی د ه
but only in mozilla firefox and safari,in chrome opera and IE9 it works fine...

about IE9 , its really better than IE8.
IE9 almost supports everything but still...many people hate it including me !
check out these links:
IE9 HTML5 support
IE9 CSS3 Support