Commit Graph

375 Commits

Author SHA1 Message Date
Behdad Esfahbod c073233f45 Add make rule to build hb.cc
Part of https://github.com/harfbuzz/harfbuzz/issues/1809
2019-07-02 14:26:45 -07:00
Behdad Esfahbod f1d20d9b4d Add ucd-table make target 2019-07-02 14:18:38 -07:00
Michiharu Ariza 040b261dee add bimap test along with bug fix/tweaks 2019-07-01 13:54:36 -07:00
Behdad Esfahbod 8786820a5a [src] Add make targets "tiny" and "tinyz" 2019-06-26 12:55:46 -07:00
Behdad Esfahbod aa3450cac1 [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.
2019-06-17 22:41:49 -07:00
Behdad Esfahbod 23768a99e0 [config] Replace HAVE_FALLBACK with HB_NO_FALLBACK_SHAPE
This disables fallback shaper in tiny builds.  Projects that don't
use our build system and want to disable fallback shaper (eg. Firefox)
should define HB_NO_FALLBACK_SHAPE now.

Part of https://github.com/harfbuzz/harfbuzz/issues/1652
2019-06-17 20:29:29 -07:00
Behdad Esfahbod 65392b734e [ucdn] Replace UCDN with a new UCD implementation
UCDN was ~120kb of data.  New implementatoin is 69kb in default builds,
and 49kb if built with HB_OPTIMIZE_SIZE or __OPTIMIZE_SIZE__.  The
latter automatically enabled if built with -Os or -Oz.

There's room to shave off another 10kb or 20kb.  That will follow later.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1652
2019-05-23 20:34:19 -04:00
Behdad Esfahbod 36dee9221f [gen-ucd] Rename 2019-05-23 20:34:19 -04:00
Behdad Esfahbod 52c15b053a Revert "[ragel] Switch to -T1 output instead of -F1"
This reverts commit ae8719eb59.

Part of https://github.com/harfbuzz/harfbuzz/issues/1708
2019-05-13 14:10:28 -07:00
Behdad Esfahbod ae8719eb59 [ragel] Switch to -T1 output instead of -F1
Fedora upgraded to ragel 7, which is buggy if char is signed.
Switching to -G2 output fails with sign-compare error:

../../src/hb-buffer-deserialize-json.hh:107:12: error: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘const char’ [-Werror=sign-compare]
    if ( 9u <= ( (*( p))) && ( (*( p))) <= 13u ) {
         ~~~^~~~~~~~~~~~~

Switching to -T1 for now.  It actually results in smaller code,
at the expense of some binary searching instead of flat tables.
In the not distant future, we might actually generate two different
outputs and choose between depending on size-optimize options.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1708
2019-05-13 12:30:40 -07:00
Behdad Esfahbod 70a49f2e4a [meta] Add hb_conditional<> and hb_is_convertible() 2019-05-09 15:24:25 -07:00
Behdad Esfahbod 11ab889a8d Rename a few test programs 2019-04-24 09:55:24 -04:00
Behdad Esfahbod 0d7af5fb02 [algs] Use universal references for hb_pair()
Such that it carries lvalues inside.
2019-02-14 19:37:57 -08:00
Behdad Esfahbod 8e5c2bc60b [Makefile.am] Minor 2018-12-21 17:29:11 -05:00
Behdad Esfahbod e952075248 Minor 2018-12-21 11:15:16 -05:00
Behdad Esfahbod 8001e00a47 [iter] First sample use 2018-12-21 01:53:27 -05:00
Behdad Esfahbod f6d5f1e91c [iter] Add empty test 2018-12-21 00:23:46 -05:00
Behdad Esfahbod 58d4d19947 Simplify build source list 2018-12-01 19:34:18 -05:00
Behdad Esfahbod 44b9331f66 [aat] Fix include issues 2018-11-25 01:16:02 -05:00
Behdad Esfahbod d6666b3866 [fuzzing] Remove limited-edition build of libraries
Use normal, production, shared libraries.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1237
2018-11-12 13:21:14 -05:00
Behdad Esfahbod f9e0552deb [fuzzing] Make "make lib" faster and more usable 2018-11-10 21:06:56 -05:00
Ebrahim Byagowi 7170e35096
Rename deprecated symbols list file name and clean it up (#1328) 2018-10-29 13:11:01 +03:30
Ebrahim Byagowi 9c692e5b8d [test-ot-color] Use public APIs on the tool 2018-10-29 12:22:39 +03:30
Behdad Esfahbod 68f2c832c8 Remove dump-emoji 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 337ea0b717 [fuzzing] Remove HB_NDEBUG
Not sure why it ever was added.
2018-10-26 21:22:26 -07:00
Behdad Esfahbod c442fd9a10 [name] Add src/test-name-table tool to show all font names 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 6d40eb8372 Touch up on previous commit
https://github.com/harfbuzz/harfbuzz/pull/1273
2018-10-23 02:51:42 -07:00
David Corbett 205737acdc [use] Prohibit visually ambiguous vowel sequences 2018-10-23 02:25:08 -07:00
Ebrahim Byagowi 9df2fb1611 Add API tests for hb_map_t 2018-10-19 20:23:36 +03:30
Ebrahim Byagowi c6eb5e852c Don't report deprecated symbols as unused symbols 2018-10-19 20:23:36 +03:30
David Corbett 2f1f961cc0 Autogenerate the BCP 47 to OpenType mappings
The new script, gen-tag-table.py, generates `ot_languages` automatically
from the [OpenType language system tag registry][ot] and the [IANA
Language Subtag Registry][bcp47] with some manual modifications. If an
OpenType tag maps to a BCP 47 macrolanguage, all the macrolanguage's
individual languages are mapped to the same OpenType tag, except for
individual languages with their own OpenType mappings. Deprecated
BCP 47 tags are canonicalized.

[ot]: https://docs.microsoft.com/en-us/typography/opentype/spec/languagetags
[bcp47]: https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry

Some OpenType tags correspond to multiple ISO 639 codes. The mapping
from ISO 639 codes lists OpenType tags in priority order, such that more
specific or more likely tags appear first.

Some OpenType tags have no corresponding ISO 639 code in the registry so
their mappings use BCP 47 subtags besides the language. For example, any
BCP 47 tag with a fonipa variant subtag is mapped to 'IPPH', and 'IPPH'
is mapped back to und-fonipa.

Other OpenType tags have no corresponding ISO 639 code because it is not
clear what they are for. HarfBuzz just ignores these tags.

One such ignored tag is 'ZHP ' (Chinese Phonetic). It probably means
zh-Latn. However, it is used in Microsoft JhengHei and Microsoft YaHei
with the script tag 'hani', implying that it is not a romanization
scheme after all. It would be simple enough to add this mapping to
gen-tag-table.py once a definitive mapping is determined.

The manual modifications are mainly either obvious mappings that the
OpenType registry omits or mappings for compatibility with previous
versions of HarfBuzz. Some of the old mappings were discarded, though,
for homophonous language names. For example, OpenType maps 'KUI ' to
kxu; previous versions of HarfBuzz also mapped it to kvd, because kvd
and kxu both happen to be called "Kui".

gen-tag-table.py also generates a function to convert multi-subtag tags
like el-polyton and zh-HK to OpenType tags, replacing `ot_languages_zh`
and the hard-coded list of special cases in `hb_ot_tags_from_language`.
It also generates a function to convert OpenType tags to BCP 47,
replacing the hard-coded list of special cases in
`hb_ot_tag_to_language`.
2018-10-11 13:54:28 -04:00
Behdad Esfahbod 1e8fdd285f Remove HAVE_OT
We never tested compiling without it.  Just kill it.  We always build
our own shaper.
2018-10-10 16:32:35 -04:00
Behdad Esfahbod cc126f2817 Minor 2018-10-09 01:10:15 -04:00
Behdad Esfahbod 1e8f195b96 [emoji] Add emoji Extended_Pictographic table and function
Part of https://github.com/harfbuzz/harfbuzz/issues/1159

.
2018-10-03 18:45:27 +02:00
Ebrahim Byagowi 93b65d9fe3
Remove dump-fon (#1100)
It had interesting stuffs like EXE parsing and
big-endian parsers but added in an attempt to find
a solution for #681 which later found not related.
2018-07-17 23:29:16 +04:30
Behdad Esfahbod 019d18e9ae Minor 2018-07-17 11:00:24 +02:00
Cosimo Lupo ccdd156554
src/Makefile.am: pass headers to gen-def.py as arguments, not env vars 2018-07-09 18:26:44 +01:00
Behdad Esfahbod f6893ef82c Move hb-version.h generation to Makefile
Fixes https://github.com/harfbuzz/harfbuzz/issues/864

Unfortunately 1.7.7 and 1.8.0 went out with the wrong hb-version.h contents.
2018-06-12 19:26:15 -04:00
Behdad Esfahbod 105a3b5e2d Minor 2018-06-05 15:31:04 -07:00
Ebrahim Byagowi 67dfb1937b Add dump-fon, a prototype on how to work with .fon/.fnt files (#981) 2018-04-16 11:55:45 +02:00
Ebrahim Byagowi a62554af89
[colr/cpal] Improvements and add a sample renderer (#927) 2018-04-10 00:53:50 +04:30
Behdad Esfahbod 08b8eb678a Another try at fixing linker issue
Fixes https://github.com/harfbuzz/harfbuzz/issues/880
2018-03-31 12:16:57 +02:00
Ebrahim Byagowi cab2c2c08c
Make more gen-* scripts py3 compatible (#940) 2018-03-29 12:48:47 +04:30
Ebrahim Byagowi 8fd55422c3
Implement an internal emojis dumper tool (#909)
Later to be expanded to a more general tool but for now it only supports CBDT, SVG and CBDT.
2018-03-27 16:57:09 +04:30
Ebrahim Byagowi 430f82817d
[ci] Fix coverage build fail (#925) 2018-03-27 13:59:56 +04:30
Behdad Esfahbod 19ec366fb1 Fix previous commit
Automake has this stupid behavior where if your Makefile.am has
syntactic error, it can get to a state that make succeeds but just
ignores broken Makefile.am.  Ouch.
2018-03-26 15:09:54 -07:00
Behdad Esfahbod 44b6c77c64 Try fixing linking again
Before 1.7.5, we were setting -fno-exceptions etc on CXXFLAGS. In 1.7.6
we set it as CPPFLAGS. Try fixing. Also, I'm fairly sure it's safe to
set these unconditionally.

Fixes https://github.com/harfbuzz/harfbuzz/issues/880 (or so I hope)
2018-03-26 14:26:45 -07:00
Ebrahim Byagowi 8d1b4082ae
Appropriate fix for msys2 bot fail on gen-def.py (#894) 2018-03-17 01:05:03 +03:30
Garret Rieger aa9612d35f [subset] Fix fuzzing build for hb-subset-fuzzer. 2018-03-16 09:04:01 -07:00
Garret Rieger 1beb08862e [subset] First pass at setting up a fuzzing program for hb-subset. 2018-03-16 09:04:01 -07:00
Ebrahim Byagowi f7399796a1
Enable coverage test on autotools (#857) 2018-03-03 22:55:09 +03:30
Garret Rieger f757757eda [subset] Add cmake build def for test-unicode-ranges. 2018-02-26 16:00:33 -08:00
Garret Rieger f82f2a3e50 [subset] Rename hb-os2-unicode-ranges.cc to test-unicode-ranges.cc. 2018-02-26 16:00:33 -08:00
Garret Rieger a570142d0c [subset] Move hb-ot-os2-unicode-ranges into a cc file with a helper methods and tests. 2018-02-26 16:00:33 -08:00
Behdad Esfahbod b91e8da36e Include hb-version.h in git (#825) 2018-02-24 10:21:17 +03:30
Ben Boeckel d38f37b2e3 autoconf: provide a harfbuzz-config for use from CMake (#822) 2018-02-24 01:25:53 +03:30
Behdad Esfahbod e0939d811f Clean up check-defs and check-symbols (#821)
Also, call c++filt on their results.

Also build and fix and check harfbuzz-gobject.def

Also changes harfbuzz-gobject to distribute generated enum sources.
2018-02-24 00:49:34 +03:30
Behdad Esfahbod abc82b493e Add Ragel-generated files to git
I know it's bad form; I know I've said no to this multiple times...
But this is part of an experiment to see if we can make rolling HarfBuzz
into Chrome much faster. That will give us a lot more testing exposure
that currently Chrome does.

Doing this while those files are still considered ignored by our
gitignore rules; will see how that flies.
2018-02-20 14:36:14 -08:00
Behdad Esfahbod e2d2d81984 Limit how much work sanitize() can do
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6022
2018-02-18 17:28:53 -08:00
Behdad Esfahbod 2903b2f357 Another linker tweaking
Trying to fix this warning:
cc1: warning: command line option ‘-fno-threadsafe-statics’ is valid for C++/ObjC++ but not for C

Let's see what the clang bots think of it.
2018-02-14 15:46:27 -08:00
Behdad Esfahbod ccae99fdad Another try 2018-02-14 11:12:09 -08:00
Behdad Esfahbod 8c3612af65 Tweak Makefile some more 2018-02-14 10:57:34 -08:00
Behdad Esfahbod d594f947b6 [subset] Allow linking to libstdc++
We want to use it.
2018-02-14 10:55:25 -08:00
Ebrahim Byagowi 109314cb55
Another attempt on fixing the tests on Travis (#788) 2018-02-14 21:05:11 +03:30
Behdad Esfahbod 507804479a [use] Add dump-use-data 2018-02-13 21:46:28 -08:00
Behdad Esfahbod 15ba4fbe01 [khmer] Add dump-khmer-data 2018-02-13 21:41:51 -08:00
Behdad Esfahbod effddd03bd [myanmar] Add dump-myanmar-data 2018-02-13 21:38:15 -08:00
Behdad Esfahbod c0e45b60a0 [indic] Rename print-indic-table to dump-indic-data
Makes more sense given what this prints, err, dumps.
2018-02-13 21:25:16 -08:00
Behdad Esfahbod 8634846a0a More tweaking linker and linker flags 2018-02-13 21:18:00 -08:00
Behdad Esfahbod 397ed53e55 [indic] Add print-indic-table 2018-02-13 18:54:26 -08:00
Behdad Esfahbod aeed082e28 Another tweak at libstdc++ things
To fix this warning:

cc1: warning: command line option ‘-fno-threadsafe-statics’ is valid for C++/ObjC++ but not for C
2018-02-13 14:02:59 -08:00
Behdad Esfahbod 28e63a1287 Disable threadsafe static's for all libraries
Even in libharfbuzz-subset, we still will handle our own threadsafety
for statics.
2018-02-13 13:50:21 -08:00
Behdad Esfahbod b969a82e30 Pass no-libstdc++ flags only to libraries suppressing it 2018-02-12 20:51:26 -08:00
Behdad Esfahbod 42040a273f Allow libharfbuzz-subset to link to libstdc++
We want to use it instead of reinventing hashmap...

Also, don't change linker for ICU since libicu also uses libstdc++.
2018-02-12 18:41:36 -08:00
Ebrahim Byagowi 4af3c5e258 Move linker specifying to a better place 2018-02-12 18:39:42 -08:00
Khaled Hosny 0b94d590d9 Rename --with-stdcpp → --with-libstdc++
Also improve wording a bit and fix make check in --with-libstdc++=yes.
2018-02-12 12:37:41 -07:00
Ebrahim Byagowi 91f0d51f05
Fix symbol exporting issue on msys2 and bringing all the bots (#781) 2018-02-12 17:20:12 +03:30
Ebrahim Byagowi a9b650d384
Apply check-defs.sh to -icu and -subset, toward mingw fix (#780) 2018-02-12 15:10:13 +03:30
Ebrahim Byagowi 2efc896550
Add --with-stdcpp for ossfuzzer and mupdf use (#770) 2018-02-12 12:00:07 +03:30
Ebrahim Byagowi 844f48ea9a
Fix symbol exporting and libstdc++ linkage of hb-subset (#769) 2018-02-10 23:13:12 +03:30
Behdad Esfahbod 3b68a03a1c [fuzzer] Minor 2018-02-08 17:00:37 -06:00
Behdad Esfahbod eeffabc875 Build 2018-02-07 21:34:05 -06:00
Behdad Esfahbod ae39fc8171 [subset] Build hb-subset into separate libharfbuzz-subset.so 2018-02-04 20:18:52 -05:00
Rod Sheeter 9ccb8366f6 Start to sketch APIs for subsetting 2018-02-04 12:57:33 -08:00
Ebrahim Byagowi 00806149b9
Improve avoiding C++ linkage, definition creation and cmake tests (#710) 2018-01-19 01:12:31 +03:30
Behdad Esfahbod 7c32e01d04 Minor 2018-01-11 10:47:31 +01:00
Ebrahim Byagowi 72bec1cd09
Improve tests (#679) 2018-01-05 12:42:20 +03:30
Ebrahim Byagowi 5ed26fc5bd
[cmake] Run src/ tests (#675) 2018-01-04 10:11:34 +03:30
Behdad Esfahbod baf7779d2d Limit how much recursion GSUB/GPOS does
This only counts recursions right now.  Good start.

Hopefully...
Fixes https://github.com/behdad/harfbuzz/issues/429
2017-11-14 21:55:37 -08:00
Behdad Esfahbod 909de95a11 Minor build fix 2017-11-14 16:22:52 -08:00
Behdad Esfahbod 6a2cbc6ef5 [coretext] Use fabsf() instead of abs()
Fixes bots.

Link libharfbuzz.so with -lm.  Surprising that we survived without
it so far!
2017-10-12 10:46:09 +02:00
Behdad Esfahbod c2545b9215 Add check for HB_EXTERNs
https://github.com/behdad/harfbuzz/pull/555
2017-10-07 12:57:30 +02:00
William Hua 5ecf96e3a2 Use absolute paths of ragel generated headers (#467)
https://github.com/behdad/harfbuzz/issues/455
2017-04-16 22:33:42 -07:00
Behdad Esfahbod a4471d0c2c Move list of ragel sources to Makefile.sources as well 2017-04-05 15:42:11 +02:00
ebraminio d2acaf6d72 Split ragel generated files lists and remove hardcoded rl files lists (#453) 2017-04-05 11:21:23 +02:00
Behdad Esfahbod 7c47474f20 Set LC_ALL instead of LANG when creating harfbuzz.def
Hopefully fixes Travis faliure?
https://github.com/behdad/harfbuzz/pull/413#issuecomment-278481882
https://travis-ci.org/khaledhosny/harfbuzz/jobs/199785332#L1065
2017-02-08 14:33:28 -08:00
Behdad Esfahbod 785982bf83 [var] Flesh out some more 2017-01-20 20:05:45 -08:00
Kal Conley b424b6c372 Add --with-icu=builtin configure option 2016-02-26 00:35:15 +01:00
Behdad Esfahbod 91dd115652 Add HB_NDEBUG
API changes:
- If NDEBUG is defined, define HB_NDEBUG
- Disable costlier sanity checks if HB_NDEBUG is defined.

In 1.2.3 introduced some code to disable costly sanity checks if
NDEBUG is defined.  NDEBUG, however, disables all assert()s as
well.  With HB_NDEBUG, one can disable costlier checks but keep
assert()s.

I'll probably add a way to define HB_NDEBUG automatically in
release tarballs.  But for now, production systems that do NOT
define NDEBUG, are encouraged to define HB_NDEBUG for our build.
2016-02-25 13:56:47 +09:00
Behdad Esfahbod 988165021f Disable internal buffer variable bookkeeping in NDEBUG builds
Saves some sweet time and binary size!
2016-02-25 12:23:02 +09:00