private unsafe void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { if (e.Node.Text != "EBLC") { return; } if (e.Node.Parent != null && e.Node.Parent.Tag is TTFFile) { TTFFile file = (TTFFile)e.Node.Parent.Tag; TableDirectoryEntry entry = file.tables["EBLC"]; Program.ErrorOut.WriteLine("EBLC 表を読みます。"); Program.ErrorOut.AddIndent(); fixed(byte *pBase = &file.image[0]) { byte *p = pBase; p += (uint)entry.offset; //-- header eblcHeader *header = (eblcHeader *)p; uint nSize = (uint)header->numSizes; Program.ErrorOut.WriteLine("表バージョン番号: {0}", header->version.Value); Program.ErrorOut.WriteLine("strike の数: {0}", nSize); p += sizeof(eblcHeader); //-- bitmapSizeTables bitmapSizeTable *size = (bitmapSizeTable *)p; bitmapSizeTable *sizeM = size + nSize; while (size < sizeM) { Program.ErrorOut.WriteLine("Size {{ppemX:{0} ; ppemY: {1}}}", size->ppemX, size->ppemY); size++; } } Program.ErrorOut.RemoveIndent(); } }
public override unsafe void BeforeExpand(object sender, System.Windows.Forms.TreeViewAction action, ref bool cancel) { base.BeforeExpand(sender, action, ref cancel); if (this.expanded) { return; } this.expanded = true; this.Nodes.Clear(); //Program.ErrorOut.WriteLine("EBLC 表を読みます。"); //Program.ErrorOut.AddIndent(); fixed(byte *pBase = &file.image[0]) { byte *p = pBase; p += (uint)entry.offset; //-- header eblcHeader *header = (eblcHeader *)p; uint nSize = (uint)header->numSizes; //Program.ErrorOut.WriteLine("表バージョン番号: {0}",header->version.Value); //Program.ErrorOut.WriteLine("strike の数: {0}",nSize); p += sizeof(eblcHeader); //-- bitmapSizeTables bitmapSizeTable *size = (bitmapSizeTable *)p; bitmapSizeTable *sizeM = size + nSize; while (size < sizeM) { this.Nodes.Add(new eblcSizeTreeNode(file, entry, *size)); size++; } } //Program.ErrorOut.RemoveIndent(); }