mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-05-31 15:21:00 +02:00
Don't create a DataView for the "CFF " TrueType table in readTableEntry
Given that the "CFF " table may be replaced completely, during font-parsing, it shouldn't make sense to read and/or modify it piecewise.
This commit is contained in:
parent
b65eedc636
commit
e5e82b9617
@ -1519,6 +1519,12 @@ class Font {
|
||||
data[8] = data[9] = data[10] = data[11] = 0;
|
||||
data[17] |= 0x20; // Set font optimized for cleartype flag.
|
||||
}
|
||||
// The "CFF " table may be replaced completely, hence its data shouldn't
|
||||
// need to be read and/or modified piecewise through a `DataView`.
|
||||
const view =
|
||||
tag === "CFF "
|
||||
? null
|
||||
: new DataView(data.buffer, data.byteOffset, data.byteLength);
|
||||
|
||||
return {
|
||||
tag,
|
||||
@ -1526,7 +1532,7 @@ class Font {
|
||||
length,
|
||||
offset,
|
||||
data,
|
||||
view: new DataView(data.buffer, data.byteOffset, data.byteLength),
|
||||
view,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user