From 8135a9f42e56b7efa91c0eb2b77209d0b5060f5f Mon Sep 17 00:00:00 2001
From: Ikiru Yoshizaki <3856350+guitarrapc@users.noreply.github.com>
Date: Thu, 26 Nov 2020 04:32:19 +0900
Subject: [PATCH 1/8] fix: libskiasharp dependency
---
src/SkiaSharp.QrCode/SkiaSharp.QrCode.csproj | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/SkiaSharp.QrCode/SkiaSharp.QrCode.csproj b/src/SkiaSharp.QrCode/SkiaSharp.QrCode.csproj
index c30997b..b6918b8 100644
--- a/src/SkiaSharp.QrCode/SkiaSharp.QrCode.csproj
+++ b/src/SkiaSharp.QrCode/SkiaSharp.QrCode.csproj
@@ -23,7 +23,6 @@
-
From eecdd42e980529458fdba3e879053b57ea376e3e Mon Sep 17 00:00:00 2001
From: Ikiru Yoshizaki <3856350+guitarrapc@users.noreply.github.com>
Date: Thu, 26 Nov 2020 04:32:49 +0900
Subject: [PATCH 2/8] chore: use NoDependencies package
---
samples/ManualGenerate/ManualGenerate.csproj | 2 ++
samples/SimpleGenerate/SimpleGenerate.csproj | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/samples/ManualGenerate/ManualGenerate.csproj b/samples/ManualGenerate/ManualGenerate.csproj
index d847a5b..8600849 100644
--- a/samples/ManualGenerate/ManualGenerate.csproj
+++ b/samples/ManualGenerate/ManualGenerate.csproj
@@ -6,7 +6,9 @@
+
+
diff --git a/samples/SimpleGenerate/SimpleGenerate.csproj b/samples/SimpleGenerate/SimpleGenerate.csproj
index 520ee42..58cafb4 100644
--- a/samples/SimpleGenerate/SimpleGenerate.csproj
+++ b/samples/SimpleGenerate/SimpleGenerate.csproj
@@ -7,8 +7,8 @@
-
+
From b947dd56c0a0bf474bf30735443b008cffc4c4b6 Mon Sep 17 00:00:00 2001
From: Ikiru Yoshizaki <3856350+guitarrapc@users.noreply.github.com>
Date: Thu, 26 Nov 2020 04:33:27 +0900
Subject: [PATCH 3/8] chore: add SKImageInfo Tests
---
.../GenerateUnitTest.cs | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tests/SkiaSharp.QrCode.Tests.net31/GenerateUnitTest.cs b/tests/SkiaSharp.QrCode.Tests.net31/GenerateUnitTest.cs
index 6ef45b6..af339d5 100644
--- a/tests/SkiaSharp.QrCode.Tests.net31/GenerateUnitTest.cs
+++ b/tests/SkiaSharp.QrCode.Tests.net31/GenerateUnitTest.cs
@@ -55,6 +55,25 @@ public void IconGenerateUnitTest()
Assert.True(actual.SequenceEqual(expect));
}
+ [Fact]
+ public void SKImageInfoTest()
+ {
+ var a = new SKImageInfo();
+ Assert.NotNull(a);
+ var b = new SKImageInfo(100, 100);
+ Assert.NotNull(b);
+ foreach (SKColorType colorType in Enum.GetValues(typeof(SKColorType)))
+ {
+ var c = new SKImageInfo(100, 100, colorType);
+ Assert.NotNull(c);
+ foreach (SKAlphaType alphaType in Enum.GetValues(typeof(SKAlphaType)))
+ {
+ var d = new SKImageInfo(100, 100, colorType, alphaType);
+ Assert.NotNull(d);
+ }
+ }
+ }
+
private byte[] GenerateQrCode(string content, SKColor? color)
{
// Generate QrCode
From 026bdf199d0c63f42d8013969801a5a214ea13f0 Mon Sep 17 00:00:00 2001
From: Ikiru Yoshizaki <3856350+guitarrapc@users.noreply.github.com>
Date: Thu, 26 Nov 2020 04:34:26 +0900
Subject: [PATCH 4/8] chore: add samples BuildTest
---
.gitignore | 2 +
samples/BuildTest/3.1/BuildTest.csproj | 19 +++++++
samples/BuildTest/3.1/Program.cs | 54 +++++++++++++++++++
samples/BuildTest/3.1/entrypoint.sh | 13 +++++
samples/BuildTest/3.1/samples/test.png | Bin 0 -> 1566 bytes
samples/BuildTest/3.1_nodep/BuildTest.csproj | 18 +++++++
samples/BuildTest/3.1_nodep/Program.cs | 54 +++++++++++++++++++
samples/BuildTest/3.1_nodep/entrypoint.sh | 11 ++++
samples/BuildTest/3.1_nodep/samples/test.png | Bin 0 -> 1566 bytes
samples/BuildTest/5.0/BuildTest.csproj | 19 +++++++
samples/BuildTest/5.0/Program.cs | 54 +++++++++++++++++++
samples/BuildTest/5.0/entrypoint.sh | 13 +++++
samples/BuildTest/5.0/samples/test.png | Bin 0 -> 1566 bytes
samples/BuildTest/5.0_nodep/BuildTest.csproj | 18 +++++++
samples/BuildTest/5.0_nodep/Program.cs | 54 +++++++++++++++++++
samples/BuildTest/5.0_nodep/entrypoint.sh | 11 ++++
samples/BuildTest/5.0_nodep/samples/test.png | Bin 0 -> 1566 bytes
samples/BuildTest/docker-compose.yaml | 30 +++++++++++
18 files changed, 370 insertions(+)
create mode 100644 samples/BuildTest/3.1/BuildTest.csproj
create mode 100644 samples/BuildTest/3.1/Program.cs
create mode 100644 samples/BuildTest/3.1/entrypoint.sh
create mode 100644 samples/BuildTest/3.1/samples/test.png
create mode 100644 samples/BuildTest/3.1_nodep/BuildTest.csproj
create mode 100644 samples/BuildTest/3.1_nodep/Program.cs
create mode 100644 samples/BuildTest/3.1_nodep/entrypoint.sh
create mode 100644 samples/BuildTest/3.1_nodep/samples/test.png
create mode 100644 samples/BuildTest/5.0/BuildTest.csproj
create mode 100644 samples/BuildTest/5.0/Program.cs
create mode 100644 samples/BuildTest/5.0/entrypoint.sh
create mode 100644 samples/BuildTest/5.0/samples/test.png
create mode 100644 samples/BuildTest/5.0_nodep/BuildTest.csproj
create mode 100644 samples/BuildTest/5.0_nodep/Program.cs
create mode 100644 samples/BuildTest/5.0_nodep/entrypoint.sh
create mode 100644 samples/BuildTest/5.0_nodep/samples/test.png
create mode 100644 samples/BuildTest/docker-compose.yaml
diff --git a/.gitignore b/.gitignore
index e8ae8d0..4de44a0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -361,3 +361,5 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd
+# custom
+output/
\ No newline at end of file
diff --git a/samples/BuildTest/3.1/BuildTest.csproj b/samples/BuildTest/3.1/BuildTest.csproj
new file mode 100644
index 0000000..032fc03
--- /dev/null
+++ b/samples/BuildTest/3.1/BuildTest.csproj
@@ -0,0 +1,19 @@
+
+
+
+ Exe
+ netcoreapp3.1;net5.0
+
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
diff --git a/samples/BuildTest/3.1/Program.cs b/samples/BuildTest/3.1/Program.cs
new file mode 100644
index 0000000..dad664e
--- /dev/null
+++ b/samples/BuildTest/3.1/Program.cs
@@ -0,0 +1,54 @@
+using SkiaSharp;
+using System;
+using System.IO;
+using SkiaSharp.QrCode;
+using SkiaSharp.QrCode.Models;
+
+namespace SkiaQrCodeSampleConsole
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ Directory.CreateDirectory("output");
+
+ var content = "testtesttest";
+ using (var generator = new QRCodeGenerator())
+ {
+ // Generate QrCode
+ var qr = generator.CreateQrCode(content, ECCLevel.L);
+
+ // Render to canvas
+ var info = new SKImageInfo(512, 512);
+ using (var surface = SKSurface.Create(info))
+ {
+ var canvas = surface.Canvas;
+ canvas.Render(qr, info.Width, info.Height);
+
+ // gen color
+ // yellow https://rgb.to/yellow
+ canvas.Render(qr, info.Width, info.Height, SKColor.Empty, SKColor.FromHsl(60,100,50));
+ // red https://rgb.to/red
+ canvas.Render(qr, info.Width, info.Height, SKColor.Empty, SKColor.FromHsl(0, 100, 50));
+
+ // gen icon
+ var logo = File.ReadAllBytes("samples/test.png");
+ var icon = new IconData
+ {
+ Icon = SKBitmap.Decode(logo),
+ IconSizePercent = 10,
+ };
+ canvas.Render(qr, info.Width, info.Height, SKColor.Empty, SKColor.Parse("000000"), icon);
+
+ // Output to Stream -> File
+ using (var image = surface.Snapshot())
+ using (var data = image.Encode(SKEncodedImageFormat.Png, 100))
+ using (var stream = File.OpenWrite(@"output/hoge.png"))
+ {
+ data.SaveTo(stream);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/samples/BuildTest/3.1/entrypoint.sh b/samples/BuildTest/3.1/entrypoint.sh
new file mode 100644
index 0000000..7d177b0
--- /dev/null
+++ b/samples/BuildTest/3.1/entrypoint.sh
@@ -0,0 +1,13 @@
+#!/bin/bash -ex
+
+FRAMEWORK=netcoreapp3.1
+while [ $# -gt 0 ]; do
+ case $1 in
+ -f) FRAMEWORK=$2; shift 2; ;;
+ *) shift ;;
+ esac
+done
+
+apt update && apt install -y libfontconfig1
+
+dotnet run --csproj BuildTest.csproj -f "${FRAMEWORK}"
diff --git a/samples/BuildTest/3.1/samples/test.png b/samples/BuildTest/3.1/samples/test.png
new file mode 100644
index 0000000000000000000000000000000000000000..b8699ad7e9f61fb85436e30e86c1610e7e9b6b53
GIT binary patch
literal 1566
zcmeAS@N?(olHy`uVBq!ia0y~yU|a&i985rwk9x7%t_gLD&L)WUkj@R+|%s3%FJe6{i)CH*(UmwDD*11Fzl(j
t|NZY5K8F8uPSc^>gxdZ?nt|c}|BzRTrv8=tPXNn(22WQ%mvv4FO#u9-2u1(^
literal 0
HcmV?d00001
diff --git a/samples/BuildTest/3.1_nodep/BuildTest.csproj b/samples/BuildTest/3.1_nodep/BuildTest.csproj
new file mode 100644
index 0000000..e539ad5
--- /dev/null
+++ b/samples/BuildTest/3.1_nodep/BuildTest.csproj
@@ -0,0 +1,18 @@
+
+
+
+ Exe
+ netcoreapp3.1;net5.0
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
diff --git a/samples/BuildTest/3.1_nodep/Program.cs b/samples/BuildTest/3.1_nodep/Program.cs
new file mode 100644
index 0000000..dad664e
--- /dev/null
+++ b/samples/BuildTest/3.1_nodep/Program.cs
@@ -0,0 +1,54 @@
+using SkiaSharp;
+using System;
+using System.IO;
+using SkiaSharp.QrCode;
+using SkiaSharp.QrCode.Models;
+
+namespace SkiaQrCodeSampleConsole
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ Directory.CreateDirectory("output");
+
+ var content = "testtesttest";
+ using (var generator = new QRCodeGenerator())
+ {
+ // Generate QrCode
+ var qr = generator.CreateQrCode(content, ECCLevel.L);
+
+ // Render to canvas
+ var info = new SKImageInfo(512, 512);
+ using (var surface = SKSurface.Create(info))
+ {
+ var canvas = surface.Canvas;
+ canvas.Render(qr, info.Width, info.Height);
+
+ // gen color
+ // yellow https://rgb.to/yellow
+ canvas.Render(qr, info.Width, info.Height, SKColor.Empty, SKColor.FromHsl(60,100,50));
+ // red https://rgb.to/red
+ canvas.Render(qr, info.Width, info.Height, SKColor.Empty, SKColor.FromHsl(0, 100, 50));
+
+ // gen icon
+ var logo = File.ReadAllBytes("samples/test.png");
+ var icon = new IconData
+ {
+ Icon = SKBitmap.Decode(logo),
+ IconSizePercent = 10,
+ };
+ canvas.Render(qr, info.Width, info.Height, SKColor.Empty, SKColor.Parse("000000"), icon);
+
+ // Output to Stream -> File
+ using (var image = surface.Snapshot())
+ using (var data = image.Encode(SKEncodedImageFormat.Png, 100))
+ using (var stream = File.OpenWrite(@"output/hoge.png"))
+ {
+ data.SaveTo(stream);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/samples/BuildTest/3.1_nodep/entrypoint.sh b/samples/BuildTest/3.1_nodep/entrypoint.sh
new file mode 100644
index 0000000..2b27e45
--- /dev/null
+++ b/samples/BuildTest/3.1_nodep/entrypoint.sh
@@ -0,0 +1,11 @@
+#!/bin/bash -ex
+
+FRAMEWORK=netcoreapp3.1
+while [ $# -gt 0 ]; do
+ case $1 in
+ -f) FRAMEWORK=$2; shift 2; ;;
+ *) shift ;;
+ esac
+done
+
+dotnet run --csproj BuildTest.csproj -f "${FRAMEWORK}"
diff --git a/samples/BuildTest/3.1_nodep/samples/test.png b/samples/BuildTest/3.1_nodep/samples/test.png
new file mode 100644
index 0000000000000000000000000000000000000000..b8699ad7e9f61fb85436e30e86c1610e7e9b6b53
GIT binary patch
literal 1566
zcmeAS@N?(olHy`uVBq!ia0y~yU|a&i985rwk9x7%t_gLD&L)WUkj@R+|%s3%FJe6{i)CH*(UmwDD*11Fzl(j
t|NZY5K8F8uPSc^>gxdZ?nt|c}|BzRTrv8=tPXNn(22WQ%mvv4FO#u9-2u1(^
literal 0
HcmV?d00001
diff --git a/samples/BuildTest/5.0/BuildTest.csproj b/samples/BuildTest/5.0/BuildTest.csproj
new file mode 100644
index 0000000..032fc03
--- /dev/null
+++ b/samples/BuildTest/5.0/BuildTest.csproj
@@ -0,0 +1,19 @@
+
+
+
+ Exe
+ netcoreapp3.1;net5.0
+
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
diff --git a/samples/BuildTest/5.0/Program.cs b/samples/BuildTest/5.0/Program.cs
new file mode 100644
index 0000000..dad664e
--- /dev/null
+++ b/samples/BuildTest/5.0/Program.cs
@@ -0,0 +1,54 @@
+using SkiaSharp;
+using System;
+using System.IO;
+using SkiaSharp.QrCode;
+using SkiaSharp.QrCode.Models;
+
+namespace SkiaQrCodeSampleConsole
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ Directory.CreateDirectory("output");
+
+ var content = "testtesttest";
+ using (var generator = new QRCodeGenerator())
+ {
+ // Generate QrCode
+ var qr = generator.CreateQrCode(content, ECCLevel.L);
+
+ // Render to canvas
+ var info = new SKImageInfo(512, 512);
+ using (var surface = SKSurface.Create(info))
+ {
+ var canvas = surface.Canvas;
+ canvas.Render(qr, info.Width, info.Height);
+
+ // gen color
+ // yellow https://rgb.to/yellow
+ canvas.Render(qr, info.Width, info.Height, SKColor.Empty, SKColor.FromHsl(60,100,50));
+ // red https://rgb.to/red
+ canvas.Render(qr, info.Width, info.Height, SKColor.Empty, SKColor.FromHsl(0, 100, 50));
+
+ // gen icon
+ var logo = File.ReadAllBytes("samples/test.png");
+ var icon = new IconData
+ {
+ Icon = SKBitmap.Decode(logo),
+ IconSizePercent = 10,
+ };
+ canvas.Render(qr, info.Width, info.Height, SKColor.Empty, SKColor.Parse("000000"), icon);
+
+ // Output to Stream -> File
+ using (var image = surface.Snapshot())
+ using (var data = image.Encode(SKEncodedImageFormat.Png, 100))
+ using (var stream = File.OpenWrite(@"output/hoge.png"))
+ {
+ data.SaveTo(stream);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/samples/BuildTest/5.0/entrypoint.sh b/samples/BuildTest/5.0/entrypoint.sh
new file mode 100644
index 0000000..7d177b0
--- /dev/null
+++ b/samples/BuildTest/5.0/entrypoint.sh
@@ -0,0 +1,13 @@
+#!/bin/bash -ex
+
+FRAMEWORK=netcoreapp3.1
+while [ $# -gt 0 ]; do
+ case $1 in
+ -f) FRAMEWORK=$2; shift 2; ;;
+ *) shift ;;
+ esac
+done
+
+apt update && apt install -y libfontconfig1
+
+dotnet run --csproj BuildTest.csproj -f "${FRAMEWORK}"
diff --git a/samples/BuildTest/5.0/samples/test.png b/samples/BuildTest/5.0/samples/test.png
new file mode 100644
index 0000000000000000000000000000000000000000..b8699ad7e9f61fb85436e30e86c1610e7e9b6b53
GIT binary patch
literal 1566
zcmeAS@N?(olHy`uVBq!ia0y~yU|a&i985rwk9x7%t_gLD&L)WUkj@R+|%s3%FJe6{i)CH*(UmwDD*11Fzl(j
t|NZY5K8F8uPSc^>gxdZ?nt|c}|BzRTrv8=tPXNn(22WQ%mvv4FO#u9-2u1(^
literal 0
HcmV?d00001
diff --git a/samples/BuildTest/5.0_nodep/BuildTest.csproj b/samples/BuildTest/5.0_nodep/BuildTest.csproj
new file mode 100644
index 0000000..e539ad5
--- /dev/null
+++ b/samples/BuildTest/5.0_nodep/BuildTest.csproj
@@ -0,0 +1,18 @@
+
+
+
+ Exe
+ netcoreapp3.1;net5.0
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
diff --git a/samples/BuildTest/5.0_nodep/Program.cs b/samples/BuildTest/5.0_nodep/Program.cs
new file mode 100644
index 0000000..dad664e
--- /dev/null
+++ b/samples/BuildTest/5.0_nodep/Program.cs
@@ -0,0 +1,54 @@
+using SkiaSharp;
+using System;
+using System.IO;
+using SkiaSharp.QrCode;
+using SkiaSharp.QrCode.Models;
+
+namespace SkiaQrCodeSampleConsole
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ Directory.CreateDirectory("output");
+
+ var content = "testtesttest";
+ using (var generator = new QRCodeGenerator())
+ {
+ // Generate QrCode
+ var qr = generator.CreateQrCode(content, ECCLevel.L);
+
+ // Render to canvas
+ var info = new SKImageInfo(512, 512);
+ using (var surface = SKSurface.Create(info))
+ {
+ var canvas = surface.Canvas;
+ canvas.Render(qr, info.Width, info.Height);
+
+ // gen color
+ // yellow https://rgb.to/yellow
+ canvas.Render(qr, info.Width, info.Height, SKColor.Empty, SKColor.FromHsl(60,100,50));
+ // red https://rgb.to/red
+ canvas.Render(qr, info.Width, info.Height, SKColor.Empty, SKColor.FromHsl(0, 100, 50));
+
+ // gen icon
+ var logo = File.ReadAllBytes("samples/test.png");
+ var icon = new IconData
+ {
+ Icon = SKBitmap.Decode(logo),
+ IconSizePercent = 10,
+ };
+ canvas.Render(qr, info.Width, info.Height, SKColor.Empty, SKColor.Parse("000000"), icon);
+
+ // Output to Stream -> File
+ using (var image = surface.Snapshot())
+ using (var data = image.Encode(SKEncodedImageFormat.Png, 100))
+ using (var stream = File.OpenWrite(@"output/hoge.png"))
+ {
+ data.SaveTo(stream);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/samples/BuildTest/5.0_nodep/entrypoint.sh b/samples/BuildTest/5.0_nodep/entrypoint.sh
new file mode 100644
index 0000000..2b27e45
--- /dev/null
+++ b/samples/BuildTest/5.0_nodep/entrypoint.sh
@@ -0,0 +1,11 @@
+#!/bin/bash -ex
+
+FRAMEWORK=netcoreapp3.1
+while [ $# -gt 0 ]; do
+ case $1 in
+ -f) FRAMEWORK=$2; shift 2; ;;
+ *) shift ;;
+ esac
+done
+
+dotnet run --csproj BuildTest.csproj -f "${FRAMEWORK}"
diff --git a/samples/BuildTest/5.0_nodep/samples/test.png b/samples/BuildTest/5.0_nodep/samples/test.png
new file mode 100644
index 0000000000000000000000000000000000000000..b8699ad7e9f61fb85436e30e86c1610e7e9b6b53
GIT binary patch
literal 1566
zcmeAS@N?(olHy`uVBq!ia0y~yU|a&i985rwk9x7%t_gLD&L)WUkj@R+|%s3%FJe6{i)CH*(UmwDD*11Fzl(j
t|NZY5K8F8uPSc^>gxdZ?nt|c}|BzRTrv8=tPXNn(22WQ%mvv4FO#u9-2u1(^
literal 0
HcmV?d00001
diff --git a/samples/BuildTest/docker-compose.yaml b/samples/BuildTest/docker-compose.yaml
new file mode 100644
index 0000000..882fd64
--- /dev/null
+++ b/samples/BuildTest/docker-compose.yaml
@@ -0,0 +1,30 @@
+version: "3"
+
+services:
+ netcoreapp3.1:
+ image: mcr.microsoft.com/dotnet/core/sdk:3.1
+ command: bash -eux entrypoint.sh -f netcoreapp3.1
+ working_dir: /src
+ volumes:
+ - ./3.1/:/src
+
+ netcoreapp3.1_nodep:
+ image: mcr.microsoft.com/dotnet/core/sdk:3.1
+ command: bash -eux entrypoint.sh -f netcoreapp3.1
+ working_dir: /src
+ volumes:
+ - ./3.1_nodep/:/src
+
+ net5.0:
+ image: mcr.microsoft.com/dotnet/sdk:5.0
+ command: bash -eux entrypoint.sh -f net5.0
+ working_dir: /src
+ volumes:
+ - ./5.0:/src
+
+ net5.0__nodep:
+ image: mcr.microsoft.com/dotnet/sdk:5.0
+ command: bash -eux entrypoint.sh -f net5.0
+ working_dir: /src
+ volumes:
+ - ./5.0_nodep:/src
From 7d999c07efb571b8e13effe324fc23232e51e8c8 Mon Sep 17 00:00:00 2001
From: Ikiru Yoshizaki <3856350+guitarrapc@users.noreply.github.com>
Date: Thu, 26 Nov 2020 04:34:40 +0900
Subject: [PATCH 5/8] docs: add Linux TIPS
---
README.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 61 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index b61f28a..c4d07a6 100644
--- a/README.md
+++ b/README.md
@@ -105,12 +105,72 @@ namespace SkiaQrCodeSampleConsole
```
-## Build
+## TIPS
+### Linux support
+
+You have 2 choice to run on Linux. If you don't need font operation, use `SkiaSharp.NativeAssets.Linux.NoDependencies`.
+
+1. Use `SkiaSharp.NativeAssets.Linux` package. In this case, you need to install `libfontconfig1` via apt or others.
+1. Use `SkiaSharp.NativeAssets.Linux.NoDependencies` 2.80.2 or above. In this case, you don't need `libfontconfig1`.
+
+SkiaSharp.NativeAssets.Linux.NoDependencies still can draw text, however can't search font cased on character or other fonts.
+
+> Detail: https://github.com/mono/SkiaSharp/issues/964#issuecomment-549385484
+
+**SkiaSharp.NativeAssets.Linux sample**
+
+```shell
+sudo apt update && apt install -y libfontconfig1
```
+
+```csproj
+
+
+
+ Exe
+ netcoreapp3.1
+
+
+
+
+
+
+
+```
+
+**SkiaSharp.NativeAssets.Linux.NoDependencies sample**
+
+```csproj
+
+
+
+ Exe
+ netcoreapp3.1
+
+
+
+
+
+
+
+```
+
+### Docker Build & Run
+
+Test Build lib.
+
+```shell
docker build -t skiasharp.qrcode .
```
+Test Run on linux.
+
+```shell
+cd samples/RunTest
+docker-compose up
+```
+
## License
MIT
From 037a31b5cf55971af3c8faa0ba632a59f2f46f28 Mon Sep 17 00:00:00 2001
From: Ikiru Yoshizaki <3856350+guitarrapc@users.noreply.github.com>
Date: Thu, 26 Nov 2020 04:47:26 +0900
Subject: [PATCH 6/8] chore: use project reference to test build and run
---
.github/workflows/build.yaml | 7 +++++++
README.md | 2 +-
.../3.1/BuildTest.csproj | 0
.../{BuildTest => LinuxRunSamples}/3.1/Program.cs | 0
.../3.1/entrypoint.sh | 0
.../3.1/samples/test.png | Bin
.../3.1_nodep/BuildTest.csproj | 0
.../3.1_nodep/Program.cs | 0
.../3.1_nodep/entrypoint.sh | 0
.../3.1_nodep/samples/test.png | Bin
.../5.0/BuildTest.csproj | 0
.../{BuildTest => LinuxRunSamples}/5.0/Program.cs | 0
.../5.0/entrypoint.sh | 0
.../5.0/samples/test.png | Bin
.../5.0_nodep/BuildTest.csproj | 0
.../5.0_nodep/Program.cs | 0
.../5.0_nodep/entrypoint.sh | 0
.../5.0_nodep/samples/test.png | Bin
.../docker-compose.yaml | 0
samples/ManualGenerate/ManualGenerate.csproj | 7 +++++--
samples/SimpleGenerate/SimpleGenerate.csproj | 12 ++++++++++--
21 files changed, 23 insertions(+), 5 deletions(-)
rename samples/{BuildTest => LinuxRunSamples}/3.1/BuildTest.csproj (100%)
rename samples/{BuildTest => LinuxRunSamples}/3.1/Program.cs (100%)
rename samples/{BuildTest => LinuxRunSamples}/3.1/entrypoint.sh (100%)
rename samples/{BuildTest => LinuxRunSamples}/3.1/samples/test.png (100%)
rename samples/{BuildTest => LinuxRunSamples}/3.1_nodep/BuildTest.csproj (100%)
rename samples/{BuildTest => LinuxRunSamples}/3.1_nodep/Program.cs (100%)
rename samples/{BuildTest => LinuxRunSamples}/3.1_nodep/entrypoint.sh (100%)
rename samples/{BuildTest => LinuxRunSamples}/3.1_nodep/samples/test.png (100%)
rename samples/{BuildTest => LinuxRunSamples}/5.0/BuildTest.csproj (100%)
rename samples/{BuildTest => LinuxRunSamples}/5.0/Program.cs (100%)
rename samples/{BuildTest => LinuxRunSamples}/5.0/entrypoint.sh (100%)
rename samples/{BuildTest => LinuxRunSamples}/5.0/samples/test.png (100%)
rename samples/{BuildTest => LinuxRunSamples}/5.0_nodep/BuildTest.csproj (100%)
rename samples/{BuildTest => LinuxRunSamples}/5.0_nodep/Program.cs (100%)
rename samples/{BuildTest => LinuxRunSamples}/5.0_nodep/entrypoint.sh (100%)
rename samples/{BuildTest => LinuxRunSamples}/5.0_nodep/samples/test.png (100%)
rename samples/{BuildTest => LinuxRunSamples}/docker-compose.yaml (100%)
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index c95f455..279d231 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -30,6 +30,7 @@ jobs:
- run: dotnet build ./src/SkiaSharp.QrCode/ -c Debug
- run: dotnet build ./samples/ManualGenerate/ -c Debug
- run: dotnet build ./samples/SimpleGenerate/ -c Debug
+ # tests
- run: dotnet test ./tests/SkiaSharp.QrCode.Tests.net31/ -c Debug
- run: dotnet test ./tests/SkiaSharp.QrCode.Tests.net50/ -c Debug -p:CollectCoverage=true -p:CoverletOutputFormat=opencover
- uses: codecov/codecov-action@v1
@@ -38,3 +39,9 @@ jobs:
flags: unittests
fail_ci_if_error: true
verbose: true
+ # run
+ - run: dotnet run --project ./samples/ManualGenerate/ManualGenerate.csproj -c Debug
+ - run: dotnet run --project ./samples/SimpleGenerate/SimpleGenerate.csproj -c Debug
+ # todo: add LinuxRunSamples
+ # - run: docker-compose up
+ # working-directory: ./samples/LinuxRunSamples
diff --git a/README.md b/README.md
index c4d07a6..a6cbb4a 100644
--- a/README.md
+++ b/README.md
@@ -167,7 +167,7 @@ docker build -t skiasharp.qrcode .
Test Run on linux.
```shell
-cd samples/RunTest
+cd samples/LinuxRunSamples
docker-compose up
```
diff --git a/samples/BuildTest/3.1/BuildTest.csproj b/samples/LinuxRunSamples/3.1/BuildTest.csproj
similarity index 100%
rename from samples/BuildTest/3.1/BuildTest.csproj
rename to samples/LinuxRunSamples/3.1/BuildTest.csproj
diff --git a/samples/BuildTest/3.1/Program.cs b/samples/LinuxRunSamples/3.1/Program.cs
similarity index 100%
rename from samples/BuildTest/3.1/Program.cs
rename to samples/LinuxRunSamples/3.1/Program.cs
diff --git a/samples/BuildTest/3.1/entrypoint.sh b/samples/LinuxRunSamples/3.1/entrypoint.sh
similarity index 100%
rename from samples/BuildTest/3.1/entrypoint.sh
rename to samples/LinuxRunSamples/3.1/entrypoint.sh
diff --git a/samples/BuildTest/3.1/samples/test.png b/samples/LinuxRunSamples/3.1/samples/test.png
similarity index 100%
rename from samples/BuildTest/3.1/samples/test.png
rename to samples/LinuxRunSamples/3.1/samples/test.png
diff --git a/samples/BuildTest/3.1_nodep/BuildTest.csproj b/samples/LinuxRunSamples/3.1_nodep/BuildTest.csproj
similarity index 100%
rename from samples/BuildTest/3.1_nodep/BuildTest.csproj
rename to samples/LinuxRunSamples/3.1_nodep/BuildTest.csproj
diff --git a/samples/BuildTest/3.1_nodep/Program.cs b/samples/LinuxRunSamples/3.1_nodep/Program.cs
similarity index 100%
rename from samples/BuildTest/3.1_nodep/Program.cs
rename to samples/LinuxRunSamples/3.1_nodep/Program.cs
diff --git a/samples/BuildTest/3.1_nodep/entrypoint.sh b/samples/LinuxRunSamples/3.1_nodep/entrypoint.sh
similarity index 100%
rename from samples/BuildTest/3.1_nodep/entrypoint.sh
rename to samples/LinuxRunSamples/3.1_nodep/entrypoint.sh
diff --git a/samples/BuildTest/3.1_nodep/samples/test.png b/samples/LinuxRunSamples/3.1_nodep/samples/test.png
similarity index 100%
rename from samples/BuildTest/3.1_nodep/samples/test.png
rename to samples/LinuxRunSamples/3.1_nodep/samples/test.png
diff --git a/samples/BuildTest/5.0/BuildTest.csproj b/samples/LinuxRunSamples/5.0/BuildTest.csproj
similarity index 100%
rename from samples/BuildTest/5.0/BuildTest.csproj
rename to samples/LinuxRunSamples/5.0/BuildTest.csproj
diff --git a/samples/BuildTest/5.0/Program.cs b/samples/LinuxRunSamples/5.0/Program.cs
similarity index 100%
rename from samples/BuildTest/5.0/Program.cs
rename to samples/LinuxRunSamples/5.0/Program.cs
diff --git a/samples/BuildTest/5.0/entrypoint.sh b/samples/LinuxRunSamples/5.0/entrypoint.sh
similarity index 100%
rename from samples/BuildTest/5.0/entrypoint.sh
rename to samples/LinuxRunSamples/5.0/entrypoint.sh
diff --git a/samples/BuildTest/5.0/samples/test.png b/samples/LinuxRunSamples/5.0/samples/test.png
similarity index 100%
rename from samples/BuildTest/5.0/samples/test.png
rename to samples/LinuxRunSamples/5.0/samples/test.png
diff --git a/samples/BuildTest/5.0_nodep/BuildTest.csproj b/samples/LinuxRunSamples/5.0_nodep/BuildTest.csproj
similarity index 100%
rename from samples/BuildTest/5.0_nodep/BuildTest.csproj
rename to samples/LinuxRunSamples/5.0_nodep/BuildTest.csproj
diff --git a/samples/BuildTest/5.0_nodep/Program.cs b/samples/LinuxRunSamples/5.0_nodep/Program.cs
similarity index 100%
rename from samples/BuildTest/5.0_nodep/Program.cs
rename to samples/LinuxRunSamples/5.0_nodep/Program.cs
diff --git a/samples/BuildTest/5.0_nodep/entrypoint.sh b/samples/LinuxRunSamples/5.0_nodep/entrypoint.sh
similarity index 100%
rename from samples/BuildTest/5.0_nodep/entrypoint.sh
rename to samples/LinuxRunSamples/5.0_nodep/entrypoint.sh
diff --git a/samples/BuildTest/5.0_nodep/samples/test.png b/samples/LinuxRunSamples/5.0_nodep/samples/test.png
similarity index 100%
rename from samples/BuildTest/5.0_nodep/samples/test.png
rename to samples/LinuxRunSamples/5.0_nodep/samples/test.png
diff --git a/samples/BuildTest/docker-compose.yaml b/samples/LinuxRunSamples/docker-compose.yaml
similarity index 100%
rename from samples/BuildTest/docker-compose.yaml
rename to samples/LinuxRunSamples/docker-compose.yaml
diff --git a/samples/ManualGenerate/ManualGenerate.csproj b/samples/ManualGenerate/ManualGenerate.csproj
index 8600849..39a613d 100644
--- a/samples/ManualGenerate/ManualGenerate.csproj
+++ b/samples/ManualGenerate/ManualGenerate.csproj
@@ -7,8 +7,11 @@
-
-
+
+
+
+
+
diff --git a/samples/SimpleGenerate/SimpleGenerate.csproj b/samples/SimpleGenerate/SimpleGenerate.csproj
index 58cafb4..39a613d 100644
--- a/samples/SimpleGenerate/SimpleGenerate.csproj
+++ b/samples/SimpleGenerate/SimpleGenerate.csproj
@@ -7,8 +7,16 @@
-
-
+
+
+
+
+
+
+
+ PreserveNewest
+
+
From 51297ad1d0935a883721929e84462fed3476a83c Mon Sep 17 00:00:00 2001
From: Ikiru Yoshizaki <3856350+guitarrapc@users.noreply.github.com>
Date: Thu, 26 Nov 2020 04:51:21 +0900
Subject: [PATCH 7/8] chore: test requires
SkiaSharp.NativeAssets.Linux.NoDependencies
---
.../SkiaSharp.QrCode.Tests.net31.csproj | 1 +
.../SkiaSharp.QrCode.Tests.net50.csproj | 1 +
2 files changed, 2 insertions(+)
diff --git a/tests/SkiaSharp.QrCode.Tests.net31/SkiaSharp.QrCode.Tests.net31.csproj b/tests/SkiaSharp.QrCode.Tests.net31/SkiaSharp.QrCode.Tests.net31.csproj
index b483ae3..a7b49e6 100644
--- a/tests/SkiaSharp.QrCode.Tests.net31/SkiaSharp.QrCode.Tests.net31.csproj
+++ b/tests/SkiaSharp.QrCode.Tests.net31/SkiaSharp.QrCode.Tests.net31.csproj
@@ -7,6 +7,7 @@
+
diff --git a/tests/SkiaSharp.QrCode.Tests.net50/SkiaSharp.QrCode.Tests.net50.csproj b/tests/SkiaSharp.QrCode.Tests.net50/SkiaSharp.QrCode.Tests.net50.csproj
index 89227c7..4950a6c 100644
--- a/tests/SkiaSharp.QrCode.Tests.net50/SkiaSharp.QrCode.Tests.net50.csproj
+++ b/tests/SkiaSharp.QrCode.Tests.net50/SkiaSharp.QrCode.Tests.net50.csproj
@@ -10,6 +10,7 @@
+
From 371996bd2a21e2a5521fc34ebcc43ab5442aed92 Mon Sep 17 00:00:00 2001
From: Ikiru Yoshizaki <3856350+guitarrapc@users.noreply.github.com>
Date: Thu, 26 Nov 2020 04:55:32 +0900
Subject: [PATCH 8/8] chore: run with framework
---
.github/workflows/build.yaml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 279d231..cf8b9c5 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -40,8 +40,10 @@ jobs:
fail_ci_if_error: true
verbose: true
# run
- - run: dotnet run --project ./samples/ManualGenerate/ManualGenerate.csproj -c Debug
- - run: dotnet run --project ./samples/SimpleGenerate/SimpleGenerate.csproj -c Debug
+ - run: dotnet run --project ./samples/ManualGenerate/ManualGenerate.csproj -c Debug -f netcoreapp3.1
+ - run: dotnet run --project ./samples/ManualGenerate/ManualGenerate.csproj -c Debug -f net5.0
+ - run: dotnet run --project ./samples/SimpleGenerate/SimpleGenerate.csproj -c Debug -f netcoreapp3.1
+ - run: dotnet run --project ./samples/SimpleGenerate/SimpleGenerate.csproj -c Debug -f net5.0
# todo: add LinuxRunSamples
# - run: docker-compose up
# working-directory: ./samples/LinuxRunSamples