0

Mac OS XI では、afdk (フォント変更モジュール) で使用するためにいくつかのバージョンの Python がインストールされていました。私はそれらを削除して最初からやり直すように勧められました。

.profile、.bash.profile、.profile.pysave ファイルを見ると、インストールした以前のバージョンがすべて記録されていることがわかります。最新の Python バージョンのみを使用するには、古いバージョンを削除してこれらの .bash ファイルをハックし、現在の Python バージョンの $PATH のみを保持する必要がありますか?

$ echo $PATH
/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/adrianshome/bin/FDK/Tools/osx

ありがとう、エイドリアン

したがって、ここで言及した .bash ファイルを以下に示します。

。プロフィール:

##
# DELUXE-USR-LOCAL-BIN-INSERT
# (do not remove this comment)
##
echo $PATH | grep -q -s "/usr/local/bin"
if [ $? -eq 1 ] ; then
    PATH=$PATH:/usr/local/bin
    export PATH
fi

# Setting PATH for MacPython 2.5
# The orginal version is saved in .profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"

# Setting PATH for Python 3.4
# The orginal version is saved in .profile.pysave
# Initialization for FDK command line tools.Sun Oct 14 12:28:07 2018
FDK_EXE="/Users/adrianshome/bin/FDK/Tools/osx"
PATH=${PATH}:"/Users/adrianshome/bin/FDK/Tools/osx"
export PATH
export FDK_EXE

.profile.pysave:

##
# DELUXE-USR-LOCAL-BIN-INSERT
# (do not remove this comment)
##
echo $PATH | grep -q -s "/usr/local/bin"
if [ $? -eq 1 ] ; then
    PATH=$PATH:/usr/local/bin
    export PATH
fi

# Setting PATH for MacPython 2.5
# The orginal version is saved in .profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
export PATH
# Initialization for FDK command line tools.Wed May 21 12:21:59 2008
FDK_EXE="/Users/adrianwi/bin/FDK/Tools/osx"
PATH=${PATH}:"/Users/adrianwi/bin/FDK/Tools/osx"

.bash.profile:

# Initialization for FDK command line tools.Fri Apr 10 14:12:30 2015

# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"

# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"

# Setting PATH for Python 2.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"

# Setting PATH for Python 2.7

これがPython3とAFDKモジュールをインストールした結果です...

Last login: Sun Oct 14 12:50:11 on ttys001
Adrians-iMac-2:~ adrianshome$ pip3 install --user --upgrade afdko;
Collecting afdko
  Downloading https://files.pythonhosted.org/packages/b6/d2/0ba8ccfe42b0f88b0cc2819b73d93d4ad6240285a8d9a6a1570f39b1e613/afdko-2.8.2-py2.py3-none-macosx_10_6_intel.whl (2.4MB)
    100% |████████████████████████████████| 2.4MB 543kB/s 
Collecting ufoLib~=2.3.1 (from afdko)
  Downloading https://files.pythonhosted.org/packages/b7/72/e053c7f9adc52ee7f4ac163cebef4c8d39732a79a02f9abcfdcfbca35785/ufoLib-2.3.2-py2.py3-none-any.whl (109kB)
    100% |████████████████████████████████| 112kB 525kB/s 
Collecting ufonormalizer~=0.3.5 (from afdko)
  Downloading https://files.pythonhosted.org/packages/e6/f3/cdf8d7616cde052b07f3fb83eec34a4a534965df71968cbef9f3895a31c3/ufonormalizer-0.3.5-py2.py3-none-any.whl
Collecting defcon~=0.5.3 (from afdko)
  Downloading https://files.pythonhosted.org/packages/e5/e5/7491cd6b2f5ec7ef96804f31b8c5fd4d8030d2ff7f331fc2c179ff196bfa/defcon-0.5.3-py2.py3-none-any.whl (212kB)
    100% |████████████████████████████████| 215kB 1.6MB/s 
Collecting booleanOperations~=0.8.0 (from afdko)
  Downloading https://files.pythonhosted.org/packages/bd/98/4c43398f43b023803609ac4ab46b02f10936ba501c8e53e70ee8f21d794d/booleanOperations-0.8.0-py2.py3-none-any.whl
Collecting fontTools~=3.29.1 (from afdko)
  Downloading https://files.pythonhosted.org/packages/ab/68/a583423ac2ca5dd624ca4914ee97307b4b61a83dda5e0451f0242f628f58/fonttools-3.29.1-py2.py3-none-any.whl (612kB)
    100% |████████████████████████████████| 614kB 551kB/s 
Collecting psautohint==1.8.1 (from afdko)
  Downloading https://files.pythonhosted.org/packages/50/95/4583fcdb5cca5efe32c46dfa2bab95fcf2a99f43a8fd201971b5978d4705/psautohint-1.8.1-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (377kB)
    100% |████████████████████████████████| 378kB 486kB/s 
Collecting mutatorMath~=2.1.1 (from afdko)
  Downloading https://files.pythonhosted.org/packages/01/26/6d1583731da1d236f917b6618ac342ad435eb761750f934f1fc1bfd9ae84/MutatorMath-2.1.1-py2.py3-none-any.whl
Collecting fontMath~=0.4.7 (from afdko)
  Downloading https://files.pythonhosted.org/packages/33/b2/6e4d8fd1c0c82f42961dd4e901ecf819e490a64f2abb0a7bdf5082997a4f/fontMath-0.4.7-py2.py3-none-any.whl
Collecting fontPens~=0.1.0 (from afdko)
  Downloading https://files.pythonhosted.org/packages/76/11/0ad531d40c608eb3b798bb94607b10109b4e145142fe68eda40e92b84daf/fontPens-0.1.0-py2.py3-none-any.whl
