[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#730430: bdf2psf: does not cope with short bitmap rows in BDF



Package: bdf2psf
Version: 1.102
Severity: normal
Tags: patch

In the BITMAP part of a BDF character definition, trailing zero bytes are allowed to be omitted. However, when a font has them missing, bdf2psf ignores the entire glyph. For instance, converting the "100dpi-courB10.bdf" font from the console-setup-1.102 source distribution with this command:

bdf2psf --fb 100dpi-courB10.bdf \
  /usr/share/bdf2psf/standard.equivalents \
  /usr/share/bdf2psf/ascii.set 256 foo.psf

gives a sequence of warnings starting with:

WARNING: U+0020: no glyph defined

Obviously, the font does define a space character -- bdf2psf is just ignoring it. The resulting PSF-format font is almost unusable.

The attached patch solves the problem, but it may be that it also renders unnecessary the test for box-drawing and block element characters on the previous line.

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing') Architecture: i386 (i686)
Kernel: Linux 3.10-3-686-pae (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages bdf2psf depends on:
ii  perl  5.18.1-4

bdf2psf recommends no packages.

bdf2psf suggests no packages.

-- no debconf information

--
Ben Harris
--- console-setup-1.102/Fonts/bdf2psf.orig	2011-03-19 02:01:10.000000000 +0000
+++ console-setup-1.102/Fonts/bdf2psf	2013-11-25 00:02:44.000000000 +0000
@@ -463,7 +463,7 @@
 		$row = hex ($1) >> -$shiftbits;
 	    }
 	    if (($u >= 0x2500 && $u <= 0x259f)
-		|| length($1) == 2 * matrix_row_size ()) {
+		|| length($1) <= 2 * matrix_row_size ()) {
 		for my $i (1 ... matrix_row_size ()) {
 		    push (@glyph_bytes,
 			  ($row >> 8 * (matrix_row_size () - $i)) & 0xff);

Reply to: