Package: gbdfed
Version: 1.5-1.1
Tags: patch

BDF files are permitted to contain leading space on the lines
defining font properties (i.e. those between 'STARTPROPERTIES' and
'ENDPROPERTIES'), in that 'bdftopcf' will cope fine with such files
and generate an identical PCF to the one it would generate in the
absence of that leading space.

However, gbdfed does not cope with files that have leading spaces on
property lines. I attach a sample BDF file. When I run gbdfed and
pass the name of that file on its command line, the main gbdfed
window comes up immediately with [modified] in the title bar, and
selecting View > Messages from the menu shows messages including

  FONT_ASCENT property missing.  Added "FONT_ASCENT 12".
  FONT_DESCENT property missing.  Added "FONT_DESCENT 4".

I attach a trivial patch in the BDF reading code which makes it cope
with leading spaces on font property lines. With this patch applied,
my sample file is successfully loaded into gbdfed without being
reported as modified.

Cheers,
Simon
-- 
Simon Tatham         "A defensive weapon is one with my finger on the
<ana...@pobox.com>    trigger. An offensive weapon is one with yours."
STARTFONT 2.1
FONT -gbdfed-Unknown-Medium-R-Normal--16-120-96-96-P-100-FontSpecific-0
SIZE 12 96 96
FONTBOUNDINGBOX 5 11 2 0
STARTPROPERTIES 9
  POINT_SIZE 120
  PIXEL_SIZE 16
  RESOLUTION_X 96
  RESOLUTION_Y 96
  FONT_ASCENT 12
  FONT_DESCENT 4
  AVERAGE_WIDTH 100
  SPACING "P"
  _GBDFED_INFO "Edited with gbdfed 1.5."
ENDPROPERTIES
CHARS 1
STARTCHAR char65
ENCODING 65
SWIDTH 437 0
DWIDTH 7 0
BBX 5 11 2 0
BITMAP
70
F8
D8
D8
D8
D8
F8
F8
D8
D8
D8
ENDCHAR
ENDFONT
diff --git a/bdf.c b/bdf.c
index cf0e9a7..fec5487 100644
--- a/bdf.c
+++ b/bdf.c
@@ -1654,6 +1654,9 @@ _bdf_parse_properties(char *line, unsigned int linelen, unsigned int lineno,
     next = (_bdf_line_func_t *) call_data;
     p = (_bdf_parse_t *) client_data;
 
+    while (*line == ' ' || *line == '\t')
+        line++;
+
     /*
      * Check for the end of the properties.
      */

Reply via email to