Use strwidth instead of strlen for line width