08-13-2017, 04:28 AM | #16 |
The Grand Mouse 高貴的老鼠
Posts: 71,506
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
It seems that easy alignment of text elements within the page is another thing sadly lacking in the ePub 2 and 3 specifications.
In CSS/CSS2, I suppose the question is how to get access to a measurement of the width of the initial capital in some way, so that it can be centred on the 50% page width. |
08-13-2017, 05:13 AM | #17 |
Resident Curmudgeon
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
Advert | |
|
08-13-2017, 05:15 AM | #18 |
Resident Curmudgeon
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
There is another problem. If this eBook is going to be sold at Amazon, then you'll have to deal with Mobi which cannot do this and with KF8 you'll have to deal with the fact that the first line's height will be off.
Also, in your second sample where the graphic is centered over the initial cap, that won't work either for the same reason. You have no idea what font and font size someone is going to be using and thus, you cannot do it the way you want. Last edited by JSWolf; 08-13-2017 at 05:17 AM. |
08-13-2017, 05:30 AM | #19 |
The Grand Mouse 高貴的老鼠
Posts: 71,506
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
You might be able to get something going with display: inline. I had a little play, but didn't get anything completely successful.
And while Jon is right, of course, that getting anything like this in Mobi is probably impossible, in the more modern KF8 it might work if you can get it going in ePub, and you could have fall-back CSS to make Mobi look nice. |
08-13-2017, 09:03 AM | #20 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
I'm afraid I have to agree that this looks awful. I appreciate, though, that there are occasions on which you have to go with what the customer wants.
|
Advert | |
|
08-13-2017, 09:35 AM | #21 |
The Grand Mouse 高貴的老鼠
Posts: 71,506
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
But the question is, can this be done in ePub, not whether it's a good idea.
I'm all for people trying designs and asking whether it can be done. It helps to show either that the ePub spec is good for a wide variety of ebook design, or that it is not. Personally, I think it's vastly over complicated for 90% of books. And that the complications don't actually help very much with complex page layout, as HTML/CSS wasn't designed from the point of view of high quality typography/page layout. |
08-13-2017, 02:03 PM | #22 | |||
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
And yes, you can place them using precise x/y coordinates, as well. And we have NONE of these things, in reflowable ePUB/MOBI. (I mention MOBI only because others here have mentioned it, not b/c the OP has mentioned it.) We don't have x/y coordinate placement, not unless we have the digital equivalent of print--fixed-layout. We don't have tabs. For all intents and purposes, we don't have spaces, not really. We don't have kerning, and leading is at best, remarkably primitive. So...how, exactly, would we all propose to achieve the centered placement of a single letter, which would change, depending upon which letter it is that's being used? Without the ability to calculate the width of the individual letter, and the size it's being displayed at, on the fly, and then calculate the remainder of the line...well. (Note to the OP: have you considered using a BFL, instead? Yes, yes, I realize that you are determined to emulate the original print layout, from nearly 30 years ago, but, hear me out. If you used a monospace BFL, for your Raised Initial, it would ALWAYS be the same size, and thus, you could get relatively decent results doing that.) Quote:
Quote:
I see the ignoring of that, all the time, in print books made at CS, IS, etc.--POD DIY books. You'll see 80-char long lines, or 50, etc. Things that make the reading experience harder on the reader, because the person who did the layout isn't trained. Sorry--I don't mean to digress; we're talking eBooks, not print. But the principals are the same. And believe me, we (at my biz) do a lot of frippery, too. We try VERY hard to emulate print, as closely as we can, too. I'm not dissing the OP. But you can't compare the realities of one to the other. They're not remotely the same. And when you think about the computing power that would be needed, to do even this one small thing--calculate the width of a given letter, on the fly, then do this, then that--you'd be adding size/weight to the eReader. I will say this--if I were going to do this book, with the same goal--I'd consider looking at the coding from a slightly different view. Do we know the widths of all the letters, of each of the letters, at any given size? Can CSS be written for each? For a website, you could use "transform," and then make each of the RI the same size--that would solve some of the issue. But transform is not supported, typically...so that dog don't hunt. Or, maybe...letter-spacing. If you set it to xpx, just for this, perhaps that would do it. I'd think about approaching it from the "manage the letter," not manage the coding standpoint, due to the limitations of the coding that we have available to us for eBooks. Anyway....that's what I'd do. If I undertook it. (Which, fortunately, I didn't, {smile}) Hitch |
|||
08-13-2017, 03:13 PM | #23 |
A Hairy Wizard
Posts: 3,095
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
|
I'm not sure that you will be able to get the letter exactly centered in a non-fixed-layout book or using a monospace/fixed font (as Hitch mentioned). The best that you can hope for is to have the letter start in the same place...eg. the letter always starts at exactly 50% of the screen.
Honestly...unless someone is holding the original print version up next to the electronic, they are probably not going to see any difference. If you are really worried about the crosshairs not lining up exactly in the center of the letter...then don't display crosshairs!! lol The customer will never see the difference - or care if they do see it. It's all about managing expectations. Good luck! |
08-13-2017, 03:23 PM | #24 | |
The Grand Mouse 高貴的老鼠
Posts: 71,506
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Quote:
And yes, of course I understand the different between print and ebook. But since the desired placement is conceptually simple, it's a shame it's not easy in ePub. So what's the closest the OP can get? I suspect you're right in suggesting individual CSS depending on the initial letter. At least that way, for most font sizes, and most page widths, it will be so close to centred as to make no difference. |
|
08-13-2017, 06:59 PM | #25 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Perhaps you could try a SVG inline image for the first letter. It could be centered.
Dale |
08-14-2017, 03:07 AM | #26 |
The Grand Mouse 高貴的老鼠
Posts: 71,506
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
|
08-14-2017, 05:34 AM | #27 |
Resident Curmudgeon
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
08-14-2017, 05:39 AM | #28 |
Resident Curmudgeon
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
But, with SVG, what happens when I want to increase or decrease the font size?
|
08-14-2017, 06:01 AM | #29 |
The Grand Mouse 高貴的老鼠
Posts: 71,506
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
I think you could even argue that ePub supports manual kerning. A span with a negative right margin?
<html> <head> <style> .kern { margin-right:-0.2em; } </style> </head> <body> <h1>Plain: AV</h1> <h1>Kerned: <span class="kern">A</span>V</h1> </body> Of course, since the font can change, I don't think I'd really try this in any ebook. But that is a limitation caused by the flexibility of ebooks, rather than by limitations in the ePub format. Ebook flexibility (different fonts, pages sizes, font sizes, page aspect ratios) shouldn't limit design choices, like the choice to have the first letter of a chapter be a raised capital exactly centred in the page width, with the rest of the paragraph justified following the initial letter. It does look like ePub won't let you do this. Unless someone can come up with cleverer HTML/CSS than I've managed to work out. Last edited by pdurrant; 08-14-2017 at 06:07 AM. |
08-14-2017, 11:01 AM | #30 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Grand Mouse: That's a distinction without a difference. I'm sorry, I am really not trying to be argumentative, but as you point out, given that you can change the font face, that will never work. Kerning and leading really only work, from any standpoint, where you can control the entire environment, display-wise. Which brings us back around to fixed-layout. Forget changing fonts--what happens when someone sizes the font? Up, or down? The kerning will be a car wreck. Yes, the command, itself, exists. But...for what purpose, in what world? Maybe on a website, but even then, given that a website can be seen on any browser, at any size....kerning, meet car wreck. IMHO. Hitch |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
RegEx Question: H1 ALL CAPS to All Caps | phossler | Sigil | 21 | 02-06-2014 02:44 PM |
Interesting PW bug, everything centered | twowheels | Amazon Kindle | 1 | 02-01-2013 12:27 PM |
Centered but left align? | mtrahan | ePub | 15 | 04-01-2012 03:56 PM |
would like toc to be centered | alansplace | Kindle Formats | 9 | 11-20-2011 11:47 AM |
mobi toc centered | alansplace | Conversion | 1 | 11-19-2011 07:45 PM |