Add TeX-specific glyph names to glyphlist.js to improve both glyph mapping and text selection for mathematic fonts (issue 2594)

This commit is contained in:
Jonas Jenwald 2016-07-27 13:41:09 +02:00
parent 8d036faf40
commit 81b9d553cf
2 changed files with 121 additions and 2 deletions

View File

@ -879,7 +879,7 @@ var Font = (function FontClosure() {
}
/**
* Helper function for |adjustMapping|.
* Helper function for `adjustMapping`.
* @return {boolean}
*/
function isProblematicUnicodeLocation(code) {
@ -939,7 +939,7 @@ var Font = (function FontClosure() {
// with firefox and thuluthfont).
if ((usedFontCharCodes[fontCharCode] !== undefined ||
isProblematicUnicodeLocation(fontCharCode) ||
(isSymbolic && (isIdentityUnicode || !hasUnicodeValue))) &&
(isSymbolic && !hasUnicodeValue)) &&
nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END) { // Room left.
// Loop to try and find a free spot in the private use area.
do {

View File

@ -1480,6 +1480,7 @@ var getGlyphsUnicode = getLookupTableFactory(function (t) {
t['controlHT'] = 0x0009;
t['controlLF'] = 0x000A;
t['controlNAK'] = 0x0015;
t['controlNULL'] = 0x0000; // Glyph is missing from Adobe's original list.
t['controlRS'] = 0x001E;
t['controlSI'] = 0x000F;
t['controlSO'] = 0x000E;
@ -4231,6 +4232,124 @@ var getGlyphsUnicode = getLookupTableFactory(function (t) {
t['zuhiragana'] = 0x305A;
t['zukatakana'] = 0x30BA;
t['.notdef'] = 0x0000;
// TeX-specific glyph names.
t['angbracketleftbig'] = 0x2329;
t['angbracketleftBig'] = 0x2329;
t['angbracketleftbigg'] = 0x2329;
t['angbracketleftBigg'] = 0x2329;
t['angbracketrightBig'] = 0x232A;
t['angbracketrightbig'] = 0x232A;
t['angbracketrightBigg'] = 0x232A;
t['angbracketrightbigg'] = 0x232A;
t['arrowhookleft'] = 0x21AA;
t['arrowhookright'] = 0x21A9;
t['arrowlefttophalf'] = 0x21BC;
t['arrowleftbothalf'] = 0x21BD;
t['arrownortheast'] = 0x2197;
t['arrownorthwest'] = 0x2196;
t['arrowrighttophalf'] = 0x21C0;
t['arrowrightbothalf'] = 0x21C1;
t['arrowsoutheast'] = 0x2198;
t['arrowsouthwest'] = 0x2199;
t['backslashbig'] = 0x2216;
t['backslashBig'] = 0x2216;
t['backslashBigg'] = 0x2216;
t['backslashbigg'] = 0x2216;
t['bardbl'] = 0x2016;
t['bracehtipdownleft'] = 0xFE37;
t['bracehtipdownright'] = 0xFE37;
t['bracehtipupleft'] = 0xFE38;
t['bracehtipupright'] = 0xFE38;
t['braceleftBig'] = 0x007B;
t['braceleftbig'] = 0x007B;
t['braceleftbigg'] = 0x007B;
t['braceleftBigg'] = 0x007B;
t['bracerightBig'] = 0x007D;
t['bracerightbig'] = 0x007D;
t['bracerightbigg'] = 0x007D;
t['bracerightBigg'] = 0x007D;
t['bracketleftbig'] = 0x005B;
t['bracketleftBig'] = 0x005B;
t['bracketleftbigg'] = 0x005B;
t['bracketleftBigg'] = 0x005B;
t['bracketrightBig'] = 0x005D;
t['bracketrightbig'] = 0x005D;
t['bracketrightbigg'] = 0x005D;
t['bracketrightBigg'] = 0x005D;
t['ceilingleftbig'] = 0x2308;
t['ceilingleftBig'] = 0x2308;
t['ceilingleftBigg'] = 0x2308;
t['ceilingleftbigg'] = 0x2308;
t['ceilingrightbig'] = 0x2309;
t['ceilingrightBig'] = 0x2309;
t['ceilingrightbigg'] = 0x2309;
t['ceilingrightBigg'] = 0x2309;
t['circledotdisplay'] = 0x2299;
t['circledottext'] = 0x2299;
t['circlemultiplydisplay'] = 0x2297;
t['circlemultiplytext'] = 0x2297;
t['circleplusdisplay'] = 0x2295;
t['circleplustext'] = 0x2295;
t['contintegraldisplay'] = 0x222E;
t['contintegraltext'] = 0x222E;
t['coproductdisplay'] = 0x2210;
t['coproducttext'] = 0x2210;
t['floorleftBig'] = 0x230A;
t['floorleftbig'] = 0x230A;
t['floorleftbigg'] = 0x230A;
t['floorleftBigg'] = 0x230A;
t['floorrightbig'] = 0x230B;
t['floorrightBig'] = 0x230B;
t['floorrightBigg'] = 0x230B;
t['floorrightbigg'] = 0x230B;
t['hatwide'] = 0x0302;
t['hatwider'] = 0x0302;
t['hatwidest'] = 0x0302;
t['intercal'] = 0x1D40;
t['integraldisplay'] = 0x222B;
t['integraltext'] = 0x222B;
t['intersectiondisplay'] = 0x22C2;
t['intersectiontext'] = 0x22C2;
t['logicalanddisplay'] = 0x2227;
t['logicalandtext'] = 0x2227;
t['logicalordisplay'] = 0x2228;
t['logicalortext'] = 0x2228;
t['parenleftBig'] = 0x0028;
t['parenleftbig'] = 0x0028;
t['parenleftBigg'] = 0x0028;
t['parenleftbigg'] = 0x0028;
t['parenrightBig'] = 0x0029;
t['parenrightbig'] = 0x0029;
t['parenrightBigg'] = 0x0029;
t['parenrightbigg'] = 0x0029;
t['prime'] = 0x2032;
t['productdisplay'] = 0x220F;
t['producttext'] = 0x220F;
t['radicalbig'] = 0x221A;
t['radicalBig'] = 0x221A;
t['radicalBigg'] = 0x221A;
t['radicalbigg'] = 0x221A;
t['radicalbt'] = 0x221A;
t['radicaltp'] = 0x221A;
t['radicalvertex'] = 0x221A;
t['slashbig'] = 0x002F;
t['slashBig'] = 0x002F;
t['slashBigg'] = 0x002F;
t['slashbigg'] = 0x002F;
t['summationdisplay'] = 0x2211;
t['summationtext'] = 0x2211;
t['tildewide'] = 0x02DC;
t['tildewider'] = 0x02DC;
t['tildewidest'] = 0x02DC;
t['uniondisplay'] = 0x22C3;
t['unionmultidisplay'] = 0x228E;
t['unionmultitext'] = 0x228E;
t['unionsqdisplay'] = 0x2294;
t['unionsqtext'] = 0x2294;
t['uniontext'] = 0x22C3;
t['vextenddouble'] = 0x2225;
t['vextendsingle'] = 0x2223;
});
var getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) {