summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-02-15 16:58:38 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-02-15 17:03:13 +0200
commit372b225dc5f139b0988eb03032b571e0b91010eb (patch)
tree55d8008518d605aca45598e645d3e151d19fe74b
parent42180261320683ea265631d44024ba698286dba8 (diff)
downloadluaotfload-372b225dc5f139b0988eb03032b571e0b91010eb.tar.gz
Disable progress bar in verbose mode
-rw-r--r--luaotfload-fonts.lua32
1 files changed, 17 insertions, 15 deletions
diff --git a/luaotfload-fonts.lua b/luaotfload-fonts.lua
index a79a18b..746b520 100644
--- a/luaotfload-fonts.lua
+++ b/luaotfload-fonts.lua
@@ -32,22 +32,24 @@ local function log(lvl, fmt, ...)
end
local function progress(current, total)
--- local width = os.getenv("COLUMNS") -2 --doesn't work
- local width = 78
- local percent = current/total
- local gauge = format("[%s]", rep(" ", width))
- if percent >= 0.01 then
- gauge = format("[%s>%s]", rep("=", (width*percent)-1), rep(" ", width-(width*percent)))
- end
- if percent == 1 then
- gauge = gauge .. "\n"
- end
- if lastislog == 1 then
- texio.write_nl("")
- lastislog = 0
+ if luaotfload.fonts.log_level == 1 then
+-- local width = os.getenv("COLUMNS") -2 --doesn't work
+ local width = 78
+ local percent = current/total
+ local gauge = format("[%s]", rep(" ", width))
+ if percent > 0 then
+ gauge = format("[%s>%s]", rep("=", (width*percent)-1), rep(" ", width-(width*percent)))
+ end
+ if percent == 1 then
+ gauge = gauge .. "\n"
+ end
+ if lastislog == 1 then
+ texio.write_nl("")
+ lastislog = 0
+ end
+ io.stderr:write("\r"..gauge)
+ io.stderr:flush()
end
- io.stderr:write("\r"..gauge)
- io.stderr:flush()
end
function fontloader.fullinfo(...)