# ehlphabet
Fork of the original [abjphabet mod](https://forum.minetest.net/viewtopic.php?f=11&t=11744) by ABJ

**Letter Machine Reciepe**|**Letter Machine UI**
----|----
|
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.
https://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
See LICENSE file
## Changelist2018-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
2018-04-01 intllib support added with russian and german languages
/*MinetestCopyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>This program is free software; you can redistribute it and/or modifyit under the terms of the GNU Lesser General Public License as published bythe Free Software Foundation; either version 2.1 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU Lesser General Public License for more details.You should have received a copy of the GNU Lesser General Public License alongwith this program; if not, write to the Free Software Foundation, Inc.,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.*/#include"staticobject.h"#include"util/serialize.h"#include"server/serveractiveobject.h"StaticObject::StaticObject(const ServerActiveObject *s_obj,const v3f &pos_):type(s_obj->getType()),pos(pos_){
s_obj->getStaticData(&data);}voidStaticObject::serialize(std::ostream &os){// typewriteU8(os, type);// poswriteV3F1000(os, pos);// data
os<<serializeString16(data);}voidStaticObject::deSerialize(std::istream &is, u8 version){// type
type =readU8(is);// pos
pos =readV3F1000(is);// data
data =deSerializeString16(is);}voidStaticObjectList::serialize(std::ostream &os){// Check for problems firstauto problematic = [] (StaticObject &obj) ->bool{if(obj.data.size() > U16_MAX) {
errorstream <<"StaticObjectList::serialize(): ""object has excessive static data ("<< obj.data.size() <<"), deleting it."<<std::endl;return true;}return false;};for(auto it = m_stored.begin(); it != m_stored.end(); ) {if(problematic(*it))
it = m_stored.erase(it);else
it++;}for(auto it = m_active.begin(); it != m_active.end(); ) {if(problematic(it->second))
it = m_active.erase(it);else
it++;}// version
u8 version =0;writeU8(os, version);// countsize_t count = m_stored.size() + m_active.size();// Make sure it fits into u16, else it would get truncated and cause e.g.// issue #2610 (Invalid block data in database: unsupported NameIdMapping version).if(count > U16_MAX) {
errorstream <<"StaticObjectList::serialize(): "<<"too many objects ("<< count <<") in list, "<<"not writing them to disk."<<std::endl;writeU16(os,0);// count = 0return;}writeU16(os, count);for(StaticObject &s_obj : m_stored) {
s_obj.serialize(os);}for(auto&i : m_active) {
StaticObject s_obj = i.second;
s_obj.serialize(os);}}voidStaticObjectList::deSerialize(std::istream &is){if(m_active.size()) {
errorstream <<"StaticObjectList::deSerialize(): "<<"deserializing objects while "<< m_active.size()<<" active objects already exist (not cleared). "<< m_stored.size() <<" stored objects _were_ cleared"<<std::endl;}
m_stored.clear();// version
u8 version =readU8(is);// count
u16 count =readU16(is);for(u16 i =0; i < count; i++) {
StaticObject s_obj;
s_obj.deSerialize(is, version);
m_stored.push_back(s_obj);}}