Example #1
0
 private CharInfo GetCharInfo(ITeXFont texFont, TexStyle style)
 {
     if (this.TextStyle == null)
         return texFont.GetDefaultCharInfo(this.Character, style);
     else
         return texFont.GetCharInfo(this.Character, this.TextStyle, style);
 }
Example #2
0
 private CharInfo GetCharInfo(ITeXFont texFont, TexStyle style)
 {
     if (this.TextStyle == null)
     {
         return(texFont.GetDefaultCharInfo(this.Character, style));
     }
     else
     {
         return(texFont.GetCharInfo(this.Character, this.TextStyle, style));
     }
 }
Example #3
0
        private TexEnvironment(TexStyle style, ITeXFont texFont, Brush background, Brush foreground)
        {
            if (style == TexStyle.Display || style == TexStyle.Text ||
                style == TexStyle.Script || style == TexStyle.ScriptScript)
                this.Style = style;
            else
                this.Style = TexStyle.Display;

            this.TexFont = texFont;
            this.Background = background;
            this.Foreground = foreground;
        }
Example #4
0
        private TexEnvironment(TexStyle style, ITeXFont mathFont, ITeXFont textFont, Brush background, Brush foreground)
        {
            if (style == TexStyle.Display || style == TexStyle.Text ||
                style == TexStyle.Script || style == TexStyle.ScriptScript)
                this.Style = style;
            else
                this.Style = TexStyle.Display;

            this.MathFont = mathFont;
            TextFont = textFont;
            this.Background = background;
            this.Foreground = foreground;
        }
Example #5
0
        private TexEnvironment(TexStyle style, ITeXFont texFont, Brush background, Brush foreground)
        {
            if (style == TexStyle.Display || style == TexStyle.Text ||
                style == TexStyle.Script || style == TexStyle.ScriptScript)
            {
                this.Style = style;
            }
            else
            {
                this.Style = TexStyle.Display;
            }

            this.TexFont    = texFont;
            this.Background = background;
            this.Foreground = foreground;
        }
Example #6
0
        public TexEnvironment(
            TexStyle style,
            ITeXFont mathFont,
            ITeXFont textFont,
            Brush?background = null,
            Brush?foreground = null)
        {
            if (style == TexStyle.Display || style == TexStyle.Text ||
                style == TexStyle.Script || style == TexStyle.ScriptScript)
            {
                this.Style = style;
            }
            else
            {
                this.Style = TexStyle.Display;
            }

            this.MathFont   = mathFont;
            TextFont        = textFont;
            this.Background = background;
            this.Foreground = foreground;
        }
Example #7
0
 public override CharFont GetCharFont(ITeXFont texFont) => texFont.GetCharInfo(Name, TexStyle.Display).GetCharacterFont();
Example #8
0
 public override Result <CharFont> GetCharFont(ITeXFont texFont) =>
 Result.Ok(this.CharFont);
Example #9
0
 public TexEnvironment(TexStyle style, ITeXFont mathFont, ITeXFont textFont)
     : this(style, mathFont, textFont, null, null)
 {
 }
Example #10
0
 /// <summary>Returns the symbol rendered by font.</summary>
 public abstract Result <CharFont> GetCharFont(ITeXFont texFont);
Example #11
0
 /// <summary>Checks if the symbol can be rendered by font.</summary>
 public bool IsSupportedByFont(ITeXFont font, TexStyle style) =>
 this.GetCharInfo(font, style).IsSuccess;
Example #12
0
 /// <summary>Returns a <see cref="CharInfo"/> for this character.</summary>
 protected abstract Result <CharInfo> GetCharInfo(ITeXFont font, TexStyle style);
Example #13
0
 public override Result <CharFont> GetCharFont(ITeXFont texFont) =>
 // Style is irrelevant here.
 texFont.GetCharInfo(this.Name, TexStyle.Display).Map(ci => ci.GetCharacterFont());
Example #14
0
 public TexEnvironment(TexStyle style, ITeXFont texFont)
     : this(style, texFont, null, null)
 {
 }
Example #15
0
 private CharInfo GetCharInfo(ITeXFont texFont, TexStyle style) =>
 TextStyle is null
         ? texFont.GetDefaultCharInfo(Character, style)
         : texFont.GetCharInfo(Character, TextStyle, style);
Example #16
0
 public abstract CharFont GetCharFont(ITeXFont texFont);
Example #17
0
 public override CharFont GetCharFont(ITeXFont texFont) => CharFont;
Example #18
0
 public TexEnvironment(TexStyle style, ITeXFont texFont)
     : this(style, texFont, null, null)
 {
 }
 public CharFont GetCharFont(ITeXFont texFont)
 {
     return(((CharSymbol)this.Atom).GetCharFont(texFont));
 }
Example #20
0
 protected override Result <CharInfo> GetCharInfo(ITeXFont texFont, TexStyle style) =>
 this.IsDefaultTextStyle
         ? texFont.GetDefaultCharInfo(this.Character, style)
         : texFont.GetCharInfo(this.Character, this.TextStyle, style);
Example #21
0
 public CharFont GetCharFont(ITeXFont texFont)
 {
     return ((CharSymbol)this.Atom).GetCharFont(texFont);
 }
Example #22
0
 public override CharFont GetCharFont(ITeXFont texFont)
 {
     // Style is irrelevant here.
     return GetCharInfo(texFont, TexStyle.Display).GetCharacterFont();
 }
Example #23
0
 public CharFont GetCharFont(ITeXFont texFont) => ((CharSymbol)Atom).GetCharFont(texFont);
Example #24
0
 protected override Result <CharInfo> GetCharInfo(ITeXFont font, TexStyle style) =>
 font.GetCharInfo(this.Name, style);
Example #25
0
 public override CharFont GetCharFont(ITeXFont texFont)
 {
     return(this.CharFont);
 }
Example #26
0
 public abstract CharFont GetCharFont(ITeXFont texFont);
Example #27
0
 public override CharFont GetCharFont(ITeXFont texFont)
 {
     // Style is irrelevant here.
     return(texFont.GetCharInfo(Name, TexStyle.Display).GetCharacterFont());
 }
Example #28
0
 public Result <CharFont> GetCharFont(ITeXFont texFont) =>
 ((CharSymbol)this.Atom).GetCharFont(texFont);
Example #29
0
 public override CharFont GetCharFont(ITeXFont texFont)
 {
     return this.CharFont;
 }