def blit_text(surface, font, position, text, font_color,
              background_color=None, size=None, anchor="NW", fill=True):
    """
    Blits text into a pygame Surface following the parameters described below

    :param surface: Destination surface
    :type surface: pygame.Surface
    :param font: Text font
    :type font: pygame.font.Font
    :param position: Text position inside the surface
    :type position: tuple(int, int)
    :param str text: Text content
    :param font_color: Font foreground color
    :type font_color: tuple(int, int, int)

    :param background_color: Font background color
    :type background_color: tuple(int, int, int)
    :param size: Text size
    :type size: tuple(int, int)
    :param str anchor: position of the text inside its rect (N, S, W or E)
    :param bool fill: Whether to fill the background or not

    :return: None
    """
    antialiasing = True
    rendered = font.render(text, antialiasing, font_color, background_color)

    if size is None:
        surface.blit(rendered, position)
        return None

    if background_color is not None and fill:
        surface.fill(background_color, (position, size))

    text_rect = rendered.get_rect()
    # North, South and Center
    if "N" in anchor:
        text_rect.top = position[1]
    elif "S" in anchor:
        text_rect.bottom = position[1] + size[1]
    else:
        text_rect.centery = position[1] + size[1] // 2
    # West, East and Center
    if "W" in anchor:
        text_rect.left = position[0]
    elif "E" in anchor:
        text_rect.right = position[0] + size[0]
    else:
        text_rect.centerx = position[0] + size[0] // 2

    surface.blit(rendered, text_rect)
    return None