RE: keeping word together (not breaking words onto next line)

Thanks Jeremias,

Seems I forgot to put one twist into the mix. The title is a marker. So did some testing with the xsl:fo source by adding the fo:inline manually and parsing it.

<fo:marker marker-class-name="partsPageTitle">FLUSH WINDOW ASSEMBLY, NON-EMERGENCY <fo:inline keep-together.within-line="always">TIP-IN/FIXED</fo:inline></fo:marker>

Works like a charm. So my question is when defining the marker "partsPagetitle" can I place the fo:inline there while creating the xsl:fo or will I need to do a pass on the FO and add the fo:inline during this step. Not a big deal to parse the FO but do not want to go up the wrong path while creating a called-template to parse the string, find any word containing symbols, and then wrap the string in fo:inline.

Marijan (Mario) Madunic
Publishing Specialist
New Flyer Industries

-----Original Message-----
From: www-xsl-fo-request@w3.org [mailto:www-xsl-fo-request@w3.org] On Behalf Of Jeremias Maerki
Sent: Tuesday, December 21, 2010 2:02 AM
To: www-xsl-fo@w3.org
Subject: Re: keeping word together (not breaking words onto next line)

Have you had the "TIP-IN/FIXED" enclosed in an fo:inline? That should
really work. Otherwise, it's a bug (or missing functionality). Using
that on fo:block, it prevents the whole block text from being broken.

As an alternative, you can try to use word joiners (&#x2060;) to keep
the formatter from breaking a word apart at a particular place.

I've verified both approaches with Apache FOP 1.0:

      <fo:block-container width="11.3cm" background-color="lightgray">
        <fo:block>FLUSH WINDOW ASSEMBLY, NON-EMERGENCY TIP-IN/FIXED</fo:block>
        <fo:block keep-together.within-line="always">FLUSH WINDOW ASSEMBLY, NON-EMERGENCY TIP-IN/FIXED</fo:block>
        <fo:block>FLUSH WINDOW ASSEMBLY, NON-EMERGENCY <fo:inline keep-together.within-line="always">TIP-IN/FIXED</fo:inline></fo:block>
        <fo:block>FLUSH WINDOW ASSEMBLY, NON-EMERGENCY TIP-&#x2060;IN/&#x2060;FIXED</fo:block>
      </fo:block-container>

Some FO formatters implement Unicode UAX #14 for line breaking:
http://unicode.org/reports/tr14/
That document may give you additional ideas on how to control
line-breaking behaviour.

On 20.12.2010 17:16:02 Mario Madunic wrote:
> After doing some investigation by playing with the string "FLUSH WINDOW
> ASSEMBLY, NON-EMERGENCY TIP-IN/FIXED", I found that the culprit is the
> "-". When I remove it from the string I get the behaviour I'm looking
> for without using @keep-together.within-line. Is there a way to modify
> this behaviour?
> 
> Marijan (Mario) Madunic
> Publishing Specialist
> New Flyer Industries
> 
> -----Original Message-----
> From: www-xsl-fo-request@w3.org [mailto:www-xsl-fo-request@w3.org] On Behalf Of Mario Madunic
> Sent: Monday, December 20, 2010 9:47 AM
> To: www-xsl-fo@w3.org
> Subject: RE: keeping word together (not breaking words onto next line)
> 
> Thanks Jeremias, but it is keeping the entire string on one line instead of forcing an entire word to the next line. I'm looking at keeping words together when they would span two lines. Is there a group of attributes that I should be looking at?
> 
> Example:
> FLUSH WINDOW ASSEMBLY, NON-EMERGENCY TIP-IN/FIXED
> 
> Should become
> FLUSH WINDOW ASSEMBLY, NON-EMERGENCY
> TIP-IN/FIXED
> 
> Not
> FLUSH WINDOW ASSEMBLY, NON-EMERGENCY TIP-IN/
> FIXED
> 
> Marijan (Mario) Madunic
> Publishing Specialist
> New Flyer Industries
> 
> -----Original Message-----
> From: www-xsl-fo-request@w3.org [mailto:www-xsl-fo-request@w3.org] On Behalf Of Jeremias Maerki
> Sent: Monday, December 20, 2010 8:31 AM
> To: www-xsl-fo@w3.org
> Subject: Re: keeping word together (not breaking words onto next line)
> 
> <fo:block keep-together.within-line="always">My Title</fo:block>
> 
> ...or the same with fo:inline.
> 
> HTH
> 
> On 20.12.2010 14:52:13 Mario Madunic wrote:
> > I’m trying to keep words in titles together when they would break onto
> > two lines. An example would be when a title has the following
> > text“TIP-IN/FIXED”. Currently it is breaking the string at the “/
> > ” and placing “FIXED” on the next line. What is required is the
> > whole string on the next line. How can this be accomplished.
> > 
> > Marijan (Mario) Madunic
> > Publishing Specialist
> > New Flyer Industries


Jeremias Maerki



--------------------------------------------------------------------
Please consider the environment before printing this e-mail.

CONFIDENTIALITY STATEMENT: This communication (and  any and all information or material transmitted with this communication) is confidential, may be privileged and is intended only for the use of the intended recipient. If you are not the intended recipient, any review, retransmission, circulation, distribution, reproduction, conversion to hard copy, copying or other use of this communication, information or material is strictly prohibited and may be illegal. If you received this communication in error or if it is forwarded to you without the express authorization of New Flyer, please notify us immediately by telephone or by return email and permanently delete the communication, information and material from any computer, disk drive, diskette or other storage device or media. Thank you.

Received on Tuesday, 21 December 2010 12:31:37 UTC