fpdf:嵌入特殊字符(fpdf: Embedding special characters)

编程入门 行业动态 更新时间:2024-10-25 13:27:18
fpdf:嵌入特殊字符(fpdf: Embedding special characters)

我正在使用tFPDF生成一些音乐,需要使用平坦的♭符号。 我见过的几个例子都使用了UTF-8和自定义字体,我已经实现了。 但是,它们似乎并没有嵌入整个字体,因为那个和其他字符不会显示和显示? 代替。

有谁知道如何实现这个(即插入特定字符,嵌入整个字体等)?

I am using tFPDF to generate some music and need to use the flat ♭ symbol. Several examples I have seen use UTF-8 and custom fonts, which I have implemented. However, they do not seem to embed the entire font, as that and other characters will not display and show a ? instead.

Does anyone know how to implement this (i.e. insert specific character, embed entire font, etc.)?

最满意答案

2669 - Quarter Note 266A - Eighth Note 266B - Beamed Eighth Note 266C - Beamed Sixteenth Note 266D - Flat Symbol 266E - Natural Symbol 266F - Sharp Symbol

&#____;

只需将_____替换为html(php的一部分)中的代码,即可创建unicode字符。

例如hello this is &#266D;

创造: hello this is ♭

编辑:编码必须是UTF-8。 如果需要,您可以创建一个函数,用可以在html中显示的集替换每个音符。 您不需要任何特殊的插件或库。

I found the answer myself. First, I implement tFPDF. Then I use the DejaVu UTF-8 font that is included in the package, then use urldecode to display the character.

urldecode('%E2%99%AD');

更多推荐

本文发布于:2023-08-03 15:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1393328.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:特殊字符   fpdf   Embedding   characters   special

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!