|
@@ -135,6 +135,9 @@ import Foundation
|
|
|
|
|
|
let size = string.size(withAttributes: attributes)
|
|
let size = string.size(withAttributes: attributes)
|
|
self.img = nil
|
|
self.img = nil
|
|
|
|
+ if string.length < 1 || size.width < 0.01{
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
self.img = NSImage(size: size)
|
|
self.img = NSImage(size: size)
|
|
self.img?.lockFocus()
|
|
self.img?.lockFocus()
|
|
NSGraphicsContext.current?.imageInterpolation = .high
|
|
NSGraphicsContext.current?.imageInterpolation = .high
|