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
2023-11-10 16:47:57 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0a07c95b54bf8b27446a660b5eadee336dcb7ffa
0a07c95b
1 parent
aa9ca3bd
Fix empty lines text gap
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
3 deletions
pdf/CHANGELOG.md
pdf/lib/src/pdf/font/ttf_parser.dart
pdf/lib/src/pdf/obj/font.dart
pdf/lib/src/widgets/text.dart
pdf/pubspec.yaml
pdf/CHANGELOG.md
View file @
0a07c95
# Changelog
## 3.10.7
-
Fix empty lines text gap
## 3.10.6
-
Update bidi dependency
...
...
pdf/lib/src/pdf/font/ttf_parser.dart
View file @
0a07c95
...
...
@@ -19,9 +19,10 @@
import
'dart:convert'
;
import
'dart:math'
as
math
;
import
'dart:typed_data'
;
import
'package:meta/meta.dart'
;
import
'bidi_utils.dart'
as
bidi
;
import
'bidi_utils.dart'
as
bidi
;
import
'font_metrics.dart'
;
enum
TtfParserName
{
...
...
@@ -192,6 +193,8 @@ class TtfParser {
int
get
descent
=>
bytes
.
getInt16
(
tableOffsets
[
hhea_table
]!
+
6
);
int
get
lineGap
=>
bytes
.
getInt16
(
tableOffsets
[
hhea_table
]!
+
8
);
int
get
numOfLongHorMetrics
=>
bytes
.
getUint16
(
tableOffsets
[
hhea_table
]!
+
34
);
...
...
pdf/lib/src/pdf/obj/font.dart
View file @
0a07c95
...
...
@@ -282,6 +282,9 @@ See https://github.com/DavBfr/dart_pdf/wiki/Fonts-Management
/// Spans the distance between the baseline and the lowest descending glyph
double
get
descent
;
/// Height of an empty line
double
get
lineGap
=>
ascent
+
descent
;
/// Internal units per
int
get
unitsPerEm
;
...
...
pdf/lib/src/widgets/text.dart
View file @
0a07c95
...
...
@@ -1041,7 +1041,7 @@ class RichText extends Widget with SpanningWidget {
if
(
spanCount
>
0
)
{
offsetY
+=
bottom
-
top
;
}
else
{
offsetY
+=
space
.
ascent
+
space
.
descent
;
offsetY
+=
font
.
lineGap
*
style
.
fontSize
!
*
textScaleFactor
;
}
top
=
0
;
bottom
=
0
;
...
...
pdf/pubspec.yaml
View file @
0a07c95
...
...
@@ -12,7 +12,7 @@ topics:
-
print
-
printing
-
report
version
:
3.10.
6
version
:
3.10.
7
environment
:
sdk
:
"
>=2.18.0
<4.0.0"
...
...
Please
register
or
login
to post a comment