Behdad Esfahbod
6c1a4bed4a
Better rounding clip boxes
2023-01-09 11:37:39 -07:00
Behdad Esfahbod
f46dcf147b
[paint/COLR] Fix clip transform
...
Sigh. So complicated.
2023-01-08 14:35:42 -07:00
Behdad Esfahbod
f283d4d366
[paint] Try to adjust both renderers to use same clip order
2023-01-08 12:42:34 -07:00
Behdad Esfahbod
5d94eb61b8
[hb-cairo] Fix hb_cairo_glyphs_from_buffer() when utf8 missing
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/4016
2023-01-08 11:56:01 -07:00
Behdad Esfahbod
5bd6fc1ace
Comment
2023-01-07 16:32:50 -07:00
Behdad Esfahbod
432afa9dff
[paint] Fix paint_extents usage
...
It was broken all this time :(.
The two backends do this slightly differently...
2023-01-07 16:25:30 -07:00
Behdad Esfahbod
a63d329261
[paint-extents] Simplify transform_extents
2023-01-07 16:05:24 -07:00
Behdad Esfahbod
e062f98260
[paint-extents] Fix transform_extents
...
Ouch!
2023-01-07 16:02:21 -07:00
Behdad Esfahbod
823a9b18d9
[cairo] Return COMPOSITE mode CLEAR for unknown values
...
As per the spec.
2023-01-07 14:50:30 -07:00
Behdad Esfahbod
65c3cde5da
[COLRv1] Fix scale variation
2023-01-07 14:29:18 -07:00
Behdad Esfahbod
004cdc10f8
[open-type] More tweaks to fixed types
...
Add set_int().
2023-01-07 14:27:15 -07:00
Behdad Esfahbod
c8486b6301
[open-type] Add to_int to fixed types
...
To make sure we don't accidentally forget to_float().
As we did recently in COLRv1 code.
2023-01-07 14:15:17 -07:00
Behdad Esfahbod
dfd9bf8a50
[COLRv1] Fix a couple of missing to_float() calls
...
Ouch!
2023-01-07 14:05:02 -07:00
Behdad Esfahbod
d045de78c1
[paint] Optimize PAINT_COMPOSITE
...
At the start of each paint call the current group is clear.
So we don't need to start a new group for the backdrop paint.
A paint composite really needs one group push, not two.
2023-01-07 13:56:43 -07:00
Behdad Esfahbod
5ea5aacda9
[ft-colr] Adjust for FreeType master color-stop change
...
Part of https://github.com/harfbuzz/harfbuzz/issues/4013
2023-01-07 13:25:11 -07:00
Qunxin Liu
1eb5445e75
[subset] Fix issue in hb_subset_input_override_name_table()
...
If a nameRecord with provided name_id/platform_id/encoding_id/lang_id
is not retained after subsetting, create it and insert it to
the name table. So we need to check against retained name_records
rather than name_record in the original name table.
2023-01-06 19:17:14 -07:00
Khaled Hosny
02948263f9
[subset] Document that CFF2 instancing is now supported
2023-01-06 13:58:29 -07:00
Behdad Esfahbod
82c863a50b
Whitespace
2023-01-06 12:51:58 -07:00
Behdad Esfahbod
76879c5763
[subset-cff] Minor hide num_coords again
2023-01-06 11:47:04 -07:00
Behdad Esfahbod
576b36a31b
[cff2] Undo rounding change in draw() codepath
2023-01-06 11:40:21 -07:00
Behdad Esfahbod
4867e0b192
[subset-cff2] Faster instancing
...
Instantiate blends during parsing. Dedups code as well.
2023-01-06 11:39:13 -07:00
Behdad Esfahbod
3757baab2c
[subset-cff2] Better condition
...
Previous condition wasn't working for dropping axes.
2023-01-06 11:23:37 -07:00
Behdad Esfahbod
acc6c13f05
[subset-cff] Round numbers when instancing
2023-01-06 11:20:41 -07:00
Behdad Esfahbod
2f174f23c3
Rename
2023-01-06 11:11:14 -07:00
Behdad Esfahbod
a59116cd8f
Oops
2023-01-06 11:09:09 -07:00
Behdad Esfahbod
c632a164b9
[subset/cff] Support instancing
2023-01-06 11:01:25 -07:00
Behdad Esfahbod
5153218b41
[set] Add hb_set_is_inverted()
2023-01-05 16:26:41 -07:00
Behdad Esfahbod
e8ac0ef2fd
[face] Minor rename a variable
2023-01-05 16:20:59 -07:00
Behdad Esfahbod
14ff747024
[set] Add tests for inverted set range iteration
2023-01-05 16:20:59 -07:00
Matthias Clasen
381ac2fd78
docs: Fix a typo
2023-01-05 15:55:57 -07:00
Behdad Esfahbod
2764a61691
Revert "[gsubgpos] Use swap instead of move"
...
This reverts commit 8a17cc4ecf
.
2023-01-05 15:14:54 -07:00
Behdad Esfahbod
167b7c6046
Revert "[gsubgpos] Reduce hb_set_t allocations"
...
This reverts commit 0b7f6d6cf0
.
Not much benefit as the main allocations come from other places.
2023-01-05 14:48:20 -07:00
Behdad Esfahbod
3947cedd09
Revert "[gsubgpos] Cache pos_glyphs allocation in closure"
...
This reverts commit 3961cc46bf
.
This was wrong...
2023-01-05 14:47:47 -07:00
Behdad Esfahbod
097fb8b8aa
[priority-queue] Use resize instead of shrink
...
To avoid reallocation of smaller array. Not desirable here.
2023-01-05 14:38:10 -07:00
Behdad Esfahbod
8a17cc4ecf
[gsubgpos] Use swap instead of move
...
Move is wrong when we want to reuse the object.
2023-01-05 14:15:38 -07:00
Behdad Esfahbod
4401dd2482
[gsubgpos] Minor use ->clear() directly
2023-01-05 14:13:57 -07:00
Behdad Esfahbod
207ae11ab9
[set] Allocate first page exact
2023-01-05 14:08:47 -07:00
Behdad Esfahbod
0b7f6d6cf0
[gsubgpos] Reduce hb_set_t allocations
2023-01-05 14:05:11 -07:00
Behdad Esfahbod
3961cc46bf
[gsubgpos] Cache pos_glyphs allocation in closure
...
Saves some 3% in Gulzar-Regular subsetting.
2023-01-05 13:58:57 -07:00
Behdad Esfahbod
a90f149e1b
[gsubgpos] Minor drop an allocation
2023-01-05 13:52:11 -07:00
Behdad Esfahbod
c54debc76d
[face] Add hb_face_collect_nominal_glyph_mapping
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3973
2023-01-05 11:57:48 -07:00
Behdad Esfahbod
ec70a3f797
[map] Include
2023-01-05 11:52:12 -07:00
Behdad Esfahbod
8b12c19573
[face] Split hb-face-builder.cc
2023-01-05 11:42:21 -07:00
Behdad Esfahbod
dc7b3a627d
[test-map] Another test
2023-01-05 10:49:10 -07:00
Behdad Esfahbod
a8df5cb07d
[test-map] Test keys() / values()
2023-01-05 10:47:47 -07:00
Konstantin Käfer
a349eef6a6
Disable hb_paint_extents_* functions if HB_NO_PAINT is defined
2023-01-05 10:18:47 -07:00
Behdad Esfahbod
9420966f5b
[map] Fix next()
2023-01-05 10:17:24 -07:00
Behdad Esfahbod
35f46e74d1
[map] Add hb_map_keys() and hb_map_values()
2023-01-04 17:12:08 -07:00
Behdad Esfahbod
07f2d8d538
Comment
2023-01-04 15:42:56 -07:00
Behdad Esfahbod
4f6079138d
[map] Add hb_map_update()
2023-01-04 13:58:46 -07:00
Behdad Esfahbod
c350458539
[subset-plan] Relax const return type of a few functions
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/4003
2023-01-04 13:25:03 -07:00
Behdad Esfahbod
dbf0964a0f
[map] Doc
2023-01-04 13:17:14 -07:00
Behdad Esfahbod
0875a420f7
[map] Doc
2023-01-04 13:11:37 -07:00
Behdad Esfahbod
ffafcf9633
[map] Add hb_map_next()
2023-01-04 12:56:42 -07:00
Behdad Esfahbod
3e471bbc08
[vector] Better test
2023-01-04 11:53:49 -07:00
Behdad Esfahbod
45fc919a10
[bit-set] Minor setting length on allocation failure
2023-01-04 11:35:44 -07:00
Behdad Esfahbod
d8509061e6
[vector] It's okay if shrinking fails
2023-01-04 11:33:54 -07:00
Behdad Esfahbod
6c272b920d
[set] Don't discard allocation in operator=
...
That had caused memory thrashing.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54789
2023-01-03 13:00:41 -07:00
Behdad Esfahbod
e6bbf112ea
[buffer] Better document set_content_type
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/4000
2023-01-03 12:35:48 -07:00
Behdad Esfahbod
8f2345ca36
Use more vector resize_exact
2023-01-02 18:08:45 -07:00
Behdad Esfahbod
b6be455020
[vector] Add resize_exact()
2023-01-02 18:05:43 -07:00
Behdad Esfahbod
a516ce97e0
[subset-cff] Add a few exact-allocation calls
2023-01-02 17:58:51 -07:00
Behdad Esfahbod
4a435dc024
[subset-cff] Remove an unlikely
2023-01-02 17:41:31 -07:00
Behdad Esfahbod
f8c578fd93
[subset-cff] Remove commented-out line
2023-01-02 17:33:04 -07:00
Behdad Esfahbod
d5e1748f31
[cff] Simplify add_op()
2023-01-02 12:26:43 -07:00
Behdad Esfahbod
27531d853e
[subset-cff] Move code around
2023-01-02 12:05:11 -07:00
Behdad Esfahbod
9afe5f973e
[vector] Fix leak
...
Discovered by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54767
2023-01-02 11:46:45 -07:00
Behdad Esfahbod
4f013c42f0
[subset-cff] Always compact charstrings
...
Reduces non-preprocessed subsetting memory footprint significantly.
2023-01-02 10:39:14 -07:00
Behdad Esfahbod
d3ed6eed43
[cff] Initialize a member variable
...
For good hygiene.
2023-01-02 10:39:14 -07:00
Behdad Esfahbod
55a7d81740
[vector] Allocate exact size in operator=
2023-01-01 23:07:42 -07:00
Behdad Esfahbod
449910d431
[vector] Allocate exact size in constructor
2023-01-01 19:27:10 -07:00
Behdad Esfahbod
4dda1f7881
[cff-subset] Compact charstrings just after parsing
...
Massive peak-memory saving when processing face.
2023-01-01 19:00:04 -07:00
Behdad Esfahbod
a7617c3cf1
[cff-subset] Drop hints just after parsing charstring
...
In prep for next commit.
2023-01-01 18:58:08 -07:00
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
Behdad Esfahbod
f9c2e30e01
[paint-extents] Better handle empty glyphs
2022-12-23 17:13:35 -07:00
Matthias Clasen
885dbcfba0
Skip empty outlines
2022-12-23 19:07:32 -05:00
Behdad Esfahbod
bd61e645ff
[paint-extents] Use hb_min/hb_max
2022-12-23 16:59:12 -07:00
Behdad Esfahbod
56a48f8b0a
[paint] Don't use extents in hb-view
...
Let the clipbox do its magic. Currently works for ft backend only.
2022-12-23 16:45:04 -07:00
Matthias Clasen
79229cea17
Get outline extents manually
2022-12-23 18:41:24 -05:00
Behdad Esfahbod
47c896f004
[paint-extents] Hook it up, kinda
2022-12-23 16:25:36 -07:00
Behdad Esfahbod
7fbaaebe8b
[paint-extents] Finish off
...
Untested and unused.
2022-12-23 15:57:05 -07:00
Behdad Esfahbod
8ca78d1520
[paint-extend] More
2022-12-23 15:21:48 -07:00
Behdad Esfahbod
23a2d4dbab
[paint-extents] More
2022-12-23 15:11:45 -07:00
Behdad Esfahbod
d7435b1009
[paint-extents] Flesh out more
2022-12-23 15:05:30 -07:00
Behdad Esfahbod
c37a1eadef
[paint-extents] Flesh out some more
2022-12-23 14:57:12 -07:00
Behdad Esfahbod
268d8b7ded
[paint-extents] Start out
2022-12-23 14:45:56 -07:00
Behdad Esfahbod
d9875ddc9d
[ft-colr] Add depth counter
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
583f010b05
[ft] Move lock only around clip_glyph
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
2762903909
[ft-colr] Minor
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
3a1385f019
[ft-colr] Simplify color-stop callback
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
1cc3b10008
[ft-colr] Ifdef build for older freetype
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
882c2bca2d
[ft-colr] Add a paint context
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
7a4b4c64f2
[ft-colr] Minor macro
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
c453c2fce9
[ft-colr] Fix color-stop iteration
2022-12-23 13:37:59 -07:00
Matthias Clasen
bbb89e62aa
[paint] Document color lines as transient
...
Just so people don't get ideas.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
15582d5fc1
[ft-colr] Apply slant to clipbox
2022-12-23 13:37:59 -07:00
Matthias Clasen
7abd5dcf10
[ft-paint] Fix handling of colorstop iters
2022-12-23 13:37:59 -07:00
Matthias Clasen
393bab4ba1
[ft-paint] Apply ClipBox to all glyphs
2022-12-23 13:37:59 -07:00
Matthias Clasen
c11ae85cbf
[ft-paint] Apply root transform
2022-12-23 13:37:59 -07:00
Matthias Clasen
7fc3fdac76
[ft-paint] Optimize away some transforms
2022-12-23 13:37:59 -07:00
Matthias Clasen
586d1758c1
[ft-paint] Fix an oversight
2022-12-23 13:37:59 -07:00
Matthias Clasen
092637f94c
[ft-paint] Fix rounding
2022-12-23 13:37:59 -07:00
Matthias Clasen
fe08e956e0
[ft-paint] Fix a case of x/y confusion
2022-12-23 13:37:59 -07:00
Matthias Clasen
0d5256e5a7
[ft-paint] Fix some fixed->float conversions
2022-12-23 13:37:59 -07:00
Matthias Clasen
07ba5be393
[paint] Documentation tweaks
2022-12-23 13:37:59 -07:00
Matthias Clasen
21f78c8774
[paint] Document that colors are unpremultiplied
...
And mention that gradient interpolation must happen
in premultiplied space.
2022-12-23 13:37:59 -07:00
Matthias Clasen
b6e98cf758
[colr] Add more docs
...
State explicitly that palette entries are
unpremultipled, and link to the spec.
2022-12-23 13:37:59 -07:00
Matthias Clasen
a634f6b486
[colr] Add more docs
...
State explicitly that palette entries are
unpremultipled, and link to the spec.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
a02c2a911c
[ft-paint] Apply alpha correctly
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
6ebcc9d2e1
[ft-paint] Hook up gradients
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
fe4e9bd930
[colr] Add public vtable for hb_color_line_t
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
7c9e42ed92
[colr] Fix transform hell
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
569d5b436c
[ft-paint] Remove dead code
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
cfdc34b44d
[ft-paint] Implement FT_COLR_PAINTFORMAT_SKEW
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
64cf17ec8b
[ft-paint] Fix center translation
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
ddbe4e52ec
[ft-paint] Implement FT_COLR_PAINTFORMAT_ROTATE
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
16598e024b
[ft-paint] Default
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
a0f7f9e61c
[ft-paint] Implement FT_COLR_PAINTFORMAT_COMPOSITE
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
0ec201446b
[ft] Implement FT_COLR_PAINTFORMAT_COLR_GLYPH
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
ac2682c610
[ft] Start of a COLRv1 renderer
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
e2546f5ab0
[ft] Add hb-ft-colr.hh
2022-12-23 13:37:59 -07:00
Matthias Clasen
5bd3c07b54
[colr] Don't access baseGlyphList unless v1
...
This was showing up sporadic crashes due to
invalid reads.
2022-12-23 13:37:59 -07:00
Matthias Clasen
6909701b36
[paint] Update docs
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
381d410b1e
[paint] Add HB_PAINT_IMAGE_FORMAT_BGRA and use it in hb-ft
...
Now hb-ft can render color emoji as well.
Just left COLRv2.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
c5f903872f
[paint] Add bitmap width/height to paint_image callback
...
Such that we can add raw data as well.
2022-12-23 13:37:59 -07:00
Matthias Clasen
eef47f2379
[paint] Fix the docs
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
3c972867b9
More s/hb_font_get_glyph_shape/hb_font_draw_glyph/
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
72a169c846
[ft] Paint COLRv0 glyphs
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
bb807f47d2
[ft] Implement paint_glyph() for outline glyphs
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
91c880503e
[ft] Use new name for draw API
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
c27eefec1d
Revert "Drop the deprecation"
...
This reverts commit 3904e66777339a3d420ece1c2b7d550949aa3946.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
f3985d9482
[paint] Fix drawing non-color glyphs
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
237955dffc
[paint] Add slant to image() callback
...
And slant images in hb-view.
2022-12-23 13:37:59 -07:00
Matthias Clasen
c221933977
[paint] Preserve foreground information
2022-12-23 13:37:59 -07:00
Matthias Clasen
f146299a40
[paint] Drop unnecessary api
2022-12-23 13:37:59 -07:00
Matthias Clasen
6387004cad
[paint] Simplify api
...
Drop the hb_paint_context_t struct from the API, and
only pass the font where we need it.
2022-12-23 13:37:59 -07:00
Matthias Clasen
71bd5a0dfc
[paint] Resolve colors
...
We don't need to pass the index/alpha pairs to
client callbacks, and can just resolve the colors
internally.
Update test results.
2022-12-23 13:37:59 -07:00
Matthias Clasen
9be01b6bff
[paint] Pass hb_paint_context_t along
...
Replace the font argument with a hb_paint_context_t
that carries the font, the palette index and the
foreground color.
The hb_font_paint_glyph() api now takes the palette
index and the foreground color as extra arguments.
Update all callers and regenerate test results.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
6c71c530ca
[paint] Rename hb_paint_context_t to hb_ot_paint_context_t
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
8495395397
[paint] Fix slant
2022-12-23 13:37:59 -07:00
Matthias Clasen
97224f3b63
[paint] Pass font to all callbacks
...
This will lead to easier implementations.
At the same time, we change the push_clip_glyph
callback to use the font as-is, no unscaling needed.
Update all callers and expected test results.
2022-12-23 13:37:59 -07:00
Matthias Clasen
32ce29f99e
[font] Move hb_font_t typedef
...
This is needed to avoid circular header dependencies.
2022-12-23 13:37:59 -07:00
Matthias Clasen
8364d9130f
Document hb_font_set_draw_glyph_func
2022-12-23 13:37:59 -07:00
Matthias Clasen
a20999b9df
[font] Fix a few documentation mistakes
2022-12-23 13:37:59 -07:00
Matthias Clasen
2333a566ed
Drop the deprecation
...
No need to drop hb_font_get_glyph_shape, just
because hb_font_draw_glyph does the same.
Its fine to keep both around.
2022-12-23 13:37:59 -07:00
Matthias Clasen
14b026ff86
[draw] Add hb_font_draw_glyph
...
hb_font_draw_glyph(), hb_font_draw_glyph_func_t and
hb_font_funcs_set_draw_glyph_func() are just alternative
names for hb_font_get_glyph_shape and friends, to better
align with hb_font_paint_glyph.
2022-12-23 13:37:59 -07:00
Matthias Clasen
08da126523
[docs] Linkify links
2022-12-23 13:37:59 -07:00
Matthias Clasen
9437f719a7
[paint] Document hb_paint_extend_t
2022-12-23 13:37:59 -07:00
Matthias Clasen
3a2634e27c
[paint] Document hb_font_paint_glyph_func_t
2022-12-23 13:37:59 -07:00
Matthias Clasen
0f287e75ec
[paint] Rename hb_font_get_glyph_paint_func_t
...
The 'get' was just there due to implementation
choices. Work around that and call the vfunc
what it should be: hb_font_paint_glyph_func_t.
2022-12-23 13:37:59 -07:00
Matthias Clasen
ddd2039265
[paint] Improve the docs
2022-12-23 13:37:59 -07:00
Matthias Clasen
3a219cfa6a
[config] Make HB_LEAN imply HB_NO_PAINT
2022-12-23 13:37:59 -07:00
Matthias Clasen
0ef2dc9be5
Drop a TODO
...
This was addressed in 61bd602791d801
2022-12-23 13:37:59 -07:00
Matthias Clasen
96cda3886c
[paint] Clarify docs
...
Spell out where the different datas originate.
2022-12-23 13:37:59 -07:00
Matthias Clasen
0800d1879c
Try to fix autotools build
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
5ac218865a
[paint] A doc fix
2022-12-23 13:37:59 -07:00
Matthias Clasen
7c12db46ff
Try to fix msvc build
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
5d1fc9ee9d
[paint] Fix annotations
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
ee2204469e
[paint] Add get_empty / [sg]et_user_data
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
21a9db875e
[draw] Add get_empty / [sg]et_user_data
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
9a7422c5fb
[font] Minor doc fix
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
a9b37206eb
[font] Minor rename
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
815544a1f7
[font] Adapt paint_glyph to parent transform
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
85917e5b21
[paint] Fix docs
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
14bf3aaa8d
[colr] Make paint_image work again
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
7accbe97d8
[util] Fix argument order and root transform PNGs
2022-12-23 13:37:59 -07:00
Matthias Clasen
f1f8d1e855
Small documentation addition
2022-12-23 13:37:59 -07:00
Matthias Clasen
021618e91a
[colr] Add hb_ot_color_has_paint
...
This is a counterpart to hb_ot_color_has_layers
for COLRv1 data.
2022-12-23 13:37:59 -07:00
Matthias Clasen
63fcb26c9b
Add some more docs
2022-12-23 13:37:59 -07:00
Matthias Clasen
451414a27e
[paint] Documentation fixes
2022-12-23 13:37:59 -07:00
Matthias Clasen
0c77f1d9ab
[paint] Documentation tweaks
2022-12-23 13:37:59 -07:00
Matthias Clasen
0a2f3673b9
[paint] Use tags for image formats
...
This fits better with the rest of the
HarfBuzz API.
2022-12-23 13:37:59 -07:00
Matthias Clasen
4c728e952b
[colr] Add a todo
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
4b0285bae6
[colr] Use slant_xy
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
b9314400ec
[colr] Hook up color-line variation
2022-12-23 13:37:59 -07:00
Matthias Clasen
a935e4b0c2
[paint] Add synthetic slant to root transform
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
edf2738263
[colr] Try fixing bot build
...
I don't get the error. Let's see.
../../src/harfbuzz/src/hb-ot-color-colr-table.hh:574:66: error: incomplete definition of type 'OT::NoVariable<OT::ColorLine<OT::NoVariable>>'
2022-12-23 13:37:59 -07:00
Matthias Clasen
686e627bdf
[paint] Set up root transform in one place
...
Instead of spreading this in all the tables,
make hb_paint_funcs_t provide a push/pop_root_transform
that does all the setup.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
c6dd56cc64
[colr] Simplify color-stop handling
2022-12-23 13:37:59 -07:00
Matthias Clasen
485ba9beb3
[paint] Spell out rectangle in the API
...
No need to abbreviate this.
2022-12-23 13:37:59 -07:00
Matthias Clasen
37f3f0fcc2
[paint] Change the image callback
...
Instead of passing the glyph ID, give
it the image blob, a mimetype, and
glyph extents (if available).
Update all callers.
2022-12-23 13:37:59 -07:00
Matthias Clasen
ea48d6c292
Move hb_glyph_extents_t definition
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
b722039c48
[colr] Simplify
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
452cfb9599
[colr] Simplify loop using iterators
...
Or complexify?!
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
601a596ca0
[paint] Fix include path
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
8a9069d55f
[colr] Fix radial gradient
...
Broke it when adding variations.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
e799c33bb5
[paint] Fix function prototype
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
1953d26a8a
[colr] Limit recursion depth
2022-12-23 13:37:59 -07:00
Matthias Clasen
378bbeea01
Add more docs
2022-12-23 13:37:59 -07:00
Matthias Clasen
6079173a52
Try paint_glyph for more tables
...
If the COLR table does not paint the glyph,
try SVG, CBDT and sbix too, before giving up
on color.
2022-12-23 13:37:59 -07:00
Matthias Clasen
e6c5a616aa
SVG Implement paint-glyph
2022-12-23 13:37:59 -07:00
Matthias Clasen
23c60fd9b2
sbix: Implement paint_glyph
2022-12-23 13:37:59 -07:00
Matthias Clasen
7996ae4c3d
CBDT: Implement paint glyph
2022-12-23 13:37:59 -07:00
Matthias Clasen
82e23f322a
paint: Add a paint-image callback
...
This will be used for image blobs like pngs and svgs.
FIXME: nail down and document sizing.
2022-12-23 13:37:59 -07:00
Matthias Clasen
56b02b6599
Update the docs
...
Mention that the color index will always be 0xFFFF
when using hb_paint API with fonts that don't have
color palettes.
And add an outline about which kinds of glyphs
require which callbacks.
2022-12-23 13:37:59 -07:00
Matthias Clasen
9461ab7088
Try paint_glyph for more tables
...
If the COLR table can't paint the glyph,
try glyf, cff1 and cff2 too.
2022-12-23 13:37:59 -07:00
Matthias Clasen
3e39dd492b
cff2: Implement paint_glyph
2022-12-23 13:37:59 -07:00
Matthias Clasen
df89b52130
cff1: Implement paint_glyph
2022-12-23 13:37:59 -07:00
Matthias Clasen
2edd771cf5
glyf: Implement paint_glyph
2022-12-23 13:37:59 -07:00
Matthias Clasen
0b33b35eb0
COLRv1: Return bool from paint_glyph
...
This will let hb_ot_font_paint_glyph() try
multiple tables in turn.
2022-12-23 13:37:59 -07:00
Matthias Clasen
0d890061d1
Rename 'solid' to 'color'
...
'solid' does not really describe well what
the function does, and there is no strong
reason to stick 1:1 to the terminology used
in the spec.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
46286275f7
[colr] More dispatch functionality
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
81f232afb5
[colr] Use dispatch machinery for paint_glyph context
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
a96300d42c
[colr] Hide internal symbols
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
b4cab86d94
Fix autotools build
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
0757519092
[colr] Add variation to rest of the paints
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
5bce005346
[colr] Flesh out variations for a few paints
2022-12-23 13:37:59 -07:00
Behdad Esfahbod
9d3440b742
[colr] Add variation infrastructure to paint_glyph
...
No paint applies variations yet.
2022-12-23 13:37:59 -07:00
Matthias Clasen
5c6329555e
Apply root transform
...
This commit applies scale, slant is still missing.
2022-12-23 13:37:59 -07:00
Matthias Clasen
5afca91ff2
Add some docs
2022-12-23 13:37:59 -07:00
Matthias Clasen
44c68594f1
Some docs
2022-12-23 13:37:59 -07:00
Matthias Clasen
d7c2eacf45
Handle COLRv0 layers in paint_glyph
2022-12-23 13:37:59 -07:00
Matthias Clasen
55ca6ed230
minor fixes
2022-12-23 13:37:59 -07:00
Matthias Clasen
1880e54753
Assorted fixes
2022-12-23 13:37:59 -07:00
Matthias Clasen
684df8a82a
add some todos
2022-12-23 13:37:59 -07:00
Matthias Clasen
a6f813b680
Implement hb_color_line_get_extend
2022-12-23 13:37:59 -07:00
Matthias Clasen
3937d6b0aa
Implement hb_color_line_t
2022-12-23 13:37:59 -07:00
Matthias Clasen
64f1b55d01
api fixes: use floats consistently
2022-12-23 13:37:59 -07:00
Matthias Clasen
627c857f8b
rename pop_group_and_composite
2022-12-23 13:37:59 -07:00
Matthias Clasen
c9350838c7
assorted fixes and changes
2022-12-23 13:37:59 -07:00
Matthias Clasen
42324aef2b
hb-paint: annotation fix
2022-12-23 13:37:59 -07:00
Matthias Clasen
8377341b28
wip: implement paint_glyph
2022-12-23 13:37:59 -07:00
Matthias Clasen
efe13a191d
fix introspection
2022-12-23 13:37:59 -07:00
Matthias Clasen
6a48ac42f4
COLR implementation
2022-12-23 13:37:59 -07:00
Matthias Clasen
71efa0dcf1
wip: hb_font_paint_glyph
2022-12-23 13:37:59 -07:00
Matthias Clasen
83d0a49f71
wip: hb-paint
2022-12-23 13:37:59 -07:00
Matthias Clasen
30c5402e3d
Make hb-features.h usable standalone
...
The intended use for hb-features.h is to
be included standalone, so we can't put
the single-include guards in here.
2022-12-23 12:33:28 -07:00
Behdad Esfahbod
d628aff9db
[ft] Apply slant in get_glyph_extents
2022-12-22 10:53:37 -07:00
Behdad Esfahbod
9a0ebd2b2a
[glyf] Fix slant-scaling in GlyphHeader too
2022-12-22 10:21:50 -07:00
Behdad Esfahbod
392463bff5
[cff] Fix extent rounding
...
I broke it in b0abbfd868
.
2022-12-22 08:34:01 -07:00
Behdad Esfahbod
897c102703
[font] Fix scale_glyph_extents
2022-12-22 08:15:01 -07:00
Behdad Esfahbod
9194e13e25
[font] Apply slant to glyph extents
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3952
hb-ft not fixed since doesn't use this code.
2022-12-22 07:32:29 -07:00
Behdad Esfahbod
b0abbfd868
[font] Centralize glyph-extents scaling
...
Needs more testing...
Some rounding was removed, namely in cff1 and cff2.
2022-12-22 07:32:15 -07:00
Behdad Esfahbod
97b8ada865
[varc] Reset component coordinates to that of the font
...
Fixes https://github.com/harfbuzz/boring-expansion-spec/issues/78
2022-12-21 19:52:20 -07:00
Garret Rieger
40342c9437
[subset] check for addition overflow in hdmx size calculation.
...
Fixes https://oss-fuzz.com/testcase-detail/4877336988483584 .
2022-12-21 16:44:06 -07:00
Garret Rieger
d77fca997e
[subset] when subsetting preprocessor fails, reference the returned face.
...
The caller of the method is expected to destroy the returned result.
2022-12-21 15:04:27 -07:00
Behdad Esfahbod
9b5b4da0e4
[varc] Set coordinates as absolute values
2022-12-20 09:58:04 -07:00
Behdad Esfahbod
80e68f09c5
[VarC] Change rotation/skew representation
...
Fixes https://github.com/harfbuzz/boring-expansion-spec/issues/77
2022-12-19 19:17:04 -07:00
Garret Rieger
1840b02e6a
[subset] Don't gate access to the table repacker.
...
Any table with an object graph should repack correctly.
2022-12-19 17:57:33 -07:00
Behdad Esfahbod
03a1685693
[VarC] Change representation of scale from 4.12 to 6.10
...
Fixes https://github.com/harfbuzz/boring-expansion-spec/issues/76
2022-12-19 17:12:09 -07:00
Matthias Clasen
c292e577ff
Fix a typo
2022-12-19 20:04:36 +02:00
Matthias Clasen
b795246fff
[draw] Clarify the docs
...
Disambiguate the origin of draw_data and user_data,
this had me confused a few times.
Fixes: https://github.com/harfbuzz/harfbuzz/issues/3955
2022-12-19 20:04:36 +02:00
Matthias Clasen
eddb408f9c
[draw] Small doc fix
2022-12-19 20:03:57 +02:00
Khaled Hosny
bc4c290b75
[doc] Workaround gtk-doc limitation with HB_DEPRECATED_FOR
...
See https://github.com/harfbuzz/harfbuzz/issues/3957#issuecomment-1356890525
2022-12-19 00:59:50 +02:00
Khaled Hosny
f9e1192d58
[ot-tag] Document two deprecated symbols
...
See https://github.com/harfbuzz/harfbuzz/issues/3957
2022-12-18 23:58:36 +02:00
Khaled Hosny
947e01a7c1
[subset] Suppress gtk-doc warning
2022-12-18 23:40:01 +02:00
Nirbheek Chauhan
7be06f6377
meson: Override dependencies to improve usage as a subproject
...
With this change, harfbuzz can be consumed as a subproject without
making any changes to the build files of a project. All you need to do
is provide a wrap file with a `[provide]` section:
https://mesonbuild.com/Wrap-dependency-system-manual.html#provide-section
This is also necessary because otherwise projects need to hard-code
the subproject name, which might be `harfbuzz` when using `wrap-git` or
`harfbuzz-6.0.0` when using `wrap-file` (to build from a release
tarball). This can cause conflicts between different subprojects that
consume harfbuzz differently.
Other projects like glib, cairo, pango, etc already do this.
2022-12-18 08:28:55 +02:00
Behdad Esfahbod
206957aee4
[COLR] Change recursion limit back to 128
2022-12-17 08:57:56 -07:00
Khaled Hosny
afcae83a06
6.0.0
2022-12-16 23:35:26 +02:00
Matthias Clasen
a98c6fdd92
Mark an argument as unused
2022-12-16 13:23:01 -07:00
Matthias Clasen
601d3806c9
COLRv1: Revamp extents variation
...
Try to do this a cleaner way.
2022-12-16 13:23:01 -07:00
Behdad Esfahbod
51a17201a7
[open-type] In to_float() take offset as float
2022-12-16 12:28:50 -07:00
Behdad Esfahbod
f252cf80e1
[open-type] Allow passing an offset to to_float()
2022-12-16 12:03:51 -07:00
Behdad Esfahbod
6ae35365f8
Fix build
2022-12-16 11:43:38 -07:00
Behdad Esfahbod
e957391efe
[colr] Add NoVariable::varIdxBase
2022-12-16 11:33:04 -07:00
Behdad Esfahbod
e06de98c36
[var-common] Make VarInstancer take an offset
2022-12-16 11:31:00 -07:00
Behdad Esfahbod
251f9f6213
[open-type] Add VarIdx::add()
2022-12-16 11:29:51 -07:00
Behdad Esfahbod
bf2ae3f0ca
[open-type] Add static_assert for NO_VARIATION
2022-12-16 11:26:24 -07:00
Matthias Clasen
d4496e6405
COLRv1: Apply variations correctly
...
The variations are for xMin, yMin, xMAx, yMax.
Apply them before converting to extents..
2022-12-16 11:14:42 -07:00
Matthias Clasen
193e0e3e8e
Cosmetic: typo fix
2022-12-14 22:34:06 -07:00
Garret Rieger
b5acde43ed
[subset] check pending/subsetted tag sets for alloc failure.
2022-12-13 15:31:40 -07:00
Jordan Petridis
79285a9983
VarC: cast ints ( #3934 )
...
msvc is rightfully complaining that the types on the sides of
the ternary are not matching:
```
C:\pango\subprojects\harfbuzz\src\OT\glyf\VarCompositeGlyph.hh(317): error C2446: ':': no conversion from 'const OT::HBUINT16' to 'const OT::HBUINT8'
```
2022-12-13 11:14:20 -07:00
Behdad Esfahbod
300d82ce2e
Fix compiler warning
2022-12-13 11:01:03 -07:00
Behdad Esfahbod
199345eb29
Merge pull request #3928 from harfbuzz/colrv1-extents
...
COLRv1: use ClipBoxes for extents
2022-12-12 18:37:10 -07:00
Behdad Esfahbod
bd7cb384cf
[VarC] Remove unused variable
2022-12-12 14:10:48 -07:00
Behdad Esfahbod
51d3ce39ba
Merge pull request #3933 from googlefonts/cff
...
[subset] Fix infinite loop when instancing CFF fonts
2022-12-12 14:07:44 -07:00
Behdad Esfahbod
1b278c7658
[VarC] Update for new format
...
https://github.com/harfbuzz/boring-expansion-spec/issues/71
2022-12-12 13:57:05 -07:00
Garret Rieger
64cbe8b962
[subset] Also note that only full instancing works.
2022-12-12 20:41:40 +00:00
Garret Rieger
0da59f86a8
[subset] note that CFF/CFF2 instancing is not yet supported.
2022-12-12 20:26:11 +00:00
Garret Rieger
38a9628885
[subset] simplify handling of table subsetting depedencies.
...
Allow the dependency checker to see all tables that will be subset. Use this to fix the HMTX/VMTX dep check against glyf. Don't delay hmtx/vmtx subsetting if no glyf table is present.
2022-12-12 20:13:17 +00:00
Garret Rieger
0853e5d9d7
[subset] if table dependencies can't be resolved fail the subset.
...
Avoids getting stuck in an infinite loop.
2022-12-12 19:43:31 +00:00
Behdad Esfahbod
6bb478eeeb
[VarC] Clamp after addition
2022-12-12 11:39:06 -07:00
Behdad Esfahbod
80a5011eb6
[VarC] Fix coord setting
...
Those are additive.
2022-12-12 11:37:59 -07:00
Behdad Esfahbod
4e9a6cfb49
[COLR] Use VarStoreInstancer
2022-12-12 10:20:51 -07:00
Behdad Esfahbod
a3a3d37b95
[var] Add VarStoreInstancer
2022-12-12 10:17:41 -07:00
Behdad Esfahbod
c64661b2f8
[COLR] Fix variation code
2022-12-12 10:11:02 -07:00
Behdad Esfahbod
ff332b14ea
[COLR] Handle HB_OT_LAYOUT_NO_VARIATIONS_INDEX
2022-12-11 21:05:14 -07:00
Behdad Esfahbod
9a3f0be291
[COLR] Apply variations in get_extent
2022-12-11 13:40:53 -07:00
Behdad Esfahbod
68964efa55
[COLR] Use bsearch in get_extents
2022-12-11 13:21:01 -07:00
Behdad Esfahbod
d0ee5a452f
[COLR] Return false from get_extents if table version not 1
2022-12-11 13:13:35 -07:00
Behdad Esfahbod
b3d6a5ef86
[colr] Minor no behavior change
2022-12-11 13:12:30 -07:00
Matthias Clasen
7a748ad4ac
COLRv1: use ClipBoxes for extents
...
This is a first step; ultimatively, we
should compute the extents is ClipBoxes
are missing.
2022-12-11 13:12:30 -07:00
Behdad Esfahbod
d36a0f8c42
[COLR] Add TODO
2022-12-11 13:12:19 -07:00
Behdad Esfahbod
a306820681
[colr] Use SortedArray instead of Array
2022-12-11 13:03:55 -07:00
Behdad Esfahbod
b9d5e7a8bb
[colr] Set HB_COLRV1_MAX_NESTING_LEVEL to 16
...
Was 100. That seemed excessive.
2022-12-11 12:54:19 -07:00
Behdad Esfahbod
c17afa48de
[colr] Remove COLRV1_ENABLE_SUBSETTING
2022-12-11 12:53:55 -07:00
Behdad Esfahbod
9ab2c8034e
Revert "[glyf] Use component phantom points after transformation"
...
This reverts commit a756bd1944
.
Fixes https://github.com/harfbuzz/harfbuzz/issues/3929
2022-12-11 12:04:29 -07:00
Behdad Esfahbod
7f73b57bc1
[subset] Graduate L1 instancing API from experimental
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3926
2022-12-10 17:35:52 -07:00
Khaled Hosny
0f4e38cd86
[subset] Small doc fixes
2022-12-10 16:39:26 +02:00
Behdad Esfahbod
bf2e817549
[VarComposites] Support GID24
2022-12-09 23:15:26 -07:00
Behdad Esfahbod
10d38dcdfd
[varc] Change format slightly
...
Fixes https://github.com/harfbuzz/boring-expansion-spec/issues/70
2022-12-09 19:19:57 -07:00
Behdad Esfahbod
af450a757d
[config] Use HB_EXPERIMENTAL_API instead of adhoc HB_EXPERIMENTAL
2022-12-09 19:05:16 -07:00
Behdad Esfahbod
5cf0b9ae7d
[varc] Mark as experimental feature with HB_NO_VAR_COMPOSITES
2022-12-09 18:59:43 -07:00
Behdad Esfahbod
82b4f3791e
[coord-setter] Don't modify font coords
2022-12-09 18:46:33 -07:00
Behdad Esfahbod
e9e503b80b
[Glyph] Pass down coords to get_points
2022-12-09 18:42:46 -07:00
Behdad Esfahbod
8e46870093
[gvar] Take coords in instead of font in apply_deltas_to_points
2022-12-09 18:35:30 -07:00
Behdad Esfahbod
3caa42a4a7
Fix build after rebase
2022-12-09 14:48:41 -07:00
Behdad Esfahbod
bbe59e4211
Whitespace
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
13deea7cbd
[glyf/VarComposite] Clamp axis coordinates
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
a975be4c07
[glyf/VarComposite] Minor rename
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
1e71db2d26
[glyf/VarComposite] Fix transformation
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
1233be61d8
[glyf/VarComposite] Remove unneeded resize
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
1a906162cb
[glyf/coord-setter] Fix memory issue
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
7efd68da39
[glyf/VarComposite] Set coordinates
...
Code is untested but complete!
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
4ec7781497
[glyf] Move coord-setter to its own file
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
dadb4ed71d
[glyf/VarComposite] More, almost there
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
0a939b48a6
[glyf/VarComposite] Implement more
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
65cc3b5e2b
[glyf/VarComposite] More
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
12688ed386
[glyf] Fix distcheck
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
60d959a6e7
[glyf/VarComposite] Add use_my_metrics()
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
575d99406a
[glyf] Flesh out VarCompositeGlyph
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
21f671bc45
[glyf] Add stub VarCompositeGlyph
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
435c5eeffe
[glyf] Split composite-iter
2022-12-09 14:45:29 -07:00
Behdad Esfahbod
1024a013fd
[glyf] Add CoordSetter
2022-12-09 14:45:29 -07:00
Garret Rieger
e66d02126e
[subset] replace subset-processing.md reference with link to it on github.
2022-12-08 16:32:24 -07:00
Garret Rieger
27201ed32b
[subset] fix up hb_subset_preprocess api comment.
2022-12-08 16:32:24 -07:00
Garret Rieger
13b0388351
[subset] link to preprocessing doc from api comment.
2022-12-08 16:32:24 -07:00
Garret Rieger
c097abab52
[subset] set no prune unicode ranges flag in preprocessor.
...
To avoid modifying the original unicode range values in the source font.
2022-12-08 16:32:24 -07:00
Garret Rieger
bc87fe952e
[subset] add note about memory management with preprocessed faces.
2022-12-08 16:32:24 -07:00
Garret Rieger
5e713e99bf
Revert "[map] Speed up is_real()"
...
This reverts commit f5307c3ba8
.
Found to slow down the benchmarks in some cases.
2022-12-08 16:32:24 -07:00
Garret Rieger
eda02c2ebd
[subset] Move hb_subset_preprocess to be non-experimental.
2022-12-08 16:32:24 -07:00
Garret Rieger
76d5482a7c
[subset] always return a valid face from hb_subset_preprocess.
2022-12-08 16:32:24 -07:00
Garret Rieger
35233d2514
[repacker] fix fuzzer reported stack overflow.
...
Fixes https://oss-fuzz.com/testcase-detail/6014493291577344 .
2022-12-07 10:32:56 -07:00
Garret Rieger
f1d3489388
[repacker] bail on failure to alloc assigned_bytes set.
...
Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/5390364397928448 .
2022-12-05 14:13:47 -07:00
Garret Rieger
239a5aca02
[repacker] don't allow references to the null object in graph.
...
Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/6714085985353728
2022-12-05 14:13:47 -07:00
Behdad Esfahbod
4ce0f08897
[coretext] Clamp variation settings to min/max
...
Like our native implementation does; CoreText doesn't itself.
Also fix leak of CFNumber's.
2022-12-05 13:18:34 -07:00
Behdad Esfahbod
22b0390e2d
Revert "[VarData] Don't clear memory we are going to fill in completely"
...
This reverts commit e28e2dad03
.
This made fuzzer unhappy. I'm not sure how.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54044
2022-12-05 09:43:36 -07:00
Behdad Esfahbod
3c497e2458
[harfbuzz-subset.cc] Revert accidental change
...
These extra files are unnecessary, but our generator currently
isn't smart enough to know that. Will fix some time.
2022-12-04 15:35:01 -07:00
Behdad Esfahbod
aa7f5e3742
[subset] Conditionalize call to hb_font_set_variations
2022-12-04 15:33:18 -07:00
Behdad Esfahbod
ad5588e800
[config] If HB_NO_SHAPER then HB_NO_OT_SHAPE
2022-12-04 15:27:59 -07:00
Behdad Esfahbod
1a5c749581
[config] Flesh out HB_NO_SHAPER a bit more
2022-12-04 15:20:51 -07:00
Behdad Esfahbod
2c0abf0258
Revert "[harfbuzz-subset.cc] Trim down!"
...
This reverts commit a335458d57
.
While this can be vastly trimmed down, what I did is not right.
It still depends on hb-face, hb-font, hb-blob, hb-set, and hb-map.
2022-12-04 15:03:36 -07:00
Behdad Esfahbod
a335458d57
[harfbuzz-subset.cc] Trim down!
2022-12-04 14:56:20 -07:00
Behdad Esfahbod
765a3551da
[face-builder] Minor cast
2022-12-04 14:48:32 -07:00
Behdad Esfahbod
3fff6d9084
[face-builder] Initialize face orders to -1
2022-12-04 14:47:38 -07:00
Behdad Esfahbod
805ce9ad3d
[face-builer] Protect against wrong face
...
In hb_face_builder_sort_tables.
2022-12-04 14:43:17 -07:00
Behdad Esfahbod
0acfd2b714
[indic-machine] Regenerate line numbers
2022-12-04 14:01:05 -07:00
Behdad Esfahbod
9704f8354e
Merge branch 'config-header'
2022-12-04 13:58:52 -07:00
Behdad Esfahbod
c1aae14a68
[features.h] Fix autotools build rules
2022-12-04 13:58:39 -07:00
Behdad Esfahbod
0545949f01
[gvar] Minor use array get_size()
2022-12-04 12:44:09 -07:00
Behdad Esfahbod
1bd386515c
[bit-set] Micro-optimize page_for
2022-12-04 12:30:20 -07:00
Behdad Esfahbod
b182e2808a
[bit-set] Don't clear pages when copying set
2022-12-04 12:22:17 -07:00
Behdad Esfahbod
f5307c3ba8
[map] Speed up is_real()
2022-12-04 11:54:16 -07:00
Behdad Esfahbod
301f6e4b47
[Coverage] Remove TODO
2022-12-04 11:46:10 -07:00
Behdad Esfahbod
dbbb8e8006
Revert "[map] Add hb_map_filter_invalid"
...
This reverts commit 8d7e921117
.
Surprisingly this slowed NotoNastaliqUrdu benchmark down by a couple
percent instead of speeding it up.
2022-12-04 11:13:39 -07:00
Behdad Esfahbod
8d7e921117
[map] Add hb_map_filter_invalid
...
Use it in one place.
2022-12-04 11:02:15 -07:00
David Corbett
260df1fa32
[indic] Support <U+0A02, U+0A40>
2022-12-04 10:46:47 -07:00
Behdad Esfahbod
8b533763c0
Use hb_len() instead of .len()
2022-12-03 15:58:12 -07:00
Behdad Esfahbod
e28e2dad03
[VarData] Don't clear memory we are going to fill in completely
2022-12-03 15:56:43 -07:00
Behdad Esfahbod
0e13b4abbc
[VarData] Optimize main loop slightly
2022-12-03 15:50:24 -07:00
Behdad Esfahbod
ad17c0acce
[VarData] Whitespace
2022-12-03 14:56:57 -07:00