Commit Graph

48 Commits

Author SHA1 Message Date
Simon J. Gerraty
d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Ed Maste
119db52f42 vtfontcvt: improve hex font format validation
Previously an EOF would result in sscanf returning -1 leading to a
crash.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-07-19 11:48:09 -04:00
Mateusz Piotrowski
ef2d0816dd vtfontcvt(8): Update usage() to match vtfontcvt.8
MFC after:	2 weeks
2022-07-19 16:35:50 +02:00
Mateusz Piotrowski
cad64622ca vtfontcvt.8: Use D1 instead of Ql for readability
MFC after:	2 weeks
2022-07-19 16:35:49 +02:00
Mateusz Piotrowski
e0bd2ab2eb vtfontcvt.8: Sort synopsis
MFC after:	2 weeks
2022-07-19 16:35:49 +02:00
Mateusz Piotrowski
b38e3722f5 vtfontcvt.8: Improve synopsis and -f documentation
MFC after:	2 weeks
2022-07-19 16:35:48 +02:00
Ed Maste
df777aeb98 vtfontcvt: correct usage
Commit e7fd9688ea changed vtfontcvt's command line parsing, but did
not correctly update the usage (it omitted the new -o flag).

Fixes:		e7fd9688ea ("Move font related data structured to...")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-07-18 13:24:29 -04:00
Ed Maste
4e1e3ff571 vtfontcvt: update FreeBSD Foundation copyrights
Remove "All Rights Reserved"
2022-02-17 20:05:14 -05:00
Ed Maste
a0d701f614 vtfontcvt: minor style(9) fixes from clang-format
Found during clang-format experiments (in D26340).

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30237
2021-08-04 15:08:21 -04:00
Mateusz Piotrowski
ea27bce336 Document automatic handling of font height for BDF files
PR:		248395
Submitted by:	Dmitry Wagin <dmitry.wagin@ya.ru>
Reviewed by:	bcr, emaste, tsoome
Differential Revision:	https://reviews.freebsd.org/D25907
2020-08-02 16:41:36 +00:00
Toomas Soome
e7fd9688ea Move font related data structured to sys/font.c and update vtfontcvt
Prepare support to be able to handle font data in loader, consolidate
data structures to sys/font.h and update vtfontcvt.

vtfontcvt update is about to output set of glyphs in form of C source,
the implementation does allow to output compressed or uncompressed font
bitmaps.

Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D24189
2020-06-14 06:58:58 +00:00
Ed Maste
40adef9e59 vtfontcvt: simplify rshift_row
We don't need to specify the buffer size in both bytes and bits.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-08-23 16:03:23 +00:00
Warner Losh
912a01b36d Replay r349333 by emaste accidentally reverted by r349352
vtfontcvt: improve .bdf validation

Previously if we had a FONTBOUNDINGBOX or DWIDTH entry that had missing
or invalid values and and failed sscanf, we would proceeded with
partially initialized bounding box / device width variables.

Reported by:	afl (FONTBOUNDINGBOX)
MFC with:	r349100
Sponsored by:	The FreeBSD Foundation
2019-06-25 06:13:56 +00:00
Warner Losh
f5a95d9a07 Remove NAND and NANDFS support
NANDFS has been broken for years. Remove it. The NAND drivers that
remain are for ancient parts that are no longer relevant. They are
polled, have terrible performance and just for ancient arm
hardware. NAND parts have evolved significantly from this early work
and little to none of it would be relevant should someone need to
update to support raw nand. This code has been off by default for
years and has violated the vnode protocol leading to panics since it
was committed.

Numerous posts to arch@ and other locations have found no actual users
for this software.

Relnotes:	Yes
No Objection From: arch@
Differential Revision: https://reviews.freebsd.org/D20745
2019-06-25 04:50:09 +00:00
Ed Maste
2771ab3322 vtfontcvt: improve .bdf validation
Previously if we had a FONTBOUNDINGBOX or DWIDTH entry that had missing
or invalid values and and failed sscanf, we would proceeded with
partially initialized bounding box / device width variables.

Reported by:	afl (FONTBOUNDINGBOX)
MFC with:	r349100
Sponsored by:	The FreeBSD Foundation
2019-06-24 17:25:14 +00:00
Ed Maste
97634938d0 vtfontcvt: correct typo in hex parsing update
PR:		205707
Submitted by:	Dmitry Wagin
MFC with:	349100
Event:		Berlin Devsummit 2019
2019-06-16 15:14:49 +00:00
Ed Maste
08584e2c48 vtfontcvt: improve .bdf validation
Previously if we had a BBX entry that had invalid values (e.g. bounding
box outside of font bounding box) and failed sscanf (e.g., because it
had fewer than four values) we skipped the BBX value validation and then
triggered an assertion failure.

Reported by:	afl
MFC with:	r349100
Event:		Berlin Devsummit 2019
Sponsored by:	The FreeBSD Foundation
2019-06-16 13:51:45 +00:00
Ed Maste
fd0e3f7c98 vtfontcvt: improve .bdf verification
Previously we would crash if the BBX y-offset was outside of the font
bounding box.

Reported by:	afl
MFC with:	r349100
Event:		Berlin Devsummit 2019
Sponsored by:	The FreeBSD Foundation
2019-06-16 13:35:53 +00:00
Ed Maste
0f17b429d0 vtfontcvt: initialize another variable to quiet GCC warning
I believe this case could be triggered by a broken .bdf font.

PR:		205707
Reported by:	ci.freebsd.org
MFC with:	349100
Event:		Berlin Devsummit 2019
Sponsored by:	The FreeBSD Foundation
2019-06-16 12:26:46 +00:00
Ed Maste
ff31ddeb11 vtfontcvt: initialize bbwbytes to avoid GCC 4.2.1 uninitialized warning
PR:		205707
MFC with:	349100
Event:		Berlin Devsummit 2019
Sponsored by:	The FreeBSD Foundation
2019-06-16 10:43:18 +00:00
Ed Maste
3bd2e9a54e vtfontcvt: improve BDF and hex font parsing
Support larger font sizes.

PR:		205707
Submitted by:	Dmitry Wagin (original version)
MFC after:	2 weeks
Event:		Berlin Devsummit 2019
Differential Revision:	https://reviews.freebsd.org/D20650
2019-06-16 09:17:26 +00:00
Ed Maste
cfe607d5bf vtfontcvt: add comments in add_glyph
During review for PR 205707.

Event:		Berlin Devsummit 2019
2019-06-15 09:15:58 +00:00
Ed Maste
a9de4100e6 vtfontcvt: allow out-of-order glyphs
PR:		205707
Reported by:	mi
MFC after:	2 weeks
Event:		Vienna Hackathon 2019
Sponsored by:	The FreeBSD Foundation
2019-06-08 08:25:43 +00:00
Ed Maste
24dd375e25 vtfontcvt: exit on error if the input font has too many glyphs
The kernel has a limit of 131072 glyphs in a font; add the same check to
vtfontcvt so that we won't create a font file that the kernel will not
load.

PR:		205707
Submitted by:	Dmitry Wagin
MFC after:	2 weeks
2019-06-05 15:23:48 +00:00
Ed Maste
7e65018aa6 vtfontcvt: zero memory allocated by xmalloc
PR:		205707
Submitted by:	Dmitry Wagin
2019-06-04 19:39:06 +00:00
Ed Maste
4c42647e13 vtfontcvt: include width and height in verbose info
PR:		205707
Submitted by:	Dmitry Wagin
2019-06-04 18:55:02 +00:00
Ed Maste
2810d2385c vtfontcvt: rework height/width setting
Introduce VFNT_MAXDIMENSION to replace bare 128, add set_height, and
consistently use set_height and set_width.

PR:		205707
Submitted by:	Dmitry Wagin
2019-06-04 18:49:49 +00:00
Ed Maste
d7bcf73630 vtfontcvt: unwrap a line per style(9)
PR:		205707
Submitted by:	Dmitry Wagin
2019-06-04 18:31:52 +00:00
Ed Maste
3c7951c78b vtfontcvt: use VFNT_MAP_{NORMAL|BOL}_RH symbolic constants
PR:		205707
Reported by:	Dmitry Wagin
MFC after:	1 month
2019-06-04 18:26:42 +00:00
Ed Maste
0235d5e283 vtfontcvt: whitespace cleanup
PR:		205707
Submitted by:	Dmitry Wagin
2019-02-06 18:50:48 +00:00
Ed Maste
362e958eec vtfontcvt: allow .bdf characters less than full height
Sponsored by:	The FreeBSD Foundation
2018-04-03 18:43:00 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Ed Maste
9b61efccf7 vtfontcvt: remove superfluous newlines in errx messages 2016-09-14 18:22:12 +00:00
Ed Maste
0f2d5632a5 vtfontcvt: support .hex fonts with characters beyond the Unicode BMP
This is already supported by the vt(4) vfnt format mapping from code
points to glyphs. Update the .hex font parser to accept up to six hex
digits.
2016-03-15 21:32:46 +00:00
Ed Maste
a1f0b4cf95 vtfontcvt: fix buffer overflow for non-default size .hex fonts
Sponsored by:	The FreeBSD Foundation
2015-09-01 01:35:43 +00:00
Ed Maste
2e268aa950 vtfontcvt: introduce xmalloc to abort on out-of-memory
Sponsored by:	The FreeBSD Foundation
2015-08-31 23:08:39 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Baptiste Daroussin
66a86d242f Remove WARNS vtfontcvt builds find with clang and gcc with maximum level warning 2015-06-06 12:34:59 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Ed Maste
e867fb0558 vtfontcvt: Allow 6 digits in verbose output
Some fonts (e.g. GNU Unifont) have more than 100,000 (half-)glyphs.

Sponsored by:	The FreeBSD Foundation
2015-05-14 20:17:53 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Ed Maste
cb5249a242 vtfontcvt will first ship in FreeBSD 10.1 2014-07-24 15:16:03 +00:00
Ed Maste
0dfe37f8f3 Remove redundant return statement after errx
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2014-07-21 17:43:37 +00:00
Ed Maste
54a7138bd8 Use the standard way of printing the usage string
Sponsored by:	The FreeBSD Foundation
2014-07-21 17:18:00 +00:00
Ed Maste
634ad025e1 vtfontcvt: correct width calculation (.hex files and commandline)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-02 19:31:49 +00:00
Ed Maste
efc81e89ec Avoid leaking file pointer on error
CID:		1222506, 1222505
2014-06-11 17:19:57 +00:00
Ed Maste
b410b62c85 vt fontcvt: move to usr.bin/vtfontcvt
vtfontcvt is useful for end users to convert arbitrary bitmap fonts
for use by vt(4).  It can also be used as a build tool, allowing us
to keep the source font data in the src tree rather than uuencoded
binaries.

Reviewed by:	ray, wblock (D183)
Sponsored by:	The FreeBSD Foundation
2014-06-10 18:29:45 +00:00