简体   繁体   中英

Can I call some function of FontForge in my own C# project?

I have installed Cygwin and FontForge successfully in the Windows7 operating system and they seem work very well.I find that FontForge is a powerful tool~~However I have a very naive question...Can I call some function of FontForge in my own C# project? It's the first time for me to use the open source project, and I don't know how to combine the open source codes with my own codes~

I've currently building a project that uses fontforge and I call it from C# as a Process that starts bash.exe and running fontforge as a command line arguments.

Here's an example:

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 is something like /myworkfolder and windowsWorkPath is like c:\\cygwin\\myworkfolder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM