16 Commits

Author SHA1 Message Date
Claudio Matsuoka
b320d67ce7 Refactor code to open font and control files
Reduce duplicate code by moving file opening code to the FIGopen()
function. This function is used to open font and control files, and
will be used to open multiple font files in ransom mode.

For code simplicity, DEFAULTFONTFILE is now defined without suffix.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-23 12:09:27 -02:00
Claudio Matsuoka
5f7350cae5 Add support to TLF font format
The TLF font format is used by TOIlet and is very similar to the FLF
font format, the only difference being the presence of UTF-8 encoded
Unicode characters. This patch adds TLF support to FIGlet if TLF_FONTS
is defined in Makefile.

When TLF_FONTS is defined, the internal character format is changed
to UCS-4 wide characters. System requirements are support to UTF-8
multibyte encoding, a font capable of displaying Unicode glyphs and an
implementation of C99 wchar.h.

Warning: UTF-8 characters are allowed as endmarks and sub-characters, but
not as a hardblank symbol.

Example:

$ fortune | ./figlet -fpagga
░█▀█░▀█▀░█▀█░█▀▀░▀█▀░█░█░░░█▀█░█▀▀░█▀▄░█▀▀░█▀▀░█▀█░▀█▀░░░█▀█░█▀▀
░█░█░░█░░█░█░█▀▀░░█░░░█░░░░█▀▀░█▀▀░█▀▄░█░░░█▀▀░█░█░░█░░░░█░█░█▀▀
░▀░▀░▀▀▀░▀░▀░▀▀▀░░▀░░░▀░░░░▀░░░▀▀▀░▀░▀░▀▀▀░▀▀▀░▀░▀░░▀░░░░▀▀▀░▀░░
░█▀▀░█░█░█▀▀░█▀▄░█░█░▀█▀░█░█░▀█▀░█▀█░█▀▀░░░▀█▀░█▀▀░░░█▀▀░█▀▄░█▀█░█▀█░░░
░█▀▀░▀▄▀░█▀▀░█▀▄░░█░░░█░░█▀█░░█░░█░█░█░█░░░░█░░▀▀█░░░█░░░█▀▄░█▀█░█▀▀░░░
░▀▀▀░░▀░░▀▀▀░▀░▀░░▀░░░▀░░▀░▀░▀▀▀░▀░▀░▀▀▀░░░▀▀▀░▀▀▀░░░▀▀▀░▀░▀░▀░▀░▀░░░▀░
░░░░░░░░░░░░░░░▀█▀░█░█░█▀▀░█▀█░█▀▄░█▀█░█▀▄░█▀▀
░░░░░▄▄▄░▄▄▄░░░░█░░█▀█░█▀▀░█░█░█░█░█░█░█▀▄░█▀▀
░░░░░░░░░░░░░░░░▀░░▀░▀░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀░▀▀▀
░█▀▀░▀█▀░█░█░█▀▄░█▀▀░█▀▀░█▀█░█▀█
░▀▀█░░█░░█░█░█▀▄░█░█░█▀▀░█░█░█░█
░▀▀▀░░▀░░▀▀▀░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀░▀

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-16 10:53:05 -02:00
Claudio Matsuoka
ae816570cf Add missing chkfont source to distribution package
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-13 23:51:30 -02:00
Claudio Matsuoka
b3df1e6321 Fix binary list
Otherwise figlist and showfigfonts won't be installed on make install.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-13 00:33:37 -02:00
Claudio Matsuoka
628c0297f4 Fix DESTDIR setting for fonts directory
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-12 22:13:48 -02:00
Claudio Matsuoka
3635c3c5b4 Set version number to 2.2.3
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-12 00:35:48 -02:00
Claudio Matsuoka
d971045702 Update version number and changelog file
List current changes to the CHANGES file and call this version 2.3.
The version and date must be updated in several places before the
final release, including the FAQ and all man pages.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-12 00:27:50 -02:00
Claudio Matsuoka
897df1c955 Add utility man pages written by Jonathon Abbott
Add chkfont(6), figlist(6) and showfigfonts(6) manual pages contributed
by Jonathon Abbott to the Debian Project.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-12 00:11:26 -02:00
Claudio Matsuoka
6d142cab60 Add distribution package generation target
This should make distribution package generation easier. Also removed
clang-specific entries since C flags are the same used in gcc.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-11 21:15:30 -02:00
Claudio Matsuoka
0a94e7271c Fix directory creation in install target
Also move man6 out of MANDIR to keep compatibility with modern canonical
usage of installation variables in Linux.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-11 18:55:30 -02:00
Claudio Matsuoka
208b9e5134 Change makefile rules for compatibility
Not all non-GNU make(1) utility recognize $* in Makefile rule dependencies,
changed to a more compatible format to work e.g. with BSD make.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-11 17:58:39 -02:00
Claudio Matsuoka
f926ed97ac Address ignored return value warnings in chkfont
Actually verify return values of fgets() and fscanf() in chkfont instead
of disabling the warning.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-11 17:54:24 -02:00
Claudio Matsuoka
7981f92538 Add compiler definitions for clang
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-11 17:27:19 -02:00
Claudio Matsuoka
e906b5fd72 Update Makefile to meet modern standards
Changed Makefile to use BINDIR as the destination for binary files instead
of DESTDIR, and reserve DESTDIR as the extra installation prefix commonly
used in package building.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-11 14:32:30 -02:00
Claudio Matsuoka
27cd08716a Address compiler warnings
Add missing headers, remove unused variables, specify implicit types.
Ensure compatibility with ancient systems is maintained.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-10 08:04:29 -02:00
Claudio Matsuoka
47c9d2db33 Import FIGlet 2.2.2
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
2011-01-10 07:37:04 -02:00