Hello community, here is the log from the commit of package hxtools for openSUSE:Factory checked in at 2020-02-11 22:25:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hxtools (Old) and /work/SRC/openSUSE:Factory/.hxtools.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hxtools" Tue Feb 11 22:25:55 2020 rev:36 rq:767498 version:20200126 Changes: -------- --- /work/SRC/openSUSE:Factory/hxtools/hxtools.changes 2019-06-19 20:55:37.813838591 +0200 +++ /work/SRC/openSUSE:Factory/.hxtools.new.26092/hxtools.changes 2020-02-11 22:26:22.731599572 +0100 @@ -1,0 +2,8 @@ +Sun Jan 26 14:39:46 UTC 2020 - Jan Engelhardt <[email protected]> + +- Update to release 20200126 + * vfontas: add full vectorizer for SFD glyphs + * vfontas: improved ascent/descent values for vector output + * vfontas: hex format misreading was fixed + +------------------------------------------------------------------- Old: ---- hxtools-20190428.tar.asc hxtools-20190428.tar.xz New: ---- hxtools-20200126.tar.asc hxtools-20200126.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hxtools.spec ++++++ --- /var/tmp/diff_new_pack.Wq9PjH/_old 2020-02-11 22:26:23.515600002 +0100 +++ /var/tmp/diff_new_pack.Wq9PjH/_new 2020-02-11 22:26:23.519600004 +0100 @@ -17,7 +17,7 @@ Name: hxtools -Version: 20190428 +Version: 20200126 Release: 0 Summary: Collection of day-to-day tools (binaries) License: GPL-2.0+ and WTFPL @@ -56,7 +56,7 @@ * ofl(1) — open file lister (replaces fuser and lsof -m) * tailhex(1) — hex dumper with tail-following support * utmp_register(1) — make entries in the utmp/wtmp database -* vfontas(1) — VGA font file assembler +* vfontas(1) — Bitmap font transformation utility %package scripts Summary: Collection of day-to-day tools (scripts) @@ -166,6 +166,7 @@ %install %make_install b="%buildroot" +mv "$b/%_bindir"/extract_* "$b/%_libexecdir/%name/" mv "$b/%_bindir/rot13" "$b/%_libexecdir/%name/" install -dm0755 "$b/%_datadir/mc/syntax" install -pm0644 cooledit/*.syntax "$b/%_datadir/mc/syntax/" @@ -188,23 +189,23 @@ %defattr(-,root,root) %doc LICENSE* %_bindir/bin2c +%_bindir/bsvplay %_bindir/declone %_bindir/gxxdm %_bindir/hcdplay +%_bindir/pcmdiff +%_bindir/proc_iomem_count +%_bindir/proc_stat_parse +%_bindir/qplay %_bindir/tailhex +%_bindir/vfontas %_bindir/xcp %dir %hldir -%hldir/bsvplay %hldir/cctypeinfo -%hldir/pcmdiff %hldir/peicon -%hldir/proc_iomem_count -%hldir/proc_stat_parse %hldir/psthreads -%hldir/qplay %hldir/rot13 %hldir/utmp_register -%hldir/vfontas %files scripts %defattr(-,root,root) @@ -216,6 +217,7 @@ %_bindir/gpsh %_bindir/man2html %_bindir/mkvappend +%_bindir/mod2opus %_bindir/pegrep %_bindir/pesubst %_bindir/qpdecode @@ -228,17 +230,13 @@ %hldir/diff2php %hldir/doxygen-kerneldoc-filter %hldir/extract_* -%hldir/git-* %hldir/ldif-duplicate-attrs %hldir/ldif-leading-spaces %hldir/logontime %hldir/mailsplit -%hldir/mod2opus %hldir/recursive_lower %hldir/rezip -%hldir/shared.pm %hldir/sourcefuncsize -%hldir/stxdb %hldir/vcsaview %files man @@ -254,7 +252,6 @@ %config %_sysconfdir/openldap/schema/* %_datadir/%name %_datadir/kbd -%_datadir/fonts/misc %_datadir/mc %if 0%{?build_profile} @@ -280,10 +277,10 @@ %files -n sysinfo %defattr(-,root,root) -%_bindir/clock_info %_bindir/pmap_dirty %_bindir/sysinfo %dir %hldir +%hldir/clock_info %hldir/hxnetload %hldir/paddrspacesize %hldir/proc_stat_signal_decode ++++++ hxtools-20190428.tar.xz -> hxtools-20200126.tar.xz ++++++ ++++ 3463 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/LICENSES.txt new/hxtools-20200126/LICENSES.txt --- old/hxtools-20190428/LICENSES.txt 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/LICENSES.txt 2020-01-26 15:28:25.000000000 +0100 @@ -50,7 +50,6 @@ smm/pcmdiff WTFPL-2.0+ smm/qplay GPL-2.0+ smm/ssa2srt WTFPL-2.0+ -smm/stxdb GPL-2.0+ smm/vfontas GPL-3.0+ suser/437cipher WTFPL-2.0+ suser/declone WTFPL-2.0+ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/build-aux/compile new/hxtools-20200126/build-aux/compile --- old/hxtools-20190428/build-aux/compile 2019-04-28 20:44:00.376715440 +0200 +++ new/hxtools-20200126/build-aux/compile 2020-01-26 15:30:22.903533153 +0100 @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2018-03-07.03; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # Written by Tom Tromey <[email protected]>. # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # 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, see <https://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -340,7 +340,7 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/build-aux/missing new/hxtools-20200126/build-aux/missing --- old/hxtools-20190428/build-aux/missing 2019-04-28 20:44:00.384715363 +0200 +++ new/hxtools-20200126/build-aux/missing 2020-01-26 15:30:22.911533238 +0100 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2018-03-07.03; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # 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, see <https://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ exit $st fi -perl_URL=https://www.perl.org/ -flex_URL=https://github.com/westes/flex -gnu_software_URL=https://www.gnu.org/software +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software program_details () { @@ -207,7 +207,7 @@ exit $st # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/configure.ac new/hxtools-20200126/configure.ac --- old/hxtools-20190428/configure.ac 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/configure.ac 2020-01-26 15:28:25.000000000 +0100 @@ -1,4 +1,4 @@ -AC_INIT([hxtools], [20190428]) +AC_INIT([hxtools], [20200126]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) AC_PROG_INSTALL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/doc/Makefile.am new/hxtools-20200126/doc/Makefile.am --- old/hxtools-20190428/doc/Makefile.am 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/doc/Makefile.am 2020-01-26 15:28:25.000000000 +0100 @@ -42,7 +42,6 @@ sourcefuncsize.1 \ spec-beautifier.1 \ ssa2srt.1 \ - stxdb.1 \ sysinfo.1 \ tailhex.1 \ utmp_register.8 \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/doc/NEWS.txt new/hxtools-20200126/doc/NEWS.txt --- old/hxtools-20190428/doc/NEWS.txt 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/doc/NEWS.txt 2020-01-26 15:28:25.000000000 +0100 @@ -1,4 +1,11 @@ +rel-20200124 +============ +* vfontas: add full vectorizer for SFD glyphs +* vfontas: improved ascent/descent values for vector output +* vfontas: hex format misreading was fixed + + rel-20190428 ============ * vfontas: new implementation. Replaces clt2bdf, clt2pbm, cltxscale, fnt2bdf. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/doc/hxtools.7 new/hxtools-20200126/doc/hxtools.7 --- old/hxtools-20190428/doc/hxtools.7 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/doc/hxtools.7 2020-01-26 15:28:25.000000000 +0100 @@ -116,8 +116,6 @@ .PP \fBssa2srt\fP(1) \(en convert SubStation Alpha (SSA) subtitles to SubRip (SRT) .PP -\fBstxdb\fP(1) \(en A/V file database -.PP \fBsu1\fP(8) \(en what sudo should have done .PP \fBsysinfo\fP(1) \(en print IRC\-style system information banner diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/doc/stxdb.1 new/hxtools-20200126/doc/stxdb.1 --- old/hxtools-20190428/doc/stxdb.1 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/doc/stxdb.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,71 +0,0 @@ -.TH stxdb 1 "2008-02-06" "hxtools" "hxtools" -.SH Name -.PP -stxdb \(em A/V file database -.SH Syntax -.PP -\fBstxdb\fP [\fB\-MSWal\fP] [\fB\-A\fP \fIdir\fP] [\fB\-V\fP \fIvolid\fP] -[\fB\-f\fP \fIfile\fP] [\fB\-o\fP \fIopt\fP] -.SH Options -.PP -The options may seem weird, because they are flags, not commands. This means -that the order of execution is always "Load database", "Add directory", "Save -database", "Show database". You just specify _which_ of these you want to run, -and if it's all four. -.TP -\fB\-A\fP \fIdir\fP -Directory which should be added to the database. -.TP -\fB\-M\fP -Mount the directory given by \-A before adding. -.TP -\fB\-S\fP -Save the database. (Not specifying this would make for a dry run.) -.TP -\fB\-V\fP \fIvolid\fP -Tag the directory with volid in the database. -.TP -\fB\-W\fP -Show database. -.TP -\fB\-a\fP -Show only artists. -.TP -\fB\-f\fP \fIfile\fP -Use specified file as database. -.TP -\fB\-l\fP -Show only albums. -.TP -\fB\-o\fP \fIopt\fP -Set arbitrary option. -.SH Examples -.PP -Examples for common operations: -.PP -Adding a CD to the database, using \-M to make stxdb mount it: -.PP -.nf - stxdb \-A /mnt \-MSV "Private Collection CD #34" -.fi -.PP -Adding a directory (w/o mount!): -.PP -.nf - stxdb \-A /bla/dir \-SV "Private Collection CD #35" -.fi -.PP -Show database: -.PP -.nf - stxdb \-W -.fi -.PP -Rebuild database: -.PP -.nf - stxdb \-S -.fi -.SH See also -.PP -\fBhxtools\fP(7) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/doc/vfontas.1 new/hxtools-20200126/doc/vfontas.1 --- old/hxtools-20190428/doc/vfontas.1 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/doc/vfontas.1 2020-01-26 15:28:25.000000000 +0100 @@ -59,14 +59,15 @@ in various ways. .SS blankfnt .PP -Initializes the memory buffer with 256 empty 8x16 glyphs. The use for this is -with \fBsaveclt\fP to get 256 blank glyph files for hand-editing. +Initializes the memory buffer with 256 empty 8x16 glyphs. The primary purpose +for this is with \fBsaveclt\fP to get blank glyph files for hand-editing. For a +differently-sized canvas, combine with \fB\-crop\fP or \fB\-canvas\fP. .SS canvas .PP Enlarges the glyph box to the specified size. (It never shrinks it.) .SS clearmap .PP -Discards the Unicode mapping table. +Discards the in-memory glyph index <-> Unicode mapping table. .SS crop .PP Removes an outer area from the glyph images, shrinking the image in the process. @@ -87,6 +88,10 @@ Reads a headerless bitmap font file, as typically used for CGA/EGA/VGA/MDA hardware, from the specified file into memory. 8x8x256 (width/height/glyphs), 8x12x256, 8x14x256, 8x16x256 and 8x16x512 are supported. +.SS loadfnth +.PP +Reads a headerless bitmap font file, using the specified height N and width 8. +The number of characters is then autoderived from the filesize. .SS loadhex .PP Reads a Unifont .hex encoded file. @@ -95,15 +100,19 @@ Reads a glyphindex <-> Unicode codepoint mapping table from the given file into memory. The format follows the maps from /usr/share/kbd/unimaps, that is, "0x00 U+0000" at its simplest. Multiple U+ codepoints can be specified in a line. +\fB\-loadmap\fP does not clear the mapping table, which makes it possible to +cumulate mappings from multiple files. .SS loadpsf .PP -Reads a PC Screen Font PSF 2 version 0. +Reads a PC Screen Font PSF 2 version 0. If the psf file comes with a mapping +table, the current in-memory table will be discarded and replaced with the one +from the PSF. .SS savebdf .PP -Saves the font to a Glyph Bitmap Distribution Format file (BDF). This typefile -can be processed further by other tools such as bdftopcf(1) or fontforge(1) to, -for example, turn them into Portable Compiled Format (PCF) or TrueType/OpenType -(TTF/OTF) files. (See the "Examples" section.) +Saves the font to a Glyph Bitmap Distribution Format file (BDF). This type of +file can be processed further by other tools such as bdftopcf(1) or +fontforge(1) to, for example, turn them into Portable Compiled Format (PCF) or +TrueType/OpenType (TTF/OTF) files. (See the "Examples" section.) .SS saveclt .PP Saves the current in-memory glyphs as multiple CLT files to the given @@ -119,25 +128,29 @@ .SS savepsf .PP Saves the current in-memory glyphs as a PC Screen Font PSF2.0 file, which can -then be loaded into a Linux text console with setfont(1). +then be loaded into a Linux text console with setfont(1). The in-memory Unicode +mapping table is added to the PSF. .SS savesfd .PP Saves the font to a Spline Font Database file (SFD). This type of file can be processed further by fontforge(1). .SS upscale .PP -Performs a linear upscale by an integral factor in both dimensions for all -glyphs. +Performs a linear upscale by an integral factor for all glyphs. .SS xbrz .PP -Performs a xBRZ upscale by an integral factor. +Performs a xBRZ upscale by an integral factor. xBRZ 1.6 supports up to factor +6. (Higher factors will result in an empty glyph box.) .SS xcpi .PP Extracts a multi-font .cpi file (as was typically used on DOS) as separate .fnt -files into the specified directory. +files into the specified directory. This operation does not touch the in-memory +glyph buffers or Unicode mapping table. .SS xlat .PP Moves all glyphs around within their canvases by the specified amount. +vfontas's coordinate system has (0,0) in the upper left corner, with positive x +going to the right, and positive y going down. .SH Known limits .PP The Linux kernel accepts console font glyphs of at most 32x32 in size. @@ -168,8 +181,8 @@ .PP .RS 4 .nf -vfontas \-loadfnt /usr/share/kbd/consolefonts/mu.fnt \-loadmap -/usr/share/kbd/unimaps/cp437.uni saveclt +mkdir mu; vfontas \-loadfnt /usr/share/kbd/consolefonts/mu.fnt \-loadmap +/usr/share/kbd/unimaps/cp437.uni \-saveclt mu/ .fi .RE .PP @@ -183,13 +196,24 @@ .fi .RE .PP -To convert a .fnt for use under X11 and XTerm (generates sizes 12, 24 and 36): +To convert a .fnt to TrueType/OpenType/WOFF (the Fontforge part is +unfortunately manual): +.PP +.RS 4 +.nf +vfontas \-loadfnt mux.fnt \-loadmap cp437AB.uni \-canvas 9 16 \-lge \-savesfd +mux.sfd # && fontforge mux.sfd +.fi +.RE +.PP +To convert a .fnt for use under X11 and XTerm (generates sizes 12, 24 and 36, +@96dpi): .PP .RS 4 .nf -for i in 1 2 3; do vfontas \-loadfnt mux.fnt \-loadmap cp437AB.uni \-upscale $i ->$i \-savebdf \- Mux | bdftopcf | gzip >~/.fonts/mux$i.pcf.gz; -done; xterm -fa "misc Mux:size=24" +for i in 1 2 3; do vfontas \-loadfnt mux.fnt \-loadmap cp437AB.uni \-canvas 9 +16 \-lge \-upscale $i $i \-savebdf \- Mux | bdftopcf | gzip +>~/.fonts/mux$i.pcf.gz; done; xterm \-fa "misc Mux:size=24" .fi .RE .SH Comparison to earlier vfontas (2005-2018) invocation syntax diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/examples/437cipher new/hxtools-20200126/examples/437cipher --- old/hxtools-20190428/examples/437cipher 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/examples/437cipher 1970-01-01 01:00:00.000000000 +0100 @@ -1,26 +0,0 @@ -#!/usr/bin/perl -# -# An alternate simple substitution cipher to ROT13 -# written by Jan Engelhardt, 2013 -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the WTF Public License version 2 or -# (at your option) any later version. -# - -use utf8; -binmode STDIN, ":utf8"; -binmode STDOUT, ":utf8"; -if ($ARGV[0] eq "-d") { - shift @ARGV; - while (<>) { - tr[☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼]{ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^}; - print; - } -} else { - while (<>) { - tr[a-z][A-Z]; - tr{ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^}[☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼]; - print; - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/kbd/Makefile.am new/hxtools-20200126/kbd/Makefile.am --- old/hxtools-20190428/kbd/Makefile.am 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/kbd/Makefile.am 2020-01-26 15:28:25.000000000 +0100 @@ -1,11 +1,5 @@ # -*- Makefile -*- -x11fonts = mux_9x16.pcf.gz mux_17x32.pcf.gz rhx_9x16.pcf.gz \ - rhx_17x32.pcf.gz tosh_9x16.pcf.gz tosh_17x32.pcf.gz -x11miscdir = ${x11fontdir}/misc -x11misc_DATA = ${x11fonts} -CLEANFILES = ${x11fonts} - qwertydir = ${kbddatadir}/keymaps/i386/qwerty dist_qwerty_DATA = us_jng.map us_jng_vaiou3.map @@ -13,10 +7,7 @@ dist_qwertz_DATA = de_jng.map vgafontdir = ${kbddatadir}/consolefonts -dist_vgafont_DATA = A1.fnt B1.fnt ati.fnt gotik-textura.fnt ital.fnt mux.fnt \ - neuropol.fnt nvidia.fnt \ - rhx.fnt tosh.fnt \ - ega437_8x16.fnt ega437_8x14.fnt ega437_8x8.fnt +dist_vgafont_DATA = A1.fnt B1.fnt mux.fnt neuropol.fnt unimapdir = ${kbddatadir}/unimaps dist_unimap_DATA = cp437AB.uni @@ -24,16 +15,3 @@ fontgen1 = ${AM_V_GEN} ../smm/vfontas -loadfnt $< -loadmap ${srcdir}/cp437x.uni -canvas 9 16 -lge -savebdf - fontgen2 = ${AM_V_GEN} ../smm/vfontas -loadfnt $< -loadmap ${srcdir}/cp437x.uni -upscale 2 2 -canvas 17 32 -lge -savebdf - fontout = bdftopcf | gzip -9 >$@ - -mux_9x16.pcf.gz: mux.fnt - ${fontgen1} mux | ${fontout} -mux_17x32.pcf.gz: mux.fnt - ${fontgen2} mux | ${fontout} -rhx_9x16.pcf.gz: rhx.fnt - ${fontgen1} rhx | ${fontout} -rhx_17x32.pcf.gz: rhx.fnt - ${fontgen2} rhx | ${fontout} -tosh_9x16.pcf.gz: tosh.fnt - ${fontgen1} tosh | ${fontout} -tosh_17x32.pcf.gz: tosh.fnt - ${fontgen2} tosh | ${fontout} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/kbd/README new/hxtools-20200126/kbd/README --- old/hxtools-20190428/kbd/README 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/kbd/README 2020-01-26 15:28:25.000000000 +0100 @@ -72,26 +72,9 @@ B1.fnt A font with more soft roundings in upper-case and digit glyphs. To be used with cp437AB.uni. -ati.fnt - ATI ROM font -ega*.fnt - EGA.CPI -gotik-textura.fnt - a Blackletter-Textura font (1994) -ital.fnt - a sans-serif oblique font (1994) mu0.fnt sans-serif font mu.fnt from the SUSE "kbd" package mux.fnt a geometric, sans-serif font with serifs on a few glyphs by myself (Jan), reuses some dingbat glyphs from mu -nvidia.fnt - AMIBIOS/NVIDIA ROM font -rhx.fnt - a serif roman font - r.fnt from the SUSE "kbd" package, alterations -tosh.fnt - A narrow geometric sans-serif font. All glyphs are 7 pixels - wide, for use with 8-pixel character cells. - CrystalLogic CS55554 ROM Binary files old/hxtools-20190428/kbd/ati.fnt and new/hxtools-20200126/kbd/ati.fnt differ Binary files old/hxtools-20190428/kbd/ega437_8x14.fnt and new/hxtools-20200126/kbd/ega437_8x14.fnt differ Binary files old/hxtools-20190428/kbd/ega437_8x16.fnt and new/hxtools-20200126/kbd/ega437_8x16.fnt differ Binary files old/hxtools-20190428/kbd/ega437_8x8.fnt and new/hxtools-20200126/kbd/ega437_8x8.fnt differ Binary files old/hxtools-20190428/kbd/gotik-textura.fnt and new/hxtools-20200126/kbd/gotik-textura.fnt differ Binary files old/hxtools-20190428/kbd/ital.fnt and new/hxtools-20200126/kbd/ital.fnt differ Binary files old/hxtools-20190428/kbd/nvidia.fnt and new/hxtools-20200126/kbd/nvidia.fnt differ Binary files old/hxtools-20190428/kbd/rhx.fnt and new/hxtools-20200126/kbd/rhx.fnt differ Binary files old/hxtools-20190428/kbd/tosh.fnt and new/hxtools-20200126/kbd/tosh.fnt differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/sadmin/Makefile.am new/hxtools-20200126/sadmin/Makefile.am --- old/hxtools-20190428/sadmin/Makefile.am 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/sadmin/Makefile.am 2020-01-26 15:28:25.000000000 +0100 @@ -3,20 +3,13 @@ AM_CPPFLAGS = ${regular_CPPFLAGS} ${libHX_CFLAGS} AM_CFLAGS = ${regular_CFLAGS} -bin_PROGRAMS = \ - clock_info \ - ofl +bin_PROGRAMS = ofl proc_iomem_count proc_stat_parse dist_bin_SCRIPTS = \ pmap_dirty \ su1 -pkglibexec_PROGRAMS = \ - fd0ssh \ - proc_iomem_count \ - proc_stat_parse \ - psthreads \ - utmp_register +pkglibexec_PROGRAMS = clock_info fd0ssh psthreads utmp_register dist_pkglibexec_SCRIPTS = \ logontime \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/sdevel/Makefile.am new/hxtools-20200126/sdevel/Makefile.am --- old/hxtools-20190428/sdevel/Makefile.am 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/sdevel/Makefile.am 2020-01-26 15:28:25.000000000 +0100 @@ -11,7 +11,9 @@ checkbrack \ cwdiff \ git-author-stat \ + git-blame-stats \ git-forest \ + git-revert-stats \ git-track \ man2html \ spec-beautifier @@ -23,8 +25,6 @@ dist_pkglibexec_SCRIPTS = \ diff2php \ doxygen-kerneldoc-filter \ - git-blame-stats \ - git-revert-stats \ paddrspacesize \ proc_stat_signal_decode \ sourcefuncsize diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/smm/Makefile.am new/hxtools-20200126/smm/Makefile.am --- old/hxtools-20190428/smm/Makefile.am 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/smm/Makefile.am 2020-01-26 15:28:25.000000000 +0100 @@ -4,24 +4,9 @@ AM_CFLAGS = ${regular_CFLAGS} AM_CXXFLAGS = ${regular_CXXFLAGS} -bin_PROGRAMS = hcdplay - -dist_bin_SCRIPTS = aumeta gpsh mkvappend ssa2srt - -pkglibexec_PROGRAMS = \ - bsvplay \ - pcmdiff \ - qplay \ - vfontas - -dist_pkglibexec_SCRIPTS = \ - extract_d3pkg \ - extract_dxhog \ - extract_f3pod \ - extract_qupak \ - mod2opus \ - shared.pm \ - stxdb +bin_PROGRAMS = bsvplay hcdplay pcmdiff qplay vfontas +dist_bin_SCRIPTS = aumeta extract_d3pkg extract_dxhog extract_f3pod \ + extract_qupak extract_dfqshared.pm gpsh mod2opus mkvappend ssa2srt bsvplay_SOURCES = bsvplay.c pcspkr_pcm.c bsvplay_LDADD = ${libHX_LIBS} -lm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/smm/aumeta new/hxtools-20200126/smm/aumeta --- old/hxtools-20190428/smm/aumeta 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/smm/aumeta 2020-01-26 15:28:25.000000000 +0100 @@ -40,6 +40,7 @@ push(@args, $strip_video ? "-vn" : ("-vcodec", "copy")); foreach my $key (keys %meta) { if (defined($meta{$key})) { + push(@args, "-metadata:s", "$key=$meta{$key}"); push(@args, "-metadata", "$key=$meta{$key}"); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/smm/extract_dfqshared.pm new/hxtools-20200126/smm/extract_dfqshared.pm --- old/hxtools-20190428/smm/extract_dfqshared.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/hxtools-20200126/smm/extract_dfqshared.pm 2020-01-26 15:28:25.000000000 +0100 @@ -0,0 +1,77 @@ +#!/usr/bin/perl + +use strict; + +sub getcf () +{ + local *FH = shift @_; + my $size = shift @_; + my $buf; + read(FH, $buf, $size); + return $buf; +} + +sub mkdir_p () +{ + my $fullpath = shift @_; + my @list; + + if (-d $fullpath) { + return; + } + + $fullpath =~ s/\/+$//go; + $fullpath =~ s/^~(?!\w)/$ENV{HOME}/so; + $fullpath =~ s/\/$//so; + @list = split(/\//so, $fullpath); + + for (my $i = 0; $i < scalar(@list); ++$i) { + my $dir = join("/", @list[0..$i]); + if ($dir eq "") { + next; + } + if (!-e $dir && !mkdir($dir)) { + return 0; + } + } + + return 1; +} + +sub mkdir_p_stripbase () +{ + my $s = shift @_; + + $s =~ s{^(.*)/.*}{$1}is; + return &mkdir_p($s); +} + +sub transfer () +{ + local *OUT = shift @_; + local *IN = shift @_; + my $size = shift @_; + my $offset = shift @_; + my $saved_offset; + my $buf; + + if (defined($offset)) { + $saved_offset = tell(IN); + seek(IN, $offset, 0); + } + + while ($size > 0) { + my $rem = ($size > 4096) ? 4096 : $size; + read(IN, $buf, $rem); + print OUT $buf; + $size -= $rem; + } + + if (defined($offset)) { + seek(IN, $saved_offset, 0); + } + + return; +} + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/smm/shared.pm new/hxtools-20200126/smm/shared.pm --- old/hxtools-20190428/smm/shared.pm 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/smm/shared.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,77 +0,0 @@ -#!/usr/bin/perl - -use strict; - -sub getcf () -{ - local *FH = shift @_; - my $size = shift @_; - my $buf; - read(FH, $buf, $size); - return $buf; -} - -sub mkdir_p () -{ - my $fullpath = shift @_; - my @list; - - if (-d $fullpath) { - return; - } - - $fullpath =~ s/\/+$//go; - $fullpath =~ s/^~(?!\w)/$ENV{HOME}/so; - $fullpath =~ s/\/$//so; - @list = split(/\//so, $fullpath); - - for (my $i = 0; $i < scalar(@list); ++$i) { - my $dir = join("/", @list[0..$i]); - if ($dir eq "") { - next; - } - if (!-e $dir && !mkdir($dir)) { - return 0; - } - } - - return 1; -} - -sub mkdir_p_stripbase () -{ - my $s = shift @_; - - $s =~ s{^(.*)/.*}{$1}is; - return &mkdir_p($s); -} - -sub transfer () -{ - local *OUT = shift @_; - local *IN = shift @_; - my $size = shift @_; - my $offset = shift @_; - my $saved_offset; - my $buf; - - if (defined($offset)) { - $saved_offset = tell(IN); - seek(IN, $offset, 0); - } - - while ($size > 0) { - my $rem = ($size > 4096) ? 4096 : $size; - read(IN, $buf, $rem); - print OUT $buf; - $size -= $rem; - } - - if (defined($offset)) { - seek(IN, $saved_offset, 0); - } - - return; -} - -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/smm/stxdb new/hxtools-20200126/smm/stxdb --- old/hxtools-20190428/smm/stxdb 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/smm/stxdb 1970-01-01 01:00:00.000000000 +0100 @@ -1,303 +0,0 @@ -#!/usr/bin/perl -# -# stxdb 2.1 (Audio file database) -# Copyright © Jan Engelhardt <jengelh [at] medozas de>, 2005 - 2007 -# -# 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. -# -use Data::Dumper; -use Encode; -use Getopt::Long; -use strict; - -binmode STDIN, ":utf8"; -binmode STDOUT, ":utf8"; -select((select(STDERR), $| = 1)[0]); -my $EXTENSIONS = qr/\.(ogg|mp3|it|mid|divx?|mpe?g)/i; - -# Data::Dumper configuration -$Data::Dumper::Useqq = 1; -$Data::Dumper::Indent = 1; - -# Option gathering -my @Addpt; -my $Convert; -my $Db_file; -my $Do_mount; -my $Do_save_db; -my $Do_show_db; -my $Vol_id; -my %Opts; - -&Getopt::Long::Configure(qw(bundling pass_through)); -&GetOptions( - "A=s" => \@Addpt, # path to directory which to add - "C" => \$Convert, - "M" => \$Do_mount, # (un)mount each "add" target - "S" => \$Do_save_db, # save database after operation - "V=s" => \$Vol_id, # volume identifier - "W" => \$Do_show_db, # show database after operation - "a" => \$Opts{artist}, - "f=s" => \$Db_file, # use specified file - "l" => \$Opts{album}, - "o=s" => \%Opts, -); - -&load_db(); -&process_add(); -if($Convert) { &convert_db(); } -if($Do_save_db) { &save_db(); } -if($Do_show_db) { &show_db(); } - -#------------------------------------------------------------------------------ -sub add_target () -{ - my $count = 0; # added this many files - my($vol_id, $dir) = @_; - - foreach my $filename (`find "$dir" -type f`) { - my($artist, $album, $title); - - chomp $filename; - if ($filename !~ /$EXTENSIONS/s) { - next; - } - - ++$count; - my $filesize = -s $filename; - $filename =~ s[^\Q$dir\E/][]; - - my $regname = $filename; - $regname =~ s/$EXTENSIONS$//s; - - # - # Different kinds of naming schemes: - # - if ($regname =~ m{([^/]+)\s+-\s+([^/]+)/([^/]+)$}) { - # - # >> "Artist - Album/Title" - # - # This storage method is obviously used for complete albums. - # - ($artist, $album, $title) = ($1, $2, $3); - } elsif ($regname =~ m{([^/]+)/([^/]+)$}) { - # - # >> "Artist/Title.ogg" - # - # This one is used when you do not want to sort by album, probably - # because: - # - you do not have the full album and thus intermix them - # - the track does not belong to any album or - # - has more than one "home" album - # - ($artist, $album, $title) = ($1, undef, $2); - } elsif ($regname =~ m{([^/]+)\s+-\s+([^/]+)$}) { - # - # >> "Artist - Title.ogg" - # - # This is like the above, but used when there are X (depends on - # personal preference, I use 3 or 4 for X) or less files for that - # artist on the volume. - # - ($artist, $album, $title) = ($1, undef, $2); - } else { - # - # >> "Single file.ogg" - # - # For files which do not [quite] have an artist, for example the - # "Star Trek TNG Theme". (You could use "Theme" as artist, though.) - # To give a clearer example: "Cool Cat". Go figure. - # - ($artist, $album, $title) = (undef, undef, $regname); - - # Print a warning; maybe this file was not recognized by the above - # regular expressions. - print STDERR "Warning: Adding single file \"$filename\"\n"; - } - - $::DB->{$artist}{$album}{$title} = [$filesize, "$vol_id/$filename"]; - } - - return $count; -} - -# -# Process -f option: Load database -# -sub load_db () -{ - if ($Db_file eq "") { - my $name = getpwuid($>); - if ($name eq "") { - $Db_file = "stxdb.dat"; - } else { - $Db_file = "stxdb-$name.dat"; - } - do $Db_file; - } else { - # Explicit filename was given, so croak if it cannot be loaded - do $Db_file || die "Error loading database: $!\n"; - } - return; -} - -# -# Process -A targets, if any. -# -sub process_add () -{ - foreach my $pt (@Addpt) { - if($Do_mount) { - system "mount", $pt; - } - &add_target($Vol_id, $pt); - if($Do_mount) { - system "umount", $pt; - } - } - return; -} - -# -# Process -S -# -sub save_db () -{ - my $db = Dumper($::DB); - $db =~ s[^\$VAR1 = \{][\$::DB = \{]s; # }} - - open(OUT, "> $Db_file"); - print OUT "#!/usr/bin/perl\n", $db; - close OUT; - return 1; -} - -sub convert_db () -{ - my $ND = {}; - - while (my($artist, $album_hash) = each %$::DB) { - print "Converting artist \"", $artist, "\"\n"; - my $artist_utf = decode("utf-8", $artist); - my $NA = {}; - $ND->{$artist_utf} = $NA; - - while (my($album, $title_hash) = each %$album_hash) { - print "Converting album \"", $album, "\"\n"; - my $album_utf = decode("utf-8", $album); - my $NT = {}; - $NA->{$album_utf} = $NT; - - while (my($title, $title_data) = each %$title_hash) { - print "Converting title \"", $title, "\"\n"; - my $title_utf = decode("utf-8", $title); - $NT->{$title_utf} = $title_data; - } - } - } - - $::DB = $ND; - return; -} - -# -# Process -W -# Displays the database in a nice text-tabular format. -# show_db() is always executed after save_db(), so that bytes-per-artist -# are not stored in the database. -# -sub show_db () -{ - my($total_files, $total_size) = (0, 0); - - printf "%-50s %16s LOCATION\n", "ARTIST / ALBUM / TITLE", "FILES / SIZE"; - print "-" x 160, "\n"; - - # - # Compute bytes-per-artist, bytes-per-album and total sizes - # Will use "each" since order does not matter here. - # - my $stat = {}; - while (my($artist, $album_hash) = each %$::DB) { - while (my($album, $title_hash) = each %$album_hash) { - while (my($title, $title_data) = each %$title_hash) { - ++$total_files; - $total_size += $title_data->[0]; - ++$stat->{$artist}[0]; - $stat->{$artist}[1] += $title_data->[0]; - ++$stat->{$artist}[2]{$album}; - $stat->{$artist}[3]{$album} += $title_data->[0]; - } - } - } - - # Now traverse the assoc arrays for printing - foreach my $artist (sort keys %$::DB) { - my $album_hash = $::DB->{$artist}; - my $indent = 0; - if ($artist ne "") { - printf "%-42s %25s\n", "$artist >", - sprintf "(%u files, %.1f MB)", - $stat->{$artist}[0], - $stat->{$artist}[1] / 1048576; - $indent += 2; - } - # -o artist shows only ... artists - if (defined $Opts{artist}) { - next; - } - &show_albums($artist, $album_hash, $stat, $indent); - } - - print "-" x 160, "\n"; - printf "%-50s %16s (%.1f MB, %.2f GB, %.2f TB)\n", - $total_files." files", &commify($total_size, "_"), - $total_size / (1024 ** 2), $total_size / (1024 ** 3), - $total_size / (1024 ** 4); - return; -} - -sub show_albums () -{ - my($artist, $album_hash, $stat, $indent) = @_; - - foreach my $album (sort keys %$album_hash) { - my $title_hash = $album_hash->{$album}; - - if ($album ne "") { - printf " %-39s %25s\n", "$album >", - sprintf "(%u files, %.1f MB)", - $stat->{$artist}[2]{$album}, - $stat->{$artist}[3]{$album} / 1048576; - $indent += 2; - } - - if (!defined($Opts{album})) { - # show_titles() - my $len = 57 - $indent; - foreach my $title (sort keys %$title_hash) { - printf "%s%-*s %9d %13s %s\n", " " x $indent, - $len, $title, @{$title_hash->{$title}}; - } - } - - if ($album ne "") { - $indent -= 2; - } - } - - return; -} - -sub commify () -{ - # from perl manuals - my $v = shift @_; - my $sep = shift(@_) || ","; - while($v =~ s/^([-+]?\d+)(\d{3})/$1$sep$2/) { - } - return $v; -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/smm/vfalib.cpp new/hxtools-20200126/smm/vfalib.cpp --- old/hxtools-20190428/smm/vfalib.cpp 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/smm/vfalib.cpp 2020-01-26 15:28:25.000000000 +0100 @@ -14,6 +14,7 @@ #include <map> #include <memory> #include <numeric> +#include <set> #include <sstream> #include <string> #include <utility> @@ -166,11 +167,9 @@ void font::lge() { - for (unsigned int k = 0xC0; k <= 0xDF; ++k) { - if (m_glyph.size() < k) - break; + auto max = std::min(0xE0U, static_cast<unsigned int>(m_glyph.size())); + for (unsigned int k = 0xC0; k < max; ++k) m_glyph[k].lge(); - } } void font::xbrz(unsigned int factor, unsigned int mode) @@ -281,28 +280,33 @@ if (m_unicode_map == nullptr) m_unicode_map = std::make_shared<unicode_map>(); - char line[80], gbits[16]; + hxmc_t *line = nullptr; size_t lnum = 0; - while (fgets(line, sizeof(line), fp.get()) != nullptr) { + while (HX_getl(&line, fp.get()) != nullptr) { ++lnum; char *end; - auto cp = strtoul(line, &end, 0); + auto cp = strtoul(line, &end, 16); if (*end != ':') continue; ++end; unsigned int z; - for (z = 0; z < sizeof(glyph) && end[0] != '\0' && end[1] != '\0'; ++z) { + char gbits[32]{}; + HX_chomp(line); + for (z = 0; z < sizeof(gbits) && end[0] != '\0' && end[1] != '\0'; + ++z, end += 2) { gbits[z] = 0; - if (end[0] >= '0' && end[0] <= '9') - gbits[z] = end[0] - '0'; - else if (HX_tolower(end[0]) >= 'A' && HX_tolower(end[0]) <= 'F') - gbits[z] = end[0] - HX_tolower(end[0]); + auto c = HX_tolower(end[0]); + if (c >= '0' && c <= '9') + gbits[z] = c - '0'; + else if (HX_tolower(end[0]) >= 'a' && HX_tolower(end[0]) <= 'f') + gbits[z] = c - 'a' + 10; gbits[z] <<= 4; - if (end[1] >= '0' && end[1] <= '9') - gbits[z] |= end[1] - '0'; - else if (HX_tolower(end[1]) >= 'A' && HX_tolower(end[1]) <= 'F') - gbits[z] |= end[1] - HX_tolower(end[1]); + c = HX_tolower(end[1]); + if (c >= '0' && c <= '9') + gbits[z] |= c - '0'; + else if (HX_tolower(end[1]) >= 'a' && HX_tolower(end[1]) <= 'f') + gbits[z] |= c - 'a' + 10; } if (z == 16) @@ -312,7 +316,9 @@ else fprintf(stderr, "load_hex: unrecognized glyph size (%u bytes) in line %zu\n", z, lnum); m_unicode_map->add_i2u(m_glyph.size() - 1, cp); + m_unicode_map->add_u2i(cp, m_glyph.size() - 1); } + HXmc_free(line); return 0; } @@ -623,15 +629,39 @@ return 0; } +std::pair<int, int> font::find_ascent_descent() const +{ + std::pair<int, int> asds{0, 0}; + if (m_glyph.size() == 0) + return asds; + int base = -1; + if (m_unicode_map->m_u2i.size() == 0) { + for (unsigned int c : {'M', 'X', 'x'}) + if (m_glyph.size() >= c) + base = std::max(base, m_glyph[c].find_baseline()); + } else { + for (unsigned int c : {'M', 'X', 'x'}) { + auto i = m_unicode_map->m_u2i.find(c); + if (i == m_unicode_map->m_u2i.cend()) + continue; + base = std::max(base, m_glyph[i->second].find_baseline()); + } + } + if (base < 0) { + asds.first = m_glyph[0].m_size.h; + return asds; + } + asds.first = base; + asds.second = m_glyph[0].m_size.h - base; + return asds; +} + int font::save_sfd(const char *file, const char *aname) { std::unique_ptr<FILE, deleter> filep(fopen(file, "w")); if (filep == nullptr) return -errno; auto fp = filep.get(); - vfsize sz0; - if (m_glyph.size() > 0) - sz0 = m_glyph[0].m_size; std::string name; if (aname != nullptr) { name = aname; @@ -640,7 +670,7 @@ } else { name = "vfontas output"; } - int ascent = sz0.h, descent = 0; + auto asds = find_ascent_descent(); fprintf(fp, "SplineFontDB: 3.0\n"); fprintf(fp, "FontName: %s\n", name.c_str()); fprintf(fp, "FullName: %s\n", name.c_str()); @@ -648,26 +678,31 @@ fprintf(fp, "Weight: medium\n"); fprintf(fp, "Version: 001.000\n"); fprintf(fp, "ItalicAngle: 0\n"); - fprintf(fp, "UnderlinePosition: -100\n"); - fprintf(fp, "UnderlineWidth: 40\n"); - fprintf(fp, "Ascent: %u\n", ascent); - fprintf(fp, "Descent: %u\n", descent); + fprintf(fp, "UnderlinePosition: -3\n"); + fprintf(fp, "UnderlineWidth: 1\n"); + fprintf(fp, "Ascent: %d\n", asds.first); + fprintf(fp, "Descent: %d\n", asds.second); fprintf(fp, "NeedsXUIDChange: 1\n"); fprintf(fp, "FSType: 0\n"); - fprintf(fp, "PfmFamily: 33\n"); + fprintf(fp, "PfmFamily: 49\n"); fprintf(fp, "TTFWeight: 500\n"); fprintf(fp, "TTFWidth: 5\n"); - fprintf(fp, "Panose: 2 0 6 4 0 0 0 0 0 0\n"); - fprintf(fp, "LineGap: 72\n"); + fprintf(fp, "Panose: 2 0 6 9 9 0 0 0 0 0\n"); + fprintf(fp, "LineGap: 0\n"); fprintf(fp, "VLineGap: 0\n"); - fprintf(fp, "OS2WinAscent: 0\n"); - fprintf(fp, "OS2WinAOffset: 1\n"); - fprintf(fp, "OS2WinDescent: 0\n"); - fprintf(fp, "OS2WinDOffset: 1\n"); - fprintf(fp, "HheadAscent: 0\n"); - fprintf(fp, "HheadAOffset: 1\n"); - fprintf(fp, "HheadDescent: 0\n"); - fprintf(fp, "HheadDOffset: 1\n"); + fprintf(fp, "OS2TypoAscent: %d\n", asds.first); + fprintf(fp, "OS2TypoAOffset: 0\n"); + fprintf(fp, "OS2TypoDescent: %d\n", -asds.second); + fprintf(fp, "OS2TypoDOffset: 0\n"); + fprintf(fp, "OS2TypoLinegap: 0\n"); + fprintf(fp, "OS2WinAscent: %d\n", asds.first); + fprintf(fp, "OS2WinAOffset: 0\n"); + fprintf(fp, "OS2WinDescent: %d\n", asds.second); + fprintf(fp, "OS2WinDOffset: 0\n"); + fprintf(fp, "HheadAscent: %d\n", asds.first); + fprintf(fp, "HheadAOffset: 0\n"); + fprintf(fp, "HheadDescent: %d\n", -asds.second); + fprintf(fp, "HheadDOffset: 0\n"); fprintf(fp, "Encoding: UnicodeBmp\n"); fprintf(fp, "UnicodeInterp: none\n"); fprintf(fp, "DisplaySize: -24\n"); @@ -679,16 +714,101 @@ if (m_unicode_map == nullptr) { for (size_t idx = 0; idx < m_glyph.size(); ++idx) - save_sfd_glyph(fp, idx, idx, ascent, descent); + save_sfd_glyph(fp, idx, idx, asds.first, asds.second); } else { for (const auto &pair : m_unicode_map->m_u2i) - save_sfd_glyph(fp, pair.second, pair.first, ascent, descent); + save_sfd_glyph(fp, pair.second, pair.first, asds.first, asds.second); } fprintf(fp, "EndChars\n"); fprintf(fp, "EndSplineFont\n"); return 0; } +class vectorizer final { + public: + using vertex = std::pair<unsigned int, unsigned int>; + using edge = std::pair<vertex, vertex>; + void set(unsigned int, unsigned int); + void finalize(); + std::vector<edge> pop_poly(); + + private: + void add_edge(edge &&e) { emap.insert(std::move(e)); } + std::set<edge> emap; +}; + +void vectorizer::set(unsigned int x, unsigned int y) +{ + /* TTF/OTF spec wants CCW orientation */ + add_edge({{x, y}, {x, y + 1}}); + add_edge({{x, y + 1}, {x + 1, y + 1}}); + add_edge({{x + 1, y + 1}, {x + 1, y}}); + add_edge({{x + 1, y}, {x, y}}); +} + +void vectorizer::finalize() +{ + /* + * Remove overlaps: As enforced by set(), all the polygons are added + * with the same orientation. Polygons at most touch, and never + * overlap. Joining polygons therefore simply requires removing shared + * contradirectional edges. The remaining set of edges then forms a new + * set of polygons, and, as the edges themselves were never reoriented, + * these polygons have the correct orientation. + */ + for (auto i = emap.begin(); i != emap.end(); ) { + auto j = emap.find({i->second, i->first}); + if (j == emap.cend()) { + ++i; + continue; + } + emap.erase(j); + i = emap.erase(i); + } +} + +static inline unsigned int dir(const vectorizer::edge &e) +{ + /* We have no diagonal lines, so this is fine */ + const auto &v1 = e.first, &v2 = e.second; + if (v2.first == v1.first) + return v2.second < v1.second ? 180 : 0; + return v2.first < v1.first ? 270 : 90; +} + +std::vector<vectorizer::edge> vectorizer::pop_poly() +{ + std::vector<edge> poly; + if (emap.size() == 0) + return poly; + poly.push_back(*emap.begin()); + emap.erase(emap.begin()); + auto prev_dir = dir(poly[0]); + + while (true) { + if (emap.size() == 0) + break; + auto &tail_vtx = poly.rbegin()->second; + if (tail_vtx == poly.cbegin()->first) + break; + auto next = emap.lower_bound({tail_vtx, {}}); + if (next == emap.cend()) { + fprintf(stderr, "unclosed poly wtf?!\n"); + break; + } + + /* Squash redundant vertices along the way */ + auto next_dir = dir(*next); + if (next_dir == prev_dir) + tail_vtx = next->second; + else + poly.push_back(*next); + emap.erase(next); + prev_dir = next_dir; + } + return poly; +} + void font::save_sfd_glyph(FILE *fp, size_t idx, char32_t cp, int asc, int desc) { unsigned int cpx = cp; @@ -697,23 +817,29 @@ fprintf(fp, "StartChar: %04x\n", cpx); fprintf(fp, "Encoding: %u %u %u\n", cpx, cpx, cpx); fprintf(fp, "Width: %u\n", sz.w); - fprintf(fp, "TeX: 0 0 0 0\n"); - fprintf(fp, "Flags: W\n"); + fprintf(fp, "Flags: MW\n"); fprintf(fp, "Fore\n"); + fprintf(fp, "SplineSet\n"); + vectorizer vk; for (unsigned int y = 0; y < sz.h; ++y) { + unsigned int yy = sz.h - 1 - y - desc; for (unsigned int x = 0; x < sz.w; ++x) { bitpos ipos = y * sz.w + x; - if (!(g.m_data[ipos.byte] & ipos.mask)) - continue; - int yy = sz.h - 1 - y - desc; - fprintf(fp, "%d %d m 25\n", x, yy); - fprintf(fp, " %d %d l 25\n", x, yy + 1); - fprintf(fp, " %d %d l 25\n", x + 1, yy + 1); - fprintf(fp, " %d %d l 25\n", x + 1, yy); - fprintf(fp, " %d %d l 25\n", x, yy); + if (g.m_data[ipos.byte] & ipos.mask) + vk.set(x, yy); } } + vk.finalize(); + while (true) { + auto poly = vk.pop_poly(); + if (poly.size() == 0) + break; + const auto &v1 = poly.cbegin()->first; + fprintf(fp, "%d %d m 25\n", v1.first, v1.second); + for (const auto &edge : poly) + fprintf(fp, " %d %d l 25\n", edge.second.first, edge.second.second); + } fprintf(fp, "EndSplineSet\n"); fprintf(fp, "EndChar\n"); } @@ -747,8 +873,8 @@ for (unsigned int x = sof.x; x < sof.x + sof.w && x < m_size.w; ++x) { int ox = pof.x + x - sof.x; int oy = pof.y + y - sof.y; - if (ox < 0 || oy < 0 || static_cast<unsigned int>(ox) > pof.w || - static_cast<unsigned int>(oy) > pof.h) + if (ox < 0 || oy < 0 || static_cast<unsigned int>(ox) >= pof.w || + static_cast<unsigned int>(oy) >= pof.h) continue; bitpos ipos = y * m_size.w + x; bitpos opos = oy * ng.m_size.w + ox; @@ -759,6 +885,18 @@ return ng; } +int glyph::find_baseline() const +{ + for (int y = m_size.h - 1; y >= 0; --y) { + for (unsigned int x = 0; x < m_size.w; ++x) { + bitpos ipos = y * m_size.w + x; + if (m_data[ipos.byte] & ipos.mask) + return y + 1; + } + } + return -1; +} + glyph glyph::flip(bool flipx, bool flipy) const { glyph ng(m_size); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/smm/vfalib.hpp new/hxtools-20200126/smm/vfalib.hpp --- old/hxtools-20190428/smm/vfalib.hpp 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/smm/vfalib.hpp 2020-01-26 15:28:25.000000000 +0100 @@ -73,6 +73,7 @@ std::string as_pclt() const; std::string as_rowpad() const; glyph blit(const vfrect &src, const vfrect &dst) const; + int find_baseline() const; glyph flip(bool x, bool y) const; void invert(); glyph upscale(const vfsize &factor) const; @@ -113,6 +114,7 @@ void lge(); private: + std::pair<int, int> find_ascent_descent() const; int load_clt_glyph(FILE *, glyph &); void save_bdf_glyph(FILE *, size_t idx, char32_t cp); int save_clt_glyph(const char *dir, size_t n, char32_t cp); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/smm/vfontas.cpp new/hxtools-20200126/smm/vfontas.cpp --- old/hxtools-20190428/smm/vfontas.cpp 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/smm/vfontas.cpp 2020-01-26 15:28:25.000000000 +0100 @@ -148,6 +148,15 @@ return false; } +static bool vf_loadfnth(font &f, char **args) +{ + auto ret = f.load_fnt(args[0], atoi(args[1])); + if (ret >= 0) + return true; + fprintf(stderr, "Error loading %s: %s\n", args[0], strerror(-ret)); + return false; +} + static bool vf_loadhex(font &f, char **args) { auto ret = f.load_hex(args[0]); @@ -399,6 +408,7 @@ {"lge", 0, vf_lge}, {"loadclt", 1, vf_loadclt}, {"loadfnt", 1, vf_loadfnt}, + {"loadfnth", 2, vf_loadfnth}, {"loadhex", 1, vf_loadhex}, {"loadmap", 1, vf_loadmap}, {"loadpsf", 1, vf_loadpsf}, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/hxtools-20190428/suser/fxterm new/hxtools-20200126/suser/fxterm --- old/hxtools-20190428/suser/fxterm 2019-04-28 20:40:14.000000000 +0200 +++ new/hxtools-20200126/suser/fxterm 2020-01-26 15:28:25.000000000 +0100 @@ -43,4 +43,7 @@ -xrm '*VT100*visualBell: false' ); fi; -exec xterm "${par[@]}" "$@" +if [ -z "$XTERM" ]; then + XTERM=xterm +fi +exec "$XTERM" "${par[@]}" "$@"
