Age | Commit message (Collapse) | Author |
|
Make sure all fz_fonts have a ft_buffer available.
|
|
|
|
|
|
|
|
Always ignore a line break immediately after an opening tag and
before a closing tag.
|
|
|
|
|
|
The scissor argument is an optional (potentially NULL) rectangle
that can give hints to devices about the area that can be scissored.
This is used by the draw device and display list device to minimize
the size of temporary clip mask buffers.
The scissor rectangle, if used, must have been transformed by the
current transform matrix.
|
|
|
|
Extraneous explicit type casts can mask errors, especially if a
function prototype or return value changes in the future.
|
|
Image objects are immutable and opaque once constructed.
Therefore there is no need for the const keyword.
|
|
Shading objects are immutable and opaque once constructed.
Therefore there is no need for the const keyword.
|
|
Match naming of fz_moveto/lineto etc for paths.
|
|
We compile with -Wno-unused-parameters instead.
|
|
Don't just cast an enum to another.
|
|
The PCL monochrome output code was unfinished. This now produces
PCL accepted by ghostpcl for ljet4 and dj500 presets at least.
|
|
Writing individual bytes using fwrite is VERY slow (profile of debug
code shows 93% of runtime is in system fwrite). Fix this by collating
into a buffer and writing (now 2.5%).
|
|
|
|
Use putc for single byte writes instead of fwrite.
|
|
Use the flags when selecting a fallback font.
|
|
fz_fonts gain a 'shaper' field that will be filled in as
required. Use a void * rather than an hb_font_t to avoid
polluting top level include space.
Harfbuff handles mirroring for us, so lose the 'mirror'
fields. This simplifies our wrappers around the 'standard'
bidi code in that we don't need to split fragments upon
mirroring.
We do need to split our fragments at script changes though
as harfbuzz only operates on a single font at a time.
Update the html flow structure so that each flow node contains
details of the the direction specified for it in the markup,
the language specified for it in the markup and the script
detected by the bidi code.
Get the bidi code to pass out the script for each fragment
as part of the callback and populate that field in the node.
Ensure that we pass in the markup direction to the bidi
splitting code as the 'base' direction.
When feeding the bidi code, rather than feeding it paragraphs
at a time, break those paragraphs if different parts of them
have different marked up directions.
|
|
Thanks to Simon Reinhardt for these.
|
|
Take on a (slightly tweaked) version of Simon Reinhardt's
patch.
The actual logic is left entirely unchanged; minor changes
have been made to the names of functions/types to avoid
clashing in the cmapdump.c repeated inclusion.
Currently this should really only affect xps files, as strtof
is only used as fz_atof, and that's (effectively) all xps for
now.
I will look at updating lex_number to call this in future.
|
|
Because of a shortcoming in harfbuzz, we can't easily force
all its allocations through our allocators.
We fudge it, with the addition of some macros to change
malloc/free/calloc into hb_malloc/hb_free/hb_calloc. To
prevent thread safety issues, we use our freetype lock
around calls to harfbuzz.
We stash the current context in a static var.
|
|
|
|
Look up fallback fonts by unicode script, with a flag to select the serif or
sans-serif font style where such variants exist.
Move all builtin fonts into fitz namespace.
|
|
MSVC doesn't understand %04X. Use %04x instead.
|
|
Note: font->fallback is not reference counted here. The fallback
mechanism is probably going to have to change when we add text shaping.
|
|
It's an opaque immutable structure, that we don't expect to ever want
to change after creation. Therefore the const keyword is not useful,
and is only line noise.
|
|
fz_encode_character_with_fallback finds the first font in the fallback
chain that has the glyph encoded, and if none do then try to encode
a bullet character.
|
|
The font is an immutable opaque structure, no need to add the const
keyword since users aren't expected or expecting to change it.
|
|
|
|
Make the import follow mupdf style (better, if not perfect).
Use ucdn where possible to avoid duplicating tables.
Shrink the types, make them explicit (e.g. use fz_bidi_level rather
than int) and make tables const.
Use 32-bit integers for text.
|
|
After we parse html text from an ebook run it through the
unicode bidirectional algorithm to determine the directionality
of each fragment. This may require splitting of fragments.
Currently we don't do anything with this information.
|
|
|
|
Forgot these in my previous pass.
|
|
Use a pointer to the top error stack slot instead of access via
array and index. Return the stack slot from fz_push_try.
|
|
In general, we should use 'const fz_blah' in device calls whenever
the callee should not alter the fz_blah.
Push this through. This shows up various places where we fz_keep
and fz_drop these const things.
I've updated the fz_keep and fz_drops with appropriate casts
to remove the consts. We may need to do the union dance to avoid
the consts for some compilers, but will only do that if required.
I think this is nicer overall, even allowing for the const<->no const
problems.
|
|
|
|
It's slower, but will work for CJK fonts as well.
|
|
|
|
|
|
stm.avail_out is only set if !only_metadata.
Reverse the order of the if tests to silence valgrind.
|
|
|
|
Add a caching table for the lower planes of unicode, which cover the
latin, greek, cyrillic, hebrew and arabic scripts.
|
|
|
|
|
|
|
|
|
|
During pdf_save_document the main performance bottleneck is the formatting
of floats to decimal ASCII representations in fz_ftoa.
Fix this by using the Grisu2 algorithm, the fastest known algorithm for
accurate printing of IEEE floating point numbers while minimizing the number
of produced decimal digits.
This requires no libc support, only integer arithmetic.
|