`Custom font is not found error` if Playground file name has different case then reference in `contents.xcworkspacedata`

Originator:volodymyr.gorlov
Number:rdar://34829352 Date Originated:October 5 2017
Status:Open Resolved:
Product:Swift Playgrounds Product Version:Xcode Version 9.0 (9A235)
Classification:Bug Reproducible:100%
 
We are using custom font in our app. In order to write UI from code in Playground we have to copy custom fonts to Playground `Resources` folder and load them manually. This workflow is working as long as Playground name has similar case of letters as reference in `contents.xcworkspacedata` in Xcode workspace. If case of letters in file name and reference is different - then custom font is missed.

Steps to Reproduce:

1. Open attached sample app.
2. Open workspace `PlaygroundTests.xcworkspace`. Build and run playground page named `View-CustomFontLabel`.
3. Open workspace `PlaygroundTests-Failure.xcworkspace`. Build and run playground page named `View-CustomFontLabel`.

Note: The difference between `PlaygroundTests-Failure.xcworkspace` and `PlaygroundTests.xcworkspace` in one line (one letter):

PlaygroundTests.xcworkspace: location = "group:Playground.playground">
PlaygroundTests-Failure.xcworkspace: location = "group:playground.playground">

Expected Results:

Playground page named `View-CustomFontLabel` working on steps #2 and #3. Custom font is loaded.

Actual Results:

Error `fatal error: Font with name `OpenSans-Bold` is not found.: file /_EDITED_/SharedUI/Font.swift, line 41` observed while running playground page named `View-CustomFontLabel`.

Version/Build:
Xcode Version 9.0 (9A235)

Configuration:
Xcode Version 9.0 (9A235)
iOS Simulator: iPhone 8 Plus, iOS 11.0 (15A372), Model: iPhone2017-B

Link to sample app GitHub repo: https://github.com/vgorloff/Radar34829352

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!