Return a default font when a font name cannot be found#1253
Conversation
- Disabled a related unit test - Revert this change when microsoft#1250 is finished Fixes microsoft#1251
| // For now return a default font to avoid crashes in case of missing fonts | ||
| // When #1250 is completed, remove this | ||
| if (!properties.familyName) { | ||
| name = CFSTR("Segoe UI"); |
There was a problem hiding this comment.
Segoe UI [](start = 22, length = 8)
make this into a defined cost. #WontFix
There was a problem hiding this comment.
no.
- we're reverting this soon anyway, no reason to make this change bigger and messier to revert.
- this isn't intended to be our go-to default font functionality. we have other default font constants elsewhere. this just has to be any default font. (@rajsesh-msft and I were throwing around the idea of using something ugly so it'd stick out)
In reply to: 85445534 [](ancestors = 85445534)
aballway
left a comment
There was a problem hiding this comment.
Approved, seconding font name as a const
|
same as below - it'd be a no-op, so there's no reason to have the code actually execute, but it's a useful reminder that DWRITE_FONT_STYLE, STRETCH, WEIGHT, _NORMAL exists and we didn't forget about it In reply to: 256795601 [](ancestors = 256795601,256795517,256795157) Refers to: Frameworks/CoreGraphics/DWriteWrapper.mm:317 in a31c45e. [](commit_id = a31c45e, deletion_comment = False) |
|
|
I know this is not part of the CR, but I'm curious why Refers to: tests/unittests/CoreText/CTFontTests.mm:227 in a31c45e. [](commit_id = a31c45e, deletion_comment = False) |
I wrote this one before the rest and I missed that the reference platform also has Courier New and not just Courier as default fonts. I'll fix this in #1212. In reply to: 256796499 [](ancestors = 256796499) Refers to: tests/unittests/CoreText/CTFontTests.mm:227 in a31c45e. [](commit_id = a31c45e, deletion_comment = False) |
|
|
Fixes #1251
This change is