XSL FO: letter-spacing and space-resolution

Dear xsl-editors,

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


Problem 1: Unexpected space-suppressing

simple example:

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

output:
AAABBBCCC
(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:

AAA    BBB    CCC
   (1cm)  (1cm)

but we have to write more complicated stylesheet:

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

or

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

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

    NOTE: 
    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
</fo:block>

output:
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).



IMHO,
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]
  http://lists.w3.org/Archives/Public/xsl-editors/2000AprJun/0057.html



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?


Thanks,
MURAKAMI Shinyu

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