summaryrefslogtreecommitdiff
path: root/src/cairo-cff-subset.c
AgeCommit message (Collapse)AuthorFilesLines
2010-05-16cff: Use correct glyph advance when subsetting cff fontsAdrian Johnson1-17/+21
Previously the glyph advance in font units was used for the widths in the PDF font dictionary. This only works for cff fonts that use a [0.001 0 0 0.001 0 0] font matrix.
2010-04-27Update FSF addressAndrea Canciani1-1/+1
I updated the Free Software Foundation address using the following script. for i in $(git grep Temple | cut -d: -f1 ) do sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i" done Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
2010-01-22Move _cairo_error() to a standalone headerChris Wilson1-0/+1
A pending commit will want to include some utility code from cairo and so we need to extricate the error handling from the PLT symbol hiding.
2009-01-29[cff-subset] Free ps_name.Chris Wilson1-1/+3
Ensure ps_name is freed along error paths and by the normal destructor.
2009-01-29[truetype] Initialise font_nameChris Wilson1-0/+2
Ensure the font_name is initialized to NULL.
2009-01-22Use PS font name in CFF and TrueType PDF font subsetsAdrian Johnson1-25/+45
James Cloos found that the font name in embedded fonts should be the PostScript font name (nameID=6 in the name table). http://lists.cairographics.org/archives/cairo/2008-December/015919.html
2009-01-22Factor out duplicate code in truetype and cff subsettingAdrian Johnson1-52/+8
The code for reading the font name from the name table has been moved to a new function: _cairo_truetype_read_font_name().
2009-01-02Iterate over hash table using foreach() in destructors.Chris Wilson1-10/+11
Don't use the remarkably inefficient _cairo_hash_table_random_entry() to remove all entries from the hash table!
2008-11-29Fix up a couple of likely(malloc==NULL)Chris Wilson1-2/+2
Adrian Johnson spotted that I marked a few malloc failures as likely, whoops.
2008-11-29Mark allocation failures as unlikely.Chris Wilson1-33/+33
Use the gcc likelihood annotation to indicate that allocation failures are extremely unlikely.
2008-11-29Mark if(status) as being unlikely.Chris Wilson1-104/+104
The error paths should be hit very rarely during normal operation, so mark them as being unlikely so gcc may emit better code.
2008-11-07[hash] Return lookup entry.Chris Wilson1-14/+10
Use the return value to return the result from _cairo_hash_table_lookup() (as opposed to filling an output parameter on the stack) as this (a) results in cleaner code (no strict-alias breaking pointer casts), (b) produces a smaller binary and (c) is measurably faster.
2008-10-30[cff-subset] Eliminate shadowed variable.Chris Wilson1-4/+4
Cleanup a minor -Wshadow warning.
2008-09-02Revamp the build system.Behdad Esfahbod1-0/+5
Quick summary of changes: - Move list of cairo source files out of src/Makefile.am and into src/Sources.mk, - Generate files src/Config.mk and src/Config.mk.win32 that choose the right set of source files and headers based on configured backends and features. This drastically simplifies building using other build systems. The src/Makefile.win32 file needs to be updated to reflect these changes. - Add README files to various directories, - Add toplevel HACKING file.
2008-04-04Add links to the font specifications.Chris Wilson1-0/+5
Add links to specifications for the Type1, CFF, and TrueType font file formats, provided by Adrian Johnson.
2008-03-12Define _BSD_SOURCE to enable prototypes for strdup, snprintf.Chris Wilson1-0/+1
strdup() and friends require at least _BSD_SOURCE or _XOPEN_SOURCE >= 500 to be defined for the prototypes to be included. For the time being, add the define to each source file that requires one of the BSD functions.
2008-03-04[cairo-cff-subset] Propagate error status.Chris Wilson1-22/+25
Remove duplicate _cairo_error() by ensuring that the error status is always propagated from the original error site. Note that in one case this eliminates a potential _cairo_error(CAIRO_INT_STATUS_UNSUPPORTED)!
2007-10-10[cairo-cff-subset] Propagate error status from failed append_copy().Chris Wilson1-6/+10
Add a couple of missing status checks for the result of cff_index_append_copy().
2007-10-04[cairo-cff-subset] Propagate errors and review error paths.Chris Wilson1-82/+209
Ensure that errors get duly propagated back to the caller and all locally allocated resources are freed along error paths.
2007-10-04[cairo-error] Clean up all the warnings and missing _cairo_error() calls.Chris Wilson1-76/+46
Every time we assign or return a hard-coded error status wrap that value with a call to _cairo_error(). So the idiom becomes: status = _cairo_error (CAIRO_STATUS_NO_MEMORY); or return _cairo_error (CAIRO_STATUS_INVALID_DASH); This ensures that a breakpoint placed on _cairo_error() will trigger immediately cairo detects the error.
2007-10-04[malloc/error] Add call to _cairo_error() after a failed malloc.Chris Wilson1-17/+55
Blitz all allocations to ensure that they raise a _cairo_error(CAIRO_STATUS_NO_MEMORY) on failure.
2007-09-29CFF Subetting: Fix for #10849Adrian Johnson1-1/+1
This fixes the problem Apple Preview has with viewing PDFs with CFF font subsets.
2007-08-02CFF Subsetting: fix integer encoding bugAdrian Johnson1-1/+1
Bug report at https://bugzilla.mozilla.org/show_bug.cgi?id=368668
2007-05-17CFF Subsetting: Filter out Unique ID from subsetAdrian Johnson1-0/+7
The subsetted font is not the same as the original font so it should not have the same XUID and UniqueID.
2007-04-20Add CFF CID FallbackAdrian Johnson1-0/+212
Switching to CID font embedding requires a fallback font for the case where CFF CID or TrueType CID subsetting fails. The new function _cairo_type2_charstrings_init() added to cairo-type1-fallback.c creates Type2 charstrings from glyph paths. _cairo_cff_fallback_init() in cairo-cff-subset.c wraps these charstrings in a CFF CID font.
2007-04-20Make CFF Subsetting create CID subsetsAdrian Johnson1-299/+559
OpenType/CFF fonts come in two types: CID and non CID. CFF CID font subsetting was previously disabled in cairo due 1) to the need to embed CFF CID fonts in PDF as a CID fonts and 2) there is no easy way to convert CFF CID to CFF non CID. With the switch to CID fonts cairo-cff-subset.c has been updated to subset CID fonts and to covert non CID fonts to CID. A further advantage of converting non CID CFF fonts to CID is the reduction in size due to not embedding the name of each glyph in the font subset.
2007-04-20Add support for creating CID/composite font subsetsAdrian Johnson1-7/+2
cairo-scaled-font-subsets.c now provides three functions for creating subsets: _cairo_scaled_font_subsets_create_scaled() Create a subset for each scaled font with maximum size INT_MAX. _cairo_scaled_font_subsets_create_simple() Create subsets suitable for embedding as simple fonts in PS/PDF. _cairo_scaled_font_subsets_create_composite() Create subsets suitable for embedding as composite fonts in PS/PDF. The _create_simple() and _create_composite() functions both merge scaled fonts with the same face and an outline path available into the same subset. _create_composite() has a maximum subset size of 65536 for outline fonts. Bitmap fonts have a separate subset for each scale with a maximum subset size of 256. The _create_simple() and _create_composite() functions both reserve the first glyph in the subset for the .notdef glyph. CID fonts require CID 0 to be .notdef. Update Type1, TrueType and CFF subsetting to expect glyph 0 of each subset to be the .notdef.
2007-04-10Rename ARRAY_LEN to ARRAY_LENGTHCarl Worth1-3/+3
Yet another victim in my hunt against abbreviations within cairo's implementation.
2007-03-20Define and use ARRAY_LENBehdad Esfahbod1-5/+3
2007-03-07[cairoint] Move endian-conversion routines into cairoint.hBehdad Esfahbod1-28/+0
2007-02-13CFF: Fix Visual C++ compile problemAdrian Johnson1-11/+14
Don't use structure intitialization for assigning structure values. Add a new field to cff_charset_t to point to the sids charset array instead of casting it into the data field.
2007-02-06Remove dead cff_dict_remove functionCarl Worth1-14/+0
I assume this was just a leftover that was meant to be removed earlier. If not, please feel free to bring it back again.
2007-01-28CFF Subsetting: Add charset data to embedded fontEugeniy Meshcheryakov1-1/+252
Current code for subsetting CFF fonts does not write charset information into it. According to spec this means that font have ISOAdobe charset. This charset contains only 228 names (excluding .notdef). This is not enough for subfonts with 256 glyphs and causes bugs when viewing generated PDFs.
2006-10-27Add OpenType/CFF SubsettingAdrian Johnson1-0/+1452