using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Collections.ObjectModel; namespace WpfApp1_CMAP_CS { ///'https://anderson02.com/cs/wpf/wpf-21/ /// <summary> /// MainWindow.xaml の相互作用ロジック /// </summary> public partial class MainWindow : Window { int ii = 0; public MainWindow() { InitializeComponent(); GlyphItems = new List<object>(); System.IO.StreamWriter sw = new System.IO.StreamWriter( @"C:\Users\Y2\Desktop\ipatest.txt", false); //TextBox1.Textの内容を1行ずつ書き込む var font = @"C:\Users\Y2\AppData\Local\Microsoft\Windows\Fonts\ipamjm.ttf"; //var font = @"C:\Windows\Fonts\meiryo.ttc"; for (int i = 0; i < new GlyphTypeface(new Uri(font)).GlyphCount; i++) // for (int i = 0; i < 100; i++) { GlyphItems.Add(new { FontUri = font, Indices = i.ToString() }); ii = i; sw.WriteLine(new { FontUri = font, Indices = i.ToString() }); } MessageBox.Show(Convert.ToString(ii)); //https://www.sejuku.net/blog/57946 DataContext = this; //閉じる sw.Close(); } public List<object> GlyphItems { get; set; } } }