470,849 Members | 720 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

Allowing lines to break at hyphens?

I've read the recent post about not breaking at hyphens in HTML documents.
I *want* breaking to occur at hyphens. (for 'hyphen' read 'minus sign')

IE6 and Opera7.54 both break phrases such as "never-to-be-forgotten" exactly
as I want but Mozilla1.7.3 and Firefox1.0 don't. The same happens with
entitites such as –
The CSS white-space: property doesn't seem to correct things.

The zero-width space entity ​ after each minus sign fixes things for
all the mentioned browsers except for IE6, which renders it as a small
square box. Does IE6 support this character entity?

The only solution I could find was to insert the following
<span style="font-size:0px"> </span>
after each hyphen. It works but it's a clumsy hack.

The easiest and neatest solution is not to hyphenate the phrase at all.
Jul 23 '05 #1
8 2568
On Mon, 15 Nov 2004, Danny@Kendal wrote:
I *want* breaking to occur at hyphens. (for 'hyphen' read 'minus sign')
Err, what?

I *want* Bush. (For 'Bush' read 'Kerry'.)

Usually, I do not want breaking after a minus sign, e.g. -273*°C.
The zero-width space entity &#x200B; after each minus sign fixes things for
all the mentioned browsers except for IE6, which renders it as a small
square box. Does IE6 support this character entity?


U+200B ​ is outside the WGL4 character set.
http://ppewww.ph.gla.ac.uk/~flavell/...unidata20.html
This means Internet Explorer in its _default_ setup is likely to fail
at this character.

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 23 '05 #2
"Danny@Kendal" <da***@STOPSPAMghpkendal.co.uk> wrote:
I've read the recent post about not breaking at hyphens in HTML
documents. I *want* breaking to occur at hyphens. (for 'hyphen' read
'minus sign')
As Andreas wrote, it's illogical to say "hyphen" and mean "minus sign".
Using the Ascii hyphen-minus as a surrogate for the minus sign is
understandable (though typographically, the en dash or the em dash is a
better surrogate), but it does not _make_ it a minus sign.
IE6 and Opera7.54 both break phrases such as "never-to-be-forgotten"
exactly as I want but Mozilla1.7.3 and Firefox1.0 don't.
So do you mean hyphens, or do you mean minus signs?
The same
happens with entitites such as &ndash;
Which is neither a hyphen nor a minus sign, but could be used as a
surrogate for the latter.
The CSS white-space: property doesn't seem to correct things.
It can be used to prevent line breaks in such cases, but not explicitly
allow them.
The zero-width space entity &#x200B; after each minus sign fixes
things for all the mentioned browsers except for IE6, which renders
it as a small square box.
Which rules this approach out for most purposes in authoring for the WWW,
does it not.
Does IE6 support this character entity?
It's not an entity but a character reference. IE recognizes it but fails
to apply any specific semantics to it or even render it properly.
The only solution I could find was to insert the following
<span style="font-size:0px"> </span>
after each hyphen. It works but it's a clumsy hack.
It may work for some values of "work". How about a browser that has been
configured to use a minimum font size, for example?
The easiest and neatest solution is not to hyphenate the phrase at
all.


It's not neat at all if the correct spelling contains hyphens.

The practical method is to use the tag <wbr> after the hyphen, or dash,
or minus sign. The <wbr> tag was invented by Netscape, then adopted by
other browser vendors as well, later dropped out in Netscape, then
re-introduced. But in any case, it either does nothing, or it allows a
line break, so it's a safe hack.

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

Jul 23 '05 #3
"Andreas Prilop" <nh******@rrzn-user.uni-hannover.de> a écrit dans le
message de news:Pine.GSO.4.44.0411151534410.7398-100000@s5b004
U+200B ​ is outside the WGL4 character set.


What is the "WGL4 character set" ?

Jul 23 '05 #4
On Tue, 16 Nov 2004, Pierre Goiffon wrote:
What is the "WGL4 character set" ?


What's a search engine?

http://www.google.com/search?q=wgl4

Microsoft has now defined a character set standard which includes
characters required by Western, Central, and Eastern European writing
systems, as well as characters required by Greek and Turkish. This
"PanEuropean" character set contains 652 characters and is called
WGL4: Windows Glyph List 4.

Of course, like all vendor-defined "standards", it can change at the
vendor's whim: the original WGL4 definition is subtly different from
the current "WGL4.0" definition. Who'd have thought that .0 was
greater than nothing?
Jul 23 '05 #5
In article <41**********************@news.free.fr>,
Pierre Goiffon <pg******@nowhere.invalid> wrote:
"Andreas Prilop" <nh******@rrzn-user.uni-hannover.de> a écrit dans le
message de news:Pine.GSO.4.44.0411151534410.7398-100000@s5b004
U+200B ​ is outside the WGL4 character set.


What is the "WGL4 character set" ?


It stands for "Windows Glyph List 4" and it is a Microsoft-defined
subset of Unicode that "includes characters required by Western,
Central, and Eastern European writing systems, as well as characters
required by Greek and Turkish." More info at
http://www.microsoft.com/typography/unicode/cscp.htm .

--
= Eric Bustad, Norwegian bachelor programmer
Jul 23 '05 #6
On Mon, 15 Nov 2004 17:48:26 +0000, "Jukka K. Korpela"
<jk******@cs.tut.fi> wrote in message
<Xn*****************************@193.229.0.31>:
"Danny@Kendal" <da***@STOPSPAMghpkendal.co.uk> wrote:
I've read the recent post about not breaking at hyphens in HTML
documents. I *want* breaking to occur at hyphens. (for 'hyphen' read
'minus sign')


As Andreas wrote, it's illogical to say "hyphen" and mean "minus sign".


Maybe I should have said I use the character - to hyphenate words
rather than some other character such as &hyp; &ndash; or &mdash;

Anyway. It turns out that this is a problem with Mozilla and Mozilla-based
browsers which has been known about for centuries, or so it would seem.

<wbr> was a useful tip. Thanks.

--
FZS600 - Silver/Black
GS125 - Black/Rust
Ford 100E Prefect - Black, naturally
Whisky - Aberlour Cask Strength
Jul 23 '05 #7
"Eric Kenneth Bustad" <ek*@hos1cad.ho.att.com> a écrit dans le message
de news:cn********@netnews.proxy.lucent.com
What is the "WGL4 character set" ?

(...)

Alan, Eric, thanks very mutch for these details !

Jul 23 '05 #8
Alan J. Flavell wrote:
like all vendor-defined "standards", it can change at the
vendor's whim


Like Monopoly money, as one web page put it: useful as long as the game
is played. [I Googled for the page, but could not find it. Terms like
monopoly, money, and game are a little too common on the www. ;-) ]

--
Brian (remove "invalid" to email me)
Jul 23 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by Gustaf Liljegren | last post: by
13 posts views Thread by Jesse Engle | last post: by
10 posts views Thread by Tim | last post: by
2 posts views Thread by patrik.nyman | last post: by
17 posts views Thread by kevgibbo | last post: by
19 posts views Thread by Pavan | last post: by
9 posts views Thread by Donos | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.