sebschub / FontPro

LaTeX support for Adobe's Pro opentype fonts: Minion Pro, Myriad Pro, Cronos Pro and possibly more
226 stars 42 forks source link

Install script uses the wrong 'enc' directory #26

Closed alexleach closed 11 years ago

alexleach commented 11 years ago

When running ./scripts/install ${pkgdir}/usr/share/texmf, I get the error:-

cp: cannot stat ‘dvips/*.enc’: No such file or directory

It's a really simple fix, just replace dvips for enc, in line 34 of scripts/install..

$ git diff scripts/install
diff --git a/scripts/install b/scripts/install
index 821218c..a59ce8f 100755
--- a/scripts/install
+++ b/scripts/install
@@ -31,7 +31,7 @@ doc_dir="$dir/doc/latex/$font"
 mkdir -p "$enc_dir" "$map_dir" "$pfb_dir" "$tfm_dir" "$vf_dir" "$tex_dir" "$doc_dir"

 cp pfb/*.pfb          "$pfb_dir"
-cp dvips/*.enc        "$enc_dir"
+cp enc/*.enc          "$enc_dir"
 cp "dvips/$font.map"  "$map_dir"
 cp tex/*.{sty,cfg,fd} "$tex_dir"
sebschub commented 11 years ago

I suppose another error occurred or something went wrong because dvips is the intended folder and it always worked so far. Please re-check the process. Any errors? What is included in the enc folder? Any enc files which are not already included in the respective subfolder?

alexleach commented 11 years ago

Hiya, thanks for getting back so quickly.

There was a lot of output from makeall, which I obviously didn't pay close enough attention to...

Turns out that makeall just wasn't finding any of the font files. I thought I had MinionPro installed, but I double-checked this morning and it turns out I didn't. So I've just installed Minion Pro on this machine, reran the build and now it looks much better, with the only warnings being:

cfftot1: glyph ‘<glyph name>’: warning: complex flex hint replaced with curve
cfftot1: (This Type 2 format font contains flex hints prohibited by Type 1.
cfftot1: I’ve safely replaced them with ordinary curves.)
[...]
This is TeX, Version 3.1415926 (TeX Live 2012/Arch Linux)
(./make-<symbol name>.tex (./fontinst-macros.tex
(/usr/share/texmf-dist/tex/fontinst/base/fontinst.sty
No file fontinst.rc.
[...]
(./MinionPro-<font style>.mtx) (./adjust-oml.mtx) (./arrowhooks.mtx)
(./tie.mtx) (./mn-oml-mixed.etx) (./mn-oml-mixed.etx) (./mn-oml-mixed.etx)
(./mn-oml-mixed.etx
Warning: missing glyph `hookrightchar'.
Warning: missing glyph `hookleftchar'.
)
[...]

So generally speaking, the MinionPro build looks good. I'm not entirely sure of the differences between Type 1 and 2 format fonts, but I guess I should try to use the Type 2 font in LaTeX output... The missing glyph warnings are repeated quite a few times; I'm not exactly sure what I could do about them, though.

On the MyriadPro build, it's also not finding the fonts, but this time because the font file names are all MyriadPro_<Style>.otf. Note the use of an underscore (_) instead of a dash (-) in the file name. This results in quite a few errors, which I previously ignored, by pressing Ctrl+d at the various ? prompts (not exactly sure what program uses that prompt; latex itself, maybe). Some of the errors:-

otfinfo: otf/MyriadPro-Regular.otf: No such file or directory
[...]
otfinfo: otf/MyriadPro-Regular.otf: No such file or directory
[...] # 2 other similar errors, for It and Regular, again.
tftopl: fatal: tfm file `../tfm/MyriadPro-It-integral.tfm' not found
[...] # 3 similar errors, for It-integral-cn2, BoldIt-integral and BoldIt-integral-cn2
No file fontinst.rc.
[...]
! \install... error:
        Font/MTX file MyriadPro-It-integral not found.
[...]
?

The Myriad Pro fonts are originally from Adobe Creative Suite 5, which happens to have a lot more MyriadPro fonts than are expected, too (40).

I had a grep through the repository, and it seems that MyriadPro- is hard-coded into a lot of LaTex files, so although convert.sh will happily convert each font in otf/M*_*.otf, they're essentially useless as the installed LaTeX package won't find them.

So, I'll have to modify the command I use to find system-installed font files, which is currently:

    find /usr/share/fonts/ /usr/local/share/fonts/ -type f \
        \( -name "Minion*.otf" -o -name "Myriad*.otf" \) \
        -exec ln -sf {} ${srcdir}/${pkgname}/otf/ \;

So, apologies. These are all problems which I can resolve in the build script I've made, which I thought I might submit to the Arch User Repository, when I get it working. Arch Linux only has a package for building these fonts with the original CTAN package, from which you forked. (I successfully used that last year on Ubuntu, and am just trying to set up my new Arch Linux box similarly, but the blog article I used as reference has since been updated and now recommends FontPro; keeping everything in a single repo does make things a lot easier!)

Okay, well I've just fixed that up and now the MyriadPro fonts are actually being generated :)

I just ran this before makeall, so it could just be put into makeall, if you like..

    # replace any font names which have underscores, with dashes
    cd ${_srcdir}/otf
    for _f in M*_*.otf ; do
        # replace '_' with '-' in file name string
        _x=$(echo ${_f} | sed -e 's|_|-|')
        mv ${_f} ${_x}  # move the link
    done
    cd ..

Kind regards, Alex

alexleach commented 11 years ago

Thought I'd add that I think I should definitely reduce the number of MyriadPro fonts in use, as it seems to seriously bulk out the package.

After running:

$ scripts/makeall MinionPro
$ scripts/install ${pkgdir}/usr/share/texmf

$ scripts/makeall MyriadPro
$ scripts/install ${pkgdir}/usr/share/texmf

the package directory seems rather large:-

$ du -h pkg/
536K    pkg/FontPro/usr/share/texmf/tex/latex/MyriadPro
268K    pkg/FontPro/usr/share/texmf/tex/latex/MinionPro
808K    pkg/FontPro/usr/share/texmf/tex/latex
812K    pkg/FontPro/usr/share/texmf/tex
396K    pkg/FontPro/usr/share/texmf/doc/latex/MyriadPro
680K    pkg/FontPro/usr/share/texmf/doc/latex/MinionPro
1.1M    pkg/FontPro/usr/share/texmf/doc/latex
1.1M    pkg/FontPro/usr/share/texmf/doc
159M    pkg/FontPro/usr/share/texmf/fonts/tfm/adobe/MyriadPro
57M     pkg/FontPro/usr/share/texmf/fonts/tfm/adobe/MinionPro
216M    pkg/FontPro/usr/share/texmf/fonts/tfm/adobe
216M    pkg/FontPro/usr/share/texmf/fonts/tfm
25M     pkg/FontPro/usr/share/texmf/fonts/vf/adobe/MyriadPro
5.3M    pkg/FontPro/usr/share/texmf/fonts/vf/adobe/MinionPro
30M     pkg/FontPro/usr/share/texmf/fonts/vf/adobe
30M     pkg/FontPro/usr/share/texmf/fonts/vf
656K    pkg/FontPro/usr/share/texmf/fonts/map/dvips/MyriadPro
184K    pkg/FontPro/usr/share/texmf/fonts/map/dvips/MinionPro
844K    pkg/FontPro/usr/share/texmf/fonts/map/dvips
848K    pkg/FontPro/usr/share/texmf/fonts/map
888K    pkg/FontPro/usr/share/texmf/fonts/enc/dvips/MyriadPro
656K    pkg/FontPro/usr/share/texmf/fonts/enc/dvips/MinionPro
1.6M    pkg/FontPro/usr/share/texmf/fonts/enc/dvips
1.6M    pkg/FontPro/usr/share/texmf/fonts/enc
9.2M    pkg/FontPro/usr/share/texmf/fonts/type1/adobe/MyriadPro
3.7M    pkg/FontPro/usr/share/texmf/fonts/type1/adobe/MinionPro
13M     pkg/FontPro/usr/share/texmf/fonts/type1/adobe
13M     pkg/FontPro/usr/share/texmf/fonts/type1
260M    pkg/FontPro/usr/share/texmf/fonts
262M    pkg/FontPro/usr/share/texmf
262M    pkg/FontPro/usr/share
262M    pkg/FontPro/usr
264M    pkg/FontPro
264M    pkg/

Do you know how much space these two fonts normally require?

KR, Alex