diff options
| author | sekelsenmat <sekelsenmat@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2010-09-01 08:11:36 +0000 |
|---|---|---|
| committer | sekelsenmat <sekelsenmat@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2010-09-01 08:11:36 +0000 |
| commit | 938491a71eb0760b5e723262ac1e568f2a4bc74f (patch) | |
| tree | ebdb713f95d7d4f34727363c1d55c31546540294 /packages/fpvectorial | |
| parent | 01c47caf9eb515186faf8f0dd1260900acd5146a (diff) | |
| download | fpc-938491a71eb0760b5e723262ac1e568f2a4bc74f.tar.gz | |
Fixes the font size setting in the fpvectorial svg output and adds a bigger test to the suite
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15929 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fpvectorial')
| -rw-r--r-- | packages/fpvectorial/examples/fpvwritetest.pas | 27 | ||||
| -rw-r--r-- | packages/fpvectorial/src/svgvectorialwriter.pas | 8 |
2 files changed, 30 insertions, 5 deletions
diff --git a/packages/fpvectorial/examples/fpvwritetest.pas b/packages/fpvectorial/examples/fpvwritetest.pas index ea01977afe..1a189cafbb 100644 --- a/packages/fpvectorial/examples/fpvwritetest.pas +++ b/packages/fpvectorial/examples/fpvwritetest.pas @@ -101,18 +101,39 @@ begin // text_ascii One text written at (10, 10) Vec.Clear; - Vec.AddText(10, 10, 0, 'Some text in english.'); + Vec.AddText(10, 10, 0, '10,10 Some text in english.'); Vec.WriteToFile('text_ascii' + cExtension, cFormat); // text_europen One text testing european languages at (20, 20) Vec.Clear; - Vec.AddText(20, 20, 0, 'Mówić, cześć, Włosku, Parabéns, Assunção, Correções.'); + Vec.AddText(20, 20, 0, '20, 20 Mówić, cześć, Włosku, Parabéns, Assunção, Correções.'); Vec.WriteToFile('text_europen' + cExtension, cFormat); // text_asian One text testing asian languages at (30, 30) Vec.Clear; - Vec.AddText(30, 30, 0, '森林,是一个高密度树木的区域'); + Vec.AddText(30, 30, 0, '30, 30 森林,是一个高密度树木的区域'); Vec.WriteToFile('text_asian' + cExtension, cFormat); + + // multi_test_1 Combines various elements + Vec.Clear; + Vec.StartPath(0, 20); + Vec.AddLineToPath(30, 30); + Vec.EndPath(); + Vec.StartPath(0, 0); + Vec.AddLineToPath(100, 0); + Vec.AddLineToPath(100, 100); + Vec.AddLineToPath(0, 100); + Vec.AddLineToPath(0, 0); + Vec.EndPath(); + Vec.StartPath(0, 0); + Vec.AddLineToPath(10, 10); + Vec.AddBezierToPath(10, 20, 20, 20, 20, 10); + Vec.AddLineToPath(30, 0); + Vec.EndPath(); + Vec.AddText(10, 10, 0, '10,10 Some text in english.'); + Vec.AddText(20, 20, 0, '20, 20 Mówić, cześć, Włosku, Parabéns, Assunção, Correções.'); + Vec.AddText(30, 30, 0, '30, 30 森林,是一个高密度树木的区域'); + Vec.WriteToFile('multi_test_1' + cExtension, cFormat); finally Vec.Free; end; diff --git a/packages/fpvectorial/src/svgvectorialwriter.pas b/packages/fpvectorial/src/svgvectorialwriter.pas index eb73f80b4e..76272a9697 100644 --- a/packages/fpvectorial/src/svgvectorialwriter.pas +++ b/packages/fpvectorial/src/svgvectorialwriter.pas @@ -182,9 +182,13 @@ begin AStrings.Add(' <text '); AStrings.Add(' x="' + FloatToStr(PtX, FPointSeparator) + '"'); AStrings.Add(' y="' + FloatToStr(PtY, FPointSeparator) + '"'); - AStrings.Add(' font-size="' + IntToStr(FontSize) + '"'); +// AStrings.Add(' font-size="' + IntToStr(FontSize) + '"'); Doesn't seam to work, we need to use the tspan AStrings.Add(' font-family="' + SVGFontFamily + '">'); - AStrings.Add(TextStr + '</text>'); + AStrings.Add(' <tspan '); + AStrings.Add(' style="font-size:' + IntToStr(FontSize) + '" '); +// AStrings.Add(' id="tspan2828" '); + AStrings.Add(' >'); + AStrings.Add(TextStr + '</tspan></text>'); end; end; |
