Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between textAlign Left and Start on a canvas 2d context?

What is the difference between ctx.textAlign = 'start' and ctx.textAlign = 'left' when ctx is a a 2d context for a canvas?

like image 949
RainingChain Avatar asked Aug 06 '13 23:08

RainingChain


People also ask

How do I align text to the left?

Align the text left or right Select the text that you want to align. On the Home tab, in the Paragraph group, click Align Left or Align Right .

How do I center content in canvas?

Complete HTML/CSS Course 2022 To center canvas in HTML 5, include the canvas tag in div tag. Then we can center align the div tag. By doing so, the canvas is also center aligned.


1 Answers

The start value does align left when you are using a LTR (left to right) browser. In RTL browsers, the start value aligns right.

The start value is preferred for content/text information, because it will display in a way preferable to the reader (depending on browser settings). It is the default value for this attribute. It is preferable to align right or left only when you're sure it won't introduce localization problems with rtl/lrt languages.

https://developer.mozilla.org/en-US/docs/Drawing_text_using_a_canvas

like image 143
Michael Jasper Avatar answered Sep 29 '22 06:09

Michael Jasper