473,387 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Fractions Simply Won't Display Properly

I've been searching in vain for a way to present typographically
correct fractions (not resorting to <sup> and <sub> tags) but have been
frustrated by the fact that the glyphs for one-half, one-eighth,
three-quarters, etc. do not display in the correct typeface (or even
consistently the same typeface) and seem totally resistant to attempt
to fix this through CSS:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Language" content="en">
<table>
<tr valign="top"><td>&#x00bc;</td></tr>
<tr valign="top"><td>&#x00bd;</td></tr>
<tr valign="top"><td>&#x00be;</td></tr>
<tr valign="top"><td>⅓</td></tr>
<tr valign="top"><td>⅔</td></tr>
<tr valign="top"><td>⅕</td></tr>
<tr valign="top"><td>⅖</td></tr>
<tr valign="top"><td>⅗</td></tr>
<tr valign="top"><td>⅘</td></tr>
<tr valign="top"><td>⅙</td></tr>
<tr valign="top"><td>⅚</td></tr>
<tr valign="top"><td>⅛</td></tr>
<tr valign="top"><td>⅜</td></tr>
<tr valign="top"><td>⅝</td></tr>
</table>
</body>
</html>

Any thoughts of a solution (other than using inlines like 1/2, 3/4,
etc. or other hacks)?

Jul 24 '05 #1
33 6555
se*******@gwi.net wrote:
I've been searching in vain for a way to present typographically
correct fractions (not resorting to <sup> and <sub> tags) but have been
frustrated by the fact that the glyphs for one-half, one-eighth,
three-quarters, etc. do not display in the correct typeface (or even
consistently the same typeface) and seem totally resistant to attempt
to fix this through CSS:


CSS won't add glyphs to a font that doesn't have them.
Jul 24 '05 #2
On Wed, 29 Jun 2005, se*******@gwi.net wrote:
I've been searching in vain for a way to present typographically
correct fractions (not resorting to <sup> and <sub> tags) but have been
frustrated by the fact that the glyphs for one-half, one-eighth,
three-quarters, etc. do not display in the correct typeface
Well, as was mentioned in the responses to your same question on
comp.fonts, where it was suggested that you might raise the question
in this hierarchy: that's really a question about the browser, not so
much about the HTML. As far as HTML is concerned, your &#number;
references, such as ⅓ onwards, *are* the correct way to
represent the fraction characters. Each browser will do its best (for
some value of "best") to display them.
(or even consistently the same typeface)
Again, that's a browser question, really, as well as being indirectly
a question about the available fonts. As I said, some of those
fractions are in MS's WGL4 (and thus are likely to be present in their
supplied fonts), whereas others aren't (and thus might need a
specialist font to get them).

Ideally, browsers are supposed to work their way through
cosmetically-similar fonts when the selected font doesn't have the
desired character. But, in the end, it's better to display the
desired character (no matter how bad the style match) than to display
nothing at all. So if you're short on available fonts, this is what
you're going to get. That's a browser fact (which you could discuss
on the relevant browsers group if you think it's of sufficient
interest), but from the authoring point of view, I say that what
you're doing is entirely correct (even if you're disappointed in the
results).
and seem totally resistant to attempt to fix this through CSS:


As author in a web situation, you really can't expect to "fix" this
sort of thing through CSS[1]. As author you have no idea what fonts
and repertoires the user may have available. Note that CSS allows you
to *name* fonts, but knowing the name of the font *in no way* tells
you for sure what repertoire of characters that font may contain.

As reader, your best bet is to disable any font suggestions from the
author, and fix your browser to use the best font that you can get.

If you want better results on your *own* browser, you'd need to
explain more (on the appropriate browsers group) about what you've got
already, i.e which OS you're using, which browsers you're testing,
which fonts you configured to be your default, and so on.

But your readers will be getting whatever they're getting - unless you
manage to encourage them to install some better fonts, etc.

hope this helps
[1] there have been proposals for downloadable fonts in CSS, but they
aren't in widespread practical use on the web.
Jul 24 '05 #3
> CSS won't add glyphs to a font that doesn't have them.

This I know. What I meant by "fixing" via CSS is in the case where the
font does in fact "have" the particular glyph but doesn't display it in
the correct typeface, I've tried to specify a font like Arial Unicode
MS and it still doesn't render properly. Plus, I'm trying not to count
on someone having a font installed other than the standard half-dozen
or so (Arial, Georgia, Times, Helvetica, et al.)

Jul 24 '05 #4
se*******@gwi.net wrote:

