             }
         }
     }
-
+    
     func releaseCachedImages() {
         releaseCachedCharacterImages()
         releaseCachedDigitsImage()
     }
-
+    
     private var _font:TRZFont = TRZFont.systemFontOfSize(12).monospacedDigitsFont
     public var font:TRZFont {
         get { return _font }

                    contentsLayer.contents = image.CGImage
                #endif
            }

            contentLayersIndex++
            charactersIndex++
        }

            let image = UIGraphicsGetImageFromCurrentImageContext()
            UIGraphicsEndImageContext()
        #endif
        
        
        if let box = imageCache?.setImage(image, key: cacheKey, font: font, color: self.textColor) {
            _cachedCharacterImageBoxes.append(box)
        }
        
        return image
    }
    
    private func createDigitsImage(font:TRZFont) -> TRZImage {
        let cacheKey = String(self.dynamicType) + ".digits"
        if let box = imageCache?.cachedImageBoxForKey(cacheKey, font: font, color: self.textColor) {
            _cachedDigitsImageBox = box
            return box.acquire()
        }
        
        let fontAttributes = fontAttributesForFont(font)
        let repetitions = self.repetitions
        var maxSize = CGSizeZero
        
        let digits = (0...9).map({String($0)})
        
        for digit in digits {
            maxSize = maxSize.union((digit as NSString).sizeWithAttributes(fontAttributes))
        }
        
        maxSize = CGSize(width: ceil(maxSize.width), height: ceil(maxSize.height))
        
        let imageSize = CGSize(width: maxSize.width, height: maxSize.height * CGFloat(digits.count) * CGFloat(repetitions))
        
        let drawingHandler = { (rect:CGRect) -> Bool in
            #if os(OSX)
                let ctx = NSGraphicsContext.currentContext()?.CGContext
            #elseif os(iOS) || os(tvOS)
                let ctx = UIGraphicsGetCurrentContext()
            #endif
            CGContextSetShouldSmoothFonts(ctx, false)
            let individualHeight = maxSize.height
            var currentRect = CGRect(origin: CGPoint(x: 0, y: 0), size: CGSize(width: imageSize.width, height: individualHeight))
            for _ in 0..<repetitions {
