Generated by GPT-5-mini| libgxps | |
|---|---|
| Name | libgxps |
| Title | libgxps |
| Developer | GNOME Project |
| Released | 2008 |
| Programming language | C (programming language) |
| Operating system | Linux, FreeBSD, NetBSD, OpenBSD, Microsoft Windows |
| Platform | GTK+, GObject |
| License | GNU Lesser General Public License |
libgxps
libgxps is a lightweight C library implementing rendering and parsing of the XPS (XML Paper Specification) document format. It provides facilities for reading, inspecting, and rendering XPS packages and serves as a core component for several GNOME Project applications and third-party viewers. Designed for portability and integration with GTK+ and GObject-based toolchains, libgxps emphasizes faithful fidelity to XPS semantics and interoperability with common desktop ecosystems such as Linux, FreeBSD, and Microsoft Windows.
libgxps implements the XPS document model as defined by the ECMA-376 and related ISO/IEC specifications, mapping document parts such as fixed documents, fixed pages, and resources into an accessible API. The library focuses on parsing the ZIP-based Open Packaging Convention used by XPS, interpreting XML markup for documents, and producing vector and image output suitable for compositor backends including Cairo (graphics) and Skia (graphics library). libgxps is often used alongside toolkits like GTK+, toolchains such as Meson (software), and desktop environments like GNOME.
libgxps provides a suite of features tailored for XPS handling and rendering. It supports reading and navigating XPS packages using the Open Packaging Conventions derived from Office Open XML practices and exposes structures for fixed documents, fixed pages, and resource dictionaries. Rendering backends allow output to Cairo (graphics), enabling integration with windowing systems like Wayland and X.Org Server. Image decoding support connects with libraries such as libpng, libjpeg, and FreeType for font handling. Additional capabilities include text extraction useful for indexing by projects like Tracker (software), metadata access compatible with Dublin Core conventions, and printing integration with CUPS.
Development of libgxps began within the ecosystem surrounding the GNOME Project as a response to the need for native XPS support on free desktop platforms. Early work drew on specifications from Microsoft and standardization bodies such as ECMA International. Contributors from organizations involved with GNOME Foundation and independent developers iteratively refined parsing logic to address corner cases in XPS packages produced by tools like Microsoft Office and Adobe Systems converters. Over time, integration with build systems transitioned from autotools to Meson (software), reflecting broader GNOME Project modernization efforts. The project has interacted with related initiatives such as Poppler and MuPDF in discussions about document format support.
The architecture of libgxps centers on modular components that map XPS constructs to runtime objects. Core components include a package reader for ZIP-based containers, an XML parser layer typically implemented atop libxml2, and a rendering abstraction that targets backends like Cairo (graphics) and platform-specific surfaces. Resource management subsystems handle images, fonts, and brushes; text layout leverages font rasterization via FreeType and shaping engines related to Harfbuzz. The library exposes GObject-based types enabling language bindings for projects using GObject Introspection and interoperability with languages such as Python (programming language) through projects like PyGObject.
libgxps offers a C API following GObject conventions for object creation, reference counting, and signal emission. Typical usage flows include opening an XPS package, enumerating fixed documents and pages, and invoking render routines to draw pages onto a target surface backed by Cairo (graphics). The API provides accessors for page dimensions, resource lookup, and text extraction, facilitating usage in document viewers, thumbnail generators, and printing pipelines that interact with CUPS. Language bindings created via GObject Introspection enable integration with environments such as GNOME Shell extensions and applications built with GTK+.
libgxps is integrated into a variety of desktop and server-side applications. On GNOME Project desktops, viewers and document utilities use libgxps to display XPS documents in file managers like Nautilus (software) and viewer front-ends similar to Evince. Thumbnail and search indexing subsystems such as Tracker (software) can leverage libgxps for metadata extraction and preview generation. Print dialog implementations that communicate with CUPS may use libgxps to rasterize pages for printers. Third-party projects on platforms including FreeBSD and OpenBSD package libgxps for use in document processing pipelines and remote rendering services.
libgxps is released under the GNU Lesser General Public License (LGPL), permitting linking from proprietary and open-source applications while preserving compatibility with the GNOME Project ecosystem. Source distribution is commonly managed via project hosting and distribution channels used by GNOME and Linux distributions such as Debian, Fedora, Arch Linux, and Ubuntu. Binary packaging for BSD systems is available through ports collections maintained by FreeBSD and OpenBSD maintainers. The LGPL licensing model has facilitated adoption by both libre projects and commercial software that require XPS support.
Category:GNOME libraries