I've been searching in vain for a way to present typographically
correct fractions (not resorting to <sup> and <sub> tags) but have been
frustrated by the fact that the glyphs for one-half, one-eighth,
three-quarters, etc. do not display in the correct typeface (or even
consistently the same typeface) and seem totally resistant to attempt
to fix this through CSS:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Language" content="en">
<table>
<tr valign="top"><td>&#x00bc;</td></tr>
<tr valign="top"><td>&#x00bd;</td></tr>
<tr valign="top"><td>&#x00be;</td></tr>
<tr valign="top"><td>⅓</td></tr>
<tr valign="top"><td>⅔</td></tr>
<tr valign="top"><td>⅕</td></tr>
<tr valign="top"><td>⅖</td></tr>
<tr valign="top"><td>⅗</td></tr>
<tr valign="top"><td>⅘</td></tr>
<tr valign="top"><td>⅙</td></tr>
<tr valign="top"><td>⅚</td></tr>
<tr valign="top"><td>⅛</td></tr>
<tr valign="top"><td>⅜</td></tr>
<tr valign="top"><td>⅝</td></tr>
</table>
</body>
</html>

Any thoughts of a solution (other than using inlines like 1/2, 3/4,
etc. or other hacks)?


First of all, I hope you have a </head> and <body> between the last
<meta> and the <table>.

For fractions that have entity references in the HTML 4.01
specification, use them in place of the numeric character
references:
&frac14; for 1/4
&frac12; for 1/2
&frac34; for 3/4
If the glyphs exist in the viewer's display font, this will work.

For other fractions (and for the above three, if you choose),
create a style that displays the inlines with a smaller font
relative to the current font-size and slightly elevated. For
example:
.fract { font-size: 80%; vertical-align: 20% }
Then use
<p>1 = <span class=fract>1/3</span> + <span class=fract>2/3</span>
This will work even if the viewer does not have fractional glyphs.

Actually, I would probably use <font> in place of <span> because
the effect is supposed to change the size font. I know <font> is
deprecated, but its use here would be mnemonic when I manually edit
an HTML file.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
Jul 24 '05 #5
> CSS won't add glyphs to a font that doesn't have them.

Obviously not. What I meant by this is that I thought CSS might be able
to force a group of fraction glyphs to all display in the same font.
Try styling the table I provided using CSS and you'll see what I mean.

Apparently, the problem arises from the fact that the glyphs for
one-half, one-quarter, and three-quarters reside in the Latin-1
Supplement Block and the others are in the Number Forms block, and
those two blocks are (maddeningly enough) not presented in the same
shape or typeface.

Jul 24 '05 #6
> CSS won't add glyphs to a font that doesn't have them.

Of course not. What I meant was that CSS cannot override the fact that
the glyphs for one-half, one-quarter, and three-quarters (from the
Latin-1 block) display in one typeface and the others (from the Number
Forms block) in another typeface.

Jul 24 '05 #7
Sorry for the essentially duplicate posts. I was foolishly using Google
Groups and got frustrated when my replies weren't showing up. Apologies.
Jul 24 '05 #8

"Alan J. Flavell" <fl*****@ph.gla.ac.uk> wrote in message
news:Pi******************************@ppepc56.ph.g la.ac.uk...
On Wed, 29 Jun 2005, se*******@gwi.net wrote:
I've been searching in vain for a way to present typographically
correct fractions (not resorting to <sup> and <sub> tags) but have been
frustrated by the fact that the glyphs for one-half, one-eighth,
three-quarters, etc. do not display in the correct typeface
Well, as was mentioned in the responses to your same question on
comp.fonts, where it was suggested that you might raise the question
in this hierarchy: that's really a question about the browser, not so
much about the HTML. As far as HTML is concerned, your &#number;
references, such as ⅓ onwards, *are* the correct way to
represent the fraction characters. Each browser will do its best (for
some value of "best") to display them.


I understand. I'm still not happy with the visual results, though.
(or even consistently the same typeface)


Again, that's a browser question, really, as well as being indirectly
a question about the available fonts. As I said, some of those
fractions are in MS's WGL4 (and thus are likely to be present in their
supplied fonts), whereas others aren't (and thus might need a
specialist font to get them).


I don't know of a way to "get" a specialist font for a public website. I'm
stuck, like most web designers, with either specifying the same crummy group
of fonts (Arial, Times, Verdana, et al.). If I were to specify a font I was
sure "had" all of the necessary glyphs, there's a good chance a visitor to
my website will not have that font installed on his/her client machine.
Hence my dilemma.
But, in the end, it's better to display the
desired character (no matter how bad the style match) than to display
nothing at all.
I see what you mean, but that kind of cold comfort for my situation.
So if you're short on available fonts, this is what
you're going to get. That's a browser fact (which you could discuss
on the relevant browsers group if you think it's of sufficient
interest), but from the authoring point of view, I say that what
you're doing is entirely correct (even if you're disappointed in the
results).
In other words, I'm screwed.
[1] there have been proposals for downloadable fonts in CSS, but they
aren't in widespread practical use on the web.


This I would like to see!!!! :-) :-) :-) If they could make the presentation
of fonts dependent on the server rather than the client, that would solve a
lot of problems from my perspective. Why should the web continue to be
typographically inferior to print?
Jul 24 '05 #9
On Wed, 29 Jun 2005, Sam Elowitch wrote:
I understand. I'm still not happy with the visual results, though.
This is what I'm getting at: if you're not happy with the visual
results on *your* browser, then tune *your* browser (e.g get some
better fonts, and tell the browser to use them).

But if you're not happy with the visual results that your *users*
might be getting, then your only recourse is to encourage them to do
the same. There's nothing that you, as an HTML author, can do in
practice to force their browser to do something that it's currently
not doing - either because it's not capable of it, or because it's
not currently configured to do it.

Your HTML is correct, there's no real argument about that.
I don't know of a way to "get" a specialist font for a public website.
It's not going to happen. Good fonts cost money, and rightly so.
I'm stuck, like most web designers, with either specifying the same
crummy group of fonts (Arial, Times, Verdana, et al.).
As I've said: if the reader has a better font, they may well get
improved results by disabling the author's choice of font, and
imposing their own instead.
If I were to specify a font I was sure "had" all of the necessary
glyphs, there's a good chance a visitor to my website will not have
that font installed on his/her client machine. Hence my dilemma.
It's the way things are on the web, indeed.
In other words, I'm screwed.
If you were hoping to persuade your readers to display something of
which their own browsers aren't capable or aren't configured to do,
then yes, I suppose you are. But in web terms, that's considered to
be their choice, really.
Why should the web continue to be typographically inferior to print?


It isn't, inherently. If you used the same fonts for printing that
your browser is using for the web, I reckon you'd get the same printed
results. And how many print documents do you know which can be
processed in all the interesting ways that web documents can be
handled? Visual browsing is only one possibility, even if it's the
one of specific interest to you at this point.

