David PHAM-VAN

Update demo favicons

... ... @@ -55,3 +55,4 @@ cache_*
package.json
GeneratedPluginRegistrant.*
test/social_preview.png
... ...
... ... @@ -267,6 +267,7 @@ ref: svg
cd $@; curl -OL 'https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf'
gh-pages: all
cd test; $(DART_BIN) --enable-asserts github_social_preview.dart
cd demo; $(FLUTTER_BIN) build web
git checkout gh-pages
rm -rf assets icons
... ...
... ... @@ -40,3 +40,5 @@ assets/*.png
assets/*.jpg
assets/logo.svg
linux
web/*.png
... ...
... ... @@ -21,7 +21,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="printing_demo">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<link rel="apple-touch-icon" href="icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
... ...
... ... @@ -10,12 +10,12 @@
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"src": "icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"src": "icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
... ...
... ... @@ -68,7 +68,7 @@ Future<void> main() async {
),
),
// Add a vertical separator
Container(width: 5 * px, color: PdfColors.lightBlue),
VerticalDivider(width: 5 * px, color: PdfColors.lightBlue),
// Show "Hello World!" centered and rotated on the second half of the page
Flexible(
fit: FlexFit.tight,
... ... @@ -95,8 +95,62 @@ Future<void> main() async {
await File('social_preview.pdf').writeAsBytes(await pdf.save());
// Convert to png
Process.runSync('pdftocairo',
['social_preview.pdf', '-png', '-r', '72', 'social_preview.png']);
Process.runSync('pdftocairo', [
'social_preview.pdf',
'-png',
'-singlefile',
'-r',
dpi.toString(),
'social_preview',
]);
// Generate some favicons
Document.debug = false;
// Create a pdf document
final favicon = Document();
favicon.addPage(
Page(
pageFormat: PdfPageFormat(512, 512),
build: (context) => Center(child: PdfLogo()),
),
);
await File('favicon.pdf').writeAsBytes(await favicon.save());
// Convert to png
Process.runSync('pdftocairo', [
'favicon.pdf',
'-png',
'-singlefile',
'-transp',
'-r',
dpi.toString(),
'../demo/web/icon-512',
]);
Process.runSync('pdftocairo', [
'favicon.pdf',
'-png',
'-singlefile',
'-transp',
'-scale-to',
'192',
'-r',
dpi.toString(),
'../demo/web/icon-192',
]);
Process.runSync('pdftocairo', [
'favicon.pdf',
'-png',
'-singlefile',
'-transp',
'-scale-to',
'16',
'-r',
dpi.toString(),
'../demo/web/favicon',
]);
}
class SyntaxHighlighterStyle {
... ...