Commit Graph

793 Commits

Author SHA1 Message Date
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
Behdad Esfahbod 907e67da13 Oops, add file. 2009-12-20 20:59:51 +01:00
Behdad Esfahbod 2014b8d110 Hook OpenType shaping up
Default features only for now.
2009-12-20 20:58:26 +01:00
Behdad Esfahbod 196610ba4c Pass features down 2009-12-20 19:02:23 +01:00
Behdad Esfahbod 51f141a7f3 Avoid overflow 2009-12-20 18:22:52 +01:00
Behdad Esfahbod 26d7a75752 Refactor hb_shape a bit 2009-12-20 17:58:25 +01:00
Behdad Esfahbod 001fc2d2aa Add TrueType kern support 2009-12-20 17:24:05 +01:00
Behdad Esfahbod 2c1b85cf66 Direct unicode->get_mirroring directly 2009-12-20 16:29:17 +01:00
Behdad Esfahbod 6a2ef5aa54 Do mirroring 2009-12-20 16:28:01 +01:00
Behdad Esfahbod 0465e69832 Protect against NULL funcs 2009-12-20 16:25:18 +01:00
Behdad Esfahbod 5ceefa1d8d Add hb_unicode_get_*() functions 2009-12-20 15:29:16 +01:00
Behdad Esfahbod b8a53e44ce We'll have to link to libstdc++ if linking to ICU, so disable test for now
We have to get rid of the ICU in main lib.  Still thinking about best way
to do it.
2009-12-20 14:56:25 +01:00
Behdad Esfahbod 314905d754 Explicitly track whether the buffer has positions 2009-12-20 14:50:42 +01:00
Behdad Esfahbod 314b460d8a Add HB_DIRECTION_IS_FORWARD/BACKWARD 2009-12-20 13:58:50 +01:00
Behdad Esfahbod bdd0ff5290 Make main.cc compile without glib 2009-12-15 04:07:40 -05:00
Behdad Esfahbod 807b8aa486 Another C++ strictness fix
Pango Bug 602408 - Invalid C++ code breaks compile with Sun C++ Compiler
(Error: A union member cannot have a user-defined assignment operator)

According to the bug:

C++ Programming Language by Bjarne Stroustrup: Chapter 10.4.12 forbids
explicitly using of union members with constructors, destructors or assignment
operations.

