Added unicode support and proper height offset

This commit fixed unicode decoding errors, replaces the assumed vertical padding with a calculated offset, and extracts the `get_initial` functionality.