05-15-2013, 08:44 AM | #1 |
Addict
Posts: 314
Karma: 1002965
Join Date: Mar 2006
Location: UK
Device: ILiad. Gen 3, PocketBook 360, Kobo Aura HD, Kindle Oasis 2
|
Embedded font problem
Why does my WC3 validation for stylesheet give me the following errors?:
5 Property src doesn't exist : url('../Fonts/alkaios-regular.ttf') 13 .alkaios Property src doesn't exist : url('../Fonts/alkaios-regular.ttf') but the font displays correctly in Desktop Adobe Digital Editions. I want to use this font for some Romanian characters. The code in my css sheet is: @font-face { font-family: "alkaios"; font-weight: normal; font-style: normal; src: url('../Fonts/alkaios-regular.ttf'); } .alkaios { font-family: "alkaios"; font-weight: normal; font-style: normal; src: url('../Fonts/alkaios-regular.ttf'); } The @fontface declaration is the first in the CSS stylesheet. I have been hours trying to figure this out. |
05-15-2013, 08:57 AM | #2 |
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
|
Try removing src:... From the .alkaios {} definition.....I don't think it is needed/allowed there.
Also try double quotes around the URL in the font face: url("....") that shouldn't matter but is something to try. |
Advert | |
|
05-15-2013, 09:08 AM | #3 | |
Addict
Posts: 314
Karma: 1002965
Join Date: Mar 2006
Location: UK
Device: ILiad. Gen 3, PocketBook 360, Kobo Aura HD, Kindle Oasis 2
|
Quote:
Property src doesn't exist : url("../Fonts/alkaios-regular.ttf") Single or double quotes makes no difference but the font is still displaying correctly in ADE. I'm stumped! |
|
05-15-2013, 09:46 AM | #4 |
Well trained by Cats
Posts: 29,807
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
This was copied from a working @font
Code:
src:url(../Fonts/CharisSILR.ttf) |
05-15-2013, 10:06 AM | #5 | |
Addict
Posts: 314
Karma: 1002965
Join Date: Mar 2006
Location: UK
Device: ILiad. Gen 3, PocketBook 360, Kobo Aura HD, Kindle Oasis 2
|
Quote:
@font-face { font-family: "alkaios"; font-weight: normal; font-style: normal; src: url(../Fonts/alkaios-regular.ttf) } Note -- no quotes but I still get the same error from WC3 Property src doesn't exist : url(../Fonts/alkaios-regular.ttf) I've given up now because the ePub is displaying correctly. Although, I would be interested to know why it is erroring if anybody knows. |
|
Advert | |
|
05-15-2013, 10:08 AM | #6 |
Resident Curmudgeon
Posts: 73,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
My working embedded font code has no quotes of any kind in the source line.
|
05-15-2013, 10:10 AM | #7 | |
Resident Curmudgeon
Posts: 73,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Also, the CSS code you last posted is correct. It's the validation that's getting it wrong. |
|
05-15-2013, 10:26 AM | #8 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
.alkaios { font-family: "alkaios"; font-weight: normal; font-style: normal; } You don't have to include (in that class) "src: url('../Fonts/alkaios-regular.ttf');". That is because "src" is not a valid property for a class (is a valid property for a @font definition). |
|
05-15-2013, 10:30 AM | #9 | |
Resident Curmudgeon
Posts: 73,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Code:
@font-face { font-family: alkaios; font-style: normal; font-weight: normal; src: url(../Fonts/alkaios-regular.ttf); } |
|
05-15-2013, 10:42 AM | #10 | |
Addict
Posts: 314
Karma: 1002965
Join Date: Mar 2006
Location: UK
Device: ILiad. Gen 3, PocketBook 360, Kobo Aura HD, Kindle Oasis 2
|
Quote:
Thank you J.S. Wolf. I didn't know what version of CSS validation Sigil used. |
|
05-15-2013, 10:44 AM | #11 |
Resident Curmudgeon
Posts: 73,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
05-15-2013, 03:46 PM | #12 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
http://web.sigil.googlecode.com/git/...bed_fonts.html And you'll realize that what I said was correct. The issue is not in your @font-face declarations but in the way you are wanting to apply those fonts. Last edited by RbnJrg; 05-15-2013 at 06:30 PM. |
|
05-15-2013, 04:17 PM | #13 | |
Well trained by Cats
Posts: 29,807
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
font-family: alkaios ; is all that should be in any selector where it is used |
|
05-21-2013, 05:33 PM | #14 | |
Guru
Posts: 696
Karma: 150000
Join Date: Feb 2010
Device: none
|
Quote:
However, even though CSS 2.1 will complain about font declarations, they still work in epub. CSS 3 will correctly validate font declarations, but it will also validate some constructions that are not allowed in epub 2. So if Sigil were to validate against CSS 3 (as one of the recent betas did), a situation could arise where your epub stylesheet validated "correctly", yet reader software choked on it. This debate has gone round and round in other threads in this forum, and the decision was made to validate against CSS 2.1 as being cannonically correct. So, ignore errors related to font declarations. Or manually check against CSS 3.0 yourself. (easily done: Copy the stylesheet and paste it into a browser window at the W3C CSS validation site.) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
embedded font - now line with embedded font not re-flowing | Kaylee Skylyn | ePub | 23 | 08-09-2012 07:30 PM |
FlightCrew report about embedded font | roger64 | Sigil | 8 | 04-20-2011 03:00 PM |
Can't delete embedded font | eosrose | Sigil | 1 | 08-16-2010 06:28 AM |
problem with embedded font | ericshliao | EPUBReader | 2 | 12-11-2009 10:04 AM |
LRF with embedded font | igorsk | Sony Reader | 8 | 10-26-2006 08:08 AM |