示例#1
0
        public int AddNewStyle(float fontSize, Color color, UNOTextAlign align)
        {
            UNOStatStyle style = new UNOStatStyle(fontSize, color, align);

            stylesCollection.Add(style);
            //return stylesCollection.Count - 1;
            return(stylesCollection.IndexOf(style));
        }
示例#2
0
        public UNOStatStyle(float fontSize, Color color, UNOTextAlign align)
        {
            TextFont              = UNOFonts.GetUNOFont(fontSize);
            TextColor             = color;
            SFormat.LineAlignment = StringAlignment.Center;

            switch (align)
            {
            case UNOTextAlign.left:
                SFormat.Alignment = StringAlignment.Near;
                break;

            case UNOTextAlign.center:
                SFormat.Alignment = StringAlignment.Center;
                break;

            case UNOTextAlign.right:
                SFormat.Alignment = StringAlignment.Far;
                break;
            }
        }