private void btnCompFont_Click(object sender, EventArgs e) { frmCompFont fCompFont = new frmCompFont(); fCompFont.CompFHelper = CFHelper; DialogResult Ans = fCompFont.ShowDialog(); if (Ans == DialogResult.Cancel) { return; } CFHelper = fCompFont.CompFHelper; CompFontFlag = true; for (int i = 0; i < 256; i++) { int c = TableItems[i].Code; Font fnt = CFHelper.GetFont(c); TableItems[i].SymFont = fnt;; } PosTableItems(StartX, StartY); this.Location = new Point((Screen.PrimaryScreen.Bounds.Width - this.Width) / 2, (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2); }
private void LoadCompFont() { List <CompFont> lstCF = CompFHelper.GetCompFonts(); grdCompFont.Rows.Clear(); foreach (CompFont cf in lstCF) { grdCompFont.Rows.Add(); grdCompFont.Rows[grdCompFont.Rows.Count - 1].Cells["clStart"].Value = cf.Start; grdCompFont.Rows[grdCompFont.Rows.Count - 1].Cells["clEnd"].Value = cf.End; if (cf.InFile) { grdCompFont.Rows[grdCompFont.Rows.Count - 1].Cells["clFile"].Value = cf.FileName; grdCompFont.Rows[grdCompFont.Rows.Count - 1].Cells["clFont"].Value = null; } else { grdCompFont.Rows[grdCompFont.Rows.Count - 1].Cells["clFile"].Value = null; grdCompFont.Rows[grdCompFont.Rows.Count - 1].Cells["clFont"].Value = cf.FamilyName; } grdCompFont.Rows[grdCompFont.Rows.Count - 1].Cells["clFontOptions"].Value = CompFHelper.GetFont(cf.Start); } }
private bool FillUnicodeTable(int PageNumber) { int start = UB.PageStart(256, PageNumber); int end = UB.PageEnd(256, PageNumber); if ((start == -1) || (end == -1)) { return(false); //вылетели за кол-во страниц в блоке } for (int i = 0; i < 256; i++) { int num = start + i; if (num <= end) { string st = ""; if ((num >= 0x00d800) && (num <= 0x00dfff)) { st = Convert.ToString((char)num); } else { st = char.ConvertFromUtf32(num); } TableItems[i].Chr = st; TableItems[i].CodeFormat = CodeFormat; TableItems[i].Code = num; if (CompFontFlag) { System.Drawing.Font cfont = CFHelper.GetFont(num); if (cfont == null) { cfont = new Font("Microsoft Sans Serif", 8, FontStyle.Regular); } else { if (cfont != TableItems[i].SymFont) { TableItems[i].SymFont = cfont; PosTableItems(StartX, StartY); } } } } else { TableItems[i].Clear(); //TableItems[i].ChrHeight = 13; } } return(true); }