def _get_text_alignment(point1, point2):
    """Get the horizontal and vertical text alignment keywords for text placed at the end of a line segment from point1 to point2
    args:
        point1 - x,y pair
        point2 - x,y pair
    returns:
        ha - horizontal alignment string
        va - vertical alignment string"""
    x1, x2, y1, y2 = point1[0], point2[0], point1[1], point2[1]
    if(x1 < x2):
        ha = 'left'
    else:
        ha = 'right'
    if(y1 < y2):
        va = 'bottom'
    else:
        va = 'top'
    return(ha, va)