Bug 39347 - Create TextBox failed when define the font bold or italic
Summary: Create TextBox failed when define the font bold or italic
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: 3.0-dev
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-19 10:46 UTC by Jason Bourne
Modified: 2006-07-02 09:10 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Bourne 2006-04-19 10:46:59 UTC
When you create a ppt, create a slide and add a textbox, define the font bold 
or italic, the font size will trun to 1. It's too small to seen.
Check the below code:
   public static void test1() {
      try{
         File ppt = new File("D:/temp/a.ppt");
         //HSLFSlideShow hshow = new HSLFSlideShow(new FileInputStream(ppt));
         HSLFSlideShow hshow = new HSLFSlideShow();
         SlideShow show = new SlideShow(hshow);

         Slide slide = show.createSlide();
         
         TextBox box = new TextBox();
//       set box content
//         box.setItalic(true);
         box.setText("Text Box!!");
         // set the box's size
         Rectangle rec = new Rectangle(100,100,100,100);
         box.setAnchor(rec);
         // set text box's color
         //box.setFillColor(Color.BLACK);
         box.setBackgroundColor(Color.BLUE);
         // set text box's font
         box.setFontName("Arial", show);
         box.setFontSize(20);
         box.setBold(true); 
         
         box.setFillColor(Color.BLUE);
         slide.addShape(box);
         
         // line shape
         Line line = new Line();
         line.setAnchor(new java.awt.Rectangle(50, 50, 100, 20));
         line.setLineColor(new Color(0, 128, 0));
         line.setLineStyle(Line.LineDashDotSys);
         slide.addShape(line);
                 
         // write the file
         hshow.write(new FileOutputStream(ppt));
         Trace("Export successful!  " + ppt.getAbsolutePath());
      }catch(Exception e) {
         e.printStackTrace();
      }
   }
Comment 1 Yegor Kozlov 2006-04-20 12:46:58 UTC
It seems another example of Bug 39324. When it is fixed this issue should be
resolved. 
Comment 2 Nick Burch 2006-04-21 13:48:10 UTC
A fix for bug 39324 has been committed. Could you please re-try with the latest SVN?
Comment 3 Nick Burch 2006-07-02 16:10:05 UTC
As we haven't heard anything to say it doesn't now work, marking as closed.

Please re-open if the problem still exists.