Commit Graph

867 Commits

Author SHA1 Message Date
Behdad Esfahbod fff9aa263d Minor 2010-05-05 00:32:21 -04:00
Behdad Esfahbod 27e302dc8e I keep changing my mind about this 2010-05-05 00:26:16 -04:00
Behdad Esfahbod 39840474af Remove SANITIZE_ARG_DEF and SANITIZE_ARG 2010-05-05 00:23:19 -04:00
Behdad Esfahbod b261e2ad5c Remove trace from sanitize_shallow() 2010-05-05 00:20:16 -04:00
Behdad Esfahbod dfc8cbe854 Add hb_trace_t 2010-05-05 00:19:46 -04:00
Behdad Esfahbod 20e3dd5d29 Make sanitize_depth variable automatic and not passed through function args 2010-05-04 23:32:49 -04:00
Behdad Esfahbod 4a446ac351 Use function template for pass-thru argument 2010-05-04 22:56:20 -04:00
Behdad Esfahbod 98daaf183d Make _hb_sanitize_*() methods of the context object 2010-05-04 22:42:49 -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 89da1346ec Remove SANITIZE_OBJ 2010-05-04 15:01:45 -04:00
Behdad Esfahbod 4d4cce9626 Remove SANITIZE_THIS2 2010-05-04 14:57:55 -04:00
Behdad Esfahbod 26bfcb64e4 Cosmetic 2010-05-04 14:49:45 -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 73c7dbf7f5 Remove SANITIZE2 2010-05-04 14:40:55 -04:00
Behdad Esfahbod c9f14687a3 Remove the NEUTER macro, move code to a method 2010-05-04 14:38:08 -04:00
Behdad Esfahbod 30fa2821c2 Make internal method private 2010-05-04 14:28:18 -04:00
Behdad Esfahbod ce5694c796 [main] Recognize Apple SFNTs 2010-05-04 14:10:18 -04:00
Behdad Esfahbod 710500a93e Comment new SFNT tags 2010-05-03 23:11:16 -04:00
Behdad Esfahbod 64d3fc8d0d Cosmetic: Rename HB_LIKELY/HB_UNLIKELY to likely/unlikely 2010-05-03 22:51:19 -04:00
Behdad Esfahbod fa3b3d5844 Mark a couple functions as inline 2010-05-03 22:47:22 -04:00
Behdad Esfahbod 6b84198f9d Merge remote branch 'jrmuizel/master' 2010-05-03 22:46:52 -04:00
Jeff Muizelaar eaf29edb8f HB_UNUSED is unneeded on static inline functions 2010-05-03 22:27:56 -04:00
Jeff Muizelaar 4ce578ed36 Include the tags from the Apple specification for TrueType fonts 2010-05-03 15:03:53 -04:00
Behdad Esfahbod 631d10b728 Remove unused method 2010-05-02 21:14:21 -04:00
Behdad Esfahbod f0abcd6940 Whitespace 2010-05-02 18:14:25 -04:00
Behdad Esfahbod a8d960bd26 [GPOS] Speedup apply_value() 2010-04-29 14:31:56 -04:00
Behdad Esfahbod 2cd1ea4411 [ft] Disallow getting the entire font data with tag=0 2010-04-29 14:16:43 -04:00
Behdad Esfahbod 33d13fdda9 Rename HB_GNUC_UNUSED -> HB_UNUSED 2010-04-29 13:56:44 -04:00
Behdad Esfahbod 7d3a126334 Define HB_FUNC for portability to non-gcc 2010-04-29 13:54:01 -04:00
Behdad Esfahbod fa030175ca [sanitize] Make debug code always available to the compiler
Such that we don't break debug build all the time.
2010-04-29 13:48:26 -04:00
Behdad Esfahbod fde6f5bd68 Convert to uppercase in hb_ot_tag_from_language() 2010-04-29 04:41:41 -04:00
Behdad Esfahbod 6f729b45b0 More contour point use 2010-04-29 03:59:06 -04:00
Behdad Esfahbod 3840b6b505 [gdef] Fix delta scale 2010-04-29 03:48:27 -04:00
Behdad Esfahbod 4ac6cc284b [gdef] Fix rounding 2010-04-29 03:48:11 -04:00
Behdad Esfahbod b52fbb1bab [gdef] Implement getting contour point 2010-04-29 03:47:00 -04:00
Behdad Esfahbod 4c5fbae011 Make sure mirroring is done in original direction
Reported by Jonathan Kew.
2010-04-29 03:39:39 -04:00
Behdad Esfahbod ce23c9234b Use BCP47 private-use tags for OpenType tag language string mapping 2010-04-29 03:31:03 -04:00
Behdad Esfahbod eaf1d9a46c Minor 2010-04-29 03:11:32 -04:00
Behdad Esfahbod 3a4784fe88 Fix bug in hb_language_from_string()
Reported by Jonathan Kew.
2010-04-29 02:58:38 -04:00
Behdad Esfahbod 602e4f8d55 Use const_cast 2010-04-29 02:28:54 -04:00
Behdad Esfahbod abff3580a5 Add const 2010-04-29 02:27:20 -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 bc20045743 Simplify trace code 2010-04-29 01:40:26 -04:00
Behdad Esfahbod 807c5b03a2 [sanitize] Make debug code always available to the compiler
Such that we don't break debug build all the time.
2010-04-28 23:28:07 -04:00
Behdad Esfahbod 74e313c016 [gsubgpos] Make debug code always available to the compiler
Such that we don't break debug build all the time.
2010-04-28 15:15:09 -04:00
Behdad Esfahbod 41011a6ed7 Fix compiler warning about value unused 2010-04-28 13:33:09 -04:00
Behdad Esfahbod 863df68e89 [object] Make debug code always available to the compiler
Such that we don't break debug build all the time.
2010-04-28 13:29:55 -04:00
Behdad Esfahbod 1d52151a19 Minor 2010-04-28 13:20:31 -04:00
Behdad Esfahbod 444fffb1ab [blob] Make debug code always available to the compiler
Such that we don't break debug build all the time.
2010-04-28 13:16:38 -04:00
Behdad Esfahbod ba51b25c7b Fix build. Ouch! 2010-04-28 13:10:36 -04:00
Behdad Esfahbod a92f0fda7f Fix debug build 2010-04-28 13:09:40 -04:00
Behdad Esfahbod c165f25410 [object] Actually handle malloc() failure
Caught by John Daggett.
2010-04-27 23:28:10 -04:00
Behdad Esfahbod caff7db93d Fix Device::get_size() calculation 2010-04-26 10:07:35 -04:00
Behdad Esfahbod 66d6eb30eb Rename Var to Obj 2010-04-25 23:01:45 -04:00
Behdad Esfahbod 690b919461 Remove use of flexible arrays
Also remove wrong ASSERT_SIZE that would trigger only when not using
flexible arrays (which was the case on win32, but not with gcc).
2010-04-25 22:52:22 -04:00
Behdad Esfahbod 1cebfbb063 Cleanup hb_face_create_for_data() 2010-04-23 20:49:18 -04:00
Behdad Esfahbod d6b3c83a90 Allow get_table() to return NULL 2010-04-23 19:59:53 -04:00
Behdad Esfahbod ad3653751b Typo 2010-04-23 19:43:40 -04:00
Behdad Esfahbod 990443e5f2 Remove lock_instance() 2010-04-23 17:53:32 -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 f1aaa2a436 Add TODO 2010-04-23 15:19:50 -04:00
Behdad Esfahbod 33d4d4325e Zero glyph metrics before calling user callback 2010-04-23 14:56:55 -04:00
Behdad Esfahbod 4206e9511a More warning fixes 2010-04-23 14:54:01 -04:00
Behdad Esfahbod ef66ebeabc Remove unused parameter 2010-04-23 14:40:36 -04:00
Behdad Esfahbod 1d720192b1 Fix compile warnings (HB_GNUC_UNUSED) 2010-04-23 14:39:10 -04:00
Behdad Esfahbod 8dfdca599c No need to keep blob in sanitize context 2010-04-23 14:07:34 -04:00
Behdad Esfahbod 254933c397 When sanitizing, delay making writable
Before, as soon as we needed to make an edit, we tried to make the blob
writable inplace.  That grows code unnecessarily though.  We can simply
fail, make writable, then start again.  That's indeed what the fallback
was doing anyway.
2010-04-23 13:57:10 -04:00
Behdad Esfahbod 71e735e915 [blob] Fallback to copying if mprotect() fails 2010-04-23 13:48:06 -04:00
Behdad Esfahbod 1aa4666b91 Cleanup OpenTypeFontFile 2010-04-23 13:32:03 -04:00
Behdad Esfahbod ae4190cafe Properly define separate structs for TTCHeader and TTCHeaderVersion1 2010-04-23 12:33:02 -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 a0bb49c583 Add comment re bsearch effect on sanitize 2010-04-22 18:47:03 -04:00
Behdad Esfahbod d632ec4000 Cosmetic 2010-04-22 18:42:05 -04:00
Behdad Esfahbod a3263aa773 Convert the last set of cast macros to templates 2010-04-22 18:42:01 -04:00
Behdad Esfahbod c38188a191 Remove unused macro 2010-04-22 16:52:09 -04:00
Behdad Esfahbod 3b2c2df41b Cleanup Extension sanitize() 2010-04-22 16:51:42 -04:00
Behdad Esfahbod 1856184b93 Fail sanitize on major version mismatch
We handle major-version differences via get_for_data(), so sanitize
should never see a major version mismatch.
2010-04-22 14:21:17 -04:00
Behdad Esfahbod df3f505dcf More sanitize cleanup 2010-04-22 14:11:33 -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 9fc8684fd8 Cleanup ContextFormat3 sanitize 2010-04-22 13:37:58 -04:00
Behdad Esfahbod e77302c61f Add comment 2010-04-22 13:34:00 -04:00
Behdad Esfahbod 7c469c3ca4 Minor 2010-04-22 13:26:21 -04:00
Behdad Esfahbod dc228048a8 Remove integrity check in Tag sanitize
Serves no useful purpose.
2010-04-22 13:22:41 -04:00
Behdad Esfahbod 8015a8c762 Don't sanitize raw table data
That part is performed by individual table sanitize.
2010-04-22 13:21:12 -04:00
Behdad Esfahbod c293581e96 Add coment 2010-04-22 11:20:28 -04:00
Behdad Esfahbod 1faa76c6e8 Remove unnecessary casts 2010-04-22 10:54:26 -04:00
Behdad Esfahbod 079dc40112 Avoid overflow in TableDirectory sanitize 2010-04-22 10:47:12 -04:00
Behdad Esfahbod fb5904ec93 Make casts more explicit 2010-04-22 10:43:30 -04:00
Behdad Esfahbod 565c80bd29 Make sure semicolon is expected after DEFINE_NULL_DATA() 2010-04-22 10:26:35 -04:00
Behdad Esfahbod bb1e16335e Improve Subst/Pos SubTable access and sanitize 2010-04-22 01:01:35 -04:00
Behdad Esfahbod 81f2af40f9 Simplify Extension offset now that our int types have no alignment 2010-04-22 00:58:49 -04:00
Behdad Esfahbod 19828ad42d Sanitize shallow in Lookup since the generic SubLookup has no methods 2010-04-22 00:50:19 -04:00
Behdad Esfahbod e5546a4352 Watch for overflow in Array sanitize 2010-04-22 00:48:54 -04:00
Behdad Esfahbod 4f5f1c34dd Rename const_sub_array to sub_array since all consts are implicit now 2010-04-22 00:27:39 -04:00
Behdad Esfahbod 0795b784dd Cosmetic 2010-04-22 00:23:14 -04:00
Behdad Esfahbod 2d98d3bbaa Simplify Lookup sanitize 2010-04-22 00:19:30 -04:00
Behdad Esfahbod c755cb3e3a Change header comment 2010-04-22 00:11:43 -04:00
Behdad Esfahbod 243d20e011 More cast simplification 2010-04-21 23:57:01 -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 dd15587056 Add more comments 2010-04-21 23:13:33 -04:00
Behdad Esfahbod c85c362067 Add comment 2010-04-21 23:12:54 -04:00
Behdad Esfahbod 2467c669c2 Add comment 2010-04-21 23:11:45 -04:00
Behdad Esfahbod 29c3f5e1b6 Improve comment 2010-04-21 23:01:00 -04:00
Behdad Esfahbod 01c01618e9 Further simplify IntType struct defs 2010-04-21 22:49:56 -04:00
Behdad Esfahbod 2cb08458f6 Rename const_array() to array() (overloaded) 2010-04-21 22:37:31 -04:00
Behdad Esfahbod 2e2f43edf2 Remove ArrayAfter, use StructAfter in place 2010-04-21 22:30:36 -04:00
Behdad Esfahbod e961c86c57 Convert NEXT() and ARRAY_AFTER() macros to templates 2010-04-21 15:56:11 -04:00
Behdad Esfahbod 198facdc55 Use templates for const char * casts 2010-04-21 13:35:36 -04:00
Behdad Esfahbod 1922ffe701 Const correctness 2010-04-21 04:52:11 -04:00
Behdad Esfahbod e032ed9f75 Use templates for defining int typess 2010-04-21 04:51:55 -04:00
Behdad Esfahbod 2c9fd2adce Remove unused macro 2010-04-21 02:15:39 -04:00
Behdad Esfahbod 7a52f28117 Rename macros 2010-04-21 02:14:44 -04:00
Behdad Esfahbod ffff7dc44c Minor 2010-04-21 02:13:55 -04:00
Behdad Esfahbod f60f2166c4 Move macros around 2010-04-21 02:12:45 -04:00
Behdad Esfahbod 649a4344ca Remove unused macros 2010-04-21 02:11:59 -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 40d73bc68d Improve comments 2010-04-21 01:55:20 -04:00
Behdad Esfahbod 394bad41a7 Remove stale TODO item 2010-04-21 01:55:17 -04:00
Behdad Esfahbod 9d3677899f Use a function template instead of struct template for Null 2010-04-21 01:55:12 -04:00
Behdad Esfahbod ffd321afd9 Simplify Tag struct 2010-04-21 01:55:09 -04:00
Behdad Esfahbod 00e23fcc6f Cosmetic 2010-04-21 01:55:03 -04:00
Behdad Esfahbod a87072db5d Fix Class operator return type 2010-04-21 01:54:57 -04:00
Behdad Esfahbod f9b3772798 Add couple consts to operators 2010-04-21 01:54:53 -04:00
Behdad Esfahbod 53d237ec63 Remove ASSERT_SIZE_DATA 2010-04-21 01:54:49 -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 d5943407a4 Fix debug build 2010-04-21 01:42:11 -04:00
Behdad Esfahbod 12b27ed91d Fix leak when duplicating blob 2010-04-21 01:41:53 -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 9b39755d10 Typo 2010-04-15 14:00:25 -04:00
Behdad Esfahbod f85ec1c7da Cosmetic 2010-03-10 04:14:40 -05:00
Behdad Esfahbod e48ed72230 [ft] Check stream->read instead of stream->base
The former is more robust.  See discussion on freetype-devel.
2010-03-01 22:33:45 -05:00
Behdad Esfahbod 917c227500 Make blob unlocking 64bit-safe
GNOME Bug 604128 - Applications crash when displaying Hebrew characters
2010-02-23 16:47:51 -05:00
Behdad Esfahbod ecd2e996d2 Improve the alignment for NullPool 2010-02-23 02:42:00 -05:00
Behdad Esfahbod bc7830e425 Use __attribute__((unused)) only with gcc 4 and later
See discussion at:
https://bugzilla.gnome.org/show_bug.cgi?id=610183
2010-02-17 15:14:57 -05:00
Behdad Esfahbod 555d11273e [GDEF] Fix bug in building synthetic GDEF 2010-01-26 12:58:59 -05:00
Behdad Esfahbod cd11a98fa1 Fix compile with older FreeType 2009-12-20 23:05:02 +01:00
Behdad Esfahbod 7f7448a354 Indent 2009-12-20 21:42:14 +01:00
Behdad Esfahbod e70f45eb52 Revert "Fallback to 'kern' if no GPOS applied"
This reverts commit d740c8f78b.

The change is wrong.  If there is a GPOS table, we should not use 'kern'.
2009-12-20 21:26:24 +01:00
Behdad Esfahbod d740c8f78b Fallback to 'kern' if no GPOS applied 2009-12-20 21:23:56 +01:00
Behdad Esfahbod 2f78c17197 Remove glibism! 2009-12-20 21:03:11 +01:00