if not modules then modules = { } end modules ['font-enc'] = { version = 1.001, comment = "companion to font-ini.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files" } local match, gmatch, gsub = string.match, string.gmatch, string.gsub --[[ldx--
Because encodings are going to disappear, we don't bother defining them in tables. But we may do so some day, for consistency.
--ldx]]-- fonts.enc = fonts.enc or { } fonts.enc.version = 1.03 fonts.enc.cache = containers.define("fonts", "enc", fonts.enc.version, true) fonts.enc.known = { -- sort of obsolete texnansi = true, ec = true, qx = true, t5 = true, t2a = true, t2b = true, t2c = true, unicode = true } function fonts.enc.is_known(encoding) return containers.is_valid(fonts.enc.cache(),encoding) end --[[ldx--An encoding file looks like this:
Beware! The generic encoding files don't always apply to the ones that
ship with fonts. This has to do with the fact that names follow (slightly)
different standards. However, the fonts where this applies to (for instance
Latin Modern or
There is no unicode encoding but for practical purposed we define one.
--ldx]]-- -- maybe make this a function: function fonts.enc.make_unicode_vector() local vector, hash = { }, { } for code, v in next, characters.data do local name = v.adobename if name then vector[code], hash[name] = name, code else vector[code] = '.notdef' end end for name, code in next, characters.synonyms do vector[code], hash[name] = name, code end return containers.write(fonts.enc.cache(), 'unicode', { name='unicode', tag='unicode', vector=vector, hash=hash }) end