summaryrefslogtreecommitdiff
path: root/fitz/res_font.c
AgeCommit message (Collapse)Author
2012-01-27Rename pdf_xref type to pdf_document.Tor Andersson
2012-01-27Whitespace fixes.Tor Andersson
2012-01-18Better handling of 'uncacheable' Type3 glyphs. Bug 692745.Robin Watts
Some Type 3 fonts contain glyphs that rely on inheriting various aspects of the graphics state from their calling code. (i.e. a glyph might use d0, then fill an area without setting a color first). While the spec is vague on this point, we believe that technically it is invalid. Previously mupdf defaulted all elements of the graphic state back when beginning to draw the glyph. This does not match what Acrobat does though, so we change the approach taken. We now watch (by use of bits in the device flags word) for the use of parts of the graphics state before it is set. If such use is detected, then we note that the glyph is 'uncacheable' and render it direct. This seems to match Acrobats behaviour.
2012-01-12Support proper XPS mitering. (And stroke fixes).Robin Watts
XPS differs from PS/PDF/etc in the way it handles miters; rather than simply converting a miter that's overly long to a bevel, it truncates it at the miter limit. As such it needs to be handled correctly. For clarity, expose new enumerated types for linejoins and linecaps, and use these throughout code. When we upgrade our freetype, we can move to using proper xps mitering in that too. Add new fz_matrix_max_expansion function to return a safer expansion value that works in the case where we scale up in one direction and down in another. In the xps path drawing code, avoid generating unnecessary linetos. Thanks to Zeniko for spotting these and providing implementations.
2012-01-12Calculate individual glyph bboxes for Type 3 fonts too.Tor Andersson
2012-01-12Fix memory leak in font->bbox_table.Tor Andersson
2012-01-11Hide glyph cache in context.Tor Andersson
2012-01-11Add glyph bbox cache.Tor Andersson
2012-01-11Calculate accurate per-glyph bounding boxes for fz_bound_text.Tor Andersson
2012-01-06Various memory leak fixes.Robin Watts
In error cases, ensure we free objects correctly. Thanks to Zeniko for finding the problems (and many of the solutions!)
2011-12-16Add fz_malloc_struct, and make code use it.Robin Watts
The new fz_malloc_struct(A,B) macro allocates sizeof(B) bytes using fz_malloc, and then passes the resultant pointer to Memento_label to label it with "B". This costs nothing in non-memento builds, but gives much nicer listings of leaked blocks when memento is enabled.
2011-12-08Stylistic changes when testing pointer values for NULL.Tor Andersson
Also: use 'cannot' instead of 'failed to' in error messages.
2011-12-08Throw exceptions for read errors.Tor Andersson
2011-12-06Move antialias levels into context.Robin Watts
In builds that support configurable layers of antialiasing, move the variables that control this into the context. This makes it possible to safely use different levels of antialiasing in different threads.
2011-11-28Move Freetype globals into context.Robin Watts
Freetype globals are not shared between threads currently - to do that we'll need to introduce a lock.
2011-10-04Move to exception handling rather than error passing throughout.Robin Watts
This frees us from passing errors back everywhere, and hence enables us to pass results back as return values. Rather than having to explicitly check for errors everywhere and bubble them, we now allow exception handling to do the work for us; the downside to this is that we no longer emit as much debugging information as we did before (though this could be put back in). For now, the debugging information we have lost has been retained in comments with 'RJW:' at the start. This code needs fuller testing, but is being committed as a work in progress.
2011-09-21Add warning context.Tor Andersson
2011-09-21Rename malloc functions for arrays (fz_calloc and fz_realloc).Tor Andersson
2011-09-21Don't thread ctx through safe fz_obj functions.Tor Andersson
2011-09-15Add context to mupdf.Robin Watts
Huge pervasive change to lots of files, adding a context for exception handling and allocation. In time we'll move more statics into there. Also fix some for(i = 0; i < function(...); i++) calls.
2011-09-14Initial import of exception handling codeRobin Watts
Import exception handling code from WSS, modified to fit into the fitz world. With this code we have 'real' fz_try/fz_catch/fz_rethrow functions, handling a fz_except type. We therefore rename the existing fz_throw/ fz_catch/fz_rethrow to be fz_error_make/fz_error_handle/fz_error_note. We don't actually use fz_try/fz_catch/fz_rethrow yet...
2011-08-06Cosmetic style fixes.Tor Andersson
2011-08-01Add support for colored Type3 glyphs (ones that use d0).Robin Watts
Detect the d0 or d1 operators by writing a bit to the new device flags word. This can then be checked by the Type3 code to create the appropriate backing pixmap. In order to know what the appropriate backing pixmap is, we pass an additional colorspace into the glyph rendering code.
2011-07-26Fix bug 692354: Horizontal white lines in images.Robin Watts
The problem is due to abutting images showing gaps between them. These gaps are due to a combination of rounding errors, and anti-aliasing effects on the edge of images. The solution is to selectively 'grid fit' images. If an image is part of a type 3 font, we do NOT want to grid fit it, as this is where the sub pixel positioning makes a huge difference. If an image is displayed with alpha, then we don't want to grid fit it (as grid fitting will tend to make the edges of images overlap by 1 pixel, and will hence produce nasty effects). Otherwise, we will grid fit; Grid fit in this sense is where we expand an image to completely fill the pixel grid that it touches (i.e. the extents for the image are expanded to pixel boundaries; no half full pixels are left around the edges). The only real change of note here is in how we detect that we are in a type 3 charproc; we add a new draw device creation function that we call in the type3 charproc case that sets a flag that the drawing functions can check.
2011-04-20Revert part of "Tweak hinting flags to freetype."Tor Andersson
FT_LOAD_TARGET_LIGHT implies the autohinter, which causes spectacular failures on DynaLab fonts. The stripped down freetype we compile with using the "thirdparty" package does not have the autohinter, which is how this bug slipped through the regression testing.
2011-04-15Tweak hinting flags to freetype.Tor Andersson
2011-04-15Use artificial italics and emboldening for substitute font.Tor Andersson
2011-04-15Use DroidSans.ttf as substitute font.Tor Andersson
2011-04-11Add triangle caps; separate start, dash and end cap styles for XPS.Tor Andersson
2011-04-08Simplify arguments to fz_new_pixmap.Tor Andersson
2011-04-08Add special case non-aa scan converter with accompanying blit functions.Tor Andersson
Also turn on font hinting when rendering non-aa text.
2011-04-07Add text antialiasing too.Robin Watts
Update the text rendering code to use the raster renderer in freetype rather than the smooth one. No change to the hinting methods used yet.
2011-04-04Le Roi est mort, vive le Roi!Tor Andersson
The run-together words are dead! Long live the underscores! The postscript inspired naming convention of using all run-together words has served us well, but it is now time for more readable code. In this commit I have also added the sed script, rename.sed, that I used to convert the source. Use it on your patches and application code.
2011-04-03xps: Plug memory leaks.Tor Andersson
2011-04-03xps: Fix bugs uncovered by QualityLogicMinBar tests.Tor Andersson
2011-02-23Revert to using fthint since we cannot rely on FreeType's trickyness ↵Tor Andersson
detection on some subset fonts.
2011-02-23Remove fthint workaround for DynaLab fonts, since that is now a part of ↵Tor Andersson
freetype.
2011-02-17Stretch glyphs for substituted fonts when stroking the same as when filling.Tor Andersson
2011-02-04Add ftsize and ftfile fields to font struct for SumatraPDF use.Tor Andersson
2011-02-02Store font data buffer in fz_font rather than in pdf_fontdesc. Fixes bug ↵Tor Andersson
where the fontdesc was evicted from cache while the font still lived on in a display list, with a now stale pointer.
2011-01-27Add fz_calloc function to check for integer overflow when allocating arrays, ↵Tor Andersson
and change the signature of fz_realloc to match.
2010-12-30Adhere to nil idiom.Sebastian Rasmussen
2010-11-28Support luminosity softmask background colors.Tor Andersson
2010-08-04Rearrange low level painting functions and add new functions for constant ↵Tor Andersson
alpha painting.
2010-07-17Remove all trailing whitespace.Tor Andersson
2010-07-17Minor edits.Tor Andersson
2010-07-17Support SMasks for general graphics (incomplete).Tor Andersson
2010-07-15Check page for transparency to install a page-level transparency group.Tor Andersson
2010-07-13Implement stroked text.Tor Andersson
2010-07-09Rearrange and merge some files in the fitz directory.Tor Andersson