{"id":748,"date":"2019-09-24T06:29:53","date_gmt":"2019-09-24T06:29:53","guid":{"rendered":"https:\/\/www.bverhue.nl\/delphisvg\/?p=748"},"modified":"2019-09-24T06:29:54","modified_gmt":"2019-09-24T06:29:54","slug":"svg-control-package-version-2-3","status":"publish","type":"post","link":"https:\/\/www.bverhue.nl\/delphisvg\/2019\/09\/24\/svg-control-package-version-2-3\/","title":{"rendered":"SVG Control Package Version 2.3"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This is a complete rewrite of the package partly to remove some limitations in the previous version but also to make it ready for future improvements and extensions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Among the changes are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Support for FPC Lazarus<\/li><li>Added interfaces for more graphic libraries<\/li><li>Improved text rendering<\/li><li>Faster integrated parser<\/li><li>New licensing terms<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Support for FPC Lazarus<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The package will now also compile for FPC Lazarus, Windows, MacOS and Linux.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You need at least FPC 3.0.4 and Lazarus 1.8.4. Also needed is the &#8221; rtl-generics&#8221;  package.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Delphi you need at least XE2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong> Added interfaces for more graphic libraries<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Windows next to the Direct2D &#8220;WIC&#8221; render context there is also a render context based on the <a rel=\"noreferrer noopener\" aria-label=\"DirectX 11 &quot;Device Context&quot; (opens in a new tab)\" href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/direct2d\/devices-and-device-contexts\" target=\"_blank\">DirectX 11 &#8220;Device Context&#8221;<\/a>. This last one supports hardware accelerated <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/direct2d\/built-in-effects\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"effects (opens in a new tab)\">effects<\/a>. You can use theses render contexts with Delphi and FPC Lazarus.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">All the header files needed to render with DirectX are translated and included in the package.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Mac OS there is a dedicated render context based on &#8220;Quartz&#8221;, can be used with Delphi FMX and FPC Lazarus.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There is now also a render context based on the &#8220;<a href=\"https:\/\/github.com\/graphics32\/graphics32\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Graphics32 (opens in a new tab)\">Graphics32<\/a>&#8221; library<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For FPC Lazarus there is a render context based on &#8220;<a href=\"https:\/\/github.com\/bgrabitmap\/bgrabitmap\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"BGRA bitmap (opens in a new tab)\">BGRA bitmap<\/a>&#8220;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See the &#8220;<a rel=\"noreferrer noopener\" aria-label=\"Technical design (opens in a new tab)\" href=\"https:\/\/www.bverhue.nl\/delphisvg\/technical-design\" target=\"_blank\">Technical design<\/a>&#8221; page for an overview of the available render contexts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Or take a look at the &#8220;<a href=\"https:\/\/www.bverhue.nl\/delphisvg\/rendering-examples\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Rendering examples (opens in a new tab)\">Rendering examples<\/a>&#8221; how these render contexts compare.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Improved text rendering<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Similar to the &#8220;Render context&#8221; interface, an interface is added to the package that gives access to font and text formatting libraries, called a &#8220;text layout&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Windows there is a text layout based on &#8220;DirectWrite&#8221; and legacy &#8220;GDI fonts&#8221; with &#8220;Uniscribe&#8221;. Again all header files needed are included in the package.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For MacOS there is a text layout based on &#8220;Core text&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These text formatting libraries support complex text formatting, for example bi-directionality and ligatures.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There is also a text layout based on &#8220;Freetype&#8221; but this one has only limited text formatting capabilities but is available for every operating system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The text layout is independent from the render context, so you can for example choose &#8220;Graphics32&#8221; render context and &#8220;DirectWrite&#8221; as a text layout.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> See the &#8220;<a rel=\"noreferrer noopener\" aria-label=\"Technical design (opens in a new tab)\" href=\"https:\/\/www.bverhue.nl\/delphisvg\/technical-design\" target=\"_blank\">Technical design<\/a>&#8221; page for an overview of the available text layouts or the <a rel=\"noreferrer noopener\" aria-label=\"&quot;Rendering examples (opens in a new tab)\" href=\"https:\/\/www.bverhue.nl\/delphisvg\/rendering-examples\" target=\"_blank\">&#8220;Rendering examples<\/a>&#8221; for comparison.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Faster integrated parser<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The parser is integrated, this means that you can set attributes by text, for example to change the &#8220;style&#8221; attribute for an element you can simply code it like so:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Node.Attributes['style'] := 'font-family: \"times\"; font-size: 24; fill: red;';<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also add fragments to create child elements, for example:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>procedure TForm1.SVG2Image1Click(Sender: TObject);             <br>var             <br>\u00a0 Element: ISVGElement;             <br>begin             <br>\u00a0 Element := SVG2Image1.SVGRoot.Element['text'];             <br>\u00a0 if assigned(Element) then             <br>\u00a0 begin             <br>\u00a0\u00a0\u00a0 Element.ChildNodes.Clear;             <br>\u00a0\u00a0\u00a0 Element.AddFragment('&lt;tspan fill=\"yellow\">Button &lt;tspan fill=\"red\" font-weight=\"bold\" text-decoration=\"underline\">clicked!&lt;\/tspan>&lt;\/tspan>');             <br>\u00a0\u00a0\u00a0 SVG2Image1.Repaint;             <br>\u00a0 end;             <br>end; <\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <a rel=\"noreferrer noopener\" aria-label=\"help file contains a number of example (opens in a new tab)\" href=\"https:\/\/www.bverhue.nl\/SVGDoc23\/Delphi%20SVG%20control%20version%202_3.html#idProgrammingExamples\" target=\"_blank\">help file contains a number of examples<\/a> how to create animations or interact with SVG graphics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>New licensing terms<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The new license is based on a subscription. There is a one time fee to buy the source code and a yearly subscription fee for receiving fixes and updates. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have a v2.2 license you can upgrade to v2.3 for the amount of the subscription fee.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For details see the &#8220;<a href=\"https:\/\/www.bverhue.nl\/delphisvg\/order-page\">Order page<\/a>&#8220;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Or check out the free demo package or the demo viewer apps <a href=\"https:\/\/www.bverhue.nl\/delphisvg\/downloads\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a complete rewrite of the package partly to remove some limitations in the previous version but also to make it ready for future improvements and extensions. Among the changes are: Support for FPC Lazarus Added interfaces for more graphic libraries Improved text rendering Faster integrated parser New licensing terms Support for FPC Lazarus &#8230; <a title=\"SVG Control Package Version 2.3\" class=\"read-more\" href=\"https:\/\/www.bverhue.nl\/delphisvg\/2019\/09\/24\/svg-control-package-version-2-3\/\" aria-label=\"Read more about SVG Control Package Version 2.3\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":682,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-748","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.bverhue.nl\/delphisvg\/wp-json\/wp\/v2\/posts\/748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bverhue.nl\/delphisvg\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bverhue.nl\/delphisvg\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bverhue.nl\/delphisvg\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bverhue.nl\/delphisvg\/wp-json\/wp\/v2\/comments?post=748"}],"version-history":[{"count":15,"href":"https:\/\/www.bverhue.nl\/delphisvg\/wp-json\/wp\/v2\/posts\/748\/revisions"}],"predecessor-version":[{"id":763,"href":"https:\/\/www.bverhue.nl\/delphisvg\/wp-json\/wp\/v2\/posts\/748\/revisions\/763"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bverhue.nl\/delphisvg\/wp-json\/wp\/v2\/media\/682"}],"wp:attachment":[{"href":"https:\/\/www.bverhue.nl\/delphisvg\/wp-json\/wp\/v2\/media?parent=748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bverhue.nl\/delphisvg\/wp-json\/wp\/v2\/categories?post=748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bverhue.nl\/delphisvg\/wp-json\/wp\/v2\/tags?post=748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}