title: Draw text on bitmap in the bottom left corner
body: <p>I'm trying to draw some text on bitmap with a fixed position (Bottom left corner) no matter how bitmap size different.</p>
  
  <p>Code below works but, the Text is drawn on the center of the bitmap</p>
  
  <pre><code>public Bitmap drawTextToBitmap(Context gContext,
                                 Bitmap bitmap,
                                 String gText) {
      Resources resources = gContext.getResources();
      float scale = resources.getDisplayMetrics().density;
      android.graphics.Bitmap.Config bitmapConfig =
              bitmap.getConfig();
      if (bitmapConfig == null) {
          bitmapConfig = android.graphics.Bitmap.Config.ARGB_8888;
      }
      bitmap = bitmap.copy(bitmapConfig, true);
      Canvas canvas = new Canvas(bitmap);
      Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
      paint.setColor(getResources().getColor(R.color.fujiColor));
      paint.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/DS-DIGI.TTF"));
      paint.setTextSize((int) (14 * scale));
      paint.setShadowLayer(1f, 0f, 1f, getResources().getColor(R.color.fujiShadowColor));
      Rect bounds = new Rect();
      paint.getTextBounds(gText, 0, gText.length(), bounds);
      int x = (bitmap.getWidth() - bounds.width()) / 2;
      int y = (bitmap.getHeight() + bounds.height()) / 2;
      canvas.drawText(gText, x, y, paint);
      return bitmap;
  }
  </code></pre>
  
  <p>What I need is something similar to this : </p>
  
  <p><a href="https://i.stack.imgur.com/bji72.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bji72.jpg" alt="enter image description here"></a></p>
  
  <p>Thank you.</p>