如何编译Freetype(2)和Harfbuzz(使用Visual Studio)以使其协同工作? [英] How to compile Freetype (2) and Harfbuzz (with visual studio) to make them work together?

查看:664
本文介绍了如何编译Freetype(2)和Harfbuzz(使用Visual Studio)以使其协同工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了有关编译与Harfbuzz相关的Freetype的已知问题的良好文档: http://www.gregwesselsels.com/dev/2017/05/02/freetype-harfbuzz.html 和此处 44184890

I have found good documentations on this known problem of compiling Freetype related to Harfbuzz: http://www.gregwessels.com/dev/2017/05/02/freetype-harfbuzz.html and here 44184890

但如今它们似乎已经过时了:带有harfbuzz-1.7.6的freetype-2.9

But they seem obsolet nowadays: freetype-2.9 with harfbuzz-1.7.6

这是我的编译方式:


  • 下载自由型tarball

  • 提取tarball ...
  • 打开内部版本\windows\vc2010\freetype.sln

  • 它应该已经生成好(作为dll)

  • 下载 Harfbuzz

  • extrac t压缩文件旁的freetype ...

  • 在根目录下运行 cmake ./以获得。 sln

  • 它必须已经生成好(作为lib)

  • download Freetype tarball
  • extract the tarball...
  • open builds\windows\vc2010\freetype.sln
  • it should already Generate well (as a dll)
  • download Harfbuzz
  • extract the tarball next to freetype...
  • run cmake ./ at root level to obtain a .sln
  • it must already Generate well (as lib)

此时,您有2个单独的库无法一起使用,这意味着:

At this point you have 2 separate libs not working together which means:

Freetype将无法打开字体的GSUB脚本。(或者也许我错了)

要这样做,我需要帮助!我还需要确认!!!

To do so, I need help! I also need confirmations!!!

似乎需要在编译时在Freetype中启用Harfbuzz;我发现了一个名为 FT_CONFIG_OPTION_USE_HARFBUZZ

Is seems to be needed to enable the use of Harfbuzz in Freetype at compile time; I have found a precompiler directive called FT_CONFIG_OPTION_USE_HARFBUZZ

的预编译器指令,但是在激活它时,同时使用它们会出现一些编译链接错误在第三个项目中的库:

But when activating it, I have some compile link errors when using both libs in a third project:

autofit.obj : error LNK2019: external symbol not found _hb_ft_font_create referenced in function _af_face_globals_new

很高兴知道, hb_ft_font_create 是harfbuzz中的外部函数。

Good to know, hb_ft_font_create is an extern function in harfbuzz.

所以这似乎是一个周期性的外部问题...我当然一点上都没有好的配置,但是我浏览了许多文档和帮助,发现什么都没有...

So it seems to be a cyclic extern problem... I certainly don't have the good config at a point, but I have browsed many docs and helps, found nothing...

-编辑-
在两个对象都减压后,您通常可以得到这样的树:

-- edit -- After both pojects decompression, you have normaly to obtain such a tree:

.
├── freetype-2.9
│   ├── autogen.sh
│   ├── builds
│   │   ├── ...
│   │   └── windows
│   │       └── vc2010    <<<< The .sln to use is in here
│   ├── CMakeLists.txt    <<<< It is also good to obtain proper sln
│   ├── configure
│   ├── devel
│   │   ├── ft2build.h
│   │   └── ftoption.h
│   ├── include
│   │   ├── freetype
│   │   └── ft2build.h
│   ├── ...
│   ├── objs
│   │   ├── freetype.dll
│   │   ├── freetype.lib
│   │   ├── README
│   │   └── Win32
│   ├── README
│   ├── README.git
│   └── src
└── harfbuzz-1.7.6
    ├── ...
    ├── cmake_install.cmake
    ├── CMakeLists.txt   <<<< The cmake project to obtain proper sln is this one
    ├── compile
    ├── ...
    ├── COPYING
    ├── CTestTestfile.cmake
    ├── Debug
    │   ├── harfbuzz.lib
    │   ├── harfbuzz-subset.lib
    │   └── ...
    ├── depcomp
    ├── docs
    ├── gtk-doc.make
    ├── harfbuzz.sln
    ├── harfbuzz.vcxproj
    ├── ...
    ├── main.dir
    │   └── Debug
    ├── NEWS
    ├── README
    ├── README.python
    ├── RELEASING.md
    ├── replace-enum-strings.cmake
    ├── RUN_TESTS.vcxproj
    ├── RUN_TESTS.vcxproj.filters
    ├── src
    │   ├── *.hh
    │   └── *.cc
    ├── test
    ├── THANKS
    ├── TODO
    ├── util
    └── Win32
        └── Debug


推荐答案

或者像-with-freetype = no --with-fontconfig = no 这样配置harfbuzz以避免循环延迟...我还是这么认为...

Or configure harfbuzz like --with-freetype=no --with-fontconfig=no to avoid circular deps...I think so anyway...

这篇关于如何编译Freetype(2)和Harfbuzz(使用Visual Studio)以使其协同工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