-
Question from Fabien:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can use SVG text styling or CSS. Mozilla has a great guide: https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorials/SVG_from_scratch/Texts To create underlined text, add +text(description)(font-family="body" font-size=10 x=50 y=200 text-decoration="underline") To make italics, use Applying styles to only certain words instead of the whole text block is a little trickier. You need to use the SVG text(font-family="body" font-size=10 x=50 y=200)
| The #[tspan(font-style="italic") quick] brown fox That Pug code gets converted to the following SVG XML: <text font-family="body" font-size="10" x="50" y="200">
The <tspan font-style="italic">quick</tspan> brown fox
</text> |
Beta Was this translation helpful? Give feedback.
You can use SVG text styling or CSS. Mozilla has a great guide: https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorials/SVG_from_scratch/Texts
To create underlined text, add
text-decoration="underline"
to your element:To make italics, use
font-style="italic"
Applying styles to only certain words instead of the whole text block is a little trickier. You need to use the SVG
text
andtspan
elements directly, not the+text
and+textWrap
helper mixins. Here is an example:That Pug code gets converted…