Skip to content

Canvas text and macOS font fixes#27548

Merged
bors-servo merged 2 commits intoservo:masterfrom
jdm:canvas-text-panic
Aug 10, 2020
Merged

Canvas text and macOS font fixes#27548
bors-servo merged 2 commits intoservo:masterfrom
jdm:canvas-text-panic

Conversation

@jdm
Copy link
Copy Markdown
Member

@jdm jdm commented Aug 7, 2020

These changes work around a source of panics by skipping glyphs that don't exist when drawing text to the canvas. Ideally we would have font fallback and/or tofu characters, but that's a larger project than I wanted to get into right now.

Relatedly, while investigating the non-panic errors observed in #27476, I realized that the underlying source of #24622 could be dealt with because we shouldn't actually need to open the CTFont by a file path to get the bytes, since we already have bytes available that we use to create the CTFont.


@highfive
Copy link
Copy Markdown

highfive commented Aug 7, 2020

warning Warning warning

  • These commits modify gfx code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 7, 2020
@jdm
Copy link
Copy Markdown
Member Author

jdm commented Aug 7, 2020

r? @pcwalton

@highfive highfive assigned pcwalton and unassigned ferjm Aug 7, 2020
@jdm
Copy link
Copy Markdown
Member Author

jdm commented Aug 7, 2020

@bors-servo try

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Trying commit 1645d2f with merge 1c47960...

bors-servo added a commit that referenced this pull request Aug 7, 2020
Canvas text and macOS font fixes

These changes work around a source of panics by skipping glyphs that don't exist when drawing text to the canvas. Ideally we would have font fallback and/or tofu characters, but that's a larger project than I wanted to get into right now.

Relatedly, while investigating the non-panic errors observed in #27476, I realized that the underlying source of #24622 could be dealt with because we shouldn't actually need to open the CTFont by a file path to get the bytes, since we already have bytes available that we use to create the CTFont.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24622 and fix #27476 and fix the panic observed in #20445.
- [x] There are tests for these changes
@bors-servo
Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Aug 7, 2020
@jdm jdm force-pushed the canvas-text-panic branch from 1645d2f to 78e1f9e Compare August 7, 2020 20:42
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Aug 7, 2020
@jdm
Copy link
Copy Markdown
Member Author

jdm commented Aug 7, 2020

@bors-servo try=wpt

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Trying commit 78e1f9e with merge 1b2bf0b...

bors-servo added a commit that referenced this pull request Aug 7, 2020
Canvas text and macOS font fixes

These changes work around a source of panics by skipping glyphs that don't exist when drawing text to the canvas. Ideally we would have font fallback and/or tofu characters, but that's a larger project than I wanted to get into right now.

Relatedly, while investigating the non-panic errors observed in #27476, I realized that the underlying source of #24622 could be dealt with because we shouldn't actually need to open the CTFont by a file path to get the bytes, since we already have bytes available that we use to create the CTFont.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24622 and fix #27476 and fix the panic observed in #20445.
- [x] There are tests for these changes
@bors-servo
Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Aug 7, 2020
@jdm jdm force-pushed the canvas-text-panic branch from 78e1f9e to 1e743a7 Compare August 7, 2020 21:20
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Aug 7, 2020
@jdm
Copy link
Copy Markdown
Member Author

jdm commented Aug 7, 2020

@bors-servo try=wpt-mac

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Trying commit 1e743a7 with merge 778dc01...

bors-servo added a commit that referenced this pull request Aug 7, 2020
Canvas text and macOS font fixes

These changes work around a source of panics by skipping glyphs that don't exist when drawing text to the canvas. Ideally we would have font fallback and/or tofu characters, but that's a larger project than I wanted to get into right now.

Relatedly, while investigating the non-panic errors observed in #27476, I realized that the underlying source of #24622 could be dealt with because we shouldn't actually need to open the CTFont by a file path to get the bytes, since we already have bytes available that we use to create the CTFont.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24622 and fix #27476 and fix the panic observed in #20445.
- [x] There are tests for these changes
@bors-servo
Copy link
Copy Markdown
Contributor

☀️ Test successful - status-taskcluster
State: approved= try=True

continue;
},
};
start += advance * point_size / 24. / 96.;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do these values come from? Are you sure this isn't the units_per_em for some font?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pcwalton
Copy link
Copy Markdown
Contributor

@bors-servo: r+

@bors-servo
Copy link
Copy Markdown
Contributor

📌 Commit 1e743a7 has been approved by pcwalton

@highfive highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Aug 10, 2020
@highfive highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 10, 2020
@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Testing commit 1e743a7 with merge 3c426d7...

@bors-servo
Copy link
Copy Markdown
Contributor

☀️ Test successful - status-taskcluster
Approved by: pcwalton
Pushing 3c426d7 to master...

@bors-servo bors-servo merged commit 3c426d7 into servo:master Aug 10, 2020
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fail to get font handle in canvas fill_text Intermittent mac timeout due to missing font URLs (No URL for Core Text font!)

5 participants