update resize_string_keeping_height_ratio signature and clean code