title: How to align text center to left on canvas Android
body: <p>I am developing Photography apps, and for that I am using this code:</p>
  
  <pre><code>Canvas canvas = new Canvas(bmOverlay);
  TextPaint paint = new TextPaint();
  paint.setColor(Color.RED);
  paint.setTextAlign(Align.CENTER);
  paint.setTextSize(50);
  paint.setFlags(Paint.ANTI_ALIAS_FLAG);
  // if the background image is defined in main.xml, omit this line
  canvas.drawBitmap(mBitmap, 0, 0, null);
  int left = measureTextWidth(paint, InstaTextActivity.CurrentWord);
  int top = measureTextHeight(paint, InstaTextActivity.CurrentWord);
  
  left = mBitmap.getWidth() / 2 - InstaTextActivity.textCount / 2;
  top = mBitmap.getHeight() / 2 - InstaTextActivity.textCount / 2;
  StaticLayout layout = new StaticLayout(InstaTextActivity.CurrentWord, paint, total,
   android.text.Layout.Alignment.ALIGN_NORMAL, (float) 1.0, (float) 0.0, true);
  //canvas.save();
  canvas.translate(left, top);
  layout.draw(canvas);
  //canvas.restore();
  </code></pre>
  
  <p>In this code I am using <code>paint.setTextAlign(Align.CENTER)</code>.  It aligns to centre, but text doesn't align center to left, instead it aligns centre to right.  Also, what is the proper way to align text on canvas?</p>
  
  <p><img src="https://i.stack.imgur.com/30Zyg.png" alt="enter image description here"></p>
  
  <p>But I want     </p>
  
  <p><img src="https://i.stack.imgur.com/1yy7c.png" alt="enter image description here"></p>