mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Font renderer - get int8 instead of uint8 in composite glyphes (bug 1749563)
- it aims to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1749563; - use some helper functions to get (u|i)int** values in buffer: it helps to have a clearer code; - in composite glyphes the translations values with a transformations are signed so consequently get some int8 instead of uint8; - add few TODOs.
This commit is contained in:
parent
da953f4b64
commit
74f25d2755
4 changed files with 96 additions and 65 deletions
|
@ -550,14 +550,12 @@ class CompositeGlyph {
|
|||
pos += 4;
|
||||
flags ^= ARG_1_AND_2_ARE_WORDS;
|
||||
} else {
|
||||
argument1 = glyf.getUint8(pos);
|
||||
argument2 = glyf.getUint8(pos + 1);
|
||||
if (flags & ARGS_ARE_XY_VALUES) {
|
||||
const abs1 = argument1 & 0x7f;
|
||||
argument1 = argument1 & 0x80 ? -abs1 : abs1;
|
||||
|
||||
const abs2 = argument2 & 0x7f;
|
||||
argument2 = argument2 & 0x80 ? -abs2 : abs2;
|
||||
argument1 = glyf.getInt8(pos);
|
||||
argument2 = glyf.getInt8(pos + 1);
|
||||
} else {
|
||||
argument1 = glyf.getUint8(pos);
|
||||
argument2 = glyf.getUint8(pos + 1);
|
||||
}
|
||||
pos += 2;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue