Beispiel #1
0
        bool ReadWidthLimitWidth()
        {
            if (_rightToLeft)
            {
                if (_index < 0)
                {
                    return(false);
                }

                //read current
                UnscaledGlyphPlan unscale = _seq[_index];

                short scaled_advW    = (short)Math.Round(unscale.AdvanceX * _pxscale);
                short scaled_offsetX = (short)Math.Round(unscale.OffsetX * _pxscale);
                short scaled_offsetY = (short)Math.Round(unscale.OffsetY * _pxscale);

                if (_accW + scaled_advW > _limitW)
                {
                    //stop
                    return(false);
                }

                _exactX = _accW + scaled_offsetX;
                _exactY = scaled_offsetY;
                _accW  += scaled_advW;

                _currentGlyphIndex = unscale.glyphIndex;
                _index--;
                return(true);
            }
            else
            {
                if (_index >= _end)
                {
                    return(false);
                }

                //read current
                UnscaledGlyphPlan unscale = _seq[_index];

                short scaled_advW    = (short)Math.Round(unscale.AdvanceX * _pxscale);
                short scaled_offsetX = (short)Math.Round(unscale.OffsetX * _pxscale);
                short scaled_offsetY = (short)Math.Round(unscale.OffsetY * _pxscale);

                if (_accW + scaled_advW > _limitW)
                {
                    //stop
                    return(false);
                }

                _exactX = _accW + scaled_offsetX;
                _exactY = scaled_offsetY;
                _accW  += scaled_advW;

                _currentGlyphIndex = unscale.glyphIndex;
                _index++;
                return(true);
            }
        }
        public bool Read()
        {
            if (_index >= _end)
            {
                return(false);
            }

            //read current
            UnscaledGlyphPlan unscale = _seq[_index];

            float scaled_advW = unscale.AdvanceX * _pxscale;

            _exactX            = _accW + (unscale.AdvanceX + unscale.OffsetX) * _pxscale;
            _exactY            = unscale.OffsetY * _pxscale;
            _accW             += scaled_advW;
            _currentGlyphIndex = unscale.glyphIndex;
            _index++;
            return(true);
        }
        //
        public bool Read()
        {
            if (_index >= _end)
            {
                return(false);
            }

            //read current
            UnscaledGlyphPlan unscale = _seq[_index];

            short scaled_advW    = (short)Math.Round(unscale.AdvanceX * _pxscale);
            short scaled_offsetX = (short)Math.Round(unscale.OffsetX * _pxscale);
            short scaled_offsetY = (short)Math.Round(unscale.OffsetY * _pxscale);

            _exactX = _accW + scaled_offsetX;
            _exactY = scaled_offsetY;
            _accW  += scaled_advW;

            _currentGlyphIndex = unscale.glyphIndex;
            _index++;
            return(true);
        }
Beispiel #4
0
 public void Append(UnscaledGlyphPlan glyphPlan)
 {
     _glyphPlans.Add(glyphPlan);
     _accumAdvanceX += glyphPlan.AdvanceX;
 }
Beispiel #5
0
 public void Append(UnscaledGlyphPlan glyphPlan)
 {
     _list.Add(glyphPlan);
 }