Skip to content

conversion fails with .notdef ENCODING -1 entries #37

@x37v

Description

@x37v

I'll preface this by saying I don't really know anything about BDF. I'm trying to convert some of these fonts: https://github.com/farsil/ibmfonts to use in my embedded graphics based project.

EgBdfOutput::new(font: Font) expects all glyphs to have encoding entries but the parser encodes None if the ENCODING entry isn't a positive integer

this bdf spec indicates that encoding can be negative:

3 File Format 9
ENCODING integer (integer)
ENCODING is followed by a positive integer representing the Adobe Stan-
dard Encoding value. If the character is not in the Adobe Standard Encoding,
ENCODING is followed by –1 and optionally by another integer specifying
the glyph index for the non-standard encoding.

and all of the fonts that I've tried to parse from that repo have this entry as the last character in the font:

STARTCHAR .notdef
ENCODING -1
SWIDTH 500 0
DWIDTH 8 0
BBX 8 16 0 -4
BITMAP
FF
FF
83
39
39
F3
E7
E7
E7
FF
E7
E7
FF
FF
FF
FF
ENDCHAR

since I don't really know what i'm doing, I don't know what the implication of just removing that entry from the font before doing the conversion, or trying to skip that glyph would be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions