Commit Graph

161 Commits

Author SHA1 Message Date
Behdad Esfahbod 1432df102e [config] Disable hb-ot-font code if HB_NO_OT_FONT
Part of https://github.com/harfbuzz/harfbuzz/issues/1652
2019-06-19 18:32:40 -07:00
Behdad Esfahbod d7e27cd65a [config] Don't use VORG table if HB_NO_OT_FONT_CFF
Part of https://github.com/harfbuzz/harfbuzz/issues/1652
2019-06-18 14:38:05 -07:00
Behdad Esfahbod eb2825c7f1 Minor 2019-06-17 13:42:53 -07:00
Behdad Esfahbod a6048e4cd0 Fix build 2019-05-11 12:11:22 -07:00
Behdad Esfahbod 32d3c06b61 Disable sbix if no-color or no-ot-font-bitmap
Part of https://github.com/harfbuzz/harfbuzz/issues/1652
2019-05-11 11:59:18 -07:00
Behdad Esfahbod 227d85e138 Minor 2019-05-10 23:16:14 -07:00
Behdad Esfahbod 60a58aa61c Add HB_NO_OT_FONT_BITMAP
Part of https://github.com/harfbuzz/harfbuzz/issues/1652
2019-04-12 14:58:53 -04:00
Behdad Esfahbod 160c4d8b2d Add HB_NO_OT_FONT_CFF
Part of https://github.com/harfbuzz/harfbuzz/issues/1652
2019-04-12 14:57:49 -04:00
Evgeniy Reizner d29c8424c8 Typo (#1588)
Fixed a small typo.
[skip ci]
2019-02-19 20:05:00 +03:30
Behdad Esfahbod 447323b85a Better fix for -Wcast-align errors 2019-01-22 12:50:12 +01:00
Behdad Esfahbod 81ec543d80 More -Wcast-error fixes 2019-01-22 12:43:12 +01:00
Behdad Esfahbod 8d05bf7dc0 Fix cast-align error
If compiler doesn't inline StructAtOffset, this was an error since we
only disable cast-align at call-site.  So, move the cast out.

../src/hb-machinery.hh: In instantiation of 'const Type& StructAtOffset(const void*, unsigned int) [with Type = unsigned int]':
../src/hb-font.cc:146:85:   required from here
../src/hb-machinery.hh:63:12: error: cast from 'const char*' to 'const unsigned int*' increases required alignment of target type [-Werror=cast-align]
 { return * reinterpret_cast<const Type*> ((const char *) P + offset); }
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/hb-machinery.hh: In instantiation of 'Type& StructAtOffset(void*, unsigned int) [with Type = unsigned int]':
../src/hb-font.cc:147:79:   required from here
../src/hb-machinery.hh:66:12: error: cast from 'char*' to 'unsigned int*' increases required alignment of target type [-Werror=cast-align]
 { return * reinterpret_cast<Type*> ((char *) P + offset); }
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-01-22 12:34:05 +01:00
Behdad Esfahbod b900f78088 [pragma] More cast-align whitelist 2019-01-18 10:08:23 -05:00
Ebrahim Byagowi e412008599 Remove redundant void from C++ sources (#1486) 2018-12-17 13:01:01 -05:00
Ebrahim Byagowi b2ebaa9afa Remove redundant 'inline' from methods (#1483) 2018-12-16 14:08:10 -05:00
Michiharu Ariza 32d291ae89 Merge branch 'master' into cff-subset 2018-11-28 16:27:45 -08:00
Behdad Esfahbod b89c7fd3dc Allow defining HB_USE_ATEXIT to 0
That's better use of that value than requiring extra macro HB_NO_ATEXIT
2018-11-21 12:32:48 -05:00
Michiharu Ariza 892ab37e7c Merge branch 'master' into cff-subset 2018-11-14 13:54:07 -08:00
Ebrahim Byagowi 7867c2bad0
[STAT] Add table parsing (#1384) 2018-11-14 22:13:50 +03:30
Michiharu Ariza 43ee0e4d00 Merge branch 'master' into cff-subset 2018-11-06 09:57:17 -08:00
Behdad Esfahbod 9198de7b9b [ot-font] Remove ensure 2018-11-05 23:10:37 -05:00
Behdad Esfahbod 0fe7a745c9 [ot-face] Simplify more table access 2018-11-05 23:10:18 -05:00
Behdad Esfahbod 914b595f25 [ot-face] Include hb-ot-face directly in hb_face_t
Simplifying access coming next.
2018-11-05 23:10:12 -05:00
Behdad Esfahbod 56ba998cdd [cmap] Push get_nominal_glyphs down into cmap accelerator 2018-11-05 19:49:54 -05:00
Behdad Esfahbod 03348ce005 Minor 2018-11-05 12:59:32 -05:00
Michiharu Ariza e600e5440b Merge branch 'master' into cff-subset 2018-11-01 16:13:56 -07:00
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
Michiharu Ariza e1241636d6 Merge branch 'master' into cff-subset 2018-10-23 11:25:51 -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
Michiharu Ariza 9ade3e7bb8 Merge branch 'master' into cff-subset 2018-10-15 14:03:23 -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
Michiharu Ariza c06a5dff0b Merge branch 'master' into cff-subset 2018-10-09 22:00:10 -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
Michiharu Ariza f5f505b512 Merge branch 'master' into cff-subset 2018-10-09 10:10:35 -07:00
Behdad Esfahbod bee93e2697 Add const to get_*_advances API
Ouch!
2018-10-09 08:02:25 -04:00
Michiharu Ariza 8b349040e9 Merge branch 'master' into cff-subset 2018-10-08 21:46:23 -07:00
Behdad Esfahbod 47030b1855 [ft/ot] Remove implementation of deprecated kerning funcs 2018-10-09 00:30:45 -04:00
Michiharu Ariza a90fd8b9fe Merge branch 'master' into cff-subset 2018-10-08 15:07:58 -07:00
Michiharu Ariza b51418f596 added CFF2 get_extents
added source hb-ot-cff2-table.cc
augmented VariationData to return scalars
misc bug fixes, renaming, cleanup
2018-10-08 15:05:36 -07: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
Michiharu Ariza 3dd43f0234 Merge branch 'master' into cff-subset 2018-10-01 10:22:06 -07:00
Behdad Esfahbod 8a31e40629 [font] Make *_advance() fallback to *_advances
And remove redundant implementations.
2018-09-30 06:08:11 -04:00