[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [docbook-apps] acronym and small caps
Long time lurker, first time poster (thus apologies if this reply doesn't work out). We like to use small caps in certain in-house trademarked terms and use fop to output instruction manuals in PDF format. Because our universe of terms
that include small caps is known and we don't have a current or predicted future use for the <keycap> element, I co-opted it in our transformation file as follows to explicitly transform tagged terms if they're one of our known small-caps terms, and to output
a pink warning text if the element is used to tag an unknown term. (Ideally, our review process would include searching for "KEYCAP NOT FOUND" in the resulting PDF to make sure we don't miss any possible instances of the warning text.) Transformation file code: <xsl:template match="d:keycap"> <xsl:call-template name="inline.phrase-smallcaps"/> </xsl:template> <xsl:template name="inline.phrase-smallcaps"> <xsl:param name="content"> <xsl:call-template name="anchor"/> <xsl:call-template name="simple.xlink"> <xsl:with-param name="content"> <xsl:apply-templates/> </xsl:with-param> </xsl:call-template> </xsl:param> <xsl:choose> <xsl:when test="normalize-space($content)='Trademarked Term'"> <xsl:text>T</xsl:text> <fo:inline font-size="0.8em"><xsl:text>RADEMARKED</xsl:text></fo:inline> <fo:inline font-size="inherit"><xsl:text> T</xsl:text></fo:inline> <fo:inline font-size="0.8em"><xsl:text>ERM</xsl:text></fo:inline> </xsl:when> <xsl:when test="$content='tradeMARK'"> <fo:inline font-size="0.8em"><xsl:text>TRADE</xsl:text></fo:inline> <fo:inline font-size="inherit"><xsl:text>MARK</xsl:text></fo:inline> </xsl:when> <xsl:when test="$content='soCOOLhuh?'"> <fo:inline font-size="0.8em"><xsl:text>SO</xsl:text></fo:inline> <fo:inline font-size="inherit"><xsl:text>COOL</xsl:text></fo:inline> <fo:inline font-size="0.8em"><xsl:text>HUH?</xsl:text></fo:inline> </xsl:when> <xsl:otherwise> <fo:inline color='magenta'> <xsl:text>[KEYCAP NOT FOUND: </xsl:text> <xsl:copy-of select="$content"/> <xsl:text>]</xsl:text> </fo:inline> </xsl:otherwise> </xsl:choose> </xsl:template> Test input: <para>Text Text <keycap>Trademarked Term</keycap> some other text
<keycap>tradeMARK</keycap> how now brown cow <keycap>soCOOLhuh?</keycap>.
What if we use an <keycap>UnKnoWn TerM</keycap>?</para> Test output: Thanks, Bryan -----Original Message----- From: Tony Graham <tgraham@antenna.co.jp>
Sent: Saturday, June 12, 2021 5:09 PM To: docbook-apps@lists.oasis-open.org Subject: Re: [docbook-apps] acronym and small caps [Caution - External] On 12/06/2021 20:54, Kevin Dunn wrote: ... > This accomplishes nothing with fop or xep, but axf does the right > thing: it uses the small cap glyph in the font I am using. With AH Formatter, you also have the option of 'font-variant="all-small-caps"' so that capital letters also come out as small caps. (Useful if, e.g., you want 'XML' [1] in small caps.) See
https://urldefense.com/v3/__https://www.antenna.co.jp/AHF/help/en/ahf-ext.html*axf.font-variant__;Iw!!O7uE89YCNVw!c62ucK2KifkbhTZL9Tyb1mlGyNQ5eifGJJNGk70EnRuJEVErnjdQ0O6H3lZmo4czJYQ$ Regards, Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland [1] But is 'XML' really an acronym? --------------------------------------------------------------------- To unsubscribe, e-mail:
docbook-apps-unsubscribe@lists.oasis-open.org For additional commands, e-mail:
docbook-apps-help@lists.oasis-open.org |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]