Menu
SVG Code for Outlined Letters Text

Stroked Text

SVG can be used to create banners, charts, diagrams, graphs, illustrations, logos, maps, and many other things that require text. Fortunately you don't have to actually draw the text. You can create text using the SVG text element in which you can specify the attributes of the text. This tutorial explains how to code for outlined letters text in your SVG drawings using the SVG text element.

<svg width="300" height="60" version="1.1" xmlns="http://www.w3.org/2000/svg" style="border-style:solid;">
  <text x="25" y="40" font-family="Verdana" font-size="35" font-weight="bold" fill="white" stroke="black" stroke-width="2"">Stroked Text</text">
</svg">

Shown below are the attributes you can specify for a text element.

AttributeDescription
xx-axis coordinate of the upper-left corner of the text
yy-axis coordinate of the upper-left corner of the text
font-familyname of font, similar to styles attribute
font-sizesize of font, similar to styles attribute
font-weightboldness of font, similar to styles attribute
fillcolor to fill the characters
strokecolor to outline the characters
stroke-widthwidth of lines to outline the characters
textLengthused to ensure that text displays same width if web fonts fail to load
lengthAdjusthow text is stretched or compressed to fit into its element. Set to spacing the letter forms are preserved, the space between them stretches or shrinks. Set to spacingAndGlyphs the entire text element stretches or shrinks


Learn more at amazon.com

More Graphics Design Tips:
• Inkscape Exercise: Draw Photorealistic Sphere
• Coding a Matrice in MathML
• Introduction to X3D (Extensible 3D)
• Create GIF Animations With Free GIMP Image Editing Program
• How to Remove PNG and JPEG EXIF Metadata
• Stop Motion Animation: Nine Creative and Easy Techniques
• Drawing Text with Draw SVG
• MathML Element to Display a Fraction
• How to Really Create an Arc in SVG
• How to Trace an Image Using Inkscape