So we use a set() method instead of the assignment operator.  Ugly, but hey,
that's life.
2009-11-19 20:35:01 -05:00
Behdad Esfahbod 8b9b866d3e Fix warning 2009-11-19 20:27:57 -05:00
Behdad Esfahbod c65b26acf2 Use autoconf FLEXIBLE_ARRAY_MEMBER when available 2009-11-18 11:27:33 -05:00
Behdad Esfahbod d33f674cb7 Add Mongolian variation selectors 2009-11-18 09:47:44 -05:00
Behdad Esfahbod d6387757de Fix sanitize 2009-11-11 17:15:03 -05:00
Behdad Esfahbod 636f017e38 Remove obsolete TODO item 2009-11-10 12:56:35 -05:00
Behdad Esfahbod bf2b25dd85 Remove done item 2009-11-06 19:52:47 -05:00
Behdad Esfahbod 4a86053159 Reverse buffer at the end if RTL 2009-11-06 19:52:01 -05:00
Behdad Esfahbod ff44f88df2 Handle shaping in non-native direction 2009-11-06 19:48:16 -05:00
Behdad Esfahbod b4b4272c8d Oops, wrong change 2009-11-06 17:46:33 -05:00
Behdad Esfahbod 52ea47767c Change order of font and face for API consistency 2009-11-06 17:45:38 -05:00
Behdad Esfahbod f4f1fc970b Remove debug info that crept in 2009-11-06 17:42:38 -05:00
Behdad Esfahbod aa196d6026 [GSUB] More ligature/component fixing
We can only reuse the ligid if it belongs to a previous ligature, not a
component!
2009-11-06 17:23:31 -05:00
Behdad Esfahbod 25e7ef7046 Add _hb_buffer_add_output_glyphs() that takes codepoint_t* 2009-11-06 17:21:01 -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 edb54e9aec Fix FT_Face finalizer call 2009-11-06 15:19:22 -05:00
Behdad Esfahbod 3d14528b8b Rename hb_buffer_get_len() to hb_buffer_get_length() 2009-11-06 15:13:17 -05:00
Behdad Esfahbod 1ff7775051 Minor. 2009-11-06 13:52:57 -05:00
Behdad Esfahbod 3648bdf5b2 Fix FT_Face generic finalizer 2009-11-05 20:17:53 -05:00
Behdad Esfahbod 5a11c875d8 Cosmetic 2009-11-05 20:08:17 -05:00
Behdad Esfahbod 44533e773f Fix warning 2009-11-05 19:58:02 -05:00
Behdad Esfahbod bcc0406a52 include errno.h 2009-11-05 19:54:23 -05:00
Behdad Esfahbod 799b3c375a Add debugging to object lifecycle 2009-11-05 19:37:58 -05:00
Behdad Esfahbod 25edb940ab Cosmetic 2009-11-05 19:20:06 -05:00
Behdad Esfahbod 850dc5bb55 Return 0 from get_glyph_nil 2009-11-05 18:26:52 -05:00
Behdad Esfahbod 85555a9533 Initialize font->klass 2009-11-05 18:25:56 -05:00
Behdad Esfahbod bcd26bd7b1 Add TODO item 2009-11-05 18:03:26 -05:00
Behdad Esfahbod f4281e0a92 Fix ref counting 2009-11-05 17:58:41 -05:00
Behdad Esfahbod 6358ff45ae Add hb_ft_face_create_cached 2009-11-05 17:39:16 -05:00
Behdad Esfahbod 2027f74b28 Add default positioning to hb-shape 2009-11-05 16:34:47 -05:00
Behdad Esfahbod c3f9f7e59d Fix MarkMark issue with ligid and components 2009-11-05 16:16:14 -05:00
Behdad Esfahbod d0351314cd Include stdio.h if debugging 2009-11-05 16:16:06 -05:00
Behdad Esfahbod 2e33669291 Add hb_font_get_* 2009-11-05 13:55:41 -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 2daa47e9cd Cosmetic 2009-11-05 12:08:34 -05:00
Behdad Esfahbod 2f50d87368 Start filling hb_shape() in 2009-11-04 21:07:03 -05:00
Behdad Esfahbod ae070b7d39 Add script and language to buffer 2009-11-04 20:29:54 -05:00
Behdad Esfahbod 8a3511ac6c Add hb_language_t as well as language/script conversion to OT tags 2009-11-04 19:45:39 -05:00
Behdad Esfahbod 4591753ad4 Define ARRAY_LENGTH 2009-11-04 18:15:59 -05:00
Behdad Esfahbod 214ac7c1ff Another one 2009-11-04 18:12:32 -05:00
Behdad Esfahbod 1e91434569 Minor 2009-11-04 18:12:09 -05:00
Behdad Esfahbod 48de3730cd Fix previous commit, ouch! 2009-11-04 16:59:50 -05:00
Behdad Esfahbod e21899bc35 Fix array query API
The array query APIs now all do:

  - Return the total number of items
  - Take a start_offset, such that individual items can be fetched
  - The _count IN/OUT variable always has number of items written
    into the array upon return of the function
2009-11-04 16:36:14 -05:00
Behdad Esfahbod 3b59306b85 Finish FT glue. Rough and untested 2009-11-04 15:48:32 -05:00
Behdad Esfahbod 7951279b4a Implement nil font functions 2009-11-03 20:27:05 -05:00
Behdad Esfahbod 8fb3d1aa4e Start ft glue 2009-11-03 18:34:20 -05:00
Behdad Esfahbod d94647e2cd Add ICU glue 2009-11-03 16:35:10 -05:00
Behdad Esfahbod b7dd4b945b Fix hb_be_uint16() 2009-11-03 15:21:15 -05:00
Behdad Esfahbod cd7555eef2 Namespace MSVC defines in public header 2009-11-03 15:16:10 -05:00
Behdad Esfahbod 5ebabecef3 Move unicode_funcs to buffer 2009-11-03 15:15:07 -05:00
Behdad Esfahbod d5a8e46099 [Makefile] Install hb-unicode.h
Separate OT headers also.
2009-11-03 15:14:40 -05:00
Behdad Esfahbod 21d0fce3d5 Add check for not linking to libstdc++ 2009-11-03 14:28:32 -05:00
Behdad Esfahbod ca95ce460a Use the C linker, not C++ linker
Such that we don't link to libstdc++.
2009-11-03 14:18:33 -05:00
Behdad Esfahbod ffbe0a853d More MSVC fixes from Jonathan Kew 2009-11-03 10:52:45 -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 6bec81aa3a Cosmetic 2009-11-02 19:17:36 -05:00
Behdad Esfahbod 2f3e69f3cb Fix build without glib, again 2009-11-02 18:53:15 -05:00
Behdad Esfahbod 63a792a811 Update Makefile to build without glib 2009-11-02 18:34:26 -05:00
Behdad Esfahbod 68a2c771e2 Build without glib
Thready-safety disabled in that case, until we add support for pthread, etc.
Fun...
2009-11-02 18:31:53 -05:00
Behdad Esfahbod cc4c096a7e MSVC has no stdint.h 2009-11-02 18:14:48 -05:00