0

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.)?

Ramsay Smith
  • 1,098
  • 13
  • 30

2 Answers2

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

&#____;

Simply replace _____ with the code in html (part of php) in casual text in order to create the unicode character.

e.g hello this is &#266D;

creates: hello this is ♭

EDIT: Encoding must be UTF-8. If needed, you can create a function that replaces every note with the set that can be displayed in html. You do not need any special addons or libraries.

0

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');
Ramsay Smith
  • 1,098
  • 13
  • 30