You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Oleg Tkachenko <ol...@multiconn.com> on 2002/07/21 22:21:46 UTC

[PATCH] text-transform support

Hello there!

In spite of text-transform non-recommended status and i18n issues I 
believe fop can rely on java i18n support and implement this property 
using toUpperCase()/toLowerCase() stuff.
Here is suggested patch.

-- 
Oleg Tkachenko
Multiconn International, Israel

Re: [PATCH] text-transform support

Posted by Oleg Tkachenko <ol...@multiconn.com>.
J.Pietschmann wrote:

> The problem is that
>   <fo:wrapper text-transform="capitalize">e<fo:wrapper
>        >x</fo:wrapper>tensible</fo:wrapper>
> 
> will create three FOText objects, holding "e", "x" and
> "tensible". With your algorithm it would probably capitalize
> to EXTensible. 
You right. I had feeling it's wrong place, but after testing on xep test 
suite decided all right.

> The other approach, doing text transformation
> as the text is added to a line, wont work either because of
> the current small-caps implementation (see FOText.addText()),
> and I'd rather keep small caps than text transformations.
That doesn't help either, they are 3 different chunks till LineArea's
addText() method and I have not enough courage to sink into this 400 
lines method, so... forget it. :)

-- 
Oleg Tkachenko
Multiconn International, Israel


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: [PATCH] text-transform support

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Oleg Tkachenko wrote:
> Hello there!
> 
> In spite of text-transform non-recommended status and i18n issues I 
> believe fop can rely on java i18n support and implement this property 
> using toUpperCase()/toLowerCase() stuff.
> +            case TextTransform.CAPITALIZE:
> +                boolean isFirst = true;
> +                for (int i=0; i<length; i++) {

The problem is that
   <fo:wrapper text-transform="capitalize">e<fo:wrapper
        >x</fo:wrapper>tensible</fo:wrapper>

will create three FOText objects, holding "e", "x" and
"tensible". With your algorithm it would probably capitalize
to EXTensible. The other approach, doing text transformation
as the text is added to a line, wont work either because of
the current small-caps implementation (see FOText.addText()),
and I'd rather keep small caps than text transformations.

The third nail are the actual i18n issues, because text
transformations are language dependent. Ok, only for a very
few real characters (IIRC see Unicode "special casing"
  http://www.unicode.org/Public/3.2-Update/SpecialCasing-3.2.0.txt),
but I think the German szlig is still widely used in the
FOP audience.

Actually, IIRC text transformations were added to FO because CSS
had them, but I can't quite remember the original use cases for
CSS. I vaguely remember some issues with pseudo classes, which
are not problems in XSLFO.

As long as nobody comlains loudly, I think we'll leave this out.

J.Pietschmann



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org