src/hb-ft.cc


Log

Author Commit Date CI Message
Ebrahim Byagowi 24b8b9b2 2018-04-23T19:03:57 Resolve clang's used-but-marked-unused warnings
Ebrahim Byagowi f24b0b97 2018-04-12T13:40:45 Update the links and revive the dead ones
Ebrahim Byagowi 70d36543 2018-03-30T05:00:28 Make atexit callbacks threadsafe (#930)
Bruce Mitchener 90218fa9 2018-01-31T20:44:45 Fix typos.
Behdad Esfahbod 0473d95e 2018-01-08T10:07:46 [ft] Use FT_Done_MM_Var() if available
Behdad Esfahbod cb43bdbc 2018-01-05T13:06:25 [ft] If there's no variations set, don't set them on hb-font
Olivier Blin 0fd89dc6 2017-12-04T18:58:41 [hb-ft] Fix build when Multiple Master font support is disabled in freetype FT_Set_Var_Blend_Coordinates() is not available when "Multiple Master font interface" is disabled in freetype's modules.cfg
Behdad Esfahbod 93f7c165 2017-11-14T10:59:54 Revert "[glib/ucdn/icu/ft/ot] Make returned funcs inert" This reverts commit 5daf3bd4494cce6b4fb074533be9e99c4d9e0edd. If other atexit callbacks try to destruct the objects we destruct in atexit callbacks, bad things will happen. I'll come up with some other way to catch premature destruction of HB-owned objects. Fixes https://github.com/behdad/harfbuzz/issues/618
Behdad Esfahbod 40ec3bbb 2017-11-03T16:57:30 Consolidate debug stuff into hb-debug.hh Part of fixing https://github.com/behdad/harfbuzz/pull/605
Behdad Esfahbod 5daf3bd4 2017-10-27T16:34:01 [glib/ucdn/icu/ft/ot] Make returned funcs inert Such that client cannot accidentally destroy them, even though that will be a bug in their code...
Behdad Esfahbod 473b17af 2017-10-15T14:10:34 Remove unused hb_cache_t
Behdad Esfahbod dbdbfe3d 2017-10-15T12:11:08 Use nullptr instead of NULL
Behdad Esfahbod 4e478131 2017-10-12T10:33:16 [ft] Add hb_ft_font_changed() When the font size or variations settings on underlying FT_Face change, one can call hb_ft_font_changed() and continue using hb_font created using hb_ft_font_create(). Fixes https://github.com/behdad/harfbuzz/issues/559 New API: hb_ft_font_changed()
Behdad Esfahbod e1b6d923 2017-10-11T15:51:31 Remove cast of functions to (hb_destroy_func_t) Fixes https://github.com/behdad/harfbuzz/issues/474
Behdad Esfahbod ac8c4e56 2017-08-09T22:05:08 [ft] Fix theoretical leak
Behdad Esfahbod 68af14d5 2017-08-09T17:09:21 Protect against div-by-zero in CBDT extent code Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1452#c5 CC https://github.com/behdad/harfbuzz/issues/139
Behdad Esfahbod 7647a05a 2017-01-22T17:47:49 Minor
Behdad Esfahbod 825e4040 2017-01-22T16:41:45 [hb-ft] Remove use of variable-length array Hopefully also fixes build failure on msvc.
Behdad Esfahbod 47ee34e8 2017-01-21T18:10:08 [var] Hook up variations to FreeType face hb-view correctly renders variations with ft font-funcs now. hb-ot-font needs HVAR implementation.
Behdad Esfahbod b8376b10 2017-01-20T18:19:28 Minor
Behdad Esfahbod 42c81425 2016-09-13T23:49:46 [GX] Fix build with older FreeType
Sascha Brawer 72873cf5 2016-09-13T18:40:07 Call hb_font_set_var_coords_normalized() from FT_Face coords
Behdad Esfahbod 33317310 2016-08-08T17:24:04 Fix sign of shift operators This one: map->mask = (1 << (next_bit + bits_needed)) - (1 << next_bit); before the fix, the shift was done as an int, causing overflow if it ever got to 1 << 31. Sprinkle 'u's around. Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=634805
Behdad Esfahbod 34f9aa58 2016-07-20T02:35:54 Implement symbol cmap in ft and ot fonts Fixes https://github.com/behdad/harfbuzz/issues/236 Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=627953
Birunthan Mohanathas 6bf9db4f 2016-07-11T13:38:23 [ft] Fix unsafe cast of FT_Done_Face in hb_ft_{face,font}_create_referenced (#289) Prior to this change the function `FT_Error FT_Done_Face(FT_Face *)` was called through a pointer with the signature `void (void *)` resulting in undefined behaviour.
Behdad Esfahbod 8b5bc141 2016-02-24T19:05:23 Add get_nominal_glyph() and get_variation_glyph() instead of get_glyph() New API: - hb_font_get_nominal_glyph_func_t - hb_font_get_variation_glyph_func_t - hb_font_funcs_set_nominal_glyph_func() - hb_font_funcs_set_variation_glyph_func() - hb_font_get_nominal_glyph() - hb_font_get_variation_glyph() Deprecated API: - hb_font_get_glyph_func_t - hb_font_funcs_set_glyph_func() Clients that implement their own font-funcs are encouraged to replace their get_glyph() implementation with a get_nominal_glyph() and get_variation_glyph() pair. The variation version can assume that variation_selector argument is not zero.
Behdad Esfahbod 31fa3892 2015-12-10T16:38:29 [ft] Use ftface->size->metrics for font extent info
Simon Cozens 6f2e6de1 2015-10-26T16:23:22 Get font ascender and descender metrics from OS/2 table.
Behdad Esfahbod c743ec58 2015-11-05T17:33:57 [ft] Fix extents with negative scales Fixes https://github.com/behdad/harfbuzz/issues/162
Behdad Esfahbod 44f82750 2015-11-04T20:40:05 [ft] Remove font funcs that do nothing
Behdad Esfahbod 7918c261 2015-11-04T20:37:49 [ft] Port ft font funcs to allocated object
Behdad Esfahbod ca97ea7a 2015-10-15T20:20:22 [ft] Revert change-of-behavior of hb_ft_font_create() introduced in 1.0.5 The default FreeType load flags where changed from FT_LOAD_NO_HINTING to FT_LOAD_DEFAULT in 2a9627c5641cd000e2adff0e42a0dc687b53ec70. This is crashing HarfBuzz-enabled FreeType as I suppose it causes infinite recursion between HB and FT autohinter... Revert the behavior change. Fixes https://github.com/behdad/harfbuzz/issues/143
Behdad Esfahbod edeb3dab 2015-10-08T12:47:15 [ft] Add version for new API
Behdad Esfahbod 2a9627c5 2015-10-07T17:33:20 [ft] API: Add hb_font_[sg]et_load_flags() API This changes the default load_flags of fonts created using hb_ft_font_create() from NO_HINTING to DEFAULT. Hope that doesn't break too much client code. Code calling hb_ft_font_set_funcs() is unaffected.
Behdad Esfahbod b8811429 2015-09-03T15:53:22 Fix Since tags Fixes https://github.com/behdad/harfbuzz/issues/103
Sascha Brawer 01c3a885 2015-06-01T13:22:01 Fix "Since:" tags Based on data from http://upstream-tracker.org/versions/harfbuzz.html Resolves #103
Behdad Esfahbod 9df099b4 2015-05-18T18:37:06 [ft] Don't set *glyph in get_glyph() if glyph not found
Behdad Esfahbod 7888a6b0 2015-01-28T12:40:40 [ft] Handle negative scales with vertical writing
Behdad Esfahbod a319d077 2015-01-23T12:44:24 [ft] Handle negative x_scale / y_scale
Chris Peterson fb85d618 2015-01-04T19:31:10 Add #ifdef HB_USE_ATEXIT to fix -Wunused-function warnings
Behdad Esfahbod f34aaba8 2014-12-28T18:56:15 [ft] Don't set font ppem For discussion see: http://lists.freedesktop.org/archives/harfbuzz/2012-April/001905.html Over time we have had added NO_HINTING all over the place in hb-ft. Finish it off. Not setting ppem on hb-font disables get_contour_point() calls which is good anyway. See comments in the commit.
Behdad Esfahbod 350f3a02 2014-12-28T17:44:26 [ft] Add hb_ft_face_create_referenced() and hb_ft_font_create_referenced() When I originally wrote hb-ft, FreeType objects did not support reference counting. As such, hb_ft_face_create() and hb_ft_font_create() had a "destroy" callback and client was responsible for making sure FT_Face is kept around as long as the hb-font/face are alive. However, since this was not clearly documented, some clienets didn't correctly did that. In particular, some clients assumed that it's safe to destroy FT_Face and then hb_face_t. This, indeed, used to work, until 45fd9424c723f115ca98995b8f8a25185a6fc71d, which make face destroy access font tables. Now, I fixed that issue in 395b35903e052aecc97d0807e4f813c64c0d2b0b since the access was not needed, but the problem remains that not all clients handle this correctly. See: https://bugs.freedesktop.org/show_bug.cgi?id=86300 Fortunately, FT_Reference_Face() was added to FreeType in 2010, and so we can use it now. Originally I wanted to change hb_ft_face_create() and hb_ft_font_create() to reference the face if destroy==NULL was passed in. That would improve pretty much all clients, with little undesired effects. Except that FreeType itself, when compiled with HarfBuzz support, calls hb_ft_font_create() with destroy==NULL and saves the resulting hb-font on the ft-face (why does it not free it immediately?). Making hb-face reference ft-face causes a cycling reference there. At least, that's my current understanding. At any rate, a cleaner approach, even if it means all clients will need a change, is to introduce brand new API. Which this commit does. Some comments added to hb-ft.h, hoping to make future clients make better choices. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=75299
Behdad Esfahbod 9a3b7488 2014-12-28T17:27:39 Remove redundant check for FT_Face_GetCharVariantIndex We require FreeType >= 2.8.3. This symbol was introduced earlier than that.
Behdad Esfahbod affacf2f 2014-12-28T16:20:31 [ft] Open blob in READONLY mode HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE is deprecated and fairly useless now.
Behdad Esfahbod 8afaf096 2014-10-02T16:40:41 [ft] Add NO_HINTING in a couple other places
Behdad Esfahbod 38fb30d7 2014-08-06T13:34:49 Use atexit() only if it's safe to call from shared library Apparently they are not (advertised as?) safe on BSD systems. We ignore the case of static libraries. Whitelisted on glibc, Android, and MSVC / mingw. https://bugs.freedesktop.org/show_bug.cgi?id=82246
Behdad Esfahbod 83408cf8 2013-11-06T14:46:04 Fix llvm warnings on Mac Patch from Scott Fleischman. Warnings were: harfbuzz/src/hb-font-private.hh:121:42: Implicit conversion loses integer precision: 'long long' to 'hb_position_t' (aka 'int') harfbuzz/src/hb-font-private.hh:126:42: Implicit conversion loses integer precision: 'long long' to 'hb_position_t' (aka 'int') harfbuzz/src/hb-font-private.hh:400:85: Implicit conversion loses integer precision: 'long long' to 'hb_position_t' (aka 'int') harfbuzz/src/hb-ot-layout-common-private.hh:1115:37: Implicit conversion loses integer precision: 'long long' to 'int' harfbuzz/src/hb-ft.cc:421:97: Implicit conversion loses integer precision: 'unsigned long long' to 'int' harfbuzz/src/hb-ft.cc:422:97: Implicit conversion loses integer precision: 'unsigned long long' to 'int'
Behdad Esfahbod 755b44cc 2013-10-18T11:17:42 [ft] Round metrics instead of truncate Lohit-Punjabi has a upem of 769! We were losing one unit in our code, and FreeType is losing another one... Test with U+0A06. Has an advance of 854 in the font. We were producing 852. Now we do 853, which is what FreeType is telling us.
Behdad Esfahbod ace5c7eb 2013-09-13T20:34:42 [introspection] hb-ft annotations
Behdad Esfahbod e509d35c 2013-07-11T14:56:45 [ft] hb_ft_get_glyph_from_name fails for the name of glyph id 0 Based on patch from Jonathan Kew, as reported on the mailing list.
Behdad Esfahbod 79d1007a 2013-06-13T19:01:07 If variation selector is not consumed by cmap, pass it on to GSUB This changes the semantics of get_glyph() callback and expect that callbacks return false if the requested variant is not available, and then we will call them back with variation_selector=0 and will retain the glyph for the selector in the glyph stream. Apparently most Mongolian fonts implement the Mongolian Variation Selectors using GSUB, not cmap. https://bugs.freedesktop.org/show_bug.cgi?id=65258 Note that this doesn't fix the Mongolian shaping yet, because the way that's implemented is that the, say, 'init' feature ligates the letter and the variation-selector. However, since currently the variation selector doesn't have the 'init' mask on, it will not be matched...
Behdad Esfahbod 190e19e6 2013-03-09T20:30:22 [ft] Remove TODO items that I'm not going to fix
Behdad Esfahbod 392ee974 2013-03-09T20:27:55 [ft] Remove TODO item re FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH That flag is redundant, deprecated, and ignored since April 2011. From FreeType git log: commit 8c82ec5b17d0cfc9b0876a2d848acc207a62a25a Author: Behdad Esfahbod <behdad@behdad.org> Date: Thu Apr 21 08:21:37 2011 +0200 Always ignore global advance. This makes FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH redundant, deprecated, and ignored. The new behavior is what every major user of FreeType has been requesting. Global advance is broken in many CJK fonts. Just ignoring it by default makes most sense. * src/truetype/ttdriver.c (tt_get_advances), src/truetype/ttgload.c (TT_Get_HMetrics, TT_Get_VMetrics, tt_get_metrics, compute_glyph_metrics, TT_Load_Glyph), src/truetype/ttgload.h: Implement it. * docs/CHANGES: Updated.
Behdad Esfahbod 5594c2d1 2013-03-06T19:37:31 [FT] Just return if glyph name not found The fallback happens in higher level already. No need to do here.
Behdad Esfahbod e9171af5 2013-01-29T22:45:00 Bug 60053 - hb-common.cc:181:6: warning: ‘void free_langs()’ defined but not used
Behdad Esfahbod d05ac7dc 2012-11-12T10:26:50 Fix hb-ft glyph name for broken fonts that return empty glyph names
Behdad Esfahbod 21756934 2012-08-08T01:20:45 [OT] Implement fallback positioning Implemented for Arabic, Hebrew, and generic marks. Activated if no GPOS table present.
Behdad Esfahbod 271c8f89 2012-07-13T09:32:30 Minor
Behdad Esfahbod 2023e2b5 2012-07-11T19:00:30 [ft] Disable ppem setting The calculations were wrong. FreeType makes it really hard to set size and ppem independently. For now, disable it. Need to come up with a fix later.
Behdad Esfahbod cdf74445 2012-07-11T18:52:39 [ft] Use unfitted kerning if x_ppem is zero
Behdad Esfahbod 0594a244 2012-06-05T20:35:40 Cleanup TRUE/FALSE vs true/false
Behdad Esfahbod f64b2ebf 2012-06-05T19:23:29 Remove last static initializer We're free! Lazy or immediate...
Behdad Esfahbod 04aed572 2012-06-05T18:30:19 Make hb-ft static-initializer free
Behdad Esfahbod f06ab8a4 2012-06-05T12:31:51 Better hide nil objects and make them const
Behdad Esfahbod bce09552 2012-05-27T11:29:21 Add hb_font_get_glyph_name() and hb_font_get_glyph_from_name()
Behdad Esfahbod 323190c2 2012-04-12T12:29:10 Minor
Behdad Esfahbod 0b7e4d9f 2011-08-15T20:41:59 [ft] FT_Get_Advance() for advance-width callbacks Using graphite2's comparerenderer suggests that this makes hb-ft 15 times faster. No caching layer needed anymore.
Behdad Esfahbod 553bc3de 2011-08-15T16:21:06 Minor
Behdad Esfahbod 254142bb 2011-08-15T16:15:44 [ft] FT_Select_Charmap() when we create face
Behdad Esfahbod 9527fb20 2011-08-13T19:03:48 Fix missing return
Behdad Esfahbod 01ec13a1 2011-08-10T22:00:35 Implement hb_ft_font_get_face
Behdad Esfahbod 13a601fe 2011-08-09T11:36:54 [FT] Don't make font immutable
Behdad Esfahbod 38b21187 2011-08-09T10:51:24 [API] Add hb_ft_font_set_funcs(), remove hb_ft_get_font_funcs() Remove hb_ft_get_font_funcs() as it cannot be used by the user anyway. Add hb_ft_font_set_funcs(). Which will make the font internally use FreeType. That is, no need for the font to have created using the hb-ft API. Just create using hb_face_create()/hb_font_create() and then call this on the font (after having set font scale). This internally creates an FT_Face and attached to the font.
Behdad Esfahbod de1e1cf9 2011-08-09T00:19:38 [FT] Adapt to new face API
Behdad Esfahbod 3897335c 2011-08-08T23:37:41 [API] Sort out get_blob API hb_face_get_blob() renamed to hb_face_reference_blob(), returns a reference now. hb_face_[sg]et_index() added. hb_face_set_upem() added.
Behdad Esfahbod e715784b 2011-08-08T21:42:02 Rename get_table to reference_table in all API
Behdad Esfahbod c605bbbb 2011-08-04T20:00:53 Remove C++ guards from source files Where causing issues for people with MSVC.
Behdad Esfahbod 2d8ebcb9 2011-05-25T11:27:33 [API] One last font-funcs API change Now that vertical text works correctly, I'm doing a last round modification of the font-funcs API to simplify. Expect no more changes around here.
Behdad Esfahbod 60fbb360 2011-05-19T18:46:15 [Vertical] GPOS is always done with horizontal origin
Behdad Esfahbod 8b38faee 2011-05-19T13:08:00 More vertical Starting to get there, but not without yet another round of changes. I think I know wheere to go now.
Behdad Esfahbod 19098185 2011-05-17T23:27:22 Cosmetic
Behdad Esfahbod 7e2c85de 2011-05-17T17:55:03 [API] Vertical support, take 2 I like this API *much* better. Implementation still incomplete, but horizontal works.
Behdad Esfahbod 744970af 2011-05-16T18:15:37 [API] Add support for vertical text Design not final yet, and in fact I'm going to change it immediately, but this is an standalone change for itself.
Behdad Esfahbod 56d12e03 2011-05-16T16:01:58 Remove unnecessary TODO item
Behdad Esfahbod 0fd8c2f1 2011-05-12T15:14:13 [API] Make get_glyph() callback return a boolean We need to know whether the glyph exists, so we can fallback to composing / decomposing. Assuming that glyph==0 means "doesn't exist" wouldn't work for applications like Pango that want to use different "doesn't exist" glyph codes for different characters. An explicit return value fixes that.
Behdad Esfahbod 805af724 2011-05-12T12:39:40 Rename get_kernings() arguments from first/second_glyph to left/right_glyph Makes it clear that kerning is in visual order.
Behdad Esfahbod 7033518f 2011-05-11T23:31:15 [API] Pass face to get_table()
Behdad Esfahbod b4678278 2011-05-11T23:25:28 [API] Remove const from font user_data
Behdad Esfahbod 9a14688e 2011-05-11T22:49:29 [API] Rename hb_face_create_for_data() to hb_face_create()
Behdad Esfahbod a513dbcf 2011-05-11T00:24:34 [API] Change signature of get_contour_point and get_kerning ffuncs get_contour_point now takes glyph id before point_index. get_kerning now takes a vector to fill-in.
Behdad Esfahbod b9d975b9 2011-05-10T20:41:13 [API] Pass down closure user_data to font funcs
Behdad Esfahbod d2928858 2011-05-03T01:03:53 [ft] Fix font->face handling Don't use _cached()
Behdad Esfahbod 72657e4c 2011-05-02T20:46:32 [API] Make hb_font_create() take a face and reference it
Behdad Esfahbod fca368c4 2011-04-21T18:24:02 Add hb_object_header_t which is the common part of all objects Makes way for adding arbitrary user_data support.
Behdad Esfahbod 2409d5f8 2011-04-21T17:14:28 Update Copyright headers
Behdad Esfahbod 783a7d69 2011-04-21T16:03:59 [TODO] Remove finished items
Behdad Esfahbod c57d454a 2011-04-20T18:50:27 Rename all private sources and headers to C++ files So we can liberally use the simple features of C++ that parts of the codebase is already using.
Behdad Esfahbod cc6d5227 2010-07-23T15:00:13 De-C++ where possible Helps with avoiding many "extern C" declarations in source files.
Behdad Esfahbod c442672e 2010-05-24T18:02:32 Fix struct initializers
Behdad Esfahbod 750a2294 2010-05-20T16:23:27 get_table() is allowed to return NULL. Use that to simplify code