Example #1
0
        static Font LoadDefaultFont(PDFFONTFAMILY _font, int _size)
        {
            string _path = "../../Fonts/STXINGKA.TTF";

            switch (_font)
            {
            case PDFFONTFAMILY.宋体:
                _path = "../../Fonts/SIMFANG.TTF";
                break;

            case PDFFONTFAMILY.幼圆:
                _path = "../../Fonts/SIMYOU.TTF";
                break;

            case PDFFONTFAMILY.微软雅黑:
                _path = "../../Fonts/MSYH.ttf";
                break;

            case PDFFONTFAMILY.方正悬针篆变简体:
                _path = "../../Fonts/FZXZZ.TTF";
                break;

            default:
                _path = "../../Fonts/SIMSUN.TTF";
                break;
            }
            BaseFont font = BaseFont.CreateFont(_path, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
            Font     _f   = new Font(font, _size);

            return(_f);
        }
Example #2
0
        static Phrase GetPhrase(string content, PDFFONTFAMILY f, int size)
        {
            Font _font = LoadDefaultFont(f, size);

            return(new Phrase(content, _font));
        }