summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-02-06Tweak text extraction block creation.Robin Watts
Better tolerate long horizontal spaces without breaking lines.
2013-02-05Android: reflow - request layout each time we learn a new page heightPaul Gardiner
2013-02-05Android: Avoid SEGV on reflow on HTC Desire HDRobin Watts
Move the one time setup of the HTMLOUT javascript interface etc into the constructor. This seems to avoid the occasional SEGV caused while flipping pages on the HTC Desire in reflow mode.
2013-02-05Android: use identity matrix in html extraction to improve font sizesPaul Gardiner
2013-02-05Android: avoid view churn in reflow modePaul Gardiner
2013-02-05Android: reflow - get zoom working againPaul Gardiner
2013-02-05Android: avoid byte[] -> String -> byte[]Paul Gardiner
2013-02-05Tweak HTML output.Robin Watts
Send blocks as paragraphs, rather than lines. Send lines as spans.
2013-02-05Android: Use HTML output in reflow mode.Robin Watts
This gets us styles.
2013-02-04Add fz_output, and make output functions use it.Robin Watts
Various functions in the code output to FILE *, when there are times we'd like them to output to other things, such as fz_buffers. Add an fz_output type, together with fz_printf to allow things to output to this.
2013-02-04Android: reset zoom on mode changePaul Gardiner
We should probably record the last scale for each mode and reenstate it when returning to that mode, but there are a few difficulties to that that need to be addressed
2013-02-04Android: alter zoom range for reflow modePaul Gardiner
2013-02-04Android: zooming in reflow mode altering CSS fontSize via javascriptPaul Gardiner
2013-02-04Android: add hooks for zooming in reflow modePaul Gardiner
2013-02-04Android: add button for reflowPaul Gardiner
2013-02-04Android: handle Unicode correctly in reflowPaul Gardiner
2013-02-03Android: first attempt at reflow modePaul Gardiner
2013-02-02Android: introduce common interface for normal and reflowed viewsPaul Gardiner
2013-02-01Android: quick and dirty conversion of text to htmlPaul Gardiner
2013-01-31Create annotations in indirect-object formPaul Gardiner
2013-01-31Android: fix buildPaul Gardiner
2013-01-31Fix missing linewidth in pdf-device-created appearance streamsPaul Gardiner
2013-01-31Android: use a single fz_page to render both main and hq bitmapsPaul Gardiner
2013-01-31Android: implement strikeout annotation creationPaul Gardiner
2013-01-31Add support for annotation creationPaul Gardiner
2013-01-30Improve exception handling in fz_bound_t3_glyphPaul Gardiner
Also simplify some other functions using pdf_dict_puts_drop
2013-01-30Parts of Robin's PDF editing/page creation commit useful for annotationsPaul Gardiner
2013-01-30Fix Android build after rect/bbox changes.Robin Watts
2013-01-30Rename fz_irect back to fz_bbox.Tor Andersson
2013-01-30Always pass value structs (rect, matrix, etc) as values not by pointer.Tor Andersson
2013-01-30Rename fz_rect_covering_rect to fz_irect_from_rect.Tor Andersson
It used to be called fz_bbox_covering_rect. It does exact rounding outwards of a rect, so that the resulting irect will always cover the entire area of the input rect. Use fz_round_rect for fuzzy rounding where near-integer values are rounded inwards.
2013-01-30Introduce fz_irect where the old fz_bbox was useful.Tor Andersson
Inside the renderer we often deal with integer sized areas, for pixmaps and scissoring regions. Use a new fz_irect type in these places.
2013-01-30Pass content/clip bbox to device functions by value.Tor Andersson
2013-01-30Eliminate fz_bbox in favor of fz_rect everywhere.Tor Andersson
2013-01-30Fix dependencies in VS solution.Robin Watts
libmupdf, libmupdf-v8 and libmupdf-nov8 were all calling generate.bat resulting in occasional build failures. As the latter 2 depend on the first, only libmupdf needs call it.
2013-01-26Android: Fix NullPointerException seen on Google PlayRobin Watts
According to Google Plays automated crash detection, we get a NullPointerException when trying to parse a null string as a Uri. This turns out to be caused by us trying to open a PDF attachment from gmail. This is because MuPDF is invoked with a content:// URL that does not have a file associated with it. Instead we can open that URL as an InputStream. Here we amend MuPDF to spot that case, and to open the InputStream, suck the data into a byteArray, and then to use that to open the file from.
2013-01-25Android: Refine Smart Motion to avoid tiny scrolls at end of pagesRobin Watts
Tor observes that when advancing down a page, it's annoying to have a tiny scroll at the end to expose the last pixel. To avoid this, he suggests making the amount we scroll dynamic; rather than always moving by 90% of the screen height, we allow ourselves to move between 80% and 95% of the screen height if it means that we'll exactly meet the end of the page. This seems to work well.
2013-01-25Silence some warnings.Tor Andersson
2013-01-25Make strdup take a const char * to silence some warnings.Tor Andersson
2013-01-25Update copyright date.Tor Andersson
2013-01-24Android: Smart Motion fix.Robin Watts
Moving backwards from the top of a zoomed out page was taking us back to the top of the previous page, not the bottom. Fixed here. Thanks to Tor for spotting this.
2013-01-24android: Tint the icon in the file picker.Tor Andersson
Use setImageResource instead of setBackgroundResource!
2013-01-24Android: Show path in file picker title.Robin Watts
Also, replace ".." with "[Up one level]".
2013-01-24Android: Implement 'Smart Motion'.Robin Watts
Currently, when the edges of the screen are tapped, we move just enough to bring the next/previous page onto the screen. When we are zoomed out, this is exactly what we want. When we are zoomed in, however, it rarely is, as 1) it doesn't allow for their being more content on the same page that we might want to view, and 2) it doesn't take us the the same region of the next page, but rather to the 'nearest edge' of the next page at the same zoom. This is particularly annoying as if we accidentally hit 'right', we can't then hit 'left' to go back to where we were. Smart Motion is an attempt to more neatly advance/retreat through the document in a logical fashion. When we are asked to 'advance', we try to advance down the page by 90% of the screen height; this will bring the next pageful of information into view, allowing for lines that might have been split over the edge of the screen before. If that would take us past the bottom of the page, we just move to the bottom of the page. If we are already at the bottom of the page, however, we consider advancing to the next 'column' of content on this page (i.e. we look to see if we have another screenful of content to the right of this one). If we do, we move to the top of the same page, at the top. If we don't, we move to the next page. When we move to the next page, we always move to the top, but our X position is chosen to match the first column of text (as calculated from the current screen position) on the next page. We assign the right hand side and bottom edges of the screen to 'advance', and the left and top edges to 'retreat'. Common use cases: * When the screen is zoomed out, left/right act precisely as they always have. * When the screen is zoomed in to avoid the margins of the page, left/right jump to the next/previous pages, with the same zoom, an improvement on the current mechanism. * When the screen is zoomed in to view a portrait file in landscape mode so that a line of text just fills the screen, left/right move nicely down the page a screenful at a time, and advances to do the same on the next page. We had no way of doing this before. * When the page is in 2 (or more) columns, and the user zooms to fit a single column in, advance nicely follows the flow across multiple pages. We had no way to do this before.
2013-01-23Bug 693520: Fix rendering of non-orthogonal gradients.Robin Watts
Jarkko Poyry(*) points out that gradients are incorrectly rendered when they aren't axis aligned. This review fixes it here using a patch inspired by both his and zenikos patch. Thanks guys. Further thanks to zeniko for spotting that it applies to the XPS code too and providing a patch. * Apologies for the lack of the accent - my editor/git gives problems with them in commit messages.
2013-01-22Bug 693527: Avoid JP2K images with themselves as their SMask.Robin Watts
Bug 693527 points out that we fail to spot Jpeg 2000 images that have themselves as their own SMask and enter an infinite loop. We extend the code by passing the forcemask parameter in exactly the same way as the non-JPEG 2K code does. Thanks to Jarkko Poyry for spotting this, reporting it, and suggesting the fix.
2013-01-22Android: Fix clipboard operation on older androids.Robin Watts
ClipboardManager changed its API at Honeycomb, AnimatorInflater only appeared at Honeycomb. Both of these are used by the clipboard code. Add fallback code to work with the older systems on older devices.
2013-01-22Android: Make the 'tap to skip page' regions more smartly sized.Robin Watts
Rather than always using 20% of the screen for the tap region (which can be excessive and confusing on a large tablet), instead try to use just the left/right inch. We do this by reading the dpi of the screen. As (apparently) some devices lie about the dpi of the screen we arrange first to always use at least 100 pixels, and then never to use more than 1/5 of the screen.
2013-01-22Android: Update clipboard icons and resize doc icons.Robin Watts
Update clipboard icons to ones that make the intent clearer (but probably aren't as pretty as I drew them). Resize doc items to be the same width as dir icons so the file list looks nicer.
2013-01-22More work on android bitmap recycling.Robin Watts
After much discussion and investigation, Paul and I have realised that we do in fact (in the current scheme at least) need to hold the existing bitmap in memory while drawing the next one (as the existing bitmap is still in an ImageView and being used for any foreground render requests). As such remove a 'setBm(null)' in drawPage. Also, in the onPostExecute for the patch redraw, we cannot recycle the bitmap in a bitmap holder due to it still potentially being in use. We therefore add a 'drop' method to the BitmapHolder class that sets the reference to null without recycling. This is not ideal, but is better than recycling too early and causing crashes.