You can see the following
- Want to install FreeType
Table of contents
Reference
- FreeType Official Site: https://www.freetype.org/
Install FreeType
Configure option
--prefix | The installation path |
---|---|
--enable-freetype-config | Install freetype-config |
For CentOS / Ubuntu / MacOS
※ When installing version 2.10.1
console
> cd /usr/local/src > sudo wget https://download.savannah.gnu.org/releases/freetype/freetype-2.10.1.tar.gz > sudo tar xvfz freetype-2.10.1.tar.gz > cd freetype-2.10.1 > sudo ./configure --prefix=/usr/local/freetype/2_10_1 --enable-freetype-config > sudo make > sudo make install
Create Symbolic Link
Create installed libraries to under "/usr/local" by symbolic link.
※ When installing version 2.10.1
console
// /usr/local/bin > sudo ln -s /usr/local/freetype/2_10_1/bin/freetype-config /usr/local/bin/ // /usr/local/include > sudo ln -s /usr/local/freetype/2_10_1/include/freetype2 /usr/local/include/ // /usr/local/lib > sudo ln -s /usr/local/freetype/2_10_1/lib/libfreetype.a /usr/local/lib/ > sudo ln -s /usr/local/freetype/2_10_1/lib/libfreetype.la /usr/local/lib/ > sudo ln -s /usr/local/freetype/2_10_1/lib/libfreetype.so /usr/local/lib/ > sudo ln -s /usr/local/freetype/2_10_1/lib/libfreetype.so.6 /usr/local/lib/ > sudo ln -s /usr/local/freetype/2_10_1/lib/libfreetype.so.6.17.1 /usr/local/lib/ // /usr/local/lib/pkgconfig > sudo ln -s /usr/local/freetype/2_10_1/lib/pkgconfig/freetype2.pc /usr/local/lib/pkgconfig/
Set Environment Variable
Setting LD_LIBRARY_PATH and PKG_CONFIG_PATH variables is useful when building or executing other sources.
When copying or creating a symbolic link the library installed under /usr/local, it is recommended to set it.
console
> vim ~/.bash_profile
※ For CentOS / Ubuntu
.bash_profile
... export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH ...
If you want to load shared libraries in the system, create a file which is wrote "/usr/local/lib" under /etc/ld.so.conf.d.
console
> sudo echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf > sudo ldconfig > sudo ldconfig -v
Error Handling
fatal error: hb-ft.h: No such file or directory
Need to install HarfBuzz compled FreeType.
Install HarfBuzz From Source