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); }
public static GridUnitsTranslator GetUnitsTranslator(GridUnit sourceUnit, GridUnit targetUnit, RoundMode roundMode = RoundMode.Round) { return(new GridUnitsTranslator(sourceUnit, targetUnit, roundMode)); }
public GridUnitsTranslator(GridUnit sourceUnit, GridUnit targetUnit, RoundMode roundMode = RoundMode.Round) { this.roundMode = roundMode; multiplier = (double)targetUnit.Divisor / sourceUnit.Divisor; }
public TextGeometryModel(BoundingBox pageBox, GridUnit gridUnit) { this.pageBox = pageBox; this.gridUnit = gridUnit; }