PHPExcel: Custom font?

风流意气都作罢 提交于 2019-12-24 00:58:44

问题


Is there a way to embed a font to the xls and use it with PHPExcel?

I want custom font because I want to use barcode font in the excel. I tried to embed a barcode image but random dot appears when printing and the barcode scanner cannot read it.


回答1:


There isn't. Excel relies on the range of fonts that exist on the client PC where the Excel document is opened. Where a font doesn't exist, it will fall back to members of the font family that exist on that client PC. In the case of a font referenced in an xls file where no member of that font family exists on the client PC, it simply cannot be rendered. This is standard MS Excel behaviour, not specific to PHPExcel-generated files.

The only alternative I can suggest is generating an image file of the barcode, and embedding that image in the xls file.



来源:https://stackoverflow.com/questions/9130568/phpexcel-custom-font

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!