示例#1
0
        public void PrepareStringForRenderVx(RenderVxFormattedString renderVx, char[] text, int startAt, int len)
        {
            //1. update some props..
            //2. update current type face
            UpdateTypefaceAndGlyphBuilder();
            Typeface typeface = _currentTypeface;// _glyphPathBuilder.Typeface;

            _glyphLayout.Typeface = typeface;
            _glyphLayout.Layout(text, startAt, len);
            //
            //3. scale from design unit to specific font size
            _outputGlyphPlans.Clear();
            _pxScaleEngine.Layout(_glyphLayout.ResultUnscaledGlyphPositions, _outputGlyphPlans);
            TextPrinterHelper.CopyGlyphPlans(renderVx, _outputGlyphPlans, this._currentFontSizePxScale);
        }
        public void PrepareStringForRenderVx(RenderVxFormattedString renderVx, char[] text, int startAt, int len)
        {
            //1. update some props..
            //2. update current type face
            UpdateTypefaceAndGlyphBuilder();
            Typeface typeface = _currentTypeface;// _glyphPathBuilder.Typeface;
            //3. layout glyphs with selected layout technique
            //TODO: review this again, we should use pixel?

            float pxscale = typeface.CalculateToPixelScaleFromPointSize(FontSizeInPoints);

            _outputGlyphPlans.Clear();
            _glyphLayout.Layout(typeface, text, startAt, len, _outputGlyphPlans);
            TextPrinterHelper.CopyGlyphPlans(renderVx, _outputGlyphPlans, pxscale);
        }