W3C home > Mailing lists > Public > www-style@w3.org > December 2011

Re: [selectors4][css3-text] Plaintext Fallback Characters

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 20 Dec 2011 08:05:07 -0800
Message-ID: <CAAWBYDAFayGTxHJx-cnDoxfRnNUaqzOBb1Zet8twYDyLuDnpdg@mail.gmail.com>
To: Christoph Päper <christoph.paeper@crissov.de>
Cc: www-style list <www-style@w3.org>
On Tue, Dec 20, 2011 at 4:09 AM, Christoph Päper
<christoph.paeper@crissov.de> wrote:
> In plain text you would type a vulgar fraction as “1 2/3”, “1 2⁄3” (fraction slash) or “1⅔”. The latter does not work well if that plain text is supposed to be a fallback from a richer markup language. You may want to use a different character than the normal space between integer and numerator, e.g. ‘_’, ‘+’, a non-breaking or a narrow space. If possible you may want to render the fraction stacked, i.e. with a horizontal bar in between numerator and denominator. Several markups are possible:
>  <span class="frac">1&nbsp;<sup>2</sup>&frasl;<sub>3</sub></span> – HTML4
>  <frac><int>1</int><num>2</num><den>3</den></frac> – arbitrary XML
>  <mrow>1<mfrac><mn>2</mn><mn>3</mn></mfrac></mrow> – MathML, presentational
>  <apply><plus/><cn>1</cn><apply><divide/><cn>2</cn><cn>3</cn></apply></apply>
>  $1\,\frac{2}{3}$ – LaTeX
>  {{frac|1|2|3}} – Wikipedia <http://en.wikipedia.org/wiki/Template:Frac>
> All but the first one fall back to plain text “123” or, hardly better, “1 2 3”. The problem is that you have to type the separator and the slash, then remove them with “display: none;”.

The best way is to type it as "<span>1 2/3</span>", and apply a font
with the appropriate ligatures to display the 2/3 specially.  That
doesn't remove the space, but it's at least very simple.

Another good solution would be to petition the MathML WG to allow a /
in <mfrac> between the <mn>s, to allow decent fallback behavior.
Perhaps a more generic fallback mechanism could be supported, similar
to the <rp> element in ruby text, which you mention elsewhere in your

Received on Tuesday, 20 December 2011 16:06:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:08 UTC