Make the Terminus fonts an external package

Credit to Michael Allison for the patch and for the previous one
to build the fonts in the cross-compile.
This commit is contained in:
Ray Chason
2022-10-05 20:03:11 -04:00
parent 03a82720ef
commit 31859f562e
15 changed files with 70 additions and 314976 deletions

View File

@@ -41,13 +41,21 @@ II. There once was a time when people built NetHack right on their DOS machine.
https://github.com/andrewwutw/build-djgpp/releases/download/v3.0/
a DOS-extender (for including in msdos packaging) from:
http://sandmann.dotster.com/cwsdpmi/csdpmi7b.zip
and pdcurses from:
https://github.com/wmcbrine/PDCurses.git
or pdcursesmod from:
https://github.com/Bill-Gray/PDCursesMod.git
and Lua from:
http://www.lua.org/ftp/lua-5.4.4.tar.gz
If you want the DOSVGA build, to support higher resolutions and Unicode
symbols, you also need:
pdcursesmod from:
https://github.com/Bill-Gray/PDCursesMod.git
(Name this lib/pdcurmod for the native build)
Terminus fonts from:
https://sourceforge.net/projects/terminus-font/files/terminus-font-4.49/terminus-font-4.49.1.tar.gz
(Name this lib/terminus for the native build)
If not, you also need:
pdcurses from:
https://github.com/wmcbrine/PDCurses.git
- A shell script to download the above-mentioned djgpp cross-compiler and
associated support pieces for either linux or macOS is available:
sh sys/msdos/fetch-cross-compiler.sh
@@ -84,8 +92,8 @@ II. There once was a time when people built NetHack right on their DOS machine.
make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_MSDOS=1 all
make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_MSDOS=1 package
Add WANT_DOSVGA for a curses build that supports higher resolutions and
external fonts:
Add WANT_DOSVGA for a curses build that supports higher resolutions,
external fonts and Unicode symbols:
make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_MSDOS=1 WANT_DOSVGA=1 all
make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_MSDOS=1 WANT_DOSVGA=1 package

View File

@@ -66,6 +66,11 @@ endif
ADD_LUA=Y
LUATOP=../lib/lua$(LUAVER)
#
#---------------------------------------------------------------
# Location of terminus-fonts
#
FONTTOP=../lib/terminus
#==============================================================================
# This marks the end of the BUILD DECISIONS section.
#==============================================================================
@@ -922,14 +927,14 @@ $(O)luac.o: $(LUASRC)/luac.c
ifdef WANT_DOSVGA
$(O)fonts.tag: lua.exe $(MSYS)/fonts/makefont.lua
lua $(MSYS)/fonts/makefont.lua $(MSYS)/fonts/ter-u16b.bdf $(MSYS)/fonts/ter-u16b.psf
lua $(MSYS)/fonts/makefont.lua $(MSYS)/fonts/ter-u16v.bdf $(MSYS)/fonts/ter-u16v.psf
lua $(MSYS)/fonts/makefont.lua $(MSYS)/fonts/ter-u18b.bdf $(MSYS)/fonts/ter-u18b.psf
lua $(MSYS)/fonts/makefont.lua $(MSYS)/fonts/ter-u20b.bdf $(MSYS)/fonts/ter-u20b.psf
lua $(MSYS)/fonts/makefont.lua $(MSYS)/fonts/ter-u22b.bdf $(MSYS)/fonts/ter-u22b.psf
lua $(MSYS)/fonts/makefont.lua $(MSYS)/fonts/ter-u24b.bdf $(MSYS)/fonts/ter-u24b.psf
lua $(MSYS)/fonts/makefont.lua $(MSYS)/fonts/ter-u28b.bdf $(MSYS)/fonts/ter-u28b.psf
lua $(MSYS)/fonts/makefont.lua $(MSYS)/fonts/ter-u32b.bdf $(MSYS)/fonts/ter-u32b.psf
lua $(MSYS)/fonts/makefont.lua $(FONTTOP)/ter-u16b.bdf $(MSYS)/fonts/ter-u16b.psf
lua $(MSYS)/fonts/makefont.lua $(FONTTOP)/ter-u16v.bdf $(MSYS)/fonts/ter-u16v.psf
lua $(MSYS)/fonts/makefont.lua $(FONTTOP)/ter-u18b.bdf $(MSYS)/fonts/ter-u18b.psf
lua $(MSYS)/fonts/makefont.lua $(FONTTOP)/ter-u20b.bdf $(MSYS)/fonts/ter-u20b.psf
lua $(MSYS)/fonts/makefont.lua $(FONTTOP)/ter-u22b.bdf $(MSYS)/fonts/ter-u22b.psf
lua $(MSYS)/fonts/makefont.lua $(FONTTOP)/ter-u24b.bdf $(MSYS)/fonts/ter-u24b.psf
lua $(MSYS)/fonts/makefont.lua $(FONTTOP)/ter-u28b.bdf $(MSYS)/fonts/ter-u28b.psf
lua $(MSYS)/fonts/makefont.lua $(FONTTOP)/ter-u32b.bdf $(MSYS)/fonts/ter-u32b.psf
@echo Fonts done >$(O)fonts.tag
else
$(O)fonts.tag:

View File

@@ -85,13 +85,13 @@ if [ ! -d djgpp/cwsdpmi ]; then
rm csdpmi7b.zip
fi
# PDCurses
# PDCurses (non-Unicode build uses this)
if [ ! -d "pdcurses" ]; then
echo "Getting ../pdcurses from https://github.com/wmcbrine/PDCurses.git" ; \
git clone --depth 1 https://github.com/wmcbrine/PDCurses.git pdcurses
fi
# PDCursesMod
# PDCursesMod (Unicode build uses this)
if [ ! -d "pdcursesmod" ]; then
echo "Getting ../pdcursesmod from https://github.com/Bill-Gray/PDCursesMod.git" ; \
git clone --depth 1 https://github.com/Bill-Gray/PDCursesMod.git pdcursesmod
@@ -115,6 +115,24 @@ if [ ! -d djgpp/djgpp-patch ]; then
cd ../../
fi
FONT_VERSION="4.49"
FONT_FILE="terminus-font-$FONT_VERSION"
FONT_RFILE="$FONT_FILE.1.tar.gz"
FONT_URL="https://sourceforge.net/projects/terminus-font/files/$FONT_FILE/$FONT_RFILE"
# fonts
if [ ! -d "$FONT_FILE" ]; then
echo "Getting terminus fonts"
if [ "$(uname)" = "Darwin" ]; then
#Mac
curl -L $FONT_URL --output $FONT_RFILE
else
wget --quiet --no-hsts $FONT_URL
fi
tar -xvf $FONT_RFILE
rm $FONT_RFILE
fi
cd ../
# Don't fail the build if lua fetch failed because we cannot do anything about it

View File

@@ -1,94 +0,0 @@
Copyright (C) 2020 Dimitar Toshkov Zhekov,
with Reserved Font Name "Terminus Font".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@@ -1,28 +0,0 @@
The following files are copied verbatim from the Terminus font package,
version 4.49, available at https://sourceforge.net/projects/terminus-font/ .
They are distributed under the SIL Open Font License, Version 1.1.
* ter-u16b.bdf
* ter-u16v.bdf
* ter-u18v.bdf
* ter-u20b.bdf
* ter-u22b.bdf
* ter-u24b.bdf
* ter-u28b.bdf
* ter-u32b.bdf
The program makefont.lua is distributed under the NetHack license, and can be
used to generate the binary font files. The binary font files are provided
precompiled; working their compilation into the cross-compile proved to be
complicated. They are also distributed under the SIL Open Font License.
* ter-u16b.psf
* ter-u16v.psf
* ter-u18v.psf
* ter-u20b.psf
* ter-u22b.psf
* ter-u24b.psf
* ter-u28b.psf
* ter-u32b.psf
OFL.TXT contains the text of the SIL Open Font License.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -24,24 +24,22 @@ $(TARGETPFX)exceptn.o : ../lib/djgpp/djgpp-patch/src/libc/go32/exceptn.S
$(GAMEBIN) : $(HOBJ) $(LUACROSSLIB)
$(TARGET_LINK) $(TARGET_LFLAGS) -o $(GAMEBIN) \
$(HOBJ) $(WINLIB) $(TARGET_LIBS)
FONTDIR = ../sys/msdos/fonts
$(FONTDIR)/ter-u16b.psf: $(FONTDIR)/ter-u16b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTDIR)/ter-u16b.bdf $@
$(FONTDIR)/ter-u16v.psf: $(FONTDIR)/ter-u16v.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTDIR)/ter-u16v.bdf $@
$(FONTDIR)/ter-u18b.psf: $(FONTDIR)/ter-u18b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTDIR)/ter-u18b.bdf $@
$(FONTDIR)/ter-u20b.psf: $(FONTDIR)/ter-u20b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTDIR)/ter-u20b.bdf $@
$(FONTDIR)/ter-u22b.psf: $(FONTDIR)/ter-u22b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTDIR)/ter-u22b.bdf $@
$(FONTDIR)/ter-u24b.psf: $(FONTDIR)/ter-u24b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTDIR)/ter-u24b.bdf $@
$(FONTDIR)/ter-u28b.psf: $(FONTDIR)/ter-u28b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTDIR)/ter-u28b.bdf $@
$(FONTDIR)/ter-u32b.psf: $(FONTDIR)/ter-u32b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTDIR)/ter-u32b.bdf $@
$(FONTDIR)/ter-u16b.psf: $(FONTTOP)/ter-u16b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTTOP)/ter-u16b.bdf $@
$(FONTDIR)/ter-u16v.psf: $(FONTTOP)/ter-u16v.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTTOP)/ter-u16v.bdf $@
$(FONTDIR)/ter-u18b.psf: $(FONTTOP)/ter-u18b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTTOP)/ter-u18b.bdf $@
$(FONTDIR)/ter-u20b.psf: $(FONTTOP)/ter-u20b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTTOP)/ter-u20b.bdf $@
$(FONTDIR)/ter-u22b.psf: $(FONTTOP)/ter-u22b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTTOP)/ter-u22b.bdf $@
$(FONTDIR)/ter-u24b.psf: $(FONTTOP)/ter-u24b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTTOP)/ter-u24b.bdf $@
$(FONTDIR)/ter-u28b.psf: $(FONTTOP)/ter-u28b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTTOP)/ter-u28b.bdf $@
$(FONTDIR)/ter-u32b.psf: $(FONTTOP)/ter-u32b.bdf $(FONTDIR)/makefont.lua $(LUABIN)
$(LUABIN) $(FONTDIR)/makefont.lua $(FONTTOP)/ter-u32b.bdf $@
#
.PHONY: dodata dospkg dosfonts
ifdef WANT_DOSVGA

View File

@@ -164,10 +164,13 @@ MSDOS_TARGET_CFLAGS = -c -O -I../include -I../sys/msdos -I../win/share \
PDCINCL += -I$(PDCPORT)
PDC_TARGET_CFLAGS = $(MSDOS_TARGET_CFLAGS) -Wno-unused-parameter \
-Wno-missing-prototypes
FONTTARGETS = ../sys/msdos/fonts/ter-u16b.psf ../sys/msdos/fonts/ter-u16v.psf \
../sys/msdos/fonts/ter-u18b.psf ../sys/msdos/fonts/ter-u20b.psf \
../sys/msdos/fonts/ter-u22b.psf ../sys/msdos/fonts/ter-u24b.psf \
../sys/msdos/fonts/ter-u28b.psf ../sys/msdos/fonts/ter-u32b.psf
FONTVER = terminus-font-4.49.1
FONTTOP = ../lib/$(FONTVER)
FONTDIR = ../sys/msdos/fonts
FONTTARGETS = $(FONTDIR)/ter-u16b.psf $(FONTDIR)/ter-u16v.psf \
$(FONTDIR)/ter-u18b.psf $(FONTDIR)/ter-u20b.psf \
$(FONTDIR)/ter-u22b.psf $(FONTDIR)/ter-u24b.psf \
$(FONTDIR)/ter-u28b.psf $(FONTDIR)/ter-u32b.psf
LUABIN = ../lib/lua-$(LUA_VERSION)/src/lua
LUA_TARGET_CFLAGS = $(MSDOS_TARGET_CFLAGS)
override TARGET_CFLAGS = $(MSDOS_TARGET_CFLAGS) -Wmissing-declarations \