You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In working on TEIC/TEI#1949, we found some issues with including SVG images in the Guidelines using the <graphic> element. SVG is fine for the HTML build and also viewable in the epub build. However, there are two issues:
our tests for the epub build are failing because at some point in the processing, SVG isn't being recognized as a valid image type for epub3.
Guidelines.pdf fails to build.
1) epub3 test failure:
Error message for epub:
java -jar Utilities/epubcheck3.jar Guidelines.epub
Epubcheck Version 3.0.1
Validating against EPUB version 3.0
ERROR: Guidelines.epub/OPS/SG.html: This file should declare in the OPF the property: svg
@martindholmes identified the problem in tei-to-epub3.xsl, which is failing to indicate SVG is a property of the specific files in the epub collection. From our Slack conversation, Martin recommends, "for each item that's being listed in the epub manifest, we have to check to see if it has any SVG images linked or embedded in it; if it does, we have to add the appropriate property to the manifest."
2) Guidelines.pdf fails to build at all.
With SVG graphics present, Guidelines.pdf (and LaTeX) build fails with this message:
BUILD: build Lite version of Guidelines, then LaTeX version of Guidelines from Lite, then run to PDF using XeLaTeX
Make sure you have Junicode, Arphic and Mincho fonts installed
ANT_OPTS="-Xss2m -Xmx752m -Djava.awt.headless=true" ant -q -lib Utilities/lib/saxon9he.jar -f antbuilder.xml -DXSL=/usr/share/xml/tei/stylesheet -DXELATEX=xelatex pdfonce
[echo] make LaTeX and PDF
BUILD FAILED
/tei/P5/antbuilder.xml:185: exec returned: 1
Makefile:148: recipe for target 'Guidelines.pdf' failed
make: *** [Guidelines.pdf] Error 1
Guidelines.pdf builds successfully on replacing the SVG with a PNG.
The text was updated successfully, but these errors were encountered:
We probably shouldn't be surprised about PDF not supporting embedded SVG. See jgm/pandoc#265 where the pandoc people prepare a filter to convert SVG to PDF for embedding.
This suggests to me:
We should be okay with SVG just for HTML and epub builds of the Guidelines.
But if we want to include SVG images in PDF or LaTeX, we need to adapt them to PDF or png format first, and perhaps we could prepare or adapt a script to do that, or provide a backup version of the same image in a format these can handle.
All this raises the question: Is it worth including SVG images in the Guidelines at all? I would say, yes, we should try to include SVG for the web and epub builds of the Guidelines, especially in the case of simple labelled graphs like this because they are always precisely rendered (never fuzzy or pixelated) and their text-based contents are readily accessible as XML code. But we will need to recognize and deal with the PDF and LaTeX problem.
I've started a branch on the TEI repo for testing these issues with building SVG here: https://github.com/TEIC/TEI/tree/ebb-svg-epub3, which has an SVG image in the SG-GentleIntroduction.xml chapter.
The particular problem here, which I agree should be fixed, is that the ePub validator requires that if you use inline SVG in your ePub, you must declare that fact in the manifest file. I think (although I'm not sure) that you have to declare it for each file which contains SVG. It's not too difficult to do, but it'll require that we learn a bit about how the ePub manifest works.
@ebeshero Coming back to this after so many years, I see that we are still not using any SVGs in the Guidelines -- there are some in the Images folder but they all have PNGs alongside them which are used instead. So I assume that the problem still exists, but we would have to test it to be sure. Your branch above still exists, so we can revive this work easily enough. Should we go for it?
In working on TEIC/TEI#1949, we found some issues with including SVG images in the Guidelines using the
<graphic>
element. SVG is fine for the HTML build and also viewable in the epub build. However, there are two issues:1) epub3 test failure:
Error message for epub:
@martindholmes identified the problem in tei-to-epub3.xsl, which is failing to indicate SVG is a property of the specific files in the epub collection. From our Slack conversation, Martin recommends, "for each item that's being listed in the epub manifest, we have to check to see if it has any SVG images linked or embedded in it; if it does, we have to add the appropriate property to the manifest."
2) Guidelines.pdf fails to build at all.
With SVG graphics present, Guidelines.pdf (and LaTeX) build fails with this message:
Guidelines.pdf builds successfully on replacing the SVG with a PNG.
The text was updated successfully, but these errors were encountered: