David PHAM-VAN

Depreciate Font.stringSize

... ... @@ -3,6 +3,7 @@
## 3.7.0
- Move files
- Depreciate Font.stringSize
## 3.6.6
... ...
... ... @@ -18,6 +18,7 @@ import 'dart:math' as math;
import 'package:meta/meta.dart';
import '../point.dart';
import '../rect.dart';
/// Describe dimensions for glyphs in a font
... ... @@ -130,6 +131,9 @@ class PdfFontMetrics {
/// Ending point
double get rightBearing => advanceWidth - right;
/// Get the unit size of this string
PdfPoint get size => PdfPoint(width, height);
@override
String toString() =>
'PdfFontMetrics(left:$left, top:$top, right:$right, bottom:$bottom, ascent:$ascent, descent:$descent, advanceWidth:$advanceWidth, leftBearing:$leftBearing, rightBearing:$rightBearing)';
... ...
... ... @@ -181,11 +181,9 @@ See https://github.com/DavBfr/dart_pdf/wiki/Fonts-Management
}
}
/// Calculage the unit size of this string
PdfPoint stringSize(String s) {
final metrics = stringMetrics(s);
return PdfPoint(metrics.width, metrics.height);
}
/// Calculate the unit size of this string
@Deprecated('Use stringMetrics(s).size instead.')
PdfPoint stringSize(String s) => stringMetrics(s).size;
@override
String toString() => 'Font($fontName)';
... ...