|
|
#1 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 173
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
|
|
|
|
|
|
#2 |
|
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,519
Karma: 996810
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 | |
|
|
|
|
#3 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 173
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
|
|
|
|
|
|
#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.
|
|
|
|
|
|
#5 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 173
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 07:53 AM. |
|
|
|
| Advert | |
|
|
|
|
#6 |
|
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,397
Karma: 20212733
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/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)
|
|
|
|
|
|
#8 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 877
Karma: 2676800
Join Date: Sep 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. |
|
|
|
|
|
#9 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 173
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. |
|
|
|
|
|
#10 |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,571
Karma: 20150435
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? |
|
|
|
|
|
#11 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 173
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
I work on ePub and then convert it to AZW3 sith calibre.
|
|
|
|
|
|
#12 |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,571
Karma: 20150435
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.
|
|
|
|
|
|
#13 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,271
Karma: 61916422
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 03:40 AM |
| Line over text | Dalegaard | ePub | 19 | 06-11-2013 04:45 PM |
| Since 1.9.10, text slightly cut off on very bottom line | danskmacabre | Kobo Reader | 33 | 01-13-2012 06:25 AM |
| Two columns of text, line down middle? | chingu | ePub | 2 | 09-04-2011 07:12 PM |
| changing text line-height in css | wjcroft | EPUBReader | 0 | 12-15-2010 04:13 PM |