Commit Graph

7907 Commits

Author SHA1 Message Date
Anurag Thakur 70e807cef5 Add FT_Refresh_Glyph 2023-10-05 02:37:12 +05:30
Anurag Thakur bd0c3e594e dense fixes 2023-10-04 00:37:16 +05:30
Anurag Thakur 78df2b651f Add preload support in smooth 2023-10-03 03:08:03 +05:30
Anurag Thakur 012a28c055 remove log 2023-10-02 04:02:45 +05:30
Anurag Thakur ac4e710098 Use correct index for glyph loading 2023-10-02 03:12:18 +05:30
Anurag Thakur f3ba8614f6 compilation fixes 2023-10-01 00:44:48 +05:30
Anurag Thakur c107e5a76e prevent segfault 2023-09-30 14:24:24 +05:30
Anurag Thakur 2727d668bf silence 2023-09-30 01:38:06 +05:30
Anurag Thakur 5721ad0e38 Finally, it works 2023-09-30 00:47:07 +05:30
Anurag Thakur 0f715c8b90 Add support for conics 2023-09-29 21:00:41 +05:30
Anurag Thakur 579d9385ef First correct render 2023-09-29 01:46:56 +05:30
Anurag Thakur 382949cdea Fix render 2023-09-29 01:09:09 +05:30
Anurag Thakur 168eace51c Close contour with line segment and render glyph 2023-09-28 21:52:04 +05:30
Anurag Thakur c41d05e8a2 Render prelines 2023-09-08 01:45:42 +05:30
Anurag Thakur 71f7fb7203 Connect prelines to renderer 2023-09-04 02:00:23 +05:30
Anurag Thakur ebf1f32705 Add decompose logic 2023-08-31 22:25:22 +05:30
Anurag Thakur c1be4f6059 [wip] First prototype for benchmarks 2023-08-30 00:50:21 +05:30
Anurag Thakur 36f7c6bd34 Add structure to store preloaded lines 2023-08-25 00:35:30 +05:30
Anurag Thakur 67c1c30645 Load all glyphs when creating face 2023-08-23 21:56:19 +05:30
Anurag Thakur d23d82d84b Work on preloading font outlines 2023-08-15 01:15:13 +05:30
Anurag Thakur 71f5924d25 Notes for implementation 2023-08-12 23:43:16 +05:30
Anurag Thakur ca85076134 Debug options, to be reverted later 2023-08-12 23:29:01 +05:30
Anurag Thakur 3926f77efd Begin 'preload' font driver (based on truetype) 2023-08-09 01:46:40 +05:30
Anurag Thakur 4769e58bbd [dense] Add compilation flags for meson 2023-08-09 01:32:15 +05:30
Anurag Thakur f1550424d5 [dense] Add -msse4.1 to compile with CMake 2023-08-09 01:32:15 +05:30
Anurag Thakur f7f7eb0843 [dense] Add optimization for division
* src/dense/ftdense.c: FT_UDIV, FT_UDIVPREP macros taken from smooth
rasterizer, help optimize fixed-point division
2023-08-09 01:32:15 +05:30
Anurag Thakur d2be765703 [dense] Add optimization for vertical lines
* src/dense/ftdense.c: Optimize line drawing when a vertical line is encountered
2023-08-09 01:32:15 +05:30
Anurag Thakur eaf09d951f [dense] Re-enable SIMD to work with fixed-point
* src/dense/ftdense.c: Use integer SIMD functions for accumulation

* src/dense/ftdense.h: Change types of FT26D6, FT20D12 to better fit
their usage
2023-08-09 01:32:15 +05:30
Anurag Thakur 0aa7485b0d [dense] Migrate line drawing and accumulation to fixed-point
* src/dense/ftdense.h: (FT26D6, FT20D12): New typedefs

* src/dense/ftdense.c: dense_render_line, dense_render_glyph now
use fixed-point numbers for calculation

Disabled SIMD for now
2023-08-09 01:32:15 +05:30
Anurag Thakur 70d6a8ef1a [dense] Add SIMD support to rasterizer
* src/dense/ftdense: Use SSE4.1 for final accumulation step
(FT_SSE4_1): Macro which checks if SSE4.1 is available

* src/dense/rules.mk: Enable linking for SSE4.1
2023-08-09 01:32:15 +05:30
Anurag Thakur 2504e2de84 [dense] Enable module compilation
* src/dense/ftdense.c: Redefine FT_SWAP to fix compilation error

* src/include/freetype/config/ftmodule.h: Added ft_dense_renderer_class

* src/dense/dense.c: Build single object of module

* modules.cfg: Added 'dense' RASTER_MODULE

* src/dense/module.mk, src/dense/rules.mk: Added Makefile

* CMakeLists.txt: Added 'dense.c' to compilation files
2023-08-09 01:32:15 +05:30
Anurag Thakur 5e681678f6 [dense] Add drawing functions to rasterizer
* src/dense/ftdense.c: (dense_render_line, dense_render_quadratic,
dense_render_cubic, dense_render_glyph, dense_raster_render, Lerp):
New Functions
2023-08-09 01:32:15 +05:30
Anurag Thakur f2ff1dc37e [dense] Add rasterizer functions
* src/dense/ftdense.c: (ONE_PIXEL, TRUNC, UPSCALE, DOWNSCALE,
FT_SWAP, FT_MIN, FT_MAX, FT_ABS): New Macros

(dense_move_to, dense_line_to, dense_conic_to): Added outline
decomposing functions

(dense_raster_new, dense_raster_done, dense_raster_reset,
dense_raster_set_mode, dense_raster_render): Added interface
functions
2023-08-09 01:32:15 +05:30
Anurag Thakur abce0cab72 [dense] Add 'dense' renderer
* src/dense/ftdenserend.c: Add 'dense' renderer along with its interface
functions.

(ft_dense_set_mode, ft_dense_transform, ft_dense_get_cbox, ft_dense_init,
ft_dense_done, ft_dense_render)
2023-08-09 01:32:15 +05:30
Anurag Thakur f681099918 [dense] Populate headers for 'dense' module
* src/dense/ftdenserend.h (ft_dense_renderer_class): New Structures

* src/dense/ftdense.h (dense_worker): New Structure
(dense_render_line, dense_render_quadratic, dense_render_cubic): New
function declarations
(ft_dense_raster): Export dense raster funcs

* src/dense/ftdenseerrs.h: Add module error setup
2023-08-09 01:32:15 +05:30
Anurag Thakur a78906fb4e [dense] Add files for new 'dense' module
Breakdown of what the files will contain

* src/dense/ftdenserend.c, src/dense/ftdenserend.h: The 'dense' renderer.

* src/dense/ftdense.c, src/dense/ftdense.h: The rasterizer for the
'dense' renderer.

* src/dense/ftdenseerrs.h: Common error defines.

* src/dense/dense.c: For building a single object of the entire module.
2023-08-09 01:32:15 +05:30
Ben Wagner 3829fdaae5 Avoid overflow in COLR bounds checks.
The values read into `base_glyphs_offset_v1` and `layer_offset_v1` may
be in the range 0xFFFFFFFD-0xFFFFFFFF. On systems where `unsigned long`
is 32 bits adding 4 to such values will wrap and pass bounds checks but
accessing values at such offsets will be out of bounds.

On the other hand `table_size` has already been tested to be at least
`COLRV1_HEADER_SIZE` (34) so it is safe to subtract 4 from it.

* src/sfnt/ttcolr.c (tt_face_load_colr): subtract 4 from `table_size`
instead of adding 4 to font data offsets in bounds checks

Fixes: https://crbug.com/1469348
2023-08-04 11:41:23 -04:00
Alexei Podtelezhnikov 95a872085e * src/base/ftobjs.c (open_face_from_buffer): Silence `maybe-uninitialized`.
We never call this function without a `driver_name` (#1245).
2023-08-01 22:48:31 -04:00
Alexei Podtelezhnikov b2584c738f [truetype] Reduce v40 footprint.
*  src/truetype/ttgload.c (TT_HInt_Glyph, tt_loader_set_pp,
tt_loader_init): Refactor code.
2023-07-28 22:35:58 -04:00
Alexei Podtelezhnikov 1ecfd21990 [truetype] Remove Infinality for good (remaining bits).
* src/truetype/ttobjs.h: Remove remaining fields.
* src/truetype/ttinterp.c: Do not initialize them.
* include/freetype/internal/tttypes.h: Remove descriptions.
2023-07-27 16:12:28 +00:00
Alexei Podtelezhnikov 5b7e45ac34 [truetype] Remove Infinality for good.
Remove everything `#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY`,
which was undefined for a while now.

* include/freetype/internal/tttypes.h: Ditto.
* src/truetype/truetype.c: Ditto.
* src/truetype/ttdriver.c: Ditto.
* src/truetype/ttgload.c: Ditto.
* src/truetype/ttinterp.c: Ditto.
* src/truetype/ttinterp.h: Ditto.
* src/truetype/ttobjs.c: Ditto.
* src/truetype/ttsubpix.[ch]: Remove files.
* src/truetype/rules.mk: Don't mention "ttsubpix.c".
2023-07-27 15:06:38 +00:00
Jouk Jansen 9e3c5d7e18 * vms_make.com: Provide separate library compiled with C++.
Some types on OpenVMS x86_64 (for example, `long') have different sizes
depending on whether compiled with either C or C++.  In particular,
X-Windows applications crash if linked with the C++ version.

This patch makes `vms_make.com` create a second version of the FreeType
library compiled with C++ if OpenVMS is running on the x86_64 platform.
2023-07-21 21:36:57 +02:00
Jouk Jansen f7ae7e88e9 * vms_make.com: Fix typos. 2023-07-21 21:33:20 +02:00
Jouk Jansen 7c542d02bf * src/smooth/ftgrays.c (FT_SSE2): Fix definition for VMS. 2023-07-21 21:31:28 +02:00
Jouk Jansen 5769f13a6b vms_make.com: Make use of additional libraries optional.
Check whether `.olb` files are present.

Also check for the HarfBuzz library.
2023-07-19 13:41:04 +02:00
Jouk Jansen e8aa5af936 vms_make.com: Add `/warn=noinfo` to `CFLAGS`.
This reduces enormously the informationals while compiling on x86_64 (i.e.,
which `.h` file is inluded form where).
2023-07-19 13:41:04 +02:00
Ben Wagner dd3c9c5fec [woff2] Clean up on large brotli expansion
* src/sfnt/sfwoff2.c (woff2_open_font): set error and goto cleanup

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60711
2023-07-18 13:34:09 -04:00
Werner Lemberg 336503dfd7 [woff2] Avoid allocation bomb.
This is a fix for commit 85167dbd5, reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60615

* src/sfnt/sfwoff2.c (MAX_SFNT_SIZE): New macro.
(woff2_open_font): Use it to limit the maximum size of an uncompressed WOFF2
font.
2023-07-16 07:40:32 +02:00
Werner Lemberg 3c92e7bfc2 [cff] Fix compiler warning.
* src/cff/cffparse.c, src/cff/cffparse.h: Make `cff_parse_fixed` a local
function.
2023-07-14 18:58:55 +02:00
Ben Wagner 85167dbd50 [woff2] Remove sfnt size guess check
In WOFF the `totalSfntSize` must be correct, however in WOFF2 this value
is now just a hint and a conforming implementation must not reject
otherwise valid data if the `totalSfntSize` turns out not to be exact.

* src/sfnt/sfwoff2.c (woff2_open_font): remove check that uncompressed
woff2 data would fit in the sfnt size guess.

Fixes: #1235
2023-07-14 14:52:20 +00:00