Exemplo n.º 1
0
 public void setFontSize(int size)// for dg row color expression
 {
     if (Font == null)
     {
         Font = new EbFont();
     }
     Font.Size = size;
 }
Exemplo n.º 2
0
 public void toLower()// for dg row color expression
 {
     if (Font == null)
     {
         Font = new EbFont();
     }
     Font.Caps = false;
 }
Exemplo n.º 3
0
 public void toUpper()// for dg row color expression
 {
     if (Font == null)
     {
         Font = new EbFont();
     }
     Font.Caps = true;
 }
Exemplo n.º 4
0
 public void setColor(string hexCode)// for dg row color expression
 {
     if (Font == null)
     {
         Font = new EbFont();
     }
     Font.Color = hexCode;
 }
Exemplo n.º 5
0
 public void setFontStyle(string fontStyle)// for dg row color expression
 {
     if (Font == null)
     {
         Font = new EbFont();
     }
     if (Enum.TryParse(fontStyle.ToUpper(), out FontStyle style))
     {
         Font.Style = style;
     }
 }
Exemplo n.º 6
0
 public Phrase GetFormattedPhrase(EbFont Font, EbFont _reportFont, string text)
 {
     iTextSharp.text.Font iTextFont = null;
     if (Font is null)
     {
         if (!(_reportFont is null))
         {
             Font = _reportFont;
         }
         else
         {
             Font = (new EbFont {
                 color = "#000000", FontName = "Roboto", Caps = false, Size = 10, Strikethrough = false, Style = 0, Underline = false
             });
         }
     }
Exemplo n.º 7
0
        public static void SetFont(this Label label, EbFont font, bool isHeader = false)
        {
            if (font != null)
            {
                label.FontSize  = font.Size;
                label.TextColor = isHeader ? Color.White : Color.FromHex(font.Color);

                switch (font.Style)
                {
                case FontStyle.BOLD:
                    label.FontAttributes = FontAttributes.Bold;
                    break;

                case FontStyle.ITALIC:
                    label.FontAttributes = FontAttributes.Italic;
                    break;

                case FontStyle.BOLDITALIC:
                    label.FontAttributes = FontAttributes.Italic;
                    break;

                default:
                    label.FontAttributes = FontAttributes.None;
                    break;
                }

                if (font.Caps)
                {
                    label.TextTransform = Xamarin.Forms.TextTransform.Uppercase;
                }

                if (font.Underline)
                {
                    label.TextDecorations = TextDecorations.Underline;
                }
                else if (font.Strikethrough)
                {
                    label.TextDecorations = TextDecorations.Strikethrough;
                }
                else
                {
                    label.TextDecorations = TextDecorations.None;
                }
            }
        }