     }
     
     func fittingSubstring(_ width: CGFloat, font: UIFont) -> String {
-        for i in stride(from: characters.count, to: 0, by: -1) {
+        for i in stride(from: count, to: 0, by: -1) {
             let substr = self[0..<i]
             if substr.width(font) <= width {
                 return substr

    }
    
    subscript (r: Range<Int>) -> String {
        let start = characters.index(startIndex, offsetBy: r.lowerBound)
//        let end = <#T##String.CharacterView corresponding to `start`##String.CharacterView#>.index(start, offsetBy: r.upperBound - r.lowerBound)
        let end = characters.index(start, offsetBy: r.upperBound - r.lowerBound)
        return String(self[Range(start..<end)])
    }


extension String {
    
    subscript (i: Int) -> Character {
        return self[index(startIndex, offsetBy: i)]
    }
    
    subscript (i: Int) -> String {
