Russian fonts

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Russian fonts

Post by ddragas »

How to use Russian fonts with Web page?
How to tell script to use particular fonts (that is on server)

How is these page displaying russian text
http://forums.codeforge.com/view.php?si ... 1063890134
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

Content-Type: text/html; charset=KOI8-R
That's in the response (HTTP) headers.
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

Thank you for reply


I’m doing site that alows owner to translate this site on unlimited number of languages and between them is russian. Now I’m stuck with this Russian problem.

I’ ve got more questions

How to install font (russian cyrillic alphabet) on server (probably upload like all other files)
If so how to tell css to use this font?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

ddragas wrote: How to install font (russian cyrillic alphabet) on server (probably upload like all other files)
If so how to tell css to use this font?
To answer your exact question: http://www.w3.org/TR/REC-CSS2/fonts.html#descdef-src

Although for such a site I would highly recommend to serve the pages in UTF-8 encoding. Much less hassle. And this way there's no need to use font embedding, majority of modern user-agents will correctly display the entire range of UTF-8.

Further reading: http://www.w3.org/International/resource-index
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

If i put like feyd sugested me

<meta http-equiv="Content-Type" content="text/html; charset=KOI8-R" />

instead of

<meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />

will it convert latin letters into cyrillic letters?


If I select in windows (win98) russian language and write some text in MS Word it automaticly convert into cyrillic letters

Does it work in that way?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

ddragas wrote:If i put like feyd sugested me

<meta http-equiv="Content-Type" content="text/html; charset=KOI8-R" />

instead of

<meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />

will it convert latin letters into cyrillic letters?
That depends on what source charset is. There's 4 different character sets (other than Unicode variants) for russian language widely used: windows-1251 (cp1251), koi8-r, cp866 (dos charset) and MAC. For correct display of html page source charset (e.g. character set html file is written in) must match declared charset (<meta http-equiv> tag).
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

It is not working in way I've described abowe . What should I do to make it work?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

What is source charset of your files?
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

I've tried all you've mentioned with this code

Code: Select all

<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r" /> 
<title>Untitled Document</title>
</head>

<body>
<?

$rr = "csdvcavgaetzcyvcbgsfdhtsd";

echo $rr;
?>
</body>
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

of course

changing line

<meta http-equiv="Content-Type" content="text/html; charset=koi8-r" />

with

<meta http-equiv="Content-Type" content="text/html; charset=cp866" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-5" />
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r" />
<meta http-equiv="Content-Type" content="text/html; charset=koi8-ru" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

and what you expected? There are no cyrillic characters in code you've posted... setting different russian charsets would make no difference in this case.

Here's another resource you may find useful: http://vancouver-webpages.com/multilingual/
Side note: koi8-r example there is wrong (because they should have used "koi8-r", not "koi8"
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

Thank you for reply.
I tought that it will act like on windows.
When language is changed (source charset) that it will convert latin letters into cyrillic letters.
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

And is MySql db accepting cyrilic characters?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

ddragas wrote:And is MySql db accepting cyrilic characters?
http://dev.mysql.com/doc/mysql/en/charset.html
Post Reply