Текст в SVG

Лабораторная работа №3 по предмету «Графическая визуализация».

Выполнил студент второго курса математического факультета Фомин В.Л.

Цель работы: Ввести какой-либо текст в документе SVG



Рисунок SVG lab03p1.svg

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="800" height="500">
<g font-family="Arial" font-size="40" stroke="black" stroke-width="2">
<text x="10" y="40" fill="red">
Theorem of Pifagor
</text>
</g>
<path d="M30,100 l400,0 l-400, 300 z" style="fill:none; stroke:blue; stroke-width:3"/>
<path d="M30,100 l144,192 z" style="fill:none; stroke:blue; stroke-width:3"/>
<g font-family="Arial" font-size="30" stroke="black" stroke-width="2">
<text x="8" y="95" fill="red">
C
</text>
<text x="420" y="95" fill="red">
A
</text>
<text x="8" y="410" fill="red">
B
</text>
<text x="170" y="320" fill="red">
M
</text>
</g>
<g font-family="Arial" font-size="20">
<text x="470" y="65" fill="red">
ACB=AMC=BMC=Pi/2 
</text>
<text x="470" y="95" fill="red">
Cos(A)=AM/AC=AC/AB 
</text>
<text x="470" y="125" fill="red">
Cos(B)=BM/BC=BC/AB 
</text>
<text x="470" y="155" fill="red">
AC*AC=AM*AB
</text>
<text x="470" y="185" fill="red">
BC*BC=BM*AB
</text>
<text x="470" y="215" fill="red">
AC*AC+BC*BC=(AM+BM)*AB
</text>
<text x="470" y="245" fill="red">
AC*AC+BC*BC=AB*AB
</text>
<text x="300" y="275" fill="blue">
AC=400
</text>
<text x="300" y="300" fill="blue">
BC=300
</text>
<text x="300" y="330" fill="blue">
AB=500
</text>
<text x="300" y="360" fill="blue">
CM=240
</text>
<text x="300" y="390" fill="blue">
AM=320
</text>
<text x="300" y="420" fill="blue">
BM=180
</text>
<text x="470" y="300" fill="green">
Cos(A)=320/400=400/500=4/5 
</text>
<text x="470" y="350" fill="green">
Cos(B)=180/300=300/500=3/5 
</text>
</g>
</svg>
Вывод.текст целесообразно вводить возле рисунка или чертежа. Для ввода обычного текстового документа достаточно html-редактора.

На главную страницу.