a modified version of ovlaere/placing-text