When overlaying 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 in placement. For example, the text on this image:
https://res.cloudinary.com/demo/image/upload/c_fill,g_center,h_157,w_292/c_fit,g_south_west,l_text:helvetica_17_bold:some%20label%20here,w_292,y_2/cld-sample-5
is displayed differently than on this image:
https://res.cloudinary.com/demo/image/upload/c_fill,g_center,h_157,w_292/c_fit,g_south_west,l_text:helvetica_17_bold:label%20with%20the%20letter%20j,w_292,y_2/cld-sample-5
The way to achieve a consistent experience is to use the text_no_trim
flag, which overrides the tight trimming of text overlays.
Including the text_no_trim
flag has the following results:
https://res.cloudinary.com/demo/image/upload/c_fill,g_center,h_157,w_292/c_fit,g_south_west,l_text:helvetica_17_bold:some%20label%20here,w_292,y_2,fl_text_no_trim/cld-sample-5
https://res.cloudinary.com/demo/image/upload/c_fill,g_center,h_157,w_292/c_fit,g_south_west,l_text:helvetica_17_bold:label%20with%20the%20letter%20j,w_292,y_2,fl_text_no_trim/cld-sample-5
More information on text_no_trim
can be found in this support article.
Comments
0 comments
Please sign in to leave a comment.