summaryrefslogtreecommitdiff
path: root/fitz/dev_text.c
AgeCommit message (Collapse)Author
2012-07-05Move to static inline functions from macros.Robin Watts
Instead of using macros for min/max/abs/clamp, we move to using inline functions. These are more typesafe, and should produce equivalent code on compilers that support inline (i.e. pretty much everything we care about these days). People can always do their own macro versions if they prefer.
2012-04-05Fix potential problems on malloc failure.Robin Watts
Don't reset the size of arrays until we have successfully resized them.
2012-03-19Fix typo in text device where lines would group into blocks too eagerly.Tor Andersson
The default page userspace transform changed to a top-down coordinate space, and I forgot this detail when updating the text device branch. Also remove the final block sorting pass to give preference to the original PDF text order.
2012-03-19Don't create empty spans and lines in the text device.Tor Andersson
2012-03-14Some fixes to the new text device, courtesy of Zeniko.Tor Andersson
2012-03-14Put 'lastchar' into the text device struct to remember what theTor Andersson
last character was across style changes.
2012-03-14Fix memory leaks in style sheet handling of the new text device.Tor Andersson
2012-03-13Make fz_print functions all take a FILE *.Robin Watts
Also tidy up the taking of fz_context *'s, and hide an unwanted indent param.
2012-03-13Fix building on windows.Robin Watts
Fix a couple of silly problems (one gccism, and one windows specific bug).
2012-03-13Rename some functions and accessors to be more consistent.Tor Andersson
Debug printing functions: debug -> print. Accessors: get noun attribute -> noun attribute. Find -> lookup when the returned value is not reference counted. pixmap_with_rect -> pixmap_with_bbox. We are reserving the word "find" to mean lookups that give ownership of objects to the caller. Lookup is used in other places where the ownership is not transferred, or simple values are returned. The rename is done by the sed script in scripts/rename3.sed
2012-03-12Create style sheet and group extracted text into blocks, lines and spans.Tor Andersson
2012-03-07More release tidyups.Robin Watts
Add some function documentation to fitz.h. Add fz_ prefix to runetochar, chartorune, runelen etc. Change fz_runetochar to avoid passing unnecessary pointer.
2012-03-06Split fitz.h/mupdf.h into internal/external headers.Robin Watts
Attempt to separate public API from internal functions.
2012-02-13Add locking around freetype calls.Robin Watts
We only open one instance of freetype per document. We therefore have to ensure that only 1 call to it takes place at a time. We introduce a lock for this purpose (FZ_LOCK_FREETYPE), and arrange to take/release it as required. We also update the font context so it is properly shared.
2012-02-03Be consistent about passing a fz_context in path/text/shade functions.Tor Andersson
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-11-25Merge branch 'master' into contextRobin Watts
2011-11-17Fix bug 692627: stack overflows in text handling.Robin Watts
The existing code uses recursion for text span handling. With sufficiently many chained spans we get stack overflow. Simple fixes to use a loop.
2011-09-21Add warning context.Tor Andersson
2011-09-21Rename malloc functions for arrays (fz_calloc and fz_realloc).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-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-02-23Remove fthint workaround for DynaLab fonts, since that is now a part of ↵Tor Andersson
freetype.
2011-02-18Make pdfdraw -tt output valid XML.Tor Andersson
2011-02-08Use horizontal metrics to create text boxes instead of guessing at bad ↵Tor Andersson
vertical values.
2011-02-03Various patches from SumatraPDF.Tor Andersson
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-07-26Fix bug where storage capacity of 0 or 1 was not taken care of.Sebastian Rasmussen
2010-06-26When computing advance width, use fontsize 64 instead of 1000.Sebastian Rasmussen
2010-06-24More tweaks to space insertion.Tor Andersson
2010-06-23Tweak how often spaces are inserted in dev_ext.Tor Andersson
2010-06-22Add hints flag to device struct so that the interpreter doesn't need to load ↵Tor Andersson
image resources for dev_text.
2010-06-21Put magic numbers in #defines.Tor Andersson
2010-06-21Improve newline detection heuristic in text extraction device.Tor Andersson
2010-06-21Fix ascender and descender and other metric calculations to use proper ↵Tor Andersson
scaling values.
2010-06-21Divide bbox for custom ligatures defined by one-to-many ToUnicode mappings.Tor Andersson
2010-06-21Implement searching for text within the current page.Tor Andersson
2010-06-19Floats everywhere!Tor Andersson
2010-06-17Fix a handful typos reported in bug 691398.Tor Andersson
2010-06-16Fix typo in dev_text that caused the bounding boxes to be incorrect.Tor Andersson
2010-06-05Do text extraction heuristics in device space in order to be more robust.Tor Andersson
2010-06-03Add wmode flag to text objects to support vertical writing mode in the text ↵Tor Andersson
extraction device.
2010-05-31Initialize variables, fixing potential bugs.Tor Andersson
2010-05-25Support one-to-many glyph/character mappings.Tor Andersson
2010-05-25Expand ligature presentation forms into their individual characters when ↵Tor Andersson
extracting text.
2010-05-13Various fixes to avoid relying on C99. Move definitions of variables back to ↵Robin Watts
the start of the block.
2010-05-11Accumulate text to be clipped in text render mode 7.Tor Andersson
2010-05-11Record stroked and clipped text in dev_text.Tor Andersson
2010-04-24Add font and font size information to text spans.Tor Andersson
2010-04-24Calculate bounding boxes for text in the text extraction device.Tor Andersson