What's going wrong here seems to be that you don't accept the division
of responsibility between HTML (marking-up content), CSS (to propose a
presentation), and the browser (to render the content as best it can,
with or without use of those CSS proposals from the author). Your
complaint seems to me to lie exactly with the browsers that you're
using (and the fonts that are available to them, and the settings
you've chosen or at least accepted, and so on).

that's the best I can summarise it, anyway.
Jul 24 '05 #10
David Ross wrote:
se*******@gwi.net wrote:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Language" content="en">
<table>
<tr valign="top"><td>&#x00bc;</td></tr>
<tr valign="top"><td>&#x00bd;</td></tr> [snip]<tr valign="top"><td>⅝</td></tr>
</table>
</body>
</html>


First of all, I hope you have a </head> and <body> between the last
<meta> and the <table>.


Technically not necessary--and neither are the <head> or </body>.
However, it's still weird to include one and not the other.
Jul 24 '05 #11
In our last episode,
<11**********************@f14g2000cwb.googlegroups .com>,
the lovely and talented se*******@gwi.net
broadcast on comp.infosystems.www.authoring.html:
I've been searching in vain for a way to present typographically
correct fractions (not resorting to <sup> and <sub> tags) but have been
frustrated by the fact that the glyphs for one-half, one-eighth,
three-quarters, etc. do not display in the correct typeface (or even
consistently the same typeface) and seem totally resistant to attempt
to fix this through CSS:
You cannot fix it with CSS because it isn't CSS's fault. The
font has to have the characters. No font, of course, has
characters for all the simple fractions. Some have none. Some
have half and fourth, perhaps 3/4. You may find some that have
a few more where the denominator is some small power of two.
For that reason, it is probably a good idea to represent
fractions differently where you will have many different
fractions and not to mix the two in the same context even when
you have a few.
Any thoughts of a solution (other than using inlines like 1/2, 3/4,
etc. or other hacks)?


If you are doing mathematical texts in which fractions composed
with the solidus are not acceptable, HTML is not your best
choice.

--
Lars Eighner ei*****@io.com http://www.larseighner.com/
War on Terrorism: Okay, Unleash OUR Extreme Fundamentalists
"... all of them who have tried to secularize America, I point the finger in
their face and say, 'You helped this happen.'" --Jerry Falwell
Jul 24 '05 #12
On 29 Jun 2005 se*******@gwi.net wrote:
I've been searching in vain for a way to present typographically
correct fractions (not resorting to <sup> and <sub> tags) but have been
frustrated by the fact that the glyphs for one-half, one-eighth,
three-quarters, etc. do not display in the correct typeface (or even
consistently the same typeface)


Your problem is not limited to fractions but it can occur with nearly
*every* character. Have a look at
http://www.unics.uni-hannover.de/nht...face-arial.gif
where the browser took the glyphs for non-Western characters from
a completely-different-looking typeface.

You should be happy if the reader's browser and fonts display
http://ppewww.ph.gla.ac.uk/~flavell/...a21.html#x2153
in some way. If you want a uniform typeface, use PDF.
Why do you want fractions, anyway? Use the metric system
http://physics.nist.gov/cuu/Units/
http://www.metric.org/
and you don't need to bother with fractions.

--
Everybody expects the German Inquisition.

Jul 24 '05 #13
On Thu, 30 Jun 2005, Andreas Prilop wrote:
Your problem is not limited to fractions but it can occur with nearly
*every* character.
Indeed.

Just as a data point here. As I commented before, the 1/8, 3/8, 5/8
and 7/8 characters are in MS's WGL4, but the others in this area are
not, as far as I can tell. By default I had Win Mozilla configured to
use "Arial".

Looking at my test page, it was clear that not only the 1/8...7/8
glyphs but also the 1/3 and 2/3 glyphs were being taken from the same
font, but the fifths and sixths were coming from somewhere else.

So I changed my Mozilla configuration to choose Code2000 instead, and,
sure enough, then they all came out in the same style. (This is not
the place to discuss whether you like that style or not, but they were
the *same*, that's my point).

I then tried "Arial Unicode MS", and again got a consistent
presentation (different, of course, from Code2000, but consistent in
itself). We know from previous discussion why "Arial Unicode MS"
would not be a good choice of font for general use (it has no real
bold or italic faces, they have to be derived from the base font), but
at least this demonstrates the principle as I was telling it before:
same HTML (under control of the author), but different browser
configuration (under control of the reader), means different visual
results.
Why do you want fractions, anyway? Use the metric system


But as you rightly say, the principle is the same for any bunch of
characters/glyphs - so the underlying principles can't be wiped aside
quite so easily as that ;-}

Jul 24 '05 #14
> I then tried "Arial Unicode MS", and again got a consistent
presentation (different, of course, from Code2000, but consistent
in itself).
What's Code2000 and how do you set it in Firefox? I know Arial Unicode
MS is common on recent iterations of Windows, but what about Mac OS X?
Can I force the browsers to do this automatically? Probably the answers
to the latter three questions are all "no".
Why do you want fractions, anyway? Use the metric system


Actually, on my website, I need to display both. The whole world
prefers metric except Americans. Unfortunately, most Americans are so
unaccustomed to the metric system that it ends up confusing them.

Jul 24 '05 #15
"Alan J. Flavell" <fl*****@ph.gla.ac.uk> wrote:
As far as HTML is concerned,
your &#number; references, such as ⅓ onwards, *are* the
correct way to represent the fraction characters.


I would question the wording "the correct way" vs. "a correct way".

And I'm not quite sure about the correctness. Surely ⅓ is correct
by HTML specifications, but it is a compatibility character, and the
document "Unicode in XML and other Markup Languages"
http://www.w3.org/TR/unicode-xml/
recommends _normalization_ for it, with the somewhat hypocritical
comment "As long as fraction slash is supported!" Here normalization
refers to Unicode normalization form KC

So it seems that both the W3C and the Unicode Consortium think that
⅓ should be replaced by 1&#x2044;3 or some equivalent way of
representing the three-character sequence U+0031 U+2044 U+0033
and browsers should take care of rendering it as a conventional
fraction (even without style sheets - and a style sheet would hardly
help here anyway). But they implicitly admit that this doesn't really
work yet.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 24 '05 #16

On Tue, 5 Jul 2005, Jukka K. Korpela wrote:
"Alan J. Flavell" <fl*****@ph.gla.ac.uk> wrote:
As far as HTML is concerned,
your &#number; references, such as ⅓ onwards, *are* the
correct way to represent the fraction characters.
I would question the wording "the correct way" vs. "a correct way".


Thanks for the correction, which I don't disagree with...
And I'm not quite sure about the correctness. Surely ⅓ is correct
by HTML specifications, but it is a compatibility character, and the
document "Unicode in XML and other Markup Languages"
http://www.w3.org/TR/unicode-xml/
recommends _normalization_ for it, with the somewhat hypocritical
comment "As long as fraction slash is supported!" Here normalization
refers to Unicode normalization form KC

So it seems that both the W3C and the Unicode Consortium think that
⅓ should be replaced by 1&#x2044;3 or some equivalent way of
representing the three-character sequence U+0031 U+2044 U+0033
and browsers should take care of rendering it as a conventional
fraction (even without style sheets - and a style sheet would hardly
help here anyway). But they implicitly admit that this doesn't really
work yet.


Right.
Jul 24 '05 #17


On Fri, 1 Jul 2005, shamshoon wrote:
I then tried "Arial Unicode MS", and again got a consistent
presentation (different, of course, from Code2000, but consistent
in itself).


What's Code2000

what's a search engine? For example
http://www.google.co.uk/search?hl=en&q=code2000

It's a font.
and how do you set it in Firefox?
If you wanted to, you'd first get the font, install it, and then select
it.
I know Arial Unicode MS is common on recent iterations of Windows,
Actually not. To the best of my knowledge it does not come with any MS
OS, but is only licensed with a number of their chargeable products, such
as MS Office etc.
but what about Mac OS X?
I think you'd need to consult a lawyer about that...
Can I force the browsers to do this automatically?
If you're speaking as a web author, then the standard answer applies: on
the web you can not "force" your readers to do ANYTHING, and it is good
that it is so.
Actually, on my website, I need to display both. The whole world
prefers metric except Americans. Unfortunately, most Americans are so
unaccustomed to the metric system that it ends up confusing them.


Then you have a particularly challenging problem, since USA users appear
to be the most likely to have a crippled font installation, and unaware
that they can or should do anything about it. That was a summary of
previous discussions here, as well as my own personal experience of
interactions with some of them.

I recall that M.Crispin (who I believe reads Japanese), author of the IMAP
protocol, somewhat sarcastically remarked that USA users don't need
anything more than us-ascii, with the implication that anything more
would only confuse them. Ho hum.

all the best.
Jul 24 '05 #18
On Tue, 5 Jul 2005, Alan J. Flavell wrote:
I recall that M.Crispin (who I believe reads Japanese), author of the IMAP
protocol, somewhat sarcastically remarked that USA users don't need
anything more than us-ascii, with the implication that anything more
would only confuse them.


However, © ® seem to be widely used even in US-ASCII land.
http://www.google.com/search?q=copyr...:microsoft.com

--
Evil® is a registered trademark of the President of the United States.

Jul 24 '05 #19
> On Fri, 1 Jul 2005, shamshoon wrote:
Actually, on my website, I need to display both. The whole world
prefers metric except Americans. Unfortunately, most Americans are so
unaccustomed to the metric system that it ends up confusing them.

Alan J. Flavell wrote:
Then you have a particularly challenging problem, since USA users appear
to be the most likely to have a crippled font installation, and unaware
that they can or should do anything about it. That was a summary of
previous discussions here, as well as my own personal experience of
interactions with some of them. I recall that M.Crispin (who I believe reads Japanese), author of the IMAP
protocol, somewhat sarcastically remarked that USA users don't need
anything more than us-ascii, with the implication that anything more
would only confuse them. Ho hum.


I'm American, and I agree with that...

While trying to make my pages present themselves as best I could I found
that quite a few compromises needed to used. So, ultimately, I gave up
on trying to suppoort Netscape 4.xx this allowed me to used entity
references as defined in HTML 4.01 please see my tables...

http://software.seaplusplus.net/code...eferences.html

So, I have settled on the scheme for equations (which exhibit fractions
on steroids) ;-) used in...

