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