Ebrahim Byagowi | 5f7f0bf | 2018-03-29 04:22:53 +0430 | [diff] [blame] | 1 | For the development of HarfBuzz, the Microsoft shaping technology, Uniscribe, |
| 2 | as a widely used and tested shaper is used as more-or-less OpenType reference |
| 3 | implemenetation and that specially is important where OpenType specification |
| 4 | is or wasn't that clear. For having access to Uniscribe on Linux/macOS these |
| 5 | steps are recommended: |
| 6 | |
| 7 | 1. Install Wine from your favorite package manager. |
| 8 | |
| 9 | 2. And `mingw-w64` compiler. |
| 10 | With `brew` on macOS, you can have it like `brew install mingw-w64` |
| 11 | |
| 12 | 3. Download and put [this](https://drive.google.com/open?id=0B3_fQkxDZZXXbWltRGd5bjVrUDQ) |
| 13 | on your `~/.local/i686-w64-mingw32`. |
| 14 | |
| 15 | 4. Replace all the instances of `/home/behdad/.local/i586-mingw32msvc` |
| 16 | and `/home/behdad/.local/i686-w64-mingw32` with `<$HOME>/.local/i686-w64-mingw32` |
| 17 | on that folder. (`<$HOME>` replace it with `/home/XXX` or `/Users/XXX` on macOS) |
| 18 | |
| 19 | Probably you shouldn't replace the ones are inside binaries. |
| 20 | |
| 21 | 5. `NOCONFIGURE=1 ./autogen.sh && mkdir winbuild && cd winbuild` |
| 22 | |
| 23 | 6. `../mingw32.sh --with-uniscribe && cd ..` |
| 24 | |
| 25 | 7. `make -Cwinbuild` |
| 26 | |
| 27 | Now you can use hb-shape using `wine winbuild/util/hb-shape.exe` but if you like to |
| 28 | to use the original Uniscribe, |
| 29 | |
| 30 | 8. Bring a 32bit version of `usp10.dll` for youself from `C:\Windows\SysWOW64\usp10.dll` of your |
| 31 | Windows installation (asuming you have a 64-bit installation, otherwise `C:\Windows\System32\usp10.dll`) |
| 32 | that it is not a DirectWrite proxy ([for more info](https://en.wikipedia.org/wiki/Uniscribe)). |
| 33 | Rule of thumb, your `usp10.dll` should have a size more than 500kb, otherwise |
| 34 | it is designed to work with DirectWrite which Wine can't work with its original one. |
| 35 | |
| 36 | Put the dll on the folder you are going to run the next command, |
| 37 | |
| 38 | 9. `WINEDLLOVERRIDES="usp10=n" wine winbuild/util/hb-shape.exe fontname.ttf -u 0061,0062,0063 --shaper=uniscribe` |
| 39 | |
| 40 | (`0061,0062,0063` means `abc`, use test/shaping/hb-unicode-decode to generate ones you need) |