         t.width += 1
       }
     }
+    if maxWidth >= 0 && t.width > maxWidth {
+      t.width = maxWidth
+    }
     if height > 0 {
       t.height = height
-    } else if count > 0 {
+    } else if t.count > 0 {
       t.height = 1
     }
     if t.height > 0 {

      if borderBottom {
        t.height += 1
      }
    }
    if expandWidth {
      t.expandWidth = 1



public struct TellSize {
  public var count = 0                 // Useful to record NCText's char count.
  public var width = 0
  public var height = 0
  public var expandWidth = 0
