It crashes runtime except when the given string is not an existing font
family name, in which case it returns nil (as expected).

So I'm unable to use it.

Here's a REPL session demo of the issue, but it's the same in Xcode 8 and
8.1 beta 1 (haven't tried any other versions):

Welcome to Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38).
Type :help for assistance.
  1> import AppKit
  2> NSFontManager.shared().availableMembers(ofFontFamily: "Blahblah")
$R0: [[Any]]? = nil
  3> NSFontManager.shared().availableMembers(ofFontFamily: "Georgia")
Execution interrupted. Enter code to recover and continue.
Enter LLDB commands to investigate (type :help for assistance.)
  4> NSFontManager.shared().availableMembers(ofFontFamily: "Times")
Execution interrupted. Enter code to recover and continue.
Enter LLDB commands to investigate (type :help for assistance.)
  5> NSFontManager.shared().availableMembers(ofFontFamily: "Timeeess")
$R1: [[Any]]? = nil
  6>

Any ideas and/or workarounds?

/Jens
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to