mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-27 00:50:25 +01:00
read-only mirror of https://gitlab.freedesktop.org/cairo/cairo
Bug 15348 references the following PDF that was printing incorrectly when running through poppler and cairo to generate PostScript. http://launchpadlibrarian.net/12921700/UbuntuDesktop.pdf The PostScript output had too much space between each word causing strings of glyphs printed with the TJ operator to overlap. The original PDF file contains an CFF font with CID Identity-H encoding. The PDF file is using character code 0 (glyph 0 due to Identity-H encoding) as a space character. The CFF specification defines glyph 0 to be the .notdef glyph. The PS backend subsets CFF fonts as a Type1-fallback font. Type1-fallback creates it's own empty .notdef glyph with an arbitrary glyph advance of 500. The problem here is the TJ operator used to output the glyphs depends on the glyph advance being correct. pdf-operators.c uses the glyph advance returned by _scaled_glyph_init(). However the PostScript interpreter sees the glyph advance of 500 for .notdef. This problem does not occur when generating PDF as the PDF font dictionary contains an list of glyph advances that override the font metrics. Fix this by making Type1-fallback not treat .notdef as special and to create it the path and metrics obtained from _scaled_glyph_init(). As a special case, make it not fail if _scaled_glyph_init() is unable to return a path for .notdef. This was probably the reason Type1-fallback previously created it's own .notdef glyph as calling _scaled_glyph_init(_GLYPH_INFO_PATH) for glyph 0 returns CAIRO_INT_STATUS_UNSUPPORTED for some fonts. This ensures the Type1-fallback font metrics match the metrics used by pdf-operators.c to position the glyphs. This also results in the removal of some duplicated code. |
||
|---|---|---|
| boilerplate | ||
| doc | ||
| perf | ||
| src | ||
| test | ||
| util | ||
| .gitignore | ||
| acinclude.m4 | ||
| AUTHORS | ||
| autogen.sh | ||
| BIBLIOGRAPHY | ||
| BUGS | ||
| ChangeLog.mk | ||
| CODING_STYLE | ||
| configure.in | ||
| COPYING | ||
| COPYING-LGPL-2.1 | ||
| COPYING-MPL-1.1 | ||
| gtk-doc.make | ||
| INSTALL | ||
| Makefile.am | ||
| Makefile.win32 | ||
| NEWS | ||
| PORTING_GUIDE | ||
| README | ||
| RELEASING | ||
Cairo - Multi-platform 2D graphics library http://cairographics.org What is cairo ============= Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System, win32, and image buffers, as well as PDF, PostScript, and SVG file output. Experimental backends include OpenGL (through glitz), Quartz, XCB, BeOS, OS/2, and DirectFB. Cairo is designed to produce consistent output on all output media while taking advantage of display hardware acceleration when available (for example, through the X Render Extension). The cairo API provides operations similar to the drawing operators of PostScript and PDF. Operations in cairo include stroking and filling cubic Bézier splines, transforming and compositing translucent images, and antialiased text rendering. All drawing operations can be transformed by any affine transformation (scale, rotation, shear, etc.). Cairo has been designed to let you draw anything you want in a modern 2D graphical user interface. At the same time, the cairo API has been designed to be as fun and easy to learn as possible. If you're not having fun while programming with cairo, then we have failed somewhere---let us know and we'll try to fix it next time around. Cairo is free software and is available to be redistributed and/or modified under the terms of either the GNU Lesser General Public License (LGPL) version 2.1 or the Mozilla Public License (MPL) version 1.1. Where to get more information about cairo ========================================= The primary source of information about cairo is: http://cairographics.org/ The latest versions of cairo can always be found at: http://cairographics.org/download Documentation on using cairo and frequently-asked questions: http://cairographics.org/documentation http://cairographics.org/FAQ Mailing lists for contacting cairo users and developers: http://cairographics.org/lists Roadmap and unscheduled things to do, (please feel free to help out): http://cairographics.org/roadmap http://cairographics.org/todo Compiling ========= See the INSTALL document for build instructions. History ======= Cairo was originally developed by Carl Worth <cworth@cworth.org> and Keith Packard <keithp@keithp.com>. Many thanks are due to Lyle Ramshaw without whose patient help our ignorance would be much more apparent. Since the original development, many more people have contributed to cairo. See the AUTHORS files for as complete a list as we've been able to compile so far.