Skip to content

Comments

Fix intermittent macOS reftest failures#24347

Merged
bors-servo merged 1 commit intoservo:masterfrom
jdm:mac-font-load
Oct 3, 2019
Merged

Fix intermittent macOS reftest failures#24347
bors-servo merged 1 commit intoservo:masterfrom
jdm:mac-font-load

Conversation

@jdm
Copy link
Member

@jdm jdm commented Oct 2, 2019

CTCreateFontWithName intermittently returns the wrong font for a given postscript name. These changes rely on obtaining a font descriptor, using it to get the path to the actual font file on disk, getting the bytes that make up the font, and using Core Graphics to create a font handle and obtaining the Core Graphics font from the CGFont reference. This is the same strategy that font-kit uses.



This change is Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 2, 2019
@highfive
Copy link

highfive commented Oct 2, 2019

warning Warning warning

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

@jdm
Copy link
Member Author

jdm commented Oct 2, 2019

@bors-servo try=wpt-mac

@bors-servo
Copy link
Contributor

⌛ Trying commit ffa4018 with merge 60184d6...

bors-servo pushed a commit that referenced this pull request Oct 2, 2019
Fix intermittent macOS reftest failures

CTCreateFontWithName intermittently returns the wrong font for a given postscript name. These changes rely on obtaining a font descriptor, using it to get the path to the actual font file on disk, getting the bytes that make up the font, and using Core Graphics to create a font handle and obtaining the Core Graphics font from the CGFont reference. This is the same strategy that font-kit uses.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23290
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24347)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Oct 2, 2019
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Oct 2, 2019
@jdm
Copy link
Member Author

jdm commented Oct 2, 2019

r? @pcwalton since this code is cribbed from font-kit.

@highfive highfive assigned pcwalton and unassigned ferjm Oct 2, 2019
}
},
None => core_text::font::new_from_name(&*self.identifier, clamped_pt_size).ok(),
None => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment linking to the issue. r=me with that.

@jdm
Copy link
Member Author

jdm commented Oct 2, 2019

@bors-servo r=pcwalton

@bors-servo
Copy link
Contributor

📌 Commit 1529436 has been approved by pcwalton

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 2, 2019
@@ -1,2 +1,2 @@
[control-chars-089.html]
expected: FAIL
sexpected: FAIL
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo?

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops.

@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 3, 2019
@jdm
Copy link
Member Author

jdm commented Oct 3, 2019

@bors-servo r=pcwalton

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 3, 2019
@bors-servo
Copy link
Contributor

📌 Commit ddbd7ae has been approved by pcwalton

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

⌛ Testing commit ddbd7ae with merge 7843811...

bors-servo pushed a commit that referenced this pull request Oct 3, 2019
Fix intermittent macOS reftest failures

CTCreateFontWithName intermittently returns the wrong font for a given postscript name. These changes rely on obtaining a font descriptor, using it to get the path to the actual font file on disk, getting the bytes that make up the font, and using Core Graphics to create a font handle and obtaining the Core Graphics font from the CGFont reference. This is the same strategy that font-kit uses.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23290
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24347)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: pcwalton
Pushing 7843811 to master...

@bors-servo bors-servo merged commit ddbd7ae into servo:master Oct 3, 2019
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 3, 2019
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.

Intermittent reftest failures due to font selection choices

6 participants