Make glyph showcase prettier

This commit is contained in:
Idrees Hassan committed 2022-12-26 21:32:03 -05:00
1 parent 4d33f20142
commit f903fa3843
5 files changed
+79 -43

No files matched your search

BIN
View File
Binary file not shown.
+25 -17
View File
@@ -1,20 +1,28 @@
-------------------------- Monocraft --------------------------
! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ `
a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~   ¡
¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ Å Æ Ç
Ð × Ø Þ ß æ ç ì í î ï ð ÷ ø Ů Ѐ Ё Ђ Ѓ Є Ѕ І Ї Ј Љ Њ Ћ Ќ Ѝ Ў Џ А
Б В Г Д Е Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я а
б в г д е ж з и й к л м н о п р с т у ф х ц ч ш щ ъ ы ь э ю я ѐ
ё ђ ѓ є ѕ і ї ј љ њ ћ ќ ѝ ў џ € ☺ ☻ ♥ À Á Â Ã Ä È É Ê Ë Ì Í Î Ï
Ñ Ò Ó Ô Õ Ö Ù Ú Û Ü Ý à á â ã ä å è é ê ë ñ ò ó ô õ ö ù ú û ü ý
ÿ Ā ā Ă ă Ć ć Ĉ ĉ Ċ ċ Č č Ď ď Ē ē Ĕ ĕ Ė ė Ě ě Ĝ ĝ Ğ ğ Ġ ġ Ĥ ĥ Ĩ
ĩ Ī ī Ĭ ĭ İ Ĵ ĵ Ĺ ĺ Ľ ľ Ń ń Ň ň Ō ō Ŏ ŏ Ő ő Ŕ ŕ Ř ř Ś ś Ŝ ŝ Š š
Ť ť Ũ ũ Ū ū Ŭ ŭ ů Ű ű Ŵ ŵ Ŷ ŷ Ÿ Ź ź Ż ż Ž ž Ǎ ǎ Ǐ ǐ Ǒ ǒ Ǔ ǔ Ǣ ǣ
Ǧ ǧ Ǩ ǩ ǰ Ǵ ǵ Ǹ ǹ Ǽ ǽ Ȟ ȟ Ȧ ȧ Ȯ ȯ Ȳ ȳ Ӂ ӂ Ӑ ӑ Ӓ ӓ Ӗ ӗ Ӝ ӝ Ӟ ӟ Ӣ
ӣ Ӥ ӥ Ӧ ӧ Ӭ ӭ Ӯ ӯ Ӱ ӱ Ӳ ӳ Ӵ ӵ Ӹ ӹ Ḃ ḃ Ḋ ḋ Ḟ ḟ Ḡ ḡ Ḣ ḣ Ḧ ḧ Ḱ ḱ Ḿ
ḿ Ṁ ṁ Ṅ ṅ Ṕ ṕ Ṗ ṗ Ṙ ṙ Ṡ ṡ Ṫ ṫ Ṽ ṽ Ẁ ẁ Ẃ ẃ Ẅ ẅ Ẇ ẇ Ẋ ẋ Ẍ ẍ Ẏ ẏ Ẑ
ẑ ẗ ẘ ẙ Ẽ ẽ Ỳ ỳ Ỹ ỹ ⨰ ⸚
--- Monocraft ---
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9
! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á
Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á
â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý ÿ Ā ā Ă
ă Ć ć Ĉ ĉ Ċ ċ Č č Ď ď Ē ē Ĕ ĕ Ė ė Ě ě Ĝ ĝ Ğ ğ Ġ ġ Ĥ ĥ Ĩ ĩ Ī ī Ĭ
ĭ İ Ĵ ĵ Ĺ ĺ Ľ ľ Ń ń Ň ň Ō ō Ŏ ŏ Ő ő Ŕ ŕ Ř ř Ś ś Ŝ ŝ Š š Ť ť Ũ ũ
Ū ū Ŭ ŭ Ů ů Ű ű Ŵ ŵ Ŷ ŷ Ÿ Ź ź Ż ż Ž
ž Ǎ ǎ Ǐ ǐ Ǒ ǒ Ǔ ǔ Ǣ ǣ Ǧ ǧ Ǩ ǩ ǰ Ǵ ǵ Ǹ ǹ Ǽ ǽ Ȟ ȟ Ȧ ȧ Ȯ ȯ Ȳ ȳ Ѐ Ё
Ђ Ѓ Є Ѕ І Ї Ј Љ Њ Ћ Ќ Ѝ Ў Џ А Б В Г Д Е Ж З И Й К Л М Н О П Р С
Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я а б в г д е ж з и й к л м н о п р с
т у ф х ц ч ш щ ъ ы ь э ю я ѐ ё ђ ѓ є ѕ і ї ј љ њ ћ ќ ѝ ў џ
Ӂ ӂ Ӑ ӑ Ӓ ӓ Ӗ ӗ Ӝ ӝ Ӟ ӟ Ӣ ӣ Ӥ ӥ Ӧ ӧ Ӭ ӭ Ӯ ӯ Ӱ ӱ Ӳ ӳ Ӵ ӵ Ӹ ӹ Ḃ ḃ
Ḋ ḋ Ḟ ḟ Ḡ ḡ Ḣ ḣ Ḧ ḧ Ḱ ḱ Ḿ ḿ Ṁ ṁ Ṅ ṅ Ṕ ṕ Ṗ ṗ Ṙ ṙ Ṡ ṡ Ṫ ṫ Ṽ ṽ Ẁ ẁ
Ẃ ẃ Ẅ ẅ Ẇ ẇ Ẋ ẋ Ẍ ẍ Ẏ ẏ Ẑ ẑ ẗ ẘ ẙ Ẽ ẽ Ỳ ỳ Ỹ ỹ
€ ☺ ☻ ♥ ⨰ ⸚
--- Ligatures ---
 = = -> ==
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 KiB

After

Width:  |  Height:  |  Size: 725 KiB

+52
View File
@@ -0,0 +1,52 @@
def generateExamples(characters, ligatures, charactersByCodepoint):
terminalOutput = 26*"-" + " Monocraft " + 26*"-"
index = 0
for character in characters:
if character["codepoint"] == 32:
continue
if index % 32 == 0:
terminalOutput += "\n"
terminalOutput += chr(character["codepoint"]) + " "
index += 1
print(terminalOutput)
characterOutput = "--- Monocraft ---\n\n"
for i in range(65, 91):
characterOutput += chr(i) + " "
characterOutput += "\n"
for i in range(97, 123):
characterOutput += chr(i) + " "
characterOutput += "\n"*2
for i in range(48, 58):
characterOutput += chr(i) + " "
characterOutput += "\n"*2
for i in range(33, 48):
characterOutput += chr(i) + " "
for i in range(58, 65):
characterOutput += chr(i) + " "
for i in range(91, 97):
characterOutput += chr(i) + " "
for i in range(123, 127):
characterOutput += chr(i) + " "
index = 0
for i in range(161, 65534):
if i == 382 or i == 1120 or i == 8363:
index = 0
characterOutput += "\n"
if i in charactersByCodepoint:
if index % 32 == 0:
characterOutput += "\n"
characterOutput += chr(i) + " "
index += 1
ligatureOutput = "--- Ligatures ---"
for ligature in ligatures:
start = ''.join(map(lambda codepoint: ' ' + chr(codepoint), ligature['sequence']))
start += (7 - len(ligature['sequence'])) * " "
output = 5 * " " + ''.join(map(lambda codepoint: chr(codepoint), ligature['sequence']))
ligatureOutput += "\n" + start + "->" + output
f = open("../examples/glyphs.txt", "w")
f.write(characterOutput + 2*"\n" + ligatureOutput)
f.close()
+2 -26
View File
@@ -1,6 +1,7 @@
import fontforge
import json
from generate_diacritics import generateDiacritics
from generate_examples import generateExamples
PIXEL_SIZE = 120
@@ -76,30 +77,5 @@ def drawGlyph(pixels, pen, startingX, startingY):
top = (rowIndex + 1) * PIXEL_SIZE + startingY
return top
def generateExamples():
characterOutput = 26*"-" + " Monocraft " + 26*"-"
index = 0
for character in characters:
if character["codepoint"] == 32:
continue
if index % 32 == 0:
characterOutput += "\n"
characterOutput += chr(character["codepoint"]) + " "
index += 1
print(characterOutput)
ligatureOutput = "--- Ligatures ---"
for ligature in ligatures:
start = ''.join(map(lambda codepoint: ' ' + chr(codepoint), ligature['sequence']))
start += (7 - len(ligature['sequence'])) * " "
output = 5 * " " + ''.join(map(lambda codepoint: chr(codepoint), ligature['sequence']))
ligatureOutput += "\n" + start + "->" + output
f = open("../examples/glyphs.txt", "w")
f.write(characterOutput + 2*"\n" + ligatureOutput)
f.close()
generateFont()
generateExamples()
generateExamples(characters, ligatures, charactersByCodepoint)