<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def center_str(txt, font_name, font_size, offset=0):
 """Center a string on the x axis of a reportslab canvas"""

    return -(text_width(txt, font_name, font_size) / 2.0) + offset