ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Can CSS apply custom user style to a certain range of Unicode characters?

(1/2) > >>

daddydave:
Is there a way in CSS to have a selector for all text with a Unicode range of say, 0900–097F? (Assume the HTML does use any language tags.)

Trying to see if this problem can be resolved using Stylish and a custom userstyle for Unicode characters in that range.

Yesterday I discovered the Siddhanta font for displaying Devanagari. Today I discovered that most of the Devanagari on the web is in Arial, Helvetica, or sans-serif font, even in things like Devanagari conjunct tables, where it makes no sense. Why would they not use at least Mangal? Since it is easy enough for web designers to specify a list of display fonts in order of preference, what are they thinking? Are they so grateful we have Unicode these days, they just don't care what font it is in?

Any idea why on earth would that be, and how do I shoehorn in alternative fonts generally? The closest thing I've come up with is the FontFinder extension for Firefox, but that will only let you change the font one character or word at a time or the whole web page, and you have to do it manually after the page loads.-daddydave
--- End quote ---

nudone:
My first thought is that it's way beyond CSS.

More of a javascript thing perhaps?

Eóin:
Sounds like something that could be done with a simple enough custom Javascript bookmarklet. I don't do much JS myself, but could be worth asking in coding snacks section.

daddydave:
My first thought is that it's way beyond CSS.

More of a javascript thing perhaps?
-nudone (December 18, 2011, 01:36 PM)
--- End quote ---

I think so probably, but then I saw selectors that could apply to text tagged for specific languages, and thought this might be possible, too. Yeah, probably a Greasemonkey script could do it. It may not matter much, I think some of the ligatures/conjuncts are used more for Sanskrit than Hindi which I am learning, so I don't want to get too confused with alternate forms.

daddydave:
It's not CSS, but the solution to the real problem turned out to be hidden in plain sight; see my update to my Unilang thread. Now I am just looking for some kind of browser addon to change this setting back and forth with one or two clicks.

I am taking it that Devanagari in that dropdown refers to the Unicode range itself, since there does not seems to be any language tags or markup that indicates it is Hindi or Devanagari text, and it works.

Navigation

[0] Message Index

[#] Next page

Go to full version