Commit Graph

148 Commits

Author SHA1 Message Date
Behdad Esfahbod 3109375b84 Remove POSITION() and CURPOSITION() macros 2010-05-14 19:55:27 -04:00
Behdad Esfahbod d7cfb3b2d1 s/\<context\>/c/g 2010-05-13 14:18:49 -04:00
Behdad Esfahbod 281f08954a Remove obsolete friend 2010-05-11 11:37:58 -04:00
Behdad Esfahbod 70c9bfd564 Simplify PairSet 2010-05-11 00:36:30 -04:00
Behdad Esfahbod 69cb28bc13 Remove a few likely()'s 2010-05-10 23:13:08 -04:00
Behdad Esfahbod 24552ecf92 Remove excess sub_format sanitize 2010-05-10 23:08:41 -04:00
Behdad Esfahbod fe9bc070e1 Fix awful confusion between lookup format and subtable format
As reported by John Daggett.
2010-05-10 21:39:24 -04:00
Behdad Esfahbod dacebcadae Simplify unions 2010-05-10 19:45:41 -04:00
Behdad Esfahbod 0eb9fc6e37 Change DEFINE_SIZE_VAR to DEFINE_SIZE_ARRAY 2010-05-10 19:01:17 -04:00
Behdad Esfahbod 596e471aa5 Cleanup DEFINE_SIZE_VAR2 2010-05-10 18:48:29 -04:00
Behdad Esfahbod ed07422c33 Further cleanup of sizeof 2010-05-10 18:08:46 -04:00
Behdad Esfahbod 40cbefe858 Remove unnecessary casts 2010-05-10 17:47:22 -04:00
Behdad Esfahbod 09766b1ec5 Make StructAtOffset take a pointer
Is safer.
2010-05-10 17:36:03 -04:00
Behdad Esfahbod bea34c7cbb Further cleanup of DEFINE_SIZE 2010-05-10 17:28:16 -04:00
Behdad Esfahbod b3651231bf Remove ASSERT_SIZE in favor of the safer DEFINE_SIZE_STATIC 2010-05-10 16:59:57 -04:00
Behdad Esfahbod 569da92bc6 Cleanup ASSERT_SIZE_VAR 2010-05-10 16:46:36 -04:00
Behdad Esfahbod 99bf03459f Whitespace 2010-05-06 19:37:32 -04:00
Behdad Esfahbod e45d3f86f9 Start cleaning up get_size()
So we know when the size is static and when dynamic.
2010-05-06 19:33:31 -04:00
Behdad Esfahbod b157617644 Remove the last of SANITIZE macros: SANITIZE_SELF 2010-05-06 14:48:27 -04:00
Behdad Esfahbod 4f252fedc7 Remove SANITIZE macro 2010-05-06 13:30:23 -04:00
Behdad Esfahbod c2ddfd2d26 Cleanup Value casts 2010-05-06 13:21:54 -04:00
Behdad Esfahbod 41a93d2c1f Remove SANITIZE_WITH_BASE 2010-05-06 12:55:14 -04:00
Behdad Esfahbod f5fab0c718 Remove SANITIZE_MEM 2010-05-06 10:26:52 -04:00
Behdad Esfahbod 1cd1e117d0 Remove SANITIZE_ARRAY 2010-05-05 20:15:14 -04:00
Behdad Esfahbod 583d7f9586 Cosmetic 2010-05-05 01:49:22 -04:00
Behdad Esfahbod 705e215268 Minor 2010-05-05 01:40:25 -04:00
Behdad Esfahbod 1911b9d21b Remove APPLY_ARG_DEF and APPLY_ARG 2010-05-05 01:32:04 -04:00
Behdad Esfahbod 6c42cddfe5 Port apply to use hb_trace_t 2010-05-05 01:30:48 -04:00
Behdad Esfahbod 969c9705ae Move context_length into apply_context 2010-05-05 01:23:44 -04:00
Behdad Esfahbod 94a23aaeca Move buffer into apply_context 2010-05-05 01:13:09 -04:00
Behdad Esfahbod 63493f956d Move layout_context into apply_context 2010-05-05 01:01:05 -04:00
Behdad Esfahbod 39840474af Remove SANITIZE_ARG_DEF and SANITIZE_ARG 2010-05-05 00:23:19 -04:00
Behdad Esfahbod 4a446ac351 Use function template for pass-thru argument 2010-05-04 22:56:20 -04:00
Behdad Esfahbod bb029af943 Remove SANITIZE_THIS 2010-05-04 15:28:52 -04:00
Behdad Esfahbod 2226fc93d1 Rename SANITIZE_BASE to SANITIZE_WITH_BASE 2010-05-04 15:12:17 -04:00
Behdad Esfahbod 4d4cce9626 Remove SANITIZE_THIS2 2010-05-04 14:57:55 -04:00
Behdad Esfahbod be74284673 Remove SANITIZE_THIS3 2010-05-04 14:47:05 -04:00
Behdad Esfahbod fbab9f9bd8 Remove SANITIZE_BASE2 2010-05-04 14:42:10 -04:00
Behdad Esfahbod 64d3fc8d0d Cosmetic: Rename HB_LIKELY/HB_UNLIKELY to likely/unlikely 2010-05-03 22:51:19 -04:00
Behdad Esfahbod a8d960bd26 [GPOS] Speedup apply_value() 2010-04-29 14:31:56 -04:00
Behdad Esfahbod 33d13fdda9 Rename HB_GNUC_UNUSED -> HB_UNUSED 2010-04-29 13:56:44 -04:00
Behdad Esfahbod 6f729b45b0 More contour point use 2010-04-29 03:59:06 -04:00
Behdad Esfahbod 6617eada95 Rename apply_context -> context 2010-04-29 02:25:30 -04:00
Behdad Esfahbod b4c7fab762 Rename 2010-04-29 02:24:25 -04:00
Behdad Esfahbod 1376fb7bf9 [apply] Use a context object to reduce number of parameters passed around 2010-04-29 02:19:21 -04:00
Behdad Esfahbod 173fde7087 Further simplify tracing 2010-04-29 01:47:30 -04:00
Behdad Esfahbod 187454c595 Add different casts from pointer and ref to avoid bugs 2010-04-23 17:44:28 -04:00
Behdad Esfahbod efb324a46f Remove GET_FOR_DATA macros
The major-version check is now handled by sanitize.  If major
doesn't match, we reject and fall back to the Null object.
2010-04-23 16:28:27 -04:00
Behdad Esfahbod a065f471b3 Cleanup Extension lookups
Two things:

