File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
main/java/com/cloudinary/transformation
test/java/com/cloudinary/test Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ public class TextLayerBuilder extends AbstractLayerBuilder<TextLayerBuilder> {
1515 protected String textAlign = null ;
1616 protected String stroke = null ;
1717 protected String letterSpacing = null ;
18+ protected Integer lineSpacing = null ;
1819 protected String text = null ;
1920
2021 @ Override
@@ -73,6 +74,11 @@ public TextLayerBuilder letterSpacing(String letterSpacing) {
7374 this .letterSpacing = letterSpacing ;
7475 return self ();
7576 }
77+
78+ public TextLayerBuilder lineSpacing (Integer lineSpacing ) {
79+ this .lineSpacing = lineSpacing ;
80+ return self ();
81+ }
7682
7783 public TextLayerBuilder text (String text ) {
7884 this .text = SmartUrlEncoder .encode (text ).replace ("%2C" , "%E2%80%9A" ).replace ("/" , "%E2%81%84" );
@@ -119,6 +125,8 @@ protected String textStyleIdentifier() {
119125 components .add (this .stroke );
120126 if (StringUtils .isNotBlank (this .letterSpacing ))
121127 components .add ("letter_spacing_" + this .letterSpacing );
128+ if (this .lineSpacing != null )
129+ components .add ("line_spacing_" + this .lineSpacing .toString ());
122130
123131 if (this .fontFamily == null && this .fontSize == null && components .isEmpty ()) {
124132 return null ;
Original file line number Diff line number Diff line change @@ -919,8 +919,8 @@ public void testOverlayOptions() {
919919 new TextLayerBuilder ().text ("Hello World, Nice to meet you?" ).fontFamily ("Arial" ).fontSize (18 ),
920920 "text:Arial_18:Hello%20World%E2%80%9A%20Nice%20to%20meet%20you%3F" ,
921921 new TextLayerBuilder ().text ("Hello World, Nice to meet you?" ).fontFamily ("Arial" ).fontSize (18 )
922- .fontWeight ("bold" ).fontStyle ("italic" ).letterSpacing ("4" ),
923- "text:Arial_18_bold_italic_letter_spacing_4 :Hello%20World%E2%80%9A%20Nice%20to%20meet%20you%3F" ,
922+ .fontWeight ("bold" ).fontStyle ("italic" ).letterSpacing ("4" ). lineSpacing ( 3 ) ,
923+ "text:Arial_18_bold_italic_letter_spacing_4_line_spacing_3 :Hello%20World%E2%80%9A%20Nice%20to%20meet%20you%3F" ,
924924 new SubtitlesLayerBuilder ().publicId ("sample_sub_en.srt" ), "subtitles:sample_sub_en.srt" ,
925925 new SubtitlesLayerBuilder ().publicId ("sample_sub_he.srt" ).fontFamily ("Arial" ).fontSize (40 ),
926926 "subtitles:Arial_40:sample_sub_he.srt" };
You can’t perform that action at this time.
0 commit comments