******************************************************************** -->
<lxslt:component prefix="xtext" elements="insertfile"/>
-
<lxslt:component prefix="ximg" functions="new getWidth getDepth"/>
<!-- ==================================================================== -->
<!-- ==================================================================== -->
-<xsl:param name="nominal.image.width" select="6 * $pixels.per.inch"/>
-<xsl:param name="nominal.image.depth" select="4 * $pixels.per.inch"/>
-<xsl:param name="make.graphic.viewport" select="1"/>
-
<xsl:template name="process.image">
<!-- When this template is called, the current node should be -->
<!-- a graphic, inlinegraphic, imagedata, or videodata. All -->
<xsl:with-param name="scaled.contentwidth" select="$scaled.contentwidth"/>
<xsl:with-param name="viewport" select="$viewport"/>
</xsl:call-template>
- <embed src="{$filename}" type="image/svg+xml">
- <xsl:call-template name="process.image.attributes">
- <xsl:with-param name="alt" select="$alt"/>
- <xsl:with-param name="html.depth" select="$html.depth"/>
- <xsl:with-param name="html.width" select="$html.width"/>
- <xsl:with-param name="longdesc" select="$longdesc"/>
- <xsl:with-param name="scale" select="$scale"/>
- <xsl:with-param name="scalefit" select="$scalefit"/>
- <xsl:with-param name="scaled.contentdepth" select="$scaled.contentdepth"/>
- <xsl:with-param name="scaled.contentwidth" select="$scaled.contentwidth"/>
- <xsl:with-param name="viewport" select="$viewport"/>
- </xsl:call-template>
- </embed>
+ <xsl:if test="@align">
+ <xsl:attribute name="align">
+ <xsl:value-of select="@align"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$use.embed.for.svg != 0">
+ <embed src="{$filename}" type="image/svg+xml">
+ <xsl:call-template name="process.image.attributes">
+ <xsl:with-param name="alt" select="$alt"/>
+ <xsl:with-param name="html.depth" select="$html.depth"/>
+ <xsl:with-param name="html.width" select="$html.width"/>
+ <xsl:with-param name="longdesc" select="$longdesc"/>
+ <xsl:with-param name="scale" select="$scale"/>
+ <xsl:with-param name="scalefit" select="$scalefit"/>
+ <xsl:with-param name="scaled.contentdepth" select="$scaled.contentdepth"/>
+ <xsl:with-param name="scaled.contentwidth" select="$scaled.contentwidth"/>
+ <xsl:with-param name="viewport" select="$viewport"/>
+ </xsl:call-template>
+ </embed>
+ </xsl:if>
</object>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="src">
<xsl:value-of select="$filename"/>
</xsl:attribute>
+
+ <xsl:if test="@align">
+ <xsl:attribute name="align">
+ <xsl:value-of select="@align"/>
+ </xsl:attribute>
+ </xsl:if>
+
<xsl:call-template name="process.image.attributes">
<xsl:with-param name="alt" select="$alt"/>
<xsl:with-param name="html.depth" select="$html.depth"/>
</xsl:variable>
<xsl:choose>
- <xsl:when test="$viewport != 0">
+ <!-- tables and alignment don't play nicely; skip the table if align is set -->
+ <xsl:when test="$viewport != 0 and not(@align)">
<table border="0" summary="manufactured viewport for HTML img"
cellspacing="0" cellpadding="0">
<xsl:if test="$html.width != ''">
<!ENTITY funcsynopsis.decoration SYSTEM "../params/funcsynopsis.decoration.xml">
<!ENTITY funcsynopsis.style SYSTEM "../params/funcsynopsis.style.xml">
<!ENTITY function.parens SYSTEM "../params/function.parens.xml">
-<!ENTITY generate.meta.abstract SYSTEM "../params/generate.meta.abstract.xml">
<!ENTITY generate.id.attributes SYSTEM "../params/generate.id.attributes.xml">
<!ENTITY generate.index SYSTEM "../params/generate.index.xml">
<!ENTITY generate.legalnotice.link SYSTEM "../params/generate.legalnotice.link.xml">
<!ENTITY generate.manifest SYSTEM "../params/generate.manifest.xml">
+<!ENTITY generate.meta.abstract SYSTEM "../params/generate.meta.abstract.xml">
<!ENTITY generate.section.toc.level SYSTEM "../params/generate.section.toc.level.xml">
<!ENTITY generate.toc SYSTEM "../params/generate.toc.xml">
<!ENTITY glossary.collection SYSTEM "../params/glossary.collection.xml">
<!ENTITY linenumbering.separator SYSTEM "../params/linenumbering.separator.xml">
<!ENTITY linenumbering.width SYSTEM "../params/linenumbering.width.xml">
<!ENTITY link.mailto.url SYSTEM "../params/link.mailto.url.xml">
-<!ENTITY make.valid.html SYSTEM "../params/make.valid.html.xml">
+<!ENTITY make.graphic.viewport SYSTEM "../params/make.graphic.viewport.xml">
<!ENTITY make.single.year.ranges SYSTEM "../params/make.single.year.ranges.xml">
+<!ENTITY make.valid.html SYSTEM "../params/make.valid.html.xml">
<!ENTITY make.year.ranges SYSTEM "../params/make.year.ranges.xml">
<!ENTITY manifest SYSTEM "../params/manifest.xml">
<!ENTITY manual.toc SYSTEM "../params/manual.toc.xml">
<!ENTITY navig.graphics.extension SYSTEM "../params/navig.graphics.extension.xml">
<!ENTITY navig.graphics.path SYSTEM "../params/navig.graphics.path.xml">
<!ENTITY navig.showtitles SYSTEM "../params/navig.showtitles.xml">
+<!ENTITY nominal.image.depth SYSTEM "../params/nominal.image.depth.xml">
+<!ENTITY nominal.image.width SYSTEM "../params/nominal.image.width.xml">
<!ENTITY nominal.table.width SYSTEM "../params/nominal.table.width.xml">
<!ENTITY olink.fragid SYSTEM "../params/olink.fragid.xml">
<!ENTITY olink.outline.ext SYSTEM "../params/olink.outline.ext.xml">
<!ENTITY process.empty.source.toc SYSTEM "../params/process.empty.source.toc.xml">
<!ENTITY process.source.toc SYSTEM "../params/process.source.toc.xml">
<!ENTITY profile.arch SYSTEM "../params/profile.arch.xml">
+<!ENTITY profile.attribute SYSTEM "../params/profile.attribute.xml">
<!ENTITY profile.condition SYSTEM "../params/profile.condition.xml">
<!ENTITY profile.conformance SYSTEM "../params/profile.conformance.xml">
<!ENTITY profile.lang SYSTEM "../params/profile.lang.xml">
<!ENTITY profile.revisionflag SYSTEM "../params/profile.revisionflag.xml">
<!ENTITY profile.role SYSTEM "../params/profile.role.xml">
<!ENTITY profile.security SYSTEM "../params/profile.security.xml">
+<!ENTITY profile.separator SYSTEM "../params/profile.separator.xml">
<!ENTITY profile.userlevel SYSTEM "../params/profile.userlevel.xml">
-<!ENTITY profile.vendor SYSTEM "../params/profile.vendor.xml">
-<!ENTITY profile.attribute SYSTEM "../params/profile.attribute.xml">
<!ENTITY profile.value SYSTEM "../params/profile.value.xml">
-<!ENTITY profile.separator SYSTEM "../params/profile.separator.xml">
+<!ENTITY profile.vendor SYSTEM "../params/profile.vendor.xml">
<!ENTITY punct.honorific SYSTEM "../params/punct.honorific.xml">
<!ENTITY qanda.defaultlabel SYSTEM "../params/qanda.defaultlabel.xml">
<!ENTITY qanda.inherit.numeration SYSTEM "../params/qanda.inherit.numeration.xml">
<!ENTITY table.border.thickness SYSTEM "../params/table.border.thickness.xml">
<!ENTITY table.borders.with.css SYSTEM "../params/table.borders.with.css.xml">
<!ENTITY tablecolumns.extension SYSTEM "../params/tablecolumns.extension.xml">
-<!ENTITY textinsert.extension SYSTEM "../params/textinsert.extension.xml">
<!ENTITY tex.math.delims SYSTEM "../params/tex.math.delims.xml">
-<!ENTITY tex.math.in.alt SYSTEM "../params/tex.math.in.alt.xml">
<!ENTITY tex.math.file SYSTEM "../params/tex.math.file.xml">
+<!ENTITY tex.math.in.alt SYSTEM "../params/tex.math.in.alt.xml">
+<!ENTITY textinsert.extension SYSTEM "../params/textinsert.extension.xml">
<!ENTITY toc.list.type SYSTEM "../params/toc.list.type.xml">
<!ENTITY toc.section.depth SYSTEM "../params/toc.section.depth.xml">
<!ENTITY ulink.target SYSTEM "../params/ulink.target.xml">
+<!ENTITY use.embed.for.svg SYSTEM "../params/use.embed.for.svg.xml">
<!ENTITY use.extensions SYSTEM "../params/use.extensions.xml">
<!ENTITY use.id.as.filename SYSTEM "../params/use.id.as.filename.xml">
<!ENTITY use.role.as.xrefstyle SYSTEM "../params/use.role.as.xrefstyle.xml">
</reference>
<reference><title>Miscellaneous</title>
-&graphic.default.extension;
&formal.procedures;
&formal.title.placement;
&runinhead.default.title.end.punct;
&use.role.as.xrefstyle;
</reference>
+<reference><title>Graphics</title>
+&graphic.default.extension;
+&nominal.image.width;
+&nominal.image.depth;
+&use.embed.for.svg;
+&make.graphic.viewport;
+</reference>
+
<reference><title>Chunking</title>
&html.ext;
&html.extra.head.links;
<src:fragref linkend="funcsynopsis.decoration.frag"/>
<src:fragref linkend="funcsynopsis.style.frag"/>
<src:fragref linkend="function.parens.frag"/>
-<src:fragref linkend="generate.meta.abstract.frag"/>
<src:fragref linkend="generate.id.attributes.frag"/>
<src:fragref linkend="generate.index.frag"/>
<src:fragref linkend="generate.legalnotice.link.frag"/>
<src:fragref linkend="generate.manifest.frag"/>
+<src:fragref linkend="generate.meta.abstract.frag"/>
<src:fragref linkend="generate.section.toc.level.frag"/>
<src:fragref linkend="generate.toc.frag"/>
<src:fragref linkend="glossary.collection.frag"/>
<src:fragref linkend="htmlhelp.encoding.frag"/>
<src:fragref linkend="htmlhelp.enumerate.images.frag"/>
<src:fragref linkend="htmlhelp.force.map.and.alias.frag"/>
-<src:fragref linkend="htmlhelp.hhc.frag"/>
<src:fragref linkend="htmlhelp.hhc.folders.instead.books.frag"/>
+<src:fragref linkend="htmlhelp.hhc.frag"/>
<src:fragref linkend="htmlhelp.hhc.section.depth.frag"/>
<src:fragref linkend="htmlhelp.hhc.show.root.frag"/>
<src:fragref linkend="htmlhelp.hhp.frag"/>
<src:fragref linkend="linenumbering.separator.frag"/>
<src:fragref linkend="linenumbering.width.frag"/>
<src:fragref linkend="link.mailto.url.frag"/>
+<src:fragref linkend="make.graphic.viewport.frag"/>
<src:fragref linkend="make.single.year.ranges.frag"/>
<src:fragref linkend="make.valid.html.frag"/>
<src:fragref linkend="make.year.ranges.frag"/>
<src:fragref linkend="navig.graphics.frag"/>
<src:fragref linkend="navig.graphics.path.frag"/>
<src:fragref linkend="navig.showtitles.frag"/>
+<src:fragref linkend="nominal.image.depth.frag"/>
+<src:fragref linkend="nominal.image.width.frag"/>
<src:fragref linkend="nominal.table.width.frag"/>
<src:fragref linkend="olink.fragid.frag"/>
<src:fragref linkend="olink.outline.ext.frag"/>
<src:fragref linkend="process.empty.source.toc.frag"/>
<src:fragref linkend="process.source.toc.frag"/>
<src:fragref linkend="profile.arch.frag"/>
+<src:fragref linkend="profile.attribute.frag"/>
<src:fragref linkend="profile.condition.frag"/>
<src:fragref linkend="profile.conformance.frag"/>
<src:fragref linkend="profile.lang.frag"/>
<src:fragref linkend="profile.revisionflag.frag"/>
<src:fragref linkend="profile.role.frag"/>
<src:fragref linkend="profile.security.frag"/>
+<src:fragref linkend="profile.separator.frag"/>
<src:fragref linkend="profile.userlevel.frag"/>
-<src:fragref linkend="profile.vendor.frag"/>
-<src:fragref linkend="profile.attribute.frag"/>
<src:fragref linkend="profile.value.frag"/>
-<src:fragref linkend="profile.separator.frag"/>
+<src:fragref linkend="profile.vendor.frag"/>
<src:fragref linkend="punct.honorific.frag"/>
<src:fragref linkend="qanda.defaultlabel.frag"/>
<src:fragref linkend="qanda.inherit.numeration.frag"/>
<src:fragref linkend="table.border.thickness.frag"/>
<src:fragref linkend="table.borders.with.css.frag"/>
<src:fragref linkend="tablecolumns.extension.frag"/>
-<src:fragref linkend="textinsert.extension.frag"/>
+<src:fragref linkend="tex.math.delims.frag"/>
<src:fragref linkend="tex.math.file.frag"/>
<src:fragref linkend="tex.math.in.alt.frag"/>
-<src:fragref linkend="tex.math.delims.frag"/>
+<src:fragref linkend="textinsert.extension.frag"/>
<src:fragref linkend="toc.list.type.frag"/>
<src:fragref linkend="toc.section.depth.frag"/>
<src:fragref linkend="ulink.target.frag"/>
+<src:fragref linkend="use.embed.for.svg.frag"/>
<src:fragref linkend="use.extensions.frag"/>
<src:fragref linkend="use.id.as.filename.frag"/>
<src:fragref linkend="use.role.as.xrefstyle.frag"/>
--- /dev/null
+<refentry id="make.graphic.viewport">
+<refmeta>
+<refentrytitle>make.graphic.viewport</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>make.graphic.viewport</refname>
+<refpurpose>Use tables in HTML to make viewports for graphics</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='make.graphic.viewport.frag'>
+<xsl:param name="make.graphic.viewport" select="1"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>The HTML <sgmltag>img</sgmltag> element only supports the notion
+of content-area scaling; it doesn't support the distinction between a
+content-area and a viewport-area, so we have to make some compromises.</para>
+
+<para>If <parameter>make.graphic.viewport</parameter> is non-zero, a table
+will be used to frame the image. This creates an effective viewport-area.
+</para>
+
+<para>Tables and alignment don't work together, so this parameter is ignored
+if alignment is specified on an image.</para>
+</refsect1>
+</refentry>
--- /dev/null
+<refentry id="nominal.image.depth">
+<refmeta>
+<refentrytitle>nominal.image.depth</refentrytitle>
+<refmiscinfo role="type">length</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>nominal.image.depth</refname>
+<refpurpose>Nominal image depth</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='nominal.image.depth.frag'>
+<xsl:param name="nominal.image.depth" select="4 * $pixels.per.inch"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>See <parameter>nominal.image.width</parameter>.</para>
+
+</refsect1>
+</refentry>
--- /dev/null
+<refentry id="nominal.image.width">
+<refmeta>
+<refentrytitle>nominal.image.width</refentrytitle>
+<refmiscinfo role="type">length</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>nominal.image.width</refname>
+<refpurpose>The nominal image width</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='nominal.image.width.frag'>
+<xsl:param name="nominal.image.width" select="6 * $pixels.per.inch"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>Graphic widths expressed as a percentage are problematic. In the
+following discussion, we speak of width and contentwidth, but
+the same issues apply to depth and contentdepth.</para>
+
+<para>A width of 50% means "half of the available space for the image."
+That's fine. But note that in HTML, this is a dynamic property and
+the image size will vary if the browser window is resized.</para>
+
+<para>A contentwidth of 50% means "half of the actual image width".
+But what does that mean if the stylesheets cannot assess the image's
+actual size? Treating this as a width of 50% is one possibility, but
+it produces behavior (dynamic scaling) that seems entirely out of
+character with the meaning.</para>
+
+<para>Instead, the stylesheets define a
+<parameter>nominal.image.width</parameter> and convert percentages to
+actual values based on that nominal size.</para>
+
+</refsect1>
+</refentry>
--- /dev/null
+<refentry id="use.embed.for.svg">
+<refmeta>
+<refentrytitle>use.embed.for.svg</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>use.embed.for.svg</refname>
+<refpurpose>Use HTML <sgmltag>embed</sgmltag> for SVG?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='use.embed.for.svg.frag'>
+<xsl:param name="use.embed.for.svg" select="1"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>If non-zero, an <sgmltag>embed</sgmltag> element will be created for
+SVG figures. An <sgmltag>object</sgmltag> is <emphasis>always</emphasis> created,
+this parameter merely controls whether or not an additional <sgmltag>embed</sgmltag>
+is generated inside the <sgmltag>object</sgmltag>.</para>
+
+<para>On the plus side, this may be more portable among browsers and plug-ins.
+On the minus side, it isn't valid HTML.</para>
+
+</refsect1>
+</refentry>