protected int calculateWidth(TextChunk before, TextChunk main, TextChunk after) {
   if (after != null && (after.getText().matches("[.,!\"')}]"))) {
     return main.getWidth();
   }
   if (main.getText().matches("[({]")) {
     return main.getWidth();
   } else {
     return main.getWidth() + getFontRenderer().getCharWidth(' ');
   }
 }