Commit Graph

117 Commits

Author SHA1 Message Date
Ebrahim Byagowi c929ccfcea [ot-color/png] Consider strike ppem on scaling 2018-10-28 22:40:40 -07:00
Behdad Esfahbod 01c7d53fb7 [sbix] Select best strike based on ppem 2018-10-28 18:33:10 -07:00
Behdad Esfahbod f9f26bff4c [sbix] Move code around. Add get_extents() 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 632e9af862 [ot-color] Implement PNGHeader and test it, it doesn't work however 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 38706a0746 [ot-color] Preparation for setting PNG width/height in extents 2018-10-28 18:33:10 -07:00
Behdad Esfahbod d6d6f3bc22 [docs] Add comment 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 80d9a427cf [docs] Document remaining sections 2018-10-27 04:58:32 -07:00
Behdad Esfahbod 48ed598a35 [VORG] Hook up to hb-ot-font's v_origin
Fixes https://github.com/harfbuzz/harfbuzz/issues/544

Test added with NotoSansCJK, eg. with U+FF38.
2018-10-23 02:21:27 -07:00
Behdad Esfahbod 8dc6296818 [ot-font] Implement TrueType v_origin
Fixes https://github.com/harfbuzz/harfbuzz/issues/537
2018-10-15 01:09:05 -07:00
Behdad Esfahbod 5515355367 [ot-font] Don't pre-load cmap table
Now that we have get_h_advances() and get_nominal_glyphs() implemented, the
overhead of doing a proper atomic load would be once per run, NOT once per
glyph.  So, no need to pre-load the tables to avoid that overhead.

As such, hb_ot_font_set_funcs() has become really cheap.  Can *finally* make
it be default font functions on all newly created fonts!
2018-10-09 15:12:09 -04:00
Behdad Esfahbod ec84460e46 [ot/ft] Implement get_nominal_glyphs() callback
Some more measurable speedup.  The recent commits' speedups are as follows:

Testing with Roboto, ****when disabling kern and liga****:

Before:

FT --features=-kern,-liga
user↦   0m0.521s

OT --features=-liga,-kern
user↦   0m0.568s

After:

FT --features=-liga,-kern
user↦   0m0.428s

OT --features=-liga,-kern
user↦   0m0.470s

So, 17% speedup.

Note that FT callbacks are faster than OT these days since we added an advance
cache to FT.  I don't think the difference is enough to justify adding a cache
to OT.

When not disabling kern, the thing is three times slower, so the speedups
are three times less impressive...  Still, 5% not bad for a codebase that I
otherwise thought is optimized out.

Note that, because of this and other optimiztions in our main shaper,
disabling kern and liga, the OT shaper is now *faster* than the fallback
shaper.  So, that's my recommendation to clients that need the absolute
fastest...
2018-10-09 15:07:04 -04:00
Behdad Esfahbod bee93e2697 Add const to get_*_advances API
Ouch!
2018-10-09 08:02:25 -04:00
Behdad Esfahbod 47030b1855 [ft/ot] Remove implementation of deprecated kerning funcs 2018-10-09 00:30:45 -04:00
Behdad Esfahbod 13da3be0b3 [ot-font] Load hmtx/vmtx lazily
Since we have get_*_advanes() API now, the overhead is once per shape,
not once per glyph.

