skia2/third_party/harfbuzz
Hal Canary 2a3093c154 SkPDF: Add experimental Harfbuzz font subsetter
Currently hidden behind gn flag:  skia_pdf_subset_harfbuzz

Replaces Sfntly subsetter.

TODO:
  1) Test on all clients.
  2) Enable on each client.
  3) Set skia_pdf_subset_harfbuzz default to true,
  4) Delete sfntly dependency.

Bug: chromium:931719
Change-Id: I5c763ce3e6b21d6bc65284d4105b9974e0907cdc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/171223
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-03-06 16:30:56 +00:00
..
BUILD.gn SkPDF: Add experimental Harfbuzz font subsetter 2019-03-06 16:30:56 +00:00
README Roll HarfBuzz 2019-02-06 21:28:19 +00:00

#!/bin/sh
# Some of HarfBuzz's headers are created at build time using the Ragel
# State Machine Compiler.  To reduce complex dependencies, I pre-built
# these files:
#     hb-buffer-deserialize-json.hh
#     hb-buffer-deserialize-text.hh
#     hb-ot-shape-complex-indic-machine.hh
#     hb-ot-shape-complex-myanmar-machine.hh
#     hb-ot-shape-complex-use-machine.hh
# from these sources:
#     ../externals/harfbuzz/src/hb-buffer-deserialize-json.rl
#     ../externals/harfbuzz/src/hb-buffer-deserialize-text.rl
#     ../externals/harfbuzz/src/hb-ot-shape-complex-indic-machine.rl
#     ../externals/harfbuzz/src/hb-ot-shape-complex-myanmar-machine.rl
#     ../externals/harfbuzz/src/hb-ot-shape-complex-use-machine.rl
#
# The files in this directory are created by installing the
# prerequiste packages, checking out a new version of HarfBuzz, doing
# `./autogen.sh && ./configure && make`, then copying the
# autogenerated .h and .hh files to this directory.
#
# These files are now checked into the git repository and the HarfBuzz
# maintainers keep them up to date by using the build rules in the HarfBuzz
# build. As a result this step is no longer necessary, but if we need to
# regenerate these files ourselves, this is how to do it.

set -e
set -x
for package in automake  libtool pkg-config ragel gtk-doc-tools; do
    if ! ( dpkg-query -W -f'${Status}' "$package" 2>/dev/null | \
        grep -q "ok installed" ); then
        sudo apt-get install "$package"
    fi
done
cd "$(dirname "$0")/../externals/harfbuzz"
./autogen.sh
./configure
make -j4
cp src/hb-version.h ../../harfbuzz/
for RAGEL_FILE in src/*.rl; do
    BUILT_HEADER="src/$(basename "$RAGEL_FILE" '.rl').hh"
    if [ -f "$BUILT_HEADER" ]; then
        cp -v "$BUILT_HEADER" ../../harfbuzz/
    fi
done
git clean -fxd