Discussion:
soft hyphen and hyphenation
Johannes Hofmann
2012-11-26 20:46:17 UTC
Permalink
Hi,

is it correct that we use a soft hyphen (0xc2 0xad) to draw the
hyphen when breaking words? It seems to draw ok with fltk/X11, but
wouldn't an unconditional hyphen 0xE2 0x80 0x90 be more correct?
I'm asking because e.g the Apple drawing library doesn't seem to
draw the soft hyphen if it thinks there should be no line break.

Cheers,
Johannes
Sebastian Geerken
2012-11-26 22:02:30 UTC
Permalink
Post by Johannes Hofmann
is it correct that we use a soft hyphen (0xc2 0xad) to draw the
hyphen when breaking words? It seems to draw ok with fltk/X11, but
wouldn't an unconditional hyphen 0xE2 0x80 0x90 be more correct?
I'm asking because e.g the Apple drawing library doesn't seem to
draw the soft hyphen if it thinks there should be no line break.
I see no problem with using unconditional breaks, and it seems to work
well with fltk/X11, so I've pushed the changes to hg.dillo.org.

(BTW: unconditional hyphens should also added do dillo_hyphen.)

Sebastian
corvid
2012-11-26 22:55:04 UTC
Permalink
I just wanted to mention that if you compile with -pedantic, it complains like

textblock.cc:941:22: warning: overflow in implicit constant conversion [-Woverflow]

about

text[p++] = 0xe2;
text[p++] = 0x80;
text[p++] = 0x90;
Sebastian Geerken
2012-11-27 17:22:34 UTC
Permalink
Post by corvid
I just wanted to mention that if you compile with -pedantic,
I get 633 warnings when I compile with -pedantic. :-)
Post by corvid
it complains like
textblock.cc:941:22: warning: overflow in implicit constant conversion [-Woverflow]
about
text[p++] = 0xe2;
text[p++] = 0x80;
text[p++] = 0x90;
I don't know how to deal best with this, but following change seems to
work:

text[p++] = '\xe2';
text[p++] = '\x80';
text[p++] = '\x90';

Sebastian
corvid
2012-11-27 18:02:04 UTC
Permalink
Post by Sebastian Geerken
Post by corvid
I just wanted to mention that if you compile with -pedantic,
I get 633 warnings when I compile with -pedantic. :-)
Yeah, I went through maybe a month ago and fixed a few assorted ones,
but the rest fell into a couple of categories that seemed best left
alone...
Johannes Hofmann
2012-11-27 19:43:37 UTC
Permalink
Post by Sebastian Geerken
Post by corvid
I just wanted to mention that if you compile with -pedantic,
I get 633 warnings when I compile with -pedantic. :-)
Post by corvid
it complains like
textblock.cc:941:22: warning: overflow in implicit constant conversion [-Woverflow]
about
text[p++] = 0xe2;
text[p++] = 0x80;
text[p++] = 0x90;
I don't know how to deal best with this, but following change seems to
text[p++] = '\xe2';
text[p++] = '\x80';
text[p++] = '\x90';
I know, I brought this up in the first place, but now I noticed,
that the unconditional hyphen (0xe2 0x80 0x90) seems not be
available in all fonts (e.g. I only see squares for it on
heise.de). So maybe a hyphen-minus aka '-' might be simpler and
commonly available (also see [1]). What do you think?

Cheers and sorry for the confusion,
Johannes

[1] http://www.cs.tut.fi/~jkorpela/dashes.html
corvid
2012-11-27 20:16:30 UTC
Permalink
Post by Johannes Hofmann
I know, I brought this up in the first place, but now I noticed,
that the unconditional hyphen (0xe2 0x80 0x90) seems not be
available in all fonts (e.g. I only see squares for it on
heise.de). So maybe a hyphen-minus aka '-' might be simpler and
commonly available (also see [1]). What do you think?
hyphen-minus sounds safest to me.


I wish we had a good way to deal with the squares...
Sebastian Geerken
2012-11-27 21:16:36 UTC
Permalink
Post by corvid
Post by Johannes Hofmann
I know, I brought this up in the first place, but now I noticed,
that the unconditional hyphen (0xe2 0x80 0x90) seems not be
available in all fonts (e.g. I only see squares for it on
heise.de). So maybe a hyphen-minus aka '-' might be simpler and
commonly available (also see [1]). What do you think?
hyphen-minus sounds safest to me.
What about making it configurable, with hyphen-minus as default?
Post by corvid
I wish we had a good way to deal with the squares...
One could think of testing which character is available, and so switch
to other characters, but probably this is unnecessarily complex.

Sebastian
corvid
2012-11-28 04:11:02 UTC
Permalink
Post by Sebastian Geerken
Post by corvid
Post by Johannes Hofmann
I know, I brought this up in the first place, but now I noticed,
that the unconditional hyphen (0xe2 0x80 0x90) seems not be
available in all fonts (e.g. I only see squares for it on
heise.de). So maybe a hyphen-minus aka '-' might be simpler and
commonly available (also see [1]). What do you think?
hyphen-minus sounds safest to me.
What about making it configurable, with hyphen-minus as default?
In general, it feels a little unusual to have so much configuration
related to hyphenation specifically, but...
Post by Sebastian Geerken
Post by corvid
I wish we had a good way to deal with the squares...
One could think of testing which character is available, and so switch
to other characters, but probably this is unnecessarily complex.
Is there a way to do that?
Sebastian Geerken
2012-11-28 11:09:52 UTC
Permalink
Post by corvid
Post by Sebastian Geerken
Post by corvid
Post by Johannes Hofmann
I know, I brought this up in the first place, but now I noticed,
that the unconditional hyphen (0xe2 0x80 0x90) seems not be
available in all fonts (e.g. I only see squares for it on
heise.de). So maybe a hyphen-minus aka '-' might be simpler and
commonly available (also see [1]). What do you think?
hyphen-minus sounds safest to me.
What about making it configurable, with hyphen-minus as default?
In general, it feels a little unusual to have so much configuration
related to hyphenation specifically, but...
See my latest change. Could be made configurable in a simple way.
Post by corvid
Post by Sebastian Geerken
Post by corvid
I wish we had a good way to deal with the squares...
One could think of testing which character is available, and so switch
to other characters, but probably this is unnecessarily complex.
Is there a way to do that?
If there is a way, it is probably still quite much work. Certainly not
something for the next release.

Sebastian

Loading...