Ejemplo n.º 1
0
        public static string GetRawPrintString(string str, PrintFontType fontType = PrintFontType.Normal, bool addLineFeed = true)
        {
            string rawStr = string.Empty;

            switch (fontType)
            {
            case PrintFontType.Expand:
                rawStr = string.Format("{0}{1}{2}", (char)18, (char)14, str);
                break;

            case PrintFontType.Contract:
                rawStr = string.Format("{0}{1}{2}", (char)18, (char)15, str);
                break;

            case PrintFontType.Bold:
                rawStr = string.Format("{0}{1}{2}", (char)27, (char)69, str);
                break;

            case PrintFontType.Normal:
                rawStr = string.Format("{0}{1}{2}{3}", (char)18, (char)27, (char)70, str);
                break;

            default:
                rawStr = string.Format("{0}{1}", (char)18, str);
                break;
            }

            if (addLineFeed)
            {
                rawStr += "\n";
            }

            return(rawStr);
        }
Ejemplo n.º 2
0
 public FontInfo GetFont(PrintFontType fontType)
 {
     return(_fonts[(int)fontType]);
 }
Ejemplo n.º 3
0
        public void SetFont(FontInfo info, PrintFontType fontType)
        {
            string val = info.Serialize();

            _fontsAndBackgrounds.Set(fontType.ToString(), val);
        }
Ejemplo n.º 4
0
        public FontInfo GetFont(PrintFontType fontType)
        {
            string def = (int)fontType < DefaultFonts.Length ? DefaultFonts [(int)fontType] : "";

            return(new FontInfo(_fontsAndBackgrounds.Get(fontType.ToString(), def)));
        }