def METHOD_NAME(self, event):
    rect = event.rect()
    painter = QPainter(self)
    painter.setRenderHint(QPainter.Antialiasing)
    painter.fillRect(rect, self._backgroundColor)
    if not self._glyphs:
        return
    painter.translate(0, self.height())
    painter.scale(1, -1)
    availableHeight = self.height() - 2 * self._buffer
    availableWidth = self.width() - 2 * self._buffer
    scale = availableHeight / (self._upm * 1.2)
    yOffset = abs(self._descender * scale) + self._buffer
    scale = min(scale, availableWidth / self._maxWidth)
    for glyph in self._glyphs:
        if self._alignment == "left":
            xOffset = self._buffer
        elif self._alignment == "center":
            xOffset = (self.width() - (glyph.width * scale)) / 2
        else:
            xOffset = availableWidth + self._buffer - glyph.width * scale
        path = glyph.getRepresentation("defconQt.QPainterPath")
        painter.save()
        painter.translate(xOffset, yOffset)
        painter.scale(scale, scale)
        painter.fillPath(path, self._glyphColor)
        painter.restore()