[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freetype] Which script is covered by a font
From: |
David Turner |
Subject: |
Re: [Freetype] Which script is covered by a font |
Date: |
Wed, 09 Apr 2003 09:15:08 +0200 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030210 |
Hello Ingo,
Ingo Maier wrote:
Maybe it is a stupid question but I found no information about that. Can
I find out for which glyph indices there are glyph images in a font?
Or better, can I find out which unicode scripts are covered by a given
font?
There is no easy answer to this question. Fact is that:
- in TrueType, the OS/2 table contains bit flags that
indicates which Unicode ranges are covered by the
font. However, DON'T EXPECT this information to be
correct in all fonts out there, far from it.
- other formats don't allow you to do that. The "generic"
solution is thus to iterate over the charmaps found in
the font to retrieve every possible (charcode=>glyph index)
mapping, and build a "language coverage" out of these
you'll also need to store this information outside of the font
if you don't want to scan it each time you open it. This is
what I call "font meta-data". As far as I know, FontConfig
already provides this information on Unix.
Best Regards,
- David Turner
- The FreeType Project (www.freetype.org)