      行頭の文字を取得
      */
     private func getLineHead() -> String {
-        return self.attributedText.attributedSubstringFromRange (NSMakeRange(self.location, 1)).string
+        return self.attributedText.substring(NSMakeRange(self.location, 1))
     }
 
     /**

     */
    private func getSuggestedLineCount(offset: CGFloat? = nil) -> (Int, Bool, Bool) {
        let lineWidth: CGFloat = self.width + (offset ?? self.getOffset())
        var currentLineCount = CTTypesetterSuggestClusterBreak(self.typesetter, self.location, Double(lineWidth))
        var range = self.getCurrentLineRange(currentLineCount)
        var (didBurasagari, didOikomi) = (false, false)
        if range.location + range.length + 1 <= self.length {  // 1文字加算しても全体の文字数に収まるか
            let tmpTail = self.attributedText.attributedSubstringFromRange(NSMakeRange(range.location + range.length, 1)).string  // 次の行の2文字目
            if kCharactersCanBurasagari.contains(tmpTail) {
                range = NSMakeRange(range.location, range.length + 1)
                currentLineCount = range.length
                didBurasagari = true
            } else if kCharactersCanOikomi.contains(tmpTail) {
                range = NSMakeRange(range.location, range.length + 1)
                currentLineCount = range.length
                didOikomi = true
            }
        }
        return (currentLineCount, didBurasagari, didOikomi)

        let typographicWidth = CTLineGetTypographicBounds(ctline, nil, nil, nil)

        // 均等揃えする。ぶら下がりのために、右側のスペースを開けておく
        if let alignment = self.attributedText.textAlignment where alignment == .Justified {
            let burasagariSpace = burasagari ? Double(self.fontSize) : 0
            let oikomiSpace = oikomi ? Double(self.fontSize / 2) : 0
            let lineWidth = Double(self.width) + burasagariSpace + oikomiSpace
            if typographicWidth > (lineWidth - Double(self.fontSize)) {
                if let justifiedCtline = CTLineCreateJustifiedLine(ctline, 1, lineWidth) {
                    ctline = justifiedCtline
                }
            }
        }
        return (CGFloat(typographicWidth), offsetX, offsetY, ctline)
    }