http://library.seaplusplus.net/physi...elativity.html

Just search on the equals sign to see the treatment of the equations. I
am very anxious to hear any feedback on this scheme.

Thank you...

Rich
Jul 24 '05 #20
On Wed, 6 Jul 2005, SeaPlusPlus wrote:
So, ultimately, I gave up
on trying to suppoort Netscape 4.xx this allowed me to used entity
references as defined in HTML 4.01 please see my tables...
No need to.
http://library.seaplusplus.net/physi...elativity.html
Just search on the equals sign to see the treatment of the equations. I
am very anxious to hear any feedback on this scheme.


http://www.unics.uni-hannover.de/nht...thematics.html
with &#number; expressions displays well even on Netscape 4.08
for Macintosh, Solaris, and MS Windows.
http://ppewww.ph.gla.ac.uk/~flavell/...cklist.html#s6

--
"No Sports!"

Jul 24 '05 #21
On Wed, 6 Jul 2005, Andreas Prilop wrote:
http://www.unics.uni-hannover.de/nht...thematics.html
with &#number; expressions displays well even on Netscape 4.08
for Macintosh, Solaris, and MS Windows.
http://ppewww.ph.gla.ac.uk/~flavell/...cklist.html#s6


yes, I know that, and you know that, but it will only work if the
client has an adequate font available and selected. See also the
introductory material (User Perceptions) at:

