Commit Graph

29 Commits

Author SHA1 Message Date
Behdad Esfahbod 1c693e8c28 [test] Fix unused-var warning 2021-02-22 17:11:36 -07:00
Khaled Hosny c2cdcd4901 [tests] warning: unused variable 'num_glyphs' 2020-10-17 21:57:27 +02:00
Khaled Hosny fa771a7f85 [tests] Fix memory leak in test
To make valgrind bot happy.
2020-10-11 13:15:39 -07:00
Behdad Esfahbod 540d2cdddb [tests/buffer] Revert unintended whitespace changes
From 9e5538d6a3

Tried squashing into, but too much merge conflict.
2020-10-09 22:27:55 -06:00
Behdad Esfahbod 04658ec48f [tests/buffer] Update tests for previous commit 2020-10-09 22:27:55 -06:00
Simon Cozens 7c0bc0bb92 Serialize invalid buffer to !! (text) or [] (json)
There is no generic deserialize - you have to choose glyphs or unicode - so there is no way to deserialize this buffer.
2020-10-09 22:27:55 -06:00
Simon Cozens 150f391438 Prohibit mixed glyphs/unicode buffers in deserialization 2020-10-09 22:27:55 -06:00
Simon Cozens 3d3c87e7e7 Put the flags back in and serialize clusters.
Note that now JSON glyph buffers and Unicode buffers look very similar, except for the g/u property difference.
2020-10-09 22:27:55 -06:00
Simon Cozens 432a05b2af (Simple) tests for Unicode serialization/deserialization 2020-10-09 22:27:55 -06:00
Ebrahim Byagowi a0b4ac4dce Turn 8 spaces to tab across the project
According to the current code style of the project
2019-08-27 02:40:41 +04:30
Behdad Esfahbod 831ba74382 Fix Codacy "issues" 2018-11-20 01:16:08 -05:00
Ebrahim Byagowi bf5088b3dc
Minor, fix -Weverthing bot warnings (#1210) 2018-10-02 11:07:06 +03:30
Ebrahim Byagowi f24b0b9728 Update the links and revive the dead ones 2018-04-12 13:44:32 +04:30
Behdad Esfahbod d33ba16361 Fix more warnings 2018-02-11 18:26:41 -08:00
Behdad Esfahbod 6c1848b1e3 Misc warning fixes 2018-02-10 15:52:35 -06:00
Behdad Esfahbod c4712f8e37 Fix test 2017-08-10 20:27:21 -07:00
Behdad Esfahbod b5fbc3b8f5 API: Do not clear buffer-flags in hb_buffer_clear_contents()
After 763e5466c0, one doesn't
need to set flags for different pieces of text.  The flags now
are something the client sets up once, depending on how it
actually uses the buffer.  As such, don't clear it in
clear_contents().

Tests updated.
2014-08-11 18:40:01 -04:00
Behdad Esfahbod 976c8f4552 New API: hb_buffer_[sg]et_replacement_codepoint()
With this change, we now by default replace broken UTF-8/16/32 bits
with U+FFFD.  This can be changed by calling new API on the buffer.
Previously the replacement value used to be (hb_codepoint_t)-1.

Note that hb_buffer_clear_contents() does NOT reset the replacement
character.

See discussion here:

6f13b6d62d

New API:

  hb_buffer_set_replacement_codepoint()
  hb_buffer_get_replacement_codepoint()
2014-07-16 15:34:20 -04:00
Behdad Esfahbod e634fed428 [buffer] Validate UTF-32 input
Same as what we do for UTF-8 and UTF-16.
2014-07-16 14:17:26 -04:00
Behdad Esfahbod af2490c095 Only accept well-formed UTF-8 sequences
Enable tests that were disabled before, and adjust one test,
and add more tests.
2014-07-11 16:22:13 -04:00
Behdad Esfahbod 24b2ba9dfa [test-buffer] Add test for lonely low-surrogate
Currenty fails.  Ouch!
2014-07-10 19:31:16 -04:00
Behdad Esfahbod 4dc798de19 Add hb-deprecated.h, and rename a couple enum values
Add deprecated alias for old name.
2013-08-27 11:46:08 -04:00
Behdad Esfahbod a4446b10bf Fix build for C89 compilers 2013-06-03 18:39:14 -04:00
Behdad Esfahbod 1172dc7362 Rename hb_buffer_clear() to hb_buffer_clear_contents()
The previous name was clashing with harfbuzz.old.  There are systems
that need to link both...

Clash-free now again.
2013-01-07 16:46:37 -06:00
Behdad Esfahbod d04b128531 Fix test 2012-11-14 10:53:10 -08:00
Behdad Esfahbod 0c7df22228 Add buffer flags
New API:

	hb_buffer_flags_t

	HB_BUFFER_FLAGS_DEFAULT
	HB_BUFFER_FLAG_BOT
	HB_BUFFER_FLAG_EOT
	HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES

	hb_buffer_set_flags()
	hb_buffer_get_flags()

We use the BOT flag to decide whether to insert dottedcircle if the
first char in the buffer is a combining mark.

The PRESERVE_DEFAULT_IGNORABLES flag prevents removal of characters like
ZWNJ/ZWJ/...
2012-11-13 14:42:35 -08:00
Behdad Esfahbod 82ecaff736 Add hb_buffer_clear()
Which is like _reset(), but does NOT clear unicode-funcs.
2012-11-13 14:10:00 -08:00
Behdad Esfahbod a18280a8ce Fix warnings produced by clang analyzer 2012-06-07 15:44:12 -04:00
Behdad Esfahbod 4d6dafd47f Rename test/ to test/api/ 2012-01-19 14:52:02 -05:00