Skip to content

Commit c532987

Browse files
committed
尝试带上字体
1 parent 1b22f8c commit c532987

108 files changed

Lines changed: 51699 additions & 3 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/MediaConverters/MediaConverters.Lib/Imaging/Optimizations/EnhancedGraphicsMetafileOptimization.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Drawing;
55
using System.Drawing.Imaging;
66
using System.IO;
7+
using System.Runtime.InteropServices;
78
using System.Runtime.Versioning;
89

910
namespace DotNetCampus.MediaConverters.Imaging.Optimizations;
@@ -125,18 +126,25 @@ private static ImageFileOptimizationResult ConvertWithInkscapeLibWmf(ImageFileOp
125126

126127
var svgFile = Path.Join(workingFolder.FullName, $"{Path.GetFileNameWithoutExtension(file.Name)}_{Path.GetRandomFileName()}.svg");
127128

129+
var wmf2svgFolder = Path.Join(AppContext.BaseDirectory, "Assets", RuntimeInformation.RuntimeIdentifier);
130+
var wmf2svgFile = Path.Join(wmf2svgFolder, "wmf2svg");
131+
128132
// ./wmf2svg -o 1.svg image.wmf
129-
var processStartInfo = new ProcessStartInfo("wmf2svg")
133+
var processStartInfo = new ProcessStartInfo(wmf2svgFile)
130134
{
131135
ArgumentList =
132136
{
133137
"-o",
134138
svgFile,
135139
file.FullName,
140+
},
141+
Environment =
142+
{
143+
{"LD_LIBRARY_PATH", AppContext.BaseDirectory}
136144
}
137145
};
138146

139-
var fontFolder = Path.Join(AppContext.BaseDirectory, "fonts");
147+
var fontFolder = Path.Join(AppContext.BaseDirectory, "Assets", "gsfonts");
140148
if (Directory.Exists(fontFolder))
141149
{
142150
processStartInfo.ArgumentList.Add($"--wmf-fontdir={fontFolder}");
Lines changed: 1 addition & 0 deletions

src/MediaConverters/MediaConverters.Tool/Assets/gsfonts/a010013l.afm

Lines changed: 1571 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.

src/MediaConverters/MediaConverters.Tool/Assets/gsfonts/a010015l.afm

Lines changed: 1565 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.

src/MediaConverters/MediaConverters.Tool/Assets/gsfonts/a010033l.afm

Lines changed: 1544 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.

0 commit comments

Comments
 (0)