[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] checking national glyhs
From: |
Werner LEMBERG |
Subject: |
Re: [ft] checking national glyhs |
Date: |
Mon, 09 Jun 2014 23:50:14 +0200 (CEST) |
> I'd like to detect whether a glyph (e.g. 0x0150) is part of the
> font. Actually detect Hungarian language support of webpages. Font
> file names are extracted from CSS.
You rather want to detect whether Unicode input character U+0150 has a
mapping to a non-zero glyph index.
> Is it OK?
> ftdump -v /usr/share/fonts/truetype/msttcorefonts/verdana.ttf | grep
> 0x0151
No, it isn't, you need flag `-V' for that :-)
> Or should I care about these?
> charmaps
> 0: platform 1, encoding 0, language 0
> 1: platform 3, encoding 1, language 0 (active)
Yes, you normally need a (3,1) encoding, as described in the OpenType
specification. There are other Unicode mappings, but those are very
rare today.
However, I strongly suggest that you use already existing solutions
like the `fontconfig' library, which contains code to scan a font for
detecting the supported scripts and languages. A single glyph doesn't
make up a font for Hungarian...
Werner