Attach (recommended) or Link to PDF file here:
[docOficialPDF.php.pdf](https://github.com/mozilla/pdf.js/files/7159923/docOficialPDF.php.pdf)

Configuration:
- Web browser and its version: Firefox nightly
- Operating system and its version: linux debian
- PDF.js version: built-in viewer
- Is a browser extension: no

Steps to reproduce the problem:
1. Open the pdf page 2
2. Checkbox "Alta" in section 2 must be checked

It works fine with evince.
const glyphs = font.charsToGlyphs(text);
    const scale = fontSize / 1000;
    let width = 0;
    for (const glyph of glyphs) {
      width += glyph.width * scale;
    }
    let shift;
    if (alignment === 1) {
      
      shift = (totalWidth - width) / 2;
    } else if (alignment === 2) {
      
      shift = totalWidth - width - hPadding;
    } else {
      shift = hPadding;
    }
    shift = shift.toFixed(2);
    vPadding = vPadding.toFixed(2);
    return `${shift} ${vPadding} Td (${escapeString(text)}) Tj`;
  }
  /**
   * @private
   */
  _getSaveFieldResources(xref) {