@@ -218,15 +218,17 @@ The following additional dependencies are required:
218
218
219
219
- cairo headers and import and dynamic libraries (``cairo.lib `` and
220
220
``cairo.dll ``) *with FreeType support *. Note that this excludes, in
221
- particular, the Anaconda and conda-forge builds: they do not include
221
+ particular, most Anaconda and conda-forge builds: they do not include
222
222
FreeType support.
223
223
224
- I am in fact not aware of any such build available online, with the exception
225
- of https://github.com/preshing/cairo-windows/releases; however, this specific
226
- build appears to `misrender pdfs `_. Instead, a solution is to get the
227
- headers e.g. from a Linux distribution package, the DLL from Christoph
228
- Gohlke's cairocffi _ build, and generate the import library oneself using
229
- ``dumpbin `` and ``lib ``.
224
+ The currently preferred solution is to get the headers e.g. from a Linux
225
+ distribution package, the DLL from Christoph Gohlke's cairocffi _ build, and
226
+ generate the import library oneself using ``dumpbin `` and ``lib ``.
227
+
228
+ Alternatively, very recent conda-forge builds (≥1.16.0 build 1005) do
229
+ include FreeType support. In order to use them, the include path needs to be
230
+ modified as described below. (This is currently intentionally disabled by
231
+ default to avoid confusing errors if the cairo build is too old.)
230
232
231
233
- FreeType headers and import and dynamic libraries (``freetype.lib `` and
232
234
``freetype.dll ``), which can be retrieved from
@@ -235,7 +237,6 @@ The following additional dependencies are required:
235
237
236
238
conda install -y freetype
237
239
238
- .. _misrender pdfs : https://preshing.com/20170529/heres-a-standalone-cairo-dll-for-windows/#IDComment1047546463
239
240
.. _cairocffi : https://www.lfd.uci.edu/~gohlke/pythonlibs/#cairocffi
240
241
241
242
The (standard) |CL |_ and |LINK |_ environment variables (which always get
@@ -245,14 +246,17 @@ should be set as follows::
245
246
set CL=/IC:\path\to\dir\containing\cairo.h /IC:\same\for\ft2build.h
246
247
set LINK=/LIBPATH:C:\path\to\dir\containing\cairo.lib /LIBPATH:C:\same\for\freetype.lib
247
248
249
+ In particular, in order to use a conda-forge cairo (as described above),
250
+ ``{sys.prefix}\Library\include\cairo `` needs to be added to the include path.
251
+
248
252
Moreover, we also need to find ``cairo.dll `` and ``freetype.dll `` and copy
249
253
them next to ``mplcairo ``'s extension module. As the dynamic libraries are
250
254
typically found next to import libraries, we search the ``/LIBPATH: `` entries
251
255
in the ``LINK `` environment variable and copy the first ``cairo.dll `` and
252
256
``freetype.dll `` found there.
253
257
254
258
The script ``tools/build-windows-wheel.py `` automates the retrieval of the
255
- cairo (assuming that a Gohlke cairocffi is already installed) and FreeType and
259
+ cairo (assuming that a Gohlke cairocffi is already installed) and FreeType, and
256
260
the wheel build.
257
261
258
262
.. |CL | replace :: ``CL ``
0 commit comments