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

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 10-14-2012, 04:39 AM   #16
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,259
Karma: 4801167
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by mmat1 View Post
0.7, 0.75 or 0.8; this doesn't make much difference, it's just a matter of personal taste.
It's rather a matter of the font used (which is a matter of personal taste, if the device allows it). The height of smallcaps should be the same as the height of lowercase letters, and the ratio lowercase/uppercase varies from font to font. Nevertheless some fonts (like the Kp-fonts package, for LaTeX) provide at least two smallcap sizes, so I guess there's still some personal taste involved after all.
Jellby is offline   Reply With Quote
Old 10-14-2012, 10:06 AM   #17
mmat1
Det
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 982
Karma: 1406156
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by Jellby View Post
The height of smallcaps should be the same as the height of lowercase letters, and the ratio lowercase/uppercase varies from font to font.
Yes, that's right, Thanks for mentioning this ...
mmat1 is offline   Reply With Quote
Old 10-14-2012, 01:21 PM   #18
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,456
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Quote:
Originally Posted by Jellby View Post
... The height of smallcaps should be the same as the height of lowercase letters, and the ratio lowercase/uppercase varies from font to font. ...
Jellby has a knack for it... I love that.

Could you give an example? How to assess exactly the height of lowercase letters? (real smallcpas and fake ones). Is this something other than the font-size?

If we select fonts from the same family, can we be confident that the same percentage (or em?) will apply for both?* Shall we use em preferably than %?

* Except your example above.

Last edited by roger64; 10-14-2012 at 01:24 PM.
roger64 is offline   Reply With Quote
Old 10-14-2012, 02:24 PM   #19
mmat1
Det
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 982
Karma: 1406156
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by roger64 View Post
Jellby has a knack for it.
That's without a doubt

Quote:
Originally Posted by roger64 View Post
Could you give an example? How to assess exactly the height of lowercase letters? (real smallcpas and fake ones). Is this something other than the font-size?
That should be no problem. Make a sample-ebook with some variants in steps of 0.05 to find a proper font size with your reader. The problem is that other readers are maybe make a slight difference in rendering. You can post a sample book and ask others to test it with their readers.

The huge problem is probably:

You have:
<p><span class="LinLibSC">Text to transform into Fake-Caps</span></p>

You need:
<p>T<span class="fc">EXT</span> <span class="fc">TO</span> <span class="fc">TRANSFORM</span> <span class="fc">INTO</span> F<span class="fc">AKE</span>-C<span class="fc">APS</span></p>

Actually I don't know how to transform that with regex etc.
mmat1 is offline   Reply With Quote
Old 10-14-2012, 02:56 PM   #20
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,259
Karma: 4801167
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by roger64 View Post
Could you give an example? How to assess exactly the height of lowercase letters? (real smallcpas and fake ones). Is this something other than the font-size?
Yes, the font-size is usually the height of uppercase letters, or something similar. Depending on how the font is designed, the actual letters may be smaller or larger than their "frame" (which is what the font-size actually controls).

But for lowercase letters, every font has a different look and proportion. The only good way of getting the right size for smallcaps is by visual judgement, and you can't know which font the book will be read with!

