mozilla / mozilla/pdf.js

[Bug]: Incorrect rendering of some fonts at intersection of shapes

Open
#21,353 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

font-conversion upstream
Dominant language
JavaScript
Stars
53.9k
Forks
10.7k
Avg merge
18h 38m
Merged PRs (30d)
130

Description

Attach (recommended) or Link to PDF file

Created with Typst using New Computer Modern Math Bold 8.0.1:

#set text(font: "New Computer Modern Math", weight: "bold")
#sym.eq.not

The OTF font file I used can be downloaded on CTAN.

font-rendering.pdf

Web browser and its version

Firefox 151.0.2 (64-bit)

Operating system and its version

Windows

PDF.js version

Don't know how to check the version that's embeded in Firefox

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem
  1. Open the PDF file I provided.
  2. Have a zoom level up to 350 %.
What is the expected behavior?

The symbol should be displayed properly:

The not equal sign from New Computer Modern Math Bold.
What went wrong?

The symbol is displayed improperly:

The intersection of the equal lines with the cancel line is not filled.
Link to a viewer

No response

Additional context

The issue can be reproduced with other symbols and other NewCM fonts.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the attached font-rendering.pdf in the latest PDF.js build and reproduce the New Computer Modern Math Bold rendering issue at up to 350% zoom. Compare the not-equal and other affected symbols with the expected images, then trace the PDF.js font-rendering path to identify the scope of the defect; done means the intersections render filled correctly without regressing other symbols or fonts.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.