Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unicode character-specific CSS - a thought

Tags:

css

unicode

As a native Bānglā (Language: Bengali) writer, we are dependent on to Unicode Bānglā characters. As we all know Unicode is an extended version of ASCII, and all the ASCII characters are still preserved in Unicode. And the rest of the World glyphs were added then. Now in Bānglā and other languages' concern (it can be Chinese, Hebrew, Japanese or Javanese), we have glyphs on Unicode.

But in Bānglā's concern the font-size: 100% for English characters is not enough for Bānglā characters. Because of the glyphs' position inside every grid. The thing can be understood by the following image:

Bānglā and English glyphs in grid

While English character is largely fit in a grid, the Bānglā character is shrinked to fit within because of other supporting vowel-sign-glyphs.

Hence, while we put body{font-size: 100%} it's nice for English glyphs, but with the same CSS shows the Bānglā fonts smaller.

SOLUTION, NOW
At present, how we do solution for that, is to choose a nice font that has both good English and Bānglā glyphs, i.e. "Siyam Rupali". So that, it solves the matter a very little.

NEW THOUGHT

But what I'm thinking is a bit new:
» Why not we target the Unicode glyphs and put some specific CSS for only those?

Suppose the Unicode serial number #0048 4614 5784 4578 represents the first Bānglā character and #0048 4614 5784 9999 represents the last. So, if we can do some CSS like:

Unicode[glyph="0048461457844578" - "0048461457849999"]{
   font-size: 150%;
}

I know nothing like the above is present in CSS. But, is there a way we can target specific glyphs to pose different CSS styles onto 'em?

If there's a way then many of the Bānglā Unicode users will be benefited, especially a large portion of Online Bānglā Newspapers need such a tweak over content to achieve dynamic control.

like image 923
Mayeenul Islam Avatar asked Oct 19 '13 09:10

Mayeenul Islam


People also ask

How do I type a specific Unicode character?

Inserting Unicode characters To insert a Unicode character, type the character code, press ALT, and then press X. For example, to type a dollar symbol ($), type 0024, press ALT, and then press X.

What is the Unicode of character a?

Unicode Character “A” (U+0041)

How do I add a Unicode character in CSS?

To add a Unicode character to the CSS content property, you can do either of the following: Add a Unicode character directly, or; Use the Character's Hexadecimal Unicode Code Point Value.

What is the definition of Unicode in CSS?

The unicode-range CSS descriptor sets the specific range of characters to be used from a font defined by @font-face and made available for use on the current page. If the page doesn't use any character in this range, the font is not downloaded; if it uses at least one, the whole font is downloaded.


1 Answers

This is entirely a problem of fonts. If you choose a well balanced font in which glyph sizes are adjusted in a way that mixed language text looks good together, there's no real problem. CSS can help you here in so far as you can specify custom fonts for certain characters using @font-face:

@font-face {
  font-family:   'bangla';
  src:           url('http://example.com/mybangla.ttf');
  unicode-range: U+0980-09FF;
}

This fictional "bangla" font now applies only to the Unicode range U+0980 - U+09FF, which is the Bengali block. Choose some fonts wisely and you can create a well balanced appearance in modern browsers.

like image 138
deceze Avatar answered Oct 26 '22 16:10

deceze