wholesome unicode font generation

https://withblue.ink/2019/03/11/why-you-need-to-normalize-unicode-strings.html

well i randomly read about unicode having 137 000 individual characters, that is quite a lot.

I hardly doubt there are much / any font supporting the whole 137 000 symbols. Tho if we gether together 1 font which supports all or mesh together multiple fonts to get the full 137 000 symbols we can call it base font. We can than generate wholesome font from any partial one. The base font should be probly un-beveled (or hairlined or skeletoned) – getting only the inner „bezzier“ curve for each symbol.

Then you take comics sans and convert every character to svg or some vector representation. Compare each of its defined symbols with your wholesome base font. Then you can scribble together a snippet generating „font-transformation-function“ or you take „some“ NN and learn it to do the same faster. Then apply the „font-trans-fun“ to every symbol undefined in original comics sans and voila, you have wholesome comics sans with definition for every unicode char.

WeDoWanna

Sort nested dict in python – OrderedDict

Nested ordered dict sort. If you need to sort your dict or OrderedDict, this snippet may come helpfull.

from collections import OrderedDict
def ordered_dict(od, reverse=False, sort_key=None):
    """Sort nested ordered dict recursively.

    sort_key
    - sort by dict key case insensitively:
        sort_key = lambda (k, v): k.lower()
    """
    if not isinstance(od, OrderedDict):
        od = OrderedDict(od)

    res = OrderedDict()
    for k, v in sorted(od.items(), reverse=reverse, key=sort_key):
        if isinstance(v, dict):
            res[k] = ordered_dict(v)
        else:
            res[k] = v
    return res

# show-off
a = {chr(i+ord('a')+(i%2)*(ord('A')-ord('a'))): i for i in reversed(range(0,26))}
print(ordered_dict(a, reverse=True, sort_key=lambda (k,v): k.lower()))

kivent-robotic-visualiser (krv) documentation

Links

Frameworks used

The 2D robot simulation program is written in Python 3.5 and uses mainly GUI module kivy and its counterpart for game logic the kivent module.

Using kivent module complex physics, graphics, and game environment was created using only Python language the low-level parts of physics interactions are written as wrappers in Cython utilizing the cymunk – python port of 2d physics engine Chipmunk2D.

The compiling and installation of the kivy and kivent modules from source codes can be done using the playbook.yml file (using ansible-playbook is an installer program) or getting help from online forums and official pages.

Celý příspěvek

Microsnake vs micropython

So I am playing with the possibilities of micropython – the python interpreter in the embeded microcontroller enviroment. Using the STM32F4Discovery board.

Currently I am driving 4 character displays (HD lcd1602) with I2C controllers (ebay) via one STM’s i2c line. Creating a game of snake :“).

The source code is available on my github repo here.

Take a look and envy!