Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Long-word scroll problem

6 views
Skip to first unread message

masonc

unread,
Aug 30, 2015, 7:04:12 PM8/30/15
to
In a title, I have a long word that forces scrolling when on a narrow viewport.
(it is in one of three columns)

Is there any way to insert a narrow space in the word?
A hyphen is not appropriate in this word.

MasonC http://frontal-lobe.info

Jukka K. Korpela

unread,
Aug 31, 2015, 1:35:45 AM8/31/15
to
31.8.2015, 2:04, masonc wrote:

> In a title, I have a long word that forces scrolling when on a narrow viewport.
> (it is in one of three columns)

What word?

> Is there any way to insert a narrow space in the word?

Yes, you can insert any space character. However, there is no
requirement in HTML specifications that the semantics of fixed-width
space characters be obeyed by browsers. In practice it’s complicated and
depends on browser, fonts available to it, and CSS settings.

> A hyphen is not appropriate in this word.

If it is a word (in the normal sense of the English word “word”), then a
narrow space is usually even less appropriate.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

masonc

unread,
Aug 31, 2015, 3:02:58 AM8/31/15
to
On Mon, 31 Aug 2015 08:35:42 +0300, "Jukka K. Korpela" <jkor...@cs.tut.fi>
wrote:

>31.8.2015, 2:04, masonc wrote:
>
>> In a title, I have a long word that forces scrolling when on a narrow viewport.
>> (it is in one of three columns)
>
>What word?

fair enough: "homosexuality" and I know of no substitute in a book title
>
>> Is there any way to insert a narrow space in the word?
>
>Yes, you can insert any space character. However, there is no
>requirement in HTML specifications that the semantics of fixed-width
>space characters be obeyed by browsers. In practice it’s complicated and
>depends on browser, fonts available to it, and CSS settings.
>
>> A hyphen is not appropriate in this word.

I've made various attempts to create a narrow space, without success.
So I'll hyphenate. It doesn't look TOO bad.
>
>If it is a word (in the normal sense of the English word “word”), then a
>narrow space is usually even less appropriate.

I narrow space does look awkward. Thanks for the response.

JJ

unread,
Aug 31, 2015, 7:44:10 AM8/31/15
to
How about those Unicode space characters which are narrower than the common
space character? i.e.:

