Windows7 オペレーティング システムに Cygwin と FontForge を正常にインストールしましたが、非常にうまく機能しているようです。事業?オープンソースプロジェクトを使うのは初めてで、オープンソースコードと自分のコードを組み合わせる方法がわかりません〜
1 に答える
1
私は現在、fontforge を使用するプロジェクトを構築しており、bash.exe を開始し、fontforge をコマンド ライン引数として実行するプロセスとして C# から呼び出します。
次に例を示します。
Process p = new Process();
string cygwinDir = @"c:\cygwin\bin";
p.StartInfo.FileName = Path.Combine(cygwinDir, "bash.exe");
p.StartInfo.Arguments = "--login -c \"fontforge.exe -script '" + this.cygwinWorkPath + "script.pe";
p.StartInfo.WorkingDirectory = this.windowsWorkPath;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.Start();
p.WaitForExit();
var standardError = p.StandardError.ReadToEnd();
var standardOutput = p.StandardOutput.ReadToEnd();
var exitCode = p.ExitCode;
cygwinWorkpath は /myworkfolder のようなもので、windowsWorkPath は c:\cygwin\myworkfolder のようなものです。
于 2012-11-13T12:59:33.397 に答える