# Here's a Standalone Cairo DLL for Windows

DevFeed: [Here's a Standalone Cairo DLL for Windows](<https://devfeed.tech/articles/here-s-a-standalone-cairo-dll-for-windows-21010.md>)

Original publisher: [Read original article](<https://preshing.com/20170529/heres-a-standalone-cairo-dll-for-windows>)

Author: Jeff Preshing

Published: 2017-05-29T10:22:00Z

Content type: article

Language: en

Sources: [Jeff Preshing](<https://devfeed.tech/sources/jeff-preshing.md>)

Topics: [Library](<https://devfeed.tech/topics/library.md>), [C](<https://devfeed.tech/topics/c.md>), [Windows](<https://devfeed.tech/topics/windows.md>), [MSVC](<https://devfeed.tech/topics/msvc.md>), [CMake](<https://devfeed.tech/topics/cmake.md>), [GitHub](<https://devfeed.tech/topics/github.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [x86](<https://devfeed.tech/topics/x86.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [macOS](<https://devfeed.tech/topics/macos.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [cmake](<https://devfeed.tech/tags/cmake.md>), [github](<https://devfeed.tech/tags/github.md>), [graphics](<https://devfeed.tech/tags/graphics.md>), [graphs](<https://devfeed.tech/tags/graphs.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [linux](<https://devfeed.tech/tags/linux.md>), [macos](<https://devfeed.tech/tags/macos.md>), [msvc](<https://devfeed.tech/tags/msvc.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [windows](<https://devfeed.tech/tags/windows.md>), [x86](<https://devfeed.tech/tags/x86.md>)

## AI overview

The article presents standalone Cairo DLLs for Windows, packaged with headers, import libraries, and x86/x64 binaries. The DLLs are statically linked, have no external dependencies, support MSVC applications, and use FreeType for text rendering. A GitHub build script and a CMake sample application are also provided.

## Source excerpt

Cairo is an open source C library for drawing vector graphics. I used it to create many of the diagrams and graphs on this blog. Cairo is great, but it's always been difficult to find a precompiled Windows DLL that's up-to-date and that doesn't depend on a bunch of other DLLs. I was recently unable to find such a DLL, so I wrote a script to simplify the build process for one. The script is shared on GitHub: If you just want a binary package, you can download one from the Releases page: The binary package contains Cairo header files, import libraries and DLLs for both x86 and x64. The DLLs are statically linked with their own C runtime and have no external dependencies. Since Cairo's API is pure C, these DLLs should work with any application built with any version of MSVC. I configured these DLLs to render text using FreeType because I find the quality of FreeType-rendered text better than Win32-rendered text, which Cairo normally uses by default. FreeType also supports more font formats and gives text a consistent appearance across different operating systems. Sample Application Using CMake Here's a small Cairo application to test the DLLs. It uses CMake to support multiple platforms including Windows, MacOS and Linux. Hope this helps somebody!