From 479745e00677d933056cf25f1fc2e904a4b9c567 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 4 Oct 2011 01:15:57 +0200 Subject: Sync with ContTeXt beta 2011.10.03 12:59 Does not run yet. --- otfl-font-ini.lua | 110 ++++++++---------------------------------------------- 1 file changed, 15 insertions(+), 95 deletions(-) (limited to 'otfl-font-ini.lua') diff --git a/otfl-font-ini.lua b/otfl-font-ini.lua index df534c6..8eeba0c 100644 --- a/otfl-font-ini.lua +++ b/otfl-font-ini.lua @@ -6,16 +6,14 @@ if not modules then modules = { } end modules ['font-ini'] = { license = "see context related readme files" } --- The font code will be upgraded and reorganized so that we have a --- leaner generic code base and can do more tuning for context. +-- basemethods -> can also be in list +-- presetcontext -> defaults +-- hashfeatures -> ctx version --[[ldx--

Not much is happening here.

--ldx]]-- -local utf = unicode.utf8 -local format, serialize = string.format, table.serialize -local write_nl = texio.write_nl local lower = string.lower local allocate, mark = utilities.storage.allocate, utilities.storage.mark @@ -23,96 +21,18 @@ local report_defining = logs.reporter("fonts","defining") fontloader.totable = fontloader.to_table --- vtf comes first --- fix comes last +fonts = fonts or { } -- already defined in context +local fonts = fonts -fonts = fonts or { } +-- some of these might move to where they are used first: --- beware, some already defined +fonts.hashes = { identifiers = allocate() } +fonts.analyzers = { } -- not needed here +fonts.readers = { } +fonts.tables = { } +fonts.definers = { methods = { } } +fonts.specifiers = fonts.specifiers or { } -- in format ! +fonts.loggers = { register = function() end } +fonts.helpers = { } -fonts.identifiers = mark(fonts.identifiers or { }) -- fontdata ------.characters = mark(fonts.characters or { }) -- chardata ------.csnames = mark(fonts.csnames or { }) -- namedata ------.quads = mark(fonts.quads or { }) -- quaddata - ---~ fonts.identifiers[0] = { -- nullfont ---~ characters = { }, ---~ descriptions = { }, ---~ name = "nullfont", ---~ } - -fonts.tfm = fonts.tfm or { } -fonts.vf = fonts.vf or { } -fonts.afm = fonts.afm or { } -fonts.pfb = fonts.pfb or { } -fonts.otf = fonts.otf or { } - -fonts.privateoffset = 0xF0000 -- 0x10FFFF -fonts.verbose = false -- more verbose cache tables (will move to context namespace) - -fonts.methods = fonts.methods or { - base = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } }, - node = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } }, -} - -fonts.initializers = fonts.initializers or { - base = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } }, - node = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } } -} - -fonts.triggers = fonts.triggers or { - 'mode', - 'language', - 'script', - 'strategy', -} - -fonts.processors = fonts.processors or { -} - -fonts.analyzers = fonts.analyzers or { - useunicodemarks = false, -} - -fonts.manipulators = fonts.manipulators or { -} - -fonts.tracers = fonts.tracers or { -} - -fonts.typefaces = fonts.typefaces or { -} - -fonts.definers = fonts.definers or { } -fonts.definers.specifiers = fonts.definers.specifiers or { } -fonts.definers.specifiers.synonyms = fonts.definers.specifiers.synonyms or { } - --- tracing - -if not fonts.colors then - - fonts.colors = allocate { - set = function() end, - reset = function() end, - } - -end - --- format identification - -fonts.formats = allocate() - -function fonts.fontformat(filename,default) - local extname = lower(file.extname(filename)) - local format = fonts.formats[extname] - if format then - return format - else - report_defining("unable to determine font format for '%s'",filename) - return default - end -end - --- readers - -fonts.tfm.readers = fonts.tfm.readers or { } +fonts.tracers = { } -- for the moment till we have move to moduledata -- cgit v1.2.3