Re: [iText-questions] WordSpacing and CharacterSpacing

2008-01-29 Thread Stephan Michels
2008/1/28, Leonard Rosenthol [EMAIL PROTECTED]:
 On Jan 28, 2008, at 7:27 AM, Stephan Michels wrote:
  I can simply prevent orphans in a column if I check if the available
  height is smaller than e.g. 2 rows, then I put the paragraph into the
  next column.
  To prevent widows I have to adjust the character and word spacing so
  that I have an additional row. I know I can increase the c. and w.
  spacing only a little, just below the visibility, but sometimes it is
  enough to prevent the orphan.

 Why not implement this sort of stuff directly into iText (and then
 provide a patch)??  By doing widow and orphan control internally, in
 conjunction with a smarter justification algorithm that takes
 vertical issues into consideration will just improve iText.

Sure! My current experiement is to add the information about character
and word spacing to Chunk, copy the information to PdfChunk and then
using it to calculate the correct width in BidiLine.processLine().
The biggest hurdle is right now to combine it with the justify
alignment in PdfDocument.writeLineToContent().

If this works then you have the instrument to control windows and it
is possible to add an automatic algorithm.

Stephan.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] WordSpacing and CharacterSpacing

2008-01-28 Thread mister bean

See p. 347-350 in the book. The methods you're looking for are
setCharacterSpacing() and setWordSpacing().

Best wishes,

---mr. bean


Stephan Michels wrote:
 
 Hi,
 
 is it possible to set the word spacing and character spacing, for
 example a paragraph?
 I have to increase the values to prevent orphans in a column layout.
 
 I inspected the source code and found that
 PdfDocument.writeLineToContent() changed the values for justified
 lines, but no way to change the value directly.
 
 BTW, that the meaning of the value lastBaseFactor in this method?
 
 Thank you,
 Stephan Michels.
 
 -
 This SF.net email is sponsored by: Microsoft
 Defy all challenges. Microsoft(R) Visual Studio 2008.
 http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
 ___
 iText-questions mailing list
 iText-questions@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/itext-questions
 Buy the iText book: http://itext.ugent.be/itext-in-action/
 
 

-- 
View this message in context: 
http://www.nabble.com/WordSpacing-and-CharacterSpacing-tp15130366p15130943.html
Sent from the iText - General mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] WordSpacing and CharacterSpacing

2008-01-28 Thread Stephan Michels
2008/1/28, mister bean [EMAIL PROTECTED]:

 See p. 347-350 in the book. The methods you're looking for are
 setCharacterSpacing() and setWordSpacing().

Thanks, but AFAICS those values get lost if you use justified text and
it is not possible to define additional space.

Stephan.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] WordSpacing and CharacterSpacing

2008-01-28 Thread Leonard Rosenthol
But if you are justifying the text, what purpose do character  word  
spacing serve?

Leonard

On Jan 28, 2008, at 4:13 AM, Stephan Michels wrote:

 2008/1/28, mister bean [EMAIL PROTECTED]:

 See p. 347-350 in the book. The methods you're looking for are
 setCharacterSpacing() and setWordSpacing().

 Thanks, but AFAICS those values get lost if you use justified text and
 it is not possible to define additional space.

 Stephan.

 -- 
 ---
 This SF.net email is sponsored by: Microsoft
 Defy all challenges. Microsoft(R) Visual Studio 2008.
 http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
 ___
 iText-questions mailing list
 iText-questions@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/itext-questions
 Buy the iText book: http://itext.ugent.be/itext-in-action/



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] WordSpacing and CharacterSpacing

2008-01-28 Thread Stephan Michels
Sorry, I mixed widows and orphans before. I always do :-/

2008/1/28, Leonard Rosenthol [EMAIL PROTECTED]:
 But if you are justifying the text, what purpose do character  word
 spacing serve?

The jusitfy alignment distributes only the available space in the row.
But I want more space to get an additional row or two.

I can simply prevent orphans in a column if I check if the available
height is smaller than e.g. 2 rows, then I put the paragraph into the
next column.
To prevent widows I have to adjust the character and word spacing so
that I have an additional row. I know I can increase the c. and w.
spacing only a little, just below the visibility, but sometimes it is
enough to prevent the orphan.

Stephan.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] WordSpacing and CharacterSpacing

2008-01-28 Thread Leonard Rosenthol
On Jan 28, 2008, at 7:27 AM, Stephan Michels wrote:

 Sorry, I mixed widows and orphans before. I always do :-/


Yeah, big difference ;).


 The jusitfy alignment distributes only the available space in the row.
 But I want more space to get an additional row or two.


Then I'd turn off auto justification for that paragraph and do it  
yourself as necessary.  Be aware, however, that word spacing ONLY  
works for Latin/Roman text and character spacing will screw up any  
auto-kerning in place.   In fact, personally, I would avoid these two  
operators all together and just look into more intelligent  
justification algorithms.


 I can simply prevent orphans in a column if I check if the available
 height is smaller than e.g. 2 rows, then I put the paragraph into the
 next column.
 To prevent widows I have to adjust the character and word spacing so
 that I have an additional row. I know I can increase the c. and w.
 spacing only a little, just below the visibility, but sometimes it is
 enough to prevent the orphan.

Why not implement this sort of stuff directly into iText (and then  
provide a patch)??  By doing widow and orphan control internally, in  
conjunction with a smarter justification algorithm that takes  
vertical issues into consideration will just improve iText.

Leonard


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/