BDF: AVERAGE_WIDTH includes values that otf2bdf nullifies first
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
otf2bdf (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
The AVERAGE_WIDTH in a BDF font always tends to be under what it should be. This appears to be caused by an interaction of the code:
/*
* If the glyph is actually an empty bitmap, set the size to 0 all
* around.
*/
if (sx == 0xffff && sy == 0xffff && ex == 0 && ey == 0)
sx = ex = sy = ey = 0;
with the subsequent:
/*
* Adjust the font bounding box.
*/
wd = ex - sx;
ht = ey - sy;
then:
/*
* Add to the average width accumulator.
*/
aw += wd;
In the case of an empty cell, otf2bdf overrides the width of the cell to zero, and then adds the zero figure to the accumulator. Ideally the real advance width should be added to the accumulator, rather than the nullified one.