public Font getFontByType(fontType type, RightToLeft RightToLeft = RightToLeft.No) { var fontName = (RightToLeft == RightToLeft.Yes) ? "IRANYekanMobileFN" : "Roboto"; switch (type) { case fontType.H1: return(new Font(RobotoFontFamilies[$"{fontName}_Light"], 96f, FontStyle.Regular, GraphicsUnit.Pixel)); case fontType.H2: return(new Font(RobotoFontFamilies[$"{fontName}_Light"], 60f, FontStyle.Regular, GraphicsUnit.Pixel)); case fontType.H3: return(new Font(RobotoFontFamilies[$"{fontName}"], 48f, FontStyle.Bold, GraphicsUnit.Pixel)); case fontType.H4: return(new Font(RobotoFontFamilies[$"{fontName}"], 34f, FontStyle.Bold, GraphicsUnit.Pixel)); case fontType.H5: return(new Font(RobotoFontFamilies[$"{fontName}"], 24f, FontStyle.Bold, GraphicsUnit.Pixel)); case fontType.H6: return(new Font(RobotoFontFamilies[$"{fontName}_Medium"], 20f, FontStyle.Bold, GraphicsUnit.Pixel)); case fontType.Subtitle1: return(new Font(RobotoFontFamilies[$"{fontName}"], 16f, FontStyle.Regular, GraphicsUnit.Pixel)); case fontType.Subtitle2: return(new Font(RobotoFontFamilies[$"{fontName}_Medium"], 14f, FontStyle.Bold, GraphicsUnit.Pixel)); case fontType.SubtleEmphasis: return(new Font(RobotoFontFamilies[$"{fontName}"], 12f, FontStyle.Italic, GraphicsUnit.Pixel)); case fontType.Body1: return(new Font(RobotoFontFamilies[$"{fontName}"], 14f, FontStyle.Regular, GraphicsUnit.Pixel)); case fontType.Body2: return(new Font(RobotoFontFamilies[$"{fontName}"], 12f, FontStyle.Regular, GraphicsUnit.Pixel)); case fontType.Button: return(new Font(RobotoFontFamilies[$"{fontName}"], 14f, FontStyle.Bold, GraphicsUnit.Pixel)); case fontType.Caption: return(new Font(RobotoFontFamilies[$"{fontName}"], 12f, FontStyle.Regular, GraphicsUnit.Pixel)); case fontType.Overline: return(new Font(RobotoFontFamilies[$"{fontName}"], 10f, FontStyle.Regular, GraphicsUnit.Pixel)); } return(new Font(RobotoFontFamilies[$"{fontName}"], 14f, FontStyle.Regular, GraphicsUnit.Pixel)); }
public Font getFontByType(fontType type) { switch (type) { case fontType.H1: return(new Font(RobotoFontFamilies["Roboto_Light"], 96f, FontStyle.Regular, GraphicsUnit.Pixel)); case fontType.H2: return(new Font(RobotoFontFamilies["Roboto_Light"], 60f, FontStyle.Regular, GraphicsUnit.Pixel)); case fontType.H3: return(new Font(RobotoFontFamilies["Roboto"], 48f, FontStyle.Bold, GraphicsUnit.Pixel)); case fontType.H4: return(new Font(RobotoFontFamilies["Roboto"], 34f, FontStyle.Bold, GraphicsUnit.Pixel)); case fontType.H5: return(new Font(RobotoFontFamilies["Roboto"], 24f, FontStyle.Bold, GraphicsUnit.Pixel)); case fontType.H6: return(new Font(RobotoFontFamilies["Roboto_Medium"], 20f, FontStyle.Bold, GraphicsUnit.Pixel)); case fontType.Subtitle1: return(new Font(RobotoFontFamilies["Roboto"], 16f, FontStyle.Regular, GraphicsUnit.Pixel)); case fontType.Subtitle2: return(new Font(RobotoFontFamilies["Roboto_Medium"], 14f, FontStyle.Bold, GraphicsUnit.Pixel)); case fontType.SubtleEmphasis: return(new Font(RobotoFontFamilies["Roboto"], 12f, FontStyle.Italic, GraphicsUnit.Pixel)); case fontType.Body1: return(new Font(RobotoFontFamilies["Roboto"], 14f, FontStyle.Regular, GraphicsUnit.Pixel)); case fontType.Body2: return(new Font(RobotoFontFamilies["Roboto"], 12f, FontStyle.Regular, GraphicsUnit.Pixel)); case fontType.Button: return(new Font(RobotoFontFamilies["Roboto"], 14f, FontStyle.Bold, GraphicsUnit.Pixel)); case fontType.Caption: return(new Font(RobotoFontFamilies["Roboto"], 12f, FontStyle.Regular, GraphicsUnit.Pixel)); case fontType.Overline: return(new Font(RobotoFontFamilies["Roboto"], 10f, FontStyle.Regular, GraphicsUnit.Pixel)); } return(new Font(RobotoFontFamilies["Roboto"], 14f, FontStyle.Regular, GraphicsUnit.Pixel)); }
/// <summary> /// Gets a Material Skin Logical Roboto Font given a standard material font type /// </summary> /// <param name="type">material design font type</param> /// <returns></returns> public IntPtr getLogFontByType(fontType type) { return(logicalFonts[Enum.GetName(typeof(fontType), type)]); }
/// <summary> /// Gets a Material Skin Logical Roboto Font given a standard material font type /// </summary> /// <param name="type">material design font type</param> /// <returns></returns> public IntPtr getLogFontByType(fontType type, RightToLeft RightToLeft = RightToLeft.No) { var rtl = (RightToLeft == RightToLeft.Yes) ? "_RTL" : ""; return(logicalFonts.Any(i => i.Key == $"{Enum.GetName(typeof(fontType), type)}{rtl}") ? logicalFonts.First(i => i.Key == $"{Enum.GetName(typeof(fontType), type)}{rtl}").Value : logicalFonts.First().Value); }