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
2019-03-27 19:59:44 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cfcd69cd5f4fcc120c003a71aa6ee6e79604b1d5
cfcd69cd
1 parent
f602ad25
Add bold TTF test font
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
Makefile
pdf/test/ttf_test.dart
pdf/test/widget_test.dart
Makefile
View file @
cfcd69c
...
...
@@ -15,13 +15,16 @@
DART_SRC
=
$(
shell
find . -name
'*.dart'
)
CLNG_SRC
=
$(
shell
find printing/ios -name
'*.java'
-o -name
'*.m'
-o -name
'*.h'
)
$(
shell
find printing/android -name
'*.java'
-o -name
'*.m'
-o -name
'*.h'
)
SWFT_SRC
=
$(
shell
find . -name
'*.swift'
)
FONTS
=
pdf/open-sans.ttf pdf/roboto.ttf pdf/noto-sans.ttf pdf/genyomintw.ttf
FONTS
=
pdf/open-sans.ttf pdf/
open-sans-bold.ttf pdf/
roboto.ttf pdf/noto-sans.ttf pdf/genyomintw.ttf
all
:
$(FONTS) format
pdf/open-sans.ttf
:
curl -L
"https://github.com/google/fonts/raw/master/apache/opensans/OpenSans-Regular.ttf"
>
$@
pdf/open-sans-bold.ttf
:
curl -L
"https://github.com/google/fonts/raw/master/apache/opensans/OpenSans-Bold.ttf"
>
$@
pdf/roboto.ttf
:
curl -L
"https://github.com/google/fonts/raw/master/apache/robotomono/RobotoMono-Regular.ttf"
>
$@
...
...
pdf/test/ttf_test.dart
View file @
cfcd69c
...
...
@@ -68,6 +68,7 @@ void main() {
const
String
s
=
'Hello Lukáča '
;
printTextTtf
(
g
,
s
,
File
(
'open-sans.ttf'
),
30.0
+
30.0
*
top
++);
printTextTtf
(
g
,
s
,
File
(
'open-sans-bold.ttf'
),
30.0
+
30.0
*
top
++);
printTextTtf
(
g
,
s
,
File
(
'roboto.ttf'
),
30.0
+
30.0
*
top
++);
printTextTtf
(
g
,
s
,
File
(
'noto-sans.ttf'
),
30.0
+
30.0
*
top
++);
printTextTtf
(
g
,
'你好 檯號 '
,
File
(
'genyomintw.ttf'
),
30.0
+
30.0
*
top
++);
...
...
pdf/test/widget_test.dart
View file @
cfcd69c
...
...
@@ -16,6 +16,7 @@
import
'dart:convert'
;
import
'dart:io'
;
import
'dart:typed_data'
;
import
'package:pdf/pdf.dart'
;
import
'package:pdf/widgets.dart'
;
...
...
@@ -25,7 +26,16 @@ void main() {
test
(
'Pdf Widgets'
,
()
{
Document
.
debug
=
true
;
final
Document
pdf
=
Document
(
title:
'Widgets Test'
);
final
Uint8List
defaultFont
=
File
(
'open-sans.ttf'
).
readAsBytesSync
();
final
Uint8List
defaultFontBold
=
File
(
'open-sans-bold.ttf'
).
readAsBytesSync
();
final
Document
pdf
=
Document
(
title:
'Widgets Test'
,
theme:
Theme
.
withFont
(
Font
.
ttf
(
defaultFont
.
buffer
.
asByteData
()),
Font
.
ttf
(
defaultFontBold
.
buffer
.
asByteData
()),
));
final
TextStyle
symbol
=
TextStyle
(
font:
Font
.
zapfDingbats
());
...
...
Please
register
or
login
to post a comment