More robust SVG text demo
How do I make an more robust svg text demo?
This pen displays how much closer a font fallback is when using the font-size-adjust and lengthAdjust properties.. What is a more robust svg text demo? How do you make a more robust svg text demo? This script and codes were developed by Taylor Hunt on 29 September 2022, Thursday.
More robust SVG text demo - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>More robust SVG text demo</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Bitter'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h2>Webfont</h2>
<svg height="60" width="500"> <rect height="39" width="296" y="10"/> <text y="1em" style="font-family: Bitter">Fee fi fo fum</text>
</svg>
<hr>
<h2>Fallback</h2>
<svg height="60" width="500"> <rect height="39" width="296" y="10"/> <text y="1em">Fee fi fo fum</text>
</svg>
<hr>
<h2>Fallback with <code>textLength</code> and <code>font-size-adjust</code></h2>
<svg height="60" width="500"> <rect height="39" width="296" y="10"/> <text y="1em" textLength="297" lengthAdjust="spacingAndGlyphs" font-size-adjust="0.531">Fee fi fo fum</text>
</svg>
<hr>
<h2>Example image of fallback when both are supported (that is, in Firefox)</h2>
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/183091/textlength-and-font-size-adjust.png" alt="When both textLength and font-size-adjust are supported, the fallback font is adjusted to be as wide and as tall as the intended webfont.">
</body>
</html>
More robust SVG text demo - Script Codes CSS Codes
text { font-size: 3em; font-family: serif;
}
rect { fill: none; stroke: red;
}
Developer | Taylor Hunt |
Username | tigt |
Uploaded | September 29, 2022 |
Rating | 3 |
Size | 1,929 Kb |
Views | 22,264 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Cross-Browser data URI encoding test | 2,374 Kb |
Web site header, circa 2016 | 2,184 Kb |
SVG Coloring Book | 24,214 Kb |
Tabs without JavaScript... or CSS | 1,585 Kb |
Deuteragonist Image | 2,909 Kb |
Favicon download test | 1,242 Kb |
SVG break-all text wrapping | 1,928 Kb |
CSS Scroll thumb autosizing | 2,278 Kb |
Natural dimensions auto-sizing | 1,732 Kb |
Scaling inline SVG with object-fit | 1,668 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
React Vote Component | Souporserious | 5,465 Kb |
A Pen by Jess | Jessamyne | 5,100 Kb |
Css3 loader | Clknap | 2,391 Kb |
Drill-down Map | Good886 | 8,484 Kb |
Sequence.js - Sliding Horizontal Parallax | Maheshc | 4,537 Kb |
CodeCamp Tribute Page | JonathanDeJesus | 6,860 Kb |
Drag n Drop | Martin42 | 2,594 Kb |
Fun form with currentColor | Bnthor | 2,713 Kb |
React Recipe Box | Krokodill | 5,347 Kb |
A Pen by Ben Babics | Benbabics | 2,957 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!