Skip to content

Instantly share code, notes, and snippets.

@itiut
Last active August 29, 2015 14:13
Show Gist options
  • Save itiut/2587fa8f1b72c10a4f59 to your computer and use it in GitHub Desktop.
Save itiut/2587fa8f1b72c10a4f59 to your computer and use it in GitHub Desktop.
MiguとRictyを生成してPowerlineパッチを当てる
FROM ubuntu
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install cvs fontforge git make patch python-fontforge xz-utils --no-install-recommends
RUN mkdir -p /root/migubuild/build
# Download Migu sources
WORKDIR /root/migubuild
RUN cvs -z3 -d:pserver:[email protected]:/cvsroot/mplus-fonts co mplus_outline_fonts
RUN cvs -z3 -d:pserver:[email protected]:/cvsroot/mix-mplus-ipa co mixfont-mplus-ipa
RUN xz -d mixfont-mplus-ipa/mplus_outline_fonts/mig.d/sfd.d/*.xz
RUN cp -pr mixfont-mplus-ipa/mplus_outline_fonts/mig.d mplus_outline_fonts/
# Apply patches
ADD https://gist.githubusercontent.com/itiut/09bc1e906360ca786de4/raw/5dee06ef70f78127d190f06aefe3cffd26e16b9d/build-ttf.py.patch /root/migubuild/
RUN patch -u mplus_outline_fonts/mig.d/scripts/build-ttf.py < build-ttf.py.patch
ADD https://gist.githubusercontent.com/itiut/b988b8f5aeff690cbf83/raw/29141bc4ef84504a0fa7c534389e096a8057173f/narrow-quotation-width-in-ipagothic.py /root/migubuild/
RUN python narrow-quotation-width-in-ipagothic.py mplus_outline_fonts/mig.d/sfd.d/IPAGothic-*.sfd
ADD https://gist.githubusercontent.com/itiut/0025d87c63238c8005cb/raw/17eee4980eb2bd33f43b60ad7a838574d26ec673/migu.pe.patch /root/migubuild/
RUN patch -u mplus_outline_fonts/mig.d/scripts/migu.pe < migu.pe.patch
ADD https://gist.githubusercontent.com/itiut/0025d87c63238c8005cb/raw/cd0faa75066ae4854f6b0345f1ed38308338f02b/narrow-box-drawings-width-in-ipagothic.py /root/migubuild/
RUN python narrow-box-drawings-width-in-ipagothic.py mplus_outline_fonts/mig.d/sfd.d/IPAGothic-*.sfd
# Build Migu
WORKDIR mplus_outline_fonts
RUN sh mig.d/migu_build.sh
RUN sh mig.d/migu_merge.sh
RUN cp migu-*.ttf ../build/
# Download Ricty sources
WORKDIR /root/migubuild
RUN git clone git://github.com/yascentur/Ricty.git
ADD http://levien.com/type/myfonts/Inconsolata.otf /root/migubuild/
# Build Ricty
WORKDIR build
RUN ../Ricty/ricty_generator.sh ../Inconsolata.otf migu-1m-regular.ttf migu-1m-bold.ttf
# Download Powerline font patcher
WORKDIR /root/migubuild
RUN git clone git://github.com/powerline/fontpatcher.git
# Apply Powerline font patcher to Migu1M and Ricty
WORKDIR build
RUN ../fontpatcher/scripts/powerline-fontpatcher migu-1m-*.ttf Ricty*.ttf
@itiut
Copy link
Author

itiut commented Jan 16, 2015

ホストのディレクトリをマウントして生成したフォントをコピーする。

$ docker build -t migubuild .
$ docker run -t -i -v $(pwd)/build:/build migubuild bash
# cp *.ttf /build/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment