Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
David PHAM-VAN
2021-12-31 13:07:03 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8ab8ebe3e693f92bebe1c2d9e9aa57cfda666588
8ab8ebe3
1 parent
75feddd2
Depreciate Font.stringSize
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
pdf/CHANGELOG.md
pdf/lib/src/pdf/font/font_metrics.dart
pdf/lib/src/pdf/obj/font.dart
pdf/CHANGELOG.md
View file @
8ab8ebe
...
...
@@ -3,6 +3,7 @@
## 3.7.0
-
Move files
-
Depreciate Font.stringSize
## 3.6.6
...
...
pdf/lib/src/pdf/font/font_metrics.dart
View file @
8ab8ebe
...
...
@@ -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
)'
;
...
...
pdf/lib/src/pdf/obj/font.dart
View file @
8ab8ebe
...
...
@@ -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
)'
;
...
...
Please
register
or
login
to post a comment