Handle division in hsbw to provide the correct information to the hmtx table

This commit is contained in:
Vivien Nicolas 2011-06-28 13:34:39 +02:00
parent fe55204042
commit 82928b14a1

View File

@ -1045,7 +1045,14 @@ var Type1Parser = function() {
} else { } else {
// TODO Clean this code // TODO Clean this code
if (value == 13) { if (value == 13) {
width = charstring[1]; if (charstring.length == 2) {
width = charstring[1];
} else if (charstring.length == 4 && charstring[3] == "div") {
width = charstring[1] / charstring[2];
} else {
error("Unsupported hsbw format: " + charstring);
}
lsb = charstring[0]; lsb = charstring[0];
charstring.push(lsb, "hmoveto"); charstring.push(lsb, "hmoveto");
charstring.splice(0, 1); charstring.splice(0, 1);