-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
confirmedThis issue can be reproducedThis issue can be reproduced
Description
Case 1:
You should only change the font to "Yu Gothic", but bold and italic are valid.
The same event occurs regardless of the font setting.
// Case01.go
package main
import (
"fmt"
"github.com/360EntSecGroup-Skylar/excelize"
)
func main() {
f := excelize.NewFile();
style, err := f.NewStyle(`{"font":{"family":"Yu Gothic"}}`);
if err != nil {
fmt.Println(err);
}
f.SetCellStyle("Sheet1", "A2", "A2", style);
f.SetCellValue("Sheet1", "A2", "Hello world.");
f.SaveAs("./Book_Case01.xlsx");
}
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
Case 2:
You change the font to "Yu Gothic" and set the bool values of "bold" and "italic" to false, but bold and italic are valid.
// Case02.go
package main
import (
"fmt"
"github.com/360EntSecGroup-Skylar/excelize"
)
func main() {
f := excelize.NewFile();
style, err := f.NewStyle(`{"font":{"bold":false,"italic":false,"family":"Yu Gothic"}}`);
if err != nil {
fmt.Println(err);
}
f.SetCellStyle("Sheet1", "B3", "B3", style);
f.SetCellValue("Sheet1", "B3", "Hello world.");
f.SaveAs("./Book_Case02.xlsx");
}
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
I checked the test code and found that the values set for bold and italic were tested with only "true", so I'm concerned that I can't confirm what happens in the case of "false".
Output of go version:
go version go1.12.1 windows/amd64
Excelize version or commit ID:
2.0.1
Environment details (OS, Microsoft Excel™ version, physical, etc.):
Windows 10, Excel 2016, Excel 2013.
laramdemajo and luojiego
Metadata
Metadata
Assignees
Labels
confirmedThis issue can be reproducedThis issue can be reproduced
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
xuri commentedon Jun 13, 2019
Hi @GinSanaduki, thanks for your issue. I have fixed it. Please try to upgrade the library with the master branch code.
GinSanaduki commentedon Jun 13, 2019
Hi @xuri, thanks for reply.


I'm done checking the fix. It's working properly.
Fix qax-os#425, handle empty font style format
Fix qax-os#425, handle empty font style format