This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What's the most appropriate (and futureproof) way tostyle the FO?


On Thu, Feb 06, 2003 at 11:16:17PM +0100, Tobias Reif wrote:
> Hi
> 
> Let's say I want to change all sect1 titles. I grab my 
> titlepage.templates.xml copy (1.60.1), then insert
>    font-weight="100"
> into
> 
> <t:titlepage t:element="sect1" t:wrapper="fo:block">
>    <t:titlepage-content t:side="recto">
>      <title
> 	   margin-left="{$title.margin.left}"
> 	   font-family="{$title.font.family}"/>
> 
> so I get
> 
> <t:titlepage t:element="sect1" t:wrapper="fo:block">
>    <t:titlepage-content t:side="recto">
>      <title
>             font-weight="100"
> 	   margin-left="{$title.margin.left}"
> 	   font-family="{$title.font.family}"/>
> 
> The FO changes from
> 
> <fo:block id="d0e135">
> <fo:block><fo:block>
> <fo:block keep-together="always" margin-left="-4pc"
>    font-family="sans-serif">
> <fo:block keep-with-next.within-column="always">
> <fo:block font-family="sans-serif" font-weight="bold"
>    keep-with-next.within-column="always" space-before.minimum="0.8em"
>    space-before.optimum="1.0em" space-before.maximum="1.2em">
> <fo:marker marker-class-name="section.head.marker">Prerequisites
> 
> to
> 
> <fo:block id="d0e135">
> <fo:block>
> <fo:block>
> <fo:block keep-together="always" font-weight="100" margin-left="-4pc"
>    font-family="sans-serif">
> <fo:block keep-with-next.within-column="always">
> <fo:block font-family="sans-serif" font-weight="bold"
>    keep-with-next.within-column="always" space-before.minimum="0.8em"
>    space-before.optimum="1.0em" space-before.maximum="1.2em">
> <fo:marker marker-class-name="section.head.marker">Prerequisites
> 
> My font-weight="100" gets inserted, but gets overriden by 
> font-weight="bold".
> 
> My question is:
> 
> Is the purpose of the titlepage mechanism to supersede and obsolete the 
> property set option params, or are both mechansims intended to be combined?

Norm might want to answer this too, but
I believe the mechanisms are meant to be combined, in
a hierarchical manner.  The titlepage.templates
mechanism establishes the default values, and the
propery attribute-sets provide the runtime flexibility.

As you know, editing a copy of titlepage.templates.xml
and regenerating titlepage.templates.xsl is not something
you want to do very often.  It can be used to set
properties, but think of them as the new default properites.
It is important to retain the ability to change properties
at run time, using parameters and attribute-sets.
Since the attribute-set properties appear in an fo:block
nested inside the fo:block from the titlepage template,
it can override the defaults.

Here is where the properties come from in your first example
above:

1.  From attribute-set 'section.titlepage.recto.style' in
fo/titlepage.xsl:

  <fo:block
     keep-together="always"

2. From titlepage.templates.xml:

     margin-left="-4pc"
     font-family="sans-serif">

3. From <xsl:template match="section/title|..." mode="titlepage.mode">
in fo/sections.xsl:

    <fo:block keep-with-next.within-column="always">

4. From attribute-set 'section.title.properties' in 
fo/param.xsl:

   <fo:block font-family="sans-serif" font-weight="bold"
     keep-with-next.within-column="always" space-before.minimum="0.8em"
     space-before.optimum="1.0em" space-before.maximum="1.2em">
 
5. From attribute-set 'section.title.level1.properties' in
fo/param.xsl (not included in your example):

    <fo:block font-size="20.736pt">


In your case, you can make the change to font-weight=100
without regenerating titlepage.templates.xsl.  The
attribute-set 'section.title.properties' in fo/param.xsl
sets properties for all section title levels, while
'section.title.level1.properties' adds properties specific
to sect1 level headings.  Change the font-weight
in 'section.title.properties' from 'bold' to '100', and it will
apply to all section title levels.

I can't say how 'futureproof" these various mechanisms are.
It kind of seems like there are too many places
to set properties, but I believe some of that is the result of
stylesheet evolution, rather than by design.
So perhaps these will be consolidated a bit in the future.

-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]