src/hb-coretext.cc


Log

Author Commit Date CI Message
Khaled Hosny 68c1798a 2019-12-18T15:57:14 [coretext] Use kCTFontOpenTypeFeatureTag Instead of trying to map OpenType features to AAT feature selectors which only works for a small subset of OpenType features, use the simpler kCTFontOpenTypeFeatureTag with OpenType feature tags directly. With this change, features like cvXX can be enabled in coretext shaper, while they were previously ignored due to missing mapping. This seems to work even with AAT fonts that don’t have OpenType layout tables, which suggests that CoreText is doing the mapping itself in this case. kCTFontOpenTypeFeatureTag seems to have been introduced in macOS 10.10 and iOS 8.0, though, so its use is conditional on version check for now. Not sure how to check iOS version, so I left this out.
Ebrahim Byagowi f3214df6 2019-09-14T10:56:00 [coretext] Fix double promotion warnings by making casts explicit
Ebrahim Byagowi a0b4ac4d 2019-08-24T17:57:14 Turn 8 spaces to tab across the project According to the current code style of the project
Ebrahim Byagowi 37de38ad 2019-08-20T12:59:33 Merge branch 'master' into remove-coretext-96dpi-assumption
Ebrahim Byagowi 9fea6b4d 2019-07-05T18:46:41 [amalgam] Use it in cmake port and fix conflicts (#1812)
Misty De Meo e7108881 2019-06-18T15:20:38 coretext: remove trailing macro from SCRATCH_RESTORE
Behdad Esfahbod 10bac21b 2019-06-18T15:15:06 [coretext/uniscribe/directwrite] Remove extra semicolons Fixes https://github.com/harfbuzz/harfbuzz/pull/1783
Behdad Esfahbod aa3450ca 2019-06-17T22:41:49 [config] Don't compile disabled features This makes it possible to include all .cc files into build, even if not building CoreText, Uniscribe, etc. This was mostly to help custom builders. But also means that we can include all files in our own build system. Not sure if we should. Definitely simplifies things, but slightly only.
Behdad Esfahbod 68e12e68 2019-05-13T17:28:59 Fix more semi-colon issues
Behdad Esfahbod 2fb3a832 2019-05-10T18:40:29 [vector] Simplify arrayZ Was turned into function when we had static ones and wanted to be move-safe... Not the case anymore.
Behdad Esfahbod 0601a19d 2019-05-08T07:47:36 Fix a few more double-pomotion errors
Behdad Esfahbod 41248cce 2019-05-07T20:54:31 Remove MIN/MAX in favor of hb_min/hb_max
Behdad Esfahbod 95df00ae 2019-04-12T17:50:03 Hide a few static methods Looks like static methods that do not get inlined end up exported. We have a lot more. Need to protect all at some point. Wish there was an easier way, like the visibility flag we pass that automatically hides all inline methods. Was exposed by check-symbols.sh when compiling on OS X 10.14 with: $ make CPPFLAGS=-Oz CXXFLAGS=-flto=thin LDFLAGS=-lc++
Behdad Esfahbod c5509be9 2019-04-08T14:50:58 [coretext] Fix unused-variable error Fixes https://github.com/harfbuzz/harfbuzz/issues/1659
Ebrahim Byagowi ba4b7be4 2019-03-31T01:32:30 Remove coretext_aat shaper (#1581) coretext_aat was a temporary shaper to redirect shaping of AAT fonts to CoreText and leaving the rest for HarfBuzz. As HarfBuzz now supports AAT and Chrome now actually ships that on a stable version on macOS, we no longer care about such use-case. If a client really wants 100% metrics compatibility with CoreText better to use it directly or through our API. Replicating the same behavior still is possible using hb_shape_full, something we don't care or like to offer anymore. Fixes https://github.com/harfbuzz/harfbuzz/issues/1478
Ken fdfa3d29 2019-02-10T23:46:05 hb-coretext.cc: remove TARGET_OS_MAC from test (#1578) it is always true when building on APPLE systems and this file only builds on APPLE systems
Ken Cunningham 7859decd 2019-02-05T20:26:49 hb-coretext.cc: clean up macosx test TARGET_OS_OSX was introduced only in late OS versions so always returns as "0" on older systems. if !TARGET_OS_IPHONE can work, as it returns as !0 on older systems where TARGET_OS_IPHONE is not defined, but is not specific if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) is both specific and accurate on all systems.
Tor Arne Vestbø f401f85a 2018-12-17T00:48:35 Remove assumption about Core Text working in 96 DPI Core Text doesn't actually have a concept of DPI internally, as it doesn't rasterize anything by itself, it just generates vector paths that get passed along to Core Graphics. In practice this means Core Text operates in the classical macOS logical DPI of 72, with one typographic point corresponding to one point in the Core Graphics coordinate system, which for a normal bitmap context then corresponds to one pixel -- or two pixels for a "retina" context with a 2x scale transform. Scaling the font point sizes given to HarfBuzz to an assumed DPI of 96 is problematic with this in mind, as fonts with optical features such as 'trak' tables for tracking, or color glyphs, will then base the metrics off of the wrong point size compared to what the client asked for. This in turn causes mismatches between the metrics of the shaped text and the actual rasterization, which doesn't include the 72 to 96 DPI scaling. If a 96 DPI is needed, such as on the Web, the scaling should be done outside of HarfBuzz, allowing the client to keep the DPI of the shaping in sync with the rasterization. The recommended way to do that is by scaling the font point size, not by applying a transform to the target Core Graphics context, to let Core Text choose the right optical features of the target point size, as described in WWDC 2015 session 804: https://developer.apple.com/videos/play/wwdc2015/804/
Behdad Esfahbod 474a1205 2018-12-21T18:46:51 [array/vector] Rename len to length
Ebrahim Byagowi e4120085 2018-12-17T21:31:01 Remove redundant void from C++ sources (#1486)
Ebrahim Byagowi d0a250a7 2018-12-04T23:42:13 Reuse hb_aat_layout_has_* logic in coretext-aat detection logic (#1442)
Behdad Esfahbod 27a6b0a2 2018-11-29T16:29:30 Fix build for realz
Behdad Esfahbod ac026471 2018-11-29T15:07:44 [coretext] Fix compile Fingers crossed.
Behdad Esfahbod 50d1a41c 2018-11-16T08:52:57 [coretext] Hopefully the last one
Behdad Esfahbod 0aab861f 2018-11-16T08:43:25 [coretext] Another round
Behdad Esfahbod 0809b76a 2018-11-16T08:29:47 [coretext] One more try..
Behdad Esfahbod 78bd4475 2018-11-16T04:10:53 [coretext] One more try
Behdad Esfahbod fd27a23c 2018-11-16T03:57:12 [coretext] Another build fix attemt
Behdad Esfahbod cfb9771a 2018-11-16T03:24:22 [coretext] Try to fix
Behdad Esfahbod e3e95473 2018-11-16T02:55:29 [coretext] Unbreak build
Behdad Esfahbod ce5da0f3 2018-11-16T02:29:13 [shaper] Rewrite shaper data code to be more template-driven than macro-driven
Behdad Esfahbod f521a28b 2018-11-11T21:32:01 Embed hb_ot_shape_plan_t into hb_shape_plan_t No other shaper will need shape_plan_data, by definition. So, remove abstraction layer and always create hb_ot_shape_plan_t as part of hb_shape_plan_t.
Behdad Esfahbod 1beacdde 2018-11-11T16:35:28 Minor
Behdad Esfahbod 93ef20a8 2018-11-03T15:03:06 Replace most uses of is_inert with is_immutable
Behdad Esfahbod 3a4e5dd4 2018-10-29T18:05:25 Remove a few unnecessary hb_auto_t<>'s See a85641446c30247c4e948263f0f8c1147ed4efb9
Behdad Esfahbod 04981ee0 2018-10-27T04:40:43 [docs] More
Behdad Esfahbod 955aa56b 2018-10-25T16:50:38 [vector] Make it act more like pointer Add pointer cast operator and plus operator.
Bruce Mitchener 8d1e479d 2018-10-18T22:18:42 Use bool literals instead of 0/1.
Behdad Esfahbod e0c5e0d9 2018-10-13T18:37:14 [aat] WIP remove feature mapping here from hb-coretext Need to map enum values to numerics since we don't have CoreText headers.
Behdad Esfahbod cb057749 2018-10-13T17:03:32 [coretext] Prepare AAT feature mapping to be moved
Behdad Esfahbod b2e398c0 2018-10-07T16:31:33 [coretext] Fix OS X check Fixes https://github.com/harfbuzz/harfbuzz/issues/1230
Behdad Esfahbod 0816a549 2018-10-06T02:40:57 [uniscribe/coretext] Fix for previous change
Behdad Esfahbod 03fb6dd4 2018-10-03T21:02:16 Rewrite grapheme-formation in terms of new work Also, don't attach ZWNJ to previous cluster. Closer to Unicode graphemes.
Behdad Esfahbod 824111d4 2018-09-25T12:47:37 Fix iOS build Fixes https://github.com/harfbuzz/harfbuzz/pull/1179
Behdad Esfahbod 7671cb9b 2018-09-19T17:10:26 [coretext] Minor
Behdad Esfahbod 606bf574 2018-09-16T19:33:48 Revert forcing use of single-parameter static_assert() Some clang versions define static_assert as a macro apparently, so we cannot redefine it... This reverts commit 94bfea0ce6a7b4d5641c198d50751748a353df11. This reverts commit 4e62627831e7457ed60ff87712570065b14b200a.
Behdad Esfahbod 4e626278 2018-09-16T18:09:36 Enforce single-param static_assert() only So we don't accidentally break it again.
Behdad Esfahbod c77ae408 2018-08-25T22:36:36 Rename hb-*private.hh to hb-*.hh Sorry for the noise, downstream custom builders. Please adjust.
Behdad Esfahbod 652cd45c 2018-08-09T01:02:02 [coretext] Another try
Behdad Esfahbod 3f3585ca 2018-08-09T00:58:17 Fix coretext build (hopefully)
Behdad Esfahbod 3d22aefe 2018-08-01T18:03:32 Rename
Behdad Esfahbod be458eb0 2018-07-10T14:41:04 Include more basic internal headers from hb-private.hh
Behdad Esfahbod f7515769 2018-06-01T17:48:37 [vector] Use Crap pool in push() as well
Behdad Esfahbod 65aeabd6 2018-05-23T16:15:28 Add hb_vector_t::push(const Type &v) Makes for cleaner code.
Ebrahim Byagowi 93bdf9b2 2018-05-09T23:24:17 Use arrayZ on hb-coretext and hb-uniscribe and fix macOS/Win bots (#1024) Following to 63f57f4
Behdad Esfahbod 37b95612 2018-05-01T19:09:00 Remove hb_auto_array_t Part of https://github.com/harfbuzz/harfbuzz/issues/1017
Ebrahim Byagowi 8b0d642e 2018-04-23T18:37:35 Resolve some of clang's zero-as-null-pointer-constant warnings
Ebrahim Byagowi f24b0b97 2018-04-12T13:40:45 Update the links and revive the dead ones
Ryan Schmidt 58e569e5 2018-04-05T17:03:36 Fix build with CoreText on OS X 10.7 and earlier (#952)
David Corbett 21646cc4 2018-02-16T12:08:55 Do not mark the first glyph as unsafe to break Fixes #791.
Bruce Mitchener dae20fb5 2018-01-31T20:16:08 Use nullptr instead of 0.
Bruce Mitchener 90218fa9 2018-01-31T20:44:45 Fix typos.
Bruce Mitchener 0c66043a 2018-01-31T20:24:27 [coretext] Fix memory leaks. In `reference_table`, if the data is empty and we return early, we still need to release the data object. In `hb_coretext_shape`, there two edge cases where an early return should release the attributed string.
Behdad Esfahbod 1245395a 2017-12-17T12:32:33 [coretext] In hb_coretext_font_create() set ptem Otherwise setting the CTFont was ineffective as it would have been recreated anyway unless font size was set to 18 CSS points.
Behdad Esfahbod d5e29303 2017-11-28T23:11:34 [coretext] Add hb_coretext_font_create() Fixes https://github.com/harfbuzz/harfbuzz/issues/628 New API: hb_coretext_font_create()
ebraminio 7c6937e7 2017-11-20T14:49:22 Move all references of old url to the new address (#622)
Behdad Esfahbod e4da3802 2017-11-10T17:14:27 [coretext/uniscribe/directwrite/graphite/fallback] Update for unsafe-to-break Fixes https://github.com/behdad/harfbuzz/issues/615 We'll see which bots I broke.
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 98acdde3 2017-10-31T11:17:43 [coretext/uniscribe] Fix build https://travis-ci.org/behdad/harfbuzz/jobs/295039536#L3468 https://ci.appveyor.com/project/behdad/harfbuzz/build/1.0.697/job/dr1ujlntxafeqbej#L142
Behdad Esfahbod 80cc0a7e 2017-10-17T11:14:48 [coretext] Fix build error: static_assert expression is not an integral constant expression
Behdad Esfahbod dbdbfe3d 2017-10-15T12:11:08 Use nullptr instead of NULL
Behdad Esfahbod c3448e8d 2017-10-15T12:02:00 Use static_assert instead of custom ASSERT_STATIC
Behdad Esfahbod c2cf68db 2017-10-13T10:30:19 [coretext] Fix build
Behdad Esfahbod 95883fc5 2017-10-13T10:21:07 [coretext] Pass correct font size to CoreText CoreText "point"s are not typographic points, but CSS pixels. Ie. they are 96 per inch, not 72 per inch.
Behdad Esfahbod 8923033e 2017-10-12T12:01:48 [coretext] Use fabs() to silence compiler warning
Dominik Röttsches dd4b321b 2017-10-12T11:49:37 [coretext] Activate tracking for system fonts Another attempt at fully fixing https://github.com/behdad/harfbuzz/issues/360
Behdad Esfahbod 6a2cbc6e 2017-10-12T10:46:09 [coretext] Use fabsf() instead of abs() Fixes bots. Link libharfbuzz.so with -lm. Surprising that we survived without it so far!
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 717fcb51 2017-10-11T15:38:21 [coretext] Minor
Behdad Esfahbod 06c14225 2017-10-11T15:29:53 [coretext] Minor
Behdad Esfahbod a4b46212 2017-10-11T15:29:22 [coretext] Adjust font size check for 0
Behdad Esfahbod 84686bf4 2017-10-11T15:02:48 [coretext-aat] Also pass through CoreText if font has kerx table SFNSText has kerx table which apparently is applied.
Behdad Esfahbod 296d0134 2017-10-11T14:09:30 [coretext] Change default point size to 12
Dominik Röttsches a5ebe1d4 2017-10-11T13:32:38 [coretext] Recreate CTFont if pt size changed Attempt at fixing #360
Dominik Röttsches db7a73ce 2017-10-11T13:24:39 [coretext] Fix build
Behdad Esfahbod f3341307 2017-10-11T13:17:46 [coretext] Another try
Behdad Esfahbod a8e466c3 2017-10-11T13:05:59 [coretext] Move CT_Font to font data Towards implementing optical sizing. Untested; won't compile. https://github.com/behdad/harfbuzz/issues/360
Behdad Esfahbod f9b4c657 2017-10-11T12:51:25 [coretext] Move font size to a macro
Behdad Esfahbod 16d02a58 2017-10-11T12:28:06 [coretext] Change default font size from 36 to 18
Behdad Esfahbod 239119a6 2017-08-13T15:08:34 [unsafe-to-break] Mark all positions as unsafe in alternative shapers
Cosimo Lupo 9813be3d 2017-07-14T17:11:46 [coretext] Allow to disable kern (#508) * Minor * [coretext] Fix leak * [coretext] Do not reset num_features * [coretext] allow to disable kern; re-enabling doesn't seem to be working
Behdad Esfahbod d4bb52b9 2017-02-09T14:13:25 Unbreak hb-coretext build
Behdad Esfahbod 466b3e58 2017-02-03T16:43:25 Shuffle things around a bit
Behdad Esfahbod 72ada4f0 2016-09-10T03:57:24 [GX] Hook up feature variations Shape-plan caching is not implemented.
Ebrahim Byagowi fc4e671f 2016-09-09T23:28:28 [coretext] Use intended coretext version check logic (#315)
Khaled Hosny 48677345 2016-09-08T04:44:37 Try to unbreak building on older macOS again (#314)
Dominik Röttsches b717cd7b 2016-09-07T23:56:57 Do reconfigure the cascade list for Emoji font on OS X 10.9.5 (#313) This seems to fix crash issues on 10.9.5 reported on Chrome, compare crbug.com/549610
Khaled Hosny a0f1b44b 2016-08-16T03:09:04 [coretext] Blind fix for build on MacOS 10.9
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 489acf6c 2016-07-22T17:41:43 [coretext] "Fix" crashes on CoreText < 10.10 Fixes https://github.com/behdad/harfbuzz/issues/297