Fixing symbols encoding
This commit is contained in:
parent
dd066f8369
commit
10a0a60f8e
@ -481,8 +481,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
||||
properties.cidToGidMap = this.readCidToGidMap(cidToGidMap);
|
||||
}
|
||||
|
||||
var flags = properties.flags;
|
||||
var differences = [];
|
||||
var baseEncoding = Encodings.StandardEncoding;
|
||||
var baseEncoding = !!(flags & FontFlags.Symbolic) ?
|
||||
Encodings.symbolsEncoding : Encodings.StandardEncoding;
|
||||
var hasEncoding = dict.has('Encoding');
|
||||
if (hasEncoding) {
|
||||
var encoding = xref.fetchIfRef(dict.get('Encoding'));
|
||||
@ -761,8 +763,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
||||
// Simulating descriptor flags attribute
|
||||
var fontNameWoStyle = baseFontName.split('-')[0];
|
||||
var flags = (serifFonts[fontNameWoStyle] ||
|
||||
(fontNameWoStyle.search(/serif/gi) != -1) ? 2 : 0) |
|
||||
(symbolsFonts[fontNameWoStyle] ? 4 : 32);
|
||||
(fontNameWoStyle.search(/serif/gi) != -1) ? FontFlags.Serif : 0) |
|
||||
(symbolsFonts[fontNameWoStyle] ? FontFlags.Symbolic :
|
||||
FontFlags.Nonsymbolic);
|
||||
|
||||
var properties = {
|
||||
type: type.name,
|
||||
|
16
src/fonts.js
16
src/fonts.js
@ -19,6 +19,18 @@ var kPDFGlyphSpaceUnits = 1000;
|
||||
// Until hinting is fully supported this constant can be used
|
||||
var kHintingEnabled = false;
|
||||
|
||||
var FontFlags = {
|
||||
FixedPitch: 1,
|
||||
Serif: 2,
|
||||
Symbolic: 4,
|
||||
Script: 8,
|
||||
Nonsymbolic: 32,
|
||||
Italic: 64,
|
||||
AllCap: 65536,
|
||||
SmallCap: 131072,
|
||||
ForceBold: 262144
|
||||
};
|
||||
|
||||
var Encodings = {
|
||||
get ExpertEncoding() {
|
||||
return shadow(this, 'ExpertEncoding', ['', '', '', '', '', '', '', '', '',
|
||||
@ -762,8 +774,8 @@ var Font = (function FontClosure() {
|
||||
var names = name.split('+');
|
||||
names = names.length > 1 ? names[1] : names[0];
|
||||
names = names.split(/[-,_]/g)[0];
|
||||
this.isSerifFont = !!(properties.flags & 2);
|
||||
this.isSymbolicFont = !!(properties.flags & 4);
|
||||
this.isSerifFont = !!(properties.flags & FontFlags.Serif);
|
||||
this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);
|
||||
|
||||
var type = properties.type;
|
||||
this.type = type;
|
||||
|
Loading…
Reference in New Issue
Block a user