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 Wessel van Norel <we...@ddnh.nl> on 2003/12/11 14:35:46 UTC

Hyphenation question

Hi,

I've a problem with the hyphenation in fop. There is a certain word that 
contains a minus character that should not be hyphenated. Is there a way 
to add this word in the hyphenation.xml file, so that it won't get 
hyphenated? Or do I have to translate the minus character to a special 
minus character, and if so, which one?

Regards
Wessel van Norel


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


Re: Hyphenation question

Posted by Roland Schroth <rs...@albit.de>.
> I've a problem with the hyphenation in fop. There is a certain word that
> contains a minus character that should not be hyphenated. Is there a way
> to add this word in the hyphenation.xml file, so that it won't get
> hyphenated? Or do I have to translate the minus character to a special
> minus character, and if so, which one?

You could simply exclude this word from hyphenation in the fo code like this:
    <fo:inline hyphenate="false">some-word</fo:inline>

As far as i understand the documentation at http://xml.apache.org/fop/hyphenation.html#patterns
there is no way to exclude words with characters in them that equal the hyphen character.

>From the documentation:
-----------------------------
<exceptions> contains whitespace-separated words, each of which has either explicit hyphen characters to denote acceptable breakage
points, or no hyphen characters, to indicate that this word should never be hyphenated, or contain explicit <hyp> elements for
specifying changes of spelling due to hyphenation (like backen -> bak-ken or Stoffarbe -> Stoff-farbe in the old german spelling).
Exceptions override the patterns described below. Explicit <hyp> declarations don't work yet (patches welcome). Exceptions are
generally a bit brittle, test carefully.
-----------------------------

But if you replace the hyphen in the word with a similar looking character other than the hyphenation character, you should be able
to exclude this word from hyphenation generally by putting it into the <exceptions> section of your hyphenation xml file as
described in the documentation.

Which character to use instead depends on the font you use. At least i think so. I do not know, which character is used for
hyphenation by default. In Arial for example there is a minus (U+002D) and a hyphen (U+2013). So if the hyphen is used for
hyphenation you could be able to use the minus for your special word, if these two characters are not treated the same (but that may
be the case). But this is only what i think. I don't have tried this or have any experience with that.
Just have a look into the character table for your font and you should find characters you might be able to use alternatively.

Maybe someone else can give some more hints on that.

Kind regards,
Roland



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