Exemple #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);
 }
Exemple #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));
     }
 }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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;
        }
        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;
        }
Exemple #7
0
 public override CharFont GetCharFont(ITeXFont texFont) => texFont.GetCharInfo(Name, TexStyle.Display).GetCharacterFont();
Exemple #8
0
 public override Result <CharFont> GetCharFont(ITeXFont texFont) =>
 Result.Ok(this.CharFont);
Exemple #9
0
 public TexEnvironment(TexStyle style, ITeXFont mathFont, ITeXFont textFont)
     : this(style, mathFont, textFont, null, null)
 {
 }
Exemple #10
0
 /// <summary>Returns the symbol rendered by font.</summary>
 public abstract Result <CharFont> GetCharFont(ITeXFont texFont);
Exemple #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;
Exemple #12
0
 /// <summary>Returns a <see cref="CharInfo"/> for this character.</summary>
 protected abstract Result <CharInfo> GetCharInfo(ITeXFont font, TexStyle style);
Exemple #13
0
 public override Result <CharFont> GetCharFont(ITeXFont texFont) =>
 // Style is irrelevant here.
 texFont.GetCharInfo(this.Name, TexStyle.Display).Map(ci => ci.GetCharacterFont());
Exemple #14
0
 public TexEnvironment(TexStyle style, ITeXFont texFont)
     : this(style, texFont, null, null)
 {
 }
Exemple #15
0
 private CharInfo GetCharInfo(ITeXFont texFont, TexStyle style) =>
 TextStyle is null
         ? texFont.GetDefaultCharInfo(Character, style)
         : texFont.GetCharInfo(Character, TextStyle, style);
Exemple #16
0
 public abstract CharFont GetCharFont(ITeXFont texFont);
Exemple #17
0
 public override CharFont GetCharFont(ITeXFont texFont) => CharFont;
Exemple #18
0
 public TexEnvironment(TexStyle style, ITeXFont texFont)
     : this(style, texFont, null, null)
 {
 }
 public CharFont GetCharFont(ITeXFont texFont)
 {
     return(((CharSymbol)this.Atom).GetCharFont(texFont));
 }
Exemple #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);
Exemple #21
0
 public CharFont GetCharFont(ITeXFont texFont)
 {
     return ((CharSymbol)this.Atom).GetCharFont(texFont);
 }
Exemple #22
0
 public override CharFont GetCharFont(ITeXFont texFont)
 {
     // Style is irrelevant here.
     return GetCharInfo(texFont, TexStyle.Display).GetCharacterFont();
 }
Exemple #23
0
 public CharFont GetCharFont(ITeXFont texFont) => ((CharSymbol)Atom).GetCharFont(texFont);
Exemple #24
0
 protected override Result <CharInfo> GetCharInfo(ITeXFont font, TexStyle style) =>
 font.GetCharInfo(this.Name, style);
Exemple #25
0
 public override CharFont GetCharFont(ITeXFont texFont)
 {
     return(this.CharFont);
 }
Exemple #26
0
 public abstract CharFont GetCharFont(ITeXFont texFont);
Exemple #27
0
 public override CharFont GetCharFont(ITeXFont texFont)
 {
     // Style is irrelevant here.
     return(texFont.GetCharInfo(Name, TexStyle.Display).GetCharacterFont());
 }
Exemple #28
0
 public Result <CharFont> GetCharFont(ITeXFont texFont) =>
 ((CharSymbol)this.Atom).GetCharFont(texFont);
Exemple #29
0
 public override CharFont GetCharFont(ITeXFont texFont)
 {
     return this.CharFont;
 }