aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile15
-rw-r--r--win32/build.cmd6
-rw-r--r--win32/fcp.c26
-rw-r--r--win32/make-clean.cmd5
-rw-r--r--win32/terminus.nsi73
5 files changed, 58 insertions, 67 deletions
diff --git a/win32/Makefile b/win32/Makefile
index 7a52b73643f2..c60c48d204a1 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -6,11 +6,12 @@ UNI = ../uni
UCS2ANY = $(INT) $(BIN)/ucstoany.$(EXT)
BDF2FNT = $(INT) $(BIN)/bdftofnt.$(EXT) -fModern
-RC32 = windres -F pe-i386
-CC32 = i686-w64-mingw32-gcc
-CFLAGS = -O2 -Wall -Wextra
-LDFLAGS = -mwindows -s
+CC32 = i686-w64-mingw32-gcc
+CFLAGS = -O2 -Wall -Wextra
+LDFLAGS = -mwindows -s
FONFLAGS = -shared -nostdlib -nostartfiles
+RC32 = windres -F pe-i386
+RM = rm -f
REG_MS_1252 = Microsoft CP1252
REG_MS_1250 = Microsoft CP1250
@@ -72,7 +73,7 @@ $(FNT_IBM_437): ter-i%.fnt : ter-u%.bdf $(WIN_IBM_437)
$(FNT_BG_MIK): ter-m%.fnt : ter-u%.bdf $(WIN_BG_MIK)
$(UCS2ANY) -F Terminal $< $(REG_BG_MIK) $(WIN_BG_MIK) | $(BDF2FNT) -o $@
-fnt: $(FNT)
+fnt: $(FNT)
fnt-255: $(FNT_IBM_437) $(FNT_BG_MIK)
@@ -86,6 +87,6 @@ fcpw.exe: fcp.c
$(CC32) -DFCPW $(CFLAGS) $(LDFLAGS) -o $@ $<
clean:
- @./make-clean.cmd
+ $(RM) ter-*.bdf ter-*.fnt *.txt ter-*.o terminus.fon fcpw.exe
-.PHONY: all fnt clean
+.PHONY: all fnt fnt-255 clean
diff --git a/win32/build.cmd b/win32/build.cmd
index 6d55de54b50c..f28822ca9498 100644
--- a/win32/build.cmd
+++ b/win32/build.cmd
@@ -2,7 +2,7 @@ if errorlevel 1 type nul
if not exist dup\nul mkdir dup
if errorlevel 1 exit /b
-if not errorlevel 1 copy /y ..\*.bdf
+if not errorlevel 1 copy /y ..\ter-*.bdf
if not errorlevel 1 make -B -j8 terminus.fon
if not errorlevel 1 move /y terminus.fon terminus.bak
@@ -29,7 +29,7 @@ if not errorlevel 1 call :difftofcp hi2-ka2
if not errorlevel 1 make -B -j8 terminus.fon
if not errorlevel 1 make fcpw.exe
-if not errorlevel 1 del /q *.bdf *.fnt terminus.bak ter-font.o
+if not errorlevel 1 del ter-*.bdf ter-*.fnt terminus.bak ter-*.o dup\xos4-2.dup
exit /b
:difftofcp
@@ -38,4 +38,4 @@ if not errorlevel 1 make -B -j8 fnt
if not errorlevel 1 make terminus.fon
if not errorlevel 1 fc /b terminus.bak terminus.fon > %1.txt
rem fc sets errorlevel 1 on differences
-if not errorlevel 2 copy /y ..\*.bdf
+if not errorlevel 2 copy /y ..\ter-*.bdf
diff --git a/win32/fcp.c b/win32/fcp.c
index e578606c5d69..0c95ffecf24a 100644
--- a/win32/fcp.c
+++ b/win32/fcp.c
@@ -60,20 +60,24 @@ static void error(const char *s)
#define main wrap
#endif
-static const char *usage =
+static const char *USAGE =
"usage: " FCP " [OFFSET] FILE PATCH\n"
"\n"
FCP " 0.10.2, Copyright (C) 2017 Dimitar Toshkov Zhekov\n"
"\n"
- "This program is free software; you can redistribute it and/or\n"
- "modify it under the terms of the GNU General Public License as\n"
- "published by the Free Software Foundation; either version 2 of\n"
- "the License, or (at your option) any later version.\n"
+ "This program is free software; you can redistribute it and/or modify it\n"
+ "under the terms of the GNU General Public License as published by the Free\n"
+ "Software Foundation; either version 2 of the License, or (at your option)\n"
+ "any later version.\n"
"\n"
- "This program is distributed in the hope that it will be useful,\n"
- "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
- "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
- "GNU General Public License for more details.\n";
+ "This program is distributed in the hope that it will be useful, but\n"
+ "WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n"
+ "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n"
+ "for more details.\n"
+ "\n"
+ "You should have received a copy of the GNU General Public License along\n"
+ "with this program; if not, write to the Free Software Foundation, Inc.,\n"
+ "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n";
int main(int argc, char **argv)
{
@@ -94,9 +98,9 @@ int main(int argc, char **argv)
else if (argc != 3)
{
#ifdef FCPW
- MessageBox(NULL, usage, FCP, MB_OK);
+ MessageBox(NULL, USAGE, FCP, MB_OK);
#else
- fputs(usage, stderr);
+ fputs(USAGE, stderr);
#endif
return 1;
}
diff --git a/win32/make-clean.cmd b/win32/make-clean.cmd
deleted file mode 100644
index 859dc294bc09..000000000000
--- a/win32/make-clean.cmd
+++ /dev/null
@@ -1,5 +0,0 @@
-@echo off
-if not exist ter-font.rc exit /b 1
-if not exist ter-main.c exit /b 1
-echo rm -f *.bdf *.fnt *.txt ter-*.o terminus.fon fcpw.exe
-for %%i in (*.bdf *.fnt *.txt ter-*.o terminus.fon fcpw.exe) do if exist %%i del /q %%i
diff --git a/win32/terminus.nsi b/win32/terminus.nsi
index 489e15e1781c..c2ca37818469 100644
--- a/win32/terminus.nsi
+++ b/win32/terminus.nsi
@@ -1,15 +1,19 @@
#
-# Copyright (c) 2019 Dimitar Toshkov Zhekov <dimitar.zhekov@gmail.com>
+# Copyright (c) 2020 Dimitar Toshkov Zhekov <dimitar.zhekov@gmail.com>
#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
!include nsDialogs.nsh
@@ -18,17 +22,15 @@
!include WinVer.nsh
Name "Terminus Font"
-OutFile terminus-font-4.48.exe
+OutFile terminus-font-4.49.exe
XPStyle on
CRCCheck force
RequestExecutionLevel admin
-InstallDir "$EXEDIR\terminus-font-4.48"
+InstallDir "$EXEDIR\terminus-font-4.49"
InstallButtonText "Proceed"
-Var ter_dialog
-
Var apply_ao2
Var apply_dv1
Var apply_ge2
@@ -61,44 +63,39 @@ Page custom ter_dialog_page ter_dialog_page_leave
Page instfiles
Function install_clicked
-
EnableWindow $directory 0
EnableWindow $browse 0
- ${NSD_SetText} $directory "$FONTS"
-
+ ${NSD_SetText} $directory $FONTS
FunctionEnd
Function unpack_clicked
-
- ${NSD_SetText} $directory "$INSTDIR"
+ ${NSD_SetText} $directory $INSTDIR
EnableWindow $directory 1
EnableWindow $browse 1
-
FunctionEnd
Function hamster_clicked
-
ExecShell "open" "http://terminus-font.sourceforge.net#variants"
ToolTips::Classic $hamster "http://terminus-font.sourceforge.net#variants"
-
FunctionEnd
Function browse_clicked
-
nsDialogs::SelectFolderDialog Directory $INSTDIR
Pop $0
${If} $0 != error
- StrCpy $INSTDIR "$0"
- ${NSD_SetText} $directory "$INSTDIR"
+ StrCpy $INSTDIR $0
+ ${NSD_SetText} $directory $INSTDIR
${EndIf}
-
FunctionEnd
Function ter_dialog_page
-
nsDialogs::Create 1018
- Pop $ter_dialog
+ Pop $0
+ ${If} $0 == error
+ MessageBox MB_ICONSTOP|MB_OK "Failed to create installation dialog."
+ Abort
+ ${EndIf}
${NSD_CreateLink} 2% 1 11% 10u "Variants"
Pop $hamster
@@ -148,19 +145,17 @@ Function ter_dialog_page
${NSD_CreateLabel} 2% 71u 96% 12u "The license is available with a \
FAQ at: http://scripts.sil.org/OFL"
${NSD_CreateLabel} 2% 83u 96% 24u "Note: the Windows code pages \
- contain a total of 356 characters. All other characters \
+ contain a total of 384 characters. All other characters \
(math, pseudographics etc.) are not currently available."
- ${NSD_CreateLabel} 2% 107u 96% 12u "Terminus Font 4.48, \
- Copyright (C) 2019 Dimitar Toshkov Zhekov."
+ ${NSD_CreateLabel} 2% 107u 96% 12u "Terminus Font 4.49, \
+ Copyright (C) 2020 Dimitar Toshkov Zhekov."
${NSD_CreateLabel} 2% 119u 96% 12u "Report bugs to \
<dimitar.zhekov@gmail.com>"
nsDialogs::Show
-
FunctionEnd
Function ter_dialog_page_leave
-
${NSD_GetState} $apply_ao2 $0
${IfThen} $0 == ${BST_CHECKED} ${|} StrCpy $ao2 "ao2" ${|}
${NSD_GetState} $apply_dv1 $0
@@ -193,13 +188,12 @@ Function ter_dialog_page_leave
Abort
${EndIf}
${EndIf}
-
FunctionEnd
Function patch
-
Pop $1
${If} $1 != ""
+ ClearErrors
ExecWait '"$OUTDIR\fcpw.exe" 4100 terminus.fon $1.txt' $R0
${If} ${Errors}
MessageBox MB_OK|MB_ICONEXCLAMATION "Can't run $OUTDIR\fcpw.exe"
@@ -207,7 +201,6 @@ Function patch
${EndIf}
${IfThen} $R0 != 0 ${|} Abort "fcpw.exe failed with exit code $R0" ${|}
${EndIf}
-
FunctionEnd
!macro PATCH arg
@@ -218,12 +211,11 @@ FunctionEnd
!define Patch `!insertmacro PATCH`
Section "Install"
-
${If} $instate == ${BST_CHECKED}
InitPluginsDir
- SetOutPath "$PLUGINSDIR"
+ SetOutPath $PLUGINSDIR
${Else}
- SetOutPath "$INSTDIR"
+ SetOutPath $INSTDIR
${EndIf}
File "terminus.fon"
@@ -280,8 +272,8 @@ Section "Install"
${Else}
StrCpy $1 "SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts"
${EndIf}
- WriteRegStr HKLM "$1" "Terminus" "terminus.fon"
- ReadRegStr $0 HKLM "$1" "Terminus"
+ WriteRegStr HKLM $1 "Terminus" "terminus.fon"
+ ReadRegStr $0 HKLM $1 "Terminus"
StrCpy $1 ""
${If} $0 != "terminus.fon"
@@ -303,5 +295,4 @@ Section "Install"
File "..\CHANGES"
File "..\OFL.TXT"
${EndIf}
-
SectionEnd