Author: emaste
Date: Tue Jun 10 18:29:45 2014
New Revision: 267337
URL: http://svnweb.freebsd.org/changeset/base/267337

Log:
  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

Added:
  head/usr.bin/vtfontcvt/
  head/usr.bin/vtfontcvt/Makefile
     - copied, changed from r267335, head/tools/tools/vt/fontcvt/Makefile
  head/usr.bin/vtfontcvt/vtfontcvt.8   (contents, props changed)
  head/usr.bin/vtfontcvt/vtfontcvt.c
     - copied, changed from r267335, head/tools/tools/vt/fontcvt/fontcvt.c
Deleted:
  head/tools/tools/vt/fontcvt/Makefile
  head/tools/tools/vt/fontcvt/fontcvt.c
Modified:
  head/tools/tools/vt/fontcvt/terminus.sh
  head/usr.bin/Makefile

Modified: head/tools/tools/vt/fontcvt/terminus.sh
==============================================================================
--- head/tools/tools/vt/fontcvt/terminus.sh     Tue Jun 10 18:21:37 2014        
(r267336)
+++ head/tools/tools/vt/fontcvt/terminus.sh     Tue Jun 10 18:29:45 2014        
(r267337)
@@ -5,7 +5,7 @@ for i in 6:12 8:14 8:16 10:18 10:20 11:2
 do
        C=`echo $i | cut -f 1 -d :`
        R=`echo $i | cut -f 2 -d :`
-       ./fontcvt \
+       ./vtfontcvt \
                -w $C -h $R \
                ~/terminus-font-4.36/ter-u${R}n.bdf \
                ~/terminus-font-4.36/ter-u${R}b.bdf \

Modified: head/usr.bin/Makefile
==============================================================================
--- head/usr.bin/Makefile       Tue Jun 10 18:21:37 2014        (r267336)
+++ head/usr.bin/Makefile       Tue Jun 10 18:29:45 2014        (r267337)
@@ -362,6 +362,10 @@ SUBDIR+=   yacc
 SUBDIR+=       vi
 .endif
 
+.if ${MK_VT_SUPPORT} != "no"
+SUBDIR+=       vtfontcvt
+.endif
+
 .if ${MK_USB} != "no"
 SUBDIR+=       usbhidaction
 SUBDIR+=       usbhidctl

Copied and modified: head/usr.bin/vtfontcvt/Makefile (from r267335, 
head/tools/tools/vt/fontcvt/Makefile)
==============================================================================
--- head/tools/tools/vt/fontcvt/Makefile        Tue Jun 10 17:54:24 2014        
(r267335, copy source)
+++ head/usr.bin/vtfontcvt/Makefile     Tue Jun 10 18:29:45 2014        
(r267337)
@@ -1,5 +1,7 @@
-PROG=  fontcvt
-MAN1=
+# $FreeBSD$
+
+PROG=  vtfontcvt
+MAN8=  vtfontcvt.8
 
 WARNS?=        6
 

Added: head/usr.bin/vtfontcvt/vtfontcvt.8
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/vtfontcvt/vtfontcvt.8  Tue Jun 10 18:29:45 2014        
(r267337)
@@ -0,0 +1,74 @@
+.\" Copyright (c) 2014 The FreeBSD Foundation.  All rights reserved.
+.\"
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 9, 2014
+.Dt VTFONTCVT 8
+.Os
+.Sh NAME
+.Nm vtfontcvt
+.Nd "convert font files for use by the video console"
+.Sh SYNOPSIS
+.Nm
+.Op Fl h Ar height
+.Op Fl v
+.Op Fl w Ar width
+.Ar normal_font
+.Op Ar bold_font
+.Ar output_file
+.Sh DESCRIPTION
+The
+.Nm
+utility reads source font files in either BDF or Unifont HEX format and
+outputs a binary font file for use by
+.Xr vt 4 .
+HEX format files must have the file extension
+.Pa .hex .
+.Pp
+The following options are available:
+.Bl -tag -width "12345678"
+.It Fl h Ar height
+Set font height.
+The default is 16.
+Font height is set automatically for HEX files that have a
+.Ql # Height: Ar height
+comment before any font data.
+.It Fl v
+Display verbose statistics about the converted font.
+.It Fl w Ar width
+Set font width.
+The default is 8.
+Font width is set automatically for HEX files that have a
+.Ql # Width: Ar width
+comment before any font data.
+.El
+.Sh SEE ALSO
+.Xr vidcontrol 1 ,
+.Xr vt 4
+.Sh HISTORY
+The
+.Nm
+utility first appeared in
+.Fx 11.0 .

Copied and modified: head/usr.bin/vtfontcvt/vtfontcvt.c (from r267335, 
head/tools/tools/vt/fontcvt/fontcvt.c)
==============================================================================
--- head/tools/tools/vt/fontcvt/fontcvt.c       Tue Jun 10 17:54:24 2014        
(r267335, copy source)
+++ head/usr.bin/vtfontcvt/vtfontcvt.c  Tue Jun 10 18:29:45 2014        
(r267337)
@@ -92,7 +92,7 @@ usage(void)
 {
 
        errx(1,
-"usage: fontcvt [-w width] [-h height] [-v] normal.bdf [bold.bdf] out.fnt\n");
+"usage: vtfontcvt [-w width] [-h height] [-v] normal.bdf [bold.bdf] 
out.fnt\n");
        exit(1);
 }
 
@@ -239,7 +239,7 @@ parse_bitmap_line(uint8_t *left, uint8_t
 
                line >>= width;
        }
-       
+
        return (0);
 }
 
@@ -309,7 +309,7 @@ parse_hex(FILE *fp, unsigned int map_idx
                                dwidth *= 2; /* Double-width character. */
                        snprintf(fmt_str, sizeof(fmt_str), "%%%ux",
                            chars_per_row);
-                       
+
                        for (i = 0; i < height; i++) {
                                sscanf(p, fmt_str, &line);
                                p += chars_per_row;
@@ -449,7 +449,7 @@ write_fnt(const char *filename)
                perror(filename);
                return (1);
        }
-       
+
        if (write_glyphs(fp) != 0 ||
            write_mappings(fp, VFNT_MAP_NORMAL) != 0 ||
            write_mappings(fp, 1) != 0 ||
@@ -507,7 +507,7 @@ main(int argc, char *argv[])
        assert(sizeof(struct file_header) == 32);
        assert(sizeof(struct file_mapping) == 8);
 
-       while ((ch = getopt(argc, argv, "h:w:")) != -1) {
+       while ((ch = getopt(argc, argv, "h:vw:")) != -1) {
                switch (ch) {
                case 'h':
                        val = atoi(optarg);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to