internal void RegisterAsSimple( PDF pdf, Font font, Stream inputStream, int codePage, bool embed) { otf = new OTF(inputStream); if (embed) { EmbedFontFile(pdf, font, otf, true); } AddFontDescriptorObject(pdf, font, otf, embed); AddWidthsArrayObject(pdf, font, otf, codePage); AddEncodingObject(pdf, font, codePage); // Simple font object pdf.Newobj(); pdf.Append("<<\n"); pdf.Append("/Type /Font\n"); if (otf.cff) { pdf.Append("/Subtype /Type1\n"); } else { pdf.Append("/Subtype /TrueType\n"); } pdf.Append("/BaseFont /"); pdf.Append(otf.fontName); pdf.Append('\n'); pdf.Append("/FirstChar "); pdf.Append(otf.firstChar); pdf.Append('\n'); pdf.Append("/LastChar "); pdf.Append(255); pdf.Append('\n'); pdf.Append("/Encoding "); pdf.Append(font.GetEncodingObjNumber()); pdf.Append(" 0 R\n"); pdf.Append("/Widths "); pdf.Append(font.GetWidthsArrayObjNumber()); pdf.Append(" 0 R\n"); pdf.Append("/FontDescriptor "); pdf.Append(font.GetFontDescriptorObjNumber()); pdf.Append(" 0 R\n"); pdf.Append(">>\n"); pdf.Endobj(); font.objNumber = pdf.objNumber; }
internal void RegisterAsSimple( PDF pdf, Font font, Stream inputStream, int codePage, bool embed) { otf = new OTF(inputStream); if (embed) { EmbedFontFile(pdf, font, otf, true); } AddFontDescriptorObject(pdf, font, otf, embed); AddWidthsArrayObject(pdf, font, otf, codePage); AddEncodingObject(pdf, font, codePage); // Simple font object pdf.Newobj(); pdf.Append("<<\n"); pdf.Append("/Type /Font\n"); if (otf.cff) { pdf.Append("/Subtype /Type1\n"); } else { pdf.Append("/Subtype /TrueType\n"); } pdf.Append("/BaseFont /"); pdf.Append(otf.fontName); pdf.Append('\n'); pdf.Append("/FirstChar "); pdf.Append(otf.firstChar); pdf.Append('\n'); pdf.Append("/LastChar "); pdf.Append(255); pdf.Append('\n'); pdf.Append("/Encoding "); pdf.Append(font.GetEncodingObjNumber()); pdf.Append(" 0 R\n"); pdf.Append("/Widths "); pdf.Append(font.GetWidthsArrayObjNumber()); pdf.Append(" 0 R\n"); pdf.Append("/FontDescriptor "); pdf.Append(font.GetFontDescriptorObjNumber()); pdf.Append(" 0 R\n"); pdf.Append(">>\n"); pdf.Endobj(); font.objNumber = pdf.objNumber; }