W3C home > Mailing lists > Public > xsl-editors@w3.org > April to June 2000

XSL FO: letter-spacing and space-resolution

From: MURAKAMI Shinyu <murakami@nadita.com>
Date: Wed, 7 Jun 2000 03:36:21 +0900
To: xsl-editors@w3.org
Message-Id: <200006070336.IFH43526.BLBNJVNS@nadita.com>
Dear xsl-editors,

I found some problem on XSL WD 2000-03-27 about "letter-spacing" etc.

Problem 1: Unexpected space-suppressing

simple example:

AAA<fo:inline space-start="1cm" space-end="1cm">BBB</fo:inline>CCC

(no space between AAA and BBB and CCC)

The fo:inline's space-start/end are suppressed because each character
has default letter-spacing property, letter-spacing.precedence="force",
and fo:inline's spaces' precedence are 0.

I think it's problematic, many people will misunderstand.
Naturally the expected output is:

   (1cm)  (1cm)

but we have to write more complicated stylesheet:

AAA<fo:inline space-start="1cm" space-start.precedence="force"
space-end="1cm" space-end.precedence="force">BBB</fo:inline>CCC


<fo:block letter-spacing.precedence="0">
AAA<fo:inline space-start="1cm" space-end="1cm">BBB</fo:inline>CCC

The XSL WD says about it in [7.14.2 "letter-spacing"]:

    If it is desired that the letter-space combine with other spaces 
    that have less than forcing precedence, then the value of the 
    letter-space should be specified as a <space> with precedence less 
    than force which implies that space combines according to the space 
    resolution rules described in [4.3 Spaces and Conditionality].

it's not easy to understand for stylesheet designers, i think.

Problem 2: Only half letter-spacing

Non-forcing letter-spacings are also problematic.

<fo:block letter-spacing.precedence="0" letter-spacing.optimum="1cm"
letter-spacing.minimum="1cm" letter-spacing.maximum="1cm">
AAA<fo:inline space-start="1cm" space-end="1cm">BBB</fo:inline>CCC

A  A  A    B  B  B    C  C  C
 5mm5mm 1cm 5mm5mm 1cm 5mm5mm

I specified letter-spacing="1cm" but the resultant spaces between 
letters are only 5mm.  Because each character's start-space and 
end-space traits are set to half the value and if these are 
non-forcing, the adjacent two spaces (5mm+5mm) are resolved to 
one space (5mm).

To solve the Problem (1 and 2):

1. Extend space-specifier's .precedence value; a weak "force" is wanted,
like a .precedence="semi-force" (sorry, my English vocabulary is poor,
a better name expected), this precedence value is same as "force" except 
not suppress adjacent non-forcing spaces.  

And this new value should be the default of letter-spacing.precedence.
(and of word-spacing.precedence and line-height.precedence, too.)

2. When non-forcing letter-spacing.precedence (less than "semi-force")
is specified, the start-space and end-space traits should be set to 
full (not half) letter-spacing value.
(this method is also applicable to line-height property; when 
line-height.precedence is non-forcing, line-area's space-before and after 
should be full-leading (not half-leading), font-size - line-height.)

Note: about line-height, I've posted a comment:
  [XSL FO: line-height and space-resolution rule]

Another Questions:

Question 1: letter-spacing is for "Alphabetic"?

The XSL WD says in [7.14.2 "letter-spacing"]

    For an fo:character that in the Unicode database is classified 
    as "Alphabetic" the start-space and end-space traits are each 
    set to a value as follows: ...

Why only Alphabetic?  The "Ideographic" also needs letter-spacing.
I think letter-spacing should affect all characters except controls,
zero-width and fixed-width spaces, and other non-spacing characters.

Question 2: letter-spacing and word-spacing combination

The XSL WD says in [7.14.8 "word-spacing"]

    For fo:character whose treat-as-word-space trait has the value 
    "yes", the start-space and end-space traits are each set to a 
    value as follows: ...

The fo:character's start-space and end-space traits are also set by
letter-spacing, maybe.  If so, the resultant space is the sum? or 
resolved by the space-resolution rule?

Received on Tuesday, 6 June 2000 14:35:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:50 GMT