code: public static String fitString(String string, int fromColumn, int availableColumnSpace) {
          if(availableColumnSpace <= 0) {
              return "";
          }
  
          StringBuilder bob = new StringBuilder();
          int column = 0;
          int index = 0;
          while(index < string.length() && column < fromColumn) {
              char c = string.charAt(index++);
              column += TerminalTextUtils.isCharCJK(c) ? 2 : 1;
          }
          if(column > fromColumn) {
              bob.append(" ");
              availableColumnSpace--;
          }
  
          while(availableColumnSpace > 0 && index < string.length()) {
              char c = string.charAt(index++);
              availableColumnSpace -= TerminalTextUtils.isCharCJK(c) ? 2 : 1;
              if(availableColumnSpace < 0) {
                  bob.append(' ');
              }
              else {
                  bob.append(c);
              }
          }
          return bob.toString();
      }
docs: Given a string that may or may not contain CJK characters, returns the substring which will fit inside
  <code>availableColumnSpace</code> columns. This method does not handle special cases like tab or new-line.
  <p>
  This overload has a {@code fromColumn} parameter that specified where inside the string to start fitting. Please
  notice that {@code fromColumn} is not a character index inside the string, but a column index as if the string
  has been printed from the left-most side of the terminal. So if the string is "日本語", fromColumn set to 1 will
  not starting counting from the second character ("本") in the string but from the CJK filler character belonging
  to "日". If you want to count from a particular character index inside the string, please pass in a substring
  and use fromColumn set to 0.
  @param string The string to fit inside the availableColumnSpace
  @param fromColumn From what column of the input string to start fitting (see description above!)
  @param availableColumnSpace Number of columns to fit the string inside
  @return The whole or part of the input string which will fit inside the supplied availableColumnSpace