Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 08-21-2018, 01:04 PM   #1
JustinThought
Groupie
JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.
 
JustinThought's Avatar
 
Posts: 171
Karma: 3517858
Join Date: May 2016
Location: Monterrey, Mexico
Device: Samsung Tab-3 7"
Looking for some feedback

Good morning, all. In my constant endeavor to take the "boring" out of e-book formats, I've been working on a couple of things. Now that I have them working (sort of), I thought I'd come here to get any feedback on what I've kludged together.

The first thing I've been working on is an attempt to have the second line of each chapter heading to have completely different formats. Specifically, I would like the first element to be left-aligned, and the second element to be right-aligned. After poring through suggestions all over the internet on how to accomplish this, the first image below shows the result of my labors.

This has been accomplished by placing the following code into the stylesheet:

Code:
  <h3 class="chapter" title="Chapter 1. Chaptername">A Weather Report<br/></h3>

  <div style="line-height: 1.4em;color: white;background-color: green;">
  <span class="alignleft">
    A Trite Beginning</span>
  <span class="alignright">Chapter 1</span>
  </div>
  <div style="clear: both;"></div>
The only leading-edge aspect of the above are the alignleft and alignright classes. Here's what they look like in the stylesheet:

Code:
.alignleft {
    background-color: green;
    text-align: left;
    float: left;
    width: 75%;
}

.alignright {
    background-color: green;
    text-align: right;
    float: right;
    width: 25%;
}
This works fine in Calibre, Adobe Digital Editions, and Gitden Reader for Android. (These are my normal bellwethers for testing unique formats.) Of course, it doesn't work in Moon+ Reader, but then again, almost nothing does anyway.

The second thing I've been working on is to have the first line of each chapter to display a dropped cap, and use an external font for display of the rest of the text on that line. Based on a suggestion I found in this forum (sorry, I didn't note the author: kudos to that unsung hero), the second graphic shows the result. The only thing special in the e-book to cause this is to place the "chapter" class into the header line. But the coding in the stylesheet is a little more intricate, as shown below:

Code:
h3.chapter {
    text-indent: 0;
    text-align: center;
    font-size: 1em;
    background-color: brown;
    font-weight: bold;
    margin-bottom: 0em;
    margin-top: .5em;
}

h3.chapter+div+div+p {
    text-indent: 0em;
    margin-top: 0em;
}

h3.chapter+div+div+p::first-letter {
    font-family: chaptername3;
    color: white;
    background-color: purple;
    font-size: 3.75em;
    padding-right: 0.1em;
    padding-left: 0.1em;
    float: left;
    margin-bottom: -0.10em;
    margin-top: 0em;
}

h3.chapter+div+div+p::first-line {
    font-family: "chaptername2";
    text-transform: uppercase;
    font-size: 1.4em;
}
Interestingly enough, while this works in Calibre and Gitden Reader, Adobe Digital Editions refuses to show it properly, as you can see in the second graphic.

For anyone interested, I am including the e-book with the coding. Don't worry about copyright issues; this text is my own, created as an exercise designed to raise the "urp" factor in a sophisticated reader (and I think I've accomplished my goal there as well).

Anybody want to give me any suggestions, ideas, or flames about all this? I'm interested to know if anyone knows of a more elegant solution to the split chapter headers; as well as if anyone has gotten the first letter/first line display to work properly in ADE, as shown in the third graphic.

note: to forestall any complaints about the "text-transform" function in the first-line, I left it in there so any readers that don't display external fonts could potentially still have something to play with. Of course, it doesn't have any affect on the fonts I'm using.
Attached Thumbnails
Click image for larger version

Name:	DropCap.jpg
Views:	309
Size:	53.0 KB
ID:	165760   Click image for larger version

Name:	DropCapChapHeadAdobe.jpg
Views:	319
Size:	85.4 KB
ID:	165766  
Attached Files
File Type: epub left-right-format.epub (46.9 KB, 260 views)

Last edited by JustinThought; 08-21-2018 at 01:13 PM.
JustinThought is offline   Reply With Quote
Old 08-21-2018, 08:42 PM   #2
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
You are working in epub2 and in epub2, ADE doesn't support pseudo-elements (in your case, first-letter and first-line). If you want to remain in epub2, then you must use another code for the drop-cap and you won't be able to emulate the first-line effect. However, in epub3 your code will work (in ADE 4.x), except for the font "trench100free.ttf" that seems to have some problem to display under ADE.
RbnJrg is offline   Reply With Quote
Old 08-21-2018, 09:36 PM   #3
JustinThought
Groupie
JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.
 
JustinThought's Avatar
 
Posts: 171
Karma: 3517858
Join Date: May 2016
Location: Monterrey, Mexico
Device: Samsung Tab-3 7"
Quote:
Originally Posted by RbnJrg View Post
You are working in epub2 and in epub2, ADE doesn't support pseudo-elements (in your case, first-letter and first-line). If you want to remain in epub2, then you must use another code for the drop-cap and you won't be able to emulate the first-line effect. However, in epub3 your code will work (in ADE 4.x), except for the font "trench100free.ttf" that seems to have some problem to display under ADE.
So, maybe it's time to leave my comfort zone of epub2, and check out epub3. I've never seen any reason to make the switch--until now. Thanks for your input!
JustinThought is offline   Reply With Quote
Reply

Tags
dropcap, firstline, split-header

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Blurb feedback please? Gregg Bell Writers' Corner 73 01-19-2018 11:33 PM
To all your feedback – for which many thanks! Graham Coulson General Discussions 0 09-18-2011 08:32 AM
Feedback - Thanks Dodge Feedback 3 01-23-2011 12:57 AM
Some feedback please twr Amazon Kindle 7 09-14-2010 03:28 PM


All times are GMT -4. The time now is 08:39 PM.


MobileRead.com is a privately owned, operated and funded community.