Sent by Lars Bruzelius on 2 September 2003 17:05
Certain vulgar fractions are available in the ISO 8859-1 character set, viz.:
½ ½ Vulgar Fraction One Half
¼ ¼ Vulgar Fraction One Quarter
¾ ¼ Vulgar Fraction Three Quarters
A few others are available in the Unicode "Number forms" [Range: 2150–218F].
The vulgar fractions available in this set are:
1/3, 2/3, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6, 1/8, 3/8, 5/8, 7/8, and 1/ , eg.:
⅔ 1/3 Vulgar Fraction One Third
⅞ 7/8 Vulgar Fraction Seven Eights
However, it seems that vulgar fractions from these two sets are taken from
various fonts representing different typefaces (Windows/2000: IE 6.0,
Netscape 7.1, Opera 7.11, with the last being the most consistent).
Using the super and subscripts from Range: 2070–209F, it is possible to do:
⁴/₆
This approach seems to work well in Netscape, but less good in Opera. IE
does not support the subscript range. The drawback of this technique is
that the source code becomes obscure.
At 2003-09-01 23:24 +03:00, Jukka K. Korpela anticipated my follow-up
questiion and wrote:
>By the way, you have some fractions presented simply as e.g. 1/3 but also
>the fraction 1/2 as a single character. I think this is esthetically
>problematic, since those fractions should have similar appearance.
True, but I will not attempt any encoding of vulgar fractions other than
1/2, 1/4, and 3/4 before I have found a satisfactory way to do it.
>I played a little with the following idea:
>
>.nom { vertical-align: 0.5ex; }
>.nom, .den { font-size: 75%; }
>.frac { letter-spacing: -0.03em;}
>
>with markup like
><span class="frac"><span class="nom">1</span>/<span
> class="den">2</span></span>
>This means quite some markup for a simple fraction, but it could
>perhaps be programmatically generated.
This is more or less what I already have tried, but found that it was too
much coding.
There must be a simpler way to do proper vulgar fractions in general with
CSS. I would also like to define these as symbolic variables, eg. &frac925;
for 9/25.
I have also tried MathML but failed in styling it with CSS:
<math><mfrac><mn>6</mn><mn>34</mn></mfrac></math>
Lars Bruzelius
SYSteam Udac AB
Box 174,
SE-751 04 Uppsala,
Sweden.
Telephone: +46 18 678054 E-mail: [EMAIL-REMOVED]
Telefax: +46 18 516600 <URL:"http://www.udac.se">
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/