http://ppewww.ph.gla.ac.uk/~flavell/...ers-fonts.html

The problem we're discussing here is that USA users are the most
likely to have been supplied with a crippled font with their Windows
OS - to be unaware that it would be useful to install the OS with the
multinational option selected - and be unaware that they could or
should now do anything to correct the deficiency.

As such, I say the author is still presented with somewhat of a
challenge in trying to get this to work on those users' systems.

That it *can* be made to work is undisputed.
Jul 24 '05 #22
JRS: In article <Xn*****************************@193.229.0.31>, dated
Tue, 5 Jul 2005 17:05:57, seen in news:comp.infosystems.www.authoring.ht
ml, Jukka K. Korpela <jk******@cs.tut.fi> posted :

So it seems that both the W3C and the Unicode Consortium think that
⅓ should be replaced by 1&#x2044;3 or some equivalent way of
representing the three-character sequence U+0031 U+2044 U+0033
and browsers should take care of rendering it as a conventional
fraction (even without style sheets - and a style sheet would hardly
help here anyway). But they implicitly admit that this doesn't really
work yet.

That will work for 1/9; but ISTM not for 1/11.

Without going as far as full maths mark-up, ISTM a pity that HTML has no
way - unless there's one I've failed to see - of indicating a general
multi-character "fraction", not necessarily numeric : something that a
browser might render like either

numerator numerator
----------- or /
denominator denominator

perhaps with an indication of preference.

One can do with num/den or <sup>num</sup>/<sub>den</sub> but it does
not necessarily get rendered well, and it is not mark-up for meaning.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
Jul 24 '05 #23
Dr John Stockton <re*******@merlyn.demon.co.uk> wrote:
Without going as far as full maths mark-up, ISTM a pity that HTML has no
way - unless there's one I've failed to see - of indicating a general
multi-character "fraction", not necessarily numeric : something that a
browser might render like either

numerator numerator
----------- or /
denominator denominator

perhaps with an indication of preference.

One can do with num/den or <sup>num</sup>/<sub>den</sub> but it does
not necessarily get rendered well, and it is not mark-up for meaning.


Well, if I read the draft correctly, HTML 3.0 would have allowed markup
like <math> { numerator <over> denominator } </math>. And MathML 2.0 allows
markup like <mfrac> numerator denominator </mfrac>.

Of course, browser support is an issue...
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"Cheaters never win; they just finish first." - Johhny Hart
Jul 24 '05 #24
Andreas Prilop wrote:
http://www.unics.uni-hannover.de/nht...thematics.html
Thanks, I'll take a close look at this later...

I expect this page could also be done with entity references correct? (I
may try it)

Is there any other tradeoff using entity references besides lack of NN4
(or IE4) support?
with &#number; expressions displays well even on Netscape 4.08
for Macintosh, Solaris, and MS Windows.
I realize I could include NN4 in my support if I used the numerical
refences but I hate to use that because it makes writing, editing and
supporting the documents very hard to read. So, for me, it was more
important to have the entity references because I can read what is going
on beyond the encocdings.

i.e. &lsquo; means 'left single quote'
http://ppewww.ph.gla.ac.uk/~flavell/...cklist.html#s6


I know... I used this info when I was deciding how to approach the
problem but decided that the &#bignumber; 'preferred' was not compelling
enough for me and that it was less compelling as time marches on... ;-)
(I love the fact that I can READ entity references)

Thank you...

Rich
Jul 24 '05 #25
Dr John Stockton <jr*@merlyn.demon.co.uk> wrote:
So it seems that both the W3C and the Unicode Consortium think that
⅓ should be replaced by 1&#x2044;3 or some equivalent way of
representing the three-character sequence U+0031 U+2044 U+0033
and browsers should take care of rendering it as a conventional
fraction (even without style sheets - and a style sheet would
hardly help here anyway). But they implicitly admit that this
doesn't really work yet.


That will work for 1/9; but ISTM not for 1/11.


I don't think there's a difference. The Unicode standard says:
"Fraction Slash. U+2044 FRACTION SLASH is used between digits to form
numeric fractions, such as 2/3, 3/9, and so on. The standard form of a
fraction built using the fraction slash is defined as follows: any
sequence of one or more decimal digits (General Category = Nd),
followed by the fraction slash, followed by any sequence of one or more
decimal digits. Such a fraction should be displayed as a unit, such as
¾ or as [¾ in a different style, with horizontal line]. The precise
choice of display can depend upon additional formatting information."
http://www.unicode.org/versions/Unic...06.pdf#page=14

