Browse Source

Add some missing glyphs

Vivien Nicolas 14 years ago
parent
commit
84c2e99bef
  1. 10
      PDFFont.js
  2. 8
      glyphlist.js

10
PDFFont.js

@ -929,7 +929,7 @@ Type1Font.prototype = {
var familyName = fontInfo.get("FamilyName"); var familyName = fontInfo.get("FamilyName");
var weight = fontInfo.get("Weight"); var weight = fontInfo.get("Weight");
var strings = [version, notice, fullName, var strings = [version, notice, fullName,
familyName, weight]; familyName, weight, "asteriskmath"];
var stringsIndex = this.createCFFIndexHeader(strings); var stringsIndex = this.createCFFIndexHeader(strings);
var stringsDataLength = stringsIndex.length; var stringsDataLength = stringsIndex.length;
@ -940,6 +940,8 @@ Type1Font.prototype = {
var charset = [0x00]; var charset = [0x00];
for (var i = 0; i < glyphs.length; i++) { for (var i = 0; i < glyphs.length; i++) {
var index = CFFStrings.indexOf(charstrings[i].glyph); var index = CFFStrings.indexOf(charstrings[i].glyph);
if (index == -1)
index = CFFStrings.length + strings.indexOf(glyph);
var bytes = this.integerToBytes(index, 2); var bytes = this.integerToBytes(index, 2);
charset.push(bytes[0]); charset.push(bytes[0]);
charset.push(bytes[1]); charset.push(bytes[1]);
@ -1103,6 +1105,10 @@ Type1Font.prototype = {
for (var i = 1; i < maxPower; i++) for (var i = 1; i < maxPower; i++)
value *= 2; value *= 2;
if (fontCount == 5) {
log ("mp2: " + aNumber + "::" + value);
}
return value; return value;
}, },
@ -1474,7 +1480,7 @@ Type1Font.prototype = {
for (var i = 0; i < currentOffset; i++) for (var i = 0; i < currentOffset; i++)
fontData.push(otf[i]); fontData.push(otf[i]);
//writeToFile(fontData, "/tmp/pdf.js." + fontCount + ".otf"); writeToFile(fontData, "/tmp/pdf.js." + fontCount + ".otf");
return fontData; return fontData;
} }
}; };

8
glyphlist.js

@ -4279,5 +4279,11 @@ var GlyphsUnicode = {
zretroflexhook: "0290", zretroflexhook: "0290",
zstroke: "01B6", zstroke: "01B6",
zuhiragana: "305A", zuhiragana: "305A",
zukatakana: "30BA", zukatakana: "30BA"
}; };
// Add missing glyphs from the original Adobe's list
GlyphsUnicode["angbracketleft"] = "3008";
GlyphsUnicode["angbracketright"] = "3009";
GlyphsUnicode["circlecopyrt"] = "00A9";

Loading…
Cancel
Save