Skip to content

Instantly share code, notes, and snippets.

@rdmpage
Last active December 15, 2015 19:19
Show Gist options
  • Save rdmpage/5310136 to your computer and use it in GitHub Desktop.
Save rdmpage/5310136 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="600"
height="200"
id="svg2"
version="1.1"
>
<style
type="text/css"
>
path {
stroke: #000;
stroke-width:1;
stroke-linecap:square;
fill: none;
}
text {
dominant-baseline: alphabetic;
font-family:Times-Roman;
}
rect {
fill:none;
stroke: #000;
fill:none;
}
</style>
<!-- baseline -->
<path d="M 100 100 400 100" />
<text x="400" y="100" style="font-size:14px;"><tspan>baseline</tspan></text>
<!-- font 100 px -->
<path d="M 95 0 95 100" />
<text x="0" y="50" style="font-size:14px;"><tspan>font-size:100 px</tspan></text>
<!-- 662 + 217 = 879 879/2 = 4 -->
<!-- cap height = 662/1000 * font height -->
<!-- <path d="M 91 100 91 110.85 " /> -->
<path d="M 100 33.8 400 33.8 " />
<text x="400" y="33.8" style="font-size:14px;"><tspan>capheight</tspan></text>
<path d="M 100 121.7 400 121.7 " />
<text x="400" y="121.7" style="font-size:14px;"><tspan>descender</tspan></text>
<rect x="100" y="100" width="100" height="100" transform="translate(0,-100)" style="fill:yellow;opacity:0.4;" />
<text x="100" y="100" style="font-size:100px;"><tspan>MŮ(xp</tspan></text>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment