summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtx-fonts.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/context/lua/mtx-fonts.lua b/scripts/context/lua/mtx-fonts.lua
index 4340cb357..675d9fb12 100644
--- a/scripts/context/lua/mtx-fonts.lua
+++ b/scripts/context/lua/mtx-fonts.lua
@@ -413,8 +413,12 @@ function scripts.fonts.save()
local sub = givenfiles[2] or ""
local function save(savename,fontblob)
if fontblob then
+ if fontblob.validation_state and table.contains(fontblob.validation_state,"bad_ps_fontname") then
+ report("ignoring bad fontname for %a",name)
+ savename = file.nameonly(name) .. "-bad-ps-name"
+ end
savename = file.addsuffix(string.lower(savename),"lua")
- report("fontsave, saving data in %s",savename)
+ report("fontsave, saving data in %a",savename)
table.tofile(savename,fontloader.to_table(fontblob),"return")
fontloader.close(fontblob)
end
@@ -426,7 +430,7 @@ function scripts.fonts.save()
if suffix == 'ttf' or suffix == 'otf' or suffix == 'ttc' or suffix == "dfont" then
local fontinfo = fontloader.info(filename)
if fontinfo then
- report("font: %s located as %s",name,filename)
+ report("font: %a located as %a",name,filename)
if #fontinfo > 0 then
for k=1,#fontinfo do
local v = fontinfo[k]
@@ -436,13 +440,13 @@ function scripts.fonts.save()
save(fontinfo.fullname,fontloader.open(filename))
end
else
- report("font: %s cannot be read",filename)
+ report("font: %a cannot be read",filename)
end
else
- report("font: %s not saved",filename)
+ report("font: %a not saved",filename)
end
else
- report("font: %s not found",name)
+ report("font: %a not found",name)
end
else
report("font: no name given")