Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
2.2 KB
Raw Blame
<svg width="120px" height="180px"
    xmlns="http://www.w3.org/2000/svg" version="2.0">
<g id="testRect">
    
    <!-- This tests css-inline line-height. Line-height:normal can be differrent depending on the renderer, but line-height:1.5 is ascent+descent*1.5. Test passes if the lower set of text aligns to the blue lines.-->
    
    <!-- These lines define the inline-size boundaries for horizontal text -->
    <line x1="10" x2="10" y1="5" y2="175" stroke="cornflowerblue" />
    <line x1="110" x2="110" y1="5" y2="175" stroke="cornflowerblue" />
    
    
    <!-- These lines define the position of the baseline for the horizontal text. -->
    <!-- line x1="5" x2="115" y1="25" y2="25" stroke="powderblue" / -->
    
    <!-- DejaVu Sans, has two different sets of 'vertical metrics: HHAE has an Ascender of 9.28125 and Descender of 2.35938, making a line-height of 11.64063, this is the one Harrfbuzz picks by default because DejaVu Sans doesn't have the 'useTypoMetrics' bit set. We actually do need the 'typometrics', which result in a line-height of ~12 (7.5 asc, 2.5 desc, 2 line gap)  -->
    <text id="test1" x="10" y="25" line-height="normal"
          font-family="DejaVu Sans" fill="blue" font-size="10" inline-size="100">Lorem ipsum dolor sit amet
    </text>
    
    <line x1="5" x2="115" y1="65" y2="65" stroke="powderblue" />
    <line x1="5" x2="115" y1="75" y2="75" stroke="powderblue" />
    <text id="test2" x="10" y="65" line-height="1.0"
          font-family="DejaVu Sans" fill="blue" font-size="10" inline-size="100">Lorem ipsum dolor sit amet
    </text>
    
    <line x1="5" x2="115" y1="105" y2="105" stroke="powderblue" />
    <line x1="5" x2="115" y1="125" y2="125" stroke="powderblue" />
    <text id="test3" x="10" y="105" line-height="2.0"
          font-family="DejaVu Sans" fill="blue" font-size="10" inline-size="100">Lorem ipsum dolor sit amet
    </text>
    
    <line x1="5" x2="115" y1="145" y2="145" stroke="powderblue" />
    <line x1="5" x2="115" y1="160" y2="160" stroke="powderblue" />
    <text id="test4" x="10" y="145" line-height="150%"
          font-family="DejaVu Sans" fill="blue" font-size="10" inline-size="100">Lorem ipsum dolor sit amet
    </text>

</g>

</svg>