Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 04, 2016, 08:25:35 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Can CSS apply custom user style to a certain range of Unicode characters?  (Read 3044 times)

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 822
    • View Profile
    • Donate to Member
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.

Quote from: daddydave
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.
If bad things happen to other people, it's karma. If bad things happen to me, it's kismat!
« Last Edit: December 16, 2011, 10:40:45 PM by daddydave »

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,117
    • View Profile
    • Donate to Member
Re: Can CSS apply custom user style to a certain range of Unicode characters?
« Reply #1 on: December 18, 2011, 01:36:29 PM »
My first thought is that it's way beyond CSS.

More of a javascript thing perhaps?

Eóin

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
    • View Profile
    • Donate to Member
Re: Can CSS apply custom user style to a certain range of Unicode characters?
« Reply #2 on: December 18, 2011, 05:26:01 PM »
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

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 822
    • View Profile
    • Donate to Member
Re: Can CSS apply custom user style to a certain range of Unicode characters?
« Reply #3 on: December 18, 2011, 05:26:47 PM »
My first thought is that it's way beyond CSS.

More of a javascript thing perhaps?

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.
If bad things happen to other people, it's karma. If bad things happen to me, it's kismat!

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 822
    • View Profile
    • Donate to Member
Re: Can CSS apply custom user style to a certain range of Unicode characters?
« Reply #4 on: December 28, 2011, 02:10:28 PM »
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.
If bad things happen to other people, it's karma. If bad things happen to me, it's kismat!
« Last Edit: December 28, 2011, 07:07:05 PM by daddydave »

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 822
    • View Profile
    • Donate to Member
Re: Can CSS apply custom user style to a certain range of Unicode characters?
« Reply #5 on: December 28, 2011, 07:01:25 PM »
Got it done with PrefBar! And it is definitely a geek tool. Still fine tuning it because I actually want to change 2-3 settings at the same time, but this works so great I made an animated gif of my custom preference in action (used the ScreenshotCaptor Grab Repeat Last Size+Pos feature for the first time):

s1-4.gif



If bad things happen to other people, it's karma. If bad things happen to me, it's kismat!
« Last Edit: December 28, 2011, 07:08:05 PM by daddydave »