     }
     
     /// 查找同属性历史命令
+    ///
+    /// find last attribute with same command type
     private func lastAttr(in attrs: [(String, Any)], with attrName: String) -> Any? {
         for (key, value) in attrs.reversed() {
             if key == attrName {

    }
    
    /// 图片获取代理
    public var imageDelegate : GetImageForTextFormater = NilImageDelegate()
    
    /// 定制化字体
    public private(set) var fonts : [String : String] = [
        "normalfont" : UIFont.systemFont(ofSize: UIFont.systemFontSize).fontName,
        "boldfont" : UIFont.boldSystemFont(ofSize: UIFont.systemFontSize).fontName,
        "italicfont" : UIFont.boldSystemFont(ofSize: UIFont.systemFontSize).fontName,
        ]
    /// 设置定制化字体
    /// - parameter name: 格式化命令名
    /// - parameter font: 对应字体
    public func setFont(name: String, font: UIFont) {
        fonts[name.lowercased()] = font.fontName
        setCommand(command: name.lowercased(), squance: "ThemeFont")
    }
    
    /// 标准字号
    public var normalFontSize: CGFloat = UIFont.systemFontSize
    
    /// 定制化颜色
    public private(set) var colors : [String : UIColor] = [
        "defaultColor" : UIColor.black,
        "black" : UIColor.black,

        }
        
        // 文本分段
        // seperate string with commands
        var formatedLocation = 0
        var attrs: [(String, Any)] = []
        attrs.append((NSFontAttributeName, UIFont(name: fonts["normalfont"]!, size: normalFontSize) as Any))
        for result in regular.matches(in: _text, options: .reportProgress, range: NSMakeRange(0, _text.utf16.count)) {
            if formatedLocation < result.range.location {
                // 本段为内容
                // this section is content
                let _t = (_text as NSString).substring(with: NSRange(location: formatedLocation, length: result.range.location - formatedLocation))
                var _attrDict: [String : Any] = [:]
                for (key, value) in attrs {
