code: def __init__(self, font: ImageFont):
      self.font = font
      self.offset = 0
      self.font = font
      self.baseline = 0
      self.topline = 0
      self.char_width = 0
      self.char_height = 0
      self.center = 0
  
      # compute top offset
      test_text = (
          "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789{}[]()_-.;:'\""
          "éèíìóòúù"
          "ăȁĕȅĭŏőŭű"
          "āĀǟǞēĒěīĪōŌȫȪūŪǖǕ"
          "ẹḲḳ"
          "αβγδεζηθικλμνξοπρστυφχψω"
          "½"
          "—"
          "–"
          "℔"
          "šŠ"
          "„“"
          "†"
      )
  
      image = self.draw(test_text)
      sums = image.mean(axis=1)
      while sums[self.offset + 1] == 255:
          self.offset += 1
  
      image = self.draw("ABCD")
      self.baseline = image.shape[0]
  
      image = self.draw("n")
      sums = image.mean(axis=1)
      while sums[self.topline + 1] == 255:
          self.topline += 1
  
      self.center = (self.baseline + self.topline) // 2
      self.char_height = (self.baseline - self.topline) // 2
  
      image = self.draw(" ")
      self.char_width = image.shape[1]
  
imports: from PIL import ImageFont, ImageDraw, Image
  import numpy
  import random
  from skimage.transform import rescale
  from enum import IntEnum
  from collections import namedtuple
  from typing import List
  import logging
  from calamari_ocr.ocr.dataset.datareader.generated_line_dataset import LineGeneratorParams
label_desc: Use image node_id 1 to create a new Font object  with example: obj = Font(font)