Beispiel #1
0
        public void SetFontFamily(string typeface, byte charset, byte pictAndFamily, bool isSymbol)
        {
            CT_TextCharacterProperties rPr = GetRPr();

            if (typeface == null)
            {
                if (rPr.IsSetLatin())
                {
                    rPr.UnsetLatin();
                }
                if (rPr.IsSetCs())
                {
                    rPr.UnsetCs();
                }
                if (rPr.IsSetSym())
                {
                    rPr.UnsetSym();
                }
            }
            else
            {
                if (isSymbol)
                {
                    CT_TextFont font = rPr.IsSetSym() ? rPr.sym : rPr.AddNewSym();
                    font.typeface = (typeface);
                }
                else
                {
                    CT_TextFont latin = rPr.IsSetLatin() ? rPr.latin : rPr.AddNewLatin();
                    latin.typeface = (typeface);
                    if ((sbyte)charset != -1)
                    {
                        latin.charset = (sbyte)(charset);
                    }
                    if ((sbyte)pictAndFamily != -1)
                    {
                        latin.pitchFamily = (sbyte)(pictAndFamily);
                    }
                }
            }
        }