When overlaying a text on an image, Cloudinary automatically trims the text's container according to the text layer's height.
There are cases when some long characters (e.g., 'j' in the example below) divert from the line's average height, and this might create differences. For example, the text on this image:
https://res.cloudinary.com/demo/image/upload/c_fill,g_center,h_157,w_292/c_fit,co_rgb:eee,g_south_west,l_text:helvetica_17_bold:some%20label%20here,w_292,y_2/sample

Is trimmed differently than on this image:
https://res.cloudinary.com/demo/image/upload/c_fill,g_center,h_157,w_292/c_fit,co_rgb:eee,g_south_west,l_text:helvetica_17_bold:some%20j%20label%20here,w_292,y_2/sample

The way to achieve a consistent experience, in this case, is to use the `text_no_trim` flag that would override the automatic trimming for the texts contained.
This would make the images look like below:
https://res.cloudinary.com/demo/image/upload/c_fill,g_center,h_157,w_292/fl_text_no_trim,c_fit,co_rgb:eee,g_south_west,l_text:helvetica_17_bold:some%20label%20here,w_292,y_2/sample

https://res.cloudinary.com/demo/image/upload/c_fill,g_center,h_157,w_292/fl_text_no_trim,c_fit,co_rgb:eee,g_south_west,l_text:helvetica_17_bold:some%20j%20label%20here,w_292,y_2/sample

Another article regarding the `text_no_trim` flag can be found here.
Comments
0 comments
Please sign in to leave a comment.