epubcheck icon indicating copy to clipboard operation
epubcheck copied to clipboard

epub validator and SVG webfonts bug

Open zeewelc opened this issue 12 years ago • 7 comments

Hi all!

When I do perform epub validation (using 3.0.1) I get an error that points to SVG fonts embeded:

ERROR: wl_14_na_gr9-12_sp_se_l1_u01_9780547901541.epub/OPS/css/template.css(4,1): 'f0dd20a3-6eac-4bdf-8964-3cf614f3f798': fragment identifier is not defined in 'OPS/fonts/global/f0dd20a3-6eac-4bdf-8964-3cf614f3f798.svg'

which reffers to the CSS on webfonts

src:url("../fonts/global/f0dd20a3-6eac-4bdf-8964-3cf614f3f798.svg#f0dd20a3-6eac-4bdf-8964-3cf614f3f798") format("svg");

(I trimmed other font types above, as they are not the scope of problem)

So the problem is the value which is after hash (#) symbol, which refers to the attribute in SVG font file. That is required value to make SVG fonts working.

reference: http://stackoverflow.com/questions/12466540/is-the-hash-necessary-in-svg-font-face-declarations

So looks we have a conflict of epub validator against proper CSS syntax for SVG fonts.

Any suggestions? Would be grateful.

zeewelc avatar Jul 16 '14 11:07 zeewelc

Hi, would you have a sample file so that we can easily reproduce this error ? Thanks!

rdeltour avatar Aug 15 '14 19:08 rdeltour

Hi, you can download the epub file from here:

getwhatyalike.com/epub-svg-bug/svg-validation-bug.epub

validated with epubcheck-3.0.1

thanks Zee

zeewelc avatar Aug 22 '14 14:08 zeewelc

Please remove "#f0dd20a3-6eac-4bdf-8964-3cf614f3f798" id from css source code.

ashutosh1290 avatar Dec 05 '14 04:12 ashutosh1290

@ashutosh1290 The # identifier is required for SVG fonts as per http://www.electrictoolbox.com/download-embed-fonts-font-face/ "With SVG fonts, they also need a #hashtag" and http://stackoverflow.com/questions/12561079/font-face-completely-bugging ""This is there because you can actually have multiple fonts embedded within the same SVG file, and you need to specify which one you want to use." therefore the "#f0dd20a3-6eac-4bdf-8964-3cf614f3f798" id cannot be removed from the css source code

ethanhines avatar Jun 16 '15 01:06 ethanhines

This bug occurs selectively, and it would be great to get an answer. Why do some strings work, but others do not (such as @ethanhines UUIDs)?

chrisauclair avatar Feb 11 '16 17:02 chrisauclair

Tentatively adding to 4.2.0-RC, as we'll try to fix the handling of SVG fonts.

rdeltour avatar Feb 26 '19 12:02 rdeltour

I think this has been fixed in #995.

rdeltour avatar Mar 12 '19 14:03 rdeltour