HarfBuzz text shaping engine
Go to file
Tor Arne Vestbø f401f85a5a 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/
2019-01-15 13:26:35 +01:00
.ci [ci] minor, bring back the removed assertion 2018-03-05 13:02:50 +03:30
.circleci [ci] Enable more of GCC compile warnings (#1533) 2019-01-04 23:10:39 +03:30
docs Usermanual: small formatting and wording fixes. 2019-01-04 15:43:07 +02:00
m4 Remove generated files that were accidentally added by CFF2 branch 2018-11-30 22:43:22 -05:00
src Remove assumption about Core Text working in 96 DPI 2019-01-15 13:26:35 +01:00
test Remove assumption about Core Text working in 96 DPI 2019-01-15 13:26:35 +01:00
util Remove redundant void from C++ sources (#1486) 2018-12-17 13:01:01 -05:00
.clang-format Add an initial .clang-format config 2019-01-09 16:01:11 +03:30
.codecov.yml [ci] Add .codecov.yml 2018-11-26 18:58:39 +03:30
.editorconfig Minor, hack .editorconfig for vscode use 2019-01-09 15:56:32 +03:30
.travis.yml [ci] Fix Travis macOS bot ICU issue (#1472) 2018-12-11 23:02:52 +03:30
AUTHORS [AUTHORS] Add Ebrahim and Khaled 2018-10-18 00:35:01 -07:00
BUILD.md Fix typos. 2018-10-19 19:24:05 +03:30
CMakeLists.txt [cmake] Enable C++11 on CMake (#1519) 2018-12-30 01:53:47 -05:00
COPYING Improve license information 2012-10-28 21:26:19 -07:00
Makefile.am Add README.wine.md and touch some other docs (#939) 2018-03-29 04:22:53 +04:30
NEWS 2.3.0 2018-12-20 21:48:57 -05:00
README Add codecov.io badge 2018-11-20 01:21:36 -05:00
README.md Add README.md symlink to make github happy 2014-10-01 17:45:17 -04:00
README.python.md Fix typos. 2018-10-19 19:24:05 +03:30
README.wine.md Fix typos. 2018-10-19 19:24:05 +03:30
RELEASING.md 2.1.0 2018-10-30 15:52:26 -07:00
THANKS Bump version to 0.9.2 2012-08-10 14:50:05 -04:00
TODO [TODO] Remove BCP 47 language handling item 2018-10-20 21:13:25 +03:30
appveyor.yml [appveyor] Drop Cygwin builds again 2018-10-25 02:34:02 +02:00
autogen.sh Add Ragel-generated files to git 2018-02-20 14:36:14 -08:00
azure-pipelines.yml Set up CI with Azure Pipelines 2018-10-25 15:22:54 +00:00
configure.ac 2.3.0 2018-12-20 21:48:57 -05:00
git.mk [git.mk] Update 2017-10-27 10:23:01 -06:00
harfbuzz.doap Move all references of old url to the new address (#622) 2017-11-20 14:49:22 -05:00
mingw32.sh Add mingw32.sh and mingw64.sh 2018-02-16 14:16:28 -08:00
mingw64.sh Add mingw32.sh and mingw64.sh 2018-02-16 14:16:28 -08:00
replace-enum-strings.cmake CMake: Support building HarfBuzz-GObject 2017-10-18 23:48:11 +08:00

README.md

Travis Build Status AppVeyor Build Status CircleCI Build Status Coverity Code Health Codacy Code Health Codecov Code Coverage Coverals Code Coverage ABI Tracker

This is HarfBuzz, a text shaping library.

For bug reports, mailing list, and other information please visit:

http://harfbuzz.org/

For license information, see the file COPYING.

Documentation: https://harfbuzz.github.io