From 84c2e99bef768bfb7a47376ab08275dc3213aba3 Mon Sep 17 00:00:00 2001
From: Vivien Nicolas <21@vingtetun.org>
Date: Sun, 12 Jun 2011 23:41:57 +0200
Subject: [PATCH] Add some missing glyphs

---
 PDFFont.js   | 10 ++++++++--
 glyphlist.js |  8 +++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/PDFFont.js b/PDFFont.js
index 468b86ba1..84fdf94b1 100644
--- a/PDFFont.js
+++ b/PDFFont.js
@@ -929,7 +929,7 @@ Type1Font.prototype = {
     var familyName = fontInfo.get("FamilyName");
     var weight = fontInfo.get("Weight");
     var strings = [version, notice, fullName,
-                   familyName, weight];
+                   familyName, weight, "asteriskmath"];
     var stringsIndex = this.createCFFIndexHeader(strings);
     var stringsDataLength = stringsIndex.length;
 
@@ -940,6 +940,8 @@ Type1Font.prototype = {
     var charset = [0x00];
     for (var i = 0; i < glyphs.length; i++) {
       var index = CFFStrings.indexOf(charstrings[i].glyph);
+      if (index == -1)
+        index = CFFStrings.length + strings.indexOf(glyph);
       var bytes = this.integerToBytes(index, 2);
       charset.push(bytes[0]);
       charset.push(bytes[1]);
@@ -1103,6 +1105,10 @@ Type1Font.prototype = {
     for (var i = 1; i < maxPower; i++)
       value *= 2;
 
+    if (fontCount == 5) {
+      log ("mp2: " + aNumber + "::" + value);
+    }
+
     return value;
   },
 
@@ -1474,7 +1480,7 @@ Type1Font.prototype = {
     for (var i = 0; i < currentOffset; i++)
       fontData.push(otf[i]);
 
-    //writeToFile(fontData, "/tmp/pdf.js." + fontCount + ".otf");
+    writeToFile(fontData, "/tmp/pdf.js." + fontCount + ".otf");
     return fontData;
   }
 };
diff --git a/glyphlist.js b/glyphlist.js
index de07af4a5..e147f6c8a 100644
--- a/glyphlist.js
+++ b/glyphlist.js
@@ -4279,5 +4279,11 @@ var GlyphsUnicode = {
   zretroflexhook: "0290",
   zstroke: "01B6",
   zuhiragana: "305A",
-  zukatakana: "30BA",
+  zukatakana: "30BA"
 };
+
+// Add missing glyphs from the original Adobe's list
+GlyphsUnicode["angbracketleft"] = "3008";
+GlyphsUnicode["angbracketright"] = "3009";
+GlyphsUnicode["circlecopyrt"] = "00A9";
+