Showing posts with label Fonts. Show all posts
Showing posts with label Fonts. Show all posts

Friday, December 26, 2008

Khmer Unicode with Crystal Report in C# Application

I use VS2008 to test Khmer Unicode rendering in Crystal Report.

I. Prepare Crystal Report Render well in report design
First you have to make the crystal report in design time possible to write or view Khmer Unicode

1.1. Copy usp10.dll (version1.465.4001.0) to C:\Program Files\Business Objects\Common\2.8\bin


















1.2. Change fonts setting
in Crystal Report, at VS2008, create a crystal report and go to Crystal Reports --> Design --> Default Setting --> Go to Fonts Tab, change all element to Kh System

II. View Crystal Report with VS Crystal Report Viewer,
Khmer Unicode is not rendering well.
(Under research)

III. View Crystal Report with Crystal Report View
It's working very well for me to view Crystal Report with Khmer Unicode characters on form.
Here is the process...

3.1. On design time, add COM control of Crystal Report ActiveX Report Viewer Control of Business Objects; from my pc, it's a dll at: C:\Program Files\Business Objects\Common\2.8\bin\ crviewer.dll












3.2. Add Reference in the project of craxddrt.dll



















3.3. Create Crystal Report
and write some code in Khmer Unicode and save it to some where, my example in folder bin/Debug

3.4. Coding to call the report to view in the control:


CRAXDDRT.Application crxApp = new CRAXDDRT.Application();
CRAXDDRT.Report crxReport = new CRAXDDRT.Report();
crxReport = crxApp.OpenReport(Application.StartupPath
+ "/KhmerUnicodeTest.rpt", null);
this.axCrystalActiveXReportViewer1.ReportSource=crxReport;
this.axCrystalActiveXReportViewer1.ViewReport();

3.5. Here is the result display












DOWNLOAD: Sample Project: TestCrystalReportViewer

IV. View Crystal Report by export directly to PDF
It works very well, just have issue with font size.
We just call Crystal Report Object and then export it to disk, here is the coding:


private void btnPrintCrystal_Click(object sender, EventArgs e)
{
CrystalKhmerUnicode rptCrystal = new CrystalKhmerUnicode();
rptCrystal.SetParameterValue("txtReportTitle","Hello World");
rptCrystal.SetParameterValue("txtTitle", txtTitle.Text);
rptCrystal.SetParameterValue("txtArticle", txtArticle.Text);
rptCrystal.ExportToDisk(ExportFormatType.PortableDocFormat, "./KhmerUnicode.pdf");
MessageBox.Show("Now report exported to current folder: KhmerUnicode.pdf");
// Direct open pdf report
System.Diagnostics.Process.Start("./KhmerUnicode.pdf");
}

Enjoy,
Happy New Year 2009!
Metrey,

Tuesday, December 23, 2008

Khmer Unicode works now with Adobe CS3

Very good news for us, Khmer, that we have now the fonts that work with Adobe CS3.
It's easy to configure as in fact, we just install new fonts from Khmer OS (I'm not sure yet where is the source of this font), but you can download here: Khmer Unicode Supported CS3.

There are fonts:
  • Kh-Battambang
  • Kh-Bokor
  • Kh-Content
  • Kh-Fasthand
  • Kh-Freehand
  • Kh-Kangrey
  • Kh-Koulen
  • Kh-KoulenL
  • Kh-Metal-Chrieng
  • Kh-Muol
  • Kh-Muol-Pali
  • Kh-Siemreap
  • Kh-System

The right font view as:
















See how to do it:

1. Install fonts: Start -> Control Panel -> Fonts -> Install New Fonts -> Select Kh fonts to install















2. On Adobe Photoshop CS3, select a Kh font (Ex: Kh System)
Here Example:












Note: any font name in group of Kh font will be Ok with CS3, these fonts also can use well with embedded for website without needed usp10.dll, I'll test it first.