Four-per-Em space (&#x2005;)
Six-per-Em space (&#x2006;)
Thin space (&#x2009;)
Hair space (&#x200A;)
Zero width space (&#x200B;)

Chris F.A. Johnson

unread,
Aug 31, 2015, 8:00:04 AM8/31/15
to
On 2015-08-31, masonc wrote:
> On Mon, 31 Aug 2015 08:35:42 +0300, "Jukka K. Korpela" <jkor...@cs.tut.fi>
> wrote:
>
>>31.8.2015, 2:04, masonc wrote:
>>
>>> In a title, I have a long word that forces scrolling when on a narrow viewport.
>>> (it is in one of three columns)
>>
>>What word?
>
> fair enough: "homosexuality" and I know of no substitute in a book title

Why do you think it should not be hyphenated?

--
Chris F.A. Johnson

BootNic

unread,
Aug 31, 2015, 8:30:19 AM8/31/15
to
In article <u8u7ua9rbsao5794d...@4ax.com>,
masonc <mas...@frontal-lobe.info> wrote:

[snip]

>> 31.8.2015, 2:04, masonc wrote:

>>> In a title, I have a long word that forces scrolling when on a narrow
>>> viewport. (it is in one of three columns)

[snip]

> fair enough: "homosexuality" and I know of no substitute in a book title

soft hyphen:
Ho&shy;mo&shy;sex&shy;u&shy;al&shy;i&shy;ty

>>> Is there any way to insert a narrow space in the word?

zero width space:
Ho&#x200b;mo&#x200b;sex&#x200b;u&#x200b;al&#x200b;i&#x200b;ty

Check support for the browsers you wish.

Don't care where it wraps?

css:
h1 {
word-wrap: break-word;
}

[snip]


--
BootNic Mon Aug 31, 2015 08:30 am
Imagination was given to man to compensate him for what he isn't. A sense
of humor was provided to console him for what he is.
*Horace Walpole English novelist*
signature.asc

Jukka K. Korpela

unread,
Aug 31, 2015, 9:39:18 AM8/31/15
to
31.8.2015, 10:02, masonc wrote:

>> What word?
>
> fair enough: "homosexuality" and I know of no substitute in a book title

I don’t know any substitute either. If the text is a heading, then word
division should be avoided, but sometimes it’s the least of evils.

> I've made various attempts to create a narrow space, without success.

I don’t see how spacing would help, unless it causes line wrapping, i.e.
gets replaced by line break in rendering, and then the cure is worse
then the disease.

> So I'll hyphenate. It doesn't look TOO bad.

You don’t need “fixed” hyphenation. You can use the SOFT HYPHEN
character to suggest hyphenation points. Browser support is excellent.
The advantage over fixed hyphenation is that the text behaves well if
the heading or the styling is changed.

It’s best to include SOFT HYPHEN characters at points where division is
most acceptable, rather than at all points allowed by formal hyphenation
rules. For example,

homo&shy;sexual&shy;ity

--
Yucca, http://www.cs.tut.fi/~jkorpela/

masonc

unread,
Aug 31, 2015, 2:33:34 PM8/31/15
to
On Sun, 30 Aug 2015 16:04:09 -0700, masonc <mas...@frontal-lobe.info> wrote:

>In a title, I have a long word that forces scrolling when on a narrow viewport.
>(it is in one of three columns)
>
>Is there any way to insert a narrow space in the word?

Thanks for the *soft hyphen* &shy; It solves my problem.
Hyphen only when forced by viewport narrowness.

CIWAx rescues me again ! BootNic Jukka and all

(now I'll learn, i.e.Google, Unicode characters and
go nuts with them)

MasonC http://frontal-lobe.info

tlvp

unread,
Sep 1, 2015, 12:25:28 AM9/1/15
to
On Mon, 31 Aug 2015 11:33:31 -0700, masonc wrote:

> Thanks for the *soft hyphen* &shy; It solves my problem.

Yes. By the time I found your OP, it had already seen > 5 responses, but I
too would have suggested the discretional (or soft) hyphen and the
zero-width space as the best choices, depending on whether you would prefer
to see or to avoid hyphens when a break is required. But all I can do now
is to second those suggestions most enthusiastically :-) .

> (now I'll learn, i.e.Google, Unicode characters and
> go nuts with them)

Absolutely! A good UTF-8 way to produce diacritically decorated characters,
too. The only pity is how often there's no entity *name*, like &shy; or
&eacute; but only a decimal or hex numerical code like &#347; or &#x015B;
for "ś" (i.e., LC s with an acute accent over it -- &sacute; fails for me).

One way to get started is with the "references" links listed here:

<https://en.wikipedia.org/wiki/HTML#Character_and_entity_references>.

Other denizens and doyens of this NG will be able to offer you much more.

Cheers, -- tlvp
--
Avant de repondre, jeter la poubelle, SVP.

Jukka K. Korpela

unread,
Sep 1, 2015, 1:12:34 AM9/1/15
to
1.9.2015, 7:25, tlvp wrote:

> Absolutely! A good UTF-8 way to produce diacritically decorated characters,
> too.

I’m not sure I see what you mean by that. UTF-8 is a transfer encoding
for Unicode, representing each character (more exactly, each code point)
as 1 to 4 bytes. When you use UTF-8, you enter characters “as such”,
though you might still need to, or want to, use (numeric) character
references or entity references for some characters.

> The only pity is how often there's no entity *name*, like &shy; or
> &eacute; but only a decimal or hex numerical code like &#347; or &#x015B;
> for "ś" (i.e., LC s with an acute accent over it -- &sacute; fails for me).

There is, but this is more of a problem than a solution. HTML5 defines a
large extended set of “named character references”, including &sacute;
http://www.w3.org/TR/html5/syntax.html#named-character-references
But if you have a browser version that is a few years old, it won’t
recognize them; it will render &sacute; literally.

(Besides, the “names” are just half-mnemonic, or not mnemonic at all.
Who would guess what “&ap;” or “bcy;” means?)

Using UTF-8, you would simply enter “ś” as such. For this you need a
UTF-8 capable editor, some input method(s) for entering the characters
you need, and proper character encoding declaration (saving as UTF-8
with BOM, Byte Order Mark, will handle this, though you can’t do that
when playing with PHP, which is BOM-ignorant).

You can even enter SOFT HYPHEN as such when using UTF-8, “­”, but then
it will either be not visible at all or display as common “-” (normal
hyphen, formally called HYPHEN-MINUS), depending on software, in an
editor and in View Source.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

masonc

unread,
Sep 1, 2015, 10:06:44 AM9/1/15
to
On Mon, 31 Aug 2015 11:33:31 -0700, masonc <mas...@frontal-lobe.info> wrote:

snip snip
>(now I'll learn, i.e.Google, Unicode characters and
>go nuts with them)

But but problem, not all are supported by all browsers.
Google "unicode character support"

E.G. I like &star; and &starf; (&#x2605; &#x2606;)
but my old MSIE-8 doesn't do stars and displays &star; literally.
It hides &#x2605; and &#x2606; so that's preferable.

Jukka K. Korpela

unread,
Sep 1, 2015, 1:22:41 PM9/1/15
to
1.9.2015, 17:06, masonc wrote:

> But but problem, not all [Unicode characters] are supported by all browsers.’

This is more of a font problem, really making it worse. There is no
single font that is available in all browsers. (“Web-safe” browsers were
always a myth, and it is even more so now that Android devices – which
typically have a limited font repertoire of their own – have become common.)

> E.G. I like &star; and &starf; (&#x2605; &#x2606;)
> but my old MSIE-8 doesn't do stars and displays &star; literally.
> It hides &#x2605; and &#x2606; so that's preferable.

This is one reason why the added “named character references” should be
avoided. They introduce a new level of problems: either a browser
supports them, or it does not.

If you really like “★” and ”☆”, it is safest to use images for them.
They are typically used as standalone symbols rather than as text
characters. If you use them as characters, use the numeric references or
the characters themselves (in UTF-8) and use a “downloadable font” with
@font-face. For details see
http://www.cs.tut.fi/~jkorpela/html/characters.html

--
Yucca, http://www.cs.tut.fi/~jkorpela/

masonc

unread,
Sep 1, 2015, 9:31:49 PM9/1/15
to
After all that, I am using images for my stars.
Seems more dependable.

MasonC http://frontal-lobe.info

tlvp

unread,
Sep 1, 2015, 10:32:42 PM9/1/15
to
On Tue, 1 Sep 2015 08:12:32 +0300, Jukka K. Korpela wrote:

> 1.9.2015, 7:25, tlvp wrote:
>
>> Absolutely! A good UTF-8 way to produce diacritically decorated characters,
>> too.
>
> I’m not sure I see what you mean by that. UTF-8 is a transfer encoding
> for Unicode, representing each character (more exactly, each code point)
> as 1 to 4 bytes. When you use UTF-8, you enter characters “as such”,
> though you might still need to, or want to, use (numeric) character
> references or entity references for some characters. ...

Apologies for the confusion I engendered -- I evidently misused the
terminology (or, as NBourbaki might have put it, "abused the language").
I meant to be referring to the &#number; or &#xhexnumber; ways of
specifying glyphs/characters/punctuationmarks in HTML. Sorry.

>> The only pity is how often there's no entity *name*, like &shy; or
>> &eacute; but only a decimal or hex numerical code like &#347; or &#x015B;
>> for "ś" (i.e., LC s with an acute accent over it -- &sacute; fails for me).
>
> There is, but this is more of a problem than a solution. ...

I was too cryptic: I meant 'no entity *name* that browsers reliably honor'.

> ... HTML5 defines a
> large extended set of “named character references”, including &sacute;
> http://www.w3.org/TR/html5/syntax.html#named-character-references
> But if you have a browser version that is a few years old, it won’t
> recognize them; it will render &sacute; literally.
>
> (Besides, the “names” are just half-mnemonic, or not mnemonic at all.
> Who would guess what “&ap;” or “bcy;” means?)

Well, &ap; I'd *guess* apostrophe. And you're right: &bcy; has me stumped.

> Using UTF-8, you would simply enter “ś” as such. For this you need a
> UTF-8 capable editor, some input method(s) for entering the characters
> you need, and proper character encoding declaration (saving as UTF-8
> with BOM, Byte Order Mark, will handle this, though you can’t do that
> when playing with PHP, which is BOM-ignorant).

In my original "too-few-words" remark, I'd been assuming no such marvelous
editor and no such appropriate input method, whence the appeal of HTML's
willingness to accept character references in lieu of actual characters.

> You can even enter SOFT HYPHEN as such when using UTF-8, “­”, but then
> it will either be not visible at all or display as common “-” (normal
> hyphen, formally called HYPHEN-MINUS), depending on software, in an
> editor and in View Source.

Ah, yes. In that regard, whatever all we may agree is horrible about MS
Word, it is at least willing to display hyphens and soft hyphens in ways
that enable easy visual distinction of the one from the other :-) .

Dr J R Stockton

unread,
Sep 3, 2015, 6:40:31 PM9/3/15
to
In comp.infosystems.www.authoring.html message <ms0p03$si2$1@dont-
email.me>, Mon, 31 Aug 2015 08:35:42, Jukka K. Korpela
<jkor...@cs.tut.fi> posted:

>
>If it is a word (in the normal sense of the English word “word”), then
>a narrow space is usually even less appropriate.
>

But if it a long number, Document I.U.P.A.P.-25 (SUNAMCO 87-1) section
1.3.2 stipulates a "thin space" for grouping the digits in threes. It
evidently was not designed to apply to those who use lakhs and crores.

Those unfortunates who lack a copy of the IUPAP SUNAMCO red book can try
<http://metrology.wordpress.com/measurement-process-index/iupap-red-
book/>. Please let me know if there is a later edition.

--
(c) John Stockton, near London. Mail ?.?.Stoc...@physics.org
Web <http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, and links.

Jukka K. Korpela

unread,
Sep 4, 2015, 10:15:49 AM9/4/15
to
3.9.2015, 16:08, Dr J R Stockton wrote
under Subject: re: Re: Long-word scroll problem:

> In comp.infosystems.www.authoring.html message <ms0p03$si2$1@dont-
> email.me>, Mon, 31 Aug 2015 08:35:42, Jukka K. Korpela
> <jkor...@cs.tut.fi> posted:
>> If it is a word (in the normal sense of the English word “word”), then
>> a narrow space is usually even less appropriate.
>
> But if it a long number, Document I.U.P.A.P.-25 (SUNAMCO 87-1) section
> 1.3.2 stipulates a "thin space" for grouping the digits in threes.

I would not use the word “stipulate” here. The document says that in
long numbers, digits may be grouped. Taken literally, it allows “a thin
space” only, but it probably means “a space, which may be thin” – at
least this makes much more sense, since in many contexts, thin spaces
cannot be used.

The document is partly in contradiction with the ISO 80000-2 standard,
which says: “No group shall contain more than three digits.” IUPAP Red
Book allows a trailing 4-digit group.

> Those unfortunates who lack a copy of the IUPAP SUNAMCO red book can try
> <http://metrology.wordpress.com/measurement-process-index/iupap-red-
> book/>. Please let me know if there is a later edition.

Thank you for pointing out that resource. It seems that there is no
later edition, just a reprint, judging from
http://iupap.org/commissions/commission-on-symbols-units-nomenclature-atomic-masses-and-fundamental-constants/commission-information/
which links to an online version of the reprint:
http://iupap.org/wp-content/uploads/2014/05/A4.pdf

The original topic was about problems caused by long words, apparently
looking for solutions that make words wrap. Using spaces inside a
number, though useful, is more of a problem than a solution in that
respect. We normally don’t want 42 000 to wrap so that “42” is at the
end of a line and “000” is at the start of the next line. The space
should normally be non-breaking; whether it is thin is less essential,
and mainly a typographic issue.

ObHTML: Although it is possible to write 1&nbsp;000&nbsp;000 in HTML, it
is not ideal for several reasons. It might be better to use

<span class=num>1 000 000</span>

and CSS code that prevents line breaks and uses a negative value for
word-spacing to simulate the use of thin spaces.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
0 new messages