Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix intermittent macOS reftest failures #24347
Merged
+44
−4
Conversation
highfive
commented
Oct 2, 2019
|
@bors-servo try=wpt-mac |
bors-servo
added 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 -->
|
|
|
r? @pcwalton since this code is cribbed from font-kit. |
| @@ -86,7 +94,33 @@ impl FontTemplateData { | |||
| Err(_) => None, | |||
| } | |||
| }, | |||
| None => core_text::font::new_from_name(&*self.identifier, clamped_pt_size).ok(), | |||
| None => { | |||
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r=pcwalton |
|
|
| @@ -1,2 +1,2 @@ | |||
| [control-chars-089.html] | |||
| expected: FAIL | |||
| sexpected: FAIL | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…t incorrect behaviour.
|
@bors-servo r=pcwalton |
|
|
bors-servo
added 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 -->
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
jdm commentedOct 2, 2019
•
edited by SimonSapin
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.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is