You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2014/12/30 00:23:55 UTC

[Bug 52516] Wrong font displayed in ppt

https://issues.apache.org/bugzilla/show_bug.cgi?id=52516

Andreas Beeker <an...@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #5 from Andreas Beeker <an...@gmx.de> ---
I can't reproduce the error - please make sure to use escape sequences for
chinese (or similar) symbols. In case your chosen font doesn't support the
characters, there's also a fallback handling (see #55902 / TestFontRendering
class) - something similar is used by Office and could happen when your source
code contains umlauts and is not saved/processed in UTF-8.

This was my test code:

@Test
public void bug52516() throws Exception {
    SlideShow ppt = new SlideShow();
    Slide slide = ppt.createSlide();

    TextBox shape = new TextBox();
    RichTextRun rt = shape.getTextRun().getRichTextRuns()[0];
    shape.setHorizontalAlignment(TextBox.AlignLeft);
    rt.setFontName("MS PGothic");
    shape.setText("test\uD14C\uC2A4\uD2B8123");
    rt.setFontSize(16);
    shape.setAnchor(new java.awt.Rectangle(495, 375, 210, 115));
    slide.addShape(shape);

    shape = new TextBox();
    rt = shape.getTextRun().getRichTextRuns()[0];
    shape.setHorizontalAlignment(TextBox.AlignLeft);
    rt.setFontName("Times New Roman");
    shape.setText("testingöäåendtesting");
    rt.setFontSize(16);
    shape.setAnchor(new java.awt.Rectangle(10, 10, 210, 115));
    slide.addShape(shape);


    FileOutputStream out = new FileOutputStream("52516.ppt");
    ppt.write(out);
    out.close();        
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org