Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programatically generate the Monocraft font #74

Merged
merged 32 commits into from
Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9911ffb
Add script to generate fonts
IdreesInc Dec 23, 2022
65ffed0
Add ability to generate glyphs from pixels
IdreesInc Dec 24, 2022
8cc519f
Add descents and characters 33 to 126
IdreesInc Dec 24, 2022
1645f30
Add support for diacritics and reference glyphs
IdreesInc Dec 24, 2022
e2b12e1
Add more letters with diacritics
IdreesInc Dec 24, 2022
3cd7e5e
Add Cyrillic characters
IdreesInc Dec 25, 2022
102a854
Add some symbols
IdreesInc Dec 25, 2022
c040310
Added generation of data for characters with diacritics
Ciubix8513 Dec 26, 2022
8d0f036
Fix parentheses and underscore
IdreesInc Dec 26, 2022
09b24c4
Add ligatures
IdreesInc Dec 26, 2022
c61d49a
Add metadata
IdreesInc Dec 26, 2022
90782b0
Create LICENSE for code that generates the font
IdreesInc Dec 26, 2022
061c729
Revert "Create LICENSE for code that generates the font"
IdreesInc Dec 26, 2022
faac770
Add license for source code
IdreesInc Dec 26, 2022
5209d7f
Rename license files
IdreesInc Dec 26, 2022
e791376
Remove files that are no longer needed
IdreesInc Dec 26, 2022
711d158
Add copyright notice
IdreesInc Dec 26, 2022
b3672e5
Added license notice
Ciubix8513 Dec 26, 2022
c83992b
Fix for merge conflict
Ciubix8513 Dec 26, 2022
b580259
Merge branch '73-programatically-generate-monocraft' into main
Ciubix8513 Dec 26, 2022
ae7c885
Merge pull request #72 from Ciubix8513/main
IdreesInc Dec 26, 2022
3a8b70e
Reorganize diacritic generation code
IdreesInc Dec 27, 2022
245227a
Add more diacritics
IdreesInc Dec 27, 2022
3e72f59
Add dot above diacritic
IdreesInc Dec 27, 2022
6bbfe4c
Remove unnecessary glyph overrides
IdreesInc Dec 27, 2022
4d33f20
Generate glyph showcase when run
IdreesInc Dec 27, 2022
f903fa3
Make glyph showcase prettier
IdreesInc Dec 27, 2022
0be3af2
Fix i and j diacritics
IdreesInc Dec 27, 2022
3006076
Fix glyph preview
IdreesInc Dec 27, 2022
6ddcb8b
Add license header and remove builds from source
IdreesInc Dec 27, 2022
4e3bd39
Update README
IdreesInc Dec 27, 2022
412fd10
Fix license header wording
IdreesInc Dec 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

.DS_Store
src/__pycache__
dist/
src/build-font.sh
Binary file removed Monocraft.ttf
Binary file not shown.
2 changes: 0 additions & 2 deletions src/build-font.sh

This file was deleted.

20 changes: 12 additions & 8 deletions src/generate_diacritics.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# This program is free software:
# you can redistribute it and/or modify it under the terms of the GNU General Public License version 3
# as published by the Free Software Foundation;
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program.
# If not, see https://www.gnu.org/licenses/.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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 of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

def generateDiacritics(characters, diacritics):
# Create dictionaries for faster lookup
Expand Down
13 changes: 13 additions & 0 deletions src/generate_examples.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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 of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

def generateExamples(characters, ligatures, charactersByCodepoint):
terminalOutput = 26*"-" + " Monocraft " + 26*"-"
index = 0
Expand Down
20 changes: 18 additions & 2 deletions src/monocraft.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Monocraft, a monospaced font for developers who like Minecraft a bit too much.
# Copyright (C) 2022 Idrees Hassan
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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 of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import fontforge
import json
from generate_diacritics import generateDiacritics
Expand All @@ -19,7 +34,7 @@ def generateFont():
monocraft.fullname = "Monocraft"
monocraft.copyright = "Idrees Hassan, https://github.com/IdreesInc/Monocraft"
monocraft.encoding = "UnicodeFull"
monocraft.version = "2.0"
monocraft.version = "2.1"
monocraft.weight = "Medium"
monocraft.ascent = PIXEL_SIZE * 8
monocraft.descent = PIXEL_SIZE
Expand Down Expand Up @@ -54,7 +69,8 @@ def generateFont():
lig.addPosSub("ligatures-subtable", tuple(map(lambda codepoint: charactersByCodepoint[codepoint]["name"], ligature["sequence"])))

print(f"Generated {len(ligatures)} ligatures")
monocraft.generate("../Monocraft.ttf")
monocraft.generate("../dist/Monocraft.ttf")
monocraft.generate("../dist/Monocraft.otf")

def drawCharacter(character, pen):
if "reference" in character: return drawCharacter(charactersByCodepoint[character["reference"]],pen)
Expand Down