1e41f4b71Sopenharmony_ci# Text Drawing 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ciThe **<svg>** component can also be used to draw text. 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ci## Text 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci> **NOTE** 10e41f4b71Sopenharmony_ci> - The text content must be written in the **<text>** area. The **<tspan>** child element label can be nested. 11e41f4b71Sopenharmony_ci> 12e41f4b71Sopenharmony_ci> - **<text>** can be nested only by the parent element label **svg**. 13e41f4b71Sopenharmony_ci> 14e41f4b71Sopenharmony_ci> - Only the default font **sans-serif** is supported. 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ciSet the following attributes to define text styles: **x** (X coordinate), **y** (Y coordinate), **dx** (x-axis offset of the text), **dy** (y-axis offset of the text), **fill** (font fill color), **stroke** (text border color), and **stroke-width** (text border width). 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci```html 20e41f4b71Sopenharmony_ci<!-- xxx.hml --> 21e41f4b71Sopenharmony_ci<div class="container"> 22e41f4b71Sopenharmony_ci <svg> 23e41f4b71Sopenharmony_ci <text x="200" y="300" font-size="80px" fill="blue" >Hello World</text> <text x="200" y="300" dx="20" dy="80" font-size="80px" fill="blue" fill-opacity="0.5" stroke="red" stroke-width="2">Hello World</text> 24e41f4b71Sopenharmony_ci <text x="20" y="550" fill="#D2691E"> 25e41f4b71Sopenharmony_ci <tspan dx="40" fill="red" font-size="80" fill-opacity="0.4">Hello World </tspan> 26e41f4b71Sopenharmony_ci </text> 27e41f4b71Sopenharmony_ci </svg> 28e41f4b71Sopenharmony_ci</div> 29e41f4b71Sopenharmony_ci``` 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci## Drawing Text Along the Path 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_ciSet **textpath** to draw text along the path. 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci```html 40e41f4b71Sopenharmony_ci<!-- xxx.hml --> 41e41f4b71Sopenharmony_ci<div class="container"> 42e41f4b71Sopenharmony_ci <svg fill="#00FF00" x="100" y="400"> 43e41f4b71Sopenharmony_ci <path d="M40,360 Q360,360 360,180 Q360,20 200,20 Q40,40 40,160 Q40,280 180,180 Q180,180 200,100" stroke="red" fill="none"></path> 44e41f4b71Sopenharmony_ci <text> 45e41f4b71Sopenharmony_ci <textpath fill="blue" startOffset="20%" path="M40,360 Q360,360 360,180 Q360,20 200,20 Q40,40 40,160 Q40,280 180,180 Q180,180 200,100" font-size="30px"> 46e41f4b71Sopenharmony_ci This is textpath test. 47e41f4b71Sopenharmony_ci </textpath> 48e41f4b71Sopenharmony_ci </text> 49e41f4b71Sopenharmony_ci </svg> 50e41f4b71Sopenharmony_ci</div> 51e41f4b71Sopenharmony_ci``` 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci 54