poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 52516] Wrong font displayed in ppt
Date Mon, 29 Dec 2014 23:23:55 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=52516

Andreas Beeker <andreas.beeker@gmx.de> changed:

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

--- Comment #5 from Andreas Beeker <andreas.beeker@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


Mime
View raw message