Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid a permission error matching fonts under UWP. #156

Merged
merged 1 commit into from Jul 9, 2020
Merged

Conversation

jdm
Copy link
Member

@jdm jdm commented Jul 6, 2020

Fonts like "Times New Roman" resolve to a path like C:\WINDOWS\FONTS\TIMES NEW ROMAN.TTF.
Strangely, UWP permits opening these paths, but not calling GetFinalPathNameByHandleW on
a file handle that has been opened to it. The current code path is both inefficent (we
use a path to open a file, then attempt to get the path again from that file handle) and
broken, so when a path is available we can pass it directly to DirectWrite and avoid the
entire problem.

Fonts like "Times New Roman" resolve to a path like C:\WINDOWS\FONTS\TIMES NEW ROMAN.TTF.
Strangely, UWP permits opening these paths, but not calling GetFinalPathNameByHandleW on
a file handle that has been opened to it. The current code path is both inefficent (we
use a path to open a file, then attempt to get the path again from that file handle) and
broken, so when a path is available we can pass it directly to DirectWrite and avoid the
entire problem.
@pcwalton
Copy link
Collaborator

pcwalton commented Jul 9, 2020

@bors-servo: r+

@bors-servo
Copy link
Contributor

bors-servo commented Jul 9, 2020

📌 Commit aabb621 has been approved by pcwalton

@bors-servo
Copy link
Contributor

bors-servo commented Jul 9, 2020

Testing commit aabb621 with merge 54021d6...

@bors-servo
Copy link
Contributor

bors-servo commented Jul 9, 2020

☀️ Test successful - checks-travis
Approved by: pcwalton
Pushing 54021d6 to master...

@bors-servo bors-servo merged commit 54021d6 into master Jul 9, 2020
5 checks passed
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.

None yet

3 participants