Slide slide = slideShow.createSlide(); TextBox shape = new TextBox(); RichTextRun rt = shape.getTextRun().getRichTextRuns()[0]; shape.setHorizontalAlignment(TextBox.AlignLeft); rt.setFontName("Times New Roman"); shape.setText("testingöäåendtesting"); rt.setFontSize(12); shape.setAnchor(new java.awt.Rectangle(495, 375, 210, 115)); slide.addShape(shape); This adds a textbox in a powerpoint slide where"testing" and "endtesting" is in the font Times New Roman, but the string "öäå" is in the font Arial.
At the moment we don't have an active developer working on HSLF. You will have to wait until the problem is fixed. Yegor
I can't reproduce it. Here is my program based on your code snippet and I see "öäå" in the output, see attached. SlideShow ppt = new SlideShow(); Slide slide = ppt.createSlide(); TextBox shape = new TextBox(); RichTextRun 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(495, 375, 210, 115)); slide.addShape(shape); FileOutputStream out = new FileOutputStream("52516.ppt"); ppt.write(out); out.close(); Please post full Java code that generates problematic output. Yegor
Created attachment 28361 [details] sample file with accents
hi i'm have to same problem SlideShow ppt = new SlideShow(); Slide slide = ppt.createSlide(); TextBox shape = new TextBox(); RichTextRun rt = shape.getTextRun().getRichTextRuns()[0]; shape.setHorizontalAlignment(TextBox.AlignLeft); rt.setFontName("맑은 고딕"); shape.setText("test테스트123"); rt.setFontSize(16); shape.setAnchor(new java.awt.Rectangle(495, 375, 210, 115)); slide.addShape(shape); FileOutputStream out = new FileOutputStream("52516.ppt"); ppt.write(out); out.close(); "test" and "123" is in the font 맑은 고딕 but the String "테스트" is "굴림"
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(); }