a newly allocated string containing the text before offset bounded by the specified boundary_type. Use g_free() to free the returned string.