Important alert: (current site time 11/26/2014 5:28:56 PM EDT)
 

article

Convert Font

Email
Submitted on: 2/27/2012 4:38:51 PM
By: Thong 
Level: Beginner
User Rating: Unrated
Compatibility: VB 6.0
Views: 6841
 
     Convert font to Unicode

This article has accompanying files
 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
				Convert font in GeoDatabase
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.DataSourcesGDB;
using ESRI.ArcGIS.Carto;
using System.Threading;
namespace ConvertFontGeodatabase
{
public partial class FrmConvertFontGeodatabase : Form
{
IFeatureWorkspace workspace;
//private ArcDataBinding.TableWrapper tableWrapper;
//private ITable wrappedTable;
private IRow row;
private ITable foundITable;
public IWorkspaceEdit wkspEdit;
private FontConverter fc = new FontConverter();
ConvertFontGeodatabase.clsData cls = new ConvertFontGeodatabase.clsData();
private List SelectionTable = null;
private List SelectionField = null;
public FrmConvertFontGeodatabase()
{
InitializeComponent();
}
private void FrmConvertFontGeodatabase_Load(object sender, EventArgs e)
{
this.InitCombobox();
this.SelectionTable = new List();
this.SelectionField = new List();
}
private void btnConvert_Click(object sender, EventArgs e)
{
ThreadStart myThreadstarts = new ThreadStart(ConvertFont);
Thread myThreads = new Thread(myThreadstarts);
myThreads.Start();
}
private void ConvertFont()
{
int sfi = -1;
int dfi = -1;
BeginInvoke((MethodInvoker)delegate
 {
 sfi = this.cmbSourceFont.SelectedIndex;
 dfi = this.cmbDesFont.SelectedIndex;
 this.btnConvert.Enabled = false;
 this.btnCancel.Enabled = false;
 this.grpMain.Visible = false;
 this.rdbsldataGDB.Visible = false;
 this.rdbsldataMDB.Visible = false;
 this.grpConvert.Visible = true;
 });
if (this.rdbAllTables.Checked == true)
{
if (cls.TableList != null && cls.TableList.Count > 0)
{
for (int i = 0; i < cls.TableList.Count; i++)
{
foundITable = workspace.OpenFeatureClass(cls.TableList[i]) as ITable;
BeginInvoke((MethodInvoker)delegate
{
this.lblTitle.Text = "Converting ...";
int tableindex = i + 1;
this.lblTable.Text = tableindex.ToString() + ". Table: " + cls.TableList[i];
});
//ABC2Unicode(foundITable);
if ((sfi == 0) && (dfi == 4))
this.ABC2No(foundITable);
else if ((sfi == 0) && (dfi == 3))
this.ABC2Unicode(foundITable);
else if ((sfi == 1) && (dfi == 3))
this.VNI2Unicode(foundITable);
else if ((sfi == 2) && (dfi == 3))
this.VWX2Unicode(foundITable);
else if ((sfi == 3) && (dfi == 0))
this.Unicode2ABC(foundITable);
else if ((sfi == 3) && (dfi == 1))
this.Unicode2VNI(foundITable);
else if ((sfi == 3) && (dfi == 2))
this.Unicode2VWX(foundITable);
else if ((sfi == 1) && (dfi == 4))
this.VNI2No(foundITable);
else if ((sfi == 2) && (dfi == 4))
this.VWX2No(foundITable);
else if ((sfi == 3) && (dfi == 4))
this.Unicode2No(foundITable);
}
}
}
else
{
for (int i = 0; i < this.SelectionTable.Count; i++)
{
string tablename = this.SelectionTable[i];
BeginInvoke((MethodInvoker)delegate
{
this.lblTitle.Text = "Converting ...";
int tableindex = i + 1;
this.lblTable.Text = tableindex.ToString() + ". Table: " + tablename;
});
try
{
foundITable = workspace.OpenFeatureClass(tablename) as ITable;
}
catch
{
foundITable = workspace.OpenTable(tablename) as ITable;
}
if ((sfi == 0) && (dfi == 4))
this.ABC2No(foundITable);
else if ((sfi == 0) && (dfi == 3))
this.ABC2Unicode(foundITable);
else if ((sfi == 1) && (dfi == 3))
this.VNI2Unicode(foundITable);
else if ((sfi == 2) && (dfi == 3))
this.VWX2Unicode(foundITable);
else if ((sfi == 3) && (dfi == 0))
this.Unicode2ABC(foundITable);
else if ((sfi == 3) && (dfi == 1))
this.Unicode2VNI(foundITable);
else if ((sfi == 3) && (dfi == 2))
this.Unicode2VWX(foundITable);
else if ((sfi == 1) && (dfi == 4))
this.VNI2No(foundITable);
else if ((sfi == 2) && (dfi == 4))
this.VWX2No(foundITable);
else if ((sfi == 3) && (dfi == 4))
this.Unicode2No(foundITable);
}
}
LukeSw.Windows.Forms.VDialog.Show("Convert Successfull!", "Convert", MessageBoxButtons.OK, MessageBoxIcon.Information);
BeginInvoke((MethodInvoker)delegate
{
this.btnConvert.Enabled = true;
this.btnCancel.Enabled = true;
this.grpMain.Visible = true;
this.rdbsldataGDB.Visible = true;
this.rdbsldataMDB.Visible = true;
this.grpConvert.Visible = false;
});
}

winzip iconDownload article

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

2/28/2012 5:42:39 AMMikeB

Thong, the code you posted is in C# and not VB6.
(If this comment was disrespectful, please report it.)

 
3/26/2012 8:38:14 AMricky

i think that is not vb6 language
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.