10

I'm using imagettftext in php to generate images. Is there a true type font that supports all utf-8 characters?

Tom Kincaid
  • 4,887
  • 6
  • 47
  • 72
  • 1
    UTF-8 is an encoding for Unicode code-points (characters). So I'm not sure what your question is. There's something like 100,000+ code-points in Unicode. – Brian Neal Dec 09 '11 at 20:24
  • I'm generating images in php using imagettftext. It doesn't show all utf-8 characters in the fonts I've tried. How I can generate images that support any utf-8 character? – Tom Kincaid Dec 09 '11 at 20:44
  • 1
    Ok, well again, UTF-8 is just an encoding to represent a Unicode character. I don't know if there is any font that supports every single Unicode code point. – Brian Neal Dec 09 '11 at 20:49
  • 2
    I ended up using Arial Unicode.ttf which has almost every language you could want. – Tom Kincaid Oct 12 '16 at 23:51

2 Answers2

13

As Brian Neal stated in his comments, UTF-8 is just one of several encoding standards that can represent every character in the Unicode character set, which currently contains more than 100000 entries.

So you are actually asking for a true type font that supports all 100k+ unicode characters currently in use on this planet (and it's a moving target, as the set gets expanded and adjusted constantly).

So I guess the literal answer is no, and you should probably check your preconditions (what character subsets are likely encountered in your use case), and search for a fitting multi-purpose font.

However, there are attempts to provide fonts that cover large amounts of the unicode space - search for 'Pan-Unicode Fonts' to get an overview.


(U+2615 - 'Hot Beverage' ;)

Community
  • 1
  • 1
Henrik Opel
  • 19,341
  • 1
  • 48
  • 64
  • 1
    After poking around for a while, I found Arial Unicode.ttf which pretty much has every major language, cyrillic, arabic, chinese, etc. – Tom Kincaid Dec 09 '11 at 23:24
  • @TomKincaid For "low fidelity" you could use the [UniFoundry's font](http://unifoundry.com/unifont.html), which is of low typographic quality but covers over 65000 Unicode codepoints. – Boldewyn Mar 30 '12 at 18:53
  • 1
    Noteworthy: historical design considerations prevent any font having more than 1 `unsigned short` characters - 65,535 different glyphs. A few code points may share a glyph - Latin Capital `A` and Greek Capital `Alpha`, for example, but that's about all you can do to artifically extend the range. – Jongware Oct 07 '16 at 23:59
4

The closest you can get is Google Noto Fonts.

Sans and Serif support 582 languages while Mono supports 212 languages.

Link and more information here: https://www.google.com/get/noto/

Nicolay77
  • 2,085
  • 25
  • 20