[smc-discuss] [Git][smc/fonts/keraleeyam][master] 2 commits: Use build directory to store ttf
Balasankar C
gitlab at mg.gitlab.com
Sat Jun 23 11:03:16 PDT 2018
Balasankar C pushed to branch master at SMC / fonts / Keraleeyam
Commits:
a5530681 by Balasankar C at 2018-06-23T18:03:14Z
Use build directory to store ttf
- - - - -
11b075fb by Balasankar C at 2018-06-23T18:03:14Z
Merge branch 'build-dir' into 'master'
Use build directory to store ttf
See merge request smc/fonts/keraleeyam!2
- - - - -
5 changed files:
- + .gitignore
- .gitlab-ci.yml
- Makefile
- + tools/artifacts.sh
- tools/build.py
Changes:
=====================================
.gitignore
=====================================
@@ -0,0 +1,5 @@
+features/tables.fea.backup
+build/*
+tests/*.pdf
+tests/*.html
+.directory
=====================================
.gitlab-ci.yml
=====================================
@@ -1,23 +1 @@
-image: "debian:stretch"
-
-generate-ttf:
- stage: build
- before_script:
- - apt-get update -y
- - apt-get install -y make fonttools python-fontforge
- script:
- - make compile
- - mkdir -p ttfs/
- - mv *.ttf ttfs/
- artifacts:
- paths:
- - ttfs/
-
-test:
- stage: test
- before_script:
- - apt-get update -y
- - apt-get install -y make libharfbuzz-bin
- script:
- - cp -r ttfs/* .
- - make test
+include: 'https://gitlab.com/smc/fonts-all/raw/master/fonts-gitlab-ci.yml'
=====================================
Makefile
=====================================
@@ -6,32 +6,34 @@ feature=features/features.fea
PY=python2.7
buildscript=tools/build.py
version=3.0
-default: compile
-all: compile webfonts test
-compile:
+outdir=build
+default: ttf
+all: clean ttf webfonts test
+.PHONY: ttf
+ttf:
@for font in `echo ${fonts}`;do \
- $(PY) $(buildscript) -t ttf -i $$font.sfd -f $(feature) -v $(version);\
+ $(PY) $(buildscript) -t ttf -i $$font.sfd -f $(feature) -v $(version) -o $(outdir);\
done;
webfonts:woff woff2
-woff: compile
+woff: ttf
@rm -rf *.woff
@for font in `echo ${fonts}`;do \
- $(PY) $(buildscript) -t woff -i $$font.ttf;\
+ $(PY) $(buildscript) -t woff -i $(outdir)/$$font.ttf;\
done;
-woff2: compile
+woff2: ttf
@rm -rf *.woff2
@for font in `echo ${fonts}`;do \
- $(PY) $(buildscript) -t woff2 -i $$font.ttf;\
+ $(PY) $(buildscript) -t woff2 -i $(outdir)/$$font.ttf;\
done;
-install: compile
+install: ttf
@for font in `echo ${fonts}`;do \
- install -D -m 0644 $${font}.ttf ${DESTDIR}/${fontpath}/$${font}.ttf;\
+ install -D -m 0644 $(outdir)/$${font}.ttf ${DESTDIR}/${fontpath}/$${font}.ttf;\
done;
-ifeq ($(shell ls -l *.ttf 2>/dev/null | wc -l),0)
-test: compile run-test
+ifeq ($(shell ls -l $(outdir)/*.ttf 2>/dev/null | wc -l),0)
+test: ttf run-test
else
test: run-test
endif
@@ -39,7 +41,7 @@ endif
run-test:
@for font in `echo ${fonts}`; do \
echo "Testing font $${font}";\
- hb-view $${font}.ttf --font-size 14 --margin 100 --line-space 1.5 --foreground=333333 --text-file tests/tests.txt --output-file tests/$${font}.pdf;\
+ hb-view $(outdir)/$${font}.ttf --font-size 14 --margin 100 --line-space 1.5 --foreground=333333 --text-file tests/tests.txt --output-file tests/$${font}.pdf;\
done;
clean:
- @rm -rf *.otf *.ttf *.woff *.woff2 *.sfd-* tests/*.pdf
+ @rm -rf *.otf *.ttf *.woff *.woff2 *.sfd-* tests/*.pdf $(outdir)
=====================================
tools/artifacts.sh
=====================================
@@ -0,0 +1,21 @@
+cp *.conf build
+
+cd build
+rm -rf ttf otf woff woff2 *.pdf
+mkdir ttf woff woff2
+
+cp *.ttf ttf
+cp *.woff woff
+cp *.woff2 woff2
+
+tar cvf ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz *.conf ttf
+sha256sum ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz > ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz.sha256
+md5sum ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz > ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz.md5
+zip -j ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.zip ttf/*
+
+ln -s ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz ./${CI_PROJECT_NAME}_LATEST.tar.gz
+ln -s ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz.sha256 ./${CI_PROJECT_NAME}_LATEST.tar.gz.sha256
+ln -s ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz.md5 ./${CI_PROJECT_NAME}_LATEST.tar.gz.md5
+
+rm -rf ttf otf woff woff2 *.pdf
+rm *.conf
=====================================
tools/build.py
=====================================
@@ -92,7 +92,7 @@ def fixXAvgCharWidth(font):
font['OS/2'].xAvgCharWidth = int(round(width_sum) / count)
-def opentype(infont, type, feature, version):
+def opentype(infont, outdir, type, feature, version):
font = fontforge.open(infont)
if args.type == 'otf':
outfont = infont.replace(".sfd", ".otf")
@@ -100,6 +100,7 @@ def opentype(infont, type, feature, version):
else:
outfont = infont.replace(".sfd", ".ttf")
flags = ("opentype", "round", "omit-instructions", "dummy-dsig")
+ outfont = os.path.join(outdir, outfont)
print("Generating %s => %s" % (infont, outfont))
tmpfont = mkstemp(suffix=os.path.basename(outfont))[1]
@@ -187,8 +188,11 @@ if __name__ == "__main__":
parser.add_argument('-v', '--version', help='Version')
parser.add_argument('-f', '--feature', help='Feature file')
parser.add_argument('-t', '--type', help='Output type', default='otf')
+ parser.add_argument('-o', '--outdir', help='Output directory', default='build')
args = parser.parse_args()
+ if not os.path.exists(args.outdir):
+ os.mkdir(args.outdir)
if args.type == 'otf' or args.type == 'ttf':
- opentype(args.input, args.type, args.feature, args.version)
+ opentype(args.input, args.outdir, args.type, args.feature, args.version)
if args.type == 'woff' or args.type == 'woff2':
webfonts(args.input, args.type)
View it on GitLab: https://gitlab.com/smc/fonts/keraleeyam/compare/37256ecedc7217c7cf6be28686063b3da3ead5af...11b075fba3c24632d60609cb637e52c0cd971a24
--
View it on GitLab: https://gitlab.com/smc/fonts/keraleeyam/compare/37256ecedc7217c7cf6be28686063b3da3ead5af...11b075fba3c24632d60609cb637e52c0cd971a24
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.smc.org.in/pipermail/discuss-smc.org.in/attachments/20180623/8df63e8d/attachment-0001.html>
More information about the discuss
mailing list