/** * Set the font and the size for the subsequent text writing. * * @param bf the font * @param size the font size in points */ public void setFontAndSize(BaseFont bf, float size) { checkWriter(); if (size < 0.0001f && size > -0.0001f) throw new IllegalArgumentException(MessageLocalization.getComposedMessage("font.size.too.small.1", String.valueOf(size))); state.size = size; state.fontDetails = writer.addSimple(bf); PageResources prs = getPageResources(); PdfName name = state.fontDetails.getFontName(); name = prs.addFont(name, state.fontDetails.getIndirectReference()); content.append(name.getBytes()).append(' ').append(size).append(" Tf").append_i(separator); }
/** * Set the font and the size for the subsequent text writing. * * @param bf the font * @param size the font size in points */ public void setFontAndSize(BaseFont bf, float size) { checkWriter(); if (size < 0.0001f && size > -0.0001f) throw new IllegalArgumentException(MessageLocalization.getComposedMessage("font.size.too.small.1", String.valueOf(size))); state.size = size; state.fontDetails = writer.addSimple(bf); PageResources prs = getPageResources(); PdfName name = state.fontDetails.getFontName(); name = prs.addFont(name, state.fontDetails.getIndirectReference()); content.append(name.getBytes()).append(' ').append(size).append(" Tf").append_i(separator); }
/** * Set the font and the size for the subsequent text writing. * * @param bf the font * @param size the font size in points */ public void setFontAndSize(BaseFont bf, float size) { checkWriter(); if (size < 0.0001f && size > -0.0001f) throw new IllegalArgumentException("Font size too small: " + size); state.size = size; state.fontDetails = writer.addSimple(bf); PageResources prs = getPageResources(); PdfName name = state.fontDetails.getFontName(); name = prs.addFont(name, state.fontDetails.getIndirectReference()); content.append(name.getBytes()).append(' ').append(size).append(" Tf").append_i(separator); }
/** * Set the font and the size for the subsequent text writing. * * @param bf the font * @param size the font size in points */ public void setFontAndSize(BaseFont bf, float size) { checkWriter(); state.size = size; if (bf.getFontType() == BaseFont.FONT_TYPE_DOCUMENT) { state.fontDetails = new FontDetails(null, ((DocumentFont)bf).getIndirectReference(), bf); } else state.fontDetails = writer.addSimple(bf); PdfName psn = (PdfName)stdFieldFontNames.get(bf.getPostscriptFontName()); if (psn == null) { if (bf.isSubset() && bf.getFontType() == BaseFont.FONT_TYPE_TTUNI) psn = state.fontDetails.getFontName(); else { psn = new PdfName(bf.getPostscriptFontName()); state.fontDetails.setSubset(false); } } PageResources prs = getPageResources(); // PdfName name = state.fontDetails.getFontName(); prs.addFont(psn, state.fontDetails.getIndirectReference()); content.append(psn.getBytes()).append(' ').append(size).append(" Tf").append_i(separator); }
/** * Set the font and the size for the subsequent text writing. * * @param bf the font * @param size the font size in points */ public void setFontAndSize(BaseFont bf, float size) { checkWriter(); state.size = size; if (bf.getFontType() == BaseFont.FONT_TYPE_DOCUMENT) { state.fontDetails = new FontDetails(null, ((DocumentFont)bf).getIndirectReference(), bf); } else state.fontDetails = writer.addSimple(bf); PdfName psn = stdFieldFontNames.get(bf.getPostscriptFontName()); if (psn == null) { if (bf.isSubset() && bf.getFontType() == BaseFont.FONT_TYPE_TTUNI) psn = state.fontDetails.getFontName(); else { psn = new PdfName(bf.getPostscriptFontName()); state.fontDetails.setSubset(false); } } PageResources prs = getPageResources(); // PdfName name = state.fontDetails.getFontName(); prs.addFont(psn, state.fontDetails.getIndirectReference()); content.append(psn.getBytes()).append(' ').append(size).append(" Tf").append_i(separator); }
/** * Set the font and the size for the subsequent text writing. * * @param bf the font * @param size the font size in points */ public void setFontAndSize(BaseFont bf, float size) { checkWriter(); state.size = size; if (bf.getFontType() == BaseFont.FONT_TYPE_DOCUMENT) { state.fontDetails = new FontDetails(null, ((DocumentFont)bf).getIndirectReference(), bf); } else state.fontDetails = writer.addSimple(bf); PdfName psn = (PdfName)stdFieldFontNames.get(bf.getPostscriptFontName()); if (psn == null) { if (bf.isSubset() && bf.getFontType() == BaseFont.FONT_TYPE_TTUNI) psn = state.fontDetails.getFontName(); else { psn = new PdfName(bf.getPostscriptFontName()); state.fontDetails.setSubset(false); } } PageResources prs = getPageResources(); // PdfName name = state.fontDetails.getFontName(); prs.addFont(psn, state.fontDetails.getIndirectReference()); content.append(psn.getBytes()).append(' ').append(size).append(" Tf").append_i(separator); }