A
A
Alexey Anisimov2017-07-24 08:19:19
PHP
Alexey Anisimov, 2017-07-24 08:19:19

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

2 answer(s)
E
Eugene Mosyukov, 2017-07-24
@AnisimovAM

For PHP, you can use the https://github.com/PhenX/php-font-lib library - it can do this.

D
Dmitry Belyaev, 2017-07-24
@bingo347

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 question

Ask a Question

731 491 924 answers to any question