summaryrefslogtreecommitdiff
path: root/src/sfnt/sfobjs.c
Commit message (Collapse)AuthorAgeFilesLines
* [truetype] Fix style name handling for variation fonts.dev/wl/VF-infodev/wl/VF-fixesWerner Lemberg2023-04-281-0/+11
| | | | | | | | | | | * include/freetype/internal/tttypes.h (TT_FaceRec): New field `non_var_style_name`. * src/sfnt/sfobjs.c (sfnt_load_face): Initialize `non_var_style_name`. (sfnt_done_face): Free `non_var_style_name`. * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Restore non-VF style name if switching back to non-VF mode.
* New Variation Font function `FT_Get_Default_Named_Instance`.Werner Lemberg2023-04-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/freetype/ftmm.h, src/base/ftmm.c (FT_Get_Default_Named_Instance): New function. * include/freetype/internal/services/svmm.h (FT_Get_Default_Named_Instance_Func): New typedef. (FT_Service_MultiMasters): New field `get_default_named_instance`. (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. * include/freetype/internal/tttypes.h (TT_Face): New field `var_default_named_instance`. * src/sfnt/sfobjc.s (sfnt_init_face): Initialize `var_default_named_instance`. * src/cff/cffdrivr.c (cff_get_default_named_instance): New function. (cff_service_multi_masters): Updated. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Initialize `var_default_named_instance`. (TT_Get_Default_Named_Instance): New function. * src/truetype/ttgxvar.h: Updated. * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. * src/type1/t1driver.c (t1_service_multi_masters): Updated. * docs/CHANGES: Updated.
* [sfnt, truetype] Add `size_reset` to `MetricsVariations`.Ben Wagner2023-04-111-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a generalization of commit ``` commit e6699596af5c5d6f0ae0ea06e19df87dce088df8 Author: Werner Lemberg <wl@gnu.org> Date: Thu Feb 2 11:38:04 2017 +0100 [truetype] Fix MVAR post-action handling. ``` It is also possible for plain `CFF ` style fonts to contain an `fvar` and `MVAR` table and use `cff_metrics_adjust`. `tt_size_reset` should only be called with `TT_Size` and never with `CFF_Size`. Allow the "metrics-variations" service to specify the correct function (if any) to reset `FT_Size`s after adjusting metrics. * src/truetype/ttobjs.c (tt_size_reset): Split off some functionality into... (tt_size_reset_height): ... this new function. * src/truetype/ttdriver.c (tt_service_metrics_variations): Add `size_reset`. (tt_size_select, tt_size_request): Updated. * src/truetype/ttobjs.h: Updated. * include/freetype/internal/services/svmetric.h (MetricsVariations): Add `size_reset`. (FT_DEFINE_SERVICE_METRICSVARIATIONSREC): Updated. * include/freetype/internal/tttypes.h (TT_FaceRec_): Rename `var` to `tt_var` and add `face_var`. * src/cff/cffdrivr.c (cff_service_metrics_variations): Add `size_reset`. (cff_hadvance_adjust, cff_metrics_adjust): Updated. * src/cff/cffobjs.c (cff_face_init): Use `face_var`. * src/sfnt/sfobjs.c (sfnt_init_face): Initialize `face_var`. * src/sfnt/ttmtx.c (tt_face_get_metrics): Use `tt_var`. * src/truetype/ttgxvar.c (tt_size_reset_iterator): Renamed to... (ft_size_reset_iterator): ... this new function. Call `size_reset`. (tt_apply_mvar): Pass `size_reset` to `ft_size_reset_iterator`. Fixes #1211
* * src/sfnt/sfobjs.c (sfnt_load_face): Shorten de-referencing.Alexei Podtelezhnikov2023-03-031-1/+1
|
* Update all copyright notices.Werner Lemberg2023-01-171-1/+1
|
* [sfnt] Don't require 'gvar' table to support variation fonts.Dominik Röttsches2022-09-051-7/+1
| | | | | | | | | | | | | Fixes #1172. * src/sfnt/sfobjs.c (sfnt_load_face): Tag font as Multiple Masters font if `fvar` is present; do not require other tables to be present. * src/truetype/ttgxvar.c (tt_set_mm_blend): Allow for a missing 'gvar' table when setting variation coordinates. However, if a 'gvar' table is actually present, do perform a sanity check and fail on malformedness. (TT_Get_MM_Var): Don't assume 'fvar' needs 'gvar' or 'CFF2 tables in all cases, which is an overly tight check.
* * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_COLOR` for SVG fonts.Werner Lemberg2022-04-301-1/+2
| | | | Fixes #1151.
* Add `FT_PARAM_TAG_IGNORE_SBIX`.Werner Lemberg2022-03-251-17/+35
| | | | | | | | | | | | | This is another bit to handle 'sbix' tables as described in the OpenType specification. * include/freetype/ftparams.h (FT_PARAM_TAG_IGNORE_SBIX): New macro. * src/sfnt/sfobjc.c (is_apple_sbix): Rename to... (has_sbix): ... this. Check for more sbit tables. Handle `FT_PARAM_TAG_IGNORE_SBIX` to eventually control `has_sbix`. Only call sbit table loader if an sbit table is present.
* [truetype] Fix 'sbix' table handling.Werner Lemberg2022-03-251-11/+8
| | | | | | | | | | | | | | | | | * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Correct calculation of 'metrics->horiBearingY'. Set vertical metrics. * src/sfnt/sfobjs.c (sfnt_load_face): Adjust setting of `FT_FACE_FLAG_SBIX`. Handle metrics of fonts with 'sbix' table. * src/truetype/ttgload.c (TT_Load_Glyph): For 'sbix' embedded bitmaps, apply bbox offset and bearing values of the corresponding glyph in the 'glyf' table if it exists and has a contour. * src/truetype/ttobjs.c (tt_face_init): Handle font with 'sbix' table. Fixes issue #998.
* Add `FT_FACE_FLAG_SBIX` and `FT_HAS_SBIX`.Werner Lemberg2022-03-251-0/+5
| | | | | | | | | Fonts with 'sbix' tables need special handling by the application. * include/freetype/freetype.h (FT_FACE_FLAG_SBIX, FT_HAS_SBIX): New macros. * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_SBIX` if 'sbix' table is present.
* [sfnt] Avoid invalid face index.Werner Lemberg2022-03-171-1/+1
| | | | | | | Fixes #1138. * src/sfnt/sfobjs.c (sfnt_init_face), src/sfnt/sfwoff2.c (woff2_open_font): Check `face_index` before decrementing.
* Add code to load OT-SVG glyph documents.Moazin Khatti2022-01-201-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/freetype/config/ftheader.h (FT_OTSVG_H): New macro. * include/freetype/freetype.h (FT_FACE_FLAG_SVG, FT_HAS_SVG): New macros. (FT_LOAD_SVG_ONLY): New internal macro. * include/freetype/ftimage.h (FT_Glyph_Format): New enumeration value `FT_GLYPH_FORMAT_SVG`. * include/freetype/internal/ftobjs.h (FT_GLYPH_OWN_GZIP_SVG): New macro. * include/freetype/internal/fttrace.h: Add `ttsvg` for `ttsvg.c`. * include/freetype/internal/sfnt.h(load_svg, free_svg, load_svg_doc): New functions. * include/freetype/internal/tttypes.h (TT_FaceRec): Add `svg` for the SVG table. * include/freetype/otsvg.h (FT_SVG_DocumentRec): New structure to hold the SVG document and other necessary information of an OT-SVG glyph in a glyph slot. * include/freetype/tttags.h (TTAG_SVG): New macro. * src/base/ftobjs.c: Include `otsvg.h`. (ft_glyphslot_init): Allocate `FT_SVG_DocumentRec` in `slot->other` if the SVG table exists. (ft_glyphslot_clear): Free it upon clean-up if it is a GZIP compressed glyph. (ft_glyphslot_done): Free the document data if it is a GZIP compressed glyph. (FT_Load_Glyph): Don't auto-hint SVG documents. * src/cache/ftcbasic.c (ftc_basic_family_load_glyph): Add support for FT_GLYPH_FORMAT_SVG. * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttsvg.c`. * src/sfnt/sfdriver.c: Include `ttsvg.h`. (sfnt_interface): Add `tt_face_load_svg`, `tt_face_free_svg` and `tt_face_load_svg_doc`. * src/sfnt/sfnt.c: Include `ttsvg.c`. * src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Add code to load and free data of the the SVG table. * src/sfnt/ttsvg.c: New file, implementing `tt_face_load_svg`, `tt_face_free_svg` and `tt_face_load_svg_doc`. * src/sfnt/ttsvg.h: Declarations of the SVG functions in `ttsvg.c`.
* Update all copyright notices.Werner Lemberg2022-01-111-1/+1
|
* * src/sfnt/sfobjs.c (sfnt_open_font): Fix typo.Werner Lemberg2021-11-081-1/+1
|
* [sfnt] Reduce footprint if WOFF and WOFF2 support is not needed.Werner Lemberg2021-11-081-0/+13
| | | | | | | | | | | | | | | | | | | Based on a patch from metarutaiga (MR !106). The gist of this commit is that it doesn't make sense to support WOFF without compression (which would be only possible in WOFF 1.0 anyway). * src/sfnt/sfobjs.c (sfnt_open_font): Guard WOFF code with `FT_CONFIG_OPTION_USE_ZLIB` block. Guard WOFF2 code with `FT_CONFIG_OPTION_USE_BROTLI` block. * src/sfnt/sfwoff.c, src/sfnt/sfwoff.h: Guard files with `FT_CONFIG_OPTION_USE_ZLIB` blocks, not parts of the code. * src/sfnt/sfwoff2.c, src/sfnt/sfwoff2.h, src/sfnt/woff2tags.c, src/sfnt/woff2tags.h: Guard files with `FT_CONFIG_OPTION_USE_BROTLI` blocks, not parts of the code. Fixes #1111.
* Replace boolean allocation macros with MEM ones.Alexei Podtelezhnikov2021-09-141-1/+1
| | | | | | | | | | | * src/base/ftbitmap.c (FT_Bitmap_Copy): Use MEM-macro. * src/base/ftobjs.c (ft_glyphslot_alloc_bitmap): Ditto. * src/bzip2/ftbzip2.c (ft_bzip2_alloc): Ditto. * src/cache/ftccache.c (ftc_cache_init): Ditto * src/gzip/ftgzip.c (ft_gzip_alloc): Ditto. * src/psnames/psmodule.c (ps_unicodes_init): Ditto. * src/sfnt/sfobjs.c (sfnt_load_face): Ditto. * src/sfnt/ttload.c (tt_face_load_name): Ditto.
* [bdf, psnames, sfnt] Avoid some memory zeroing.Alexei Podtelezhnikov2021-09-131-1/+1
| | | | | | * src/bdf/bdfdrivr.c (BDF_Face_Init): Use Q-macro. * src/sfnt/sfobjs.c (sfnt_load_face): Ditto. * src/psnames/psmodule.c (src/psnames/psmodule.c): Remove zero.
* [sfnt] Additional guards on the POST table.Alexei Podtelezhnikov2021-05-161-2/+3
| | | | | | | | | | | | Fixes timeout (#1055) analyzed by Ben Wagner, reported as https://crbug.com/1194092 * src/sfnt/ttload.c (tt_face_load_post): Check POST format. * src/sfnt/sfobjs.c (sfnt_load_face): Synthesize the missing unicode charmap only if the glyph names exist. * src/psnames/psmodule.c (ps_unicode_value): Short cut ".notdef" and ".null".
* * src/sfnt/sfobjs.c (sfnt_load_face): Tweak allocation macro.Alexei Podtelezhnikov2021-05-061-1/+1
|
* [sfnt] Avoid some memory zeroing.Alexei Podtelezhnikov2021-05-011-6/+6
| | | | | | * src/sfnt/sfobjs.c (sfnt_open_font, sfnt_init_face, tt_name_ascii_from_{utf16,other}): Tweak allocaton macros. * src/sfnt/ttload.c (tt_face_load_name): Ditto.
* * src/sfnt/sfobjs.c (sfnt_init_face): Revert macro change.Alexei Podtelezhnikov2021-04-261-2/+2
|
* [sfnt] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.Alexei Podtelezhnikov2021-04-231-2/+2
| | | | | | | | * src/sfnt/sfdriver.c (get_win_string, get_apple_string, sfnt_get_var_ps_name): Do not zero out the buffer. * src/sfnt/sfobjs.c (sfnt_init_face): Ditto. * src/sfnt/sfwoff.c (woff_open_font): Ditto. * src/sfnt/sfwoff2.c (woff2_open_font): Ditto.
* Update all copyright notices.Werner Lemberg2021-01-171-1/+1
|
* * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`.Werner Lemberg2020-12-051-1/+2
| | | | | This ensures good logging output, with all lines having a proper prefix (if requested).
* Fix `-Wformat' compiler warnings.Priyesh Kumar2020-07-281-3/+3
| | | | | | * src/*: Fix format specifiers. * builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
* Remove redundant inclusion of `ft2build.h'.Werner Lemberg2020-06-131-1/+0
| | | | | | | * */*: Remove `#include <ft2build.h>' where possible. * include/freetype/freetype.h: Remove cpp error about missing inclusion of `ft2build.h'.
* Make macros for header file names optional.David Turner2020-06-081-8/+8
| | | | | | | | | | | | | | | | | We no longer have to take care of the 8.3 file name limit; this allows us (a) to introduce longer, meaningful file names, and (b) to avoid macro names in `#include' lines altogether since some compilers (most notably Visual C++) doesn't support this properly. */*: Replace #include FOO_H with #include <freetype/foo.h> or something similar. Also update the documentation.
* Update all copyright notices.Werner Lemberg2020-01-191-1/+1
|
* [woff2] Formatting.Nikhil Ramakrishnan2019-08-271-1/+1
| | | | * src/sfnt/sfobjs.c, src/sfnt/sfwoff2.c: Better formatting.
* [sfnt] Support `face->num_faces' for WOFF2 fonts.Nikhil Ramakrishnan2019-08-271-4/+16
| | | | | | | | | | | | | | | | | | | | | | Set correct value of `face->num_faces' for WOFF2 fonts. This is being handled separately because we only load the tables for the requested font face in `woff2_open_font' and create a single-face sfnt stream. The full discussion is at: https://lists.gnu.org/archive/html/freetype-devel/2019-08/msg00000.html * src/sfnt/sfobjs.c (sfnt_open_font): Add parameter `woff2_num_faces'. (sfnt_init_face): Introduce variable `woff2_num_faces', and change `face->root.num_faces' if `woff2_num_faces' is set. * src/sfnt/sfwoff2.c (woff2_open_font): Validate requested face index and handle negative face indices. * src/sfnt/sfwoff2.h (woff2_open_font): Add parameter `num_faces' to declaration.
* [woff2] Reconstruct `loca', `hmtx', and swap out stream.Nikhil Ramakrishnan2019-08-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add necessary functions to reconstruct loca and hmtx tables (the two remaining tables that can have a transform). `woff2_open_font' is now capable of loading a woff2 font face. This code may still need more refining and better memory management. * include/freetype/internal/wofftypes.h (WOFF2_HeaderRec): Add total (final) size of sfnt stream. (WOFF2_InfoRec): Add header checksum value. * src/sfnt/sfobjs.c (sfnt_open_font): Change `face_instance_index' parameter to its pointer so its value can be modified by `woff2_open_font'. * src/sfnt/sfwoff2.c: (WRITE_SFNT_BUF_AT): New macro to write into sfnt buffer at given position. (write_buf): Add parameter `extend_buf' which allows caller to specify whether buffer should be reallocated before copying data. (WRITE_SFNT_BUF): Updated. (pad4, store_loca, reconstruct_htmx): New functions. (reconstruct_glyf): Calculate loca values and store them. (reconstruct_font): Call `reconstruct_hmtx', write table record entries, and calculate table checksums. Also calculate font checksum and update `checksumAdjustment' entry in head table. (woff2_open_font): Open stream for sfnt buffer, swap out input stream and return. * src/sfnt/sfwoff2.h (woff2_open_font): Modify parameter to accept pointer to `face_index'.
* [woff2] Uncompress Brotli streams and `face_index' support.Nikhil Ramakrishnan2019-08-271-3/+4
| | | | | | | | | | | | | | | | | | | | WOFF2 compressed stream is now uncompressed if Brotli is available. This data is stored in a separate buffer (uncompressed_buf) because it does not contain direct table data. Certain tables have transformations applied to them, and they must be reconstructed before we can write those tables to the SFNT stream. `face_index' is now being passed as a parameter to `woff2_open_font'. * src/sfnt/sfobjs.c (sfnt_open_font): Add parameter `face_instance_index'. * src/sfnt/sfwoff2.c (woff2_uncompress): New function. (woff2_open_font): Call `woff2_uncompress'. (compute_first_table_offset): Fix return type. * src/sfnt/sfwoff2.h (woff2_open_font): Modify declaration.
* [sfnt] Read WOFF 2 header.Nikhil Ramakrishnan2019-08-271-0/+17
| | | | | | | | | | | | | | | | Check for WOFF2 tag, call `woff2_open_font', and implement it to read header according to specification. * include/freetype/internal/fttrace.h: Add `sfwoff2.c'. * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `sfwoff2.c'. * src/sfnt/sfnt.c: Include `sfwoff2.c'. * src/sfnt/sfobjs.c (sfnt_open_font): Check for `wOF2' tag and call `woff2_open_font'. * src/sfnt/sfwoff2.c, src/sfnt/sfwoff2.h: New files.
* [sfnt] Separate WOFF sources and headers.Nikhil Ramakrishnan2019-05-301-398/+1
| | | | | | | | | | | | | | | | | | | | | | Move WOFF sources and headers to separate files. * include/freetype/internal/wofftypes.h, src/sfnt/sfwoff.c, src/sfnt/sfwoff.h: New files. * include/freetype/internal/fttrace.h: Register `sfwoff.c'. * include/freetype/internal/internal.h: Define FT_INTERNAL_WOFF_TYPES_H. * include/freetype/internal/sfnt.h: Include FT_INTERNAL_WOFF_TYPES_H. * include/freetype/internal/tttypes.h: Move out WOFF structures. * src/sfnt/rules.mk: Add `sfwoff.c'. * src/sfnt/sfnt.c: Include `sfwoff.c'. * src/sfnt/sfobjs.c: Include `sfwoff.h', move out WOFF sources.
* Update all copyright notices.Werner Lemberg2019-02-231-1/+1
|
* [sfnt] Use typo metrics if OS/2 fsSelection USE_TYPO_METRICS bit is set.Nikolaus Waxweiler2019-02-021-50/+64
| | | | | | | | If the OS/2 table exists and fsSelection bit 7 (USE_TYPO_METRICS) is set, use the sTypo* set of values to compute the FT_Face's ascender, descender and height. Otherwise, fall back to old behavior. * src/sfnt/sfobjs.c (sfnt_load_face): Implement.
* Update copyright years.Werner Lemberg2019-01-221-1/+1
|
* A missing Unicode cmap is not a fatal error.Werner Lemberg2018-10-071-1/+2
| | | | | | | | This is a follow-up to the previous commit. * src/cff/cffobjs.c (cff_face_init), src/sfnt/sfobjs.c (sfnt_load_face), src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Implement it.
* Don't use `trace_' prefix for FT_COMPONENT arguments.Werner Lemberg2018-08-151-1/+1
| | | | | | | | * include/freetype/internal/ftdebug.h (FT_TRACE_COMP, FT_TRACE_COMP_): New auxiliary macros to add `trace_' prefix. (FT_TRACE): Use `FT_TRACE_COMP'. */* (FT_COMPONENT): Updated.
* * src/sfnt/sfobjs.c (sfnt_done_face): Fix memory leak (#54435).Ben Wagner2018-08-101-1/+2
|
* [psaux, type1] Trace PostScript dictionaries and other things.Werner Lemberg2018-07-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The tracing of /Encoding, /Subrs, and /Charstrings is rudimentary right now. * src/psaux/psobjs.c (ps_parser_load_field, ps_parser_load_field_table): Add tracing calls. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Make tracing output more compact. * src/type1/t1gload.c (T1_Compute_Max_Advance, T1_Get_Advances): Add tracing messages. * src/type1/t1load.c (parse_blend_axis_types, parse_blend_design_positions, parse_blend_design_map, parse_weight_vector, t1_load_keyword, t1_parse_font_matrix, parse_encoding, parse_subrs, parse_charstrings, T1_Open_Face): Add tracing calls. * src/type1/t1objs.c (T1_Face_Init): Add tracing call. * src/sfnt/sfobjs.c (sfnt_init_face): Make tracing message more verbose.
* s/palette_types/palette_flags/.Werner Lemberg2018-07-021-1/+1
| | | | Suggested by Behdad.
* [sfnt] Separate `CPAL' and `COLR' table handling.Werner Lemberg2018-06-131-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Later on we want to support the `SVG' table also, which needs `CPAL' (but not `COLR'). * include/freetype/internal/sfnt.h (SFNT_Interface): Add `load_cpal' and `free_cpal' fields. (FT_DEFINE_SFNT_INTERFACE): Updated. * include/freetype/internal/tttypes.h (TT_FaceRec): Replace `colr_and_cpal' fields with `cpal' and `colr'. * src/sfnt/sfdriver.c (sfnt_interface): Updated. * src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Updated. * src/sfnt/ttcolr.c (Colr, Cpal): Add `table' field. (ColrCpal): Removed. (tt_face_load_colr): Split off CPAL handling into... (tt_face_load_cpal): ... this new function. (tt_face_free_colr): Split off CPAL handling into... (tt_face_free_cpal): ... this new function. (tt_face_load_colr_layers, tt_face_palette_set): Updated. * src/sfnt/ttcolr.h: Updated. * src/truetype/ttgload.c (TT_Load_Glyph): Updated.
* Finish CPAL/COLR support (2/4).Werner Lemberg2018-06-131-0/+1
| | | | | | | | | | | | | | | | * src/sfnt/ttcolr.c (tt_face_palette_set): New function. (tt_face_load_colr): Allocate `face->palette' and call `tt_face_palette_set'. Adjust return error code in case of error. * src/sfnt/ttcolr.h: Updated. * include/freetype/internal/sfnt.h (TT_Set_Palette_Func): New function type. (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Add it. * src/sfnt/sfdriver.c (sfnt_interface), src/sfnt/sfobjs.c (sfnt_done_face): Updated.
* s/FT_Palette/FT_Palette_Data/, s/palette/palette_data/.Werner Lemberg2018-06-101-3/+3
| | | | | * include/freetype/ftcolor.h, include/freetype/internal/tttypes.h, src/base/ftcolor.c, src/sfnt/sfobjs.c, src/sfnt/ttcolr.c: Updated.
* [sfnt] Read `CPAL' version 1 tables.Werner Lemberg2018-06-091-0/+5
| | | | | | | | | | | | | | * include/freetype/internal.tttypes.h: Include FT_COLOR_H. (TT_FaceRec): Add `palette' field. * src/sfnt/ttcolr.c: Include FT_COLOR_H. (Cpal): Remove all data covered by the new `palette' field in `TT_FaceRec'. (tt_face_load_colr): Updated. Read `CPAL' version 1 data. (tt_face_load_colr_layers, tt_face_find_color): Updated. * src/sfnt/sfobjs.c (sfnt_done_face): Free glyph color palette data.
* [GSoC] src/*.*: Convert block comments to `light' style.Werner Lemberg2018-06-031-53/+53
| | | | | | | | | | | This monster commit was created by applying Nikhil's scripts `docconverter.py' and `markify.py' to all C header and source files, followed up by minor manual clean-up. No change in functionality, of course. I used commit f7419907bc6044b9b7057f9789866426c804ba82 from https://github.com/nikramakrishnan/freetype-docs.git.
* [sfnt] Preliminary support of coloured layer outlines.Shao Yu Zhang2018-05-131-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit enables OpenType's COLR/CPAL table handling; a typical application are color emojis that can be scaled to any size. If the color palette does not exist or is invalid, the rendering step rasterizes the outline instead. The current implementation assumes that the foreground is black. Enable this by defining option TT_CONFIG_OPTION_COLOR_LAYERS. There are still some issues with metrics; additionally, an API to fetch color layers is missing. * devel/ftoption.h, include/freetype/config/ftoption.h (TT_CONFIG_OPTION_COLOR_LAYERS): New macro. * include/freetype/internal/ftobjs.h (FT_Glyph_LayerRec, FT_Colr_InternalRec): New structures. (FT_Slot_InternalRec): Add `color_layers' field. * include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func, TT_Blend_Colr_Func): New function types. (SFNT_Interface): Add `load_colr', `free_colr', `load_colr_layer', and `colr_blend' fields. * include/freetype/internal/tttypes.h (TT_FaceRec): Add `colr_and_cpal' field. * include/freetype/internal/tttags. (TTAG_COLR, TTAG_CPAL): New macros. * src/sfnt/ttcolr.c, src/sfnt/ttcolr.h: New files. * src/base/ftobjs.c (ft_glyphslot_done, FT_Render_Glyph_Internal): Handle glyph color layers. * src/sfnt/Jamfile (_sources), src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttcolr.c'. * src/sfnt/sfdriver.c: Include `ttcolr.h'. (PUT_COLOR_LAYERS): New macro. Update call to `FT_DEFINE_SFNT_INTERFACE'. * src/sfnt/sfnt.c: Include `ttcolr.c'. * src/sfnt/sfobjs.c (sfnt_load_face): Load `COLR' and `CPAL' tables. (sfnt_done_face): Updated. * src/truetype/ttgload.c (TT_Load_Glyph): Handle color layers.
* [sfnt] Prefer `CBDT'/`CBLC' over `glyf' table (#53154).Werner Lemberg2018-02-171-0/+9
|
* Update copyright year.Werner Lemberg2018-01-021-1/+1
|