コード例 #1
0
ファイル: LoadDataForm.cs プロジェクト: yulinwang79/wyl-tool
 private void btCreate_Click(object sender, EventArgs e)
 {
     if (rtbCustFontData.TextLength <= 0)
     {
         MessageBox.Show("CustFontData can not be empty!");
         return;
     }
     if (rtbRangeData.TextLength <= 0)
     {
         MessageBox.Show("RangeData can not be empty!");
         return;
     }
     if (rtbOffset.TextLength <= 0)
     {
         MessageBox.Show("Offset can not be empty!");
         return;
     }
     if (rtbData.TextLength <= 0)
     {
         MessageBox.Show("Data can not be empty!");
         return;
     }
     if (m_bdf.LoadData(rtbCustFontData.Text, rtbRangeData.Text, rtbWidth.Text, rtbDWidth.Text, rtbOffset.Text, rtbData.Text))
     {
         //m_parent.LoadBdf(m_bdf);
         this.DialogResult = System.Windows.Forms.DialogResult.OK;
         this.Close();
     }
 }
コード例 #2
0
 private void tsExportFonts_Click(object sender, EventArgs e)
 {
     if (m_mtkResource == null || m_mtkResource.g_langpack2ndJumpTbl == null || m_mtkResource.g_langpack2ndJumpTbl.mtk_gLanguageArray == null)
     {
         tsOpen_Click(sender, e);
     }
     else
     {
         int index = 0;
         for (int i = 0; i < m_mtkResource.g_langpack2ndJumpTbl.fontfamilyList.Length; i++)
         {
             for (int j = 0; j < m_mtkResource.g_langpack2ndJumpTbl.fontfamilyList[i].nTotalFonts; j++)
             {
                 BdfClass bdf = new BdfClass();
                 bdf.LoadData(m_mtkResource.g_langpack2ndJumpTbl.fontfamilyList[i].DatafontData[j]);
                 bdf.SaveFile("cust" + index + ".bdf");
                 index++;
             }
         }
     }
 }
コード例 #3
0
ファイル: FontView.cs プロジェクト: yulinwang79/wyl-tool
        private void tsLoadBdfR_Click(object sender, EventArgs e)
        {
            BdfClass       s_bdf = new BdfClass();
            string         fileName;
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.InitialDirectory = System.Windows.Forms.Application.StartupPath + "\\configfile";
            openFileDialog1.Filter           = "BDF files (*.bdf)|*.bdf";
            openFileDialog1.FilterIndex      = 1;
            openFileDialog1.RestoreDirectory = true;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                if ((fileName = openFileDialog1.FileName) != null)
                {
                    if (s_bdf.LoadData(fileName))
                    {
                        LoadFont(false, s_bdf);
                    }
                }
            }
        }
コード例 #4
0
        int resource_get_fontres(byte[] bin)
        {
            UInt32 index;
            int    i;
            UInt32 rom_base = 0;
            UInt32 rom_size = (UInt32)m_bin.Length;
            int    offset;

            //resource_get_langpack2ndJumpTbl();

            for (index = 0; index < rom_size - 50; index += 4)
            {
                sCustFontData tmp = new sCustFontData();
                offset = (int)index;
                if (tmp.CheckData(g_regionInfo, offset))
                {
                    //new sCustFontData(g_regionInfo, ref offset);
                    offset = (int)index;
                    BdfClass bdf = new BdfClass();
                    try{
                        if (bdf.LoadData(new sCustFontData(g_regionInfo, ref offset)))
                        {
                            bdf.SaveFile(m_directory + "\\cust" + index + ".bdf");
                        }
                    }
                    catch
                    {
                        continue;
                    }
                }
                else
                {
                    continue;
                }
            }
            return(0);
        }