Rename get_glyph to getglyph

This is for naming consistency among other font def params like
`linespacing`, `margintop` etc.
This commit is contained in:
syimyuzya 2021-12-04 14:48:43 +08:00
parent 3612b7a7ec
commit 2e5d006e70
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -30,6 +30,6 @@ font_api.register_font(
linespacing = -3,
height = 16,
widths = widths,
get_glyph = get_glyph,
getglyph = get_glyph,
}
)