[FIX] web: pdf.js courier font ok with chrome 92

In new version of chrome (92) or firefox when some fonts (eg. courier)
were used:

- either the page would never finish loading (odoo 13 and below)
- or the text would in this font would not be shown (odoo 14 and over)

This was solved in pdf.js whith this commit:

https://github.com/mozilla/pdf.js/commit/8805614a03

And this PR is backporting that commit in 12.0 version up to master.

opw-2621405 opw-2613412 opw-2620186 opw-2618225 opw-2616690 opw-2615502
opw-2616249 opw-2615144 opw-2613969 opw-2613793 opw-2618129 opw-2617736
opw-2622506 opw-2614508 opw-2620883 opw-2622105 opw-2620863 opw-2615326
opw-2622842 opw-2620220 opw-2622842 opw-2620220 opw-2615346 opw-2615026
opw-2618389 opw-2619382 opw-2613286 opw-2621730 opw-2613412 opw-2622029
opw-2620625 opw-2622311

closes #75020

closes odoo/odoo#75057

X-original-commit: d3feb26c8923cfde60894058f06dc2c2a8be05f5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
Nicolas Lempereur
2021-08-13 01:29:08 +00:00
parent 296e3cc15f
commit 6943714f53
+2 -1
View File
@@ -32676,7 +32676,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
},
getBaseFontMetrics: function PartialEvaluator_getBaseFontMetrics(name) {
var defaultWidth = 0;
var widths = [];
// Odoo: backport mozilla/pdf.js@8805614a03c for courier font bug with chrome 92
var widths = Object.create(null);
var monospace = false;
var stdFontMap = (0, _standard_fonts.getStdFontMap)();
var lookupName = stdFontMap[name] || name;