FontForge 2.1.20141230 日本語対応版をArch Linuxにインストール

FontForge 2.1.20141230日本語対応版をLinuxにインストールします。


Arch Linuxなら最新パッケージが使えると思っていましたが2015-02-22現在、ArchLinuxのFontForgeは2014-11-26版を使うようになっています。最新安定版パッケージは2014-12-30なのでそちらを使ってパッケージを作るように修正します。


f:id:itouhiro:20150224190326p:plain


基本は
FontForge 2.0.20140101 日本語対応版をArch Linuxにインストール - itouhiroはてなブログ
と同じです。


https://wiki.archlinux.org/index.php/Arch_Build_System_%28%E6%97%A5%E6%9C%AC%E8%AA%9E%29#.E3.83.84.E3.83.BC.E3.83.AB.E3.81.AE.E3.82.A4.E3.83.B3.E3.82.B9.E3.83.88.E3.83.BC.E3.83.AB
のabsについても参考にします。

# pacman -Q base-devel
# pacman -S base-devel

# pacman -S abs
# abs


このあとはrootではなく、一般ユーザーで実行します。

$ mkdir ~/abs
$ cp -pr /var/abs/extra/fontforge ~/abs/
$ cd ~/abs/fontforge/


日本語パッチの準備
http://www.geocities.jp/meir000/fontforge/ の日本語縦書きパッチを取得。

$ wget http://www.geocities.jp/meir000/fontforge/fontforge-20150121-vmetrics.patch.txt
$ sha1sum fontforge-20150121-vmetrics.patch.txt
$ vi PKGBUILD


FontForgeのソースについても https://github.com/fontforge/fontforge/releases/ の「Source code (tar.gz)」を取得するように変更します。

$ diff -u PKGBUILD.orig PKGBUILD
--- PKGBUILD.orig       2015-02-22 08:05:28.261224392 +0900
+++ PKGBUILD    2015-02-22 21:55:08.402590862 +0900
@@ -4,9 +4,10 @@
 # Contributor: William Rea <sillywilly@gmail.com>

 pkgname=fontforge
