summaryrefslogtreecommitdiff
path: root/source/fitz/font.c
AgeCommit message (Collapse)Author
2018-09-21Regularize language and script names.Tor Andersson
Drop the unused 'serif' argument to the CJK lookup functions. Use the BCP 47 names for CJK scripts and languages: zh-Hant for traditional Chinese, zh-Hans for simplified Chinese, ja for Japanese, ko for Korean. The lookup function also allows commonly used language+country codes: zh-TW and zh-HK for traditional Chinese, zh-CN for simplified Chinese.
2018-08-22Remove the old 'nested depth' tracking.Tor Andersson
This was used to prevent infinite cycles in the Type3 font CharProcs, but the previous commits forbids all cycles in order to prevent memory leaks due to cyclic reference counts.
2018-07-05Pass rects by value: device and document interface.Tor Andersson
2018-07-05Pass matrices by value: device and document interface.Tor Andersson
2018-07-05Pass rect and matrix by value in geometry functions.Tor Andersson
Several things irk me about passing values as const pointers: * They can be NULL, which is not a valid value. * They require explicit temporary variables for storage. * They don't compose easily in a legible manner, requiring weird pointer passing semantics where the variable being assigned is hidden as an argument in the innermost function call. * We can't change the value through the pointer, requiring yet more local variables to hold copies of the input value. In the device interface where we pass a matrix to a function, we often find ourselves making a local copy of the matrix so we can concatenate other transforms to it. This copying is a lot of unnecessary busywork that I hope to eventually avoid by laying the groundwork with this commit. This is a rather large API change, so I apologize for the inconvenience, but I hope the end result and gain in legibility will be worth the pain.
2018-06-22Remember the md5 digest in the fz_font struct.Tor Andersson
2018-06-22Cache base14 and CJK fonts.Tor Andersson
Do not cache PDF fonts, since they have custom metrics and encodings that cannot be shared. This is primarily to speed up font loading for EPUB, PDF appearance synthesis, and any other uses of default metrics and unicode encoded fonts.
2018-05-16Restore Emoji font.Tor Andersson
The Noto symbol font has been split into two. The second symbol font only contains a subset of the emojis, so reinstate the real emoji font and add both symbol fonts to the fallback chain.
2018-04-25Update Noto fonts.Tor Andersson
Import Source Han Serif 1.001. Use serif fonts in preference for sans.
2018-04-25Don't use WMode as part of CJK font lookup.Tor Andersson
Return TTC subfont index from fz_lookup_noto_font.
2018-04-25Default CJK language to traditional chinese.Tor Andersson
2018-04-25Try other CJK languages to find missing characters.Tor Andersson
2018-04-11Rework how we handle DynaLab tricky fonts in freetype.Tor Andersson
Force the face_flags to include TRICKY if we detect a DynaLab font name instead of trying to force hinting ourselves.
2018-03-16Simplify PDF font creation code.Tor Andersson
Don't create a useless pdf_font_desc when writing font resources. Simplify reference counting by using fewer intermediate variables.
2018-03-16Add simple functions to create the built-in fonts by name.Tor Andersson
2018-03-16Fix 699086: Handle freetype not returning glyph advance.Sebastian Rasmussen
2018-02-23Include a font's style in its name.Paul Gardiner
We were previously using the font's family as its name. Now if only one of family and style are defined we use that. If both are present we concatenate family and style with an intervening space, unless style already has family as a prefix, in which case we just use the style. Better would be to use the font's full name, but that is more difficult to obtain via the freetype API.
2017-11-22Warn on irretrievable glyph name.Sebastian Rasmussen
2017-10-24Look for changes to Default colorspaces in XObjects.Robin Watts
2017-10-05Avoid double literals and double math functions.Sebastian Rasmussen
2017-09-07Make sure to always drop a fz_device even upon error.Sebastian Rasmussen
2017-09-07Initialize variables to appease clang scan-build.Sebastian Rasmussen
2017-08-17Detect bold/italic by also checking the font name.Tor Andersson
2017-08-17Simplify stext structure and device.Tor Andersson
* Use pool allocator and linked lists for all levels. * Remove separate fz_stext_sheet struct. * Remove unused 'script' style. * Remove 'span' level items. * Detect visual/logical RTL layouts. * Detect indented paragraphs.
2017-08-07Set custom memory allocator for FreeType.Sebastian Rasmussen
2017-07-19Add spots to fz_pixmaps.Robin Watts
Update separations interface further to cope with whether spots should be rendered separately, or as composite colors.
2017-06-22Use unsigned char arrays in hexdumped data.Tor Andersson
2017-06-22Move rasterizer/anti-alias choices into the draw device.Robin Watts
We still use the fz_context versions as the default, but these can be overridden with draw device options.
2017-06-16Drop type 3 glyph pixmap in case of error.Sebastian Rasmussen
2017-06-15Silence warning about not building a glyph bbox table.Tor Andersson
This is very common and not a problem. Let's keep warnings for problematic things, and not use them for informational messages such as these.
2017-05-31Avoid double literals causing casts to float.Sebastian Rasmussen
2017-05-25Update Type 3 font bbox with glyph bboxes if the former is invalid.Tor Andersson
Fix for bug 697943. Set the initial replacement font bbox to the empty rectangle for type3 fonts, and let the type3 glyph loading initialize by taking the union of all glyph bboxes. Set the replacement font bbox for non-Type3 fonts to the unit rectangle. Also remove unused flag from fz_font struct.
2017-04-27Typedef function pointers consistently.Tor Andersson
2017-04-27Remove debug printing code.Tor Andersson
It's not used, so prone to bit rot. Better to purge it.
2017-04-27Include required system headers.Tor Andersson
2017-04-27Include "mupdf/ucdn.h" explicitly.Tor Andersson
2017-03-28Pass the 'serif' flag to fz_lookup_noto_font.Tor Andersson
2017-03-22Rename fz_putc/puts/printf to fz_write_*.Tor Andersson
Rename fz_write to fz_write_data. Rename fz_write_buffer_* and fz_buffer_printf to fz_append_*. Be consistent in naming: fz_write_* calls write to fz_output. fz_append_* calls append to fz_buffer. Update documentation.
2017-02-20Add fz_font_is_bold and italic functions. Use them for svg output.Tor Andersson
2017-01-23Fix fallback system callback for serif fonts.Tor Andersson
2017-01-20Add system fallback font callback.Tor Andersson
2016-11-14Make fz_buffer structure private to fitz.Robin Watts
Move the definition of the structure contents into new fitz-imp.h file. Make all code outside of fitz access the buffer through the defined API. Add a convenience API for people that want to get buffers as null terminated C strings.
2016-10-26Fix 697215: Script specific punctuation blocks.Tor Andersson
Ideographic and full-width punctuation inherit the script from the surroundings, like all other punctuation. This does not play well with our fallback font lookups. Add special cases for ideographic and fullwidth unicode blocks.
2016-10-24Fix cluster timeouts with test file.Robin Watts
tests_private/pdf/sumatra/1297_-_interpolate_at_lower_resolutions.pdf times out in the cluster. This is due to us having empty t3 glyphs defined that define d1 rectangles that are wildly different to the default font bbox. Add code to spot that t3 glyphs are empty, and to use a tiny font bbox for them. (It might be nicer to drop the empty display lists, but then this produces knock on problems further on, where non-existent display lists lead to NULL pixmaps, which lead to us think that renders failed etc).
2016-10-19Rename internal headers to follow pattern *-imp.h.Sebastian Rasmussen
2016-10-18Avoid checking argument to fz_drop_*()/fz_free().Sebastian Rasmussen
As fz_drop_*()/fz_free() all must handle NULL.
2016-10-18Remove unused luminosity.Sebastian Rasmussen
2016-10-14Drop all contexts the same way.Sebastian Rasmussen
* Handle multiple calls to fz_drop_colorspace_context() and fz_drop_font_context(). * Allow missing context in call to fz_drop_aa_context() and fz_drop_glyph_cache_context(). * Only drop font context objects when dropping the last reference. * Avoid unnecessary NULL checks.
2016-10-12Remove superfluous context null checks.Tor Andersson
Code MUST pass a non-null context to all functions. Checking ctx for null and failing silently is no more useful than segfaulting. fz_keep_imp and fz_drop_imp handle NULL pointers safely, so the NULL checks for this can also be dropped at the same time.
2016-10-07Add ctx to fz_font functions.Robin Watts