im try to use the font "SFMono-Light" as font of my SKlabel.. but keep getting the error says "SKLabelNode: SFMono-Light" font not found.
func loadSKscene()->SKScene{ // load screenPFD
let loadedScene = SKScene(fileNamed: "/Asset.scnassets/Korry.sks")!
loadedScene.scaleMode = .resizeFill
let skLabel = SKLabelNode(text: "ON")
skLabel.fontColor = .white
skLabel.fontSize = 35
skLabel.fontName = "SFMono-Light"
skLabel.horizontalAlignmentMode = .center
skLabel.verticalAlignmentMode = .center
skLabel.position = CGPoint(x: 0, y: 29)
skLabel.zPosition = 1
skLabel.name = "firstLineText"
loadedScene.addChild(skLabel)
//Test to find the children font
print(loadedScene.children)
return loadedScene
}
Funny story, if from the editor I manually insert a SKlabelNode with font SFMono that's work fine ...
See the print out of my test:
what I'm doing wrong..? why from editor I can set the Font and from code I can't.. Thanks

First, for both the SF and SF Mono font, you must refer them by the family name,
SFandSF Mono. And you can not add the weight suffix to them.However that means you can't set the font weight. Instead, you could use an
AttributeStringforSKLabelNode: