Join the community today
Become a Member

Xenforo Fonttools installation for using it in Font Awesome Manager addon

Discussion in 'Forum software usage' started by Dnyan, Jun 14, 2021.

  1. Dnyan

    Dnyan Member

    106
    24
    18
    Sep 16, 2017
    Ratings:
    +36
    Local Time:
    4:43 AM
    1.17.8
    10.3.22
    I am writing this tutorial kind of post just to make help of myself in future in cases if i mess with something.

    Font Awesome Manager addon can be found at below link
    Beta - Font Awesome Manager

    First do install python 3, the instructions are well written in below article

    Sysadmin - CentOS 7 Python 2.7 will reach the end of its life on January 1st, 2020

    In case if your server GCC version is below 8 or get error while making

    make changes to below command given in above article for python installation.

    Code:
    if [[ "$(nproc)" -le '2' ]]; then time ./configure --prefix=/opt/python${python_prefixver} --with-openssl=/usr; else time ./configure --enable-optimizations --prefix=/opt/python${python_prefixver} --with-openssl=/usr; fi
    do remove

    --enable-optimizations


    so it will be

    Code:
    if [[ "$(nproc)" -le '2' ]]; then time ./configure --prefix=/opt/python${python_prefixver} --with-openssl=/usr; else time ./configure --prefix=/opt/python${python_prefixver} --with-openssl=/usr; fi
    Then do install Fonttools with following command


    Code:
    pip3 install fonttools[woff]
    Once you installed the fonttools
    Simple path to pyftsubset in above case of installation
    /home/python_projects/myproject/bin/pyftsubset

    now you can use pyftsubset in FAM.
     
  2. eva2000

    eva2000 Administrator Staff Member

    47,292
    10,700
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,625
    Local Time:
    9:13 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    FYI, you should be fine with just using Python 3.6 supported side by side with Python 2.7 on CentOS 7

    Just run the python 3.6 installer addon for Centmin Mod
    Code (Text):
    /usr/local/src/centminmod/addons/python36_install.sh

    Then you can call that version of pip via pip3.6 command
    Code (Text):
    pip3.6 install -U pip
    pip3.6 install fonttools
    pip3.6 install fonttools[woff]
    

    Code (Text):
     pip3.6 install fonttools
    WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
    Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
    To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
    Collecting fonttools
      Downloading fonttools-4.24.4-py3-none-any.whl (854 kB)
         |████████████████████████████████| 854 kB 19.9 MB/s
    Installing collected packages: fonttools
    Successfully installed fonttools-4.24.4
    WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv
    

    Code (Text):
    pip3.6 install fonttools[woff]
    WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
    Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
    To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
    Requirement already satisfied: fonttools[woff] in /usr/local/lib/python3.6/site-packages (4.24.4)
    Collecting brotli>=1.0.1
      Downloading Brotli-1.0.9-cp36-cp36m-manylinux1_x86_64.whl (357 kB)
         |████████████████████████████████| 357 kB 13.3 MB/s
    Collecting zopfli>=0.1.4
      Downloading zopfli-0.1.8-cp36-cp36m-manylinux1_x86_64.whl (41 kB)
         |████████████████████████████████| 41 kB 1.6 MB/s
    Installing collected packages: zopfli, brotli
    Successfully installed brotli-1.0.9 zopfli-0.1.8
    WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv
    

    FYI, the old script wrapper message is just telling you to change from
    Code (Text):
    pip3.6 install fonttools
    pip3.6 install fonttools[woff]
    

    to
    Code (Text):
    python3.6 -m pip install fonttools
    python3.6 -m pip install fonttools[woff]
     
  3. Chris

    Chris Premium Member Premium Member

    46
    9
    8
    Feb 27, 2015
    Ratings:
    +13
    Local Time:
    7:13 PM
    1.7
    10
    What is the path to the directory 'pyftsubset' if we follow your line @eva2000
     
  4. eva2000

    eva2000 Administrator Staff Member

    47,292
    10,700
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,625
    Local Time:
    9:13 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    tried just running
    Code (Text):
    updatedb
    locate pyftsubset


    edit, using verbose flag will show you where pyftsubset is installed too
    Code (Text):
    python3.6 -m pip install fonttools --force --verbose
    Using pip 21.2.4 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
    Collecting fonttools
      Using cached fonttools-4.26.2-py3-none-any.whl (870 kB)
    Installing collected packages: fonttools
      Attempting uninstall: fonttools
        Found existing installation: fonttools 4.26.2
        Uninstalling fonttools-4.26.2:
          Removing file or directory /usr/local/bin/fonttools
          Removing file or directory /usr/local/bin/pyftmerge
          Removing file or directory /usr/local/bin/pyftsubset
          Removing file or directory /usr/local/bin/ttx
          Removing file or directory /usr/local/lib/python3.6/site-packages/fontTools/
          Removing file or directory /usr/local/lib/python3.6/site-packages/fonttools-4.26.2.dist-info/
          Removing file or directory /usr/local/share/man/man1/ttx.1
          Successfully uninstalled fonttools-4.26.2
      changing mode of /usr/local/bin/fonttools to 775
      changing mode of /usr/local/bin/pyftmerge to 775
      changing mode of /usr/local/bin/pyftsubset to 775
      changing mode of /usr/local/bin/ttx to 775
    Successfully installed fonttools-4.26.2