Hyphenated text as String
Hey Foppers: Is there some way to get the hyphenated text of a particular block(s) returned as a string (with hyphens in place)? Since FOP puts hyphens in place at the time of the transform, I'm hoping to get back the hyphenated strings of specific blocks for a different portion of my application. Is this possible? Any input/examples would be greatly appreciated. Thanks! jw - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Hyphenated text as String
Jim Wright wrote: Is there some way to get the hyphenated text of a particular block(s) returned as a string (with hyphens in place)? Since FOP puts hyphens in place at the time of the transform, I'm hoping to get back the hyphenated strings of specific blocks for a different portion of my application. You might want to take a look at the Hyphenator class. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Hyphenated text as String
I did. And it seems like the right class to use, but it looks like it just hyphenates one word at a time(?). Can you point me toward which class decides which word is last on a line (measures text length), and hands it off to hyphenator? If I could just get a point of reference as to how Hyphenator is called by a specific block, I think I could ferret out the rest pretty quick. I checked the Javadoc, but couldn't find which class(es) used hyphenator on the block-level. Thanks for your help! jw On Tuesday, October 8, 2002, at 04:53 PM, J.Pietschmann wrote: Jim Wright wrote: Is there some way to get the hyphenated text of a particular block(s) returned as a string (with hyphens in place)? Since FOP puts hyphens in place at the time of the transform, I'm hoping to get back the hyphenated strings of specific blocks for a different portion of my application. You might want to take a look at the Hyphenator class. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Hyphenated text as String
Jim Wright wrote: I did. And it seems like the right class to use, but it looks like it just hyphenates one word at a time(?). Can you point me toward which class decides which word is last on a line (measures text length), and hands it off to hyphenator? If I could just get a point of reference as to how Hyphenator is called by a specific block, I think I could ferret out the rest pretty quick. I checked the Javadoc, but couldn't find which class(es) used hyphenator on the block-level. Windows explorer can search for files containing certain text, on Unixes there is find|grep. The code you are asking for is in LineArea.java. Be warned: it is very messy, and FOP does *not* hyphenate words, it just fakes it very successfully. One of the problems is that text making up a single word may be passed in multiple chunks to the routine doing the formatting, the other is that it isn't *really* clear what's a word if scripts are arbitrarily mixed. FOP is not language or script sensitive and just assumes that characters below #128; make up words, and everything else is just punctuation but is passed to the hyphenator anyway. In order to have proper word detection for hyphenation, a Unicode character property DB and TR29 (http://www.unicode.org/unicode/reports/tr29/) would be needed. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Hyphenated text as String
Sigh. Yeah, I was looking at that class, but hoped there was a more all in one approach. Thanks again for the input. jw On Tuesday, October 8, 2002, at 05:28 PM, J.Pietschmann wrote: Jim Wright wrote: I did. And it seems like the right class to use, but it looks like it just hyphenates one word at a time(?). Can you point me toward which class decides which word is last on a line (measures text length), and hands it off to hyphenator? If I could just get a point of reference as to how Hyphenator is called by a specific block, I think I could ferret out the rest pretty quick. I checked the Javadoc, but couldn't find which class(es) used hyphenator on the block-level. Windows explorer can search for files containing certain text, on Unixes there is find|grep. The code you are asking for is in LineArea.java. Be warned: it is very messy, and FOP does *not* hyphenate words, it just fakes it very successfully. One of the problems is that text making up a single word may be passed in multiple chunks to the routine doing the formatting, the other is that it isn't *really* clear what's a word if scripts are arbitrarily mixed. FOP is not language or script sensitive and just assumes that characters below #128; make up words, and everything else is just punctuation but is passed to the hyphenator anyway. In order to have proper word detection for hyphenation, a Unicode character property DB and TR29 (http://www.unicode.org/unicode/reports/tr29/) would be needed. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]