Exemplo n.º 1
0
        public static TextGeometryModel ScaleModel(this TextGeometryModel model, double scaleFactor)
        {
            var targetModel = new TextGeometryModel(ScaleBoundingBox(model.PageBox, scaleFactor), GridUnit.ByResolution(Round(model.GridUnit.Divisor * scaleFactor)));

            ModelGeometryTransformer.TransformModelGeometry(model, targetModel,
                                                            box => ScaleBoundingBox(box, scaleFactor));
            return(targetModel);
        }
Exemplo n.º 2
0
 public static GridUnitsTranslator GetUnitsTranslator(GridUnit sourceUnit, GridUnit targetUnit, RoundMode roundMode = RoundMode.Round)
 {
     return(new GridUnitsTranslator(sourceUnit, targetUnit, roundMode));
 }
Exemplo n.º 3
0
 public GridUnitsTranslator(GridUnit sourceUnit, GridUnit targetUnit, RoundMode roundMode = RoundMode.Round)
 {
     this.roundMode = roundMode;
     multiplier     = (double)targetUnit.Divisor / sourceUnit.Divisor;
 }
Exemplo n.º 4
0
 public TextGeometryModel(BoundingBox pageBox, GridUnit gridUnit)
 {
     this.pageBox  = pageBox;
     this.gridUnit = gridUnit;
 }