[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Font-size definition
I had a similar problem resizing a font in different contexts. You can use xsl:attribute to set font-size and put an xsl:choose inside it like this: <fo:inline xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="LucidaGrande" font-weight="normal"> <xsl:attribute name="font-size"> <xsl:choose> <xsl:when test="ancestor::title or ancestor::literal or ancestor::filename or ancestor::programlisting or ancestor::literallayout">0.9em</xsl:when> <xsl:otherwise>0.8em</xsl:otherwise> </xsl:choose> </xsl:attribute> ... Bob Stayton Sagehill Enterprises bobs@sagehill.net ----- Original Message ----- From: "Jacques Foucry" <jacques@foucry.net> To: "docbook-apps" <docbook-apps@lists.oasis-open.org> Sent: Thursday, April 17, 2008 7:31 AM Subject: [docbook-apps] Font-size definition > Hello folks, > > In my custom stylesheet I defined my own template for guilabel, guimenu, > etc. > > Sometimes I use those tags inside section title and I would like to a > font-size proportional to the title font size. > > I tried with font-size="0.9em" (in the fo:inline statement). It's ok for > the titles, but it's to big for normal text. In this case it should be > proportional to $body.font.master. > > The section font-size are already proportional to $body.font.master. > > <xsl:template name="myGuiMenu"> > <xsl:param name="content"> > <xsl:apply-templates/> > </xsl:param> > <fo:inline xmlns:fo="http://www.w3.org/1999/XSL/Format" font- > family="LucidaGrande" font-weight="normal" font-size="0.9em"> > <xsl:if test="@id"> > <xsl:attribute name="id"> > <xsl:value-of select="@id"/> > </xsl:attribute> > </xsl:if> > <xsl:if test="@dir"> > <xsl:attribute name="direction"> > <xsl:choose> > <xsl:when test="@dir = 'ltr' or @dir = > 'lro'">ltr</xsl:when> > <xsl:otherwise>rtl</xsl:otherwise> > </xsl:choose> > </xsl:attribute> > </xsl:if> > <xsl:copy-of select="$content"/> > </fo:inline> > </xsl:template> > > How can I to that without define another template for the titles ? > > Thanks in advance, > Jacques > > --------------------------------------------------------------------- > 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]