You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wired!!! .track() attribute will lead app to crash in the situation when i call CFDictionaryGetValue for CTRun's runAttribute about kCTKernAttributedName
#352
Open
k3oirj2 opened this issue
Dec 4, 2018
· 4 comments
letquote="『In this situation app will crash, the console report: p_kern_val is null pointer』"letbaseStyle=StringStyle(.font(UIFont.systemFont(ofSize:25)),.lineSpacing(15),.lineBreakMode(.byCharWrapping),.alignment(.natural))letquoteStyle= baseStyle.byAdding(.tracking(.point(20)))letattrStr= quote.styled(with: quoteStyle)
// success situation
letquote="『In this situation, i can get the right kern value』"letbaseStyle=StringStyle(.font(UIFont.systemFont(ofSize:25)),.lineSpacing(15),.lineBreakMode(.byCharWrapping),.alignment(.natural))letmStr=NSMutableAttributedString.init(attributedString: str)
mStr.addAttribute(.kern, value:20, range:NSMakeRange(0, str.length))
The text was updated successfully, but these errors were encountered:
k3oirj2
changed the title
Wired!!! app will crash, .track() attribute will crash in the situation when i call CFDictionaryGetValue for CTRun's runAttribute about kCTKernAttributedName
Wired!!! .track() attribute will lead app to crash in the situation when i call CFDictionaryGetValue for CTRun's runAttribute about kCTKernAttributedName
Dec 4, 2018
@k3oirj2 thanks for this report! Your "success situation" code doesn't compile. There is no variable called str defined. Would you mind updating the code sample so I can reproduce the non-crashing case? And could you please also provide the value for ctRun that you're using?
Actually, I'm not that familiar with Core Text. If you could provide a Playground or unit test case that demonstrates the crash, it would help me a ton with debugging this.
@ZevEisenberg Thanks for your reply, @k3oirj2 is my another account, and i don't use it anymore. I will update my core text sample code into my repository. and i will inform you. thanks for your reply again.
Develope Enviroment:
XCode 10.1
Mac: 10.14.1
// fail situation
// success situation
// get kern value
The text was updated successfully, but these errors were encountered: