@@ -163,13 +163,107 @@ <h2>Example 4 - Background under entire text box</h2>
163163            </ div > 
164164        </ section > 
165165        < section  class ="example "> 
166-             < canvas  id ="example5-canvas " class ="example-canvas " width ="400 " height ="400 "> </ canvas > 
166+             < h2 > Example 5 - centered text on full width background</ h2 > 
167+             < div  class ="row "> 
168+                 < div  class ="column "> 
169+                     < canvas  id ="example5-canvas " class ="example-canvas " width ="400 " height ="400 "> </ canvas > 
170+                 </ div > 
171+                 < div  class ="column "> 
172+                     < div  class ="example-description example1 "> 
173+                         < p > 
174+                             This example demonstrates the use of, < b > textAlign</ b >  option
175+                             with value set to < b > center</ b > . Default value of this option is < b > left</ b > 
176+                         </ p > 
177+                         < pre > < code  class ="language-javascript "> 
178+ let text = 'Lorem ipsum dolor sit amet, ...';
179+ 
180+ let canvas5 = document.getElementById("example5-canvas");
181+ let options5 = {
182+     textFillStyle: '#000000',
183+     fontSize: 22,
184+     lineHeight: 26,
185+     width: 350,
186+     startX: 26,
187+     startY: 26,
188+     bottomAligned: true,
189+     useBackground: true,
190+     fullWidthBackground: true,
191+     textAlign: 'center'
192+ };
193+ canvasTextBox.draw(canvas5, text, options5);
194+ </ code > </ pre > 
195+                     </ div > 
196+                 </ div > 
197+             </ div > 
167198        </ section > 
168199        < section  class ="example "> 
169-             < canvas  id ="example6-canvas " class ="example-canvas " width ="400 " height ="400 "> </ canvas > 
200+             < h2 > Example 6 - centered text without full width background</ h2 > 
201+             < div  class ="row "> 
202+                 < div  class ="column "> 
203+                     < canvas  id ="example6-canvas " class ="example-canvas " width ="400 " height ="400 "> </ canvas > 
204+                 </ div > 
205+                 < div  class ="column "> 
206+                     < div  class ="example-description example1 "> 
207+                         < p > 
208+                             Same as previous example, but without < b > fullWidthBackground</ b > 
209+                         </ p > 
210+                         < pre > < code  class ="language-javascript "> 
211+ let text = 'Lorem ipsum dolor sit amet, ...';
212+ 
213+ let canvas6 = document.getElementById("example6-canvas");
214+ let options6 = {
215+     textFillStyle: '#000000',
216+     fontSize: 22,
217+     lineHeight: 26,
218+     width: 350,
219+     startX: 26,
220+     startY: 26,
221+     bottomAligned: true,
222+     useBackground: true,
223+     fullWidthBackground: false,
224+     textAlign: 'center'
225+ };
226+ canvasTextBox.draw(canvas6, text, options6);
227+ </ code > </ pre > 
228+                     </ div > 
229+                 </ div > 
230+             </ div > 
170231        </ section > 
171232        < section  class ="example "> 
172-             < canvas  id ="example7-canvas " class ="example-canvas " width ="400 " height ="400 " style ="background-color: #808000; "> </ canvas > 
233+             < h2 > Example 7 - meme generator</ h2 > 
234+             < div  class ="row "> 
235+                 < div  class ="column "> 
236+                     < canvas  id ="example7-canvas " class ="example-canvas " width ="400 " height ="400 " style ="background-color: #808000; "> </ canvas > 
237+                 </ div > 
238+                 < div  class ="column "> 
239+                     < div  class ="example-description example1 "> 
240+                         < p > 
241+                             Font style and positioning in a use case that resembles a meme generator.
242+                         </ p > 
243+                         < pre > < code  class ="language-javascript "> 
244+ let canvas7 = document.getElementById("example7-canvas");
245+ let options7 = {
246+     fontFamily: 'Impact, Charcoal, sans-serif',
247+     textFillStyle: '#FFFF00',
248+     fontSize: 40,
249+     fontWeight: 'bold',
250+     lineHeight: 52,
251+     width: 400,
252+     startX: 0,
253+     startY: 52,
254+     bottomAligned: false,
255+     useBackground: false,
256+     textAlign: 'center'
257+ };
258+ let options71 = Object.assign({}, options7);
259+ options71.bottomAligned = true;
260+ options71.marginBottom = 20;
261+ canvasTextBox.draw(canvas7, 'Y U NOT USE THIS', options7);
262+ canvasTextBox.draw(canvas7, 'FOR MEME GENERATOR', options71);
263+ </ code > </ pre > 
264+                     </ div > 
265+                 </ div > 
266+             </ div > 
173267        </ section > 
174268    </ div > 
175269</ body > 
0 commit comments