Font style changed after read and write

Topics: User Forum
Sep 30, 2009 at 3:24 AM

Hi,

First of all, thank you for this great project!

I'm having a problem with font formatting in worksheet, here's the situation:

  • I have a template file with its font set to EucrosiaUPC -- see screenshot
  • I wrote a small script to load and then save the template into a new file, here's the code:
    $reader = new PHPExcel_Reader_Excel5();
    $workbook = $reader->load("template.xls");
    
    $writer = new PHPExcel_Writer_Excel5($workbook);
    $writer->save("report.xls");
    
  • The font in the output file is changed (I think it looks like Calibri) -- see screenshot
  • However, when clicking on the cell, Excel tells me the name of the font is EucrosiaUPC
  • I also tried using Excel2007 Reader/Writer, the problem persists

Any suggestions?

Developer
Oct 1, 2009 at 2:55 AM

Hi suksit,

I have no idea why this is happening. Do you think you can upload template.xls and report.xls somewhere? Or you can send the files to: (erik at phpexcel dot net). I will see if I can identify the problem.

Oct 3, 2009 at 3:39 PM
Edited Oct 3, 2009 at 3:41 PM

Hi koyama, thanks for looking into this.

Here are the files in question

Developer
Oct 3, 2009 at 9:49 PM

Fixed in SVN

http://phpexcel.codeplex.com/WorkItem/View.aspx?WorkItemId=10723

Look at patch at the link, or just download source code release from here tomorrow:

http://phpexcel.codeplex.com/SourceControl/ListDownloadableCommits.aspx

There could be similar problems with other fonts with PHPExcel_Writer_Excel5, we need to deal with each case one by one.

To everyone, please report if you find similar problems with other fonts.

Oct 4, 2009 at 4:59 PM

Wow, that works like a charm!

Thank you very much, koyama :)