Skip to content

Superscripts and subscripts are not rendered correctly #3290

@LucaDiba

Description

@LucaDiba

Describe the bug
Trying to render select superscripts and subscripts results in a wrong rendering.

To Reproduce
Steps to reproduce the behavior including code snippet (if applies):

  1. Render the following snippet:
<Document>
  <Page style={styles.body}>
    <Text style={styles.text}>
      U+00Bx (correct): x², x³, x¹
    </Text>
    <Text style={styles.text}>
      U+207x: x⁰, xⁱ, x⁴, x⁵, x⁶, x⁷, x⁸, x⁹, x⁺, x⁻, x⁼, x⁽, x⁾, xⁿ
    </Text>
    <Text style={styles.text}>
      U+208x: x₀, x₁, x₂, x₃, x₄, x₅, x₆, x₇, x₈, x₉, x₊, x₋, x₌, x₍, x₎
    </Text>
    <Text style={styles.text}>
      U+209x: xₐ, xₑ, xₒ, xₓ, xₔ, xₕ, xₖ, xₗ, xₘ, xₙ, xₚ, xₛ, xₜ
    </Text>
  </Page>
</Document>
  1. Notice that only the U+00Bx chars are rendered correctly.

Expected behavior
All the superscripts and subscripts are rendered correctly.

Screenshots

Image

Desktop:

  • OS: Windows
  • Browser: Ecosia (Chromium)
  • React-pdf version: 4.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions