Map .notdef in order to attach the [missing|break]Char to it
This commit is contained in:
parent
2e71f79865
commit
a2974b2f58
10
fonts.js
10
fonts.js
@ -417,6 +417,7 @@ var Font = (function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function createCMapTable(glyphs) {
|
function createCMapTable(glyphs) {
|
||||||
|
glyphs.push({ unicode: 0x0000 });
|
||||||
var ranges = getRanges(glyphs);
|
var ranges = getRanges(glyphs);
|
||||||
|
|
||||||
var headerSize = (12 * 2 + (ranges.length * 4 * 2));
|
var headerSize = (12 * 2 + (ranges.length * 4 * 2));
|
||||||
@ -450,7 +451,7 @@ var Font = (function () {
|
|||||||
var range = ranges[i];
|
var range = ranges[i];
|
||||||
var start = range[0];
|
var start = range[0];
|
||||||
var end = range[1];
|
var end = range[1];
|
||||||
var delta = (((start - 1) - bias) ^ 0xffff) + 1;
|
var delta = (((start - 1) - bias) ^ 0xffff);
|
||||||
bias += (end - start + 1);
|
bias += (end - start + 1);
|
||||||
|
|
||||||
startCount += string16(start);
|
startCount += string16(start);
|
||||||
@ -479,7 +480,6 @@ var Font = (function () {
|
|||||||
|
|
||||||
var charset = properties.charset;
|
var charset = properties.charset;
|
||||||
if (charset && charset.length) {
|
if (charset && charset.length) {
|
||||||
log(charset);
|
|
||||||
for (var i = 1; i < charset.length; i++) {
|
for (var i = 1; i < charset.length; i++) {
|
||||||
var position = getUnicodeRangeFor(GlyphsUnicode[charset[i]]);
|
var position = getUnicodeRangeFor(GlyphsUnicode[charset[i]]);
|
||||||
if (position < 32) {
|
if (position < 32) {
|
||||||
@ -530,10 +530,8 @@ var Font = (function () {
|
|||||||
"\x00\x00\x00\x00" + // ulCodePageRange2 (Bits 32-63)
|
"\x00\x00\x00\x00" + // ulCodePageRange2 (Bits 32-63)
|
||||||
string16(properties.xHeight) + // sxHeight
|
string16(properties.xHeight) + // sxHeight
|
||||||
string16(properties.capHeight) + // sCapHeight
|
string16(properties.capHeight) + // sCapHeight
|
||||||
// XXX mapping .notdef in the cmap table will allow us to use it
|
string16(0) + // usDefaultChar
|
||||||
// here instead, especially because these field are limit to 0xFFFF
|
string16(0) + // usBreakChar
|
||||||
string16(properties.firstChar) + // usDefaultChar
|
|
||||||
string16(properties.firstChar) + // usBreakChar
|
|
||||||
"\x00\x00"; // usMaxContext
|
"\x00\x00"; // usMaxContext
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user