From 2e5d006e70a23144903516c4160860058f65c371 Mon Sep 17 00:00:00 2001 From: syimyuzya Date: Sat, 4 Dec 2021 14:48:43 +0800 Subject: [PATCH] Rename get_glyph to getglyph This is for naming consistency among other font def params like `linespacing`, `margintop` etc. --- font_api/font.lua | 4 ++-- unifont/init.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/font_api/font.lua b/font_api/font.lua index 537990c..6a99334 100644 --- a/font_api/font.lua +++ b/font_api/font.lua @@ -258,10 +258,10 @@ function Font:render(text, texturew, textureh, style) -- Add image only if it is visible (at least partly) if x + self.widths[codepoint] >= 0 and x <= texturew then - if self.get_glyph == nil then + if self.getglyph == nil then glyph = string.format("font_%s_%04x.png", self.name, codepoint) else - glyph = self.get_glyph(codepoint):gsub("[\\^:]", "\\%0") + glyph = self.getglyph(codepoint):gsub("[\\^:]", "\\%0") end texture = texture.. string.format(":%d,%d=%s", x, y, glyph) diff --git a/unifont/init.lua b/unifont/init.lua index 465a615..f31456e 100644 --- a/unifont/init.lua +++ b/unifont/init.lua @@ -30,6 +30,6 @@ font_api.register_font( linespacing = -3, height = 16, widths = widths, - get_glyph = get_glyph, + getglyph = get_glyph, } )