Ubuntu上编译安装Freetype/Freetype-py

1.安装freetype

FreeType 2 is a software font engine that is designed to be small, efficient, highly customizable, and portable while capable of producing high-quality output (glyph images). It can be used in graphics libraries, display servers, font conversion tools, text image generation tools, and many other products as well.
官方网站:http://freetype.sourceforge.net/freetype2/index.html
安装:
1.cd ~/Downloads
2.wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.10.tar.gz
3.tar zxvf freetype-2.4.10.tar.gz
4.cd freetype-2.4.10/
5../configure
6.make
7.sudo make install


2.安装freetype-py

wget http://freetype-py.googlecode.com/files/freetype-py-0.4.1.tar.gz

tar xvzf freetype-py-0.4.1.tar.gz

cd freetype-py-0.4.1

sudo ./setup.py install

注:安装后需要重启系统后方可使用。


3.Android中的Freetype

系统版本4.2.2_r1
Freetype是字显示在屏幕上过程中的一个小阶段,看到freetype官方介绍说Android系统也使用了freetype,但是我似乎丝毫没有看到相关信息。最后在系统上亲自编译一下才探得究竟。源码位置是在./external/freetype,编译过后会产生一个静态库文件libft2.a存在obj目录下。这么说来它只是用于被其它链接而并没有最终直接放到Android系统的文件系统/system/lib中。然后以libft2为关键字搜索一下发现./frameworks/rs ./external/skia和./external/harfbuzz使用了这个库。



参考文档:Harfbuzz:複雜文字排列的好幫手

set build/lib.linux-x86_64-cpython-310/matplotlib/_version.py to '3.0.2' running build_ext building 'matplotlib.ft2font' extension /disk221/lihx/anaconda3/envs/scF/lib/python3.10/importlib/__init__.py:169: UserWarning: The NumPy module was reloaded (imported a second time). This can in some cases result in small but subtle issues and is discouraged. _bootstrap._exec(spec, module) creating build/temp.linux-x86_64-cpython-310/src /disk221/lihx/anaconda3/envs/scF/bin/x86_64-conda-linux-gnu-c++ -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /disk221/lihx/anaconda3/envs/scF/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /disk221/lihx/anaconda3/envs/scF/include -fPIC -DFREETYPE_BUILD_TYPE=system -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -I/disk221/lihx/anaconda3/envs/scF/lib/python3.10/site-packages/numpy/core/include -Iextern/agg24-svn/include -I/disk221/lihx/anaconda3/envs/scF/include -I/disk221/lihx/anaconda3/envs/scF/include/libpng16 -I/disk221/lihx/anaconda3/envs/scF/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/disk221/lihx/anaconda3/envs/scF/include/python3.10 -c src/ft2font.cpp -o build/temp.linux-x86_64-cpython-310/src/ft2font.o In file included from /disk221/lihx/anaconda3/envs/scF/include/python3.10/Python.h:36, from src/mplutils.h:33, from src/ft2font.cpp:10: /usr/include/unistd.h:1170:10: fatal error: bits/unistd_ext.h: No such file or directory 1170 | #include <bits/unistd_ext.h> | ^~~~~~~~~~~~~~~~~~~ compilation terminated. error: command '/disk221/lihx/anaconda3/envs/scF/bin/x86_64-conda-linux-gnu-c++' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for matplotlib Running setup.py clean for matplotlib Failed to build matplotlib ERROR: Failed to build installable wheels for some pyproject.toml based projects (matplotlib)
最新发布
07-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

袁保康

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值