Laravel-excel: How to use ShouldAutoSize with Chinese?

Created on 20 Mar 2018  Â·  5Comments  Â·  Source: Maatwebsite/Laravel-Excel

Versions

  • PHP version: 7.2
  • Laravel version: 5.6
  • Package version: 3.0

Description

Hi
This problem occurs when using Chinese.
ShouldAudosize seems do not working right with Chinese.

Steps to Reproduce

Expected behavior:


pic2

Actual behavior:

pic

Most helpful comment

You could try to set the autosize method to exact:

\PhpOffice\PhpSpreadsheet\Shared\Font::setAutoSizeMethod(Font::AUTOSIZE_METHOD_EXACT)

If that doesn't help, you might need to ask help in PhpSpreadsheet.

All 5 comments

You could try to set the autosize method to exact:

\PhpOffice\PhpSpreadsheet\Shared\Font::setAutoSizeMethod(Font::AUTOSIZE_METHOD_EXACT)

If that doesn't help, you might need to ask help in PhpSpreadsheet.

Sad,I have a same problem ……

@patrickbrouwers where to add that ? or how to use it ?

Service provider is fine

When I set it to Font::AUTOSIZE_METHOD_EXACT, but I cannot find TrueType Font file not found. Failed to generate template: TrueType Font file not found

Was this page helpful?
0 / 5 - 0 ratings