/** * Set the font and the size for the subsequent text writing. * * @param bf the font * @param size the font size in points */ public override void SetFontAndSize(BaseFont bf, float size) { CheckWriter(); state.size = size; if (bf.FontType == BaseFont.FONT_TYPE_DOCUMENT) { state.fontDetails = new FontDetails(null, ((DocumentFont)bf).IndirectReference, bf); } else { state.fontDetails = writer.AddSimple(bf); } PdfName psn; stdFieldFontNames.TryGetValue(bf.PostscriptFontName, out psn); if (psn == null) { if (bf.Subset && bf.FontType == BaseFont.FONT_TYPE_TTUNI) { psn = state.fontDetails.FontName; } else { psn = new PdfName(bf.PostscriptFontName); state.fontDetails.Subset = false; } } PageResources prs = PageResources; prs.AddFont(psn, state.fontDetails.IndirectReference); content.Append(psn.GetBytes()).Append(' ').Append(size).Append(" Tf").Append_i(separator); }