layout.dispose();
	void printDecorationSegment(String segment, int alignment, int page, boolean header) {				int pageIndex = segment.indexOf(StyledTextPrintOptions.PAGE_TAG);		if (pageIndex != -1) {			int pageTagLength = StyledTextPrintOptions.PAGE_TAG.length();			StringBuffer buffer = new StringBuffer(segment.substring (0, pageIndex));			buffer.append (page);			buffer.append (segment.substring(pageIndex + pageTagLength));			segment = buffer.toString();		}		if (segment.length() > 0) {			TextLayout layout = new TextLayout(printer);			layout.setText(segment);			layout.setFont(printerFont);			int segmentWidth = layout.getBounds().width;			int segmentHeight = printerRenderer.getLineHeight();			int drawX = 0, drawY;			if (alignment == LEFT) {				drawX = clientArea.x;			} else if (alignment == CENTER) {				drawX = (pageWidth - segmentWidth) / 2;			} else if (alignment == RIGHT) {				drawX = clientArea.x + clientArea.width - segmentWidth;			}			if (header) {				drawY = clientArea.y - segmentHeight * 2;			} else {				drawY = clientArea.y + clientArea.height + segmentHeight;			}			layout.draw(gc, drawX, drawY);			layout.dispose();		}	}