protected function insertTextBorder($xPosition, $yPosition, $text)
    {
        if (!$this->getBorderColor() instanceof Image\Color) {
            throw new \RuntimeException(
                'Attempt to render text border without setting a color'
            );
        }

        /*
         * Set the alpha transparency to zero since we are going to render the
         * overlay text multiple times using different offsets to achieve a
         * border effect which is not natively supported by GD.
         */
        $borderAlpha = $this->getBorderColor()->getAlpha();
        $this->getBorderColor()->setAlpha(0);

        /*
         * Overwrite the original text color with the border color so we can use
         * the decorated class for rendering.
         */
        $textColor = $this->getTextColor();
        $this->setTextColor($this->getBorderColor());

        // render border
        parent::insertText($xPosition - 1, $yPosition - 1, $text);
        parent::insertText($xPosition - 1, $yPosition, $text);
        parent::insertText($xPosition - 1, $yPosition + 1, $text);
        parent::insertText($xPosition, $yPosition - 1, $text);
        parent::insertText($xPosition, $yPosition + 1, $text);
        parent::insertText($xPosition + 1, $yPosition - 1, $text);
        parent::insertText($xPosition + 1, $yPosition, $text);
        parent::insertText($xPosition + 1, $yPosition + 1, $text);

        // restore original border alpha transparency
        $this->getBorderColor()->setAlpha($borderAlpha);

        // restore original text color for rendering the text
        $this->setTextColor($textColor);

        return $this;
    }