     {
         didSet
         {
-            createFonts()
-            updateText()
-            self.setNeedsDisplay()
+            updateFontProperty()
         }
     }
 

    {
        didSet
        {
            createFonts()
            updateText()
            self.setNeedsDisplay()
        }
    }


        if(isPercentageSignVisible)
        {
            percentageText?.numberOfLines = 0
            createAttributedStringForVisiblePercentageSign(percentageString: percentageString)

        }else
        {
            percentageText?.numberOfLines = 1
            createAttributedStringWithoutPercentageSign(percentageString: percentageString)
        }

        self.percentageText?.attributedText = self.attributedString ?? NSAttributedString(string: "")
    }

    fileprivate func createAttributedStringWithoutPercentageSign(percentageString: String) {
        attributedString = NSMutableAttributedString(string: percentageString)
        attributedString.addAttribute(NSFontAttributeName, value: font, range: NSRange(location: 0, length: percentageString.utf8.count))
        attributedString.addAttribute(NSParagraphStyleAttributeName, value: paragraphStyle!, range: NSRange(location: 0, length: attributedString.string.utf8.count))
    }

    fileprivate func createAttributedStringForVisiblePercentageSign(percentageString: String) {
        attributedString = NSMutableAttributedString(string: percentageString + "\n%")
        attributedString.addAttribute(NSFontAttributeName, value: font, range: NSRange(location: 0, length: percentageString.utf8.count))
        attributedString.addAttribute(NSFontAttributeName, value: percentageSignFont, range: NSRange(location: percentageString.utf8.count+1, length: 1))
        attributedString.addAttribute(NSParagraphStyleAttributeName, value: paragraphStyle!, range: NSRange(location: 0, length: attributedString.string.utf8.count))
    }

    fileprivate func updateProgress()
    {
        progressLayer?.strokeEnd = CGFloat(_progress)
        updateText()
        self.setNeedsDisplay()
    }

    fileprivate func updateFontProperty() {
        createFonts()
        updateText()
        self.setNeedsDisplay()
    }