Only cmap is warmed-up at set_funcs() time now.
2018-10-07 18:25:41 +02:00
Behdad Esfahbod 856db4c918 Minor 2018-10-07 18:21:15 +02:00
Behdad Esfahbod 8a31e40629 [font] Make *_advance() fallback to *_advances
And remove redundant implementations.
2018-09-30 06:08:11 -04:00
Behdad Esfahbod cbea7d49ab [ot-font] Rename 2018-09-11 12:57:41 +02:00
Behdad Esfahbod d8a67dac2a [ot-font] Add advances() callbacks 2018-09-11 12:55:54 +02:00
Behdad Esfahbod a268068010 [ot-face] Remove tables_t. The face_data_t is what tables_t was 2018-08-26 15:18:46 -07:00
Behdad Esfahbod 3a0b3a29cc Free up hb-ot-face.hh from includes
There might be a better way to do this, but I couldn't find...
2018-08-26 15:11:24 -07:00
Behdad Esfahbod e6cb938065 [ot-face] Unify accelerators and tables 2018-08-26 00:21:29 -07:00
Behdad Esfahbod 59bca0d2cb [ot-font] Rename 2018-08-26 00:06:12 -07:00
Behdad Esfahbod 1c48a7ef06 [ot-font] Cache tables on face, not font 2018-08-25 23:57:16 -07:00
Behdad Esfahbod 71f8893eff [ot-font] Use init0 2018-08-25 23:27:45 -07:00
Behdad Esfahbod f36ae6f8a8 [ot-font] Make everything (cmap/metrics) lazy 2018-08-25 23:26:45 -07:00
Behdad Esfahbod 62fc54725a [ot-font] Fallback vertical advance to UPEM
Used to be ascent+descent.  Whatever. This is more convenient for
upcoming changes.
2018-08-25 23:15:52 -07:00
Behdad Esfahbod c77ae40852 Rename hb-*private.hh to hb-*.hh
Sorry for the noise, downstream custom builders.  Please adjust.
2018-08-25 22:36:36 -07:00
Emil A Eklund 7112c6413c Guard free_static function definitions with macro
Add HB_USE_ATEXIT macros around free_static function definitions to
avoid unused function compiler warnings/errors.
2018-08-14 14:04:10 -07:00
Behdad Esfahbod 7bd508a0c4 [lazy] Rename free() 2018-08-12 17:19:55 -07:00
Behdad Esfahbod bb905e9afc [lazy] Minor 2018-08-12 16:44:44 -07:00
Behdad Esfahbod 53442be1ed [lazy] Use for ft_library 2018-08-12 16:20:11 -07:00
Behdad Esfahbod 7a8d480378 [lazy] Add .free() 2018-08-12 16:00:13 -07:00
Behdad Esfahbod c7ca30a533 [ot/ft] Port font_funcs statis to lazy-loader 2018-08-12 13:46:53 -07:00
Behdad Esfahbod 1f7380944d [atomic] Add hb_atomic_ptr_t<> and port all uses
Found and fixed a couple bugs.

Found a couple multithreading issues.  Marked them with "XXX-MT-bug".
2018-08-09 00:27:01 -07:00
Behdad Esfahbod 30ff8ac865 Rename 2018-08-03 17:33:13 -07:00
Behdad Esfahbod c988b11999 Move code around 2018-08-02 22:55:52 -07:00
Behdad Esfahbod 574b37e933 Minor 2018-08-02 02:22:38 -07:00
Behdad Esfahbod ff7826e90b Reduce storage by sharing face amongst lazy_loaders 2018-08-02 01:29:05 -07:00
Behdad Esfahbod ed7b2e58fc Remove OT namespace from hb-machinery-private.hh 2018-08-02 00:08:08 -07:00
Ebrahim Byagowi 24b8b9b227 Resolve clang's used-but-marked-unused warnings 2018-04-23 11:38:45 -07:00
Ebrahim Byagowi 70d36543aa Make atexit callbacks threadsafe (#930) 2018-03-29 17:30:28 -07:00
Ebrahim Byagowi 0ef6ab25ab
[ot-color] Move cbdt to the namespace (#860) 2018-03-04 02:47:26 +03:30
Behdad Esfahbod 7b40876a58 [ot] Remove unneeded TODO item
Looks like hb-ot-font is complete after all!

CFF font names and CFF glyph metrics don't work though...
2017-11-14 20:22:05 -08:00
Behdad Esfahbod eab4feb5e2 [hmtx] Use curiously recurring template pattern
https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern
2017-11-14 20:17:15 -08:00
Behdad Esfahbod 977ddff1f1 [ot] Move hb_ot_face_cmap_accelerator_t 2017-11-14 20:06:19 -08:00
Behdad Esfahbod a85d7ead04 [ot] Move hb_ot_face_metrics_accelerator_t 2017-11-14 20:00:34 -08:00
Behdad Esfahbod 7e2839c438 [ot] Move hb_ot_face_glyf_accelerator_t 2017-11-14 19:52:29 -08:00
Behdad Esfahbod c4e18e54dc [ot] Move hb_ot_face_cbdt_accelerator_t 2017-11-14 19:52:26 -08:00
Behdad Esfahbod 9b04b0384f [ot] Fold hb_ot_face_post_accelerator_t 2017-11-14 19:31:50 -08:00
Behdad Esfahbod 702d86ba6b [ot] Fold hb_ot_face_kern_accelerator_t 2017-11-14 19:25:51 -08:00