Esempio n. 1
0
        // Note. Make this constructor protected. Only PdfFontFactory (kernel level) will
        // be able to create Type0 font based on predefined font.
        // Or not? Possible it will be convenient construct PdfType0Font based on custom CidFont.
        // There is no typography features in CJK fonts.
        internal PdfType0Font(CidFont font, String cmap)
            : base()
        {
            if (!CidFontProperties.IsCidFont(font.GetFontNames().GetFontName(), cmap))
            {
                throw new PdfException("Font {0} with {1} encoding is not a cjk font.").SetMessageParams(font.GetFontNames
                                                                                                             ().GetFontName(), cmap);
            }
            this.fontProgram = font;
            vertical         = cmap.EndsWith("V");
            String uniMap = GetCompatibleUniMap(fontProgram.GetRegistry());

            cmapEncoding = new CMapEncoding(cmap, uniMap);
            longTag      = new SortedSet <int>();
            cidFontType  = CID_FONT_TYPE_0;
        }
Esempio n. 2
0
        internal PdfType0Font(CidFont font, String cmap)
            : base()
        {
            // Note. Make this constructor protected. Only PdfFontFactory (kernel level) will
            // be able to create Type0 font based on predefined font.
            // Or not? Possible it will be convenient construct PdfType0Font based on custom CidFont.
            // There is no typography features in CJK fonts.
            if (!CidFontProperties.IsCidFont(font.GetFontNames().GetFontName(), cmap))
            {
                throw new PdfException("font.1.with.2.encoding.is.not.a.cjk.font").SetMessageParams(font.GetFontNames().GetFontName
                                                                                                        (), cmap);
            }
            this.fontProgram = font;
            vertical         = cmap.EndsWith("V");
            String uniMap = GetCompatibleUniMap(fontProgram.GetRegistry());

            cmapEncoding = new CMapEncoding(cmap, uniMap);
            longTag      = new LinkedDictionary <int, int[]>();
            cidFontType  = CID_FONT_TYPE_0;
        }