Пример #1
0
        protected void DrawTextRightVectorFont(DrawingContext drawingContext, string text, double x, double y, bool big)
        {
            Pen pen = new Pen();

            pen.Thickness = 2;
            pen.Brush     = brush;

            double vOffset;

            x = ConvertXPos(x + offsetX);
            y = ConvertYPos(y + offsetY);

            if (big)
            {
                vOffset = BigFontVOffset * 2;
            }
            else
            {
                vOffset = SmallFontVOffset * 2;
            }

            double width  = VectorStrokeFont.GetStringWidth(text, big ? BigFontVectorScale : SmallFontVectorScale);
            double height = VectorStrokeFont.GetStringHeight(text, big ? BigFontVectorScale : SmallFontVectorScale);

            VectorStrokeFont.DrawText(drawingContext, pen, text, new Point(x - width, y - (height / 2.0) + vOffset), big ? BigFontVectorScale : SmallFontVectorScale);
        }
Пример #2
0
        protected double TextWidthVectorFont(string text, bool big)
        {
            double width = VectorStrokeFont.GetStringWidth(text, big ? BigFontVectorScale : SmallFontVectorScale);

            if (ActualWidth > 0)
            {
                return(width / (ActualWidth / 2.0));
            }
            else
            {
                return(0);
            }
        }
Пример #3
0
        protected double TextHeightVectorFont(bool big)

        {
            double height = (VectorStrokeFont.MaxCharacterHeight(big ? BigFontVectorScale : SmallFontVectorScale));

            if (ActualHeight > 0)
            {
                return(height / (ActualHeight / 2));
            }
            else
            {
                return(0);
            }
        }