It is conceivable that browsers could get this wrong, handling just
cases with single digits around the fraction slash, but the standard is
clear. And browsers just don't get even the simple case right.
Handling multi-digit cases should be trivial as soon as you handle the
simple case.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 24 '05 #26
JRS: In article <Pi*******************************@ppepc56.ph.gla. ac.uk
, dated Wed, 6 Jul 2005 17:18:53, seen in news:comp.infosystems.www.aut horing.html, Alan J. Flavell <fl*****@ph.gla.ac.uk> posted :
The problem we're discussing here is that USA users are the most
likely to have been supplied with a crippled font with their Windows
OS - to be unaware that it would be useful to install the OS with the
multinational option selected - and be unaware that they could or
should now do anything to correct the deficiency.

As such, I say the author is still presented with somewhat of a
challenge in trying to get this to work on those users' systems.


One should not pander to the incompetent. Do it so that it works well
in the majority of countries (there are more countries in the British
Isles than in the whole of North America), and include a footnote or
link explaining why they have their problem.

Consider, analogously, what Stan Brown wrote recently : in the real
world we expect servers to retain articles, in worthwhile text groups,
for of the order of a month (and, with decent newsreaders, can retain
articles locally for as long as we choose) : it is those who use ill-
chosen tools and inadequate services that should incur the consequences.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 24 '05 #27
On Wed, 6 Jul 2005, SeaPlusPlus wrote:
Andreas Prilop wrote:
http://www.unics.uni-hannover.de/nht...thematics.html


Thanks, I'll take a close look at this later...

I expect this page could also be done with entity references
correct? (I may try it)


In *theory* all three representations, where available:

- the coded character itself, in the character encoding scheme
declared by the "charset" MIME parameter

- the numeric character reference &#whatever; (in hex or decimal)

- the character entity reference &whatever;

are functionally equivalent in HTML and XHTML. The differences are in
browser support. My conclusions were that character entity references
were fine for the Latin-1 repertoire, but otherwise better avoided;
the numeric references are always fine, but decimal was somewhat
better supported than hex. Coded characters are also fine, and in
some circumstances the only available choice (specifically:
user-defined encodings); furthermore they work in utf-8, even for that
old NN4 beast - their chief disadvantage seems to be unfamiliarity to
authors, who are liable to bungle the attempt and/or fail to advertise
the character encoding correctly from their server.

There's a fuller discussion and reference to other resources on my
page http://ppewww.ph.gla.ac.uk/~flavell/charset/checklist

With time, sure, these distinctions will fade away, and it is good so,
but for now I think there still may be some benefit in observing them.

hope this helps
Jul 24 '05 #28
JRS: In article <Xn****************************@193.229.0.31>, dated
Wed, 6 Jul 2005 22:07:42, seen in news:comp.infosystems.www.authoring.ht
ml, Jukka K. Korpela <jk******@cs.tut.fi> posted :
Dr John Stockton <jr*@merlyn.demon.co.uk> wrote:
So it seems that both the W3C and the Unicode Consortium think that
⅓ should be replaced by 1&#x2044;3 or some equivalent way of
representing the three-character sequence U+0031 U+2044 U+0033
and browsers should take care of rendering it as a conventional
fraction (even without style sheets - and a style sheet would
hardly help here anyway). But they implicitly admit that this
doesn't really work yet.


That will work for 1/9; but ISTM not for 1/11.


I don't think there's a difference. The Unicode standard says:
"Fraction Slash. U+2044 FRACTION SLASH is used between digits to form
numeric fractions, such as 2/3, 3/9, and so on. The standard form of a
fraction built using the fraction slash is defined as follows: any
sequence of one or more decimal digits (General Category = Nd),
followed by the fraction slash, followed by any sequence of one or more
decimal digits. Such a fraction should be displayed as a unit, such as
¾ or as [¾ in a different style, with horizontal line]. The precise
choice of display can depend upon additional formatting information."
http://www.unicode.org/versions/Unic...06.pdf#page=14

It is conceivable that browsers could get this wrong, handling just
cases with single digits around the fraction slash, but the standard is
clear. And browsers just don't get even the simple case right.
Handling multi-digit cases should be trivial as soon as you handle the
simple case.


That would work for numeric fractions; but more is needed, as in my
gravity*.htm pages : a/b a + b/c a+b / c (a + 2b)/(c + 4d) .

ISTM that Unicode can provide only a partial solution, and mark-up for
it should be at the HTML level, to accommodate the general cases of
layout <raised> then <slash> then <lowered> and <raised> over <line>
over <lowered> (with font size reduction), which are not necessarily
fractions in any non-typographical sense.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
Jul 24 '05 #29
On Wed, 6 Jul 2005, SeaPlusPlus wrote:
http://www.unics.uni-hannover.de/nht...thematics.html
I expect this page could also be done with entity references correct?


