summaryrefslogtreecommitdiff
path: root/src/fontloader/runtime/fontloader-basics-gen.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-09-23 22:51:34 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-09-23 22:51:37 +0200
commit451bec66e177935ef906e8c530de8dc4ad6bd9c8 (patch)
tree116d74e5df5059143e7ca47fdd67bac352dbaa8e /src/fontloader/runtime/fontloader-basics-gen.lua
parent6dc3fd8fea8313c8bfebe073563a29b7e56acb4d (diff)
downloadluaotfload-451bec66e177935ef906e8c530de8dc4ad6bd9c8.tar.gz
[fontloader] patch basics-gen to include missing converters
Fontloader crashes during loading. Hans is notified, let’s wait for him to fix it properly.
Diffstat (limited to 'src/fontloader/runtime/fontloader-basics-gen.lua')
-rw-r--r--src/fontloader/runtime/fontloader-basics-gen.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/fontloader/runtime/fontloader-basics-gen.lua b/src/fontloader/runtime/fontloader-basics-gen.lua
index 2be55cc..6aec915 100644
--- a/src/fontloader/runtime/fontloader-basics-gen.lua
+++ b/src/fontloader/runtime/fontloader-basics-gen.lua
@@ -434,3 +434,23 @@ if arg then
end
end
end
+
+--- PHG: HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK
+--- certain values are missing from attr-col.lua.
+local function cmyktorgb(c,m,y,k)
+ if not c then
+ return 0, 0, 0, 1
+ else
+ return 1.0 - min(1.0,c+k), 1.0 - min(1.0,m+k), 1.0 - min(1.0,y+k)
+ end
+end
+
+local function graytorgb(s) -- unweighted
+ return 1-s, 1-s, 1-s
+end
+
+attributes = attributes or { }
+attributes.colors = attributes.colors or { }
+attributes.colors.cmyktorgb = cmyktorgb
+attributes.colors.graytorgb = graytorgb
+