04-04-2010, 03:52 PM | #1 |
Zealot
Posts: 123
Karma: 496
Join Date: Feb 2009
Location: Spokane, Washington
Device: Kindle2
|
CSS for line breaks after dashes?
Is there some way to put into the ... I suppose CSS code some trigger so that the flowable type will automatically break at hyphens, em-, and en-dashes? Maybe even before or after ellipses?
I tend to use these a fair amount, especially in dialogue, and when you add flowable type and full justification, you can get a lot of unattractively spread out lines. At the moment, I'm just putting a space at one side or the other (depending on where it occurs in the dialogue) but I'd sure rather just do it closed and have a break put in as necessary for the situation. |
04-05-2010, 06:49 AM | #2 |
Zealot
Posts: 147
Karma: 56
Join Date: Dec 2009
Location: Antwerpen
Device: iPhone, Sony PRS-505, EPUBreader
|
As far as I know hypenation is controlled by the hyphenation dictionary. There are some CSS working drafts on hyphenation, but they give only a few possibilities to link to the dictionary such as
Code:
{ hyphenate-dictionary: <uri>; } http://www.w3.org/TR/2007/WD-css3-gc...5/#hyphenation An alternative is adding a soft hyphen after every em- and en-dash, but this is generally not recommended, because many readers make a complete mess of ePubs with soft hyphens. See e.g. the top of this thread: https://www.mobileread.com/forums/showthread.php?t=28139 |
Advert | |
|
04-05-2010, 09:45 AM | #3 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Whether or not a line break is allowed after a dash should be language and context dependent. The Mobipocket firmware on the Cybook does not break after dashes, which is OK for Spanish, but for English it can result in severely underfull lines (that's why I chose to use "space-endash-space" in my books). But the ePUB firmware does break lines after dashes, which is wrong and ugly for Spanish. I have reported this to Bookeen, and they've asked me a sample file and screen picture, so I guess they'll at least look into it. In French the dashes are usually spaced from the text, so one can use non-breaking spaces to prevent that, and I use it. The option that remains is using zero-width breaking (& #8203;) or non-breaking (& #8288;) spaces before and after each dash, but this is cumbersome, and I'm afraid support for them in different readers is as reliable as usual.
|
04-05-2010, 09:59 AM | #4 |
Resident Curmudgeon
Posts: 76,433
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
ePub will be no issue. It does break the way you want.
|
04-05-2010, 01:18 PM | #5 |
Zealot
Posts: 123
Karma: 496
Join Date: Feb 2009
Location: Spokane, Washington
Device: Kindle2
|
Great! Thanks, all.
|
Advert | |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Spurious Line Breaks | Halk | Workshop | 1 | 05-15-2010 02:22 PM |
No line breaks | ecpepper | Amazon Kindle | 3 | 08-09-2009 07:42 PM |
fbreader ignores line breaks | red_dragon | OpenInkpot | 3 | 03-20-2009 09:38 AM |
Getting rid of line breaks with Bookdesigner | Ned | Workshop | 16 | 11-01-2008 06:37 PM |
Removing extra line breaks | plemming | Calibre | 0 | 07-31-2008 08:50 PM |