From: Vanessa Dannenberg Date: Tue, 9 Oct 2018 11:49:41 +0000 (-0400) Subject: add arrow symbols to fonts X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=0f78ef70de0c6141f269e404ffb28bf5985d87b4;p=signs_lib.git add arrow symbols to fonts accessible by putting ^1 to ^8 (think "arrow number 1", etc) in your text for narrow-width arrows (good for "wide font" highway signs), or ^a to ^h for double-width arrows (good for all of the normal narrow-font signs). in order, arrows 1 and "a" point up, 2/b points up-and-right, 3/c points right, and so on, turning clockwise Any other ^x pair just renders directly (no escape char, sorry) --- diff --git a/init.lua b/init.lua index 5d44b2c..eb78b67 100644 --- a/init.lua +++ b/init.lua @@ -387,6 +387,24 @@ local function make_line_texture(line, lineno, pos) for word_i, word in ipairs(line) do local chars = { } local ch_offs = 0 + word = string.gsub(word, "%^[12345678abcdefgh]", { + ["^1"] = string.char(0x81), + ["^2"] = string.char(0x82), + ["^3"] = string.char(0x83), + ["^4"] = string.char(0x84), + ["^5"] = string.char(0x85), + ["^6"] = string.char(0x86), + ["^7"] = string.char(0x87), + ["^8"] = string.char(0x88), + ["^a"] = string.char(0x8a), + ["^b"] = string.char(0x8b), + ["^c"] = string.char(0x8c), + ["^d"] = string.char(0x8d), + ["^e"] = string.char(0x8e), + ["^f"] = string.char(0x8f), + ["^g"] = string.char(0x90), + ["^h"] = string.char(0x91) + }) local word_l = #word local i = 1 while i <= word_l do diff --git a/textures/hdf_81.png b/textures/hdf_81.png new file mode 100644 index 0000000..df38787 Binary files /dev/null and b/textures/hdf_81.png differ diff --git a/textures/hdf_82.png b/textures/hdf_82.png new file mode 100644 index 0000000..e769d35 Binary files /dev/null and b/textures/hdf_82.png differ diff --git a/textures/hdf_83.png b/textures/hdf_83.png new file mode 100644 index 0000000..7c8c59a Binary files /dev/null and b/textures/hdf_83.png differ diff --git a/textures/hdf_84.png b/textures/hdf_84.png new file mode 100644 index 0000000..9af1a9b Binary files /dev/null and b/textures/hdf_84.png differ diff --git a/textures/hdf_85.png b/textures/hdf_85.png new file mode 100644 index 0000000..a83d4c3 Binary files /dev/null and b/textures/hdf_85.png differ diff --git a/textures/hdf_86.png b/textures/hdf_86.png new file mode 100644 index 0000000..7ca6698 Binary files /dev/null and b/textures/hdf_86.png differ diff --git a/textures/hdf_87.png b/textures/hdf_87.png new file mode 100644 index 0000000..2b0eba0 Binary files /dev/null and b/textures/hdf_87.png differ diff --git a/textures/hdf_88.png b/textures/hdf_88.png new file mode 100644 index 0000000..ebab336 Binary files /dev/null and b/textures/hdf_88.png differ diff --git a/textures/hdf_8a.png b/textures/hdf_8a.png new file mode 100644 index 0000000..eeac2a1 Binary files /dev/null and b/textures/hdf_8a.png differ diff --git a/textures/hdf_8b.png b/textures/hdf_8b.png new file mode 100644 index 0000000..35681f0 Binary files /dev/null and b/textures/hdf_8b.png differ diff --git a/textures/hdf_8c.png b/textures/hdf_8c.png new file mode 100644 index 0000000..bbcd100 Binary files /dev/null and b/textures/hdf_8c.png differ diff --git a/textures/hdf_8d.png b/textures/hdf_8d.png new file mode 100644 index 0000000..e280cd9 Binary files /dev/null and b/textures/hdf_8d.png differ diff --git a/textures/hdf_8e.png b/textures/hdf_8e.png new file mode 100644 index 0000000..c97a758 Binary files /dev/null and b/textures/hdf_8e.png differ diff --git a/textures/hdf_8f.png b/textures/hdf_8f.png new file mode 100644 index 0000000..845f51c Binary files /dev/null and b/textures/hdf_8f.png differ diff --git a/textures/hdf_90.png b/textures/hdf_90.png new file mode 100644 index 0000000..bafc851 Binary files /dev/null and b/textures/hdf_90.png differ diff --git a/textures/hdf_91.png b/textures/hdf_91.png new file mode 100644 index 0000000..f5d2462 Binary files /dev/null and b/textures/hdf_91.png differ