v.0.3.1 font 3x5 pretty

This commit is contained in:
tiijay
2025-10-23 19:06:30 +02:00
parent a66b00989f
commit 9fcc7712e6
7 changed files with 334 additions and 592 deletions

View File

@@ -12,52 +12,6 @@ def number_to_bitarray_msb(number, bits=8):
return [(number >> i) & 1 for i in range(bits - 1, -1, -1)]
def is_letter_assigned_right(char, letter) -> bool:
"""Prüfe ob das Zeichen auch komplett nach rechts gezogen ist
Args:
letter (_type_): Array[0..nBytes]
Returns:
bool: _description_
"""
def isLetterRight(letter):
def isByteRight(byte):
return True if 1 & byte == 1 else False
for byte in letter:
if isByteRight(byte):
return True
return False
def shiftLetterRight(letter):
def shift(letter):
return [byte >> 1 for byte in letter]
shifted = letter
for i in range(8): # max 1 Bit's
shifted = shift(shifted)
if isLetterRight(shifted):
break
return shifted
if isLetterRight(letter):
return True
# letter is not right shifted
shifted = shiftLetterRight(letter)
print('origin:')
show_byte_matrix(char, letter)
print('shifted')
show_byte_matrix(char, shifted)
return False
def get_datetime_string(format='full'):
"""
Return date/time as string with different formats