This repository contains project and solution files for building the Cairo graphics library and its dependencies (Pixman, FreeType, libpng, zlib) for Windows using Visual Studio.
- Builds both static and dynamic libraries
- Supports Debug and Release configurations
- Compatible with x86 and x64 architectures
- Includes a fix for a memory leak related to
__cairo_win32_device
(issue #19) - Adds an additional function
void pixman_reset_static_data(void);
to clean up static Pixman data
The source code for Cairo and its dependencies is copied into the packages
folder from the following repositories and tags:
- Cairo: 1.18.4
- Pixman: pixman-0.44.2
- FreeType: VER-2-13-3
- libpng: [v1.6.47] git://git.code.sf.net/p/libpng/code
- zlib: v1.3.1
- Visual Studio (latest recommended)
- Clone the repository:
git clone https://github.com/apotocki/cairo-win.git cd cairo-win
- Open the provided Visual Studio solution (
.sln
file). - Select your desired configuration (Debug/Release) and platform (x86/x64).
- Build the solution.
This build includes a fix for a memory leak related to __cairo_win32_device
. More details can be found in issue #19.
An additional function void pixman_reset_static_data(void);
has been introduced, which can be called alongside cairo_debug_reset_static_data()
to clean up static Pixman data. Note that pixman_reset_static_data
is not declared in a header, so users must declare it manually in their code before calling it:
extern "C" void pixman_reset_static_data(void);
If you find this project useful, consider supporting my open-source development by checking out my iOS application on the App Store:
PotoHEX HEX File Viewer & Editor | |
PotoHEX allows you to inspect and edit files at the byte or character level. You can support my work by downloading the app here!
Feedback and contributions are always welcome! Feel free to open an issue or submit a pull request.
📧 Contact: Reach out via GitHub Issues or email.
Enjoy building Cairo on Windows! 🚀