Quote:
If we select fonts from the same family, can we be confident that the same percentage (or em?) will apply for both?* Shall we use em preferably than %?
If with the same family you mean the same name and only varying in their bold/italic character, then yes, their proportions should be all the same (assuming it's seriously designed). If they're just "similar" fonts, their proportions would be similar, but not the same.

About using em or %, they're equivalent, I believe.

I guess you could use "font-size: 1ex" (the ex unit is supposed to be approximately the height of lowercase letters), but I don't think it is correctly defined in most fonts, and I wouldn't rely on it being correctly used by rendering engines... I haven't really tried it, though.
Jellby is offline   Reply With Quote
Old 10-14-2012, 06:23 PM   #21
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,456
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Thanks for these explanations. I am sometimes facing practical problems like this one:

This is the printed text, using smallcaps: screenshot smallcap on the left. We can see that capitals have the height of lowercase letters.

This is the copy made with fake caps: screenshot fake which uses a simple code which looks clean, but it's not smallcaps and it's not quite right:
Code:
 <p class="Corpspetit">LE MUSÉE NOIR <i>(Robert Laffont, 1946).</i></p>
Corpspetit uses font-size:0.75em which applies for everything inside but I do not get with the fake capitals "the height of lowercase letters". I think I should probably have added to this code a special 0.75em span for the fake?

I wonder how to write it with smallcaps.... Either the italics are too small or too big. I need a paragraph to wrap the line of code and inside a span for the smallcap. For smallcaps I usually write in the span the font-family. Should I also add a font-size:0.75em?
Attached Thumbnails
Click image for larger version

Name:	smallcap.png
Views:	74
Size:	38.4 KB
ID:	94105   Click image for larger version

Name:	fake.png
Views:	72
Size:	17.6 KB
ID:	94106  

Last edited by roger64; 10-14-2012 at 06:55 PM.
roger64 is offline   Reply With Quote
Old 10-14-2012, 06:36 PM   #22
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,456
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
mistake
roger64 is offline   Reply With Quote
Old 10-14-2012, 06:47 PM   #23
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 37,903
Karma: 18763702
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Is smallcaps a percecnt of the capitol or is that again based on the font in use?
JSWolf is offline   Reply With Quote
Old 10-15-2012, 02:07 AM   #24
derangedhermit
Addict
derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.
 
Posts: 233
Karma: 1262174
Join Date: Oct 2010
Location: USA
Device: None
Quote:
Originally Posted by JSWolf View Post
Is smallcaps a percecnt of the capitol or is that again based on the font in use?
Smallcaps are the same height as the x-height. The x-height is the height of a lower case "x". They picked a specific letter since, especially with serif typefaces, the x usually has nice flat tops and bottoms, while many other letters, like c-e-m-n-o-s...often differ a bit from the x-height, usually a smidgen higher on the top of a hump like in the letter "o".

X-height is a font metric, one of many, that is inside every opentype font file.

It can't be a % of cap height since the ratio x-height/cap-height varies. Modern fonts for screen use typically have larger design for x-height than traditional print typefaces (e.g. Georgia or Verdana v. Times Roman), in an effort to increase readability.

Cap height is not necessarily the same as the value for 1em, either. An em also includes lower case ascenders (usually higher than caps), descenders, and maybe more space, so that if tight line spacing is acceptable, no leading is needed.

"Em" used to be a horizontal measurement - the width of a capital M. But that's usually pretty square anyway, and now it's used for vertical height. Anyway, that's where "em dash" (and "en dash") comes from: a dash the width of the letter.

Even if one gets caps set to x-height, the text will still not look right. They will be too light/thin, and the spacing will be off. I haven't experimented, but a bold at 0.4-0.6 em might look closer to right than a regular weight - a semi-bold probably will. You really need the smallcap glyphs, either from a separate font file or, preferably, as a feature in the original font.

Last edited by derangedhermit; 10-15-2012 at 02:12 AM.
derangedhermit is offline   Reply With Quote
Old 10-15-2012, 02:31 AM   #25
derangedhermit
Addict
derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.derangedhermit ought to be getting tired of karma fortunes by now.
 
Posts: 233
Karma: 1262174
Join Date: Oct 2010
Location: USA
Device: None
Quote:
Originally Posted by roger64 View Post
Thanks for these explanations. I am sometimes facing practical problems like this one:
Code:
 <p class="Corps"><span class="Corpspetit">LE MUSÉE NOIR</span><i>(Robert Laffont, 1946).</i></p>
From the screenshot it looks more like 0.4-0.6 than 0.75em.
derangedhermit is offline   Reply With Quote
Old 10-15-2012, 02:45 AM   #26
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,456
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Quote:
Originally Posted by derangedhermit View Post
Smallcaps are the same height as the x-height. The x-height is the height of a lower case "x"....

X-height is a font metric, one of many, that is inside every opentype font file.

It can't be a % of cap height since the ratio x-height/cap-height varies....

Cap height is not necessarily the same as the value for 1em, either.

"Em" used to be a horizontal measurement - the width of a capital M.
@derangedhermit

Thanks a lot for stressing clearly these main points and commenting them. So, as far as height is concerned, we have better check visually after every font change.

It seems that, finally, after losing some time on it, I got some acceptable results for fake and true smallcaps.

To put them on equal footing, I choose a 92% font-size for the paragraph and then
- uppercase with 0.75em for the fake ('Serif' font)
- lowercase for the true ('Linux Libertine')

These values above could be further tweaked but I dare not.

From left to right: fake, true, printed.
Attached Thumbnails
Click image for larger version

Name:	fake.png
Views:	71
Size:	35.6 KB
ID:	94119   Click image for larger version

Name:	true.png
Views:	74
Size:	33.8 KB
ID:	94120   Click image for larger version

Name:	smallcap.png
Views:	66
Size:	38.4 KB
ID:	94121  

Last edited by roger64; 10-15-2012 at 02:48 AM.
roger64 is offline   Reply With Quote
Old 10-15-2012, 05:39 AM   #27
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,259
Karma: 4801167
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
While faked smallcaps look "wrong" generally (because they are too thin), they have a couple of advantages:

- It's easy to have them in different styles (italic, bold), while true smallcaps are often not available in some of them.

- They can look better when combined in with numbers (as in acronyms like P2P or B3LYP), although some true smallcaps may have matching numbers too.

But they also have another disadvantage:

- The markup is hideous, even more so if you want to be careful with the spaces (note that the spacing is the "fake" example is too tight), because these are not equivalent:

Code:
<span class="smallcap">TWO WORDS</span>
<span class="smallcap">TWO</span> <span class="smallcap">WORDS</span>
the space in the first case will be 75% of a normal space, in the second case it will be a normal space.
Jellby is offline   Reply With Quote
Old 10-15-2012, 10:09 AM   #28
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,456
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Quote:
Originally Posted by Jellby View Post
the space in the first case will be 75% of a normal space, in the second case it will be a normal space.
I really have to train my eye. I did not notice any tight spacing for the fake. Is there any reason for this? And is it coming from a special entity using 0.75em?

And now I understand why my converter uses separate spans (like in your previous second example), and also separate figures, while, to make the code look cleaner, I bundle all these separate spans into one... I was thinking it was a mistake. ;-)

Last edited by roger64; 10-15-2012 at 10:21 AM.
roger64 is offline   Reply With Quote
Old 10-15-2012, 12:45 PM   #29
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,259
Karma: 4801167
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by roger64 View Post
I really have to train my eye. I did not notice any tight spacing for the fake. Is there any reason for this? And is it coming from a special entity using 0.75em?
You probably don't notice because it's the right space for uppercase letters, but everything scaled down to 75%. With true smallcaps, however, only the letters are scaled down (sort of), but spaces remain the normal size. It's probably more noticeable in a text with mixed normal and smallcaps pieces. Make it more extreme:

Code:
<span style="font-size:20%">THIS IS A TEST</span>
<span style="font-size:20%">THIS</span> <span style="font-size:20%">IS</span> <span style="font-size:20%">A</span> <span style="font-size:20%">TEST</span>
and you'll see the difference in spacing.
Jellby is offline   Reply With Quote
Old 10-15-2012, 12:56 PM   #30
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,456
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Indeed. I learnt something. I should have thought: "Everything is scaled down to 75%" Thanks.

roger64 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ePub->ePub conversion with obfuscated fonts DiapDealer Conversion 1 03-17-2012 03:33 PM
Foreign fonts (PL) in epub tntmarek Interead COOL-ER 1 03-04-2011 07:05 PM
ePub embedded fonts JSWolf Ectaco jetBook 9 09-14-2009 09:43 PM
Epub & fonts Nate the great ePub 8 07-28-2009 07:13 AM
ePub + Embedded Fonts Cygfrydd ePub 11 03-02-2009 06:56 PM


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


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