mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-22 16:05:56 +02:00
Merge pull request #20894 from Snuffleupagus/compileFontPathInfo-slice
Simplify compilation of font paths (PR 20346 follow-up)
This commit is contained in:
commit
0e964c248a
@ -389,20 +389,15 @@ function compilePatternInfo(ir) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function compileFontPathInfo(path) {
|
function compileFontPathInfo(path) {
|
||||||
let data;
|
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING")) {
|
||||||
let buffer;
|
assert(
|
||||||
if (
|
FeatureTest.isFloat16ArraySupported
|
||||||
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
? path instanceof Float16Array
|
||||||
FeatureTest.isFloat16ArraySupported
|
: path instanceof Float32Array,
|
||||||
) {
|
"compileFontPathInfo: Unexpected path format."
|
||||||
buffer = new ArrayBuffer(path.length * 2);
|
);
|
||||||
data = new Float16Array(buffer);
|
|
||||||
} else {
|
|
||||||
buffer = new ArrayBuffer(path.length * 4);
|
|
||||||
data = new Float32Array(buffer);
|
|
||||||
}
|
}
|
||||||
data.set(path);
|
return path.slice().buffer;
|
||||||
return buffer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user