             return nsimage
         }
     }
+#endif
 }
+
+// MARK: Strings
+
+public extension CGContext {
+#if os(OSX)
+    func draw(string:String, point:CGPoint, attributes:NSDictionary?) {
+        string._bridgeToObjectiveC().drawAtPoint(point, withAttributes:attributes)
+    }
+
+    func drawLabel(string:String, point:CGPoint, size:CGFloat) {
+        let attributes = [NSFontAttributeName:NSFont.labelFontOfSize(size)]
+        self.draw(string, point:point, attributes:attributes)
+    }
 #endif
+}
 
-public extension CGContextRef {
+// MARK: Convenience shapes
+
+public extension CGContext {
 
     func strokeCross(rect:CGRect) {
         let linePoints = [


// TODO: This code is mostly experimental, use at your own risk - see TODO.markdown

public extension CGContextRef {

    class func bitmapContext(size:CGSize) -> CGContextRef! {
        let colorspace = CGColorSpaceCreateDeviceRGB()    
        var bitmapInfo = CGBitmapInfo(CGImageAlphaInfo.PremultipliedFirst.toRaw())
        return CGBitmapContextCreate(nil, UInt(size.width), UInt(size.height), 8, UInt(size.width) * 4, colorspace, bitmapInfo)

        self.strokeLine(linePoints)
    }

}
