FIX: Microsoft VM Generates Spaces for "Accent" Style Characters When You Print Mangal Font

SYMPTOMS

When you print the Mangal font, the Microsoft virtual machine (Microsoft VM) generates spaces wherever the special 'accent' style complex script characters are involved.

CAUSE

When you send the characters to the printer, the Microsoft VM computes the widths of the characters incorrectly.

RESOLUTION

To resolve this issue, install the latest version of the Microsoft VM. For more information, visit the following Microsoft Web site:WARNING: After you install the updated Microsoft VM, you cannot cannot uninstall it.


  • 3200-series Microsoft VM customers
    Upgrade to build 3316 or later.
  • 3300-series Microsoft VM customers
    Upgrade to build 3316 or later.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create the following Java applet called testPrintingDevanagari.java:
    import java.applet.Applet;import java.awt.*;import com.ms.security.*;public class testPrintingDevanagari extends Applet{    public void init() {        try {            PolicyEngine.assertPermission(PermissionID.PRINTING  );        } catch (Exception e) { }        Frame parentFrame = new Frame("Test printing devanagari script");        String testString1 = "\u0917\u0946\u0917\u0917\u0946\u0917";        String testString2 = "\u0915\u093F\u0915\u093F\u0915\u093F\u0915\u0915";        String testString3 = "\u0915\u094d\u0915\u0915\u094d\u0915";        Font hindiFont = new Font("Monospaced", Font.PLAIN, 24);            setFont(hindiFont);            Label label1 = new Label(testString1);        Label label2 = new Label(testString2);        Label label3 = new Label(testString3);            GridBagLayout gridBag = new GridBagLayout();        setLayout(gridBag);        GridBagConstraints c = new GridBagConstraints();        c.gridwidth = GridBagConstraints.REMAINDER;        c.fill = GridBagConstraints.HORIZONTAL;        gridBag.setConstraints(label1, c);        add(label1);        gridBag.setConstraints(label2, c);        add(label2);        gridBag.setConstraints(label3, c);        add(label3);        validate();        PrintJob pJob = parentFrame.getToolkit().getPrintJob(parentFrame, "Test printing devanagari script", null);        if (pJob != null) {            Graphics g = pJob.getGraphics();            g.setFont(hindiFont);            g.drawString(testString1, 150, 150);                    g.drawString(testString2, 150, 175);                    g.drawString(testString3, 150, 200);                    pJob.end();            g.dispose();        }setSize(430,270);    }}
  2. Type the following at the command prompt to generate the .class file:
    jvc testPrintingDevanagari.java
  3. Cab and sign the testPrintingDevanagari applet as follows:
    cabarc n testprint.cab *.classsetreg 1 truemakecert -sk MyNewKey -n "CN=MyNewKey" MyNewCert.cercert2spc MyNewCert.cer MyNewCert.spcsigncode -j javasign.dll -jp Low -k MyNewKey -spc MyNewCert.spc testprint.cab
  4. Create an HTML file called testPrintingDevanagari.html with an <APPLET> tag that references the Java class:
    <HTML><HEAD><TITLE>Hindi-language printing test</TITLE></HEAD><BODY><APPLET CODE="testPrintingDevanagari.class" WIDTH=430 HEIGHT=270><PARAM NAME="cabbase" VALUE="testprint.cab"></APPLET></BODY></HTML>
  5. Install a font called Mangal.
  6. Create the following registry entry:
    My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java VM\Font
    Alias\Courier
    Add the Mangal string value; this maps the monospaced Java font to the Mangal font.
  7. In Control Panel, double-click Regional Settings, and then click Indic.
  8. In Microsoft Internet Explorer, launch testPrintingDevanagari.html.

REFERENCES

For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:
Eigenschaften

Artikelnummer: 268786 – Letzte Überarbeitung: 14.02.2017 – Revision: 1

Feedback