1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

fix serif and symbol attribute detection for standard fonts

This commit is contained in:
notmasteryet 2012-01-09 21:15:18 -06:00
parent a84fa13189
commit 550819b829
2 changed files with 58 additions and 0 deletions

View file

@ -758,10 +758,17 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
baseFontName = baseFontName.name.replace(/[,_]/g, '-');
var metrics = this.getBaseFontMetrics(baseFontName);
// Simulating descriptor flags attribute
var fontNameWoStyle = baseFontName.split('-')[0];
var flags = (serifFonts[fontNameWoStyle] ||
(fontNameWoStyle.search(/serif/gi) != -1) ? 2 : 0) |
(symbolsFonts[fontNameWoStyle] ? 4 : 32);
var properties = {
type: type.name,
widths: metrics.widths,
defaultWidth: metrics.defaultWidth,
flags: flags,
firstChar: 0,
lastChar: maxCharIndex
};