Skip to content

Instantly share code, notes, and snippets.

@torque
Created May 5, 2012 07:33
Show Gist options
  • Save torque/2600662 to your computer and use it in GitHub Desktop.
Save torque/2600662 to your computer and use it in GitHub Desktop.
batch file for launching FontForge on windows
:: Slightly modified fontforge.bat from this fine fellow's (http://www.geocities.jp/meir000/fontforge/) cygwin fontforge builds
:: Mostly fixes opening fonts to work with multiple fonts, even ones with spaces in their paths.
@echo on
set PATH=%~dp0cygwin\bin;%PATH%
set CYGWIN=nodosfilewarning
set HOME=%~dp0
set DISPLAY=:9.0
set AUTOTRACE=potrace
set LANG=C.UTF-8
pushd "%~dp0"
if not exist "cygwin\bin\fontforge.exe" (
7zr.exe x -aoa -ocygwin _image.7z
if exist "cygwin\bin" (
pushd cygwin\bin
rebase.exe -v -b 0x70000000 -T rebase.list
popd
)
)
if not exist "cygwin\bin\fontforge.exe" ( echo ERROR fontforge.exe not found. && pause )
if not exist "cygwin\etc\passwd" ( mkpasswd > "cygwin\etc\passwd" )
if not exist "cygwin\etc\group" ( mkgroup > "cygwin\etc\group" )
if not exist "cygwin\var\cache\fontconfig" ( fc-cache -v -r -s )
popd
SETLOCAL EnableDelayedExpansion
set file=
for /f "delims=;" %%A in ('cygpath -u %*') do (
set file=!file! "%%A"
)
start /B XWin.exe :9 -multiwindow -silent-dup-error
xwin-close.exe -wait
fontforge.exe -nosplash %file%
xwin-close.exe -close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment