System Fonts

The font-family property allows for more than just font classifications. You can also apply system fonts (fonts already on an end user's computer) to your SVG text. Using the same property as before, you can apply specific font names by using font-family:'fontName', where fontName is the specific name of a typeface. Note, however, that the font name is surrounded by single or double quote marks; this allows you to include spaces within a typeface name.

For instance, the typeface Times New Roman should be applied as 'Times New Roman', because 'TimesNewRoman' is not recognized by the operating system as the name of that typeface. Often you can find the name of a font in your word processing or design program by perusing the names in ...

Get Sams Teach Yourself SVG in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.