iTextSharp.text.pdf.FontSelector.AddFont C# (CSharp) Метод

AddFont() публичный Метод

public AddFont ( Font font ) : void
font iTextSharp.text.Font
Результат void
        public void AddFont(Font font) {
            if (font.BaseFont != null) {
                fonts.Add(font);
                return;
            }
            BaseFont bf = font.GetCalculatedBaseFont(true);
            Font f2 = new Font(bf, font.Size, font.CalculatedStyle, font.Color);
            fonts.Add(f2);
        }
        

Usage Example

Пример #1
0
        private Phrase ComposePhrase(String text, BaseFont ufont, BaseColor color, float fontSize)
        {
            Phrase phrase = null;

            if (extensionFont == null && (substitutionFonts == null || substitutionFonts.Count == 0))
            {
                phrase = new Phrase(new Chunk(text, new Font(ufont, fontSize, 0, color)));
            }
            else
            {
                FontSelector fs = new FontSelector();
                fs.AddFont(new Font(ufont, fontSize, 0, color));
                if (extensionFont != null)
                {
                    fs.AddFont(new Font(extensionFont, fontSize, 0, color));
                }
                if (substitutionFonts != null)
                {
                    foreach (BaseFont bf in substitutionFonts)
                    {
                        fs.AddFont(new Font(bf, fontSize, 0, color));
                    }
                }
                phrase = fs.Process(text);
            }
            return(phrase);
        }
All Usage Examples Of iTextSharp.text.pdf.FontSelector::AddFont
FontSelector