Alex Rivera | Logout

Can CSS choose a different default font and size depending on Language

Asked 2009-02-11T06:15:04.970
45

I have the following CSS fragment:

INPUT{ font-family: Raavi; font-size: 14px;}

Which works fine when the textbox contains some Punjabi script like this: ਪੰਜਾਬੀ

But the user might enter English instead, and I would rather use the Verdana font with a different size, since the English letters in the Raavi font are real funky and the size is wrong.

So my question could be stated as:

  • Is there any type of conditional font-family and size selection within CSS based on the input
  • Is there anyway for CSS to know about the input language?

So I could create the following PSEUDO_CSS:

INPUT{ EN-font-family: Verdana; EN-font-size: 12px; PA-font-family; Raavi; EN-font-size: 14px;}

or

INPUT.EN{ font-family: Verdana; font-size: 12px;}
INPUT.PA{ font-family: Raavi; font-size: 14px;}
Edit
Report

1 Answer

0

How could CSS know about the input language?

I'm afraid the only solution is to find a unicode font which looks pretty for both character sets. Which is far from perfect if your remote reader has not installed it. Maybe Arial Unicode MS.

answered 2009-02-11T06:26:05.067

Your Answer