Answer the question
In order to leave comments, you need to log in
How to get font name from font file using php or javascript?
Good afternoon.
How to get font name from font file using php or javascript?
For example, there is a 1.otf file and it is a Times New Roman font file .
Answer the question
In order to leave comments, you need to log in
For PHP, you can use the https://github.com/PhenX/php-font-lib library - it can do this.
No way!
Font files do not contain their names.
For system fonts, like Times New Roman, the names are registered in the system
For fonts loaded using CSS, the name is set in CSS when connected, and if you call the font foo when connecting, then you will have to refer to it everywhere as foo
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question