summaryrefslogtreecommitdiff
path: root/otfl-font-ini.lua
diff options
context:
space:
mode:
Diffstat (limited to 'otfl-font-ini.lua')
-rw-r--r--otfl-font-ini.lua66
1 files changed, 44 insertions, 22 deletions
diff --git a/otfl-font-ini.lua b/otfl-font-ini.lua
index c695ec4..df534c6 100644
--- a/otfl-font-ini.lua
+++ b/otfl-font-ini.lua
@@ -6,6 +6,9 @@ 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.
+
--[[ldx--
<p>Not much is happening here.</p>
--ldx]]--
@@ -14,33 +17,38 @@ 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
-if not fontloader then fontloader = fontforge end
+local report_defining = logs.reporter("fonts","defining")
fontloader.totable = fontloader.to_table
-- vtf comes first
-- fix comes last
-fonts = fonts or { }
+fonts = fonts or { }
-fonts.ids = fonts.ids or { } fonts.identifiers = fonts.ids -- aka fontdata
-fonts.chr = fonts.chr or { } fonts.characters = fonts.chr -- aka chardata
-fonts.qua = fonts.qua or { } fonts.quads = fonts.qua -- aka quaddata
+-- beware, some already defined
-fonts.tfm = fonts.tfm or { }
+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.mode = 'base'
-fonts.private = 0xF0000 -- 0x10FFFF
-fonts.verbose = false -- more verbose cache tables
+--~ fonts.identifiers[0] = { -- nullfont
+--~ characters = { },
+--~ descriptions = { },
+--~ name = "nullfont",
+--~ }
-fonts.ids[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.chr[0] = { }
+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 = { } },
@@ -62,18 +70,28 @@ fonts.triggers = fonts.triggers or {
fonts.processors = fonts.processors or {
}
+fonts.analyzers = fonts.analyzers or {
+ useunicodemarks = false,
+}
+
fonts.manipulators = fonts.manipulators or {
}
-fonts.define = fonts.define or { }
-fonts.define.specify = fonts.define.specify or { }
-fonts.define.specify.synonyms = fonts.define.specify.synonyms 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.color then
+if not fonts.colors then
- fonts.color = {
+ fonts.colors = allocate {
set = function() end,
reset = function() end,
}
@@ -82,7 +100,7 @@ end
-- format identification
-fonts.formats = { }
+fonts.formats = allocate()
function fonts.fontformat(filename,default)
local extname = lower(file.extname(filename))
@@ -90,7 +108,11 @@ function fonts.fontformat(filename,default)
if format then
return format
else
- logs.report("fonts define","unable to determine font format for '%s'",filename)
+ report_defining("unable to determine font format for '%s'",filename)
return default
end
end
+
+-- readers
+
+fonts.tfm.readers = fonts.tfm.readers or { }