Yes.
Is there any other tradeoff using entity references besides lack of NN4
(or IE4) support?
Don't know.
I realize I could include NN4 in my support if I used the numerical
refences but I hate to use that because it makes writing, editing and
supporting the documents very hard to read. So, for me, it was more
important to have the entity references because I can read what is going
on beyond the encocdings.


Why then do you bother with entities? Write the text directly in UTF-8.
Isn't it more convenient to see, say, µ than &micro; ?

--
Everybody expects the German Inquisition.

Jul 24 '05 #30
On Wed, 6 Jul 2005, Dr John Stockton wrote:
One should not pander to the incompetent. Do it so that it works well
in the majority of countries (there are more countries in the British
Isles than in the whole of North America), and include a footnote or
link explaining why they have their problem.


I take that, that one should write, for example, √
for the square root sign
http://www.unics.uni-hannover.de/nht...quareroot.html

but not <font face=Symbol>&Ouml;</font>.
http://google.com/search?q=p.is.disp...859-1&filter=0

Jul 24 '05 #31
Dr John Stockton <jr*@merlyn.demon.co.uk> wrote:

[ Discussing the use of FRACTION SLASH character, in a hypothetical
situation where it is supported as defined in the Unicode standard: ]
That would work for numeric fractions; but more is needed, as in my
gravity*.htm pages : a/b a + b/c a+b / c (a + 2b)/(c + 4d)


Fractional expressions are different from fractions as fractional
numbers. Traditional typography uses particular styles for the latter
but does not deal much with the former, partly because it revolves
around normal text rather than mathematical texts. Surely you need some
special markup or comparable tools if you wish to have fractional
expressions displayed in special ways (i.e. other than simple
linearized notation). HTML 3.0 had some realistic ideas about this, but
now we are in the jungle of messy and mostly unimplemented MathML.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 24 '05 #32
Andreas Prilop wrote:
Why then do you bother with entities? Write the text directly in UTF-8.
Isn't it more convenient to see, say, µ than &micro; ?


Seems problematic to me... how do I encode the files I've already done
easily and what happens when... say... I choose view source in my
browser (or for someone else's) will it show correctly or will they then
see mouse droppings throughout the text?

If I thought it would be reasonable I would...
Thank you...

Rich
Jul 24 '05 #33
On Fri, 8 Jul 2005, SeaPlusPlus wrote:
Seems problematic to me... how do I encode the files I've already done
easily
You could open with Netscape/Mozilla Composer and save as UTF-8.
and what happens when... say... I choose view source in my
browser (or for someone else's) will it show correctly or will they then
see mouse droppings throughout the text?


Try that at
http://www.unics.uni-hannover.de/nht...ilingual1.html

Jul 24 '05 #34

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: karp | last post by:
Lets say I have the following class in order to add two fractions, class Fraction{ public: Fractions::Fraction(int numer = 0, int denom = 1) { valeurNumerateur = numer; valeurDenominateur =...
0
by: Mori | last post by:
Hi, How do I hold fractions in a string so I can display them and print them out? Say I want to display "2½" (that's 2 and a half if this doesn't display either), but it displays "2?½"...
2
by: Mori | last post by:
Hi, Can someone supply a code example of displaying a string with a fractional part, say 5 and 7 16ths. I cannot find an example of how to use the Encoding object (if that is what you use). ...
2
by: Just Me | last post by:
I need a numerical updown control that displays fractions. If the increment is 1/16 it would display 1/16, 1/32, 3/16, 1/4... I thought I might inherit from a NumericalUpDown control and place...
15
by: farah727rash | last post by:
Hi everyone, I have this problem and I don't know what's wrong with my program. I am trying to enter my two variables height and weight as fraction numbers. I declared them as float and also as...
4
by: Bob | last post by:
Hi All, Was wondering if in C# there is an elegant way of displaying and or calculating fractions. The case: we have an app that measures/slices dices etc and all our internal measures and...
1
by: Semajthewise | last post by:
Here it is cleaned up a little more. Here's what this code does. It will take 2 fractions and add, subtract, multiply, or divide them. The user enters the fractions to be calculated into two...
5
by: gubbachchi | last post by:
Hi all, How to convert the fractions into decimals and vice versa in php. I have a form, where the user will enter fractions in the text boxes such as "1 1/2", "1 1/4" and so on. I need to store...
0
by: Paddy | last post by:
(From: http://paddy3118.blogspot.com/2008/09/python-fractions-issue.html) There seems to be a problem/difference in calculating with the new fractions module when comparing Python 26rc2 and 30rc1...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.