473,408 Members | 1,743 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,408 software developers and data experts.

Combining diacritical marks and HTML+CSS

Greetings.

Is it possible using HTML and CSS to represent a combining diacritical mark
in a different style from the letter it modifies? For example, say I want
to render Å‘ (Latin small letter o with a double acute accent), but with
the o in black and the double acute accent in green. Are either of the
following valid?

1. <span style="color: black;">o</span><span style="color:
green;">&#x030B;</span>

2. <span style="color: black;">o<span style="color:
green;">&#x030B;</span></span>

Neither of the two browsers I tested (SeaMonkey 1.1.6 and Konqueror 3.5.8,
both on GNU/Linux) render the examples as intended. Is there some part of
the HTML, CSS, or Unicode standards which says that combining diacritical
marks can't be styled independently, or are my browsers buggy?

Regards,
Tristan

--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= < In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Nov 12 '07 #1
5 5582
On 11/12/2007 11:07 AM, Tristan Miller wrote:
Greetings.

Is it possible using HTML and CSS to represent a combining diacritical mark
in a different style from the letter it modifies? For example, say I want
to render Å‘ (Latin small letter o with a double acute accent), but with
the o in black and the double acute accent in green. Are either of the
following valid?

1. <span style="color: black;">o</span><span style="color:
green;">&#x030B;</span>

2. <span style="color: black;">o<span style="color:
green;">&#x030B;</span></span>

Neither of the two browsers I tested (SeaMonkey 1.1.6 and Konqueror 3.5.8,
both on GNU/Linux) render the examples as intended. Is there some part of
the HTML, CSS, or Unicode standards which says that combining diacritical
marks can't be styled independently, or are my browsers buggy?

Regards,
Tristan
In general, the mark is actually part of the character and not separate.
That is, an "ñ" is not merely an "n" with a tilde. Instead, it's quite
distinct (at least in Spanish) from an "n".

Thus, having separate colors would be inappropriate. What you want
would be the same as having an "i" with the dot a different color than
the stroke or having an "A" withe the cross-bar a different color than
the two diagonals.

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

Natural foods can be harmful: Look at all the
people who die of natural causes.
Nov 12 '07 #2
Greetings.

In article <rk********************@reader1.news.saunalahti.fi >, Jukka K.
Korpela wrote:
And if you do process combining diacritic marks by Unicode rules, then o
with double acute is to be treated as compatibility equivalent to the
single character U+0151 (Latin small letter o with double acute). In
general, programs should not be expected to treat compatibility
equivalent characters differently; they may do so, but they are surely
not required to do so.

