         keyboardType = UIKeyboardType.numbersAndPunctuation
         contentInset = UIEdgeInsets.zero
         textAlignment = NSTextAlignment.right
-        self.font = font
+        font = UIFont.numeric(size:kFontSize)
         self.controller = controller
         
         restart()

    
    private func updateInsets()
    {
        let width:CGFloat = bounds.maxX
        let height:CGFloat = bounds.maxY
        let usableWidth:CGFloat = width - insetsHorizontal2
        let usableSize:CGSize = CGSize(width:usableWidth, height:height)
        let attributed:NSAttributedString = NSAttributedString(
            string:text,
            attributes:attributes)
        let boundingRect:CGRect = attributed.boundingRect(
            with:usableSize,
            options:drawingOptions,
            context:nil)
        let textHeight:CGFloat = ceil(boundingRect.size.height)
        var insetsTop:CGFloat = height - textHeight
        
        if insetsTop > kMaxInsetsTop
        {
            insetsTop = kMaxInsetsTop
        }
        else
        {
            insetsTop -= 10
        }
        
        textContainerInset = UIEdgeInsets(

class VCalculatorText:UITextView, UITextViewDelegate
{
    private weak var controller:CCalculator!
    private let drawingOptions:NSStringDrawingOptions
    private let insetsHorizontal3:CGFloat
    private let kFontSize:CGFloat = 50
    private let kInsetsHorizontal:CGFloat = 5
    private let kMaxInsetsTop:CGFloat = 150
    
    init(controller:CCalculator)
    {
        drawingOptions = NSStringDrawingOptions([
            NSStringDrawingOptions.usesLineFragmentOrigin,
            NSStringDrawingOptions.usesFontLeading])
        insetsHorizontal3 = kInsetsHorizontal + kInsetsHorizontal + kInsetsHorizontal
        
        super.init(frame:CGRect.zero, textContainer:nil)
        delegate = self
