Skip to content

Commit

Permalink
Use .glyphspackage
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledhosny committed Nov 30, 2023
1 parent 630bddd commit ec5dcbe
Show file tree
Hide file tree
Showing 528 changed files with 130,454 additions and 129,919 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/venv
/build
/.vscode
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ FM_OPTS2 = $(FM_OPTS) \
--master-dir="{tmp}" \
--instance-dir="{tmp}"

$(BUILDDIR)/$(NAME).glyphs: $(SOURCEDIR)/$(NAME).glyphs
$(BUILDDIR)/$(NAME).glyphspackage: $(SOURCEDIR)/$(NAME).glyphspackage
echo " PREPARE $(@F)"
mkdir -p $(BUILDDIR)
$(PY) $(SCRIPTDIR)/setversion.py $< $@ $(VERSION)

$(BUILDDIR)/$(NAME).designspace: $(BUILDDIR)/$(NAME).glyphs
$(BUILDDIR)/$(NAME).designspace: $(BUILDDIR)/$(NAME).glyphspackage
echo " UFO $(@F)"
mkdir -p $(BUILDDIR)
glyphs2ufo $< -m $(BUILDDIR) -n "$(PWD)"/$(INSTANCEDIR) \
Expand Down
20 changes: 16 additions & 4 deletions scripts/setversion.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import argparse
from glyphsLib import GSFont
import shutil
import openstep_plist
import os


def main():
Expand All @@ -10,9 +12,19 @@ def main():

args = parser.parse_args()

font = GSFont(args.file)
font.versionMajor, font.versionMinor = [int(x) for x in args.version.split(".")]
font.save(args.outfile)
shutil.copytree(args.file, args.outfile)
fontinfo = os.path.join(args.outfile, "fontinfo.plist")
with open(fontinfo, "r") as f:
info = openstep_plist.load(f, use_numbers=True)

info["versionMajor"], info["versionMinor"] = [
int(x) for x in args.version.split(".")
]
print(info)
with open(fontinfo, "wb") as f:
openstep_plist.dump(
info, f, unicode_escape=False, indent=0, single_line_tuples=True
)


if __name__ == "__main__":
Expand Down
Loading

0 comments on commit ec5dcbe

Please sign in to comment.