Skip to content

Instantly share code, notes, and snippets.

@Uberi
Created April 1, 2019 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Uberi/1b35e6b5eecfec2a9026a5549bdccd7f to your computer and use it in GitHub Desktop.
Save Uberi/1b35e6b5eecfec2a9026a5549bdccd7f to your computer and use it in GitHub Desktop.
POINTS_PER_CHARACTER = 72.23 / 13
def row_col_offset_to_xy_points(row, col, offset_x, offset_y, col_widths, row_heights):
pos_x = sum(col_widths[i] for i in range(col)) * POINTS_PER_CHARACTER + offset_x
pos_y = sum(row_heights[j] for j in range(row)) + offset_y
return (pos_x, pos_y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment