Commit Graph

2321 Commits

Author SHA1 Message Date
suzuki toshiya cef43bde8e Fix `multi build' for Tytgat's CFF driver improvement.
* src/base/cffload.h (cff_index_get_name): Added.
2010-03-14 23:12:13 +09:00
suzuki toshiya 199f04f33d Remove duplicated inclusion of `FT_OUTLINE_H' in ftobjs.c. 2010-03-12 14:48:57 +09:00
Chris Liddell 6c0d881418 Fix Savannah bug #27442.
* src/raster/ftraster.c (ft_black_reset): Fix `buffer_size'.
2010-03-11 18:27:31 +01:00
Werner Lemberg 763300a97c Remove unused variable.
Reported by Graham.

* src/cff/cffparse.c (cff_parse_real): Remove `rest'.
2010-03-09 17:01:21 +01:00
Werner Lemberg 03b3da8bb6 Improve CFF string (especially glyphname) lookup performance.
We do this by avoiding memory allocation and file I/O.  This is
Savannah patch #7104.

* src/cff/cfftypes.h: Include PS cmaps service and
FT_INTERNAL_POSTSCRIPT_HINTS_H.
(CFF_SubFontRec): Remove `num_local_subrs'.
(CFF_FontRec): Add `num_strings', `strings', and `string_pool'
fields.
Remove `string_index' and `num_global_subrs' fields.
Use real types instead of `void' for `pshinter' and `psnames' fields.

* src/cff/cffload.c: Don't include PS cmaps service.
(cff_index_get_pointers): Add `pool' parameter which allows to
insert an extra NUL character for each String INDEX entry.
(cff_index_get_name): Make it a local function.
(cff_index_get_string): New function.
(cff_subfont_load): Updated.
(cff_font_load): Initialize `num_strings', `strings', and
`string_pool' fields in the `CFF_FontRec' structure.
(cff_index_get_sid_string): Use `cff_index_get_string' instead of
`cff_index_get_name'.
(cff_font_done): Updated.

* src/cff/cffload.h: Don't include PS cmaps service.
(cff_index_get_string): Added.
(cff_index_get_sid_string): Updated.

* src/cff/cffobjs.c: Don't include PS cmaps service and
FT_INTERNAL_POSTSCRIPT_HINTS_H.
(cff_size_get_globals_funcs, cff_slot_init): Updated.
(cff_face_init): Follow `cff_index_get_name',
`cff_index_get_string', and `cff_index_get_sid_string' changes.

* src/cff/cffcmap.c (cff_sid_free_glyph_name): Removed.
(cff_sid_to_glyph_name): Use `cff_index_get_cid_string'.
(cff_cmap_unicode_init): Updated.

* src/cff/cffdrivr.c: Don't include PS cmap service.
(cff_get_glyph_name): Avoid unnecessary lookup for POSTSCRIPT_CMAPS
service.
(cff_get_glyph_name, cff_ps_get_font_info, cff_get_ros): Follow API
`cff_index_get_sid_string' change.
(cff_get_name_index): Use `cff_index_get_string' instead of
`cff_index_get_name'.

* src/cff/cffgload.c: Don't include FT_INTERNAL_POSTSCRIPT_HINTS_H.
(cff_decoder_init, cff_decoder_prepare): Updated.
2010-03-02 13:00:55 +01:00
Werner Lemberg e0717d4f48 Simplify code.
Suggested by Behdad.

* src/base/ftobjs.c (FT_Get_First_Char): Don't use a loop since we
call FT_Get_Next_Char anyway if necessary.
2010-02-27 08:10:11 +01:00
Behdad Esfahbod 2415cbf365 Improve handling of invalid glyph indices in char->index functions.
* src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Use a
loop.
2010-02-26 23:48:53 +01:00
Chris Liddell 10cf388795 Fix Savannah bug #28905.
Initialize phantom points before calling the incremental interface
to update glyph metrics.

* src/truetype/ttgload.c (tt_get_metrics_incr_overrides)
[FT_CONFIG_OPTION_INCREMENTAL]: New function, split off from...
(tt_get_metrics): This.
Updated.
(load_truetype_glyph): Use tt_get_metrics_incr_overrides.
2010-02-18 17:09:30 +01:00
Werner Lemberg b36d4192a3 * Version 2.3.12 released.
==========================

Tag sources with `VER-2-3-12'.

* docs/CHANGES: Updated.

* docs/VERSION.DLL: Update documentation and bump version number to
2.3.12.

* README, Jamfile (RefDoc),
builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype.vcproj,
builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
builds/win32/visualce/freetype.vcproj,
builds/win32/visualce/index.html,
builds/wince/vc2005-ce/freetype.vcproj,
builds/wince/vc2005-ce/index.html,
builds/wince/vc2008-ce/freetype.vcproj,
builds/wince/vc2008-ce/index.html: s/2.3.11/2.3.12/, s/2311/2312/.

* include/freetype/freetype.h (FREETYPE_PATCH): Set to 12.

* builds/unix/configure.raw (version_info): Set to 10:0:4.
2010-02-13 07:57:56 +01:00
suzuki toshiya ad6954a0cb Improve autotool version checking to work with beta releases. 2010-02-13 02:25:04 +09:00
suzuki toshiya 93eaf50aae Fix overallocating bug in FT_Outline_New_Internal(). 2010-02-13 01:08:33 +09:00
Ken Sharp 63e7aac34f Really fix Savannah bug #28678 (part 2).
Since we consider `sbw' for the horizontal direction only, we still have
to synthesize vertical metrics if the user wants to use the vertical
writing direction.

* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
(cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph):
Synthesize vertical metrics (only) if FT_LOAD_VERTICAL_LAYOUT is
set.
2010-02-10 07:13:27 +01:00
Ken Sharp 980b76ea5e Really fix Savannah bug #28678 (part 1).
After long discussion, we now consider the character width vector
(wx,wy) returned by the `sbw' Type 1 operator as being part of *one*
direction only.  For example, if you are using the horizontal
writing direction, you get the horizontal and vertical components of
the advance width for this direction.  Note that OpenType and CFF fonts
don't have such a vertical component; instead, the GPOS table can be
used to generate two-dimensional advance widths (but this isn't
handled by FreeType).

* include/freetype/ftincrem.h (FT_Incremental_MetricsRec): Add
`advance_v' field to hold the vertical component of the advance
value.

* src/truetype/ttgload.c (tt_get_metrics), src/cff/cffgload.c
(cff_slot_load), src/type1/t1gload.c
(T1_Parse_Glyph_And_Get_Char_String), src/cid/cidgload.c
(cid_load_glyph): Use it.
2010-02-10 07:02:43 +01:00
Werner Lemberg db9a41e81b * devel/ftoption.h [FT_CONFIG_OPTION_PIC]: Define.
Other minor documentation fixes.
2010-02-09 15:43:24 +01:00
suzuki toshiya d9145241fe Prevent NULL pointer dereference passed to FT_Module_Requester. 2010-02-05 02:58:24 +09:00
suzuki toshiya c9669a8a63 [sfnt] Fix memory leaks in previous patch. 2010-01-30 02:24:25 +09:00
suzuki toshiya 75852eda51 New parameters for FT_Open_Face() to ignore preferred family names. 2010-01-29 23:18:34 +09:00
Ken Sharp f19e46f3ba Fix Savannah bug #28678.
* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
(cid_load_glyph): Handle vertical metrics correctly.

* src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Handle
vertical metrics correctly.
(T1_Load_Glyph): Don't synthesize vertical metrics.
2010-01-27 10:04:50 +01:00
Werner Lemberg 13fa21bd5e Make FT_Set_Transform work if no renderer is available.
* src/base/ftobjs.c (FT_Load_Glyph): Apply `standard' transformation
if no renderer is compiled into the library.
2010-01-14 21:34:08 +01:00
Werner Lemberg d40cd0b4a4 Fix compilation warning. 2010-01-14 20:32:21 +01:00
Werner Lemberg df870f3e15 Provide inline assembly code for RVCT compiler.
This is Savannah patch #7059.

* include/freetype/config/ftconfig.h (FT_MULFIX_ASSEMBLER,
FT_MulFix_arm) [__CC_ARM || __ARM_CC]: Define.
2010-01-11 06:28:56 +01:00
Ken Sharp 8ea31415f4 Fix Savannah bug #28521.
Issue #28226 involved a work-around for a font which used the
`setcurrentpoint' operator in an invalid way; this operator is only
supposed to be used with the result of OtherSubrs, and the font used
it directly.  The supplied patch removed the block of code which
checked this usage entirely.

This turns out to be a Bad Thing.  If `setcurrentpoint' is being
used correctly it should reset the flex flag in the decoder.  If we
don't do this then the flag never gets reset and we omit any further
contours from the glyph (at least until we close the path or
similar).

* src/psaux/t1decode.c (t1_decoder_parse_charstrings)
<op_setcurrentpoint>: Handle `flex_state' correctly.
2010-01-08 18:13:02 +01:00
Werner Lemberg 297dc2235a Another clang fix. 2010-01-05 20:48:57 +01:00
Werner Lemberg fc58155afc Apply reports from clang static analyzer.
* src/lzw/ftlzw.c (ft_lzw_file_init), src/base/ftstroke.c
(FT_Stroker_ParseOutline), src/base/ftsynth.c
(FT_GlyphSlot_Embolden): Remove dead code.

* src/base/ftpatent.c (_tt_check_patents_in_table): Initialize
`offset_i'.
2010-01-05 20:00:35 +01:00
Ralph Giles e383729536 Enable the incremental font interface by default.
Ghostscript requires the incremental font interface for handling
some Postscript documents.  It is moving to using FreeType as its
primary renderer; supporting this in the default build makes it
Ghostscript to be linked against the system FreeType when one is
available.

* include/freetype/config/ftoption.h (FT_CONFIG_OPTION_INCREMENTAL):
Uncomment.
2010-01-05 19:36:58 +01:00
Werner Lemberg 2a33275e3a Fix Savannah bug #28395.
* src/truetype/ttdriver.c (Load_Glyph), src/type1/t1gload.c
(T1_Loada_Glyph): Don't check `num_glyphs' if incremental interface
is used.
2010-01-05 10:27:15 +01:00
Werner Lemberg 942d92c9c0 Minor fixes. 2010-01-05 10:24:25 +01:00
Ken Sharp dbe5622335 Make Type 1 `seac' operator work with incremental interface.
* src/psaux/t1decode.c (t1operator_seac): Don't check `glyph_names'
if incremental interface is used.
2010-01-05 09:43:01 +01:00
Werner Lemberg 3445e4f942 Make incremental interface work with TrueType fonts.
* src/truetype/ttgload.c (load_truetype_glyph): Don't check
`glyf_offset' if incremental interface is used.
2010-01-04 15:53:27 +01:00
Lars Abrahamsson 8cf9b74cf0 Make compilation with FT_CONFIG_OPTION_PIC work again.
* src/base/ftglyph.c (FT_Glyph_To_Bitmap) [FT_CONFIG_OPTION_PIC]:
Declare `library' for FT_BITMAP_GLYPH_CLASS_GET.

* src/base/ftinit.c (ft_destroy_default_module_classes,
ft_create_default_module_classes): Use proper casts (needed for C++
compilation).

* src/sfnt/ttcmap.c (tt_cmap13_class_rec): Use FT_DEFINE_TT_CMAP.
2009-12-31 18:26:14 +01:00
Werner Lemberg 173bdc681a Minor addition. 2009-12-22 00:27:29 +01:00
Marc Kleine-Budde 978b11dc59 Make freetype-config aware of $SYSROOT.
* builds/unix/freetype-config.in: Decorate with ${SYSROOT} where
appropriate.
2009-12-22 00:25:38 +01:00
Werner Lemberg f4fe5a4a7f Fix compiler warning.
Reported by Sean.

* src/base/ftdbgmem.c [!FT_DEBUG_MEMORY]: ANSI C doesn't like empty
source files; however, some compilers warn about an unused variable
declaration.  This is now replaced with a typedef.
2009-12-20 17:56:22 +01:00
Werner Lemberg 7bdc1d598d Fix Savannah bug #28320.
There exist corrupt, subsetted fonts (embedded in PDF files) which
contain a private dict that ends with an unterminated floating point
number (no operator following).  We now ignore this error (as
acrobat does).

* src/cff/cffparse.c (cff_parser_run): Don't emit a syntax error for
unterminated floating point numbers.
2009-12-18 07:13:22 +01:00
Werner Lemberg 7da7ad9457 Really fix compiler warnings.
Reported by Sean.

* src/truetype/ttgxvar.c (GX_PT_POINTS_ARE_WORDS,
GX_PT_POINT_RUN_COUNT_MASK): Convert enum values to macros.
2009-12-16 18:13:55 +01:00
Werner Lemberg 0770de9aac Typos. 2009-12-16 08:36:24 +01:00
suzuki toshiya d818ba5979 Improve configure.raw to copy some options from CFLAGS to LDFLAGS. 2009-12-16 13:23:14 +09:00
Werner Lemberg 481324cd36 Fix compiler warnings.
Reported by Sean.

* src/truetype/ttgxvar.c (ft_var_readpackeddeltas): Fix counter data
type.
2009-12-15 08:58:37 +01:00
Ken Sharp ce41259372 Ignore invalid `setcurrentpoint' operations in Type 1 fonts.
This fixes Savannah bug #28226.

At least two wild PostScript files of unknown provenance contain
Type 1 fonts, apparently converted from TrueType fonts in earlier
PDF versions of the files, which use the `setcurrentpoint' operator
inappropriately.

FreeType currently throws an error in this case, but Ghostscript and
Adobe Distiller both accept the fonts and ignore the problem.  This
commit #ifdefs out the check so PostScript interpreters using
FreeType can render these files.

The specification says `setcurrentpoint' should only be used to set
the point after a `Subr' call, but these fonts use it to set the
initial point to (0,0).  Unnecessarily so, as they correctly use an
`hsbw' operation which implicitly sets the initial point.
2009-12-14 22:32:32 +01:00
Werner Lemberg 2db9783869 Fix parsing of /CIDFontVersion.
This fixes Savannah bug #28287.

* src/cid/cidtoken.h: `cid_version' in CID_FaceInfoRec (in
t1tables.h) is of type FT_Fixed.
2009-12-14 22:17:26 +01:00
Werner Lemberg 8d14b6f4fd Trace glyph index in CID module.
Suggested in Savannah patch #7023.

* src/cid/cidgload.c (cid_load_glyph): Add tracing message.
2009-12-14 07:55:39 +01:00
Werner Lemberg 9045f5bdf2 Fix compiler warnings.
* src/truetype/ttgload.c (tt_get_metrics): Put `Exit' label into the
proper preprocessor conditional.
* src/pfr/pfrobjs.c (pfr_slot_load): Pacify gcc.
2009-12-03 05:57:30 +01:00
John Tytgat 087b7ea667 Better handling of start of `eexec' section.
This fixes Savannah bug #28090.

* src/type1/t1parse.c (T1_Get_Private_Dict): Skip all whitespace
characters before start of `eexec' section.
2009-11-25 23:51:06 +01:00
Werner Lemberg a5e9dbd528 Fix Savannah bug #27742.
* src/base/ftstroke.c (ft_stroker_outside): Avoid silent division by
zero, using a threshold for `theta'.
2009-11-20 09:33:57 +01:00
Werner Lemberg 934d054f45 Fix Savannah bug #28036.
* src/type1/t1afm.c (t1_get_index): Fix comparison.
2009-11-20 06:26:22 +01:00
Werner Lemberg 0197508440 Fix compiler warnings.
Reported by Kevin Blenkinsopp <arqon@promode.org>.

* src/sfnt/ttload.c (check_table_dir): Use proper data type.
2009-11-16 23:10:53 +01:00
Werner Lemberg 0aa1de621c s/casted/cast/ 2009-11-15 10:53:50 +01:00
Werner Lemberg 7635ba64b7 Really fix FreeDesktop bug #21197.
This also fixes Savannah bug #28021.

* src/autofit/aflatin.c (af_latin_metrics_check_digits),
src/autofit/aflatin2.c (af_latin2_metrics_check_digits): Fix loop.
2009-11-15 10:17:44 +01:00
Werner Lemberg c4b22144d3 Add tracing messages for advance values.
* src/base/ftobjs.c (FT_Load_Glyph), src/truetype/ttgload.c
(TT_Get_HMetrics, TT_Get_VMetrics): Do it.
2009-11-15 10:10:00 +01:00
Werner Lemberg c0aeef4571 Fix compiler warning.
Reported by Jeremy Manson <jeremy.manson@gmail.com>.

* src/truetype/ttgload.c (load_truetype_glyph): Initialize `error'.
2009-11-08 07:58:05 +01:00
Werner Lemberg c6e4180c05 Remove compiler warning.
Reported by Sean McBride <sean@rogue-research.com>.

* src/tools/apinames.c (read_header_file)<STATE_TYPE>: Use a cast to
`int', as specified in the printf(3) man page.
2009-11-04 12:18:48 +01:00
Werner Lemberg 012552f143 Fix Savannah bug #27921.
* src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
(cid_face_init), src/type1/t1afm.c (T1_Read_Metrics),
src/type1/t1objs.c (T1_Face_Init): Don't use unsigned constant
values for rounding if the argument can be negative.
2009-11-04 10:06:04 +01:00
Bram Tassyns 8821cc5df1 Add basic support for Type1 charstrings in CFF.
* src/cff/cffgload.c (CFF_Operator, cff_argument_counts): Handle
`seac', `sbw', and `setcurrentpoint' opcodes.
(cff_compute_bias): Add parameter to indicate the charstring type.
Update all callers.
(cff_operator_seac): Add parameter for side bearing.
(cff_decoder_parse_charstrings): Updated for more Type1 support.
2009-11-04 07:21:15 +01:00
Werner Lemberg f186ba682d Return correct `linearHoriAdvance' value for embedded TT bitmaps too.
Reported by Jeremy Manson <jeremy.manson@gmail.com>.

src/truetype/ttgload.c (load_truetype_glyph): Add parameter to
quickly load the glyph header only.
Update all callers.
(tt_loader_init): Add parameter to quickly load the `glyf' table
only.
Update all callers.
(TT_Load_Glyph): Compute linear advance values for embedded bitmap
glyphs too.
2009-11-03 15:46:35 +01:00
Werner Lemberg 422210be64 Improve code readability.
* src/ttgload.c (load_truetype_glyph): Move metrics calculation
to...
(tt_get_metrics): This new function.
2009-11-03 08:11:02 +01:00
bram tassyns 06ba45978d Fix Savannah bug #27811.
* src/truetype/ttxgvar.c (ft_var_readpackeddeltas): Fix
signed/unsigned mismatch.
2009-10-26 22:26:31 +01:00
Werner Lemberg 2d15120cb5 Fix handling of `get' and `put' CFF instructions.
* src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_get,
cff_op_put>: Appendix B of Adobe Technote #5177 limits the number of
elements for the `get' and `put' operators to 32.
* src/cff/cffgload.h (CFF_MAX_TRANS_ELEMENTS): Define.
(CFF_Decoder): Use it for `buildchar' and remove `len_buildchar'.
2009-10-19 21:09:13 +02:00
Werner Lemberg d90567b1e6 Fix handling of `dup' CFF instruction.
Problem and solution reported by Ning Dong <flintning@163.com>.

* src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_dup>:
Increase `args' by 2, not 1.
2009-10-18 10:47:11 +02:00
Werner Lemberg d699c2994e * Version 2.3.11 released.
==========================

Tag sources with `VER-2-3-11'.

* docs/VERSION.DLL: Update documentation and bump version number to
2.3.11.

* README, Jamfile (RefDoc), builds/win32/visualc/index.html,
builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype.vcproj,
builds/win32/visualce/index.html,
builds/win32/visualce/freetype.dsp,
builds/win32/visualce/freetype.vcproj: s/2.3.10/2.3.11/, s/2310/2311/.

* include/freetype/freetype.h (FREETYPE_PATCH): Set to 11.

* builds/unix/configure.raw (version_info): Set to 9:22:3.
2009-10-10 20:25:48 +02:00
Werner Lemberg 3c4e6baadb * docs/CHANGES, docs/release: Updated. 2009-10-10 20:15:49 +02:00
suzuki toshiya 008686a123 [pcf] Fix a bug in the nprops truncation, Gentoo bug #288357. 2009-10-11 02:07:16 +09:00
Werner Lemberg 19dfcbd2a4 * Version 2.3.10 released.
==========================

Tag sources with `VER-2-3-10'.

* builds/toplevel.mk (major, minor, patch): Fix regexp to allow more
than a single digit.
(dist): We now use git.

* docs/VERSION.DLL: Update documentation and bump version number to
2.3.10.

* README, Jamfile (RefDoc), builds/win32/visualc/index.html,
builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype.vcproj,
builds/win32/visualce/index.html,
builds/win32/visualce/freetype.dsp,
builds/win32/visualce/freetype.vcproj: s/2.3.9/2.3.10/, s/239/2310/.

* include/freetype/freetype.h (FREETYPE_PATCH): Set to 10.

* builds/unix/configure.raw (version_info): Set to 9:21:3.
2009-10-06 12:00:43 +02:00
Werner Lemberg 5c3160ec14 Formatting. 2009-10-06 11:12:28 +02:00
Werner Lemberg ca87cd0bda Fix `make multi'.
* src/cache/ftccache.c, src/cache/ftcsbits.c (FT_COMPONENT): Define.

* src/sfnt/sfdriver.c: Include FT_INTERNAL_DEBUG_H.
2009-10-06 11:09:29 +02:00
suzuki toshiya 82633a2440 [cache] Fix Savannah bug #27441, cleanup Redhat bugzilla #513582. 2009-09-27 16:55:44 +09:00
suzuki toshiya f2647ddabb [cache, psaux, type1] Fix for multi build. 2009-09-26 00:48:37 +09:00
suzuki toshiya 76f1b9d9cf [autofit] Fix for multi build. 2009-09-25 23:57:30 +09:00
suzuki toshiya 4e0c9ee155 [cache] Check the face filled by FTC_Manager_LookupFace(). 2009-09-24 14:30:40 +09:00
Werner Lemberg e2184505b1 * docs/CHANGES: Updated. 2009-09-23 09:28:48 +02:00
Werner Lemberg 766b822f4c [raster] Fix 5-levels grayscale output.
This was broken since version 2.3.0.

* src/raster/ftraster.c (count_table): Use pre-2.3.0 values (which
were then computed dynamically).
(Vertical_Gray_Sweep_Step): Updated.

(ft_black_render): Initialize `worker->gray_lines' (problem found by
valgrind).

(FT_RASTER_OPTION_ANTI_ALIASING, DEBUG_RASTER): Dont' #undef, just
comment out.
2009-09-12 23:15:17 +02:00
suzuki toshiya 812d1bc90d Improve configure.raw for cross build. 2009-09-13 02:12:44 +09:00
suzuki toshiya 704f4d75cd [BDF] Modify hash API to take size_t value instead of void *. 2009-09-13 00:50:14 +09:00
suzuki toshiya 519a5eafd7 Whitespace. 2009-09-13 00:00:28 +09:00
suzuki toshiya 0729bc9f52 [Win64] Improve the computation of random seed from stack address. 2009-09-10 16:09:55 +09:00
Werner Lemberg 4539b3eec8 Whitespace. 2009-09-08 07:05:26 +02:00
Werner Lemberg 5e240c1270 [raster] Improvements for stand-alone mode.
* src/raster/rules.mk: Don't handle ftmisc.h.  It is needed for
stand-alone mode only.

* src/raster/ftmisc.h (FT_MemoryRec , FT_Alloc_Func, FT_Free_Func,
FT_Realloc_Func): Copy declarations from ftsystem.h.
2009-09-03 13:14:24 +02:00
Bram Tassyns 4694ea2b95 Improve vertical metrics calculation (Savannah bug #27364).
The calculation of `vertBearingX' is not defined in the OTF font
spec so FreeType does a `best effort' attempt.  However, this value
is defined in the PDF and PostScript specs, and that algorithm is
better than the one FreeType currently uses:

  FreeType: Use the middle of the bounding box as the X coordinate
            of the vertical origin.

  Adobe PDF spec: Use the middle of the horizontal advance vector as
                  the X coordinate of the vertical origin.

FreeType's algorithm goes wrong if you have a really small glyph
(like the full-width, circle-like dot at the end of the sentence, as
used in CJK scripts) with large bearings.  With the FreeType
algorithm this dot gets centered on the baseline; with the PDF
algorithm it gets the correct location (in the top right).  Note
that this is a serious issue, it's like printing the dot at the end
of a Roman sentence at the center of the textline instead of on the
baseline like it should. So i believe the PDF spec's algorithm
should be used in FreeType as well.

The `vertBearingY' value for such small glyphs is also very strange
if no `vmtx' information is present, since the height of the bbox is
not representable for the height of the glyph visually (the
whitespace up to the baseline is part of the glyph).  The fix also
includes some code for a better estimate of `vertBearingY'.

* src/base/ftobjs.c (ft_synthesize_vertical_metrics): `vertBearingX'
is now calculated as described by the Adobe PDF Spec.  Estimate for
`vertBearingY' now works better for small glyphs completely above or
below the baseline into account.

* src/cff/cffgload.c (cff_slot_load): `vertBearingX' is now
calculated as described by the Adobe PDF Spec.  Vertical metrics
information was always ignored when FT_CONFIG_OPTION_OLD_INTERNALS
was not defined.

* src/truetype/ttgload.c (compute_glyph_metrics): `vertBearingX' is
now calculated as described by the Adobe PDF Spec.
2009-09-02 13:06:33 +02:00
John Tytgat 03e8b2f763 Fix custom cmap for empty Type 1 font (Savannah bug #27294).
* include/freetype/internal/t1types.h (T1_EncodingRecRec_): Update
comment to reflect revised code_last meaning.
* src/type1/t1load.c (T1_Open_Face), src/type42/t42objs.c
(T42_Open_Face): Assign max_char as highest character code + 1 and
use this for T1_EncodingRecRec_::code_last.
* src/psaux/t1cmap.c (t1_cmap_custom_init): Follow revised
T1_EncodingRecRec_::code_last meaning.
2009-09-01 08:10:24 +02:00
Werner Lemberg d77cd8ce7e Fix rendering of horizontally compressed CFFs.
Bug reported by Ivan Nincic <inincic@pdftron.com>.

* src/cff/cffgload.c (cff_slot_load): Thinko: Check `xx' element of
`font_matrix' also.

* docs/CHANGES: Updated.
2009-08-27 00:10:56 +02:00
Su Yu efaf5abcf8 Don't call `ft_fseek' every time when executing `ft_fread'.
* src/base/ftstream.c (FT_Stream_Seek), src/base/ftsystem.c
(ft_ansi_stream_io): Implement it.
2009-08-03 19:55:58 +02:00
suzuki toshiya 2b6a3f0be9 sfnt: Cast a charcode to 32-bit in cmap format 14 parser. 2009-08-01 00:37:59 +09:00
suzuki toshiya 9b1aab8d1e sfnt: Cast a charcode to 32-bit in cmap format 12 parser. 2009-08-01 00:37:58 +09:00
suzuki toshiya e6d0c1fb9c psaux: Fix a few casts to FT_Int32 value. 2009-08-01 00:37:58 +09:00
suzuki toshiya b76c3f718d sfnt: Fix a data type mismatching with its source. 2009-08-01 00:37:57 +09:00
suzuki toshiya 2a2beb47c4 sfnt: Extend a few local variables to load 32-bit values. 2009-08-01 00:37:57 +09:00
suzuki toshiya 3783dac000 pfr: Extend `num_aux' to take 32-bit value. 2009-08-01 00:37:56 +09:00
suzuki toshiya 3bda1f9949 pcf: Truncate FT_ULong `nprops' to fit to int PCF_Face->nprops. 2009-08-01 00:37:56 +09:00
suzuki toshiya 8eb551f1b3 gxvalid: Extend a few local variables to reduce the casts. 2009-08-01 00:37:55 +09:00
suzuki toshiya d365997759 gxvalid: Extend `settingTable' to take 32-bit offset. 2009-08-01 00:37:55 +09:00
suzuki toshiya 6e2375f72c autofit: Cast FT_Long glyph_count to compare with FT_UInt GID. 2009-08-01 00:37:54 +09:00
suzuki toshiya 057bc4c071 smooth: Exclude 16-bit system in invalid pitch/height check. 2009-08-01 00:35:40 +09:00
suzuki toshiya b16a942671 cff: Type large constants > 0x7FFF as long for 16-bit systems. 2009-08-01 00:32:25 +09:00
suzuki toshiya 5133c56f2f base: Remove an unused variable. 2009-08-01 00:32:25 +09:00
suzuki toshiya 5d3ff05615 cache: Check higher bits in flags for non ILP32 systems. 2009-08-01 00:32:24 +09:00
suzuki toshiya 61adbe980a sfnt: Ignore invalid GIDs in glyph name lookup. 2009-08-01 00:32:24 +09:00
suzuki toshiya eec405540d pcf: Fix a comparison between FT_Long and FT_ULong. 2009-08-01 00:32:24 +09:00
suzuki toshiya eceaffef3e gxvalid: Guarantee `nFeatureFlags' size up to 32-bit. 2009-08-01 00:32:23 +09:00
suzuki toshiya cad4f91555 sfnt: Insert explicit cast for LP64 system. 2009-08-01 00:32:23 +09:00
suzuki toshiya 2f07c57f5a gxvalid: Guarantee `just' table size upto 32-bit. 2009-08-01 00:32:22 +09:00
suzuki toshiya 205a2a0cce gxvalid: Guarantee `trak' table size upto 32-bit. 2009-08-01 00:32:22 +09:00
suzuki toshiya 49740490e1 type1: Fix a data type mismatching with its source. 2009-08-01 00:32:22 +09:00
suzuki toshiya 737634e5e4 pfr: Fix a data type mismatching with its source. 2009-08-01 00:32:21 +09:00
suzuki toshiya b12b8c3ce4 pfr: Fix a data type mismatching with its source. 2009-08-01 00:32:21 +09:00
suzuki toshiya c4420d97f4 pfr: Fix a data type mismatching with its source. 2009-08-01 00:32:21 +09:00
suzuki toshiya 471980d9dc smooth: Improve the format in debug message. 2009-08-01 00:32:20 +09:00
suzuki toshiya 0105905052 sfnt: Fix a data type mismatching with its source. 2009-08-01 00:32:20 +09:00
suzuki toshiya cf31edf5ee psaux: Fix a data type mismatching with its source. 2009-08-01 00:32:19 +09:00
suzuki toshiya ec7bc863fb truetype: Extend TrueType GX packed deltas to FT_Offset. 2009-08-01 00:32:19 +09:00
suzuki toshiya 5668181bda truetype: Extend mmvar_len to hold size_t values. 2009-08-01 00:32:18 +09:00
suzuki toshiya a115142057 truetype: Check invalid function number in IDEF instruction. 2009-08-01 00:32:18 +09:00
suzuki toshiya d1c23082b6 truetype: Check invalid function number in FDEF instruction. 2009-08-01 00:32:17 +09:00
suzuki toshiya 9206eba291 truetype: Truncate the deltas of composite glyph at 16-bit values. 2009-08-01 00:32:17 +09:00
suzuki toshiya 1b6f1d20b5 truetype: Truncate the instructions upto 16-bit per a glyph. 2009-08-01 00:32:16 +09:00
suzuki toshiya 6dc27526a9 truetype: Cast the numerical operands to 32-bit for LP64 systems. 2009-08-01 00:32:15 +09:00
suzuki toshiya 3b56c4d390 truetype: Cast the project vector to 32-bit for LP64 system. 2009-08-01 00:32:15 +09:00
suzuki toshiya 9fc4094375 truetype: Cast the scaling params to 32-bit for LP64 system. 2009-08-01 00:32:14 +09:00
suzuki toshiya c9c6438840 sfnt: Cast a character code to FT_UInt32 for LP64 system. 2009-08-01 00:32:14 +09:00
suzuki toshiya 3f0182afb2 sfnt: Cast a character code to FT_UInt32 for LP64 system. 2009-08-01 00:32:13 +09:00
suzuki toshiya 9c1aac0011 sfnt: Extend TT_BDF->strings_size to FT_ULong for huge BDF. 2009-08-01 00:32:13 +09:00
suzuki toshiya 259568cf68 psaux: Handle the string length by FT_Offset variables. 2009-08-01 00:32:13 +09:00
suzuki toshiya 75d56e5d79 pcf: Fix some data types mismatching with their sources. 2009-08-01 00:32:12 +09:00
suzuki toshiya c595c06c61 pcf: Handle the string length by size_t variables. 2009-08-01 00:32:12 +09:00
suzuki toshiya 78ba8a610c pcf: Fix some data types mismatching with their sources. 2009-08-01 00:32:11 +09:00
suzuki toshiya 52170ac0ce otvalid: Truncate the glyph index to 16-bit. 2009-08-01 00:32:11 +09:00
suzuki toshiya f7c6b11691 cache: Insert explict casts for LP64 systems. 2009-08-01 00:32:10 +09:00
suzuki toshiya ed1d359025 cache: Fix some data types mismatching with their sources. 2009-08-01 00:32:10 +09:00
suzuki toshiya 3f0f2e462b XXX_cmap_encoding_char_next() return FT_UInt32 values. 2009-08-01 00:32:09 +09:00
suzuki toshiya 25dba9cfa8 truetype: Extend TT_Face->num_locations for broken TTFs. 2009-08-01 00:32:09 +09:00
suzuki toshiya e45e052279 smooth: Fix some data types mismatching with their sources. 2009-08-01 00:32:08 +09:00
suzuki toshiya c579dc4391 cff: Fix some data types mismatching with their sources. 2009-08-01 00:32:08 +09:00
suzuki toshiya 87054758fb autofit: Fix some data types mismatching with their sources. 2009-08-01 00:32:08 +09:00
suzuki toshiya b56680240a autofit: Count the size of the memory object by ptrdiff_t. 2009-08-01 00:32:07 +09:00
suzuki toshiya 15dc278c5a autofit: Fix for unused variable `first'. 2009-08-01 00:32:07 +09:00
suzuki toshiya e866cf3f55 Improve bitmap size or pixel variables for 16-bit systems. 2009-08-01 00:32:06 +09:00
suzuki toshiya d3ed6d1bba psaux: Prevent invalid arguments to afm_parser_read_vals(). 2009-08-01 00:30:43 +09:00
suzuki toshiya 0d226c31c5 base: Prevent some overflows on LP64 systems. 2009-08-01 00:30:24 +09:00
suzuki toshiya 072e55233e cff: Cast the long variables to 32-bit for LP64 systems. 2009-08-01 00:30:23 +09:00
suzuki toshiya b61d92898e pcf: Improve PCF_PropertyRec.value names on LP64 platforms. 2009-08-01 00:30:23 +09:00
suzuki toshiya eae89a7f07 pcf: Fix some data types mismatching with their sources. 2009-08-01 00:30:22 +09:00
suzuki toshiya be41d3e718 bdf: Improve bdf_property_t.value names for LP64 platforms. 2009-08-01 00:30:22 +09:00
suzuki toshiya 660d651317 bdf: Fix some data types mismatching with their sources. 2009-08-01 00:30:21 +09:00
suzuki toshiya 38e480b4c6 autofit: Improve Unicode range definitions. 2009-08-01 00:30:21 +09:00
suzuki toshiya 93bb15940b smooth: Fix a data type mismatching with its source. 2009-08-01 00:30:21 +09:00
suzuki toshiya ea5268d2d2 smooth: Fix a data type mismatching with its source. 2009-08-01 00:30:20 +09:00
suzuki toshiya f4e1c8bdda cache: Disable the legacy compatibility if 16-bit system. 2009-08-01 00:30:20 +09:00
suzuki toshiya 2a5831ec07 cache: Check 32-bit glyph index on 16-bit systems. 2009-08-01 00:30:19 +09:00
suzuki toshiya b566d42aa0 cache: Fix some data types mismatching with their sources. 2009-08-01 00:30:19 +09:00
suzuki toshiya ebf8e294fc cache: Fix some data types mismatching with their sources. 2009-08-01 00:30:19 +09:00
suzuki toshiya 9f50873a81 cache: Cast NULL to a required function type explicitly. 2009-08-01 00:30:18 +09:00
suzuki toshiya 41f9d0d6ee fttypes.h: Cast FT_MAKE_TAG output to FT_Tag exlicitly. 2009-08-01 00:30:18 +09:00
suzuki toshiya 82ebaa7b05 psnames: Handle Unicode codepoints by FT_UInt32 variables. 2009-08-01 00:30:17 +09:00
suzuki toshiya d200982d8b psaux: Use size_t variable to pass the buffer size. 2009-08-01 00:30:17 +09:00
suzuki toshiya d1ee378566 type1: Use size_t variable to pass the string length. 2009-08-01 00:30:16 +09:00
suzuki toshiya 7fd7c6f2e9 cid: Fix some data types mismatching with their sources. 2009-08-01 00:30:16 +09:00
suzuki toshiya 34c203cdde cff: Fix for unused variable `rest'. 2009-08-01 00:30:16 +09:00
suzuki toshiya a813cf4801 cff: Fix some data types mismatching with their sources. 2009-08-01 00:30:15 +09:00
suzuki toshiya 2bbcb7edd8 bdf: Fix some data types mismatching with their sources. 2009-08-01 00:30:15 +09:00
suzuki toshiya 763b39496e sfnt: Count the size of the memory object by ptrdiff_t. 2009-08-01 00:30:14 +09:00
suzuki toshiya f420757c73 lzw: Count the size of the memory object by ptrdiff_t. 2009-08-01 00:30:14 +09:00
suzuki toshiya 88c95bab74 otvalid: Count the table size on memory by ptrdiff_t. 2009-08-01 00:30:13 +09:00
suzuki toshiya 90c7efc8f2 otvalid: Prevent an overflow by GPOS/GSUB 32b-bit offset. 2009-08-01 00:30:13 +09:00
suzuki toshiya 95aeebf438 ftobjs.c: Prevent an overflow in glyph index handling. 2009-08-01 00:30:13 +09:00
suzuki toshiya 2ed9d7fc75 Improve the variable types in raccess_make_file_name(). 2009-08-01 00:30:12 +09:00
suzuki toshiya 61fa1b53c2 ftpatent.c: Fix for unused variable `error'. 2009-08-01 00:30:12 +09:00
suzuki toshiya f7ecdbc70a type1: Check invalid string longer than PostScript limit. 2009-08-01 00:30:12 +09:00
suzuki toshiya a8c515d25c gzip: Use FT2 zcalloc() & zfree() in ftgzip.c by default. 2009-08-01 00:30:11 +09:00
suzuki toshiya 5f43bab8bf gzip: Distinguish PureC from TurboC on MSDOS. 2009-08-01 00:30:11 +09:00
suzuki toshiya 3f36047eff gxvalid: Insert PureC pragma to allow unevaluated variables. 2009-08-01 00:30:11 +09:00
suzuki toshiya 62aa9ec647 gxvalid: Pass the union by the pointer instead of the value. 2009-08-01 00:29:29 +09:00
Werner Lemberg 7009a6eb03 Fix Redhat bugzilla #513582 and Savannah bug #26849.
* src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP) <FTC_INLINE>: Fix
aliasing bug.
2009-07-29 11:53:13 +02:00
Werner Lemberg 2cd790d7e2 Document recent library changes.
* docs/CHANGES: Do it.
2009-07-19 11:18:00 +02:00
Werner Lemberg 46e05c443b Fix Savannah bug #23786.
* src/truetype/ttobjs.c (tt_size_init_bytecode): Don't reset x_ppem
and y_ppem.  Otherwise the `*_CVT_Stretched' functions in ttinterp.c
get never called.
An anonymous guy suggested this change on Savannah, and it seems to
be the right solution.
2009-07-17 22:49:34 +02:00
Werner Lemberg 9f27998ebf Merge branch 'master' of wl@git.sv.gnu.org:/srv/git/freetype/freetype2
Conflicts:
	ChangeLog

Merge.
2009-07-15 12:33:01 +02:00
Werner Lemberg deee58f225 * docs/release: Updated. 2009-07-15 07:58:00 +02:00
Werner Lemberg 0fbdf11a48 README.CVS -> README.git
* README.CVS: Renamed to...
* README.git: This.
Updated.
2009-07-15 07:50:06 +02:00
suzuki toshiya 3009417a7d Borland C++ compiler patch proposed by Mirco Babin. 2009-07-15 12:57:26 +09:00
Werner Lemberg b2967734a6 Fix Savannah bug #27026.
* builds/win32/vc2005/freetype.sln: Use correct version number.
2009-07-14 16:44:06 +02:00
suzuki toshiya 313d4f4ca6 Add a script to check the undefined and unused trace macros. 2009-07-13 00:01:57 +09:00
suzuki toshiya 3bf7baaac3 Formatting. 2009-07-12 23:54:40 +09:00
Werner Lemberg a2ef3769bc Merge branch 'master' of wl@git.sv.gnu.org:/srv/git/freetype/freetype2 2009-07-09 18:59:25 +02:00
suzuki toshiya da59462780 smooth: Check glyph size by width/height, instead of pitch/height. 2009-07-09 17:21:32 +09:00
Werner Lemberg 0d02317fb2 [ftraster] Make it compile again with -D_STANDALONE_.
* src/raster/ftraster.c [_STANDALONE_]: Define
FT_CONFIG_STANDARD_LIBRARY_H.
Include `string.h'.
Don't include `rastpic.h'.
Define FT_DEFINE_RASTER_FUNCS.
2009-07-09 09:21:46 +02:00
suzuki toshiya 8ad243bdcd Shorten URLs referring ft-devel archive. 2009-07-09 16:12:30 +09:00
suzuki toshiya e05861b9da Register 2 missing trace components, t1afm and ttbdf. 2009-07-09 14:43:57 +09:00
suzuki toshiya a6990d0612 Register a trace component for ftgloadr.c. 2009-07-09 12:48:23 +09:00
suzuki toshiya 4c531460ed Prevent the overflows by a glyph with too many points or contours. 2009-07-08 14:52:11 +09:00
suzuki toshiya f4a0f93a14 Fix a typo in ChangeLog, found by mouse@Rodents-Montreal.ORG 2009-07-06 17:16:15 +09:00
Bram Tassyns 3d3ba0563e Improve compatibility to Acroread.
This fixes Savannah bug #26944.

* src/cff/cffload.c (cff_charset_compute_cids): For multiple GID to
single CID mappings, make the lowest value win.
2009-07-05 14:54:59 +02:00
suzuki toshiya ad289d139f ftpatent: Fix a bug by wrong usage of service->table_info(). 2009-06-29 03:09:17 +09:00
Werner Lemberg 24370d67f5 Uff, another thinko. 2009-06-28 02:11:51 +02:00
Werner Lemberg e7389a4405 [psaux, cff] Protect against nested `seac' calls.
* include/freetype/internal/psaux.h (T1_Decoder), src/cff/cffgload.h
(CFF_Decoder): Add `seac' boolean variable.

* src/cff/cffgload.c (cff_operator_seac,
cff_decoder_parse_charstrings), src/psaux/t1decode.c
(t1operator_seac, t1_decoder_parse_charstrings): Use it.
2009-06-28 01:25:55 +02:00
Werner Lemberg 6bb34880e8 Thinko.
* src/psaux/t1decode.c (t1operator_seac)
[FT_CONFIG_OPTION_INCREMENTAL]: Test for existence of incremental
interface.
2009-06-28 00:43:37 +02:00
Werner Lemberg a7e5a335f2 * devel/ftoption.h [FT_CONFIG_OPTION_INCREMENTAL]: Define. 2009-06-28 00:40:05 +02:00
Werner Lemberg b8f97f17cd Formatting. 2009-06-28 00:37:53 +02:00
suzuki toshiya fee19a786d Add tools to preprocess the source files for AtariST PureC. 2009-06-27 17:07:14 +09:00
suzuki toshiya 3609141de4 Fix wrong date in ChangeLog 2009-06-27 15:02:36 +09:00
suzuki toshiya 912f039743 Keep existing modules.cfg in the building tree. 2009-06-27 14:38:32 +09:00
suzuki toshiya 66d308edfd Filter --srcdir= option before invoking builds/unix/configure. 2009-06-27 14:33:06 +09:00
suzuki toshiya 20fb146351 Improve configure.raw for cross-building on exe-suffixed systems. 2009-06-27 14:27:55 +09:00
Werner Lemberg 610cddcac4 [truetype] Remove TT_SubGlyphRec.
* src/truetype/ttobjs.h (TT_SubGlyphRec): Removed, unused.
2009-06-26 07:39:08 +02:00