diff --git a/docs/api-constructor.md b/docs/api-constructor.md index 30cbb3da..57d64d22 100644 --- a/docs/api-constructor.md +++ b/docs/api-constructor.md @@ -51,9 +51,9 @@ Implements the [stream.Duplex](http://nodejs.org/api/stream.html#stream_class_st | [options.text.text] | string | | text to render as a UTF-8 string. It can contain Pango markup, for example `LeMonde`. | | [options.text.font] | string | | font name to render with. | | [options.text.fontfile] | string | | absolute filesystem path to a font file that can be used by `font`. | -| [options.text.width] | number | 0 | integral number of pixels to word-wrap at. Lines of text wider than this will be broken at word boundaries. | -| [options.text.height] | number | 0 | integral number of pixels high. When defined, `dpi` will be ignored and the text will automatically fit the pixel resolution defined by `width` and `height`. Will be ignored if `width` is not specified or set to 0. | -| [options.text.align] | string | "'left'" | text alignment (`'left'`, `'centre'`, `'center'`, `'right'`). | +| [options.text.width] | number | 0 | Integral number of pixels to word-wrap at. Lines of text wider than this will be broken at word boundaries. | +| [options.text.height] | number | 0 | Maximum integral number of pixels high. When defined, `dpi` will be ignored and the text will automatically fit the pixel resolution defined by `width` and `height`. Will be ignored if `width` is not specified or set to 0. | +| [options.text.align] | string | "'left'" | Alignment style for multi-line text (`'left'`, `'centre'`, `'center'`, `'right'`). | | [options.text.justify] | boolean | false | set this to true to apply justification to the text. | | [options.text.dpi] | number | 72 | the resolution (size) at which to render the text. Does not take effect if `height` is specified. | | [options.text.rgba] | boolean | false | set this to true to enable RGBA output. This is useful for colour emoji rendering, or support for pango markup features like `Red!`. | diff --git a/lib/constructor.js b/lib/constructor.js index 43d7d3f1..6b60cde0 100644 --- a/lib/constructor.js +++ b/lib/constructor.js @@ -154,9 +154,9 @@ const debuglog = util.debuglog('sharp'); * @param {string} [options.text.text] - text to render as a UTF-8 string. It can contain Pango markup, for example `LeMonde`. * @param {string} [options.text.font] - font name to render with. * @param {string} [options.text.fontfile] - absolute filesystem path to a font file that can be used by `font`. - * @param {number} [options.text.width=0] - integral number of pixels to word-wrap at. Lines of text wider than this will be broken at word boundaries. - * @param {number} [options.text.height=0] - integral number of pixels high. When defined, `dpi` will be ignored and the text will automatically fit the pixel resolution defined by `width` and `height`. Will be ignored if `width` is not specified or set to 0. - * @param {string} [options.text.align='left'] - text alignment (`'left'`, `'centre'`, `'center'`, `'right'`). + * @param {number} [options.text.width=0] - Integral number of pixels to word-wrap at. Lines of text wider than this will be broken at word boundaries. + * @param {number} [options.text.height=0] - Maximum integral number of pixels high. When defined, `dpi` will be ignored and the text will automatically fit the pixel resolution defined by `width` and `height`. Will be ignored if `width` is not specified or set to 0. + * @param {string} [options.text.align='left'] - Alignment style for multi-line text (`'left'`, `'centre'`, `'center'`, `'right'`). * @param {boolean} [options.text.justify=false] - set this to true to apply justification to the text. * @param {number} [options.text.dpi=72] - the resolution (size) at which to render the text. Does not take effect if `height` is specified. * @param {boolean} [options.text.rgba=false] - set this to true to enable RGBA output. This is useful for colour emoji rendering, or support for pango markup features like `Red!`.