diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-10-11 16:46:49 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-10-11 16:46:49 +0200 |
commit | 24f6f7de245bdff10f21984a9a3c6af3d31fa1f1 (patch) | |
tree | af5b01583380cbe1e7890c29b42386ff58f25aa1 /tex/context/base/mkiv/font-ogr.lua | |
parent | 64f50a1d7fe79d365b350c1bae688b9bf1b44d34 (diff) | |
download | context-24f6f7de245bdff10f21984a9a3c6af3d31fa1f1.tar.gz |
2019-10-11 15:56:00
Diffstat (limited to 'tex/context/base/mkiv/font-ogr.lua')
-rw-r--r-- | tex/context/base/mkiv/font-ogr.lua | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/tex/context/base/mkiv/font-ogr.lua b/tex/context/base/mkiv/font-ogr.lua index 2845cf0ba..b408fc5d6 100644 --- a/tex/context/base/mkiv/font-ogr.lua +++ b/tex/context/base/mkiv/font-ogr.lua @@ -165,7 +165,7 @@ do end -do +do -- this will move to its own module local dropins = fonts.dropins @@ -193,8 +193,11 @@ do function dropins.registerglyph(parameters) local category = parameters.category local unicode = parameters.unicode + local private = parameters.private local unichar = parameters.unichar - if type(unichar) == "string" then + if private then + unicode = fonts.helpers.newprivateslot(private) + elseif type(unichar) == "string" then unicode = utfbyte(unichar) else local unitype = type(unicode) @@ -209,9 +212,13 @@ do unicode = round(unicode) end end - parameters.unicode = unicode - -- print(category,unicode) - shapes[category].glyphs[unicode] = parameters + if unicode then + parameters.unicode = unicode + -- print(category,unicode) + shapes[category].glyphs[unicode] = parameters + else + -- error + end end -- local function hascolorspec(t) @@ -243,7 +250,7 @@ do if not specification or not next(specification) then specification = { category = value } end - -- todo: multiple categories but then mayb also different + -- todo: multiple categories but then maybe also different -- clones because of the units .. for now we assume the same -- units local category = specification.category @@ -317,6 +324,9 @@ do end end + -- This kicks in quite late, after features have been checked. So if needed + -- substitutions need to be defined with force. + otfregister { name = "metapost", description = "metapost glyphs", |