From 82928b14a170d24ae2e0f2a96150feabf3cbe042 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtetun.org> Date: Tue, 28 Jun 2011 13:34:39 +0200 Subject: [PATCH] Handle division in hsbw to provide the correct information to the hmtx table --- fonts.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fonts.js b/fonts.js index 37b8dbcce..ecc21d9c0 100644 --- a/fonts.js +++ b/fonts.js @@ -1045,7 +1045,14 @@ var Type1Parser = function() { } else { // TODO Clean this code 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]; charstring.push(lsb, "hmoveto"); charstring.splice(0, 1);