# text

[browser](..) ⟩ [canvas]() ⟩ text

{% tabs %}
{% tab title="📘 手冊" %}
* [CanvasRenderingContext2D](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) ⟩
  * [.fillText()](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillText), [.strokeText()](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeText), [.measureText()](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/measureText)
  * text styles
    * [.font](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font) - [css](../../css "mention") font (string)
    * [.textAlign](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign) - align text horizontally.
    * [.textBaseline](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textBaseline) - align text vertically.
    * [.direction](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/direction)
{% endtab %}

{% tab title="🔴 主題" %}
*
{% endtab %}

{% tab title="📗 參考" %}
* [ ] CodePen ⟩ [Canvas multiline fillText](https://codepen.io/nishiohirokazu/pen/jjNyye)
* [ ] Steve ⟩ [How to draw multi-line text on an HTML canvas in 2021](https://blog.steveasleep.com/how-to-draw-multi-line-text-on-an-html-canvas-in-2021)
{% endtab %}

{% tab title="🗣 討論" %}
* [HTML5 canvas ctx.fillText won't do line breaks?](https://stackoverflow.com/questions/5026961/html5-canvas-ctx-filltext-wont-do-line-breaks)
{% endtab %}
{% endtabs %}
