title: Canvas drawtext positioning
body: <p>I am creating a drawing tool, where user add text to image. While making the text draw to bitmap via canvas position is not being set properly. </p>
  
  <pre><code>Paint paint = new Paint();
          paint.setStyle(Paint.Style.FILL);
          paint.setColor(Color.RED);
          paint.setTypeface(tf);
          paint.setTextAlign(Paint.Align.LEFT);
  
          paint.setTextSize(30);
  
  
  
  int xPos = layoutTextViewContainer.getLeft();
          int yPos = layoutTextViewContainer.getTop();
          canvas.drawText(text, xPos, yPos, paint);
  </code></pre>
  
  <p><strong>Paint</strong></p>
  
  <pre><code>Rect textRect = new Rect();
          paint.getTextBounds(text, 0, text.length(), textRect);
          textRect.offset(0, -textRect.top);
          Canvas canvas = new Canvas(bm);
  </code></pre>
  
  <p>layoutTextViewContainer holds the edit text.
  Screen shot for more clarification.
  Black text is written and Red text is preview of embed in image<img src="https://i.stack.imgur.com/hWyNA.png" alt="enter image description here"></p>