diff --git a/README.md b/README.md index 3fc88a9..4b218c1 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,40 @@ # ehlphabet -Fork of the original abjphabet mod by ABJ -https://forum.minetest.net/viewtopic.php?f=11&t=11744 - -Letter blocks can be created with the Letter Machine or given with /giveme ehlphabet:(ascii decimal) -Example: '/giveme ehlphabet:65' will give you a block with the letter 'A' on it. -http://www.asciitable.com/ - -Textures were created using Title Wave font by Digital Graphic Labs +Fork of the original [abjphabet mod](https://forum.minetest.net/viewtopic.php?f=11&t=11744) by ABJ + +![screenshot](screenshot.png) + +**Letter Machine Reciepe**|**Letter Machine UI** +----|---- +![Letter Machine Reciepe](reciepe.png)|![Letter Machine UI](lmui.png) + +Letter blocks can be created with the Letter Machine or given with /giveme ehlphabet:(ascii decimal) + +Example: `/giveme ehlphabet:65` will give you a block with the letter [**A**] on it. +http://www.asciitable.com/ + +For UTF-8 characters add one more identifier /giveme ehlphabet:(first byte decimal)_(second byle decimal) + +Example: `/giveme ehlphabet:195_132` will give you a block with the letter [**Ä**] on it. +http://www.utf8-chartable.de/ + +## Textures + +Textures were generated using [**phantomjs**](http://phantomjs.org/download.html) script "gen.js" included in this repository. + +To (re)generate textures run: + + $ phantomjs gen.js + +To customize the look and size of letters, you need to know basic HTML and CSS and change it inside "gen.js". + +## License + Textures are licensed under CC-BY-SA 3.0 +## Changelist -20180124 -patched by Och_Noe to use it as replacement for abjphabet -(create aliases) +2018-01-24 patched by Och_Noe to use it as replacement for abjphabet (create aliases) + +2018-03-29 support for UTF-8 and cyrillic letters added + +2018-03-31 german letters added \ No newline at end of file diff --git a/gen.js b/gen.js index 512eb35..9e23974 100644 --- a/gen.js +++ b/gen.js @@ -20,6 +20,8 @@ var chars = [ // special chars "!", "#", "$", "%", "&", "(", ")", "*", "+", ",", "-", ".", "/", ":", ";", "<", "=", ">", "?", "@", '"', "'", + // german + "Ä", "Ö", "Ü", "ß", // cyrillic "А", "Б", "В", "Г", "Д", "Е", "Ё", "Ж", "З", "И", "Й", "К", "Л", "М", "Н", "О", "П", "Р", "С", "Т", "У", "Ф", "Х", "Ц", "Ч", "Ш", "Щ", "Ъ", "Ы", "Ь", diff --git a/init.lua b/init.lua index c5ffc34..300e256 100644 --- a/init.lua +++ b/init.lua @@ -7,6 +7,7 @@ local special_chars = { "!", "#", "$", "%", "&", "(", ")", "*", "+", ",", "-", ".", "/", ":", ";", "<", "=", ">", "?", "@", "'", '"' } +local german_chars = {"Ä", "Ö", "Ü", "ß"} local cyrillic_chars = { "А", "Б", "В", "Г", "Д", "Е", "Ё", "Ж", "З", "И", "Й", "К", "Л", "М", "Н", "О", "П", "Р", "С", "Т", "У", "Ф", "Х", "Ц", "Ч", "Ш", "Щ", "Ъ", "Ы", "Ь", @@ -26,12 +27,13 @@ end local function is_multibyte(ch) local byte = ch:byte() - return (208 == byte) or (209 == byte) + return (195 == byte) or (208 == byte) or (209 == byte) end table_merge(characters, base_chars) table_merge(characters, digits) table_merge(characters, special_chars) +table_merge(characters, german_chars) table_merge(characters, cyrillic_chars) local create_alias = true @@ -135,7 +137,7 @@ minetest.register_node( local mb = is_multibyte(ch) local key = mb and (ch:byte(1) .. ch:byte(2)) or ch:byte() for _, v in pairs(characters) do - if v == fields.lettername then + if v == ch then local give = {} give[1] = inv:add_item("output", "ehlphabet:" .. key) inputstack:take_item() diff --git a/lmui.png b/lmui.png new file mode 100644 index 0000000..391d4f9 Binary files /dev/null and b/lmui.png differ diff --git a/reciepe.png b/reciepe.png new file mode 100644 index 0000000..f57efc1 Binary files /dev/null and b/reciepe.png differ diff --git a/screenshot.png b/screenshot.png index 1c2caa8..c8369e6 100644 Binary files a/screenshot.png and b/screenshot.png differ diff --git a/textures/ehlphabet_195_132.png b/textures/ehlphabet_195_132.png new file mode 100644 index 0000000..6120254 Binary files /dev/null and b/textures/ehlphabet_195_132.png differ diff --git a/textures/ehlphabet_195_150.png b/textures/ehlphabet_195_150.png new file mode 100644 index 0000000..eb6b392 Binary files /dev/null and b/textures/ehlphabet_195_150.png differ diff --git a/textures/ehlphabet_195_156.png b/textures/ehlphabet_195_156.png new file mode 100644 index 0000000..6864015 Binary files /dev/null and b/textures/ehlphabet_195_156.png differ diff --git a/textures/ehlphabet_195_159.png b/textures/ehlphabet_195_159.png new file mode 100644 index 0000000..b9b01c1 Binary files /dev/null and b/textures/ehlphabet_195_159.png differ diff --git a/textures/screenshot.png b/textures/screenshot.png deleted file mode 100644 index 8761823..0000000 Binary files a/textures/screenshot.png and /dev/null differ