PHPExcel:自定义字体? [英] PHPExcel: Custom font?

查看:118
本文介绍了PHPExcel:自定义字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将字体嵌入到xls中并与PHPExcel一起使用?

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

我想要自定义字体,因为我想在Excel中使用条形码字体. 我尝试嵌入条形码图像,但是在打印时出现随机点,并且条形码扫描仪无法读取它.

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.

推荐答案

没有. Excel依赖于打开Excel文档的客户端PC上存在的字体范围.如果不存在字体,它将退回到该客户端PC上存在的字体系列的成员.如果在xls文件中引用的字体在客户端PC上不存在该字体系列的成员,则根本无法呈现该字体.这是标准的MS Excel行为,并非特定于PHPExcel生成的文件.

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.

我唯一建议的替代方法是生成条形码的图像文件,并将该图像嵌入到xls文件中.

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

这篇关于PHPExcel:自定义字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