Exemplo n.º 1
0
 public RadicalDisplay(ListDisplay <TFont, TGlyph> innerDisplay, IGlyphDisplay <TFont, TGlyph> glyph, PointF position, Range range)
 {
     Radicand      = innerDisplay;
     _radicalGlyph = glyph;
     Position      = position;
     Range         = range;
 }
Exemplo n.º 2
0
 public InnerDisplay(ListDisplay <TFont, TGlyph> inner, IGlyphDisplay <TFont, TGlyph>?left, IGlyphDisplay <TFont, TGlyph>?right, Range range)
 {
     Inner = inner;
     Left  = left;
     Right = right;
     Range = range;
 }
Exemplo n.º 3
0
 public FractionDisplay(ListDisplay <TFont, TGlyph> numeratorDisplay, ListDisplay <TFont, TGlyph> denominatorDisplay, PointF currentPosition, Range range)
 {
     Numerator   = numeratorDisplay;
     Denominator = denominatorDisplay;
     _position   = currentPosition;
     Range       = range;
     UpdateNumeratorAndDenominatorPositions();
 }
Exemplo n.º 4
0
 public LargeOpLimitsDisplay(IDisplay <TFont, TGlyph> nucleusDisplay,
                             ListDisplay <TFont, TGlyph>?upperLimit,
                             float upperLimitGap,
                             ListDisplay <TFont, TGlyph>?lowerLimit,
                             float lowerLimitGap,
                             float limitShift,
                             int extraPadding)
 {
     NucleusDisplay = nucleusDisplay;
     UpperLimit     = upperLimit;
     _upperLimitGap = upperLimitGap;
     LowerLimit     = lowerLimit;
     _lowerLimitGap = lowerLimitGap;
     _limitShift    = limitShift;
     _extraPadding  = extraPadding; // corresponds to \xi_13 in TeX.
     Width          =
         Math.Max(nucleusDisplay?.Width ?? 0f,
                  Math.Max(upperLimit?.Width ?? 0f, lowerLimit?.Width ?? 0f));
     UpdateComponentPositions();
 }
Exemplo n.º 5
0
        public void SetDegree(ListDisplay <TFont, TGlyph> degree, TFont degreeFont, FontMathTable <TFont, TGlyph> degreeFontMathTable)
        {
            var kernBefore = degreeFontMathTable.RadicalKernBeforeDegree(degreeFont);

            Degree        = degree;
            _radicalShift = kernBefore + degree.Width +
                            degreeFontMathTable.RadicalKernAfterDegree(degreeFont);
            if (_radicalShift < 0)
            {
                kernBefore   -= _radicalShift;
                _radicalShift = 0;
            }

            // Position of degree is relative to parent.
            Degree.Position =
                new PointF(Position.X + kernBefore, Position.Y +
                           degreeFontMathTable.RadicalDegreeBottomRaise(degreeFont) * (Ascent - Descent));
            // update the width by the _radicalShift
            Width = _radicalShift + _radicalGlyph.Width + Radicand.Width;
            UpdateRadicandPosition();
        }