View Single Post
Old 10-15-2014, 04:23 PM   #98
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by Tony_A20 View Post
Hello odedta, Thanks for your reply.

I tried changing the @font-face to font-family: AlexBrush; and replacing "marg" with "AlexBush" and despite what Calbre may think, it doesn't make any difference. The family-name can be anything provided the src: is correctly identified.

Spoiler:

From MDN
@font-face
{
[ font-family: <family-name>; ]?
...
}
family-name
Specifies a name that will be used as the font face value for font properties. ( i.e. font-family: <family-name>; )

An online example is:
@font-face
{
font-family: MyHelvetica;
src: url(MgOpenModernaBold.ttf);
}

So, Calibre's error message is incorrect.

What is happening is this:

This works,

<div class="letter">
<p class="marg">This is a test.</p>
</div>

This doesn't,

<div class="letter marg">
<p >This is a test.</p>
</div>


The problem seems to be combining the font class with anything else.
Multiple classes cause the font to fall back to the default/inherited font BUT, the other properties are correctly applied.

However if this CSS declaration is made:

Spoiler:
p.inherit
{
font-family: inherit;
}

then this works:

<div class="letter marg">
<p class="inherit">This is a test.</p>
<p class="inherit">This is a second line.</p>
</div>


So, the font "marg" is being correctly applied by the division tag, but the para tag is nevertheless inheriting the font-family from somewhere else. Forcing the paragraph tag to inherit the font-family from the division tag declaration corrects the inheritance, but only for one para tag at a time.

So the situation is: state the "inherit" class on every tag, or state the "marg" tag on every tag, because the font-family property is not inherited. And that's the case with changing the font indent—nothing about the embedded font is inherited, any change/use must repeat the full CSS description.

The next question is: Why doesn't an embedded font become the new default after use?

Tony
I'm going to have to see--and I know that this sounds odd--if we use multiple CSS classes anywhere. For MOBI, I mean. I don't think we do. ID's and classes, yes, of course. I asked Barb (the best bookmaker here, bar none) if she did, and she said she did, but ...I don't think so. I don't believe that any of us can think of multiple classes actually working, not for MOBI. Not with conflicting or not clearly-conformed styles. I just think that the mobi conversion loses its mind.

FWIW.

Hitch
Hitch is offline   Reply With Quote