blob: 76d1a8754e3f7ed6d452b91674890a7ea74e5649 [file] [log] [blame] [view]
Ebrahim Byagowi5f7f0bf2018-03-29 04:22:53 +04301For the development of HarfBuzz, the Microsoft shaping technology, Uniscribe,
2as a widely used and tested shaper is used as more-or-less OpenType reference
Bruce Mitchener257d0e52018-10-19 22:49:21 +07003implementation and that specially is important where OpenType specification
Ebrahim Byagowi5f7f0bf2018-03-29 04:22:53 +04304is or wasn't that clear. For having access to Uniscribe on Linux/macOS these
5steps are recommended:
6
Behdad Esfahbod7b716cb2019-05-25 11:37:23 -040071. Install Wine from your favorite package manager. On Fedora that's `dnf install wine`.
Ebrahim Byagowi5f7f0bf2018-03-29 04:22:53 +04308
92. And `mingw-w64` compiler.
Behdad Esfahbod7b716cb2019-05-25 11:37:23 -040010 With `brew` on macOS, you can have it like `brew install mingw-w64`.
11 On Fedora, with `dnf install mingw32-gcc-c++`, or `dnf install mingw64-gcc-c++` for the
12 64-bit Windows.
Ebrahim Byagowi5f7f0bf2018-03-29 04:22:53 +043013
Behdad Esfahbod7b716cb2019-05-25 11:37:23 -0400143. Install cross-compiled dependency packages. Alternatively see [^1] below.
15 On Fedora that would be `dnf install mingw32-glib2 mingw32-cairo mingw32-freetype`
16 for 32-bit, or `dnf install mingw64-glib2 mingw64-cairo mingw64-freetype` for 64-bit.
Ebrahim Byagowi5f7f0bf2018-03-29 04:22:53 +043017
185. `NOCONFIGURE=1 ./autogen.sh && mkdir winbuild && cd winbuild`
19
Behdad Esfahbod7b716cb2019-05-25 11:37:23 -0400206. Run `../mingw32.sh` for 32-bit build, or `../mingw64.sh` for 64-bit. This configures
21 HarfBuzz for cross-compiling. It enables Uniscribe backend as well.
Ebrahim Byagowi5f7f0bf2018-03-29 04:22:53 +043022
Behdad Esfahbod7b716cb2019-05-25 11:37:23 -0400237. `make`
Ebrahim Byagowi5f7f0bf2018-03-29 04:22:53 +043024
Behdad Esfahbod7b716cb2019-05-25 11:37:23 -040025Now you can use hb-shape using `wine util/hb-shape.exe` but if you like to shape with
26the Microsoft Uniscribe,
Ebrahim Byagowi5f7f0bf2018-03-29 04:22:53 +043027
Bruce Mitchener257d0e52018-10-19 22:49:21 +0700288. Bring a 32bit version of `usp10.dll` for yourself from `C:\Windows\SysWOW64\usp10.dll` of your
Behdad Esfahbod7b716cb2019-05-25 11:37:23 -040029 Windows installation (assuming you have a 64-bit installation, otherwise
30 `C:\Windows\System32\usp10.dll`) that it is not a DirectWrite proxy
31 ([for more info](https://en.wikipedia.org/wiki/Uniscribe)).
Ebrahim Byagowi5f7f0bf2018-03-29 04:22:53 +043032 Rule of thumb, your `usp10.dll` should have a size more than 500kb, otherwise
33 it is designed to work with DirectWrite which Wine can't work with its original one.
Behdad Esfahbod7b716cb2019-05-25 11:37:23 -040034 You want a Uniscribe from Windows 7 or older.
Ebrahim Byagowi5f7f0bf2018-03-29 04:22:53 +043035
Behdad Esfahbod7b716cb2019-05-25 11:37:23 -040036 Put the DLL in the folder you are going to run the next command,
Ebrahim Byagowi5f7f0bf2018-03-29 04:22:53 +043037
Behdad Esfahbod7b716cb2019-05-25 11:37:23 -0400389. `WINEDLLOVERRIDES="usp10=n" wine util/hb-shape.exe fontname.ttf -u 0061,0062,0063 --shaper=uniscribe`
Ebrahim Byagowi5f7f0bf2018-03-29 04:22:53 +043039
40(`0061,0062,0063` means `abc`, use test/shaping/hb-unicode-decode to generate ones you need)
Behdad Esfahbod7b716cb2019-05-25 11:37:23 -040041
42
43[^1] Download and put [this](https://drive.google.com/open?id=0B3_fQkxDZZXXbWltRGd5bjVrUDQ)
44 in your `~/.local/i686-w64-mingw32`. Then replace all the instances of
45 `/home/behdad/.local/i586-mingw32msvc` and `/home/behdad/.local/i686-w64-mingw32`
46 with `<$HOME>/.local/i686-w64-mingw32` on that folder.
47 (`<$HOME>` replace it with `/home/XXX` or `/Users/XXX` on macOS)
48 You shouldn't replace the instances of those inside binary files.