Exemplo n.º 1
0
        private Result GetTextSize(Mnemonic expression, IRuntime runtime)
        {
            var pp    = new PaintProvider();
            var path  = pp.GetPaintDevice().GetTextPath(GetArgument <String>("text", runtime).Value, 0, 0);
            var bound = path.Bounds;

            return(new Result(new LoplaList(
                                  new Number(Convert.ToInt32(bound.Width)),
                                  new Number(Convert.ToInt32(bound.Height)))));
        }
Exemplo n.º 2
0
        private Result GetTextInfo(Mnemonic expression, IRuntime runtime)
        {
            var pp      = new PaintProvider();
            var dev     = pp.GetPaintDevice();
            var metrics = dev.FontMetrics;

            var size = dev.MeasureText("!");

            return(new Result(new LoplaList(
                                  new Number((decimal)size),
                                  new Number((decimal)dev.TextSize)
                                  )
                              ));
        }