         self.text(text, p, rotationRadians: degreesToRadians(degrees), font: font, color: color)
     }
 }
-
-// Helper function inserted by Swift 4.2 migrator.
-fileprivate func convertToNSBitmapImageRepPropertyKeyDictionary(_ input: [String: Any]) -> [NSBitmapImageRep.PropertyKey: Any] {
-	return Dictionary(uniqueKeysWithValues: input.map { key, value in (NSBitmapImageRep.PropertyKey(rawValue: key), value)})
-}
-
-// Helper function inserted by Swift 4.2 migrator.
-fileprivate func convertToOptionalNSAttributedStringKeyDictionary(_ input: [String: Any]?) -> [NSAttributedString.Key: Any]? {
-	guard let input = input else { return nil }
-	return Dictionary(uniqueKeysWithValues: input.map { key, value in (NSAttributedString.Key(rawValue: key), value)})
-}
-
-// Helper function inserted by Swift 4.2 migrator.
-fileprivate func convertFromNSAttributedStringKey(_ input: NSAttributedString.Key) -> String {
-	return input.rawValue
-}

    func text(_ text:String, _ p:NSPoint, rotationRadians:CGFloat?, font : NSFont = NSFont(name: "Monaco", size: 10)!, color color_ : ConvertibleToNSColor = NSColor.black) {
        
        let color = color_.color
        
        let attr = [
            convertFromNSAttributedStringKey(NSAttributedString.Key.font):font,
            convertFromNSAttributedStringKey(NSAttributedString.Key.foregroundColor):color
        ]
        
        context.saveGraphicsState()
        

        cgContext.scaleBy(x: 1.0, y: -1.0)
        cgContext.translateBy(x: 0.0, y: -2.0 * p.y - font.pointSize)
        
        text.draw(at: p, withAttributes: [.font: font, .foregroundColor: color])
        
        context.restoreGraphicsState()
    }
