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 sp...@ChezPhil.org on 2001/10/16 19:59:00 UTC

Problems with hyphenation and links

Dear FOP developers,

I sent a message to this list last week describing various problems
that I've encountered with FOP (look for "Probs with underline,
background, hyphenation, svg and more").  No-one has replied :-(
It would be really good to get someone's opinion, especially with
these two which I don't have a work-around for:

Hyphenation:
------------

Hyphenation works when there is more than one word in the block.  If
there is only one word in the block, it is not hyphenated.  I think it
should be.  If I have one word in the block and the source has
whitespace before and after it, I get a run-time error.  Here's the
example:

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master margin-right="25mm" margin-left="25mm"
                           margin-bottom="20mm" margin-top="15mm"
                           page-height="297mm" page-width="210mm"
                           master-name="a4">
      <fo:region-before extent="10mm"/>
      <fo:region-after extent="10mm"/>
      <fo:region-body margin-bottom="15mm" margin-top="15mm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-name="a4">
    <fo:flow flow-name="xsl-region-body">

      <fo:block language="en" hyphenate="true">
        Thisparagraphwillbehyphenated becauseithasmorethanonewordinit
        andthisseemstoworkok.  Theseverylongwords existonlysothat
        thereisahighprobability thathyphenationwillberequired.
      </fo:block>

<!-- Uncommenting this block gives "ERROR: null".  This is identical to the
     next block apart from white space before and after the single very-long
     word.
     <fo:block language="en" hyphenate="true">
        ThisparagraphwillnotbehyphenatedbecauseitcontainsonlyoneextreemelylongwordandthisdoesnotseemtoworkIwasoriginallysufferingfromthisproblemintableswithnarrowcolumnsandwiththingslikeURLsthatareoftenverylongwithnospacesinthem.
      </fo:block> -->

<!-- there should be no line breaks in the following; watch out if
they have been added "in the post". -->

      <fo:block language="en" hyphenate="true">ThisparagraphwillnotbehyphenatedbecauseitcontainsonlyoneextreemelylongwordandthisdoesnotseemtoworkIwasoriginallysufferingfromthisproblemintableswithnarrowcolumnsandwiththingslikeURLsthatareoftenverylongwithnospacesinthem.</fo:block>

    </fo:flow>
  </fo:page-sequence>
</fo:root>


Links:
------

When I try this code, containing a basic-link and a break-before="page":

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master margin-right="25mm" margin-left="25mm"
                           margin-bottom="20mm" margin-top="15mm"
                           page-height="297mm" page-width="210mm"
                           master-name="a4">
      <fo:region-body margin-bottom="15mm" margin-top="15mm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-name="a4">
    <fo:flow flow-name="xsl-region-body">

      <fo:block>
        <fo:basic-link internal-destination="Y">
          X
        </fo:basic-link>
      </fo:block>

      <fo:block break-before="page"/>

      <fo:block id="Y"/>

    </fo:flow>
  </fo:page-sequence>
</fo:root>

I get this output:

FOP 0.20.1
using SAX parser org.apache.xerces.parsers.SAXParser
building formatting object tree
setting up fonts
 [1] [2ERROR: The id "Y" already exists in this document


Any help very, very much appreciated.

--Phil.

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


Re: Problems with hyphenation and links

Posted by sp...@ChezPhil.org.
Hi Keiron,

Many thanks for your reply.

> Most (if not all) of your problems have been fixed or don't appear
> to be problems.

Well I've downloaded 0.20.2 and tried my test code: the SVG and link
problems have both been fixed, which is great - thanks.

But I'm still getting run-time errors when I have hyphenation enabled
for blocks containing a single word.  In my experiments I've also
uncovered an unpleasant interaction between hyphenation and
underlining: the part-word at the end of the line doesn't get
underlined.

The behaviour when I try to set the background colour for an inline or
make a block underlined also hasn't changed, i.e. they are still
ignored.  Do you think this is the correct behaviour?  Why?

Thanks for your time.

Regards,

--Phil.



Here is some code illustrating the problems that I'm still getting.
Remove the <!-- --> to see the run-time error.


<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master margin-right="25mm" margin-left="25mm"
                           margin-bottom="20mm" margin-top="15mm"
                           page-height="297mm" page-width="210mm"
                           master-name="a4">
      <fo:region-before extent="10mm"/>
      <fo:region-after extent="10mm"/>
      <fo:region-body margin-bottom="15mm" margin-top="15mm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-name="a4">
    <fo:flow flow-name="xsl-region-body">

      <fo:block>
        <fo:inline text-decoration="underline">
          This will be underlined because the text-decoration is set on the
          inline element.
        </fo:inline>
      </fo:block>

      <fo:block text-decoration="underline">
        This will not be underlined even though a text-decoration is set on
        the block element.  It also fails when text-decoration is set on
        basic-link elements.
      </fo:block>

      <fo:block background-color="blue">
        This will have a blue background because background-color is set on
        the block element.
      </fo:block>

      <fo:block>
        <fo:inline background-color="blue">
          This will not have a blue background even though background-color
          is set on the inline element.
        </fo:inline>
      </fo:block>

      <fo:block language="en" hyphenate="true">
        Thisparagraphwillbehyphenated becauseithasmorethanonewordinit
        andthisseemstoworkok.  Theseverylongwords existonlysothat
        thereisahighprobability thathyphenationwillberequired.
      </fo:block>

      <fo:block language="en" hyphenate="true">
        <fo:inline text-decoration="underline">
          Thisparagraph illustratesaproblemwith hyphenationandunderlining.
          Whentextisbothhyphenatedandunderlined thepartialwordattheendof
          thelinewillnotbeunderlined.
        </fo:inline>
      </fo:block>
<!--
     <fo:block language="en" hyphenate="true">
        ThisparagraphwillnotbehyphenatedbecauseitcontainsonlyoneextreemelylongwordandthisdoesnotseemtoworkIwasoriginallysufferingfromthisproblemintableswithnarrowcolumnsandwiththingslikeURLsthatareoftenverylongwithnospacesinthem.
      </fo:block>
-->
    </fo:flow>
  </fo:page-sequence>
</fo:root>


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


Re: Problems with hyphenation and links

Posted by Keiron Liddle <ke...@aftexsw.com>.
Maybe everyone was inspired by your email address.
Most (if not all) of your problems have been fixed or don't appear to be
problems.

On Tue, 16 Oct 2001 19:59:00 spam_from_fop_dev@ChezPhil.org wrote:
> 
> Dear FOP developers,
> 
> I sent a message to this list last week describing various problems
> that I've encountered with FOP (look for "Probs with underline,
> background, hyphenation, svg and more").  No-one has replied :-(
> It would be really good to get someone's opinion, especially with
> these two which I don't have a work-around for:
> 
> Hyphenation:
> ------------
> 
> Hyphenation works when there is more than one word in the block.  If
> there is only one word in the block, it is not hyphenated.  I think it
> should be.  If I have one word in the block and the source has
> whitespace before and after it, I get a run-time error.  Here's the
> example:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>   <fo:layout-master-set>
>     <fo:simple-page-master margin-right="25mm" margin-left="25mm"
>                            margin-bottom="20mm" margin-top="15mm"
>                            page-height="297mm" page-width="210mm"
>                            master-name="a4">
>       <fo:region-before extent="10mm"/>
>       <fo:region-after extent="10mm"/>
>       <fo:region-body margin-bottom="15mm" margin-top="15mm"/>
>     </fo:simple-page-master>
>   </fo:layout-master-set>
>   <fo:page-sequence master-name="a4">
>     <fo:flow flow-name="xsl-region-body">
> 
>       <fo:block language="en" hyphenate="true">
>         Thisparagraphwillbehyphenated becauseithasmorethanonewordinit
>         andthisseemstoworkok.  Theseverylongwords existonlysothat
>         thereisahighprobability thathyphenationwillberequired.
>       </fo:block>
> 
> <!-- Uncommenting this block gives "ERROR: null".  This is identical to
> the
>      next block apart from white space before and after the single
> very-long
>      word.
>      <fo:block language="en" hyphenate="true">
>         ThisparagraphwillnotbehyphenatedbecauseitcontainsonlyoneextreemelylongwordandthisdoesnotseemtoworkIwasoriginallysufferingfromthisproblemintableswithnarrowcolumnsandwiththingslikeURLsthatareoftenverylongwithnospacesinthem.
>       </fo:block> -->
> 
> <!-- there should be no line breaks in the following; watch out if
> they have been added "in the post". -->
> 
>       <fo:block language="en" hyphenate="true">ThisparagraphwillnotbehyphenatedbecauseitcontainsonlyoneextreemelylongwordandthisdoesnotseemtoworkIwasoriginallysufferingfromthisproblemintableswithnarrowcolumnsandwiththingslikeURLsthatareoftenverylongwithnospacesinthem.</fo:block>
> 
>     </fo:flow>
>   </fo:page-sequence>
> </fo:root>
> 
> 
> Links:
> ------
> 
> When I try this code, containing a basic-link and a break-before="page":
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>   <fo:layout-master-set>
>     <fo:simple-page-master margin-right="25mm" margin-left="25mm"
>                            margin-bottom="20mm" margin-top="15mm"
>                            page-height="297mm" page-width="210mm"
>                            master-name="a4">
>       <fo:region-body margin-bottom="15mm" margin-top="15mm"/>
>     </fo:simple-page-master>
>   </fo:layout-master-set>
>   <fo:page-sequence master-name="a4">
>     <fo:flow flow-name="xsl-region-body">
> 
>       <fo:block>
>         <fo:basic-link internal-destination="Y">
>           X
>         </fo:basic-link>
>       </fo:block>
> 
>       <fo:block break-before="page"/>
> 
>       <fo:block id="Y"/>
> 
>     </fo:flow>
>   </fo:page-sequence>
> </fo:root>
> 
> I get this output:
> 
> FOP 0.20.1
> using SAX parser org.apache.xerces.parsers.SAXParser
> building formatting object tree
> setting up fonts
>  [1] [2ERROR: The id "Y" already exists in this document
> 
> 
> Any help very, very much appreciated.
> 
> --Phil.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
> 
> 

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