In particular, a browser may well internally map the combination to
U+0151 at the character level. It's nothing that complicated, though.
They probably just ignore the styles you set for a combining diacritic
mark.
Yes; this much is obvious, since the result is the same with other
combinations of characters and combining diacritical marks for which there
is no equivalent single character -- say, U+0040 U+030B (@Ì‹).
You're not the first one to ask for the feature. It has been discussed at
length in the Unicode mailing list. See e.g. the discussion "Coloured
diacritics",
http://www.unicode.org/mail-arch/uni...-m12/0379.html
That page is password-protected. :(
The bottom line is that no, you can't expect to be able to do such
things.
I suspected as much, but (except in the case of compatibility equivalent
characters) you haven't provided any normative reason for this. Are you
saying that this "bottom line" is simply an implementation choice?

Regards,
Tristan

--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= < In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Nov 13 '07 #3
Scripsit Tristan Miller:
>http://www.unicode.org/mail-arch/uni...-m12/0379.html

That page is password-protected. :(
It's pseudo-protection: the password is announced on the Unicode pages, and
it is "unicode".
>The bottom line is that no, you can't expect to be able to do such
things.

I suspected as much, but (except in the case of compatibility
equivalent characters) you haven't provided any normative reason for
this.
There is no normative reason, even for compatibility equivalent characters.
Programs are allowed to treat a precomposed character differently from its
decomposed form, though they should generally not be expected to do so.

Consider the display issue. A non-supporting (though conforming)
implementation can just ignore combining diacritic marks, showing a generic
glyph of unrepresentable character. A simplistic implementation effectively
just overprints the diacritic, as taken from a font, on the base character.
A better implementation takes into account the shape of the base character
and positions, for example, a diacritic on "O" differently from the same
diacritic on "o". An even better implementation additionally checks whether
the combination exists as a precomposed character (or just as a glyph in a
font) and uses it when possible, since a glyph designed by a font designer
should be expected to be as good as or better than a combination of glyphs
generated by software. This is the intended behavior - but not required.
Are you saying that this "bottom line" is simply an
implementation choice?
Yes, but not necessarily just a matter of lazyness. It might appear to be
simple to let diacritics to be colored separately, but then the effects
would depend on the use of precomposed forms (where no such coloring would
be applied). Moreover, treating colors in an ad hoc manner would not be that
natural, and letting _any_ font formatting apply to diacritics would open a
few cans of worms. For example, font size and weight changes might have
rather odd effects and would generally ruin the work of a sophisticated
algorithm that tries to place a diacritic optimally.

If you want to play with colored diacritics, you could use a spacing
diacritic (either as a separately coded character or as a no-break space
followed by a combining diacritic), which can be colored, and use some piece
of CSS to make it overprint the preceding character. This gets tricky of
course, and nasty - you would effectively imitate the simplistic
implementation of combining diacritics (as described above). There's no sure
way of getting even the horizontal position right, since there is no CSS
unit for the width of a character.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Nov 13 '07 #4
On Mon, 12 Nov 2007, Tristan Miller wrote:
Is it possible using HTML and CSS to represent a combining diacritical mark
in a different style from the letter it modifies?
This question is not specific to HTML or CSS. In fact, you could try it
with any word processor. It is rather a question of font technology.
Even if you write, say, í as ASCII i followed by a non-spacing,
combining acute, OpenType fonts and similar font formats will
use a single glyph for display. This is usually desired - think of
capital and small letters! There is only one non-spacing, combining
acute for both capital and small letters. And you don't want
the acute to mess with the dot on the i .

Only when no single glyph is available (say, b with acute),
then the two glyphs for b and acute are combined. See
http://www.unics.uni-hannover.de/nht...ombimarks.html
for some examples.

The situation is different for Arabic and Indic scripts where
no precomposed glyphs for letter and vowel sign are available.
Browsers behave differently here. See
http://www.unics.uni-hannover.de/nht...arks-indic.htm
for some examples.

--
In memoriam Alan J. Flavell
http://groups.google.com/groups/sear...Alan.J.Flavell
Nov 13 '07 #5
On Tue, 13 Nov 2007, I wrote:
http://www.unics.uni-hannover.de/nht...ombimarks.html
This address is correct.
http://www.unics.uni-hannover.de/nht...arks-indic.htm
Sorry, this address is wrong - it is correct
http://www.unics.uni-hannover.de/nht...rks-indic.html

--
Bugs in Internet Explorer 7
http://www.unics.uni-hannover.de/nhtcapri/ie7-bugs
Nov 14 '07 #6

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

Similar topics

20
by: Rick Cook | last post by:
I'm looking for a good (non-wysiwyg) editor for HTML and CSS. I want something that will help me produce non-dynamic pages with a minimum of excrescences (no, javascript, flash, etc.) in...
22
by: opt_inf_env | last post by:
Hello, It is strange to me that html and css use different names for variables which define the same properties. For example if I whant to define text color from html document I write: <body...
6
by: dpomt | last post by:
I have a quite strange problem with the Menu control. I have ten languages and each language has a SiteMapDataSource and a Menu. For better performance, I am creating a hashtable (language ->...
36
by: sonnystarks | last post by:
I am trying to learn HTML and have obtained several books on the subject. However, I am confused with the proper way of going about it as most of these books give me the basic tags and then say...
6
by: phil-news-nospam | last post by:
Here is another attempt at making some HTML/CSS (e.g. not image) buttons. Because I've managed to avoid the things that tend to be problems, it has mostly worked. I also went back to doing tables...
4
by: Tristan Miller | last post by:
Greetings. Is it possible using HTML and CSS to represent a combining diacritical mark in a different style from the letter it modifies? For example, say I want to render Å‘ (Latin small letter...
2
tharden3
by: tharden3 | last post by:
I'm sure you've heard this 117 times in this forum, but I have been looking around, spending time on google, and I still cannot find an answer. If you have some time on your hands, please help me...
7
by: praveenb000 | last post by:
Hi, every one on this forum.... I am new to web designing (using HTML/CSS). i designed a web page using HTML, Css with dream weaver. Here is the code i used for the desinging. it appears well...
16
by: jerry101 | last post by:
Hi, I've got the usual problem that people seem to have with HTML/CSS nav bar's where it's displaying and working fine in IE but not in Firefox. The website address is ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.