You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to be able to choose a vertical alignment (relative to the y offset) for text added using images.Text. This becomes useful in the following scenarios when the number of lines of text is not fixed.
Centering text vertically.
Creating an Open Graph image with a subtitle at a fixed distance below the title. This can be achieved by making the title "bottom" aligned and the subtitle "top" aligned and having the same y offset for both texts.
It is not currently possible to implement these using only the y option which sets a vertical offset for the top of the text relative to the top of the image.
Vertical alignment would complement the horizontal alignment feature (alignx) mentioned in #10849 and added in #13223.
The text was updated successfully, but these errors were encountered:
Add option ``aligny`` to specify the vertical alignment of the text
with respect to the ``y`` offset from the top of the image. Possible
values of ``aligny`` are ``top`` (default), ``center``, and ``bottom``.
The height of the block of text is measured from the top of the first
line to the baseline of the last line.
- ``top``: (Current behaviour) The top of the first line of the block of
text is at an offset of ``y`` from the top of the image.
- ``center``: The vertical center of the block of text is at an offset of
``y`` from the top of the image.
- ``bottom``: The baseline of the last line of the text is at an offset
of ``y`` from the top of the image.
Resolvesgohugoio#13414
It would be useful to be able to choose a vertical alignment (relative to the
y
offset) for text added usingimages.Text
. This becomes useful in the following scenarios when the number of lines of text is not fixed.y
offset for both texts.It is not currently possible to implement these using only the
y
option which sets a vertical offset for the top of the text relative to the top of the image.Vertical alignment would complement the horizontal alignment feature (
alignx
) mentioned in #10849 and added in #13223.The text was updated successfully, but these errors were encountered: