Add FONT_IDENTITY_MATRIX for calculating glyph x position
This commit is contained in:
parent
99bd258317
commit
f7fc939832
@ -1,5 +1,8 @@
|
||||
// See pdf.js shared/utils.js
|
||||
const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];
|
||||
const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
|
||||
|
||||
module.exports = {
|
||||
IDENTITY_MATRIX,
|
||||
FONT_IDENTITY_MATRIX,
|
||||
}
|
@ -25,7 +25,7 @@ class ExtractText {
|
||||
partial += glyph.unicode;
|
||||
const width = glyph.width;
|
||||
// const widthAdvanceScale = font.size * line.fontMatrix[0];
|
||||
const widthAdvanceScale = font.size * Constraints.IDENTITY_MATRIX[0];
|
||||
const widthAdvanceScale = font.size * Constraints.FONT_IDENTITY_MATRIX[0];
|
||||
const charWidth = width * widthAdvanceScale + spacing * font.direction;
|
||||
x += charWidth;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user