vestigeIndex = -1;
		private void handleNext()		{			int freeSpace = PDFTextLM.this.getFreeSpace();			// current chunk is over, get the next one.			if ( isNew || currentPos == chunk.getText().length() )			{				if (cg.hasMore())				{					chunk = cg.getNext();					if (chunk == Chunk.HARD_LINE_BREAK)					{						currentPos = chunk.getText().length();						PDFTextLM.this.newLine();						return;					}					currentPos = 0;					this.wr = new DefaultWordRecognizer(chunk.getText());				}				else				{					return;				}			}			if (isNew)			{				isNew = false;				if (isInline)				{					AbstractArea con = (AbstractArea)createInlineContainer(content, true, false);					con.setWidth(leftBorder+leftPadding);					con.setHeight( (int)(chunk.getFontInfo().getWordHeight()*PDFConstants.LAYOUT_TO_PDF_RATIO)							+ topBorder + topPadding + bottomBorder + bottomPadding);					PDFTextLM.this.addSpaceHolder(con);					leftSpaceHolder = leftMargin + leftBorder + leftPadding;					freeSpace -= leftSpaceHolder;				}			}						String str = null;			Word currentWord = null;			if (-1 == vestigeIndex)			{				currentWord = wr.getNextWord();				// The first word of the chunk is empty, so it means this chunk is a blank one. 				if (null == currentWord)				{					Dimension d = new Dimension( 0, 							(int)(chunk.getFontInfo().getWordHeight() * PDFConstants.LAYOUT_TO_PDF_RATIO ));					IArea builtArea = buildArea("", content,  //$NON-NLS-1$							chunk.getFontInfo(), d);					PDFTextLM.this.addTextLine(builtArea);					return;				}				str = currentWord.getValue();				areaStartPos = chunk.getOffset() + currentWord.getStart();				}			else			// This is a vestige.			{				str = chunk.getText().substring(vestigeIndex, vestigeIndex+vestigeLength);				areaStartPos = chunk.getOffset() + vestigeIndex;			}							int prevAreaWidth = 0;			int areaWidth = (int)(chunk.getFontInfo().getWordWidth(					chunk.getText().substring(currentPos, currentPos+str.length()))					* PDFConstants.LAYOUT_TO_PDF_RATIO)					+ letterSpacing * str.length() + wordSpacing;							// holds space for inline text to draw the right border, padding etc.			if (isInline)			{				if (isAtLast(chunk.getOffset() + currentPos + str.length()))				{					rightSpaceHolder = rightMargin + rightBorder + rightPadding;					freeSpace -= rightSpaceHolder;				}			}												while ( freeSpace >= areaWidth )			{				currentPos += str.length();				currentWord = wr.getNextWord();				if (null == currentWord)				{					str = null;					break;				}				str = currentWord.getValue();				prevAreaWidth = areaWidth;				areaWidth += (int)(chunk.getFontInfo().getWordWidth(						chunk.getText().substring(currentPos, currentPos+str.length()))						* PDFConstants.LAYOUT_TO_PDF_RATIO)						+ letterSpacing * str.length() + wordSpacing;									// holds space for inline text to draw the border, padding etc.				if (isAtLast(chunk.getOffset() + currentPos + str.length())) 				{					rightSpaceHolder = rightMargin + rightBorder + rightPadding;					freeSpace -= rightSpaceHolder;				}			}						//the chunk ends, build the TextArea.			int length = chunk.getText().length();			if (currentPos == length )			{				Dimension d = new Dimension( areaWidth, 						(int)(chunk.getFontInfo().getWordHeight() * PDFConstants.LAYOUT_TO_PDF_RATIO ));									String originalText = chunk.getText().substring(areaStartPos - chunk.getOffset(), 						chunk.getText().length());								IArea builtArea = buildArea(getReverseText(originalText), content, 						chunk.getFontInfo(), d);				PDFTextLM.this.addTextLine(builtArea);				vestigeIndex = -1;				vestigeLength = 0;				return;			}			if( maxLineSpace < chunk.getFontInfo().getWordWidth(str)* PDFConstants.LAYOUT_TO_PDF_RATIO 					+ letterSpacing * str.length()+ wordSpacing )			{				if ( 0 == str.length() )				{					vestigeIndex = -1;					vestigeLength = 0;					return;				}				// does hyphenation.				IHyphenationManager hm = new DefaultHyphenationManager();				Hyphenation hyph = hm.getHyphenation(str);								int endHyphenIndex = hyphen( 0, freeSpace-prevAreaWidth, hyph, chunk.getFontInfo() );				// forces to add the first character if the hyphen index is 0 for the second time.				if (endHyphenIndex == 0)				{					if (nothingSplitted)					{						str = hyph.getHyphenText( 0, endHyphenIndex + 1 );						addByForce = true;						nothingSplitted = false;					}					else					{						nothingSplitted = true;						vestigeIndex = currentPos;						vestigeLength = (null == currentWord) ? vestigeLength : currentWord.getLength();						return;					}				}				else				{					str = hyph.getHyphenText( 0, endHyphenIndex );					}								//int startHyphenIndex = (null == currentWord) ? vestigeIndex : currentWord.getStart();				currentPos += str.length();				vestigeIndex = currentPos;				vestigeLength = (null == currentWord) ? vestigeLength - str.length() : currentWord.getLength() - str.length();								Dimension d = null;				if ( addByForce )				{					d = new Dimension( freeSpace,							(int)(chunk.getFontInfo().getWordHeight() * PDFConstants.LAYOUT_TO_PDF_RATIO ));					addByForce = false;				}				else				{					d = new Dimension( prevAreaWidth 							+ (int)(chunk.getFontInfo().getWordWidth(str) * PDFConstants.LAYOUT_TO_PDF_RATIO) 							+letterSpacing*str.length(),							(int)(chunk.getFontInfo().getWordHeight() * PDFConstants.LAYOUT_TO_PDF_RATIO ));					}								String originalText = chunk.getText().substring(areaStartPos - chunk.getOffset(),						vestigeIndex);								IArea builtArea = buildArea(getReverseText(originalText), content, 						 chunk.getFontInfo(), d);				PDFTextLM.this.addTextLine(builtArea);				PDFTextLM.this.newLine();				return;			}			else			{				// builds the text area and ends current line.				Dimension d = new Dimension( prevAreaWidth,						(int)(chunk.getFontInfo().getWordHeight() * PDFConstants.LAYOUT_TO_PDF_RATIO));									String originalText = chunk.getText().substring(areaStartPos - chunk.getOffset(),						currentPos);								IArea builtArea = buildArea(getReverseText(originalText), content, chunk.getFontInfo(), d);				PDFTextLM.this.addTextLine(builtArea);				PDFTextLM.this.newLine();				vestigeIndex = (null == currentWord) ? -1 : currentWord.getStart();				vestigeLength = (null == currentWord) ? 0 : currentWord.getLength();				return;			}		}