docs: def draw_port_label(context, port, transparency, fill, label_position, show_additional_value=False,
                      additional_value=None, only_extent_calculations=False):
      """Draws a normal label indicating the port name.
  
      :param context: Draw Context
      :param port: The PortView
      :param transparency: Transparency of the text
      :param fill: Whether the label should be filled or not
      :param label_position: Side on which the label should be drawn
      :param show_additional_value: Whether to show an additional value (for data ports)
      :param additional_value: The additional value to be shown
      :param only_extent_calculations: Calculate only the extends and do not actually draw
      """
      c = context
      cairo_context = c
      if isinstance(c, CairoBoundingBoxContext):
          cairo_context = c._cairo
  
      # Gtk TODO
      # c.set_antialias(Antialias.GOOD)
  
      text = port.name
      label_color = get_col_rgba(port.fill_color, transparency)
      text_color = port.text_color
      port_height = port.port_size[1]
  
      port_position = c.get_current_point()
  
      layout = PangoCairo.create_layout(cairo_context)
      layout.set_text(text, -1)
  
      font_name = constants.INTERFACE_FONT
      font = FontDescription(font_name + " " + str(FONT_SIZE))
      layout.set_font_description(font)
  
      ink_extents, logical_extents = layout.get_extents()
      extents = [extent / float(SCALE) for extent in [logical_extents.x, logical_extents.y,
                                                      logical_extents.width, logical_extents.height]]
      real_text_size = extents[2], extents[3]
      desired_height = port_height
      scale_factor = real_text_size[1] / desired_height
  
      # margin is the distance between the text and the border line
      margin = desired_height / 2.5
      arrow_height = desired_height
      # The real_text_size dimensions are rotated by 90 deg compared to the label, as the label is drawn upright
      text_size = desired_height, real_text_size[0] / scale_factor,
      text_size_with_margin = text_size[0] + 2 * margin, text_size[1] + 2 * margin + arrow_height
      port_distance = desired_height
      port_offset = desired_height / 2.
  
      if label_position is SnappedSide.RIGHT:
          label_angle = deg2rad(-90)
          text_angle = 0
      elif label_position is SnappedSide.BOTTOM:
          label_angle = 0
          text_angle = deg2rad(-90)
      elif label_position is SnappedSide.LEFT:
          label_angle = deg2rad(90)
          text_angle = 0
      else:  # label_position is SnappedSide.TOP:
          label_angle = deg2rad(180)
          text_angle = deg2rad(90)
  
      # Draw (filled) outline of label
      c.move_to(*port_position)
      c.save()
      c.rotate(label_angle)
      draw_label_path(c, text_size_with_margin[0], text_size_with_margin[1], arrow_height, port_distance, port_offset)
      c.restore()
  
      c.set_line_width(port_height * .03)
      c.set_source_rgba(*label_color)
      label_extents = c.stroke_extents()
      if label_extents[0] == 0:
          label_extents = c.fill_extents()
  
      if only_extent_calculations:
          c.new_path()
      else:
          if fill:
              c.fill_preserve()
          c.stroke()
  
          # Move to the upper left corner of the desired text position
          c.save()
          c.move_to(*port_position)
          c.rotate(label_angle)
          c.rel_move_to(0, port_distance + arrow_height + 2 * margin)
          c.scale(1. / scale_factor, 1. / scale_factor)
          c.rel_move_to(-real_text_size[1] / 2 - extents[1], real_text_size[0] - extents[0])
          c.restore()
  
          # Show text in correct orientation
          c.save()
          c.rotate(text_angle)
          c.scale(1. / scale_factor, 1. / scale_factor)
          # Correction for labels positioned right: as the text is mirrored, the anchor point must be moved
          if label_position is SnappedSide.RIGHT:
              c.rel_move_to(-real_text_size[0], -real_text_size[1])
          c.set_source_rgba(*get_col_rgba(text_color, transparency))
          PangoCairo.update_layout(cairo_context, layout)
          PangoCairo.show_layout(cairo_context, layout)
          c.restore()
  
      if show_additional_value:
          value_text = limit_value_string_length(additional_value)
          value_layout = PangoCairo.create_layout(cairo_context)
          value_layout.set_text(value_text, -1)
          value_layout.set_font_description(font)
  
          ink_extents, logical_extents = value_layout.get_extents()
          extents = [extent / float(SCALE) for extent in [logical_extents.x, logical_extents.y,
                                                          logical_extents.width, logical_extents.height]]
          value_text_size = extents[2], real_text_size[1]
  
          # Move to the upper left corner of the additional value box
          c.save()
          c.move_to(*port_position)
          c.rotate(label_angle)
          c.rel_move_to(-text_size_with_margin[0] / 2., text_size_with_margin[1] + port_distance)
          # Draw rectangular path
          c.rel_line_to(text_size_with_margin[0], 0)
          c.rel_line_to(0, value_text_size[0] / scale_factor + 2 * margin)
          c.rel_line_to(-text_size_with_margin[0], 0)
          c.close_path()
          c.restore()
  
          value_extents = c.stroke_extents()
  
          if only_extent_calculations:
              c.new_path()
          else:
              # Draw filled outline
              c.set_source_rgba(*get_col_rgba(gui_config.gtk_colors['DATA_VALUE_BACKGROUND']))
              c.fill_preserve()
              c.set_source_rgb(*gui_config.gtk_colors['BLACK'].to_floats())
              c.stroke()
  
              # Move to the upper left corner of the desired text position
              c.save()
              c.move_to(*port_position)
              c.rotate(label_angle)
              c.rel_move_to(0, margin + text_size_with_margin[1] + port_distance)
              c.scale(1. / scale_factor, 1. / scale_factor)
              c.rel_move_to(-real_text_size[1] / 2., value_text_size[0])
              c.restore()
  
              # Show text in correct orientation
              c.save()
              c.rotate(text_angle)
              c.scale(1. / scale_factor, 1. / scale_factor)
              # Correction for labels positioned right: as the text is mirrored, the anchor point must be moved
              if label_position is SnappedSide.RIGHT:
                  c.rel_move_to(-value_text_size[0] - margin * scale_factor, -real_text_size[1])
              c.set_source_rgba(*get_col_rgba(gui_config.gtk_colors['SCOPED_VARIABLE_TEXT']))
              PangoCairo.update_layout(cairo_context, value_layout)
              PangoCairo.show_layout(cairo_context, value_layout)
              c.restore()
  
          label_extents = min(label_extents[0], value_extents[0]), min(label_extents[1], value_extents[1]), \
                          max(label_extents[2], value_extents[2]), max(label_extents[3], value_extents[3])
  
      return label_extents