/** * Gets the width that the line will occupy after writing. * Only the width of the first line is returned. * * @param phrase the <CODE>Phrase</CODE> containing the line * @return the width of the line */ public static float getWidth(Phrase phrase) { return getWidth(phrase, PdfWriter.RUN_DIRECTION_NO_BIDI, 0); }
/** * Gets the width that the line will occupy after writing. * Only the width of the first line is returned. * * @param phrase the <CODE>Phrase</CODE> containing the line * @return the width of the line */ public static float getWidth(Phrase phrase) { return getWidth(phrase, PdfWriter.RUN_DIRECTION_NO_BIDI, 0); }
/** * Gets the width that the line will occupy after writing. * Only the width of the first line is returned. * * @param phrase the <CODE>Phrase</CODE> containing the line * @return the width of the line */ public static float getWidth(Phrase phrase) { return getWidth(phrase, PdfWriter.RUN_DIRECTION_NO_BIDI, 0); }
public ColumnText reconfigure( PdfContentByte cb, Phrase p ) { float filledWidth = ColumnText.getWidth( p, runDirection, 0 ) + 0.5f; ColumnText ct = new ColumnText( cb ); ct.setRunDirection( runDirection ); if ( alignment == Element.ALIGN_LEFT ) { ct.setSimpleColumn( llx, lly, llx + filledWidth, ury, leading, alignment ); } else if ( alignment == Element.ALIGN_RIGHT ) { ct.setSimpleColumn( urx - filledWidth, lly, urx, ury, leading, alignment ); } else if ( alignment == Element.ALIGN_CENTER ) { float delta = ( ( urx - llx ) - filledWidth ) / 2; ct.setSimpleColumn( urx + delta, lly, urx - delta, ury, leading, alignment ); } else { ct.setSimpleColumn( llx, lly, urx, ury, leading, alignment ); } return ct; } }
float maxCalculatedSize = h / (ufont.getFontDescriptor(BaseFont.BBOXURX, 1) - ufont.getFontDescriptor(BaseFont.BBOXLLY, 1)); changeFontSize(phrase, 1); float wd = ColumnText.getWidth(phrase, rtl, 0); if (wd == 0) usize = maxCalculatedSize;
float maxCalculatedSize = h / (ufont.getFontDescriptor(BaseFont.BBOXURX, 1) - ufont.getFontDescriptor(BaseFont.BBOXLLY, 1)); changeFontSize(phrase, 1); float wd = ColumnText.getWidth(phrase, rtl, 0); if (wd == 0) usize = maxCalculatedSize;
float maxCalculatedSize = h / (ufont.getFontDescriptor(BaseFont.BBOXURX, 1) - ufont.getFontDescriptor(BaseFont.BBOXLLY, 1)); changeFontSize(phrase, 1); float wd = ColumnText.getWidth(phrase, rtl, 0); if (wd == 0) usize = maxCalculatedSize;