Commit Graph

12084 Commits

Author SHA1 Message Date
Behdad Esfahbod b1c4cb0cae [cff2] Use a shrink instead of resize
Such that we can free the allocation.
2023-01-01 18:41:19 -07:00
Behdad Esfahbod b87360763e [vector] Support shrinking storage if exact size provided
Only do it if requested size is less than quarter of allocated size.

This has massive benefit during CFF subset preprocessing.
2023-01-01 18:38:28 -07:00
Behdad Esfahbod 1119e60296 [subset-cff] Tweak another storage allocation 2023-01-01 18:31:32 -07:00
Behdad Esfahbod f0b5286b36 [features] Sort 2023-01-01 17:04:59 -07:00
Behdad Esfahbod 4a5bd7a926 [subset] Add hb_subset_input_keep_everything()
Fixes https://github.com/harfbuzz/harfbuzz/issues/3998

New API:
+ hb_subset_input_keep_everything()
2023-01-01 16:53:28 -07:00
Behdad Esfahbod 52110f13b0 [subset-input] Refactor copy-pasta code 2023-01-01 16:22:02 -07:00
Matthias Clasen 4adc748b13 Move Color tables to src/OT/Color/ 2023-01-01 14:57:53 -07:00
Behdad Esfahbod a5f1f3a05c [ft] Conditionalize all COLOR code on >= 2.11.1
Fixes https://github.com/harfbuzz/harfbuzz/issues/3994
2023-01-01 13:14:04 -07:00
Matthias Clasen dc5179d465 Drop hb-ot-color-colr-table.cc
Move everything into the .hh file.
2023-01-01 20:18:33 +02:00
Khaled Hosny 27684f14be [introspection] Skip sources not usable with GObject Introspection
There is no point in generating GIR for code interfacing with libraries
without introspection integration. This fixes spurious warnings on macOS
when g-ir-scanner mistakenly tries to scan system headers.
2023-01-01 20:08:19 +02:00
Matthias Clasen f60e7e3f8c Drop an unused file 2023-01-01 09:51:03 -05:00
Behdad Esfahbod 3ff91c449f [paint] Optimize transform operations again 2022-12-31 14:49:41 -07:00
Behdad Esfahbod 1a0dd49f1e
Merge pull request #3991 from harfbuzz/paint-optimize-transform
Paint optimize transform
2022-12-31 14:38:06 -07:00
Behdad Esfahbod edb812345a [subset-cff] Another exact allocation 2022-12-31 13:55:41 -07:00
Behdad Esfahbod 54dd01b865 [set] Use exact-allocation in copying
Significantly reduces memory consumption.
2022-12-31 13:33:40 -07:00
Behdad Esfahbod 2c64048bc4 [subset] Another exact-allocation 2022-12-31 13:26:00 -07:00
Behdad Esfahbod 0ec0214f10 [cff-subset] Adjust pre-allocation
Reduces memory use significantly.
2022-12-31 13:19:38 -07:00
Behdad Esfahbod b88ca81814 [paint-extents] Minor reorder 2022-12-31 12:53:00 -07:00
Behdad Esfahbod 0c6a721337 [set] Another exact-size allocation 2022-12-31 12:42:29 -07:00
Behdad Esfahbod b803024caf [cff2] Another exact-size allocation 2022-12-31 12:40:07 -07:00
Behdad Esfahbod 3d4659beaa [cff2] Use exact-size vector allocation for blends 2022-12-31 12:38:58 -07:00
Behdad Esfahbod 92e5933ee6 [vector] A couple more exact-size allocations 2022-12-31 12:35:30 -07:00
Behdad Esfahbod 2eacc37e08 [vector] Add internal API for exact-size allocation
Use it from a couple of places.
2022-12-31 12:30:31 -07:00
Behdad Esfahbod a0b46f3f6b [machinery] Refactor shared code into a macro 2022-12-31 12:15:14 -07:00
Behdad Esfahbod ebb475bae7 [multimap] Add consts 2022-12-31 12:11:14 -07:00
Behdad Esfahbod 9e3ff0e9f0 [paint] Fixup 2022-12-31 11:55:45 -07:00
Behdad Esfahbod 6b47fcb17a [paint] Add internal push_skew/pop_skew API 2022-12-31 11:40:12 -07:00
Behdad Esfahbod 46adf31b4c [paint] Add internal push_rotate/pop_rotate API 2022-12-31 11:35:39 -07:00
Behdad Esfahbod ce7835124a [paint] Add internal push_scale/pop_scale API 2022-12-31 11:32:15 -07:00
Behdad Esfahbod 7363eb373a [paint] Add internal push_translate/pop_translate 2022-12-31 11:24:42 -07:00
Behdad Esfahbod df91677997 [paint] Call internal API internally 2022-12-31 11:12:02 -07:00
Behdad Esfahbod 99da0e6cc3 [paint] Avoid div-by-zero 2022-12-31 11:04:40 -07:00
Behdad Esfahbod 4e94b65cff [paint-extents] Const-correctness 2022-12-31 10:53:40 -07:00
Behdad Esfahbod f6dc4698ef [paint-extents] Minor move variable 2022-12-31 10:52:32 -07:00
Behdad Esfahbod 4e7807a090 [paint-extents] Rename variable 2022-12-31 10:50:30 -07:00
Behdad Esfahbod c86d1892ad [paint-extents] Move code around 2022-12-31 10:46:46 -07:00
Behdad Esfahbod d9a9bd8fa8 [paint-extents] Add HB_UNUSED 2022-12-31 10:41:30 -07:00
Behdad Esfahbod 37e90c64c1 [cairo] Fix warnings 2022-12-30 15:41:40 -07:00
Behdad Esfahbod 04464c55b2 [pool] Change chunk-len from 16 to 32 2022-12-30 14:55:32 -07:00
Behdad Esfahbod d7941e04df [paint-extents] Unlikely 2022-12-30 14:47:47 -07:00
Behdad Esfahbod ca844b6975 [paint-extents] Whitespace 2022-12-30 14:47:24 -07:00
Behdad Esfahbod 62ca2be39d [paint-extents] Implement quadratic callback 2022-12-30 14:41:36 -07:00
Behdad Esfahbod 7389efd8e0 [post] Pre-alloc name index array 2022-12-30 13:58:52 -07:00
Behdad Esfahbod 36bef5dccf [gsubgpos] Prealloc subtables vector 2022-12-30 13:58:52 -07:00
Behdad Esfahbod a45bf5b04c [ft-colr] Require FreeType >= 2.11.1
Fixes https://github.com/harfbuzz/harfbuzz/issues/3989
2022-12-30 11:19:36 -07:00
Behdad Esfahbod ceba6c9a90 [config] Sort 2022-12-30 10:44:34 -07:00
Behdad Esfahbod f2a6643fc1 [cairo] Docs 2022-12-29 18:00:39 -07:00
Behdad Esfahbod bfce4a6046 [cairo] Remove error path
Assume cairo API always returns non-NULL.
2022-12-29 10:43:37 -07:00
Behdad Esfahbod b1de87b7f1 [cairo] Document get_glyphs() arguments as inout 2022-12-29 10:41:35 -07:00
Matthias Clasen 89bd7f64ae [hb-cairo] Small docs fixes 2022-12-29 10:09:50 -07:00
Khaled Hosny c9206df166 [hb-cairo] Fix warnings 2022-12-29 10:07:59 -07:00
Khaled Hosny 723e7a48e2 [docs] Small fixes 2022-12-29 15:49:21 +02:00
Matthias Clasen 67456a7a02 [ft] Some more docs clarifications 2022-12-28 11:14:12 -07:00
Matthias Clasen c612d068e8 [ft] Clarify docs around faces too 2022-12-28 11:14:12 -07:00
Matthias Clasen 4dc955bb46 [ft] Clarify docs
Add some clarifications on what fonts these apis
work with.
2022-12-28 11:14:12 -07:00
Matthias Clasen ef20b5e66f Typo fix 2022-12-28 08:51:27 -05:00
Behdad Esfahbod 81c04b0c21 [cairo] Add separate x/y scale factors 2022-12-27 17:46:25 -07:00
Behdad Esfahbod 50b7fff0c6 [cairo] Fix text_to_glyphs scale factor 2022-12-27 17:37:42 -07:00
Behdad Esfahbod 8f62b8c6bb [cairo] Fix cluster conversion 2022-12-27 17:26:39 -07:00
Behdad Esfahbod 326db329f8 [directwrite] Simplify delete
Fixes https://github.com/harfbuzz/harfbuzz/issues/3981
2022-12-27 14:38:17 -07:00
Behdad Esfahbod 7b0f9abc89 [paint] Add back "remote-control" API
This reverts commit f146299a40.
2022-12-27 12:38:49 -07:00
Behdad Esfahbod 43b0364eda [paint] Document composition modes 2022-12-27 12:29:53 -07:00
Behdad Esfahbod ec9e8a5993 [paint] Document extend modes. 2022-12-27 12:22:56 -07:00
Behdad Esfahbod fa3fa9422d [cairo] Doc 2022-12-27 11:54:23 -07:00
Behdad Esfahbod bbf6f42d3b [cairo] TODO 2022-12-27 11:50:06 -07:00
Behdad Esfahbod f9fc13287b [hb-cairo] Return hb_font_t* from init-func 2022-12-27 11:08:55 -07:00
Matthias Clasen d18903e443 Add def files for libharfbuzz-cairo 2022-12-27 11:00:23 -07:00
Behdad Esfahbod d88787b6ca [cairo] Add func to init fonts on creation
To set, for example, font-funcs.
2022-12-27 10:59:17 -07:00
Behdad Esfahbod c52bff2d61 [cairo] Hide internal symbols 2022-12-27 10:42:13 -07:00
Behdad Esfahbod 34aa8b0148 [cairo] Add to library tests 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 5fdfe6ae5d [cairo] Use hb_qsort 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 21573265e9 [cairo] More namespacing 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 84d1b00cd4 [cairo] More namespacing 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 8f16e98c1b [cairo] Namespace types 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 488be52467 [cairo] Try fix msvc build 2022-12-26 17:01:08 -07:00
Behdad Esfahbod c652e8e1b7 [cairo] Docs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 23980d3cb2 [cairo] Docs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod f5fd46aa3d [cairo] Docs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 36482b684b [cairo] Err, utf8_clusters 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 48cb25dd36 [cairo] Implement (untested) text_to_glyphs callback 2022-12-26 17:01:08 -07:00
Behdad Esfahbod c38abcb3fb [cairo] Add x,y args to get_glyphs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 847ed69547 [cairo] Reorder arguments of a call 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 726cfffc0d [cairo] Doc fix 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 0fe0cdf066 [cairo] Document scale-factor business 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 4e3e879c1c [cairo] Add [sg]et_scale_factor 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 186bfa99f5 [cairo] Make scale_factor a double 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 120419e180 [hb-view] Fix autotools build 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 650a46d919 [cairo] Fix autotools build 2022-12-26 17:01:08 -07:00
Matthias Clasen b417ac8a19 Try to fix autotools build 2022-12-26 17:01:08 -07:00
Matthias Clasen 8d0e18b51d [cairo] More details in the docs
Mention slant as well.
2022-12-26 17:01:08 -07:00
Matthias Clasen 30605e09b9 [cairo] Mention variations in the docs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod c4f7563f81 [cairo] Fix build 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 7a52ac4bbe [cairo] Set variations 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 4be4e017fc [cairo] Make font immutable 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 70babda6ad [cairo] docs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 1c67180d6d [cairo] Add typed destroy funcs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 43da222e6d [cairo] Rename 2022-12-26 17:01:08 -07:00
Behdad Esfahbod cf001f6ec7 [cairo] Add constructor from hb_face_t 2022-12-26 17:01:08 -07:00
Matthias Clasen 2e897cc90b Add a pc file for harfbuzz-cairo 2022-12-26 17:01:08 -07:00
Matthias Clasen ddb52e4a30 [cairo] Add docs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod dc2bf2664d [cairo] Set scaled-font extents 2022-12-26 17:01:08 -07:00
Behdad Esfahbod d6ecda36bf [cairo] Renames 2022-12-26 17:01:08 -07:00
Behdad Esfahbod ffa45f243c [cairo] #ifdef HAVE_CAIRO 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 9e61fd7705 [hb-cairo] Lazy-load funcs thread-safe 2022-12-26 17:01:08 -07:00
Matthias Clasen 306645503d Work on proper build integration
Install hb-cairo.h and define HB_HAS_CAIRO.
2022-12-26 17:01:08 -07:00
Behdad Esfahbod a7c2e839e1 [hb-cairo] Prefix internal methods 2022-12-26 17:01:08 -07:00
Behdad Esfahbod bb640d4031 [hb-cairo] Use nullptr instead of NULL 2022-12-26 17:01:08 -07:00
Behdad Esfahbod b3a3656683 [hb-cairo] Minor 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 3a11a09f54 [hb-cairo] Rename cairo_extend 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 20a50acc91 [hb-cairo] Make hb_cairo_glyphs_from_buffer public 2022-12-26 17:01:08 -07:00
Behdad Esfahbod bf52386cfa [cairo] Silence warning 2022-12-26 17:01:08 -07:00
Behdad Esfahbod e594780e28 [hb-cairo] Some header tweaks 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 1ad24421a6 [hb-cairo] Rename files to C++ 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 5c3da76a43 [hb-cairo] Change API again
We need to work with a hb-font for variations and font-funcs
to be fetched properly.
2022-12-26 17:01:08 -07:00
Behdad Esfahbod 9f7538c260 [hb-cairo] Change API 2022-12-26 17:01:08 -07:00
Matthias Clasen 767bdd43a6 wip: Add libharfbuzz-cairo
This library will provide integration with cairo
for font rendering.
2022-12-26 17:01:08 -07:00
Behdad Esfahbod c3a8c6bb8b [paint] More docs 2022-12-26 15:38:24 -07:00
Behdad Esfahbod ae208963df Add hb-limits.hh 2022-12-26 12:30:39 -07:00
Matthias Clasen 5f5fa4b219 [ft-colr] Limit the size of the graph we follow
This adds the same check that we already do in
the native implementation.
2022-12-26 12:20:04 -07:00
Matthias Clasen ea2892c30e [paint] Limit the size of the graph we follow
In addition to checking the depth, also count
the number of edges in the graph we've followed,
and give up after 1024.
2022-12-26 12:20:04 -07:00
Matthias Clasen 5dd69d81b0 Fix hb_ot_color_has_paint
We must no access v1 data without checking that
version is 1. A bit of a trap.
2022-12-26 11:29:26 -07:00
Matthias Clasen b8f2281c6c Add hb_ot_color_glyph_has_paint 2022-12-26 11:29:26 -07:00
Behdad Esfahbod 79c5bb92ce [ft] Work around a freetype bug 2022-12-24 12:57:33 -07:00
Behdad Esfahbod fa1cf15e5d [ft-colr] Whitespace 2022-12-24 11:56:23 -07:00
Behdad Esfahbod 5343eac161 [ft-colr] Minor use context instead of direct access 2022-12-24 11:53:43 -07:00
Behdad Esfahbod 0b6468b820 [ft-colr] Minor 2022-12-24 11:50:57 -07:00
Behdad Esfahbod 1c595ec17f [paint-extents] Lazy-load paint_extents funcs 2022-12-24 11:40:44 -07:00
Behdad Esfahbod 4280ed290d [paint-extents] Add missing file 2022-12-24 11:38:32 -07:00
Behdad Esfahbod 2c0ab34d03 [paint-extents] Lazy-load draw-funcs 2022-12-24 11:37:59 -07:00
Behdad Esfahbod 11036ed71e [paint] Add hb-paint-extents.cc 2022-12-24 11:30:45 -07:00
Behdad Esfahbod 959996d709 [paint-extents] Namespace 2022-12-24 11:22:16 -07:00
Behdad Esfahbod 62bd26dda3 [ft] Pick largest bitmap size 2022-12-24 11:01:32 -07:00
Behdad Esfahbod d35dff020f [cbdt] Remove extra clip 2022-12-24 10:59:17 -07:00
Behdad Esfahbod f70c5d6f0d [paint] Continue returning bool from paint_image()
6ccbfabd4f (commitcomment-94127307)
2022-12-24 10:56:06 -07:00
Behdad Esfahbod 6ccbfabd4f [paint] Return bool from paint_image()
Fixes https://github.com/harfbuzz/harfbuzz/issues/3974
2022-12-24 10:44:25 -07:00
Behdad Esfahbod 346331d375 [ft] Fix negative xscale 2022-12-24 10:35:26 -07:00
Behdad Esfahbod 9376e7a930 [ft] Remove stale TODO 2022-12-24 10:31:30 -07:00
Behdad Esfahbod a7fd48c408 [ft] Comment 2022-12-24 10:28:41 -07:00
Behdad Esfahbod bb45ba2f9f [ft] Fix negative y-scale 2022-12-24 10:25:43 -07:00
Behdad Esfahbod aba2063c22 [paint-extents] Comments 2022-12-24 10:15:47 -07:00
Behdad Esfahbod 988ca459f3 [paint-extents] Minor refactor 2022-12-24 10:12:35 -07:00
Behdad Esfahbod f8bf98798d [paint-extents] Refactor code 2022-12-24 10:11:04 -07:00
Matthias Clasen 4816be9ab5 Work around cairo limitations
If we just draw an image, cairos recording surface
complains that it is unbounded. Its not true of course.

To make things work, clip to the extents.
2022-12-24 09:16:29 -05:00
Behdad Esfahbod f7eebc397c [paint-extents] Shorten enum addressing 2022-12-23 18:52:46 -07:00
Behdad Esfahbod 0110bdb3ea [paint-extents] Streamline extents_t more 2022-12-23 18:17:05 -07:00
Behdad Esfahbod 9f3e050b99 [paint-extents] Streamline extents_t 2022-12-23 18:15:21 -07:00
Behdad Esfahbod 0d129ae308 Fix warning 2022-12-23 18:00:38 -07:00
Behdad Esfahbod 73e48b9357 [colr] Push clipbox or computed clip 2022-12-23 17:55:09 -07:00
Behdad Esfahbod 02684751bd [paint-extents] Clean up 2022-12-23 17:33:13 -07:00
Behdad Esfahbod dbea503a38 [colr] Return true extents 2022-12-23 17:28:46 -07:00