You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Alexander Uvarov <al...@gmail.com> on 2010/11/23 08:30:07 UTC

How to hyphenate nonwords?

How to hyphenate nonwords? For example i have serial number ZZ10-SX70-BBQZA in a table cell. Serial might be in any language. Table cell is small and document looks ugly. Could anyone share hyphenation rules for such case? I am sure that I am not the first person with such problem.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: How to hyphenate nonwords?

Posted by kindaian <ki...@gmail.com>.
Hi Alexander,

If i recall correctly, the hyphnation system uses a standard method 
(kind of computer based gramatical rules, the xml-fo standard, pointed 
by annother poster, states which standard it is based).

If your serial numbers follow a pattern, you may be able to "split" them 
using that pattern.

You can check the existing hyphnation rules for examples on how to build 
the paterns.

I've found a not too old post (but that can be a bit outdated) that has 
some links to the docs regarding hyphenation (and how to install new 
patterns):

http://www.devcomments.com/How-to-install-hyphenation-patterns-in-FOP-at9686.htm

Hope to have been of help,

Kind regards,
Kindaian


On 23/11/2010 07:30, Alexander Uvarov wrote:
> How to hyphenate nonwords? For example i have serial number ZZ10-SX70-BBQZA in a table cell. Serial might be in any language. Table cell is small and document looks ugly. Could anyone share hyphenation rules for such case? I am sure that I am not the first person with such problem.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


AW: AW: How to hyphenate nonwords?

Posted by Georg Datterl <ge...@geneon.de>.
Hi Alexander,

> Table cell overflow is also inappropriate. If string can't be successfully hyphenated, in case of overflow forced
> hyphenation would be better than just overflow. Imho.

Imho you are right and I complained about that too, some time ago. But it was a design decision at the start of the project and there's nothing we can do about it.

Regards,

Georg Datterl

------ Kontakt ------

Georg Datterl

Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg

HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20

www.geneon.de

Weitere Mitglieder der Willmy MediaGroup:

IRS Integrated Realization Services GmbH:    www.irs-nbg.de
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de


-----Ursprüngliche Nachricht-----
Von: Alexander Uvarov [mailto:alexander.uvarov@gmail.com]
Gesendet: Dienstag, 23. November 2010 10:35
An: fop-users@xmlgraphics.apache.org
Betreff: Re: AW: How to hyphenate nonwords?


On 23.11.2010, at 14:21, Georg Datterl wrote:

> Hi Alexander,
>
>> Sounds insane for me. I have a lot of places in documents where i need forced hyphenation.
>> It's unacceptable solution.
>> I am wondering why fop don't offer any elegant solution.
>
> Well, can you think of an elegant solution?
>
>> Why not just consider all strings as strings with zero width space after each characters?
>
> Because then hyphenation would not work at all, because after every character there would be a possible place to hyphenate. And that's simply not correct in normal language.

Table cell overflow is also inappropriate. If string can't be successfully hyphenated, in case of overflow forced hyphenation would be better than just overflow. Imho.

>
> Regards,
>
> Georg Datterl


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: AW: How to hyphenate nonwords?

Posted by Peter Hancock <pe...@gmail.com>.
Hi Alexander,

Before questioning FOP's implementation you may want to consult the
xsl:fo specification at http://www.w3.org/TR/2006/REC-xsl11-20061205/
first.
If you believe that FOP strays from this, then please raise your
concern on this list.

Often times the solution to a particular problem cannot be elegantly
expressed in xsl:fo, however, xsl:fo is not designed as a human
writable/readable data format and xslt processors should not be phased
by a documents poor aesthetic quality.  Computers are good at doing
boring jobs like adding zero width space to strings so I would
recommend figuring out a way to process the things like serial numbers
when you include them in your fo.

Pete
On Tue, Nov 23, 2010 at 9:34 AM, Alexander Uvarov
<al...@gmail.com> wrote:
>
> On 23.11.2010, at 14:21, Georg Datterl wrote:
>
>> Hi Alexander,
>>
>>> Sounds insane for me. I have a lot of places in documents where i need forced hyphenation.
>>> It's unacceptable solution.
>>> I am wondering why fop don't offer any elegant solution.
>>
>> Well, can you think of an elegant solution?
>>
>>> Why not just consider all strings as strings with zero width space after each characters?
>>
>> Because then hyphenation would not work at all, because after every character there would be a possible place to hyphenate. And that's simply not correct in normal language.
>
> Table cell overflow is also inappropriate. If string can't be successfully hyphenated, in case of overflow forced hyphenation would be better than just overflow. Imho.
>
>>
>> Regards,
>>
>> Georg Datterl
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: AW: How to hyphenate nonwords?

Posted by Alexander Uvarov <al...@gmail.com>.
On 23.11.2010, at 14:21, Georg Datterl wrote:

> Hi Alexander,
> 
>> Sounds insane for me. I have a lot of places in documents where i need forced hyphenation.
>> It's unacceptable solution.
>> I am wondering why fop don't offer any elegant solution.
> 
> Well, can you think of an elegant solution?
> 
>> Why not just consider all strings as strings with zero width space after each characters?
> 
> Because then hyphenation would not work at all, because after every character there would be a possible place to hyphenate. And that's simply not correct in normal language.

Table cell overflow is also inappropriate. If string can't be successfully hyphenated, in case of overflow forced hyphenation would be better than just overflow. Imho.

> 
> Regards,
> 
> Georg Datterl


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


AW: How to hyphenate nonwords?

Posted by Georg Datterl <ge...@geneon.de>.
Hi Alexander,

> Sounds insane for me. I have a lot of places in documents where i need forced hyphenation.
> It's unacceptable solution.
> I am wondering why fop don't offer any elegant solution.

Well, can you think of an elegant solution?

> Why not just consider all strings as strings with zero width space after each characters?

Because then hyphenation would not work at all, because after every character there would be a possible place to hyphenate. And that's simply not correct in normal language.

Regards,

Georg Datterl

------ Kontakt ------

Georg Datterl

Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg

HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20

www.geneon.de

Weitere Mitglieder der Willmy MediaGroup:

IRS Integrated Realization Services GmbH:    www.irs-nbg.de
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de


-----Ursprüngliche Nachricht-----
Von: Alexander Uvarov [mailto:alexander.uvarov@gmail.com]
Gesendet: Dienstag, 23. November 2010 09:30
An: fop-users@xmlgraphics.apache.org
Betreff: Re: How to hyphenate nonwords?

Sounds insane for me. I have a lot of places in documents where i need forced hyphenation. It's unacceptable solution.
I am wondering why fop don't offer any elegant solution. Why not just consider all strings as strings with zero width space after each characters?

On 23.11.2010, at 13:22, Pascal Sancho wrote:

> Hi,
>
> you can insert a ZWSP (zero width space, &#x200b;) between characters
> you want a possible break.
>
> Le 23/11/2010 08:30, Alexander Uvarov a écrit :
>> How to hyphenate nonwords? For example i have serial number ZZ10-SX70-BBQZA in a table cell. Serial might be in any language. Table cell is small and document looks ugly. Could anyone share hyphenation rules for such case? I am sure that I am not the first person with such problem.
>
> --
> Pascal
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: How to hyphenate nonwords?

Posted by Alexander Uvarov <al...@gmail.com>.
Sounds insane for me. I have a lot of places in documents where i need forced hyphenation. It's unacceptable solution.
I am wondering why fop don't offer any elegant solution. Why not just consider all strings as strings with zero width space after each characters?

On 23.11.2010, at 13:22, Pascal Sancho wrote:

> Hi,
> 
> you can insert a ZWSP (zero width space, &#x200b;) between characters
> you want a possible break.
> 
> Le 23/11/2010 08:30, Alexander Uvarov a écrit :
>> How to hyphenate nonwords? For example i have serial number ZZ10-SX70-BBQZA in a table cell. Serial might be in any language. Table cell is small and document looks ugly. Could anyone share hyphenation rules for such case? I am sure that I am not the first person with such problem.
> 
> --
> Pascal
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: How to hyphenate nonwords?

Posted by Pascal Sancho <pa...@takoma.fr>.
Hi,

you can insert a ZWSP (zero width space, &#x200b;) between characters
you want a possible break.

Le 23/11/2010 08:30, Alexander Uvarov a écrit :
> How to hyphenate nonwords? For example i have serial number ZZ10-SX70-BBQZA in a table cell. Serial might be in any language. Table cell is small and document looks ugly. Could anyone share hyphenation rules for such case? I am sure that I am not the first person with such problem.

--
Pascal

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: How to hyphenate nonwords?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
On 23.11.2010 08:30, Alexander Uvarov wrote:
> How to hyphenate nonwords? For example i have serial number
> ZZ10-SX70-BBQZA in a table cell. Serial might be in any language.
> Table cell is small and document looks ugly. Could anyone share
> hyphenation rules for such case? I am sure that I am not the first
> person with such problem.
>
First, I think you look for automated line breaking rather than
hyphenation. The latter adds an hyphenation sign, and I don't
think you want this in your serial number.

Second: FOP implements the Unicode line breaking algorithm 
(http://www.unicode.org/reports/tr14/) which was written with
a very common use case in mind: typesetting internationalized
text, mostly in a natural language. Unfortunately, this algorithm
can't deal easily with random innovations in written text, like
URLs or Serial Numbers. OTOH, UAX#14 provides some additional
control in form of the already mentioned Zero Width Space
character (and others), which allow you to put hints for the
line breaking engine into your source character stream. There are
various ways you can do this, for solutions at the XSLT level have
a look at the XSLT FAQ.

Third: If you come up with a more elegant solution, please
discuss it on this list and/or on the XSL list
(http://www.mulberrytech.com/xsl/xsl-list/), where the relevant
gurus tend to hang out.
If you think there should be a FOP extension element to mark
up parts of the flow text to use alternative line breaking rules,
well, spec and code contributions are welcome.

HTH
J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org