Example #1
0
        public static string ChangeFont(this Display.FrontEnd.IFontChanger fontChanger,
                                        string inputString, Atom.FontStyle outputFontStyle)
        {
            var builder = new System.Text.StringBuilder();

            foreach (var c in inputString)
            {
                int unicode = fontChanger.StyleCharacter(c, outputFontStyle);
                builder.Append(char.IsSurrogate(c)
          ? ((char)unicode).ToStringInvariant() : char.ConvertFromUtf32(unicode));
            }
            return(builder.ToString());
        }
 public void Style(TextAtom atom, Atom.FontStyle style) => Add(new TextAtom.Style(atom, style));
 public void Style(TextAtom atom, Atom.FontStyle style, int commandLength) =>
 Add(new TextAtom.Style(atom, style, TextLength, commandLength));