summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/luat-fio.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-01-29 16:15:09 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-01-29 16:15:09 +0100
commit452587cdeefbf6e3bf1eee91e4e976f1135b785f (patch)
treee52f05dfd327c3b31a1b0fb82545dbdec639d2e2 /tex/context/base/mkiv/luat-fio.lua
parent975f4f9f2d71d8021900955404f8b144ca6895f5 (diff)
downloadcontext-452587cdeefbf6e3bf1eee91e4e976f1135b785f.tar.gz
2016-01-28 22:37:00
Diffstat (limited to 'tex/context/base/mkiv/luat-fio.lua')
-rw-r--r--tex/context/base/mkiv/luat-fio.lua59
1 files changed, 48 insertions, 11 deletions
diff --git a/tex/context/base/mkiv/luat-fio.lua b/tex/context/base/mkiv/luat-fio.lua
index daa6cccb7..43f7d6486 100644
--- a/tex/context/base/mkiv/luat-fio.lua
+++ b/tex/context/base/mkiv/luat-fio.lua
@@ -33,12 +33,49 @@ if not resolvers.instance then
if callback then
- local register = callbacks.register
+ local register = callbacks.register
+
+ local addsuffix = file.addsuffix
+ local join = file.join
+
+ local function findpk(font,dpi)
+ local dpi = dpi or 600 -- could take from resolution
+ -- <font>.pk
+ local name = addsuffix(font,"pk")
+ -- <dpi>/name.pk
+ local temp = join(dpi,name)
+ local okay = findbinfile(temp,"pk")
+ -- print(temp,okay)
+ if okay and okay ~= "" then
+ return okay
+ end
+ -- <dpi>.dpi/name.pk
+ local temp = join(dpi..".dpi",name)
+ local okay = findbinfile(temp,"pk")
+ -- print(temp,okay)
+ if okay and okay ~= "" then
+ return okay
+ end
+ -- <font>.<dpi>pk
+ local name = addsuffix(font,dpi.."pk")
+ -- name.<dpi>pk
+ local temp = name
+ local okay = findbinfile(temp,"pk")
+ -- print(temp,okay)
+ if okay and okay ~= "" then
+ return okay
+ end
+ -- <dpi>.dpi/name.<dpi>pk
+ local temp = join(dpi..".dpi",name)
+ local okay = findbinfile(temp,"pk")
+ -- print(temp,okay)
+ return okay or ""
+ end
-- register('process_jobname' , function(name) return name end, true)
- register('find_read_file' , function(id,name) return findtexfile(name) end, true)
- register('open_read_file' , function( name) return opentexfile(name) end, true)
+ register('find_read_file' , function(id,name) return findtexfile(name) end, true)
+ register('open_read_file' , function( name) return opentexfile(name) end, true)
register('find_data_file' , function(name) return findbinfile(name,"tex") end, true)
register('find_enc_file' , function(name) return findbinfile(name,"enc") end, true)
@@ -48,23 +85,23 @@ if not resolvers.instance then
register('find_map_file' , function(name) return findbinfile(name,"map") end, true)
register('find_opentype_file' , function(name) return findbinfile(name,"otf") end, true)
register('find_output_file' , function(name) return name end, true)
- register('find_pk_file' , function(name) return findbinfile(name,"pk") end, true)
+ register('find_pk_file' , findpk, true)
register('find_sfd_file' , function(name) return findbinfile(name,"sfd") end, true)
register('find_truetype_file' , function(name) return findbinfile(name,"ttf") end, true)
register('find_type1_file' , function(name) return findbinfile(name,"pfb") end, true)
register('find_vf_file' , function(name) return findbinfile(name,"vf") end, true)
register('find_cidmap_file' , function(name) return findbinfile(name,"cidmap") end, true)
- register('read_data_file' , function(file) return loadbinfile(file,"tex") end, true)
- register('read_enc_file' , function(file) return loadbinfile(file,"enc") end, true)
- register('read_font_file' , function(file) return loadbinfile(file,"tfm") end, true)
+ register('read_data_file' , function(file) return loadbinfile(file,"tex") end, true)
+ register('read_enc_file' , function(file) return loadbinfile(file,"enc") end, true)
+ register('read_font_file' , function(file) return loadbinfile(file,"tfm") end, true)
-- format
-- image
- register('read_map_file' , function(file) return loadbinfile(file,"map") end, true)
+ register('read_map_file' , function(file) return loadbinfile(file,"map") end, true)
-- output
- register('read_pk_file' , function(file) return loadbinfile(file,"pk") end, true) -- 600dpi/manfnt.720pk
- register('read_sfd_file' , function(file) return loadbinfile(file,"sfd") end, true)
- register('read_vf_file' , function(file) return loadbinfile(file,"vf" ) end, true)
+ register('read_pk_file' , function(file) return loadbinfile(file,"pk") end, true) -- 600dpi/manfnt.720pk
+ register('read_sfd_file' , function(file) return loadbinfile(file,"sfd") end, true)
+ register('read_vf_file' , function(file) return loadbinfile(file,"vf" ) end, true)
-- register('find_font_file' , function(name) return findbinfile(name,"ofm") end, true)
-- register('find_vf_file' , function(name) return findbinfile(name,"ovf") end, true)