I want to use Turkish character set with itext.net. Although it is present in the java version, I couldn't find it in the .net port. What should I do?
Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
private string ReplaceRegex(string a)
{
a = Regex.Replace(a, "ı", "\u0131");
a = Regex.Replace(a, "ç", "\u00e7");
a = Regex.Replace(a, "ü", "\u00f6");
a = Regex.Replace(a, "ö", "\u00fc");
a = Regex.Replace(a, "ğ", "\u011f");
a = Regex.Replace(a, "Ü", "\u00dc");
a = Regex.Replace(a, "Ö", "\u00d6");
a = Regex.Replace(a, "Ğ", "\u011e");
a = Regex.Replace(a, "Ç", "\u00c7");
a = Regex.Replace(a, "İ", "\u0130");
I want to use Turkish character set with itext.net. Although it is present in the java version, I couldn't find it in the .net port. What should I do?
Thanks in advance.
I've solved it like this:
private string ReplaceRegex(string a)
{
a = Regex.Replace(a, "ı", "\u0131");
a = Regex.Replace(a, "ç", "\u00e7");
a = Regex.Replace(a, "ü", "\u00f6");
a = Regex.Replace(a, "ö", "\u00fc");
a = Regex.Replace(a, "ğ", "\u011f");
a = Regex.Replace(a, "Ü", "\u00dc");
a = Regex.Replace(a, "Ö", "\u00d6");
a = Regex.Replace(a, "Ğ", "\u011e");
a = Regex.Replace(a, "Ç", "\u00c7");
a = Regex.Replace(a, "İ", "\u0130");
return a;
}
BaseFont bf = BaseFont.createFont(
(String)Microsoft.Win32.Registry.CurrentUser.
OpenSubKey("Software").
OpenSubKey("Microsoft").
OpenSubKey("Windows").
OpenSubKey("CurrentVersion").
OpenSubKey("Explorer").
OpenSubKey("Shell Folders").
GetValue("Fonts")
+ java.io.File.separator + "times.ttf", BaseFont.IDENTITY_H, true);
com.lowagie.text.Font f2 = new com.lowagie.text.Font(bf, 12, com.lowagie.text.Font.NORMAL, GDI.Color.Black);
com.lowagie.text.Font f2 = new com.lowagie.text.Font(bf, 12, com.lowagie.text.Font.NORMAL, GDI.Color.Black);
Phrase myPhrase3 = new Phrase(ReplaceRegex("ÜÖĞÇŞİıüöğçş"), f2);