Collecting pyclipper>=1.0.5 (from booleanOperations~=0.8.0->afdko)
  Downloading https://files.pythonhosted.org/packages/a0/2f/6a75e90bfb924118bd65cc16ccd23df53db697f0df7a4dfa79c6d64913fe/pyclipper-1.1.0.post1-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (275kB)
    100% |████████████████████████████████| 276kB 510kB/s 
Installing collected packages: fontTools, ufoLib, ufonormalizer, defcon, pyclipper, booleanOperations, psautohint, fontMath, mutatorMath, fontPens, afdko
  The scripts fonttools, pyftinspect, pyftmerge, pyftsubset and ttx are installed in '/Users/adrianshome/Library/Python/3.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  The script ufonormalizer is installed in '/Users/adrianshome/Library/Python/3.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  The script psautohint is installed in '/Users/adrianshome/Library/Python/3.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  The scripts autohint, buildcff2vf, buildmasterotfs, charplot, checkoutlinesufo, comparefamily, digiplot, fontplot, fontplot2, fontsetplot, hintplot, makeinstancesufo, makeotf, otc2otf, otf2otc, stemhist, ttfcomponentizer, ttxn and waterfallplot are installed in '/Users/adrianshome/Library/Python/3.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed afdko-2.8.2 booleanOperations-0.8.0 defcon-0.5.3 fontMath-0.4.7 fontPens-0.1.0 fontTools-3.29.1 mutatorMath-2.1.1 psautohint-1.8.1 pyclipper-1.1.0.post1 ufoLib-2.3.2 ufonormalizer-0.3.5
Adrians-iMac-2:~ adrianshome$ echo $PATH
/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/adrianshome/bin/FDK/Tools/osx
Adrians-iMac-2:~ adrianshome$ 
Adrians-iMac-2:~ adrianshome$ 

更新: 11 月 2 日

とても良い説明をありがとう!Python3 を再インストールし、「pip3 install --user --upgrade afdko」を実行して、必要な fonttools モジュールを取得しました。仮想環境を作成しました。次に、「site-packages」ディレクトリにモジュールが見つからないというエラーが表示されたコード ルーチンを再度実行しました。

ttx をターミナルにドラッグします

dsig.ttx ファイルを含む「Dsig fldr」をデスクトップに作成するコードを貼り付けます。

「-m」を入力しました

「SassoInfProReg.ttf」をターミナルにドラッグします

「dsig.ttx」をターミナルにドラッグします

戻る

この結果 (コードがすべて等幅ではないことをお詫びしますか?)...

(env37) Adrians-iMac-2:Dsig fldr adrianshome$ FLDR="${HOME}/Desktop/Dsig fldr"

(env37) Adrians-iMac-2:Dsig fldr adrianshome$ mkdir -p "$FLDR" (env37) Adrians-iMac-2:Dsig fldr adrianshome$ cd "$FLDR" (env37) Adrians-iMac-2:Dsig fldr adrianshome $ 猫 > dsig.ttx<

00000001 00000000 EOF (env37) Adrians-iMac-2:Dsig fldr adrianshome$ open . (env37) Adrians-iMac-2:Dsig fldr adrianshome$ /Library/Python/3.7/bin/ttx -m /Users/adrianshome/Desktop/Dsig\ fldr/SassoInfProReg.ttf /Users/adrianshome/Desktop/Dsig\ fldr/ dsig.ttx

"/Users/adrianshome/Desktop/Dsig fldr/dsig.ttx" を "/Users/adrianshome/Desktop/Dsig fldr/dsig.ttf" にコンパイルしています... 'DSIG' テーブルを解析しています... エラー: 未処理の例外が発生しました(最新のコールが最後):

ファイル "/Users/adrianshome/Library/Python/3.7/lib/python/site-packages/fontTools/ttx.py"、398 行目、メイン プロセス (ジョブ、オプション)

ファイル「/Users/adrianshome/Library/Python/3.7/lib/python/site-packages/fontTools/ttx.py」、372 行目、処理中のアクション (入力、出力、オプション)

ファイル「/Users/adrianshome/Library/Python/3.7/lib/python/site-packages/fontTools/misc/loggingTools.py」、375 行、ラッパー return func(*args, **kwds)

ファイル "/Users/adrianshome/Library/Python/3.7/lib/python/site-packages/fontTools/ttx.py"、290 行目、ttCompile ttf.save(output) 内

ファイル "/Users/adrianshome/Library/Python/3.7/lib/python/site-packages/fontTools/ttLib/ttFont.py"、173 行目、save writer_reordersTables = self._save(tmp) 内

ファイル "/Users/adrianshome/Library/Python/3.7/lib/python/site-packages/fontTools/ttLib/ttFont.py"、212 行目、_save self._writeTable(tag, writer, done, tableCache) 内

ファイル "/Users/adrianshome/Library/Python/3.7/lib/python/site-packages/fontTools/ttLib/ttFont.py"、633 行目、_writeTable tabledata = self.getTableData(tag) 内

ファイル "/Users/adrianshome/Library/Python/3.7/lib/python/site-packages/fontTools/ttLib/ttFont.py"、651 行目、getTableData で self.tables[tag].compile(self) を返す

ファイル "/Users/adrianshome/Library/Python/3.7/lib/python/site-packages/fontTools/ttLib/tables/D_S_I_G_.py"、60 行目、コンパイル中 = sstruct.pack(DSIG_HeaderFormat, self)

ファイル "/Users/adrianshome/Library/Python/3.7/lib/python/site-packages/fontTools/misc/sstruct.py"、68 行目、パック値 = obj[name] KeyError: 'ulVersion' (env37) Adrians -iMac-2:Dsig fldr adrianshome$

4

1 に答える 1