02-27-2016, 05:08 AM | #1 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
first-line and text-transform
Hello everyone.
Some printed books have the first line of the chapter in small caps. In ebooks, I tried using the first-line pseudo element, and in fact it does work, only not with the text-transform command. That is, I can make the first line for example bold, or bigger, but not uppercase. Is there a way to fix this? Is it worth it? Thanks |
02-27-2016, 06:31 AM | #2 |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
I do this, but I manually capitalize the chosen words. Here's my small-cap style:
span.smallcap { font-size: 90%; font-weight: bold; } Of course it takes a bit of work, but I only use it at the start of a chapter. I think it's a good substitute for drop-caps. The oldest Kindles ignore the 90% instruction, but they also ignore the bold, so that works out all right. |
Advert | |
|
02-27-2016, 06:34 AM | #3 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
Yes, writer2epub does this by default. My problem is how to make text-transform work with first-line
|
02-27-2016, 06:43 AM | #4 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Most readers do not support text-transform (or first-line for that matter). You would be better off using either psuedo smallcaps or add a smallcaps font.
|
02-27-2016, 06:46 AM | #5 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
Ha, a specific font sounds like a good idea. Though of course if I want the small-caps effect it has to be a specific small caps font, i.e. one where capitalized letters are bigger than the others.
First-line works on two models of kindle (paperwhite and an old one). Don't know about the rest. Last edited by 1v4n0; 02-27-2016 at 06:53 AM. |
Advert | |
|
02-27-2016, 08:43 AM | #6 |
A Hairy Wizard
Posts: 3,094
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Hi 1v4n0,
I use the following for my books. It has a large drop cap for the first letter and all smallcaps for the first line. But Toxaris is correct, the pseudo-elements aren't supported in all readers. I choose not to use readers that don't support it!! lol Code:
/* First Para in lieu of Drop Caps */ p.first {text-indent:0; font-size:1em; line-height:1em; clear:both} p.first:first-letter {font-family:serif; font-size:2em; font-weight:bold; float:left; margin:-.1em .1em -.1em .1em; line-height:1} p.first:first-line {font-variant:small-caps; font-size:1.15em} with: <p class="first"> (on my first paragraph in the chapter) |
02-28-2016, 03:37 AM | #8 |
Guru
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
|
The big elephant in the room of course is Adobe RMSDK, and its support of such features (or lack thereof).
If you want to use features such as font-variant, text-transform, :first-line etc, then you're outa luck as far as RMSDK is concerned. And there are a lot of epub readers and software using RMSDK. Such missing features are a crying shame IMHO, as RMSDK probably has the best text rendering engine of all epub readers. |
02-28-2016, 04:01 AM | #9 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
Well this might be a case of "graceful degradation": if your device supports this CSS, good, but if it doesn't it's not terrible either.
Anyway first-line does work on the kindle, as well as text-transform, but they do not seem to work together. Font-variant does though, and I'm gonna use it from now on. |
02-28-2016, 07:45 AM | #10 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
So... your problem is in the Kindle?
The Kindle does not support ePub, why is this in the ePub forum? |
02-28-2016, 09:09 AM | #11 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
I work on ePub and then convert it to AZW3 sith calibre.
|
02-28-2016, 09:30 AM | #12 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
But I don't think it belongs to the ePub forum. It's either a Kindle-only question (this particular combination of CSS properties does not work on Kindle) or a general ebook/CSS question (what's the best way to achieve this kind of formatting). Moved to the Workshop.
|
03-05-2016, 10:21 AM | #13 |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
fill out line (line next to text) | Toxaris | Workshop | 6 | 09-07-2014 02:40 AM |
Line over text | Dalegaard | ePub | 19 | 06-11-2013 03:45 PM |
Since 1.9.10, text slightly cut off on very bottom line | danskmacabre | Kobo Reader | 33 | 01-13-2012 05:25 AM |
Two columns of text, line down middle? | chingu | ePub | 2 | 09-04-2011 06:12 PM |
changing text line-height in css | wjcroft | EPUBReader | 0 | 12-15-2010 03:13 PM |