View Single Post
Old 08-10-2013, 12:36 PM   #13
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
back to this again - I have a source which uses "small", "large" in font sizes.

small converts to font-size: 0.77419em; large to 1.29167 ( =15.5/12)
but if 0.77419=x/12, then x = 9.29028 which makes no sense at all ???

it seems like my specified font key is being ignored, so what ( hidden) default values can create both of 0.77419 and 1.29167 from "small" and "large"

I tried setting the font key as per my previous experiments so that it should come out in even 10ths after conversion

i.e. base size 12 , eg 9.6 10.8 12 12 13.2 14.4... but can't get it to work. i wonder if in the current version of calibre there is a bug ?


also, the font rescaling wizard seems broken, whatever 2 input values you supply the answer is always will map to 0.0pts!

testing that hypothesis:
test 1- restore all conversion defaults i.e. font key is blank, base value is zero - gives the same strange fractions as above
test 2- set a key of 10 10 10 10 10 10 10 10 with a base of 10 - so everything should flatten... well now I see a lot of 0.833333 (=10/12) and a guest appearance from our favourite 1.29167 (=15.5/12)! that key should have set all font sizes to 1em, surely ?. So something is forcing the base font size to 12 and ignoring the set value of 10, and some other bit of code is pulling 15.5 out of thin air ?
test 3: base size 10 key 12 12 12 12 12 12 12 12- gives lots of 0.83333 ? - so maybe it's noticed the 10 & is doing 10/12 ?
test 4: base size 12, key 12 12 12 12 12 12 12 12 - gives - wait for it - well finally I am expecting to see lots of font size 1.0em in the converted CSS but in fact I see lots of 0.77419

I give up

and to confirm once again - the source has no numeric font sizes, except for a single 0.9 in body style at all - it only has small x-small and large in the CSS.
sample follows:
body
{
line-height : 1.3em;
font-size: 0.9em
}

h1.part-number {
font-size: large;
margin-top: 15%;
margin-bottom: 1em;
text-align: center;
text-indent: 0em;
font-family: sans-serif;
}

p { display: block;
font-size: small;
margin-top: 0em;
margin-bottom: 0em;
margin-left: 0em;
margin-right: 0em;
text-indent: 20pt;
}

Last edited by cybmole; 08-10-2013 at 01:04 PM.
cybmole is offline   Reply With Quote