public void setFontSize(int size)// for dg row color expression { if (Font == null) { Font = new EbFont(); } Font.Size = size; }
public void toLower()// for dg row color expression { if (Font == null) { Font = new EbFont(); } Font.Caps = false; }
public void toUpper()// for dg row color expression { if (Font == null) { Font = new EbFont(); } Font.Caps = true; }
public void setColor(string hexCode)// for dg row color expression { if (Font == null) { Font = new EbFont(); } Font.Color = hexCode; }
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; } }
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 }); } }
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; } } }