Using TTF in WPF

Source: Internet
Author: User

TTF is a collection of icon buttons because of the implementation of ImageButton contact TTF usage in WPF. You can choose to download on the Ali www.iconfont.cn website. First select the desired icon to add to your cart, select "Download code" from the shopping cart when you are finished, and you can package the icon to generate a TTF file and download it locally. The downloaded folder contains the file shown in Figure one, where Iconfont.ttf is the file required by the program, open the file to see the "Font name", the program finds the TTF file based on that name, and the reference format in C # code is "#" + "font name". The font names downloaded in iconfont.cn are generally "iconfont", so use "#iconfont" when referencing, and the instance intercepts: Component/resources/#iconfont ".

Figure A

The demo_unicode.html in Figure one contains the Unicode encoding in the TTF file, shown in two. When referencing in WPF, the way in XAML and Xaml.cs differs. The encoding for the Arrow-left icon is "& #xe614;" When referenced in XAML, the encoding needs to be copied directly, and when referenced in a code (. cs file), the format is "\ue614".

Figure II

  

Current project Common icon address: http://www.iconfont.cn/collections/detail?cid=4215

Using TTF in WPF

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.