1. Allow nested Extension lookups.  The offset is always positive, so
it can't loop circularly.

2. Move the check for all Extension subtables having the same lookup
type to the correct place.  Before it wasn't really working.
2010-04-22 20:15:11 -04:00
Behdad Esfahbod a3263aa773 Convert the last set of cast macros to templates 2010-04-22 18:42:01 -04:00
Behdad Esfahbod 3b2c2df41b Cleanup Extension sanitize() 2010-04-22 16:51:42 -04:00
Behdad Esfahbod 278a91f0cd Minor cleanup of sanitize
Done with an audit of all sanitize()
2010-04-22 13:59:39 -04:00
Behdad Esfahbod 9ac7dc73bc Check for (impossible) overflow 2010-04-22 13:50:22 -04:00
Behdad Esfahbod fb5904ec93 Make casts more explicit 2010-04-22 10:43:30 -04:00
Behdad Esfahbod bb1e16335e Improve Subst/Pos SubTable access and sanitize 2010-04-22 01:01:35 -04:00
Behdad Esfahbod c755cb3e3a Change header comment 2010-04-22 00:11:43 -04:00
Behdad Esfahbod 0dfcc13a46 Rename ConstCharP to CharP (overloaded now) 2010-04-21 23:41:26 -04:00
Behdad Esfahbod 62c0fd7573 Cleanup de-const-casting during sanitize 2010-04-21 23:30:48 -04:00
Behdad Esfahbod 198facdc55 Use templates for const char * casts 2010-04-21 13:35:36 -04:00
Behdad Esfahbod eba8b4f644 GNOME Bug 613015 - [HB] Does not sanitize Device tables referenced from ValueRecords 2010-04-21 02:04:02 -04:00
Behdad Esfahbod 673a4efcbc WIP 2010-04-21 02:02:57 -04:00
Behdad Esfahbod 06558d2a74 Round instead of trunc 2010-04-21 01:50:15 -04:00
Behdad Esfahbod 0e206de986 Fix warnings 2010-04-21 01:48:41 -04:00
Behdad Esfahbod 4b8487d83e Fix the mystery bug!
A couple bugs joined forces to exhibit the mystery behavior of
crashes / infinite loops on OS X / wrong kerning / invalid memory
access.  Pooh!

The bugs were involved:

  - Wrong pointer math with ValueRecord in PairPosFormat1

  - Fallout from avoiding flex arrays, code not correctly updated
    to remove sizeof() usage.

We strictly never use sizeof() directly now.  And the PairPos code
is cleaned up.  Should fix them all.  Bugs are:

  Bug 605655 - Pango 1.26.2 introduces kerning bug
  Bug 611229 - Pango reads from uninitialized memory
  Bug 593240 - (pangoosx) Crash / infinite loop with Mac OS X

We were also doing wrong math converting Device adjustments to
hb_position_t.  Fallout from FreeType days.  Should shift 16, not
6.  Fixed that too.

There's still another bug: we don't sanitize Device records
referenced from value records.  Fixing that also.
2010-04-21 01:41:29 -04:00
Behdad Esfahbod 7f7448a354 Indent 2009-12-20 21:42:14 +01:00
Behdad Esfahbod c65b26acf2 Use autoconf FLEXIBLE_ARRAY_MEMBER when available 2009-11-18 11:27:33 -05:00
Behdad Esfahbod 9db8ad7531 Add hb_ot_layout_position_finish()
We expect buffer to be setup with default positions before GPOS.
2009-11-06 16:47:31 -05:00
Behdad Esfahbod c3f9f7e59d Fix MarkMark issue with ligid and components 2009-11-05 16:16:14 -05:00
Behdad Esfahbod 9bef3611f0 Rename [xy]_pos to [xy]_offset since we don't accumulate positions 2009-11-05 12:20:11 -05:00
Behdad Esfahbod 7951279b4a Implement nil font functions 2009-11-03 20:27:05 -05:00
Behdad Esfahbod d3480ba37f Don't use zero-sized arrays
It's not part of the standard and MSVC doesn't like it.  It makes the code
a lot less elegant than it used to be, but I think it should work now.
2009-11-03 10:47:29 -05:00
Behdad Esfahbod 3e2401f6c5 [HB] Rename DEBUG to TRACE where appropriate 2009-11-02 14:40:48 -05:00
Behdad Esfahbod 0535b50f43 [HB] Add GSUB/GPOS tracing 2009-11-02 14:40:48 -05:00
Behdad Esfahbod c91facd83b [HB] Bug 593231 - < c99 compiler dislikes ValueRecord 2009-11-02 14:40:47 -05:00
Behdad Esfahbod 8f034d5849 Fix a few other pedantic warnings 2009-11-02 14:40:45 -05:00
Behdad Esfahbod 3c69bd46e2 [HB] Avoid int overflow in GPOS
Bug 592036 - integer overflow bug causes misrendering of Nepali characters
2009-11-02 14:40:44 -05:00
Behdad Esfahbod b2b18ef43c [HB] Simplify loop 2009-11-02 14:40:44 -05:00
Behdad Esfahbod b41f210d12 [HB] Merge mark positionin code between three types of lookups 2009-11-02 14:40:44 -05:00
Behdad Esfahbod 3564ee5216 [HB] Correctly sanitize LigatureAttach 2009-11-02 14:40:43 -05:00
Behdad Esfahbod cb71a2fb76 [HB] Simplify MarkBase and MarkLig too 2009-11-02 14:40:43 -05:00
Behdad Esfahbod dfa54f4440 [HB] Simplify MarkMark 2009-11-02 14:40:43 -05:00
Behdad Esfahbod 815a73e420 [HB] Fix possible int overflows during sanitize 2009-11-02 14:40:43 -05:00
Behdad Esfahbod 5769538abf [HB] Add note about auditing sanitize code for overflows 2009-11-02 14:40:43 -05:00
Behdad Esfahbod f71329147b [HB] Ouch. Fix compilation. 2009-11-02 14:40:40 -05:00
Behdad Esfahbod 0532ed160c [HB] Fix invalid access / overflow on x86-64
Bug 591557 – [HB] crash scrolling the evolution message list
Bug 591576 – crashed with SIGSEGV at pango
2009-11-02 14:40:40 -05:00
Behdad Esfahbod 20b035dad4 [HB] Put C++ inline's back
Apparetly in C++, inline means a totally different thing.
2009-11-02 14:40:36 -05:00
Behdad Esfahbod 468769b8f5 [HB] Rename hb_ot_layout_feature_mask_t to hb_mask_t 2009-11-02 14:40:34 -05:00
Behdad Esfahbod 90482b6817 [HB] Fix a couple other sanitize() bugs 2009-11-02 14:40:31 -05:00
Behdad Esfahbod b28815c1f6 [HB] Add sanitize debugging facilities 2009-11-02 14:40:30 -05:00
Behdad Esfahbod 5ff4e13143 [HB] Avoid infinite recusion in Extension sanitize() 2009-11-02 14:40:30 -05:00
Behdad Esfahbod a328d66e6a [HB] Minor cleanup 2009-11-02 14:40:29 -05:00
Behdad Esfahbod e49a84c9e3 [HB] GDEF sanitize() 2009-11-02 14:40:29 -05:00
Behdad Esfahbod 18939487d0 [HB] Fix Extension sanitize() 2009-11-02 14:40:29 -05:00
Behdad Esfahbod 15164d9258 [HB] Fix mix warnings 2009-11-02 14:40:29 -05:00
Behdad Esfahbod 42b778f89e [HB] GPOS sanitize() 2009-11-02 14:40:29 -05:00
Behdad Esfahbod 196598bbcc [Hb] Use reinterpret casts instead of direct casts to char * 2009-11-02 14:40:28 -05:00
Behdad Esfahbod 23c86aa000 [HB] Use face_t directly instead of ot_layout_t 2009-11-02 14:40:27 -05:00
Behdad Esfahbod 5f5b24f99f [OT] Rename C++ header files from *.h to *.hh 2009-11-02 14:40:27 -05:00