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:15:33 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a80a7c997eea5d0bf2b34ecf061992fbc94c2d69
a80a7c99
1 parent
9356d102
Add a default theme initializer
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
printing/CHANGELOG.md
printing/lib/printing.dart
printing/CHANGELOG.md
View file @
a80a7c9
...
...
@@ -8,6 +8,7 @@
-
Fix TTF font parser for NewsCycle-Regular.ttf
-
Fix AssetManifest
-
Update Google Fonts
-
Add a default theme initializer
## 5.6.6
...
...
printing/lib/printing.dart
View file @
a80a7c9
...
...
@@ -14,6 +14,10 @@
* limitations under the License.
*/
import
'package:pdf/widgets.dart'
;
import
'src/fonts/gfonts.dart'
;
export
'src/asset_utils.dart'
;
export
'src/cache.dart'
;
export
'src/callback.dart'
;
...
...
@@ -25,3 +29,27 @@ export 'src/printing.dart';
export
'src/printing_info.dart'
;
export
'src/raster.dart'
;
export
'src/widget_wrapper.dart'
;
Future
<
void
>
pdfDefaultTheme
()
async
{
if
(
ThemeData
.
buildThemeData
!=
null
)
{
return
;
}
final
base
=
await
PdfGoogleFonts
.
openSansRegular
();
final
bold
=
await
PdfGoogleFonts
.
openSansBold
();
final
italic
=
await
PdfGoogleFonts
.
openSansItalic
();
final
boldItalic
=
await
PdfGoogleFonts
.
openSansBoldItalic
();
final
emoji
=
await
PdfGoogleFonts
.
notoColorEmoji
();
final
icons
=
await
PdfGoogleFonts
.
materialIcons
();
ThemeData
.
buildThemeData
=
()
{
return
ThemeData
.
withFont
(
base:
base
,
bold:
bold
,
italic:
italic
,
boldItalic:
boldItalic
,
icons:
icons
,
fontFallback:
[
emoji
,
base
],
);
};
}
...
...
Please
register
or
login
to post a comment