添加链接
注册
登录
link管理
链接快照平台
输入网页链接,自动生成快照
标签化管理网页链接
相关文章推荐
从未表白的打火机
·
Can I 3D Print This? ...
·
3 月前
·
追风的核桃
·
专访|钱永刚:这是战略科学家钱学森一生最具亮 ...
·
8 月前
·
失恋的鞭炮
·
Android 消息循环机制总结 | ...
·
1 年前
·
有胆有识的开心果
·
新型冠状病毒肺炎疫情防控 <br ...
·
1 年前
·
爱听歌的风衣
·
得力指纹机管理员初始密码 - 抖音
·
1 年前
·
link管理
›
TTF 到 SVG 转换器 API |.NET | Aspose.Font
软件
aspose
font
svg
https://products.aspose.com/font/zh/net/conversion/ttf-to-svg/
细心的南瓜
11 月前
</noscript><div class="header"><div><a rel="nofollow" href="https://www.aspose.com" alt="Aspose Pty Ltd Logo" aria-label="Aspose Pty Ltd Logo" class="logo"/><div class="bar"><ul class="menu"><li class="products desktop-only"><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com">Products</a><ul class="submenu grid-4"><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/total/"><span class="title">Aspose.Total</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/words/"><span class="title">Aspose.Words</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/pdf/"><span class="title">Aspose.PDF</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/cells/"><span class="title">Aspose.Cells</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/email/"><span class="title">Aspose.Email</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/slides/"><span class="title">Aspose.Slides</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/imaging/"><span class="title">Aspose.Imaging</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/barcode/"><span class="title">Aspose.BarCode</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/diagram/"><span class="title">Aspose.Diagram</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/tasks/"><span class="title">Aspose.Tasks</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/ocr/"><span class="title">Aspose.OCR</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/note/"><span class="title">Aspose.Note</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/cad/"><span class="title">Aspose.CAD</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/3d/"><span class="title">Aspose.3D</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/html/"><span class="title">Aspose.HTML</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/gis/"><span class="title">Aspose.GIS</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/zip/"><span class="title">Aspose.ZIP</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/page/"><span class="title">Aspose.Page</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/psd/"><span class="title">Aspose.PSD</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/omr/"><span class="title">Aspose.OMR</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/svg/"><span class="title">Aspose.SVG</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/finance/"><span class="title">Aspose.Finance</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/font/"><span class="title">Aspose.Font</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/tex/"><span class="title">Aspose.TeX</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/pub/"><span class="title">Aspose.PUB</span><span class="description">Product Solution</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://products.aspose.com/drawing/"><span class="title">Aspose.Drawing</span><span class="description">Product Solution</span></a></li></ul></li><li class="desktop-only"><a class="menu-item" rel="noopener nofollow" href="#">Purchase</a><ul class="submenu"><li><a class="menu-item" rel="noopener nofollow" href="https://purchase.aspose.com/buy"><span class="title">Buy Now</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://purchase.aspose.com/pricing"><span class="title">Pricing Information</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://downloads.aspose.com/"><span class="title">Free Trials</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://purchase.aspose.com/temporary-license"><span class="title">Temporary License</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://purchase.aspose.com/policies"><span class="title">Policies</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://purchase.aspose.com/orders"><span class="title">My Orders & Quotes</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://purchase.aspose.com/renew"><span class="title">Renew an Order</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://purchase.aspose.com/upgrade"><span class="title">Upgrade an Order</span></a></li></ul></li><li class="desktop-only"><a class="menu-item" rel="noopener nofollow" href="#">Support</a><ul class="submenu"><li><a class="menu-item" rel="noopener nofollow" href="https://docs.aspose.com/"><span class="title">Docs</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://reference.aspose.com/"><span class="title">API Reference</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://demos.aspose.com/"><span class="title">Live Demos</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://aspose.github.io/"><span class="title">Code Samples</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://forum.aspose.com/"><span class="title">Free Support</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://aspose-free-consulting.github.io/"><span class="title">Free Consulting</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://helpdesk.aspose.com/"><span class="title">Paid Support</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://consulting.aspose.com/"><span class="title">Paid Consulting</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://blog.aspose.com/"><span class="title">Blog</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://kb.aspose.com/"><span class="title">Knowledge Base</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://releases.aspose.com/"><span class="title">New Releases</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://status.aspose.com/"><span class="title">Status</span></a></li></ul></li><li class="desktop-only"><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/">Websites</a><ul class="submenu"><li><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/aspose/com/"><span class="title">aspose.com</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/aspose/cloud/"><span class="title">aspose.cloud</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/aspose/app/"><span class="title">aspose.app</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/groupdocs/com/"><span class="title">groupdocs.com</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/groupdocs/cloud/"><span class="title">groupdocs.cloud</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/groupdocs/app/"><span class="title">groupdocs.app</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/conholdate/com/"><span class="title">conholdate.com</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/conholdate/cloud/"><span class="title">conholdate.cloud</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/conholdate/app/"><span class="title">conholdate.app</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/containerize/com/"><span class="title">containerize.com</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/codeporting/com/"><span class="title">codeporting.com</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://websites.aspose.app/fileformat/com/"><span class="title">fileformat.com</span></a></li></ul></li><li class="desktop-only"><a class="menu-item" rel="noopener nofollow" href="https://about.aspose.app">About</a><ul class="submenu"><li><a class="menu-item" rel="noopener nofollow" href="https://about.aspose.app"><span class="title">About Us</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://about.aspose.app/contact/"><span class="title">Contact</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://about.aspose.app/legal/"><span class="title">Legal</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://about.aspose.app/affiliates/"><span class="title">Affiliates</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://about.aspose.app/events/"><span class="title">Events</span></a></li><li><a class="menu-item" rel="noopener nofollow" href="https://about.aspose.app/acquisition/"><span class="title">Acquisition</span></a></li></ul></li><li class="language"><span class="menu-item"><svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentcolor"><path d="M12 4c4.4183.0 8 3.58172 8 8 0 4.4183-3.5817 8-8 8-4.41828.0-8-3.5817-8-8 0-4.41828 3.58172-8 8-8zm-.381 11.428L8.57155 15.4289C8.9774 16.7012 9.60471 17.924 10.4358 19.0678 10.8198 19.1532 11.2151 19.2073 11.6191 19.2282L11.619 15.428zM15.4284 15.4289 12.38 15.428 12.3809 19.2282C12.7849 19.2073 13.1802 19.1532 13.5641 19.0687 14.3953 17.924 15.0226 16.7012 15.4284 15.4289zM18.3762 15.4285 16.0984 15.4284C15.7811 16.5746 15.31 17.6754 14.703 18.7169c1.5738-.634 2.8744-1.806 3.6732-3.2884zM7.90159 15.4284 5.62381 15.4285c.79877 1.4824 2.09943 2.6544 3.67446 3.2885-.60825-1.0416-1.07936-2.1424-1.39668-3.2886zM7.4355 12.3803 4.77175 12.3809C4.81342 13.1846 4.98617 13.9535 5.26904 14.6669L7.71488 14.6666c-.15933-.7461-.25402-1.5094-.27938-2.2863zM15.9653 12.3808 12.38 12.38v2.286L15.6434 14.6671c.1843-.7493.2928-1.5134.321899999999999-2.2863zM19.2282 12.3809 16.5645 12.3803C16.5391 13.1572 16.4444 13.9205 16.2851 14.6666L18.731 14.6669C19.0138 13.9535 19.1866 13.1846 19.2282 12.3809zM11.619 12.38 8.03469 12.3808C8.06384 13.1537 8.17229 13.9178 8.35656 14.6671L11.619 14.666V12.38zM7.78068 8.95226 5.43294 8.95224C5.05284 9.76985 4.82095 10.6703 4.77175 11.6191L7.4329 11.6194C7.45634 10.71 7.57476 9.81899 7.78068 8.95226zM15.5678 8.95239 12.38 8.952v2.667h3.588L15.9673 11.5875C15.9382 10.6945 15.8033 9.81313 15.5678 8.95239zM18.5671 8.95224 16.2193 8.95226C16.4252 9.81899 16.5437 10.71 16.5671 11.6194L19.2282 11.6191C19.1791 10.6703 18.9472 9.76985 18.5671 8.95224zM11.619 8.952 8.43217 8.95239C8.16446 9.93108 8.02667 10.9364 8.02667 11.9553L8.031 11.619h3.588V8.952zM9.22964 5.31048 9.02453 5.39982c-1.31708.59469-2.4243 1.57203-3.17995 2.79029L7.98594 8.19044C8.28727 7.19147 8.70587 6.2283 9.22964 5.31048zm3.15126-.53873L12.38 8.19 15.3312 8.18991c-.3925-1.12859-.9602-2.21592-1.6906-3.24091C13.2322 4.85405 12.8116 4.79408 12.3809 4.77175zm2.3884.53883L14.9321 5.60148C15.3809 6.43124 15.7444 7.2965 16.0141 8.19044L18.1554 8.19011C17.3607 6.9088 16.177 5.89399 14.7693 5.31058zm-4.1992-.40747L10.3594 4.949C9.629 5.97399 9.06128 7.06132 8.66884 8.18991L11.619 8.19 11.6191 4.77175C11.262 4.79027 10.9117 4.83467 10.5701 4.90311z"/></svg><span>简体中文</span></span><ul class="submenu grid-3"><li><a href="https://products.aspose.com/font/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">English</span></a></li><li><a href="https://products.aspose.com/font/fr/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Français</span></a></li><li><a href="https://products.aspose.com/font/el/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Ελληνικά</span></a></li><li><a href="https://products.aspose.com/font/ru/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Русский</span></a></li><li><a href="https://products.aspose.com/font/ja/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">日本語</span></a></li><li><a href="https://products.aspose.com/font/tr/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Türkçe</span></a></li><li><a href="https://products.aspose.com/font/de/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Deutsch</span></a></li><li><a href="https://products.aspose.com/font/es/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Español</span></a></li><li><a href="https://products.aspose.com/font/pt/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Português</span></a></li><li><a href="https://products.aspose.com/font/id/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Indonesian</span></a></li><li><a href="https://products.aspose.com/font/th/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">ไทย</span></a></li><li><a href="https://products.aspose.com/font/it/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Italiano</span></a></li><li><a href="https://products.aspose.com/font/pl/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Polski</span></a></li><li><a href="https://products.aspose.com/font/nl/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Nederlands</span></a></li><li><a href="https://products.aspose.com/font/sv/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Svenska</span></a></li><li><a href="https://products.aspose.com/font/ar/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">عربي</span></a></li><li><a href="https://products.aspose.com/font/cs/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">čeština</span></a></li><li><a href="https://products.aspose.com/font/hu/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Magyar</span></a></li><li><a href="https://products.aspose.com/font/hi/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">हिन्दी</span></a></li><li><a href="https://products.aspose.com/font/ko/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">한국인</span></a></li><li><a href="https://products.aspose.com/font/vi/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">Tiếng Việt</span></a></li><li><a href="https://products.aspose.com/font/zh-hant/net/conversion/ttf-to-svg/" class="menu-item"><span class="title">繁體中文</span></a></li></ul></li></ul></div></div></div><style>.bg-light-primary{background:#97d6ff}.productbreadcrumbs li{list-style-type:none}.productbreadcrumbs li{padding:10px 0;display:inline-block;color:#333}.productbreadcrumbs a{display:inline-block;color:#383838!important}.productbreadcrumbs li i{margin:0 10px}@media(max-width:688px){.overflow-attr{overflow-x:scroll}.productbreadcrumbs{padding:0 20px!important;width:max-content}}</style><div class="container-fluid bg-light-primary"><div class="container"><div class="row"><div class="col-md-12 p-0 overflow-attr"><ol class="d-flex align-items-center m-0 productbreadcrumbs p-0" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"><a href="/zh/" itemprop="item"><span itemprop="name">产品</span></a><meta itemprop="position" content="1"/></li><li itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"><i class="fa fa-angle-right"> </i> <a itemprop="item" href="/font/zh/"><span itemprop="name">Aspose.Font</span></a><meta itemprop="position" content="2"/></li><li itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"><i class="fa fa-angle-right"> </i> <a itemprop="item" href="/font/zh/net/conversion/"><span itemprop="name">Conversion</span></a><meta itemprop="position" content="4"/></li><li itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"><i class="fa fa-angle-right"> </i> <span itemprop="name">TTF 到 SVG 转换器 API |.NET | Aspose.Font</span><meta itemprop="position" content="4"/></li></ol></div></div></div></div><div class="container-fluid td-default td-outer set-min-height"><main role="main" class="td-main"><div class="pf-landing-page-com autogen"><div class="container-fluid header1 header2 productfamilyheader minify-header"><div class="container"><div class="row pt-lg-5"><div class="col-md-12 padding0"><div class="padding0 col-lg-12"><h1>将 TTF 转换为 SVG</h1><h2 class="pr-h2">C# .NET 的 TTF 到 SVG 转换功能。用于转换字体的 API。</h2></div></div></div></div></div><div class="container-fluid productfamilypage bg-white"><div class="container-fluid sub-menu-container"><div id="sticky1" class="stickytopheight"> </div><div class="container"><div class="row"><div class="col-md-2 title2"><h4><span class="spanclass"><img width="42" height="42" src="https://www.aspose.cloud/templates/aspose/img/products/font/aspose_font-for-net.svg" alt="Aspose.Font for .NET" class="lazyloaded"/> </span>Aspose.Font <small>for .NET</small></h4></div><div class="col-md-6"><ul class="nav nav-pills mb-hide"><li><a class="zap-btn-apps" href="https://products.aspose.app/font/conversion">Conversion Demos</a></li><li><a class="zap-btn-docs" href="https://docs.aspose.com/font/net/">Documentation</a></li><li><a class="zap-btn-code" href="https://github.com/aspose-font/Aspose.Font-for-.NET">Source Code</a></li><li><a class="zap-btn-api" href="https://reference.aspose.com/font/net/">API Reference</a></li></ul><div class="submenu"><ul class="submenul"><li class="dropdown smenu-li"><a class="dropdown-toggle arrow-dd" href="/" data-toggle="dropdown">Overview</a><ul class="dropdown-menu smenu-dd"><li><a href="#overview">Overview</a></li><li><a class="zap-btn-apps" href="https://products.aspose.app/font/conversion">Conversion Demos</a></li><li><a class="zap-btn-docs" href="https://docs.aspose.com/font/net/">Documentation</a></li><li><a class="zap-btn-code" href="https://github.com/aspose-font/Aspose.Font-for-.NET">Source Code</a></li><li><a class="zap-btn-api" href="https://reference.aspose.com/font/net/">API Reference</a></li></ul></li></ul></div></div><div class="col-md-4 sub-rhs col-sm-12"><div class="btn-group"><a class="btn btn-primary zap-btn-download" href="https://www.nuget.org/packages/Aspose.Font"><em class="fa fa-download"> </em> Nuget</a> Pricing</a> <a class="btn btn-primary zap-btn-buy" href="https://purchase.aspose.com/buy/cart?ppId=97376">Buy</a></div></div></div></div></div><div class="cleartop"> </div><div class="container-fluid productfamilypage bg-gray"><div class="container features-section"><div class="row"><p/><p>尽管 TTF 是一种比 SVG 更常用、更受支持且更紧凑的格式,但仍有一些原因可能会迫使您将一种格式转换为另一种格式。 TTF 字体专为特定像素大小而设计。缩放时,它们可能会失去一些视觉质量和清晰度,尤其是在显着放大时。 SVG 字体与分辨率无关,可以无限缩放而不会降低质量,这使它们成为响应式设计和高分辨率显示的理想选择。由于 SVG 字体基于矢量图形,因此它们更易于编辑和自定义。 Yiu 可以使用标准矢量编辑软件修改它们。但请记住,大多数现代网络浏览器都支持 SVG 字体,但某些较旧的浏览器可能对 SVG 字体的支持有限或不支持,因此如果您想使用 SVG,最好使用其他格式的后备字体。</p><p>此处的转换使用 .NET API 只需几行代码即可将 TTF 转换为 SVG。 С# 的 Aspose.Font API 解决方案非常容易集成到您自己的产品或开发跨平台 TTF 到 SVG 转换器,就像您可以通过链接找到的那样。</p><p>该解决方案由一个字体数据结构组成,该结构包含所有字体类型的每个字形和编码的详细信息。它在字符代码和字形标识符之间建立了联系。使用此 .NET API,您将能够呈现任何所需的字形或文本,包括特殊字形。通过实现接口并利用点移动、画线、创建曲线等基本图形功能,您可以实现所需的渲染结果。</p></div></div></div><div class="container-fluid bg-gray-lite agp-content section"><div class="container"><div class="row"><div class="col-md-6 tl"><h2 class="heading-border">C# 上的 TTF 到 SVG 转换</h2><p>访问 ,您可以在其中了解使用 API 所需的更多信息以及有关字体的基础知识。</p><ol><li>指定存储在变量 <em>fontPath</em> 中的 TTF 字体文件的路径,并使用 <a href="https://reference.aspose.com/font/net/aspose.font/font/open/"><em>Open()</em></a> 方法。</li><li>通过使用 <em>Path.Combine()</em> 方法将输出目录路径 <em>OutputDir</em> 与所需的字体文件名组合来指定 SVG 输出设置。然后使用 <em>File.Create()</em> 创建 <em>FileStream</em> 对象 <em>outStream</em> 以创建具有指定输出路径的新文件。</li><li>使用 <a href="https://reference.aspose.com/font/net/aspose.font/font/savetoformat/"><em>SaveToFormat()</em></a> 方法完成 TTF 到 SVG 的转换,并将 SVG 作为 <a href="https://reference.aspose.com/font/net/aspose.font/fontsavingformats/">FontSavingFormats</a> 。</li></ol></div><div class="col-md-6 tl"><h2 class="heading-border">开始使用 .NET 字体 API</h2><ol><li>从命令行安装 <code>nuget install Aspose.Font</code> 或通过 Visual Studio 的包管理器控制台使用 <code>Install-Package Aspose.Font</code> 安装。</li><li>或者,从 获取 ZIP 文件中的脱机 MSI 安装程序或 DLL。</li><li>参见跨平台 Aspose <a href="https://products.aspose.app/font/conversion/ttf-to-svg">TTF 到 SVG</a> Converter 中提到的功能的实现示例。转到我们的 <a href="https://github.com/aspose-font/Aspose.Font-Documentation/tree/master/net-examples">GitHub</a> 存储库以获取有关如何使用 C# .NET 字体 API 解决方案的更多代码示例。</li></ol></div><div class="app-font-converter" id="be9524686084237d"><div class="header">C# 上的 TTF 到 SVG 转换</div><div class="parameters"><div class="row pt-3"><div class="col-2 description"><span class="ml-25">Input file</span></div><div class="col action"><form id="fileInputContainer"><input type="file" class="fileInput" id="fileInput_be9524686084237d" name="fileupload" accept=".ttf"/> <label class="actionButton backgroundBlue" for="fileInput_be9524686084237d">Upload a file</label></form></div><div class="col description"><span id="fileName_be9524686084237d">Upload a file you want to convert</span></div><div class="col action" style="text-align:right"><a class="actionButton disabled" type="button" id="run_be9524686084237d"><svg class="spinner hidden" width="65" height="65" viewbox="0 0 66 66" xmlns="http://www.w3.org/2000/svg"><circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"/></svg><span>Run code</span></a></div></div><div class="row pb-3"><div class="col-2 description"><span class="ml-25">Output format</span></div><div class="col action"><select class="actionButton backgroundBlue outputFormat" id="outputFormat_be9524686084237d"><option value="TTF">TTF</option><option value="WOFF">WOFF</option><option value="WOFF2">WOFF2</option><option value="SVG">SVG</option></select></div><div class="col description">Select the target format</div><div class="col action"/></div></div><div class="separator"/><div class="codeblock"><pre class="hidden"> // Open {{input lower}} font string fontPath = Path.Combine(DataDir, "{{inputFile}}"); FontDefinition fontDefinition = new FontDefinition(FontType.{{input upper}}, new FontFileDefinition(new FileSystemStreamSource(fontPath))); Font font = Font.Open(fontDefinition); // {{output camel}} output settings string outPath = Path.Combine(OutputDir, "{{outputFile}}"); FileStream outStream = File.Create(outPath); // Convert {{input lower}} to {{output lower}} font.SaveToFormat(outStream, FontSavingFormats.{{output upper}}); </code></pre></div><div class="footer"><span class="error hidden" id="error_be9524686084237d"/><div class="clipboard"><svg xmlns="http://www.w3.org/2000/svg" fill="currentcolor" class="bi bi-clipboard" viewbox="0 0 16 16"><path d="M4 1.5H3a2 2 0 00-2 2V14a2 2 0 002 2h10a2 2 0 002-2V3.5a2 2 0 00-2-2h-1v1h1a1 1 0 011 1V14a1 1 0 01-1 1H3a1 1 0 01-1-1V3.5a1 1 0 011-1h1v-1z"/><path d="M9.5 1a.5.5.0 01.5.5v1a.5.5.0 01-.5.5h-3A.5.5.0 016 2.5v-1a.5.5.0 01.5-.5h3zm-3-1A1.5 1.5.0 005 1.5v1A1.5 1.5.0 006.5 4h3A1.5 1.5.0 0011 2.5v-1A1.5 1.5.0 009.5.0h-3z"/></svg><span class="copyCodeButton" href="javascript:void(0)" onclick="window.app_be9524686084237d.copyCode()">Copy code to the clipboard</span></div></div></div></div></div></div><div class="autogen container-fluid bg-white agp-content section"><div class="container"><div class="row"><div class="col-md-12 tl"><p><br/><br/></p><h2>常问问题</h2><p><b>1. 我可以将 TTF 转换为 SVG 吗?</b></p><p>Aspose.Font 解决方案具有允许您在线或以编程方式将字体转换为其他格式的功能。如果您需要立即在线将 TTF 转换为 SVG,您可以使用
推荐文章
从未表白的打火机
·
Can I 3D Print This? | EOS GmbH
3 月前
追风的核桃
·
专访|钱永刚:这是战略科学家钱学森一生最具亮点的学术创新
8 月前
失恋的鞭炮
·
Android 消息循环机制总结 | imhanjie
1 年前
有胆有识的开心果
·
新型冠状病毒肺炎疫情防控 <br />健康教育核心信息及释义 <br />(第三版)- 四川省人民政府网站
1 年前
爱听歌的风衣
·
得力指纹机管理员初始密码 - 抖音
1 年前