-_pkgver=2014-11-26
+_pkgver=2014-12-30
 pkgver=${_pkgver//-/}
-pkgrel=3
+pkgrel=1
 pkgdesc='Outline and bitmap font editor'
 url='http://www.fontforge.org/'
 arch=('i686' 'x86_64')
@@ -15,10 +16,15 @@
 depends=('libtool' 'libxkbui' 'libxi'
          'pango' 'giflib' 'libtiff' 'libspiro' 'libxml2' 'libspiro' 'libunicodenames' 'zeromq'
          'python2' 'desktop-file-utils' 'gtk-update-icon-cache' 'hicolor-icon-theme')
-source=("http://github.com/fontforge/fontforge/releases/download/${pkgver}/fontforge-${_pkgver}-Unix-Source.tar.gz"
-        'http://fontforge.org/cidmaps.tgz')
-sha1sums=('ecd776480a47cdcbe1b30ce275172d7d52288e77'
-          'efbc7c9d3e95159f5600dc71f9cccb370e46bb94')
+source=("https://github.com/fontforge/fontforge/archive/${pkgver}.tar.gz"
+        'http://fontforge.org/cidmaps.tgz'
+        'fontforge-20150121-vmetrics.patch.txt'
+)
+sha1sums=('62268018d4b0080f8b976943f36ecbeed5aa6c9a'
+          'efbc7c9d3e95159f5600dc71f9cccb370e46bb94'
+          'f253791023c32347511e760ebc71f318db879335'
+)

 install=install

@@ -30,6 +36,7 @@
                j=$(readlink "$i")
                ln -sf "${j/aclocal\//aclocal\/lt}" "$i"
        done
+        patch -p1 -i ../fontforge-20150121-vmetrics.patch.txt
 }

 build() {


まずは、ソースコードを展開してパッチを適用するまでが正常動作するか、を確認します。

$ man makepkg
-o, --nobuild
           Download and extract files, run the prepare() function, but do not
           build them. Useful with the --noextract option if you wish to tweak
           the files in $srcdir/ before building.


$ makepkg -s -o
==> Making package: fontforge 20141230-1 (Sun Feb 22 22:12:25 JST 2015)
==> Checking runtime dependencies...
==> Installing missing dependencies...
warning: skipping target: libspiro
resolving dependencies...
looking for conflicting packages...

Packages (7) libsodium-1.0.2-1  giflib-5.1.0-1  libspiro-1:0.2-2
             libunicodenames-1.1.0_beta1-1  libxkbui-1.0.2-5  python2-2.7.9-1
             zeromq-4.0.5-1

Total Download Size:   11.57 MiB
Total Installed Size:  75.15 MiB

:: Proceed with installation? [Y/n] Y
:: Retrieving packages ...
error: failed retrieving file 'giflib-5.1.0-1-i686.pkg.tar.xz' from ftp.tsukuba.wide.ad.jp : The requested URL returned error: 404
error: failed retrieving file 'giflib-5.1.0-1-i686.pkg.tar.xz' from mirror.gnomus.de : The requested URL returned error: 404
error: failed retrieving file 'giflib-5.1.0-1-i686.pkg.tar.xz' from archlinux.polymorf.fr : The requested URL returned error: 404
...
error: failed retrieving file 'libspiro-1:0.2-2-i686.pkg.tar.xz' from mirror.archlinux.fi : The requested URL returned error: 404
 libspiro-1:0.2-2-i686     10.4 KiB  3.38M/s 00:00 [######################] 100%
 libunicodenames-1.1...   322.6 KiB  1514K/s 00:00 [######################] 100%
 python2-2.7.9-1-i686      10.5 MiB  2.64M/s 00:04 [######################] 100%
 libsodium-1.0.2-1-i686   142.0 KiB  4.20M/s 00:00 [######################] 100%
 zeromq-4.0.5-1-i686      574.1 KiB  2.24M/s 00:00 [######################] 100%
(7/7) checking keys in keyring                     [######################] 100%
(7/7) checking package integrity                   [######################] 100%
(7/7) loading package files                        [######################] 100%
(7/7) checking for file conflicts                  [######################] 100%
(7/7) checking available disk space                [######################] 100%
(1/7) installing libxkbui                          [######################] 100%
(2/7) installing giflib                            [######################] 100%
(3/7) installing libspiro                          [######################] 100%
(4/7) installing libunicodenames                   [######################] 100%
(5/7) installing libsodium                         [######################] 100%
(6/7) installing zeromq                            [######################] 100%
(7/7) installing python2                           [######################] 100%
Optional dependencies for python2
    tk: for IDLE
    python2-setuptools
    python2-pip
==> Checking buildtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...

Packages (2) perl-error-0.17022-1  git-2.2.2-1

Total Download Size:    4.14 MiB
Total Installed Size:  26.08 MiB

:: Proceed with installation? [Y/n]
...
error: failed retrieving file 'git-2.2.2-1-i686.pkg.tar.xz' from mirrors.dotsrc.org : The requested URL returned error: 404
error: failed retrieving file 'git-2.2.2-1-i686.pkg.tar.xz' from mirror.archlinux.fi : The requested URL returned error: 404
 git-2.2.2-1-i686           4.1 MiB   483K/s 00:09 [######################] 100%
(2/2) checking keys in keyring                     [######################] 100%
(2/2) checking package integrity                   [######################] 100%
(2/2) loading package files                        [######################] 100%
(2/2) checking for file conflicts                  [######################] 100%
(2/2) checking available disk space                [######################] 100%
(1/2) installing perl-error                        [######################] 100%
(2/2) installing git                               [######################] 100%
Optional dependencies for git
    tk: gitk and git gui
    perl-libwww: git svn
    perl-term-readkey: git svn
    perl-mime-tools: git send-email
    perl-net-smtp-ssl: git send-email TLS support
    perl-authen-sasl: git send-email TLS support
    python2: various helper scripts [installed]
    subversion: git svn
    cvsps2: git cvsimport
    gnome-keyring: GNOME keyring credential helper
==> Retrieving sources...
  -> Downloading 20141230.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   129    0   129    0     0    103      0 --:--:--  0:00:01 --:--:--   103
100 23.1M    0 23.1M    0     0  1171k      0 --:--:--  0:00:20 --:--:-- 2013k
  -> Downloading cidmaps.tgz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   325  100   325    0     0    177      0  0:00:01  0:00:01 --:--:--   178
100  306k  100  306k    0     0  83759      0  0:00:03  0:00:03 --:--:--  225k
  -> Found fontforge-20150121-vmetrics.patch.txt
==> Validating source files with sha1sums...
    20141230.tar.gz ... Passed
    cidmaps.tgz ... Passed
    fontforge-20150121-vmetrics.patch.txt ... Passed
==> Extracting sources...
  -> Extracting 20141230.tar.gz with bsdtar
  -> Extracting cidmaps.tgz with bsdtar
==> Starting prepare()...
patching file fontforge/splinechar.c
patching file fontforge/splinefont.c
patching file fontforge/tottfgpos.c
patching file fontforgeexe/charview.c
patching file fontforgeexe/cvpointer.c
==> Sources are ready.

縦書きパッチは2015-01-21のソース向けなので、この2014-12-30ソースにそのまま当たるか疑問でしたが、問題なく適用できました。

$ makepkg -s
...
make[1]: Leaving directory '/home/foo/abs/fontforge/src/fontforge-20141230'
==> Tidying install...
  -> Purging unwanted files...
  -> Removing libtool files...
  -> Removing static library files...
  -> Compressing man and info pages...
  -> Stripping unneeded symbols from binaries and libraries...
==> Creating package "fontforge"...
  -> Generating .PKGINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: fontforge 20141230-1 (Mon Feb 23 00:26:07 JST 2015)
[foo@localhost fontforge]$

ビルドに2時間くらいかかりました。
インストール。

$ sudo pacman -U fontforge-20140101-3-i686.pkg.tar.xz


f:id:itouhiro:20150224190309p:plain


うーん、UserInterfaceのフォントにSource Han Sansを使うとなんだかずれて見えます。

実際には

と使い分けているので私としては問題ないです。
 



 

Fontforge

Fontforge