summaryrefslogtreecommitdiff
path: root/tex/context/base/font-syn.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/font-syn.lua')
-rw-r--r--tex/context/base/font-syn.lua54
1 files changed, 51 insertions, 3 deletions
diff --git a/tex/context/base/font-syn.lua b/tex/context/base/font-syn.lua
index 5b50ac75f..5126739a7 100644
--- a/tex/context/base/font-syn.lua
+++ b/tex/context/base/font-syn.lua
@@ -81,7 +81,33 @@ directives.register("fonts.usesystemfonts", function(v) usesystemfonts = toboole
local P, C, Cc, Cs = lpeg.P, lpeg.C, lpeg.Cc, lpeg.Cs
--- what to do with 'thin'
+-- -- what to do with these -- --
+--
+-- thin -> thin
+--
+-- regu -> regular -> normal
+-- norm -> normal -> normal
+-- stan -> standard -> normal
+-- medi -> medium
+-- ultr -> ultra
+-- ligh -> light
+-- heav -> heavy
+-- blac -> black
+-- thin
+-- book
+-- verylight
+--
+-- buch -> book
+-- buchschrift -> book
+-- halb -> demi
+-- halbfett -> demi
+-- mitt -> medium
+-- mittel -> medium
+-- fett -> bold
+-- mage -> light
+-- mager -> light
+-- nord -> normal
+-- gras -> normal
local weights = Cs ( -- not extra
P("demibold")
@@ -90,6 +116,7 @@ local weights = Cs ( -- not extra
+ P("ultrabold")
+ P("extrabold")
+ P("ultralight")
+ + P("extralight")
+ P("bold")
+ P("demi")
+ P("semi")
@@ -103,6 +130,17 @@ local weights = Cs ( -- not extra
+ P("regular") / "normal"
)
+-- numeric_weights = {
+-- 200 = "extralight",
+-- 300 = "light",
+-- 400 = "book",
+-- 500 = "medium",
+-- 600 = "demi",
+-- 700 = "bold",
+-- 800 = "heavy",
+-- 900 = "black",
+-- }
+
local normalized_weights = sparse {
regular = "normal",
}
@@ -116,6 +154,7 @@ local styles = Cs (
+ P("roman") / "normal"
+ P("ital") / "italic" -- might be tricky
+ P("ita") / "italic" -- might be tricky
+--+ P("obli") / "oblique"
)
local normalized_styles = sparse {
@@ -129,6 +168,7 @@ local widths = Cs(
+ P("thin")
+ P("expanded")
+ P("cond") / "condensed"
+--+ P("expa") / "expanded"
+ P("normal")
+ P("book") / "normal"
)
@@ -268,6 +308,9 @@ filters.dfont = fontloader.info
-- glyphs so here we first load and then discard which is a waste. In the past it did
-- free memory because a full load was done. One of these things that goes unnoticed.
--
+-- missing: names, units_per_em, design_range_bottom, design_range_top, design_size,
+-- pfminfo, top_side_bearing
+
-- function fontloader.fullinfo(...) -- check with taco what we get / could get
-- local ff = fontloader.open(...)
-- if ff then
@@ -283,7 +326,7 @@ filters.dfont = fontloader.info
-- Phillip suggested this faster variant but it's still a hack as fontloader.info should
-- return these keys/values (and maybe some more) but at least we close the loader which
-- might save some memory in the end.
---
+
-- function fontloader.fullinfo(name)
-- local ff = fontloader.open(name)
-- if ff then
@@ -301,6 +344,7 @@ filters.dfont = fontloader.info
-- design_size = fields.design_size and ff.design_size,
-- italicangle = fields.italicangle and ff.italicangle,
-- pfminfo = fields.pfminfo and ff.pfminfo,
+-- top_side_bearing = fields.top_side_bearing and ff.top_side_bearing,
-- }
-- table.setmetatableindex(d,function(t,k)
-- report_names("warning, trying to access field %a in font table of %a",k,name)
@@ -313,7 +357,7 @@ filters.dfont = fontloader.info
-- end
-- As we have lazy loading anyway, this one still is full and with less code than
--- the previous one.
+-- the previous one. But this depends on the garbage collector to kick in.
function fontloader.fullinfo(...)
local ff = fontloader.open(...)
@@ -326,6 +370,10 @@ function fontloader.fullinfo(...)
end
end
+if tonumber(status.luatex_version) > 78 or (tonumber(status.luatex_version) == 78 and tonumber(status.luatex_revision) > 0) then
+ fontloader.fullinfo = fontloader.info
+end
+
filters.otf = fontloader.fullinfo
filters.ttf = fontloader.fullinfo