Commit Graph

570 Commits

Author SHA1 Message Date
Werner Lemberg b355b5693a Fix Savannah bug #37178.
* src/base/ftobjs.c (FT_Open_Face): Initialize `error' with
`FT_Err_Missing_Module' before loop to indicate `no valid drivers'.
2012-08-26 14:00:11 +02:00
Werner Lemberg 68fe6a9afa Formatting. 2012-08-26 13:56:56 +02:00
Werner Lemberg f24d0793f1 Clean up `generic' fields.
* include/freetype/internal/ftobjs.h (FT_ModuleRec, FT_LibraryRec):
Remove `generic' field since users can't access it.

* src/base/ftobjs.c (FT_Done_GlyphSlot): Call `generic.finalizer' as
advertised in the documentation of FT_Generic.
(Destroy_Module, FT_Done_Library): Updated to changes in `ftobjs.h'.
2012-02-11 09:37:46 +01:00
suzuki toshiya c7c4d68bfb [raccess] Modify for PIC build.
Based on the patch provided by Erik Dahlstrom <ed@opera.com>,
http://lists.gnu.org/archive/html/freetype-devel/2012-01/msg00010.html

Also `raccess_guess_table[]' and `raccess_rule_by_darwin_vfs()'
are renamed with `ft_' suffixes.

* src/base/ftbase.h: `raccess_rule_by_darwin_vfs()' is renamed
to `ft_raccess_rule_by_darwin_vfs()'.
* src/base/ftobjs.c: Ditto.

* src/base/ftrfork.c: Declarations of FT_RFork_Rule,
raccess_guess_rec, are moved to...
* include/freetype/internal/ftrfork.h: Here.

* include/freetype/internal/ftrfork.h:
FT_RFORK_RULE_ARRAY_{BEGIN,ENTRY,END} macros are defined
to replace raccess_guess_table[] in both of PIC and non-PIC
modes.
* src/base/ftrfork.c: raccess_guess_table[] array is rewritten
by FT_RFORK_RULE_ARRAY_{BEGIN,ENTRY,END}.

* src/base/basepic.h (BasePIC): Add `ft_raccess_guess_table'
storage.  (FT_RACCESS_GUESS_TABLE_GET): New macro to retrieve
the function pointer from `ft_raccess_guess_table' storage in
`BasePIC' structure.
* src/base/ftrfork.c (FT_Raccess_Guess): Rewritten with
FT_RACCESS_GUESS_TABLE_GET.
(raccess_get_rule_type_from_rule_index): Add `library' as the
first argument to the function, to retrieve the storage of
`ft_raccess_guess_table' from it.  Also `raccess_guess_table'
is replaced by FT_RACCESS_GUESS_TABLE_GET.
(ft_raccess_rule_by_darwin_vfs): Ditto.
2012-01-17 15:13:50 +09:00
suzuki toshiya 714ee56ab1 [mac] Unify DARWIN_NO_CARBON with FT_MACINTOSH.
Originally FT_MACINTOSH was a pure auto macro and DARWIN_NO_CARBON
was a configurable macro to disable Carbon-dependent code.  Because
now configure script sets DARWIN_NO_CARBON by default and disables
Darwin & Carbon-dependent codes, these macros can be unified.
FT_MACINTOSH (undefined by default) is kept and DARWIN_NO_CARBON
(defined by default) is removed, because DARWIN_NO_CARBON violates
FT_XXX naming convention of public macros, and a macro configured by
default is not portable for the building without configure (e.g.
make devel).

* builds/unix/configure.raw: Define FT_MACINTOSH if Carbon-based
old Mac font support is requested and Carbon is available.
* builds/unix/ftconfig.in: Undefine FT_MACINTOSH when the support
for Mac OS X without Carbon (e.g.  Mac OS X 10.4 for ppc64) is
requested.
* include/freetype/config/ftconfig.in: Ditto.
* builds/vms/ftconfig.h: Ditto.

* src/base/ftbase.h: Remove DARWIN_NO_CARBON.
* src/base/ftbase.c: Ditto.
* src/base/ftobjs.c: Ditto.
* src/base/ftrfork.c: Ditto.

* src/base/ftmac.c: Compile the body if FT_MACINTOSH is defined
(same with TT_USE_BYTECODE_INTERPRETER in ttinterp.c).
* builds/mac/ftmac.c: Ditto.

* builds/mac/FreeType.m68k_cfm.make.txt: Define FT_MACINTOSH.
* builds/mac/FreeType.m68k_far.make.txt: Ditto.
* builds/mac/FreeType.ppc_classic.make.txt: Ditto.
* builds/mac/FreeType.ppc_carbon.make.txt: Ditto.
2011-12-02 21:14:58 +09:00
Kal Conley 72185cb5f4 Fix handling of transformations if no renderer is present.
* src/base/ftobjs.c (FT_Load_Glyph): Thinko.
2011-10-15 09:33:11 +02:00
Kal Conley 298608d1d2 Fix conditions for autohinting.
* src/base/ftobjs.c (FT_Load_Glyph): Handle
FT_LOAD_IGNORE_TRANSFORM.
2011-10-15 09:09:59 +02:00
Werner Lemberg 57b6a6148d Better tracing of metrics.
* src/base/ftobjs.c (FT_Request_Size, FT_Select_Size): Decorate with
FT_TRACE.
2011-09-09 19:05:54 +02:00
Werner Lemberg c9a69022dc Typo. 2011-08-30 08:09:38 +02:00
Werner Lemberg 51ca771ff6 Better tracing of metrics.
* src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics):
Decorate with FT_TRACE.
2011-08-30 07:42:19 +02:00
Chris Morgan 3abf617b5e Add FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT.
Useful for embedded systems which don't need file stream support.

* src/base/ftsystem.c, src/base/ftobjs.c (FT_Stream_New): Implement
it.
2011-07-20 06:48:08 +02:00
suzuki toshiya 65a449887d [base] Fix g++4.6 compiler warnings in src/base/*.c.
Passing uninitialized pointer to the buffer allocator is
not problematic theoretically (as far as the returned
pointer is checked before writing), but g++4.6 dislikes
it and warns by -Wuninitialized.  Initialize them by NULL.

* src/base/ftobjs.c (FT_Stream_New): Init `stream'.
(new_memory_stream): Ditto.
(FT_New_GlyphSlot): Init `slot'.
(FT_CMap_New): Init `cmap'.
(open_face_PS_from_sfnt_stream): Init `sfnt_ps'.
(Mac_Read_POST_Resource): Init `pfb_data'.
(Mac_Read_sfnt_Resource): Init `sfnt_data'.
* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets):
Init `offsets_internal' and `ref'.
(raccess_guess_darwin_hfsplus): Init `newpath'.
(raccess_guess_darwin_newvfs): Ditto.
* src/base/ftbitmap.c (ft_bitmap_assure_buffer):
Init `buffer'.
* src/base/ftstroke.c (FT_Stroker_New): Init `stroker'.
2011-06-15 01:44:24 +09:00
Werner Lemberg c9bdfa7e65 Fix autohinting fallback.
* src/base/ftobjs.c (FT_Load_Glyph): Assure that we only check TTFs,
ignoring CFF-based OTFs.
2011-03-06 18:35:37 +01:00
Kevin Kofler ff8095077c Fall back to autohinting if a TTF/OTF doesn't contain any bytecode.
This is Savannah patch #7471.

* src/base/ftobjs.c (FT_Load_Glyph): Implement it.
2011-02-19 23:09:26 +01:00
Werner Lemberg 312d26a491 Fix parameter handling of `FT_Set_Renderer'.
Reported by Kirill Tishin <siege@bk.ru>.

* src/base/ftobjs.c (FT_Set_Renderer): Increment `parameters'.
2010-12-13 20:17:26 +01:00
suzuki toshiya ac09390afc [UVS] Fix find_variant_selector_charmap(), Savannah bug #31545.
Since 2010-07-04, find_variant_selector_charmap() returns
the first cmap subtable always under rogue-compatible
configuration, it causes NULL pointer dereference and
make UVS-related functions crashed.

* src/base/ftobjs.c (Fix find_variant_selector_charmap):
Returns UVS cmap correctly.
2010-11-04 23:26:11 +09:00
suzuki toshiya b72e046098 [UVS] Remove non-essential pointer checking in previous commit. 2010-11-04 23:09:05 +09:00
suzuki toshiya e891e4d6f1 [UVS] Stabilizes UVS supporting functions against non-UVS fonts.
UVS supporting functions assume the variation handler functions
are valid.  When a font without cmap format 14 is given, these
function pointers are left as NULL, so calling these functions
causes NULL pointer dereference.

* src/base/ftobjs.c (FT_Face_GetCharVariantIndex): Check the pointer
FT_CMap_Class->char_var_index before calling it.
(FT_Face_GetCharVariantIsDefault): Check the pointer
FT_CMap_Class->char_var_default before calling it.
(FT_Face_GetVariantSelectors): Check the pointer
FT_CMap_Class->variant_list before calling it.
(FT_Face_GetVariantsOfChar): Check the pointer
FT_CMap_Class->charvariant_list before calling it.
(FT_Face_GetCharsOfVariant): Check the pointer
FT_CMap_Class->variantchar_list before calling it.
2010-11-04 21:53:11 +09:00
suzuki toshiya 463dddadfb [raccess] Skip unrequired resource access rules by Darwin VFS.
When a resource fork access rule by Darwin VFS could open the
resource fork but no font is found in it, the rest of rules
by Darwin VFS are skipped.  It reduces the warnings of the
deprecated resource fork access method by recent Darwin kernel.
Fix MacPorts ticket #18859:
	http://trac.macports.org/ticket/18859

* src/base/ftobjs.c (load_face_in_embedded_rfork):
When FT_Stream_New() returns FT_Err_Cannot_Open_Stream, it
means that the file is possible to be fopen()-ed but zero-sized.
Also there is a case that the resource fork is not zero-sized,
but no supported font exists in it.  If a rule by Darwin VFS
falls into such cases, there is no need to try other Darwin VFS
rules anymore.  Such cases are marked by vfs_rfork_has_no_font.
If it is TRUE, the Darwin VFS rules are skipped.
2010-10-13 17:20:27 +09:00
Werner Lemberg ba95440cd1 Minor doc fixes, formatting. 2010-08-06 20:07:36 +02:00
suzuki toshiya 445241589d Fix Savannah bug #30648.
* src/base/ftobjs.c (FT_Done_Library): Specify the order of font
drivers in face closing process. Type42 faces should be closed
before TrueType faces, because a Type42 face refers another
internal TrueType face which is created from sfnt[] array on the
memory.
2010-08-07 01:46:56 +09:00
suzuki toshiya 81f3472c0b Fix Savannah bug #30658.
* src/base/ftobjs.c (Mac_Read_POST_Resource): Check the total
length of collected POST segments does not overrun the allocated
buffer.
2010-08-06 14:11:54 +09:00
Werner Lemberg fe3433c736 Add reference counters and to FT_Library and FT_Face objects.
* include/freetype/freetype.h (FT_Reference_Face): New function.
* include/freetype/ftmodapi.h (FT_Rererence_Library): New function.

* include/freetype/internal/ftobjs.h (FT_Face_InternalRec,
FT_LibraryRec): New field `refcount'.

* src/base/ftobjs.c (FT_Open_Face, FT_New_Library): Handle
`refcount'.
(FT_Reference_Face, FT_Reference_Library): Implement new functions.
(FT_Done_Face, FT_Done_Library): Handle `refcount'.

* docs/CHANGES: Updated.
2010-07-18 18:41:47 +02:00
Werner Lemberg c8f5b98be2 Remove C++ warnings.
*/*: Initialize pointers where necessary to make g++ happy.
2010-07-12 21:13:22 +02:00
Eugene A. Shatokhin b33b856a27 Fix Savannah bug #27648.
* src/base/ftobjs.c (ft_remove_renderer, FT_Add_Module): Call
`raster_done' only if we have an outline glyph format.

Fix comment typo.
2010-07-05 22:36:30 +02:00
suzuki toshiya 0ae3271814 Restrict the number of the charmaps in a rogue-compatible mode.
Fix for Savannah bug #30059.

* src/cache/ftccmap.c (FTC_CMapCache_Lookup): Replace `16' the
minimum character code passed by a legacy rogue client by...
* include/freetype/config/ftoption.h (FT_MAX_CHARMAP_CACHEABLE):
This.  It is undefined when FT_CONFIG_OPTION_OLD_INTERNALS is
undefined (thus the rogue client compatibility is not required).

* src/cff/cffobjs.c (cff_face_init): Abort the automatic
selection or synthesis of Unicode cmap subtable when the charmap
index exceeds FT_MAX_CHARMAP_CACHEABLE.
* src/sfnt/ttcmap.c (tt_face_build_cmaps): Issue error message
when the charmap index exceeds FT_MAX_CHARMAP_CACHEABLE.

* src/base/ftobjs.c (find_unicode_charmap): When Unicode charmap
is found after FT_MAX_CHARMAP_CACHEABLE, ignore it and search
earlier one.
(find_variant_selector_charmap): When UVS charmap is found after
FT_MAX_CHARMAP_CACHEABLE, ignore it and search earlier one.
(FT_Select_Charmap): When a charmap matching with requested
encoding but after FT_MAX_CHARMAP_CACHEABLE, ignore and search
earlier one.
(FT_Set_Charmap): When a charmap matching with requested
charmap but after FT_MAX_CHARMAP_CACHEABLE, ignore and search
earlier one.
(FT_Get_Charmap_Index): When a requested charmap is found
after FT_MAX_CHARMAP_CACHEABLE, return the inverted charmap
index.
2010-07-05 09:59:03 +09:00
suzuki toshiya b2ea64bcc6 Additional fix for Savannah bug #30306.
* src/base/ftobjs.c (Mac_Read_POST_Resource): If the type
of the POST fragment is 0, the segment is completely ignored.
The declared length of the segment is not cared at all.
According to Adobe Technical Note 5040, type 0 segment is
comment only and should not be loaded for the interpreter.
Reported by Robert Swiecki.
2010-07-02 18:19:39 +09:00
suzuki toshiya 5ef20c8c1d Initial fix for Savannah bug #30306.
* src/base/ftobjs.c (Mac_Read_POST_Resource): Check `rlen'
the length of fragment declared in the POST fragment header
and prevent an underflow in length calculation. Some fonts
set the length to zero in spite of the exist of following
16bit `type'. Reported by Robert Swiecki.
2010-07-01 18:39:04 +09:00
suzuki toshiya f29f741efb Additional fix for Savannah bug #30248 and #30249.
* src/base/ftobjs.c (Mac_Read_POST_Resource): Check the buffer
size during gathering PFB fragments embedded in LaserWriter PS
font for Macintosh. Reported by Robert Swiecki.
2010-07-01 17:32:40 +09:00
suzuki toshiya c69891a134 Initial fix for Savannah bug #30248 and #30249.
* src/base/ftobjs.c (Mac_Read_POST_Resource): Check the error during
reading a PFB fragment embedded in LaserWriter PS font for Macintosh.
Reported by Robert Swiecki.
2010-06-25 10:48:12 +09:00
Werner Lemberg d087199f2c Fix Savannah bug #30052.
This bug has been introduced with commit 2415cbf3.

* src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Protect
against endless loop in case of corrupted font header data.
2010-06-07 08:46:01 +02:00
Werner Lemberg e30de299f2 Fix various memory problems found by linuxtesting.org.
* src/base/ftgxval.c (FT_TrueTypeGX_Free, FT_ClassicKern_Free),
src/base/ftotval.c (FT_OpenType_Free), src/base/ftpfr.c
(ft_pfr_check): Check `face'.

* src/base/ftobjs.c (FT_Get_Charmap_Index): Check `charmap' and
`charmap->face'.
(FT_Render_Glyph): Check `slot->face'.
(FT_Get_SubGlyph_Info): Check `glyph->subglyphs'.

Improve API documentation.
2010-05-22 20:03:41 +02:00
suzuki toshiya 199f04f33d Remove duplicated inclusion of `FT_OUTLINE_H' in ftobjs.c. 2010-03-12 14:48:57 +09: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
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 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 38449dceaf Whitespace. 2009-10-26 07:26:25 +01: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
suzuki toshiya 0d226c31c5 base: Prevent some overflows on LP64 systems. 2009-08-01 00:30:24 +09:00
suzuki toshiya 95aeebf438 ftobjs.c: Prevent an overflow in glyph index handling. 2009-08-01 00:30:13 +09: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 858abbedc0 For warning messages, replace FT_ERROR with FT_TRACE0.
FT_ERROR is now used only if a function produces a non-zero `error'
value.

Formatting, improving and harmonizing debug strings.
2009-06-26 06:15:41 +02:00
Werner Lemberg 777d6d59ed Provide version information better.
* src/base/ftinit.c (FT_Init_FreeType): Don't set version here
but...
* src/base/ftobjs.c (FT_New_Library): Here.
2009-06-25 16:46:39 +02:00
Werner Lemberg c6788a389d Fix some potential out-of-memory crashes.
* src/base/ftobjs.c (ft_glyphslot_done): Check `slot->internal'.
* src/base/ftstream.c (FT_Stream_ReleaseFrame): Check `stream'.
* src/truetype/ttinterp.c (TT_New_Context): Avoid double-free of
`exec' in case of failure.
2009-06-07 13:09:21 +02:00
James Cloos 15e8e237e6 Enable autohinting for glyphs rotated by multiples of 90°.
* src/base/ftobjs.c (FT_Load_Glyph): Alter check for permitted
matrices to allow rotations by multiples of 90°, not only unrotated,
possibly slanted matrices.
2009-05-29 12:59:42 +02:00
Oran Agra 636c294bef Position Independent Code (PIC) support and infrastructure in base.
* include/freetype/config/ftoption.h add FT_CONFIG_OPTION_PIC
* include/freetype/internal/ftobjs.h Add pic_container member to
FT_LibraryRec.
Add macros to declare and init instances of FT_CMap_ClassRec.
Add macros to init instances of FT_Outline_Funcs and FT_Raster_Funcs.
Add macros to declare, allocate and initialize modules
(FT_Module_Class).
Add macros to declare, allocate and initialize renderers
(FT_Renderer_Class).
Add macro to init instances of FT_Glyph_Class.
Add macros to declare, allocate and initialize drivers
(FT_Driver_ClassRec).
* include/freetype/internal/ftpic.h new file to declare the
FT_PIC_Container struct and the functions to allocate and detroy it.
* include/freetype/internal/ftserv.h add macros to allocate and
destory arrays of FT_ServiceDescRec.
* include/freetype/internal/internal.h define macro to include
ftpic.h.

New Files:
* src/base/ftpic.c implement functions to allocate and destory the
global pic_container.
* src/base/basepic.h declare struct to hold PIC globals for base and
macros to access them.
* src/base/basepic.c implement functions to allocate, destroy and
initialize PIC globals for base.

* src/base/ftinit.c when FT_CONFIG_OPTION_PIC is defined implement
functions that allocate and destroy ft_default_modules according to
FT_CONFIG_MODULES_H in the pic_container instead of the global scope
and use macro from basepic.h to access it.
* src/base/ftobjs.c add calls to the functions that allocate and
destroy the global pic_container when the library is created and
destroyed.

* src/base/jamfile add new files to FT2_MULTI build:
ftpic.c and basepic.c.
* src/base/ftbase.c add new files to build:
ftpic.c and basepic.c.

* src/base/ftglyph.c when FT_CONFIG_OPTION_PIC is defined
ft_bitmap_glyph_class and ft_outline_glyph_class will be allocated
in the pic_container instead of the global scope and use macros from
basepic.h to access them.
* src/base/ftbbox.c allocate bbox_interface stract on the stack
instead of the global scope when FT_CONFIG_OPTION_PIC is defined.
* src/base/ftstroke.c access ft_outline_glyph_class allocated in
ftglyph.c via macros from basepic.h
2009-04-05 17:59:26 +03:00
Werner Lemberg b66efefdcd Fix some FreeType Coverity issues as reported for Ghostscript.
* src/base/ftobjs.c (FT_New_Face, FT_New_Memory_Face): Initialize
`args.stream' (#3874, #3875).
(open_face_PS_from_sfnt_stream): Improve error management (#3786).
* src/base/ftmm.c (ft_face_get_mm_service): Fix check of `aservice'
(#3870).
* src/base/ftstroke.c (ft_stroke_border_get_counts): Remove dead
code (#3790).
* src/base/ftrfork.c (raccess_guess_apple_generic): Check error
value of `FT_Stream_Skip' (#3784).

* src/type1/t1gload.c (T1_Load_Glyph): Check `size' before accessing
it (#3872)

* src/pcf/pcfdrivr.c (PCF_Glyph_Load): Check `face' before accessing
it (#3871).
* src/pcf/pcfread.c (pcf_get_metrics): Handle return value of
`pcf_get_metric' (#3789, #3782).
(pcf_get_properties): Use FT_STREAM_SKIP (#3783).

* src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Fix check of
`acache' (#3797)

* src/cff/cffdrivr.c (cff_ps_get_font_info): Fix check of `cff'
(#3796).
* src/cff/cffgload.c (cff_decoder_prepare): Check `size' (#3795).
* src/cff/cffload.c (cff_index_get_pointers): Add comment (#3794).

* src/bdf/bdflib.c (_bdf_add_property): Check `fp->value.atom'
(#3793).
(_bdf_parse_start): Add comment (#3792).

* src/raster/ftraster.c (Finalize_Profile_Table): Check
`ras.fProfile' (#3791).

* src/sfnt/ttsbit.c (Load_SBit_Image): Use FT_STREAM_SKIP (#3785).

* src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Properly ignore
seek error (#3781).
2009-03-12 08:07:49 +00:00
Werner Lemberg 14de111f72 Fix Savannah bug #25669.
* src/base/ftadvanc.h (FT_Get_Advances): Fix serious typo.

* src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics): Fix
scaling factor for non-scalable fonts.

* src/cff/cffdrivr.c (cff_get_advances): Use correct advance width
value to prevent incorrect scaling.

* docs/CHANGES: Document it.
2009-02-24 21:34:51 +00:00
Werner Lemberg 5184ed6d53 Move FT_Get_FSType_Flags to a separate file.
Problem reported by Mickey Gabel <mickey@monfort.co.il>.

* src/base/ftobjs.c (FT_Get_FSType_Flags): Move to...
* src/base/ftfstype.c: This new file.

* modules.cfg (BASE_EXTENSION): Add ftfstype.c.

* docs/INSTALL.ANY: Updated.

* builds/mac/*.txt, builds/amiga/*makefile*,
builds/win32/{visualc,visualce}/freetype.*, builds/symbian/*:
Updated.
2009-01-22 10:13:59 +00:00
Suzuki, Toshiya (鈴木俊哉) 5a00909a77 * Fix a bug in POSIX resource-fork accessor since 2008-10-04 2009-01-22 03:50:37 +00:00
Werner Lemberg 9bf73ec407 Fix C++ compilation.
* src/base/ftobjs.c (FT_Get_FSType_Flags): Cast for compilation
with C++.
2009-01-13 17:42:00 +00:00
Werner Lemberg 9b1da084c2 tab -> space 2009-01-09 06:21:04 +00:00
Suzuki, Toshiya (鈴木俊哉) 2dc1079494 * src/base/ftobjs.c (FT_Done_Library): Issue an error when FT_Done_Face() is failed and retried 2009-01-09 05:07:15 +00:00
Werner Lemberg 3c5ad95166 * src/pfr/pfrdrivr.c, src/winfonts/winfnt.c, src/cache/ftcmanag.c,
src/smooth/ftgrays.c, src/base/ftobjc.s, src/sfobjs.c:
s/_Err_Bad_Argument/_Err_Invalid_Argument/.  The former is for
errors in the bytecode interpreter only.
2008-12-21 17:51:12 +00:00
Werner Lemberg 05bf6877a4 * docs/CHANGES: Updated.
Provide API for accessing embedding and subsetting restriction
information.

* include/freetype.h (FT_FSTYPE_INSTALLABLE_EMBEDDING,
FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING,
FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING, FT_FSTYPE_EDITABLE_EMBEDDING,
FT_FSTYPE_NO_SUBSETTING, FT_FSTYPE_BITMAP_EMBEDDING_ONLY): New
macros.
(FT_Get_FSType_Flags): New function declaration.

* src/base/ftobjs.c (FT_Get_FSType_Flags): New function.

* src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c
(t42_keywords): Handle `FSType'.

* include/freetype/t1tables.h (PS_FontInfoRec): Add `fs_type' field.
2008-12-18 06:32:10 +00:00
Werner Lemberg b972a2a294 Generalize the concept of `tricky' fonts by introducing
FT_FACE_FLAG_TRICKY to indicate that the font format's hinting
engine is necessary for correct rendering.

At the same time, slightly modify the behaviour of tricky fonts:
FT_LOAD_NO_HINTING is now ignored.  To really force raw loading
of tricky fonts (without hinting), both FT_LOAD_NO_HINTING and
FT_LOAD_NO_AUTOHINT must be used.

Finally, tricky TrueType fonts always use the bytecode interpreter
even if the patented code is used.

* include/freetype/freetype.h (FT_FACE_FLAG_TRICKY, FT_IS_TRICKY):
New macros.

* src/truetype/ttdriver.c (Load_Glyph): Handle new load flags
semantics as described above.

* src/truetype/ttobjs.c (tt_check_trickyness): New function, using
code of ...
(tt_face_init): This function, now simplified and updated to new
semantics.

* src/base/ftobjs.c (FT_Load_Glyph): Don't use autohinter for tricky
fonts.

* docs/CHANGES: Document it.
2008-12-11 08:55:48 +00:00
Werner Lemberg 1474f439b5 Really fix Savannah bug #25010: An SFNT font with neither outlines
nor bitmaps can be considered as containing space `glyphs' only.

* src/truetype/ttpload.c (tt_face_load_loca): Handle the case where
a `glyf' table is missing.

* src/truetype/ttgload.c (load_truetype_glyph): Abort if we have no
`glyf' table but a non-zero `loca' entry.
(tt_loader_init): Handle missing `glyf' table.

* src/base/ftobjs.c (FT_Load_Glyph): Undo change 2008-12-05.

* src/sfnt/sfobjs.c (sfnt_load_face): A font with neither outlines
nor bitmaps is scalable.
2008-12-09 06:51:56 +00:00
Werner Lemberg 76fffcd898 * include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): Use value
0x100 instead of 0x10000; the latter value is already occupied by
FT_LOAD_TARGET_LIGHT.  Bug reported by James Cloos.


Handle SFNT with neither outlines nor bitmaps.  This fixes Savannah
bug #25010.

* src/base/ftobjs.c (FT_Load_Glyph): Reject fonts with neither
outlines nor bitmaps.

* src/sfnt/sfobjs.c (sfnt_load_face): Don't return an error if there
is no table with glyphs.


* src/sfnt/ttload.c (tt_face_lookup_table): Improve debugging
message.


Other minor cosmetics.
2008-12-05 18:37:44 +00:00
Werner Lemberg 02197280b4 Formatting. 2008-11-29 09:31:44 +00:00
Werner Lemberg b6192827a3 * src/base/ftobjs.c (ft_glyphslot_free_bitmap): Protect against
slot->internal == NULL.  Reported by Graham Asher.
2008-11-08 07:28:39 +00:00
Werner Lemberg 570b1fdb84 formatting 2008-10-05 06:08:40 +00:00
Suzuki, Toshiya (鈴木俊哉) af48cb0b98 src/base/ftobjs.c: Include FT_TRUETYPE_TAGS_H 2008-10-05 02:53:06 +00:00
Suzuki, Toshiya (鈴木俊哉) 2d3e0af942 * `FT_Open_Face' tries `open_face_PS_from_sfnt_stream' when a sfnt container is found but not OpenType. 2008-10-05 02:38:57 +00:00
Suzuki, Toshiya (鈴木俊哉) 21bd516592 Introduce macros for some MacOS-specific resource tags 2008-10-04 18:10:28 +00:00
Suzuki, Toshiya (鈴木俊哉) 72eb270ac7 * Remove wrong initialization in `ft_lookup_PS_in_sfnt_stream' 2008-10-04 17:49:58 +00:00
Werner Lemberg 45489589ad * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler
warnings.

Formatting.
2008-10-04 11:39:03 +00:00
Suzuki, Toshiya (鈴木俊哉) 1137d04f85 * New function `open_face_PS_from_sfnt_stream' to check and open a Type1 PS or CID-keyed font in an sfnt stream. 2008-10-04 07:11:58 +00:00
Suzuki, Toshiya (鈴木俊哉) bc2c498419 * src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Set *is_sfnt_cid to FALSE when no PS resource is found 2008-10-03 12:28:52 +00:00
Suzuki, Toshiya (鈴木俊哉) 9e2b9900dc * Remove duplicated functions from builds/mac/ftmac.c. Now MPW builds builds/mac/ftmac.c as a part of ftbase.c 2008-10-03 11:52:22 +00:00
Werner Lemberg cff15b07f3 Formatting. 2008-10-02 05:38:29 +00:00
Suzuki, Toshiya (鈴木俊哉) f414702e04 * Merge the duplicated functions in ftmac.c with ftobjs.c 2008-10-02 01:43:18 +00:00
Suzuki, Toshiya (鈴木俊哉) c6bdee5f27 * Fix the conditions for multi build on MacOS 2008-09-30 00:59:55 +00:00
Werner Lemberg 22e970a23e Formatting, minor code fixes. 2008-09-20 12:20:21 +00:00
Werner Lemberg 6874d85ba0 * src/base/ftoutln.c: Include FT_INTERNAL_DEBUG_H.
(FT_Outline_Decompose): Decorate with tracing messages.

* src/smooth/ftgrays.c [DEBUG_GRAYS]: Replace with
FT_DEBUG_LEVEL_TRACE.
[_STANDALONE_ && FT_DEBUG_LEVEL_TRACE]: Include stdio.h and
stdarg.h.

(FT_TRACE) [_STANDALONE_]: Remove.
(FT_Message) [_STANDALONE_ && FT_DEBUG_LEVEL_TRACE]: New function.
(FT_TRACE5, FT_TRACE7) [_STANDALONE_]: New macros.
(FT_ERROR) [_STANDALONE_]: Updated.

(gray_hline) [FT_DEBUG_LEVEL_TRACE]: Fix condition.
Use FT_TRACE7.
(gray_dump_cells): Make it `static void'.
(graay_convert_glyph): Use FT_TRACE7.

(FT_Outline_Decompose) [_STANDALONE_]: Synchronize with version in
ftoutln.c.

* src/base/ftadvanc.c (FT_Get_Advance, FT_Get_Advances): Use
FT_ERROR_BASE.

Other minor modifications.
2008-09-20 11:50:47 +00:00
Suzuki, Toshiya (鈴木俊哉) dec8e7b97d * src/base/ftobjs.c: Fix double free bug in sfnt-wrapped Type1/CID font support 2008-09-19 16:47:01 +00:00
Suzuki, Toshiya (鈴木俊哉) 9ae5eaf862 * src/base/ftobjs.c: Add initial support for sfnt-wrapped CID-keyed fonts 2008-09-19 06:48:35 +00:00
Suzuki, Toshiya (鈴木俊哉) 4c60bd916c * Fix FT_Stream_New() to initialize stream always 2008-08-19 15:35:44 +00:00
Werner Lemberg f3200faaf3 Typo. 2008-06-10 04:57:57 +00:00
Werner Lemberg 102bb83afd * src/base/ftobjs.c (open_face): Check `clazz->init_face' and
`clazz->done_face'.

Update documentation of FT_Driver_ClassRec.
2008-06-10 04:57:19 +00:00
Werner Lemberg 6d29f0f1e8 * src/base/ftobjs.c (FT_Load_Glyph): Call the auto-hinter without
transformation since it recursively calls FT_Load_Glyph.  This fixes
Savannah bug #23143.
2008-05-03 15:54:15 +00:00
Werner Lemberg c32e83f23f Fix compilation with g++ 4.1 (with both `single' and `multi'
targets).

* src/base/ftobjs.c (FT_Open_Face): Don't define a variable in block
which is crossed by a `goto'.

* src/otvalid/otvalid.h (otv_MATH_validate): Add prototype.
2008-04-01 06:07:37 +00:00
Suzuki, Toshiya (鈴木俊哉) 86c0f90498 * src/base/{ftobjs.c, ftrfork.c}: recovery of Carbon-free legacy MacOS font support in freetype-2.3.4 2007-11-20 14:00:17 +00:00
David Turner cf432dbf22 * include/freetype/freetype.h, src/base/ftobjs.c: renamed
cmap14-related new APIs to the FT_Object_ActionName scheme.
        update the documentation for these APIs

        * src/sfnt/ttcmap.c: stronger cmap 14 validation, make the
        code a little more consistent with FreeType coding conventions
        and modify the cmap14 functions that returned a newly allocated
        array to use a persistent vector from the TT_CMap14 object
        instead.
2007-10-19 12:36:40 +00:00
Werner Lemberg 9a966b7d1b Add support for cmap type 14.
* devel/ftoption.h, include/freetype/config/ftoption.h
(TT_CONFIG_CMAP_FORMAT_14): New macro.

* include/freetype/internal/ftobjs.h (FT_CMap_CharVarIndexFunc,
FT_CMap_CharVarIsDefaultFunc, FT_CMap_VariantListFunc,
FT_CMap_CharVariantListFunc, FT_CMap_VariantCharListFunc): New
support function prototypes.
(FT_CMap_ClassRec): Add them.
Update all users.

* include/freetype/ttnameid.h (TT_APPLE_ID_VARIANT_SELECTOR): New
macro.

* include/freetype/freetype.h (FT_Get_Char_Variant_Index,
FT_Get_Char_Variant_IsDefault, FT_Get_Variant_Selectors,
FT_Get_Variants_Of_Char, FT_Get_Chars_Of_Variant): New API
functions.

* src/base/ftobjs.c (find_variant_selector_charmap): New auxiliary
function.
(FT_Set_Charmap): Disallow cmaps of type 14.
(FT_Get_Char_Variant_Index, FT_Get_Char_Variant_IsDefault,
FT_Get_Variant_Selectors, FT_Get_Variants_Of_Char,
FT_Get_Chars_Of_Variant): New API functions.

* src/sfnt/ttcmap.c (TT_PEEK_UINT24, TT_NEXT_UINT24): New macros.

(TT_CMap14Rec, tt_cmap14_init, tt_cmap14_validate,
tt_cmap14_char_index, tt_cmap14_char_next, tt_cmap14_get_info,
tt_cmap14_char_map_def_binary, tt_cmap14_char_map_nondef_binary,
tt_cmap14_find_variant, tt_cmap14_char_var_index,
tt_cmap14_char_var_isdefault, tt_cmap14_variants,
tt_cmap14_char_variants, tt_cmap14_def_char_count,
tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars,
tt_cmap14_variant_chars, tt_cmap14_class_rec): New functions and
structures for cmap 14 support.
(tt_cmap_classes): Register tt_cmap14_class_rec.
(tt_face_build_cmaps): One more error message.

* docs/CHANGES: Mention cmap 14 support.
2007-10-15 17:21:32 +00:00
Werner Lemberg 74597ccd8f * src/base/ftobjs.c (find_unicode_charmap): If search for a UCS-4
charmap fails, do the loop again while searching a UCS-2 charmap.
This favours MS charmaps over Apple ones.
2007-10-01 07:08:56 +00:00
Werner Lemberg 39c91ad444 * src/raster/ftraster.c (count_table): Make it conditional.
* src/base/ftobjs.c (FT_New_Library): Check FT_RENDER_POOL_SIZE with
a preprocessor statement.
2007-07-28 05:40:40 +00:00
Werner Lemberg 1e1b6dff54 * src/pfr/pfrcmap.c: Include pfrerror.h.
* src/autofit/afindic.c: Add some external declarations to pacify
`make multi' compilation.

* src/cid/cidgload.c (cid_load_glyph): Pacify compiler.

* src/cff/cffdrivr.c (cff_ps_get_font_info), src/cff/cffobjs.c
(cff_strcpy), include/freetype/internal/ftmemory.h (FT_MEM_STRDUP),
src/autofit/aflatin.c (af_latin_hints_compute_edges),
src/autofit/afcjk.c (af_cjk_hints_compute_edges), src/sfnt/ttmtx.c
(tt_face_get_metrics), src/base/ftobjs.c (open_face)
[FT_CONFIG_OPTION_INCREMENTAL]: Fix compilation with C++ compiler.

* docs/release: Mention test compilation targets.
2007-07-07 07:30:40 +00:00
Werner Lemberg 3d507fefe8 * src/base/ftobjs.c (destroy_charmaps), src/type1/t1objs.c
(T1_Face_Done), src/winfonts/winfnt.c (FNT_Face_Done): Check for
face == NULL.  Suggested by Graham Asher.
2007-06-03 16:54:55 +00:00
Werner Lemberg ce280a22e2 * src/base/ftobjs.c (FT_Request_Metrics): Fix compiler warning. 2007-06-03 05:58:30 +00:00
Werner Lemberg b9933f4b02 * src/base/ftobjs.c (FT_Request_Metrics), src/cache/ftccmap.c
(FTC_CMapCache_Lookup): Remove unused code.
2007-06-01 21:27:12 +00:00
Werner Lemberg b826fa7589 Savannah patch #5929.
* include/freetype/tttables.h, src/base/ftobjcs.c
(FT_Get_CMap_Format): New function.

* include/freetype/internal/services/svttcmap.c (TT_CMapInfo): Add
`format' member.
* src/sfnt/ttcmap.c (tt_cmap{0,2,4,6,8,10,12}_get_info): Set
cmap_info->format.
2007-05-19 07:18:48 +00:00
Werner Lemberg 607dec79bb * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Remove unused
variable.
* src/autofit/afloader.c (af_loader_load_g): Ditto.

* src/base/ftobjs.c (ft_validator_error): Use `ft_jmp_buf'.
(open_face_from_buffer): Initialize `stream'.
(FT_Request_Metrics): Remove unused variable.
Remove redundant `break' statements.
(FT_Get_Track_Kerning): Remove unused variable.

* src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs,
afm_parse_kern_data): Remove redundant
`break' statements.
(afm_parser_parse): Ditto.
Don't use uninitialized variables.

* src/psnames/psmodule.c (VARIANT_BIT): Define as unsigned long.
Use `|' operator instead of `^' to set it.
Update all users.

* src/sfnt/ttcmap.c (tt_face_build_cmaps): Use `ft_jmp_buf'.
* src/sfnt/ttkern.c (tt_face_load_kern): Remove unused variable.

* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant
comparison.
(TT_Process_Simple_Glyph): Use FT_UInt for `n_points' and `i'.
(TT_Load_Glyph): Remove unused variable.
2007-05-15 06:49:37 +00:00
Werner Lemberg 8d463a53d1 * src/base/ftobjs.c (FT_New_Library): Only allocate rendering pool
if FT_RENDER_POOL_SIZE is > 0.  From Savannah patch #5928.
2007-05-13 16:01:55 +00:00
Werner Lemberg 106eaf1dbb * src/base/ftobjs.c (FT_Set_Char_Size): Simplify code.
* include/freetype/freetype.h (FT_Set_Char_Size): Update
documentation.
2007-05-03 07:07:47 +00:00
Werner Lemberg 7478197e00 formatting 2007-04-03 19:39:28 +00:00
David Turner 7338ec2b53 make FT_Set_Char_Size deal with 0-valued resolution parameter like the other one 2007-04-03 14:30:34 +00:00
Werner Lemberg 1e259deda2 Fix ChangeLog; fix source code comment. 2007-03-08 15:39:21 +00:00
Werner Lemberg 6e87ed9f04 Spelling fixes from Alexei. 2007-01-26 22:18:56 +00:00
Werner Lemberg 8c4120d0a3 Fix various compiler warnings.
* src/truetype/ttdriver.c (tt_size_select), src/cff/cffobjs.h,
src/cff/cffobjs.c (cff_size_request), src/type42/t42objs.h:
s/index/strike_index/.
* src/base/ftobjs.c (FT_Match_Size): s/index/size_index/.

* src/gxvalid/gxvmorx5.c
(gxv_morx_subtable_type5_InsertList_validate): s/index/table_index/.

* src/truetype/ttinterp.c (Compute_Point_Displacement),
src/pcf/pcfread.c (pcf_seek_to_table_type): Avoid possibly
uninitialized variables.
2007-01-15 06:42:40 +00:00
Werner Lemberg 17432b5e37 * src/type1/t1load.c (is_space): Removed.
(parse_encoding, parse_charstrings): Use IS_PS_DELIM.
(parse_charstrings): Use IS_PS_TOKEN.


* autogen.sh: Avoid bash specific syntax.
2007-01-12 09:28:44 +00:00
David Turner 7a3c564e2e * src/base/ftobjs.c (IsMacResource): fixed a small bug that caused a
crash with some Mac OS X .dfont files. Submitted by Masatake Yamoto.
2007-01-11 15:09:01 +00:00
Werner Lemberg 4ea0a7f0b6 formatting, minor doc fixes, copyright years 2007-01-05 09:03:31 +00:00
David Turner a8cf42bb7a * src/pshinter/pshalgo.c: remove a stupid typo that results in no
hinting and a memory leak with some large Asian CFF fonts

        * src/base/ftobjs.c (FT_Done_Library): remove a subtle memory leak
        which happens when FT_Done_Library is called with opened CFF_Faces in
        it. We need to close all faces before destroying the modules, or else
        some bad things (memory leaks) may happen.
2007-01-04 16:46:46 +00:00
Werner Lemberg 0fd08bdc6a formatting 2006-12-16 02:57:46 +00:00
Suzuki, Toshiya (鈴木俊哉) 7a7d403d7a * Improve resource fork handler for POSIX 2006-12-15 14:47:42 +00:00
Werner Lemberg 913a365090 Because FT_Load_Glyph expects CID values for CID-keyed fonts, the
test for a valid glyph index must be deferred to the font drivers.
This patch fixes Savannah bug #18301.

* src/base/ftobjs.c (FT_Load_Glyph): Don't check `glyph_index'.
* src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/cff/cffgload.c
(cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph),
src/pcf/pcfdrivr.c (PCF_Glyph_Load), src/pfr/pfrobjs.c
(pfr_slot_load), src/truetype/ttdriver.c (Load_Glyph),
src/type1/t1gload.c (T1_Load_Glyph), src/winfonts/winfnt.c
(FNT_Load_Glyph): Check validity of `glyph_index'.
2006-11-19 09:19:17 +00:00
Werner Lemberg e88c5261c3 * src/cff/cffload.c (cff_encoding_load): Remove unused variable.
* src/base/ftobjs.c (FT_Select_Charmap): Disallow FT_ENCODING_NONE
as argument.
2006-10-24 05:46:26 +00:00
Werner Lemberg 046bf8b0cc formatting 2006-10-03 08:43:42 +00:00
David Turner df430e1a20 * include/freetype/internal/ftobjs.h, src/base/ftobjs.c,
src/truetype/ttobjs.c: fixes related to the unpatented hinter
2006-10-01 00:09:35 +00:00
David Turner ad83071620 * include/freetype/internal/ftobjs.h, src/truetype/ttobjs.c,
src/base/ftobjs.c: fixed a bug in the automatic unpatented
        hinting support which prevented normal bytecode hinting to
        work properly

        * src/autofit/aftypes.h: undefining AF_DEBUG to get rid of
        traces
2006-09-27 16:20:59 +00:00
Jens Claudius a787f45580 2006-08-27 Jens Claudius <jens.claudius@yahoo.com>
Fix miscellaneous compiler warnings.

	* freetype2/include/freetype/internal/ftobjs.h: close
	comment with `*/' to avoid `/* in comment' compiler warning.

	* freetype2/src/base/ftdbgmem.c (ft_mem_table_get_source): Turn
	cast `(FT_UInt32)(void*)' into `(FT_UInt32)(FT_PtrDist)(void*)'
	since on 64-bit platforms void* is larger than FT_UInt32.

	* freetype2/src/base/ftobjs.c (t_validator_error): cast
	away volatileness of argument to ft_longjmp. Spotted by
	Werner `Putzfrau' Lemberg.

	* freetype2/src/bdf/bdflib.c (bdf_load_font): initialize
	local variable `lineno'.

	* freetype2/src/gxvalid/gxvmod.c (classic_kern_validate):
	mark local variable `error' volatile.
2006-08-27 11:26:18 +00:00
David Turner 6aa260ce61 support for "automatic unpatented hinting" added
we still need to determine the list of "trick" CJK fonts
that are going to toggle the bytecode interpreter instead
of the auto-hinter
2006-08-25 22:45:13 +00:00
Werner Lemberg 1234299620 formatting 2006-08-19 11:18:09 +00:00
David Turner 33f5f24957 * include/freetype/internal/ftgloadr.h,
include/freetype/internal/tttypes.h, src/base/ftgloadr.c,
    src/base/ftobjs.c, src/truetype/ttgload.c, src/truetype/ttinterp.c,
    src/truetype/ttobjs.c: improvements to native TrueType hinting,
    this is a first try, controlled by the FIX_BYTECODE macro in
    src/truetype/ttinterp.c
2006-08-16 16:50:55 +00:00
David Turner 2b21a932f1 * src/base/ftobjs.c (ft_validator_run): disabling function, it is
buggy by design, so it will always return -1
2006-08-16 09:24:32 +00:00
Suzuki, Toshiya (鈴木俊哉) de0a96c5dd * fix 2 memory leaks in MacOS resource fork handler, Savannah bug #16631 2006-05-19 23:16:12 +00:00
Suzuki, Toshiya (鈴木俊哉) a229540280 fix bug in Mac_Read_POST_Resource() 2006-04-30 04:46:17 +00:00
Werner Lemberg 4db32ecbc5 * docs/CHANGES: Updated.
* src/tools/docmaker/tohtml.py (html_header_2): Add horizontal
padding between table elements.


Formatting, copyright years.
2006-03-24 11:54:53 +00:00
David Turner 2ce9203735 - added FT_Get_SubGlyph_Info API to freetype.h
- small fix to lsb/rsb delta computations
- cleaning up Jamfile
2006-03-23 20:58:20 +00:00
David Turner da95af6cf6 * builds/win32/visualc/freetype.dsp: updating the project file, adding
missing base source files (e.g. ftstroke.c, ftxf86.c, etc...)

    * src/autofit/afcjk.c, src/autofit/aflatin.c, src/base/ftobjs.c,
    src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrobjs.c,
    src/sfnt/sfobjs.c, src/sfnt/ttmtx.c, src/truetype/ttpload.c,
    src/truetype/ttpload.h, src/type1/t1afm.c, src/type1/t1objs.c:
      removing compiler warnings when building with Visual C++ 6 and /W4
2006-03-20 13:32:33 +00:00
Wu, Chia-I (吳佳一) a87b08a7af * src/base/ftobjs.c (FT_Done_Library): Modules are removed in the
reversed order so that type42 module is removed before truetype
module.  This avoids double free in some occasions.
2006-02-28 09:53:23 +00:00
Wu, Chia-I (吳佳一) cffa8b65be * src/base/ftobjs.c (FT_Set_Char_Size): Ahh.. forgot to check the case
width or height is 0.
2006-02-27 11:11:40 +00:00
Wu, Chia-I (吳佳一) 2e48a1a138 * src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics, FT_Load_Glyph):
Re-enable glyph metrics grid-fitting.  It is now done in the base
layer.
(FT_Set_Char_Size, FT_Set_Pixel_Sizes): Make sure the width and height
are not too small or too large, just like we were doing in 2.1.10.

* src/autofit/afloader.c (af_loader_load_g): The vertical metrics are
not scaled.
2006-02-27 09:18:07 +00:00
David Turner b463665feb * src/base/ftobjs.c (ft_recompute_scaled_metrics): re-enable conservative
rounding of metrics to avoid breaking clients like Pango
    (see http://bugzilla.gnome.org/show_bug.cgi?id=327852)
2006-02-26 07:57:45 +00:00
David Turner 6c71c6b968 * include/freetype/config/ftoption.h, src/autofit/afcjk.c,
src/base/ftobjs.c, src/base/ftutil.c, src/cff/cffobjs.c,
    src/psaux/afmparse.c, src/sfnt/ttbdf.c, src/tools/apinames.c,
    src/truetype/ttdriver.c:

       solved compiler warnings as well as C++ compilation problems
2006-02-25 12:49:40 +00:00
Wu, Chia-I (吳佳一) a8e7a01965 * include/freetype/freetype.h (FT_Size_RequestRec): Change the type of
`width' and `height' to `FT_Long'.
(enum FT_Size_Request_Type), src/base/ftobjs.c (FT_Request_Metrics):
New request type `FT_SIZE_REQUEST_TYPE_SCALES' to specify the scales
directly.
2006-02-24 06:11:30 +00:00
Werner Lemberg 5edafed12a Clean-ups, copyright years, formatting. 2006-02-22 08:23:35 +00:00
David Turner 0b5dc4df88 * include/freetype/ftmodapi.h, include/internal/ftserv.h,
include/internal/services/svtteng.h, src/base/ftobjs.c,
    src/truetype/ttdriver.c:

    adding a new API named FT_Get_TrueType_Engine_Type to determine
    wether we have a patented, unpatented or unimplemented TrueType
    bytecode interpreter.

    the FT_Get_Module_Flags API was removed consequently.
2006-02-21 22:36:23 +00:00
Werner Lemberg 8e6f8c4d79 Formatting, copyright years, documentation improvements. 2006-02-17 08:07:09 +00:00
David Turner cda2d957dc * builds/amiga/src/base/ftsystem.c, devel/ftoption.h
include/freetype/ftcache.h, include/freetype/ftoutln.h,
      include/freetype/cache/ftccache.h, include/freetype/cache/ftccmap.h,
      include/freetype/config/ftoption.h, include/freetype/internal/ftcalc.h,
      include/freetype/internal/ftdriver.h,
      include/freetype/internal/ftmemory.h,
      include/freetype/internal/ftobjs.h, include/freetype/internal/ftrfork.h,
      include/freetype/internal/psaux.h, include/freetype/internal/sfnt.h,
      include/freetype/internal/t1types.h, include/freetype/internal/tttypes.h,
      src/base/ftcalc.c, src/base/ftdbgmem.c, src/base/ftobjs.c,
      src/base/ftsystem.c, src/base/ftutil.c, src/bdf/bdfdrivr.c,
      src/cache/ftccache.c, src/cache/ftccback.h, src/cache/ftccmap.c,
      src/cache/ftcmanag.c, src/cff/cffdrivr.c, src/cid/cidriver.c,
      src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c, src/psaux/psauxmod.c,
      src/sfnt/sfdriver.c, src/truetype/ttdriver.c, src/type1/t1driver.c,
      src/type1/t1objs.c, src/type42/t42drivr.c, src/winfonts/winfnt.c:

    massive changes to the internals to respect the internal object layouts
    and exported functions of FreeType 2.1.7. Note that the cache sub-system
    cannot be fully retrofitted, unfortunately.
2006-02-16 22:45:31 +00:00
Werner Lemberg be3c9814a4 Formatting, copyright years. 2006-01-27 14:16:16 +00:00
David Turner 6a681fa84a * src/autofit/afwarp.c: simple #ifdef to prevent compilation when
the warp hinter isn't active (it shouldn't, still experimental)

    * Jamfile, include/freetype/config/ftmodule.h: removed "gxvalid"
    and "otvalid" from the list of modules that are linked statically
    to a given FreeType library. Functionality has been moved to the
    "ftvalid" CVS module.

    note also that current Make-based build system still compiles the
    modules though...

    * include/freetype/config/ftoption.h: added FT_STRICT_ALIASING,
    which controls the definitions of the memory management functions
    to avoid warnings with recent versions of GCC. this macro is
    only here to be disabled, in case we detect problems with the
    new scheme.

    NOTE: disable macro to use the memory debugger. this will be fixed
          later !!
2006-01-27 12:11:22 +00:00
Werner Lemberg 9cc4aed879 Formatting. 2006-01-26 21:03:58 +00:00
Wu, Chia-I (吳佳一) bcc438b15e * include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.

* include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
FT_REQUEST_HEIGHT): New macros to get the width and height of a
request, in fractional pixels.

* include/freetype/internal/ftobjs.h (FT_Select_Metrics,
FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
FT_Request_Metrics): New base functions to set the font metrics.  They
were part of FT_Select_Size/FT_Request_Size and are made independent
functions so that metrics are not set again and again.

* src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
only when driver's size_select/size_request is NULL.  That is, drivers
should set the metrics themselves.
(FT_Match_Size): Round before matching.  This was what we did and it
does cause some problems without rounding.

* src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
(tt_size_select): Set the font metrics.
s/index/strike_index/.
The scaled metrics are always preferred over strikes' metrics, even
when some strike is selected.  This is done because the strikes'
metrics are not reliable, e.g., the sign of the descender is wrong for
some fonts.

* src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
(tt_size_request): Set the font metrics.
Call cff_size_select/tt_size_select when some strike is matched.

* src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
Set the font metrics.
s/index/strike_index/.

* src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
files were committed.  Just a catch-up.
(PS_Conv_ToFixed): Remove the `goto'.
(PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.

* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 14:12:40 +00:00
Wu, Chia-I (吳佳一) 108fdbbbd3 * src/psaux/afmparse.c, src/psaux/afmparse.h: New files which
implement an AFM parser.  It is used to parse an AFM file.

* src/psaux/psconv.c, src/psaux/psconv.h: New files to provide
conversion functions (e.g, PS real number => FT_Fixed) for the
PS_Parser and AFM_Parser.  Some of the functions are taken, with some
modifications, from the psobjs.c

* src/psaux/psobjs.c: Use functions from psconv.c.

* include/freetype/internal/psaux.h, src/psaux/psauxmod.c:: Add
`AFM_Parser' to the `psaux' service.

* src/psaux/psaux.c, src/psaux/rules.mk: Include those new files.

* src/tools/test_afm.c: A test program for AFM parser.

* include/freetype/internal/services/svkern.h,
include/freetype/internal/ftserv.h: New service `Kerning'.  It is
currently only used to get the track kerning information.

* src/type1/t1driver.c, src/type1/t1objs.c, src/type1/t1afm.c,
src/type1/t1afm.h: Update to use the AFM parser.
Provide the `Kerning' service.

* include/freetype/freetype.h, src/base/ftobjs.c: New API
`FT_Get_Track_Kerning'.
2006-01-16 15:35:56 +00:00
Wu, Chia-I (吳佳一) ea1e8d3a53 * include/freetype/internal/ftobjs.h, src/base/ftobjs.c,
src/bdf/bdfdrivr.c, src/cff/cffgload.c, src/cid/cidgload.c,
src/pcf/pcfdrivr.c, src/type1/t1gload.c, src/winfonts/winfnt.c:
s/ft_fake_vertical_metrics/ft_synthesize_vertical_metrics/.

* docs/CHANGES: Mention that vertical metrics are synthesized for
fonts not having this info.
2006-01-15 15:01:45 +00:00
Werner Lemberg 1723dcc261 Formatting, minor clean-ups. 2006-01-15 07:30:32 +00:00
Wu, Chia-I (吳佳一) 212aee0d6e * include/freetype/internal/ftobjs.h (ft_fake_vertical_metrics),
src/base/ftobjs.c (ft_fake_vertical_metrics): New function to fake the
vertical metrics.

* src/cff/cffgload.c, src/cid/cidgload.c, src/pcf/pcfdrivr.c,
src/type1/t1gload.c, src/winfonts/winfnt.c: Fake the vertical metrics.
The fake metrics is monotone.

* src/truetype/ttgload.c (compute_glyph_metrics): Some fixes and
formattings in vertical metrics faking.  There are still rooms for
improvements (and so do the CFF module).
2006-01-15 06:24:53 +00:00
Wu, Chia-I (吳佳一) e5ff059f7f * src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/pcf/pcfdrivr.c
(PCF_Glyph_Load), src/winfonts/winfnt.c (FNT_Load_Glyph): Don't set
the linear advance fields as they are only for the outline glyphs.

* include/freetype/freetype.h: Documentation updates/clarificatoins.
The meaning of FT_LOAD_FORCE_AUTOHINT is changed so that no real
change need be made to the code.

* src/base/ftobjs.c (FT_Load_Glyph): Resolve flag dependencies and
decide whether to use the auto-hinter according to documentation.
There should to be no real difference.
Some checks (e.g., is text height positve?) after the glyph is loaded.
(FT_Select_Size, FT_Request_Size): Scales are set to wrong values.
Be careful that scales won't be negative.
2006-01-15 06:00:49 +00:00
Werner Lemberg 3d8eeb8e97 Formatting, comment fixes. 2006-01-14 07:10:45 +00:00
Wu, Chia-I (吳佳一) e33dc2ebee * docs/CHANGES: Mention the size selection change.
* src/bdf/bdfdrivr.c (BDF_Size_Request, BDF_Size_Select),
src/pcf/pcfdrivr.c (PCF_Size_Request, PCF_Size_Select),
src/winfonts/winfnt.c (FNT_Size_Request, FNT_Size_Select): Do size
matching for request of type NOMINAL and REAL_DIM.

* src/winfonts/winfnt.c (FNT_Face_Init): Print trace message when
`pixel_height' is used for nominal height.

* src/base/ftobjs.c (FT_Request_Size): Call `FT_Match_Size' if the
face is bitmap only and driver doesn't provide `request_size'.  This
is added merely for completion as no driver satisfies the conditions.
2006-01-14 05:09:30 +00:00
Werner Lemberg f1c2b91e14 Formatting, copyright year updates.
Decorate long constants with `L' and `UL' where appropriate.
2006-01-13 14:53:28 +00:00
Wu, Chia-I (吳佳一) fa7d6ab217 * include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.

* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.

* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.

* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.

* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.


Introduce new size selection interface.

* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.

* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.

* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.

* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'.  Drivers supporting bitmap strikes
can use this function to implement `request_size'.

* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.

* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 12:21:31 +00:00
Werner Lemberg 6cdab92b59 * docs/CHANGES: Updated.
* include/freetype/ftmodapi.h (FT_Module_Get_Flags): New
declaration.

* src/base/ftobjs.c (FT_Module_Get_Flags): New function.
2006-01-08 22:34:01 +00:00
Werner Lemberg 748b171dd7 Doc typos. From Huw Davies. 2005-12-25 09:15:09 +00:00
Werner Lemberg 083ba0b7bc Formatting, documentation improvements. 2005-12-23 15:10:54 +00:00
David Turner e6bb95336a * Jamfile, docs/reference/README: fix it so that "jam refdoc" works
correctly to generate the API reference in 'docs/reference'

	* src/tools/docmaker/tohtml.py: update to output nicer fields lists
	in the API reference

	* src/base/ftobjs.c (FT_Load_Glyph): FT_LOAD_TARGET_LIGHT now
	forces auto-hinting

	* freetype/freetype.h: updating the documentation for
	FT_LOAD_TARGET_XXX and FT_Render_Mode values
2005-12-23 13:32:06 +00:00
Wu, Chia-I (吳佳一) dcb8b7103f * include/freetype/internal/ftobjs.h (ft_glyphslot_grid_fit_metrics),
src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Removed.

* src/base/ftobjs.c (ft_recompute_scaled_metrics): Do not round.

* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
(cid_slot_load_glyph), src/truetype/ttgload.c (compute_glyph_metrics),
src/type1/t1gload.c (T1_Load_Glyph): Do not round glyph metrics.

* doc/CHANGES: Mention the changes.
2005-12-16 14:27:14 +00:00
Werner Lemberg 3b8db66941 Fix ChangeLog and source code comment. 2005-12-06 10:47:44 +00:00
Werner Lemberg b2d025306e * src/base/ftobjs.c (FT_Open_Face): Avoid possible memory leak.
Make compiling instructions in docs/CUSTOMIZE work again.

* builds/unix/unix-cc.in (CPPFLAGS): New variable.
(CFLAGS): Don't include @CPPFLAGS@.
* builds/freetype.mk (FT_CFLAGS): Add CPPFLAGS.
2005-11-04 06:58:49 +00:00
David Turner 92f30c812c * src/base/ftobjs.c (FT_Open_Face): don't call FT_New_GlyphSlot and
FT_New_Size if we're opening a face with face_index < 0 (which is only
  used for testing the format).

  * src/gxvalid/gxvmort0.c: removed compiler warning
2005-10-17 21:17:20 +00:00
Werner Lemberg 7b33dca43c Formatting. 2005-06-23 20:31:48 +00:00
Wu, Chia-I (吳佳一) 8cfb220eb9 * include/freetype/internal/ftobjs.h, src/base/ftobjs.c: New function
ft_glyphslot_grid_fit_metrics.

* src/truetype/ttgload.c (compute_glyph_metrics): Use
ft_glyphslot_grid_fit_metrics.

* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
(cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Use
ft_glyphslot_grid_fit_metrics.
FT_Outline_Get_CBox is called twice.

* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Modify metrics to more
reasonable values when emboldening outline glyphs.  The theoretic
ones are unrealistic.
2005-06-20 09:04:50 +00:00
Werner Lemberg 0f1c4fa7c6 Minor documentation fixes.
Include stuff created by autogensh. in .cvsignore.
2005-06-06 07:01:47 +00:00
Werner Lemberg e70371c410 * src/base/ftobjs.c (ft_cmap_done_internal): New function.
(FT_CMap_Done): Remove cmap from cmap list.
(destroy_charmaps, FT_CMap_New): Don't call FT_CMap_Done but
ft_cmap_done_internal.
2005-05-27 06:01:28 +00:00
Werner Lemberg b9ee7370f6 * docs/CHANGES: Updated.
* src/base/ftbitmap.c: Don't include FT_FREETYPE_H and FT_IMAGE_H
but FT_BITMAP_H.
(FT_Bitmap_Copy): New function (from ftglyph.c).

* include/freetype/ftbitmap.h (FT_Bitmap_Copy): New public
definition.

* src/base/ftglyph.c: Include FT_BITMAP_H.
(ft_bitmap_copy): Move to ftbitmap.c.
(ft_bitmap_glyph_init): Remove `memory' variable.
Create new bitmap object if FT_GLYPH_OWN_BITMAP isn't set.
(ft_bitmap_glyph_copy): Use FT_Bitmap_Copy.
(ft_bitmap_glyph_done): Use FT_Bitmap_Done.
(ft_outline_glyph_init): Use FT_Outline_Copy.

* src/base/ftoutln.c (FT_Outline_Copy): Handle source == target.
(FT_Outline_Done_Internal): Check for valid `memory' pointer.
(FT_Outline_Translate, FT_Outline_Reverse, FT_Outline_Render,
FT_Outline_Transform): Check for valid `outline' pointer.

* src/base/ftobjs.c (FT_New_GlyphSlot): Prepend glyph slot to
face->glyph, otherwise a new second glyph slot cannot be created.
(FT_Done_GlyphSlot): Fix memory leak.
(FT_Open_Face): Updated -- face->glyph is already managed by
FT_New_GlyphSlot.

* src/type42/t42objs.c (T42_GlyphSlot_Done): Updated.
2005-05-20 21:52:19 +00:00
Werner Lemberg ce235eaf09 * builds/win32/visualc/freetype.vcproj: Updated.
Exclude debug info for `Release' versions to reduce library size.


* src/base/ftobjs.c (FT_Open_Face): Make it work as documented, this
is, ignore `aface' completely if face_index < 0.  Reported by David
Osborn <spam@habitualhiatus.com>.


* include/freetype/ftimage.h (FT_Outline_MoveToFunc,
FT_Outline_LineTo_Func, FT_Outline_ConicToFunc,
FT_Outline_CubicToFunc), src/smooth/ftgrays.c (gray_render_conic,
gray_render_cubic, gray_move_to, gray_line_to, gray_conic_to,
gray_cubic_to, gray_render_span, gray_sweep): Decorate parameters
with `const' where appropriate.
2005-05-17 20:35:23 +00:00
Werner Lemberg 56ef6bc4d6 * src/tools/glnames.py: Formatted.
Format output to be in sync with other FreeType code.
Import `re' and `os.path'.
(StringTable) <__init__>: Add parameter to initialize master table
name.
(StringTable) <dump>: Don't pass master table name.
(StringTable) <dump_sublist>: Emit explanatory comment.
Simplify and make output more human readable.
(t1_bias, glyph_list, adobe_glyph_names): Removed.  Unused.
(main): Use `basename' for file name in header.

* src/psnames/pstables.h: Regenerated.

Other formatting.
2005-03-10 06:28:07 +00:00
David Turner 705620beeb * src/base/ftobjs.c (FT_Set_Char_Sizes): fix for bug #12263 2005-03-09 17:36:02 +00:00
Werner Lemberg 8acb867ef2 Formatting. 2005-03-08 11:43:36 +00:00
Werner Lemberg ece8b20e6c Documentation updates, whitespace. 2004-12-13 23:16:59 +00:00
Werner Lemberg 133eee06bf * src/base/ftobjs.c (FT_Get_Kerning): Make kerning amount
dependent on ppem by scaling down for ppem < 25, then do normal
rounding.  This gives slightly better results than rounding towards
zero.
2004-12-12 06:55:40 +00:00
Werner Lemberg 62f8978794 * src/base/ftobjs.c (FT_Get_Kerning): Always round towards zero
for FT_KERNING_DEFAULT.  This greatly enhances the kerning for
small ppem values.
2004-12-09 22:57:18 +00:00
Werner Lemberg 34f4f39ad8 * src/base/ftobjs.c (ft_glyphslot_clear): Reset `lsb_delta' and
`rsb_delta'.
2004-12-09 22:22:52 +00:00
Werner Lemberg 645af08157 * include/freetype/internal/ftobjs.h: Don't include
FT_CONFIG_STANDARD_LIBRARY_H.
(FT_Validator, FT_VAlidationLevel, FT_ValidatorRec, FT_VALIDATOR,
ft_validator_init, ft_validator_run, ft_validator_error, FT_INVALID,
FT_INVALID_TOO_SHORT, FT_INVALID_OFFSET, FT_INVALID_FORMAT,
FT_INVALID_GLYPH_ID, FT_INVALID_DATA): Move to...

* include/freetype/internal/ftvalid.h: New file.
Make FT_INVALID return module-specific error codes.

* include/freetype/internal/internal.h (FT_INTERNAL_VALIDATE_H): New
macro.

* include/freetype/fterrors.h: Undefine FT_ERR_PREFIX only if
FT_KEEP_ERR_PREFIX isn't defined.

* src/base/ftobjs.c: Include FT_INTERNAL_VALIDATE_H.

* src/sfnt/ttcmap.h: Don't include FT_INTERNAL_OBJECTS_H but
FT_INTERNAL_VALIDATE_H.

* src/sfnt/ttcmap.c: Don't include FT_INTERNAL_OBJECTS_H but
FT_INTERNAL_VALIDATE_H.
Include sferrors.h before FT_INTERNAL_VALIDATE_H.
s/FT_Err_Ok/SFNT_Err_Ok/.

* src/sfnt/sferrors.h: Define FT_KEEP_ERR_PREFIX.

* src/type1/t1afm.c: Include t1errors.h.
2004-09-06 07:06:56 +00:00
Werner Lemberg 17439423f8 * src/base/ftstream.c (FT_Stream_Close): Don't reset stream->close
to NULL.  This allows custom close functions to delete the FT_STREAM
object.


Add API to get information about SFNT tables.

* include/freetype/internal/services/svsfnt.h
(FT_SFNT_Table_Info_Func): New typedef.
(SFNT_Table): Add it.

* src/base/ftobjs (FT_Sfnt_Table_Info): New function.

* include/freetype/tttables.h: Updated.

* src/sfnt/sfdriver.c (sfnt_table_info): New function.
(sfnt_service_sfnt_table): Add it.

* docs/CHANGES: Updated.


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

* builds/unix/configure.ac (version_info): Set to 9:8:3.
* builds/unix/configure: Updated.

* builds/win32/visualc/index.html,
builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype.vcproj: s/219/2110/, s/2.1.9/2.1.10/.

* builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
s/2.1.8/2.1.9/.

* docs/CHANGES, docs/VERSION.DLL: Updated.


* src/base/ftrfork.c (FT_Raccess_Guess)
[!FT_CONFIG_OPTION_GUESSING_EMBEDDED_FORK]: Remove compiler
warnings.
2004-08-11 05:25:37 +00:00
Werner Lemberg b8fdcd68d2 * src/base/ftobjs.c (FT_Attach_File): Initialize `open.stream'. 2004-08-03 03:28:11 +00:00
David Turner 2f0fdb9316 fixing a scaling bug in the TrueType glyph loader that generated ugly
artefacts when the TrueType bytecode interpreter was compiled in
2004-06-21 21:16:56 +00:00
Werner Lemberg e95365b291 * include/freetype/ftcache.h (FT_Get_CharMap_Index): Rename
declaration and move to...
* include/freetype/freetype.h (FT_Get_Charmap_Index): Here.
(FREETYPE_PATCH): Set to 9.

* src/base/ftobjs.c (FT_Get_Charmap_Index): New function.

* builds/unix/configure.ac (version_info): Set to 9:7:3.
* builds/unix/configure: Updated.

* builds/win32/visualc/index.html,
builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype.vcproj: s/218/219/.

* builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
s/2.1.8/2.1.9/.

* docs/CHANGES, docs/VERSION.DLL: Updated.
2004-04-24 14:43:37 +00:00
Werner Lemberg ba80d61c7a * builds/unix/ftconfig.in, builds/vms/ftconfig.h: Define
FT_CHAR_BIT.

* src/base/ftobjs.c (FT_Load_Glyph): Don't apply autohinting if
glyph is vertically distorted or mirrored.

* src/cff/cffgload.c (cff_slot_load): Handle zero `size' properly
for embedded bitmaps.

* docs/CHANGES: Updated.
2004-04-16 09:56:30 +00:00
Werner Lemberg 754353343e Provide generic access to MacOS resource forks.
* src/base/ftrfork.c, include/freetype/internal/ftrfork.h: New
files.

* src/base/ftobjs.c: Include FT_INTERNAL_RFORK_H.
(Mac_Read_POST_Resource, Mac_Read_sfnt_Resource): Remove arguments
`resource_listoffset' and `resource_data' and adapt code
accordingly.  These values are calculated outside of the function
now.
Add new argument `offsets'.
(IsMacResource): Use `FT_Raccess_Get_HeaderInfo' and
`FT_Raccess_Get_DataOffsets'.
(load_face_in_embedded_rfork): New function.
(load_mac_face): Use load_face_in_embedded_rfork.
(ft_input_stream_new): Renamed to...
(FT_Stream_New): This.  Use FT_BASE_DEF.  Updated all callers.
(ft_input_stream_free): Renamed to...
(FT_Stream_Free): This.  Use FT_BASE_DEF.  Updated all callers.

* src/base/ftbase.c: Include ftrfork.c.

* src/base/rules.mk (BASE_SRC), src/base/Jamfile: Updated.

* include/freetype/internal/internal.h (FT_INTERNAL_RFORK_H):
New macro.

* include/freetype/internal/fttrace.h: Added `rfork' as a new
trace definition.

* include/freetype/internal/ftstream.h: Declare FT_Stream_New and
FT_Stream_Free.

* include/freetype/config/ftoption.h, devel/ftoption.h
(FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK): New option.

* include/freetype/config/ftstdlib.h (ft_strrchr): New macro.
2004-02-25 12:58:54 +00:00
Werner Lemberg 32eb5ce978 * src/base/ftobjs.c (FT_Set_Char_Size): Fix typo. 2004-02-16 12:53:59 +00:00
Werner Lemberg d233482ef5 * src/base/ftobjs.c (FT_Set_Char_Size): Return immediately if
ppem values don't change.  Suggested by Graham Asher.
2004-02-13 23:48:39 +00:00
Werner Lemberg 4338dab2f8 * src/base/ftobjs.c (destroy_charmaps): New function.
(destroy_face, open_face): Use `destroy_charmaps'.
2004-01-05 14:41:59 +00:00
Werner Lemberg cb8ede4dca * include/freetype/internal/sfnt.h (TT_Set_SBit_Strike_Func):
Use FT_UInt for ppem values.
* src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Use FT_UInt for
ppem values.
* src/sfnt/ttsbit.h: Updated.

* src/base/ftobjs.c (FT_Set_Pixel_Sizes): Don't allow ppem values
larger than -0FFFF.
2003-12-27 21:44:18 +00:00
Werner Lemberg 328abf3094 * src/cff/cffgload.c (cff_lookup_glyph_by_stdcharcode): Handle
CID-keyed fonts.

Remove MS-DOS line endings.

Minor formatting issues.
2003-12-24 13:37:58 +00:00
David Turner 87c0d30fc5 * include/freetype/fttypes.h
src/autofit/afangles.c
        src/autofit/aflatin.c
        src/autohint/ahglyph.c
        src/autohint/ahhint.c
        src/base/ftcalc.c
        src/base/ftgloadr.c
        src/base/ftglyph.c
        src/base/ftobjs.c
        src/base/ftsynth.c
        src/base/fttrigon.c
        src/cff/cffgload.c
        src/cid/cidgload.c
        src/cid/cidload.c
        src/pfr/pfrgload.c
        src/pfr/pfrload.c
        src/pfr/pfrsbit.c
        src/psaux/psobjs.c
        src/pshinter/pshalgo.c
        src/pshinter/pshglob.c
        src/pshinter/pshrec.c
        src/raster/ftrend1.c
        src/sfnt/ttcmap0.c
        src/smooth/ftsmooth.c
        src/truetype/ttdriver.c
        src/truetype/ttgload.c
        src/truetype/ttinterp.c
        src/truetype/ttobjs.c
        src/type1/t1gload.c
        src/winfonts/winfnt.c:

          use of the FT_PAD_XXX and FT_PIX_XXX macros to avoid compiler
          warnings with very pedantic compilers. Hints:  (x) & -64 will
          warn if (x) is not signed.. use (x) & ~63 instead !
2003-12-24 01:10:46 +00:00
Werner Lemberg 91a67478ec Add new function FT_Get_CMap_Language_ID to extract the language ID
for TrueType/sfnt fonts.

* include/freetype/internal/services/svttcmap.h: New file.
* include/freetype/internal/ftserv.h (FT_SERVICE_TT_CMAP_H): Add
svttcmap.h.

* src/sfnt/sfdriver.c: Include ttcmap0.h.
(tt_service_get_cmap_info): New service.
(sfnt_services): Updated.

* src/sfnt/ttcmap0.c (tt_cmap*_get_info): New functions.
(tt_cmap*_class_rec): Add tt_cmap*_get_info members.
(tt_get_cmap_info): New function.
* src/sfnt/ttcmap0.h: Include FT_SERVICE_TT_CMAP_H.
(TT_CMap_ClassRec): New field `get_cmap_info'.
(tt_get_cmap_info): New declaration.

* src/base/ftobjs.c: Include FT_SERVICE_TT_CMAP_H.
(FT_Get_CMap_Language_ID): New function implementation.
* include/freetype/tttables.h (FT_Get_CMap_Language_ID): New
function declaration.
2003-12-17 14:28:22 +00:00
Werner Lemberg 00915574c3 * src/base/ftobjs.c (load_mac_face): Recent versions of Linux
support Mac's HFS+ file system, thus enable code to read /rsrc on
non-Macintosh platforms also.
2003-12-10 22:10:16 +00:00
Werner Lemberg dc8ad54f10 * include/freetype/internal/psaux.h (PS_TableRec): Change type
of `lengths' to FT_PtrDist.
(T1_DecoderRec): Change type of `subrs_len' to FT_PtrDist.
* include/freetype/internal/t1types.h (T1_FontRec): Change type
of `subrs_len' and `charstrings_len' to FT_PtrDist.

* src/base/ftobjs.c (Mac_Read_POST_Resource): Replace `junk'
variable with better solution.
(IsMacResource): Remove unused variable `map_len'.
Replace `junk' variable with better solution.
(FT_Open_Face) [!FT_MACINTOSH]: Add conditional
FT_CONFIG_OPTION_MAC_FONTS.

* src/autohint/ahhint.c (ah_hinter_hint_edges,
ah_hinter_align_strong_points): Add some casts.

* src/base/ftoutln.c (FT_OrientationExtremumRec): Change type
of `pos' to FT_Long.

* src/base/ftobjs.c (Mac_Read_POST_Resource,
Mac_Read_sfnt_Resource): Change type of `len' to FT_Long.

* src/type42/t42parse.c (t42_parse_dict): Add cast for `n_keywords'.
2003-12-09 02:12:14 +00:00
Werner Lemberg be67c4ef33 * src/truetype/ttinterp.c (CUR_Func_move_orig): New macro.
(Direct_Move_Orig, Direct_Move_Orig_X, Direct_Move_Orig_Y): New
functions.  Similar to Direct_Move, Direct_Move_X, and
Direct_Move_Y but without touching.
(Compute_Funcs): Use new functions.

(Round_None, Round_To_Grid, Round_To_Half_Grid, Round_Down_To_Grid,
Round_Up_To_Grid, Round_To_Double_Grid, Round_Super,
Round_Super_45): Fix rounding of value zero.

(DO_DIV): Don't use TT_MULDIV.

(Ins_SHC): This instruction actually touches the points.
(Ins_MSIRP): Fix undocumented behaviour.

* src/truetype/ttinterp.h (TT_ExecContextRec): Updated.

* docs/VERSION.DLL: Updated.

* src/base/ftobjs.c (FT_Set_Char_Size): Make metrics->x_scale and
metrics->y_scale really precise.

(FT_Load_Glyph): Update computation of linearHoriAdvance and
linearVertAdvance.

* src/true/type/ttinterp.c (Update_Max): Use FT_REALLOC.
2003-11-24 22:54:58 +00:00
Werner Lemberg 40bb0964f2 * src/base/fttype1.c (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names):
Fix parameter order in calls to FT_FACE_FIND_SERVICE.

* include/freetype/internal/ftserv.h
(FT_SERVICE_POSTSCRIPT_NAMES_H): Removed.  Unused.

* src/type42/t42drivr.c (t42_services): Updated.
2003-11-01 14:36:20 +00:00
Werner Lemberg 7418415f48 Minor documentation improvements. 2003-10-18 16:56:13 +00:00
David Turner b72d8a8521 * include/freetype/internal/services/svpsname.h (added),
include/freetype/internal/psnames.h (removed),
        include/freetype/internal/internal.h (FT_SERVICE_POSTSCRIPT_NAMES):

          added new service to handle glyph name dictionaries, replacing
          the old internal header named "psnames.h" by "services/svpsname.h"
          note that this is different from "services/svpostnm.h" which only
          handles the retrieval of Postscript font name for a given face.
          (should we merge these two services into a single header ??)


        * include/freetype/internal/ftserv.h: adding
        FT_FACE_FIND_GLOBAL_SERVICE (used to lookup a service globally,
        instead of only within the current module)

        * include/freetype/internal/ftobjs.h, src/base/ftobjs.c: adding
        the new base function ft_module_get_service
2003-09-29 20:33:37 +00:00
David Turner e2d12842e1 * include/freetype/internal/fnttypes.h,
include/freetype/internal/ftserv.h, src/base/ftbdf.c, src/base/ftmm.c,
        src/base/ftobjs.c, src/base/ftpfr.c, src/base/ftwinfnt.c,
        src/base/ftxf86.c, src/pfr/pfrdrivr.c, src/winfonts/winfnt.c,
        src/winfonts/winfnt.h, include/freetype/internal/service/svwinfnt.h,:

          simplification of service lookup macros, updating the PFR and
          WINFNT font drivers to new services
2003-09-21 17:15:55 +00:00
Werner Lemberg 46333a118f * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE,
FT_FACE_LOOKUP_SERVICE): Add parameter to pass pointer type.
Ugly, I know, but this is needed for compilation with C++ --
maybe someone knows a better solution?
Updated all callers.

* src/base/ftobjs.c (FT_Get_Name_Index, FT_Get_Glyph_Name): Remove
C++ compiler warnings.

* src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property):
Fix order of arguments passed to FT_FACE_FIND_SERVICE.
2003-09-17 19:20:02 +00:00
Werner Lemberg 013efd1410 Formatting. 2003-09-17 05:26:33 +00:00
Werner Lemberg 5e3614f584 * builds/toplevel.mk (distclean): Remove `builds/unix/freetype2.pc'.
* src/cff/cffdrivr.c: Don't load headers twice.

* include/freetype/internal/ftserv.h (FT_SERVICE_SFNT_H): New macro.
* src/base/ftobjs.c: Include FT_SERVICE_SFNT_H.
2003-09-12 19:38:13 +00:00
David Turner c313c50208 * include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
          include/freetype/internal/ftobjs.h,
          include/freetype/internal/ftserv.h,
          include/freetype/internal/internal.h,
          include/freetype/internal/sfnt.h,
          include/freetype/internal/tttypes.h,
          include/freetype/internal/services/bdf.h,
          include/freetype/internal/services/glyfdict.h,
          include/freetype/internal/services/multmast.h,
          include/freetype/internal/services/postname.h,
          include/freetype/internal/services/sfnt.h,
          include/freetype/internal/services/xf86name.h,
          src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
          src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
          src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
          src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:

          heavy internal modifications to introduce the concept of
          "module services". This is the first step towards a massive
          simplification of the engine's internals, in order to
          get rid of various numbers of hacks.

          Note that this changes will break source & binary compatibility
          for authors of external font drivers.

          Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 19:51:54 +00:00
Werner Lemberg 7b0cc663e8 formatting 2003-07-05 07:46:49 +00:00
Werner Lemberg 6d79899362 A new try to synchronize bitmap font access.
include/freetype/freetype.h (FT_Bitmap_Size): `height' is now
defined to return the baseline-to-baseline distance.  This was
already the value returned by the BDF and PCF drivers.

The `width' field now gives the average width.  I wasn't able to
find something better.  It should be taken as informative only.

New fields `size', `x_ppem', and `y_ppem'.

* src/pcf/pcfread.c (pcf_load_font): Updated to properly fill
FT_Bitmap_Size.
Do proper rounding and conversion from 72.27 to 72 points.

* src/bdf/bdfdrivr.c (BDF_Face_Init): Updated to properly fill
FT_Bitmap_Size.
Do proper rounding and conversion from 72.27 to 72 points.

* src/sfnt/sfobjs.c (sfnt_load_face): Updated to properly fill
FT_Bitmap_Size.

* src/winfonts/winfnt.c (FNT_Face_Init): Updated to properly fill
FT_Bitmap_Size.

Redesigning the FNT driver to return multiple faces, not multiple
strikes.  At least one font (app850.fon from WinME) contains
different FNT charmaps for its subfonts.  Consequently, the previous
design of having multiple bitmap strikes in a single font face fails
since we have only one charmap per face.

* include/freetype/internal/fnttypes.h (FNT_Size_Rec): Removed.
(FNT_FaceRec): Remove `num_fonts' field and replace `fonts' with
`font'.

* src/base/ftwinfnt.c (FT_Get_WinFNT_Header): Updated.

* src/winfonts/winfnt.c (fnt_font_load): Don't set pixel_width equal
to pixel_height.
(fnt_face_done_fonts): Removed.
(fnt_face_get_dll_fonts): Renamed to...
(fnt_face_get_dll_font): This.  Add second function argument to
select face index.
Updated to load just one subfont.
(fnt_font_done, FNT_Face_Done): Updated.
(FNT_Face_Init): Handle `face_index'.
Updated.
(FNT_Size_Set_Pixels): Simplified; similar to BDF and PCF, the
bitmap width is now ignored.
(FNT_Load_Glyph): Updated.
Fix glyph index computation.
(winfnt_driver_class): Updated.
2003-07-01 07:28:55 +00:00
Werner Lemberg 779afe4b91 * src/winfonts/winfnt.c (FNT_Load_Glyph): Use first_char in
computation of glyph_index.
(FNT_Size_Set_Pixels): To find a strike, first check pixel_height
only, then try to find a better hit by comparing pixel_width also.
Without this fix it isn't possible to access all strikes.
Also compute metrics.max_advance to be in sync with other bitmap
drivers.

* src/base/ftobjs.c (FT_Set_Char_Size): Remove redundant code.
(FT_Set_Pixel_Size): Assign value to `metrics' after validation of
arguments.


Synchronize computation of height and width for bitmap strikes.  The
`width' field in the FT_Bitmap_Size structure is now only useful to
enumerate different strikes.  The `max_advance' field of the
FT_Size_Metrics structure should be used to get the (maximum) width
of a strike.

* src/bdf/bdfdrivr.c (BDF_Face_Init): Don't use AVERAGE_WIDTH for
computing `available_sizes->width' but make it always equal to
`available_sizes->height'.

* src/pcf/pcfread.c (pcf_load_font): Don't use RESOLUTION_X for
computing `available_sizes->width' but make it always equal to
`available_sizes->height'.

* src/truetype/ttdriver.c (Set_Pixel_Sizes): Pass only single
argument to function.

* src/psnames/psmodule.c (ps_unicode_value): Handle `.' after
`uniXXXX' and `uXXXX[X[X]]'.


* src/bdf/bdfdrivr.c: s/FT_Err_/BDF_Err/.
* src/cache/ftccache.c, src/cache/ftcsbits.c, src/cache/ftlru.c:
s/FT_Err_/FTC_Err_/.
* src/cff/cffcmap.c: s/FT_Err_/CFF_Err_/.
* src/pcf/pcfdrivr.c: s/FT_Err_/PCF_Err_/.
* src/psaux/t1cmap.c: Include psauxerr.h.
s/FT_Err_/PSaux_Err_/.
* src/pshinter/pshnterr.h: New file.
* src/pshinter/rules.mk: Updated.
* src/pshinter/pshalgo.c, src/pshinter/pshrec.c: Include pshnterr.h.
s/FT_Err_/PSH_Err_/.
* src/pfr/pfrdrivr.c, src/pfr/pfrobjs.c, src/pfr/pfrsbit.c:
s/FT_Err_/PFR_Err_/.
* src/sfnt/sfdriver.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
src/sfnt/ttload.c: s/FT_Err_/SFNT_Err_/.
* src/truetype/ttgload.c: s/FT_Err_/TT_Err_/.
* src/gzip/ftgzip.c: Load FT_MODULE_ERRORS_H and define
FT_ERR_PREFIX and FT_ERR_BASE.
s/FT_Err_/Gzip_Err_/.
2003-06-22 15:33:53 +00:00
Werner Lemberg 7a0241049a * include/freetype/freetype.h (FT_Open_Flags): Replaced with
#defines for the constants.
(FT_Open_Args): Change type of `flags' to FT_UInt.
(FT_GlyphSlot): Move `flags' to FT_Slot_Internal.

* include/freetype/ftimage.h (FT_Outline_Flags, FT_Raster_Flag):
Replaced with #defines for the constants.

* include/freetype/internal/ftobjs.h (FT_Slot_Internal): New
field `flags' (from FT_GlyphSlot).
Updated all affected source files.
(FT_GLYPH_OWN_BITMAP): New macro (from ftgloadr.h).

* include/freetype/internal/ftgloadr.h (FT_GLYPH_OWN_BITMAP): Moved
to ftobjs.h.

* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Use dummy
FT_GlyphSlot_Internal object.
2003-06-18 06:59:57 +00:00
Werner Lemberg 8b88466061 * src/autohint/ahhint.c (ah_hinter_hint_edges): Removed. Just a
wrapper for ah_hint_edges.
(ah_hint_edges): Renamed to...
(ah_hinter_hint_edges): This.

* src/base/ftobjs.c (FT_Set_Hint_Flags): Removed.  Unused.

* include/freetype/internal/ftobjs.h (FT_Face_InternalRec),
include/freetype/internal/psaux.h (T1_DecoderRec),
src/cff/cffgload.h (CFF_Builder): Remove `hint_flags' field.
Unused.

* src/cff/cffgload.c (cff_builder_init): Updated.
(cff_decoder_parse_charstrings) <cff_op_endchar>: Call hinter->apply
with decoder->hint_mode instead of builder->hint_flags.
* src/psaux/t1decode.c (t1_decoder_init): Updated.

* src/base/ftstroker.c (ft_stroke_border_export): s/index/idx/.

* src/sfnt/sfobjs.c (sfnt_load_face): Commented out code which
increased root->height by 15% if the line gap was zero.  There exist
fonts (containing e.g. form drawing characters) which intentionally
have a zero line gap value.
2003-06-03 11:51:43 +00:00
Werner Lemberg f35ff80132 * src/cff/cffobjs.c (cff_face_init): Use symbolic names for
Adobe specific encoding IDs (there was a wrong EID value for custom
encoding).

* src/cff/cffcmap.h (CFF_CMapStdRec): Remove `count'.
* src/cff/cffcmap.c (cff_cmap_encoding_init,
cff_cmap_encoding_done): Updated.
(cff_cmap_encoding_char_index, cff_cmap_encoding_char_next): Use
256 as limit for character code.
2003-06-02 21:58:05 +00:00
Werner Lemberg e20ab691c3 * src/winfonts/winfnt.c (FNT_Load_Glyph): Revert change from
2003-03-20.
2003-06-02 07:24:33 +00:00
Werner Lemberg 65ba724b66 Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.

* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.

* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.

* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers.  Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.

* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers.  Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.

* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers.  Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.

* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.

* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 09:12:50 +00:00
Werner Lemberg 282637f6a5 * include/freetype/config/ftstdlib.h (ft_strcat): New wrapper macro
for strcat.

* src/base/ftmac.c (create_lwfn_name): s/isupper/ft_isupper/.
(parse_font): s/memcpy/ft_memcpy/.
(is_dfont) [TARGET_API_MAC_CARBON]: s/memcmp/ft_memcmp/.
* src/base/ftobjs.c (load_mac_face) [FT_MACINTOSH]:
s/strlen/ft_strlen/.
s/strcat/ft_strcat/.
s/strcpy/ft_strcpy/.
* src/gzip/zutil.h: s/memset/ft_memset/.
s/memcmp/ft_memcmp/.

* src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfdriver.c
(PCF_Face_Init): Test for charset registry case-insensitively.

* t1load.c (parse_blend_axis_types): Fix compiler warning.

* descrip.mms: Removed.  Now created by...

* vms_make.com: New file.
2003-05-21 07:39:42 +00:00
Werner Lemberg 77c34b8264 * t1load.c (parse_blend_axis_types): Fix compiler warning.
* src/gzip/ftgzip.c (ft_gzip_file_io): Avoid zero value of `delta'
to prevent infinite loop.

* docs/VERSION.DLL: Provide better autoconf snippet to check
FreeType version.

* src/base/ftobjs.c (open_face): Free `internal' not
`face->internal' in case of error to avoid possible segfault.

* src/pshinter/pshalgo3.c (ps3_hints_apply): Check whether we
actually have an outline.
2003-05-20 22:06:38 +00:00
Werner Lemberg c98501b042 Add comment to #ifdef section in #ifndef. 2003-05-19 20:34:42 +00:00
Werner Lemberg 51daa4feb1 * src/raster/ftraster.c (Insert_Y_Turn): Fix overflow test.
* include/freetype/config/ftoption.h [FT_CONFIG_OPTION_MAC_FONTS]:
New macro.
* src/base/ftobjs.c: Use it to control mac font support on non-mac
platforms.

Implement partial support of Mac fonts on non-Mac platforms.

* src/base/ftobjs.c (memory_stream_close, new_memory_stream,
open_face_from_buffer, Mac_Read_POST_Resource,
Mac_Read_sfnt_Resource, IsMacResource, IsMacBinary, load_mac_face)
[!FT_MACINTOSH]: New functions.
(FT_Open_Face) [!FT_MACINTOSH]: Use load_mac_face.

* src/base/ftobjs.c (FT_Load_Glyph): Scale linear advance width only
if FT_FACE_FLAG_SCALABLE is set (otherwise we have a division by
zero since FNT and friends don't define `face->units_per_EM').
2003-05-18 22:40:11 +00:00
Werner Lemberg 2cba64d30d * src/base/ftobjs.c (FT_Load_Glyph): Fix boundary check for
`glyph_index'.
2003-04-28 08:51:07 +00:00
Werner Lemberg 428c2e4f62 * src/bdf/bdflib.c (hash_bucket, hash_lookup): Use `const' for first
argument.
(bdf_get_font_property): Use `const' for third argument.
Updated all callers.
* src/bdf/bdfdrivr.c (BDF_Face_Init): Set pixel width and height
similar to the PCF driver.
* src/bdf/bdf.h (_hashnode): Use `const' for `key'.
Updated.

* src/gzip/ftgzip.c: C++ doesn't like that the array `inflate_mask'
is declared twice.  It is perhaps better to modify the zlip source
files directly instead of this hack.
(zcalloc, zfree, ft_gzip_stream_close, ft_gzip_stream_io): Add casts
to make build with g++ successful.
2003-04-25 05:35:04 +00:00
Werner Lemberg 319c00d7d6 Fixing bugs reported by Nelson Beebe.
* src/base/ftstroker.c (FT_Stroker_ParseOutline): Remove unused
variable `in_path'.

* src/base/ftobjs (ft_glyphslot_set_bitmap): Change type of
second argument to `FT_Byte*'.
* include/freetype/internal/ftobjs.h: Updated.

* src/bdf/bdflib.c (_bdf_readstream): Remove unused variable `res'.
(_bdf_parse_glyphs): Remove unused variable `next'.
Mark `call_data' as unused.

* src/cache/ftlru.c (FT_LruList_Lookup): Remove unused variable
`plast'.

* src/pcf/pcfread.c (pcf_seek_to_table_type): Slight recoding to
actually use `error'.
(pcf_load_font): Remove unused variable `avgw'.

* src/pfr/pfrobjs.c (pfr_face_get_kerning): Change return type
to `void'.
Mark `error' as unused.
* src/pfr/pfrobjs.h: Updated.
* src/pfr/pfrdrivr.c (pfr_get_kerning): Updated.

* src/sfnt/ttload.c (sfnt_dir_check): Remove unused variable
`format_tag'.

* src/sfnt/ttcmap0.c (tt_cmap6_validate, tt_cmap10_validate): Remove
unused variable `start'.
(tt_cmap10_char_next): Remove unused variable `result'

* src/sfnt/sfobjs.c (tt_face_get_name): Mark `error' as unused.

* src/sfnt/sfdriver.c (get_sfnt_postscript_name): Mark `error' as
unused.

* src/type1/t1objs.c (T1_Face_Init): Remove unused variable
`pshinter'.

* src/type1/t1gload.c (T1_Load_Glyph): Use `glyph_data_loaded'
only for FT_CONFIG_OPTION_INCREMENTAL.
2003-04-23 19:48:24 +00:00
Werner Lemberg c8c6bf5c63 Cleanups; adding some copyrights; formatting. 2003-04-23 05:38:13 +00:00
David Turner 5158fbc03d * README: udpated
* README.UNX: removed (now replaced by docs/INSTALL.UNX)

   * src/pshinter/pshalgo3.c: the hinter now performs as in 2.1.3 and
   will ignore stem quantization only when FT_LOAD_TARGET_SMOOTH is used

   * src/base/ftobjs.c: changed the default computations to include rounding
   in all cases, this is required to provide accurate kerning data when
   native TrueType hinting is enabled.

   * src/type1/t1load.c: the Type 1 loader now accepts more general names
   according to the Postscript spec (the previous one was too restrictive)
2003-03-27 21:35:44 +00:00
David Turner 66cbc20978 * docs/*: serious rewriting of the documentation
* include/freetype/internal/ftobjs.h, src/base/ftobjs.c, src/bdf/bdfdrivr.c,
    src/pcf/pcfdriver.c, src/pfr/pfrsbit.c, src/sfnt/ttsbit.c,
    src/type42/t42objs.c, src/winfonts/winfnt.c: introduced three new functions
    to deal with glyph bitmaps within FT_GlyphSlot objects. these are:

      ft_glyphslot_free_bitmap
      ft_glyphslot_alloc_bitmap
      ft_glyphslot_set_bitmap

    these are much more convenient to use than managing the FT_GLYPH_OWN_BITMAP
    flag manually. the font drivers have been modified to use them as well.

    * src/cache/ftlru.c: fixed an invalid assertion check
2003-03-20 07:04:40 +00:00
David Turner ae26c684db * src/cache/ftccmap.c: the cmap cache now supports UCS-4 charmaps
when available in Asian fonts

    * src/sfnt/ttload.c, src/base/ftobjs.c: changed "asian" to "Asian" in
    comments

    * src/truetype/ttdriver.c (Set_Char_Sizes): fixed a rounding bug when
    computing the scale factors for a given character size in points with
    resolution.
2003-02-25 20:37:50 +00:00
David Turner ba4511b807 * src/truetype/ttdriver.c, src/truetype/ttobjs.h, src/truetype/ttobjs.c,
src/truetype/ttinterp.c, src/base/ftobjs.c: fixing the slight distortion
    problem that occured due to the latest auto-hinter changes
2003-02-18 22:25:22 +00:00
David Turner 4bdf4350f2 various improvements for 2.1.4. see ChangeLog, I've got problems with
copy & paste on my desktop !!
2003-01-30 23:24:18 +00:00
David Turner 6453a819e8 * src/base/ftobjs.c (find_unicode_charmap): fixed the error code
returned when the font doesn't contain a Unicode charmap. This
        allows FT2 to load "symbol.ttf" and a few others correctly since
        the last release
2003-01-08 09:28:34 +00:00
David Turner c528f6fa41 * src/base/ftobjs.c (find_unicode_charmap): added some comments to
better explain what's happening there

        * src/base/ftobjs.c (open_face): included Graham Asher's fix to
        prevent faces without Unicode charmaps from loading
2002-12-18 22:43:07 +00:00
David Turner 621e488622 2002-12-16 David Turner <david@freetype.org>
* docs/VERSION.DLL: updating document to better explain the differences between
        the three version numbers being used on Unix, as well as provide the AutoConf
        fragment provided by Lars Clausen

        * src/smooth/ftgrays.c (gray_render_conic): fixed small bug that
        prevented bezier arcs with negative vertical coordinates to be rendered
        appropriately


2002-11-27  Vincent Caron <v.caron@zerodeux.net>

        * builds/unix/unix-def.in, builds/unix/freetype-config.in,
        builds/unix/configure.ac, src/gzip/rules.mk, src/gzip/ftgzip.c:
        adding support for system zlib installations when available on the
        target platform (Unix only)
2002-12-16 21:51:24 +00:00
Antoine Leca c96f69dfaa * src/base/ftobjs.c: modified the logic to get Unicode charmaps.
Now it loads UCS-4 charmaps when there is one.
* src/base/ftobjs.c (find_unicode_charmap): new function.
* src/base/ftobjs.c (open_face): refer to the above one.
* src/base/ftobjs.c (FT_Select_Charmap): idem.
2002-12-03 00:39:16 +00:00
David Turner 3249c62523 * include/freetype/internal/internal.h, include/freetype/ftpfr.h,
src/base/ftpfr.c, src/base/Jamfile, src/descrip.mms, src/rules.mk,
        src/pfr/pfrdrivr.c, src/pfr/pfrobjs.c, src/pfr/pfsobjs.h:

        added PFR-specific public API. Fixed the kerning retrievel routine
        (it returned invalid values when the outline and metrics resolution
        differ)

        * src/base/ftsynth.c: fixed the synthetic emboldener. at last.

        * src/base/ftobjs.c: small internal fix to better support
        bitmap-based font formats
2002-10-31 08:30:19 +00:00
Werner Lemberg eacb9306c0 Formatting; adding file headers. 2002-10-07 10:12:43 +00:00
Werner Lemberg c4c373cee5 * include/freetype/freetype.h (FT_Open_Face): Use `const' for `args'
(suggested by Graham).
* src/base/ftobjs.c (FT_Open_Face): Updated.
(ft_input_stream_new): Ditto.
2002-10-07 09:15:20 +00:00
David Turner 80171e06dd * src/pfr/pfrsbit.h, src/pfr/pfrsbit.c, src/pfr/pfrload.c,
src/pfr/pfrgload.c, src/pfr/pfrobjs.c, src/pfr/pfrtypes.h,
        Jamfile, src/base/ftobjs.c: adding support for embedded bitmaps to
        the PFR driver, and rewriting its kerning loader / handler to use all
        kerning pairs in a physical font (and not just the first item).

        * src/tools/docmaker/content.py, src/tools/docmaker/sources.py,
        src/tools/docmaker/tohtml.py: fixing a few nasty bugs

        * src/sfnt/ttcmap0.c: the validator for format 4 sub-tables is
        now capable of dealing with invalid "length" fields at the start
        of the sub-table. This allows fonts like "mg______.ttf" (i.e.
        Marriage) to return accurate charmaps.
2002-10-05 14:57:03 +00:00
Werner Lemberg 68e9f92710 * src/sfnt/ttpost.c (load_post_names, tt_face_free_ps_names,
tt_face_get_ps_name): Replace switch statement with if clauses to
make it more portable.

* src/cff/cffobjs.c (cff_face_init): Ditto.

* include/freetype/ftmodule.h (FT_Module_Class): Use `FT_Long' for
`module_size'.
* include/freetype/ftrender.h (FT_Glyph_Class_): Use `FT_Long' for
`glyph_size'.

* src/base/ftobjs.c (FT_Render_Glyph): Change second parameter to
`FT_Render_Mode'.
(FT_Render_Glyph_Internal): Change third parameter to
`FT_Render_Mode'.
* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Change second parameter
to `FT_Render_Mode'.

* src/raster/ftrend1.c (ft_raster1_render): Change third parameter
to `FT_Render_Mode'.
* src/smooth/ftsmooth.c (ft_smooth_render, ft_smooth_render_lcd,
ft_smooth_render_lcd_v): Ditto.
(ft_smooth_render_generic): Change third and fifth parameter to
`FT_Render_Mode'.

* include/freetype/freetype.h, include/freetype/internal/ftobjs.h,
include/freetype/ftglyph.h: Updated.

* src/cff/cffdrivr.c (Load_Glyph), src/pcf/pcfdriver.c
(PCF_Glyph_Load), src/pfr/pfrobjs.c (pfr_slot_load),
src/winfonts/winfnt.c (FNT_Load_Glyph), src/t42/t42objs.c
(T42_GlyphSlot_Load), src/bdf/bdfdrivr.c (BDF_Glyph_Load): Change
fourth parameter to `FT_Int32'.

* src/pfr/pfrobjs.c (pfr_face_init): Add two missing parameters
and declare them as unused.

* src/cid/cidparse.h (CID_Parser): Use FT_Long for `postscript_len'.

* src/psnames/psnames.h (PS_Unicode_Value_Func): Change return
value to FT_UInt32.
* src/psnames/psmodule.c (ps_unicode_value, ps_build_unicode_table):
Updated accordingly.

* src/cff/cffdrivr.c (Get_Kerning): Use FT_Long for `middle'.
(cff_get_glyph_name): Use cast for result of ft_strlen.
* src/cff/cffparse.c (cff_parse_real): User cast for assigning
`exp'.
* src/cff/cffload.c (cff_index_get_pointers): Use FT_ULong for
some local variables.
(cff_charset_load, cff_encoding_load): Use casts to FT_UInt for some
switch statements.
(cff_font_load): Use cast in call to CFF_Load_FD_Select.
* src/cff/cffobjs.c (cff_size_init): Use more casts.
(cff_face_init): Use FT_Int32 for `flags'.
* src/cff/cffgload.c (cff_operator_seac): Use cast for assigning
`adx' and `ady'.
(cff_decoder_parse_charstrings): Use FT_ULong for third parameter.
Use more casts.
* src/cff/cffcmap.c (cff_cmap_unicode_init): Use cast for `count'.

* src/cid/cidload.c (cid_read_subrs): Use FT_ULong for `len'.
* src/cid/cidgload.c (cid_load_glyph): Add missing cast for
`cid_get_offset'.

* src/psaux/t1decode.c (t1_decoder_parse_charstrings) <18>: Use
cast for `num_points'.
(t1_decoder_init): Use cast for assigning `decoder->num_glyphs'.

* src/base/ftdebug.c (ft_debug_init): Use FT_Int.
* include/freetype/internal/ftdriver.h (FT_Slot_LoadFunc): Use
`FT_Int32' for fourth parameter.
* src/base/ftobjs.c (open_face): Use cast for calling
clazz->init_face.

* src/raster/ftraster.c (Set_High_Precision): Use `1' instead of
`1L'.
(Finalize_Profile_Table, Line_Up, ft_black_init): Use casts.
* src/raster/ftrend1.c (ft_raster1_render): Ditto.

* src/sfnt/sfnt_dir_check: Compare `magic' with unsigned long
constant.

* builds/amiga/include/freetype/config/ftmodule.h: Updated.
2002-09-27 11:09:23 +00:00
David Turner d48575ee3a * src/base/ftobjs.c (FT_Library_Version): bugfix 2002-09-18 23:18:36 +00:00
David Turner 00d9f40cf7 * src/smooth/ftsmooth.c, src/base/ftobjs.c,
include/freetype/config/ftmodule.h: updated to correctly support
        sub-pixel rendering

        * include/freetype/cache/ftcimage.h, include/freetype/cache/ftcsbits.h,
        src/cache/ftcimage.c, src/cache/ftcsbit.c: updated to support sub-pixel
        rendering correctly. Definition of FTC_ImageTypeRec that replaces the
        obsolete FTC_ImageDesc, and has slightly different fields. The
        image type is now determined directly by "load_flags" values.

        * src/autohint/ahtypes.h, src/autohint/ahhint.c,
        src/pshinter/pshalgo3.c, src/pshinter/pshalgo3.h: various enhancements
        to the automatic and Postscript hinters !! and sub-pixel hinting now
        works correctly (see demo programs)
2002-09-08 21:29:11 +00:00
Werner Lemberg 6b5c669b7b * src/cid/cidobjs.c (CID_Size_Init): Renamed to...
(cid_size_init): This.
* src/psaux/psobjs.c (T1_Builder_Add_Point1): Renamed to...
(t1_builder_add_point1): This.

Updated all affected code.

* src/pshinter/pshalgo3.c (psh3_hint_align): Fix compiler warnings.
* src/type1/t1gload.c (T1_Compute_Max_Advance): Ditto.

Formatting, minor doc fixes.
2002-09-05 15:10:54 +00:00
David Turner b08fe2dc7a * massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
    transformations of the sources:

      - trying to convert all enums and constants to CAPITALIZED_STYLE, with
        #define definitions like

          #define  my_old_constants   MY_NEW_CONSTANT

      - big, big update of the documentation comments

    * include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
    include/freetype/ftimage.h: adding support for LCD-optimized rendering
    though the new constants/enums:

      FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
      FT_PIXEL_MODE_LCD,  FT_PIXEL_MODE_LCD_V

    this is still work in progress, don't expect everything to work correctly
    though most of the features have been implemented.

    * adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
    targets:

      FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
      FT_LOAD_TARGET_MONO   :: monochrome bitmaps
      FT_LOAD_TARGET_LCD    :: horizontal RGB/BGR decimated hinting & rendering
      FT_LOAD_TARGET_LCD_V  :: vertical RGB/BGR decimated hinting & rendering

    note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
    behaviour of the font engine is _unchanged_.
2002-08-27 20:20:29 +00:00
David Turner 21f433cec9 * src/pshinter/pshalgo3.c, src/base/ftobjs.c, src/base/ftobject.c,
src/autohint/ahglyph.c, include/freetype/freetype.h: fixing typos
        and removing compiler warnings
2002-08-21 22:06:41 +00:00
David Turner f467e6a93f * include/freetype/freetype.h, src/base/ftobjs.c: changing the type
of the "load_flags" parameter of FT_Load_Glyph and FT_Load_Char from
        "FT_Int" to "FT_Int32", this in order to support more options.

        this should only break binary and/or source compatibility on
        16-bit platforms (Atari?)
2002-08-21 21:39:28 +00:00
Werner Lemberg 3c403e4c17 Some formatting.
* src/cff/cffcmap.c: Remove compiler warnings.
* src/cache/ftccache.c, src/cache/ftccache.i,
src/pfr/pfrload.c, src/pfr/pfrgload.c: s/index/idx/.
* src/cff/cffload.c: s/select/fdselect/.
* src/raster/ftraster.c: s/wait/waiting/.
2002-08-06 21:47:40 +00:00
Graham Asher ce12182cfc Modified incremental loading interface to be closer to David Turner's
preferences. The header freetype.h is not now affected, the interface is
specified via an FT_Parameter, the pointer to the interface is hidden in an
internal part of the face record, and all the definitions are in ftincrem.h.
2002-08-01 15:29:17 +00:00
Werner Lemberg b3d5e9cf03 s/ft_memset/FT_MEM_SET/.
s/FT_MEM_SET/FT_MEM_ZERO/ where appropriate.
2002-07-28 05:05:24 +00:00
Werner Lemberg 7f74a52a21 Fixing ChangeLog entries.
Some formatting.

* src/truetype/ttgload.c (load_truetype_glyph)
[FT_CONFIG_OPTION_INCREMENTAL]: s/memset/ft_memset/.

* src/autohint/ahhint.c (ah_hint_edges_3): Fix compiler warning.
* src/cff/cffload.c (cff_encoding_load): Remove `memory' variable.
* src/cff/cffcmap.c (cff_cmap_encoding_init): Remove `psnames'
variable.
* src/truetype/ttgload.c (load_truetype_glyph): Remove statement
without effect.
* src/truetype/ttdriver (Get_Char_Index, Get_Next_Char): Removed.
2002-07-26 09:09:10 +00:00
Graham Asher d53cf1df31 Added incremental loading capability to FT_Open_Face.
Not implemented for any drivers yet.
2002-07-18 15:04:29 +00:00
David Turner fed59b7cc2 * src/sfnt/ttload.c (TT_Load_SFNT_Header): fixed a recent bug that prevented
OpenType fonts to be recognized by FreeType
2002-07-17 22:51:06 +00:00
David Turner 3e19d85dd4 * include/freetype/config/ftoption.h, include/freetype/internal/tttypes.h,
src/base/ftobjs.c, src/bdf/bdfdrivr.c, src/cff/cffobjs.c,
    src/pcf/pcfdrivr.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
    src/sfnt/ttcmap0.h, src/sfnt/ttload.c, src/type1/t1objs.c,
    src/type42/t42objs.c, src/winfonts/winfnt.c: code cleanup,
    FT_CONFIG_OPTION_USE_CMAPS is now the default
2002-07-17 21:52:20 +00:00
David Turner 27c322e983 * include/freetype/freetype.h, src/base/ftobjs.h,
freetype/internal/ftobjs.h, freetype/internal/psaux.h,
    freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
    src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c,
    src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h,
    src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags,
    and the new FT_Set_Hint_Flags high-level API
2002-07-08 22:26:11 +00:00
Werner Lemberg fd97d137e0 Fix glyph indices to make index zero always the undefined glyph.
* src/bdf/bdfdrivr.c (bdf_cmap_init): Don't decrease
cmap->num_encodings.
(bdf_cmap_char_index, bdf_cmap_char_next, BDF_Get_Char_Index):
Increase result by 1 for normal cases.
(BDF_Glyph_Load): Decrease index by 1.

* src/pcf/pcfdriver.c (pcf_cmap_char_index, pcf_cmap_char_next,
PCF_Char_Get_Index): Increase result by 1 for normal cases.
(PCF_Glyph_Load): Decrease index by 1.
* src/pcf/pcfread.c (pcf_get_encodings): Don't decrease j for
allocating `encoding'.

* src/base/ftobjs.c (FT_Load_Glyph, FT_Get_Glyph_Name): Fix
bounding tests.
2002-06-16 01:14:16 +00:00
David Turner 25a6e3a167 * include/freetype/internal/ftobjs.h, src/autohint/ahglyph.c,
src/base/ftobjs.c, src/objs/fttype1.c, src/sfnt/ttcmap0.c,
    src/smooth/ftgrays.c: changed uses of "setjmp" and "longjmp"
    to "ft_setjmp" and "ft_lonjmp". Removed direct references to
    <stdio.h> and <setjmp.h> when appropriate, to eventually replace
    them with a FT_CONFIG_STANDARD_LIBRARY_H. Useful for the XFree86
    Font Server backend based on FT2.
2002-06-10 23:03:35 +00:00
David Turner 7504e48eaa * src/base/ftobjs.c (FT_Render_Glyph_Internal): changed definition
from FT_EXPORT_DEF to FT_BASE_DEF
2002-06-07 07:24:55 +00:00
Werner Lemberg 4d631e447f Fix comment. 2002-05-27 13:02:37 +00:00
Werner Lemberg 9ca7a15727 * src/base/ftmac.c (p2c_str): Removed.
(file_spec_from_path) [TARGET_API_MAC_CARBON]: Added support for
OS X.
(is_dfont) [TARGET_API_MAC_CARBON]: Define only for OS X.
Handle `nameLen' <= 6 also.
(parse_fond): Remove unused variable `name_table'.
Use functionality of old p2c_str directly.
Add safety checks.
(read_lwfn): Initialize `size_p'.
Check for size_p == NULL.
(new_memory_stream, open_face_from_buffer): Updated to FreeType 2.1.
(FT_New_Face_From_LWFN): Remove unused variable `memory'.
Remove some dead code.
(FT_New_Face_From_SFNT): Remove unused variable `stream'.
(FT_New_Face_From_dfont) [TARGET_API_MAC_CARBON]: Define only for
OS X.
(FT_New_Face_From_FOND): Remove unused variable `error'.
(ResourceForkSize): New function.
(FT_New_Face): Use it.
Handle empty resource forks.
Conditionalize some code for OS X.
Add code to call normal loader as a fallback.

Some more variable renames to avoid troubles on the Mac.

* src/raster/ftraster.c:
s/Unknown|Ascending|Descending|Flat/\1_State/.
* src/smooth/ftgrays.c: s/TScan/TCoord/.

Other changes for the Mac.

* include/freetype/config/ftconfig.h: Define FT_MACINTOSH for
Mac platforms.
* src/base/ftobjs.c: s/macintosh/FT_MACINTOSH/.

* src/raster/ftrend1.c (ft_raster1_render): Make `pitch' always
an even number.
2002-04-30 14:26:49 +00:00
David Turner f574960899 * src/base/ftobjs.c, builds/win32/ftdebug.c,
builds/amiga/src/base/ftdebug.c :

            2.1.0 couldn't be linked against applications in Win32 and
            Amiga builds due to changes to "src/base/ftdebug.c" that
            were not properly propagated to "builds/win32" and
            "builds/amiga"..

            this has been fixed. We'll probably make 2.1.1 real
            soon now..


        * include/freetype/internal/ftobject.h,
          include/freetype/internal/ftexcept.h,
          include/freetype/ftsysmem.h,
          include/freetype/ftsysio.h,
          src/base/ftsysmem.c,
          src/base/ftsysio.c:

            adding new experimental files for 2.1.1 (or 2.1.2)
2002-04-18 10:07:26 +00:00
David Turner d15bc0d13a * README.UNX: updated the Unix-specific quick-compilation guide to
warn about the GNU Make requirement at compile time..

        * include/freetype/config/ftstdlib.h,
          include/freetype/config/ftconfig.h,
          include/freetype/config/ftheader.h,
          include/freetype/internal/ftmemory.h,
          include/freetype/internal/ftobjs.h,

          src/autohint/ahoptim.c,

          src/base/ftdbgmem.c, src/base/ftdebug.c,
          src/base/ftmac.c,    src/base/ftobjs.c,
          src/base/ftsystem.c,

          src/cache/ftcimage.c, src/cache/ftcsbits.c,

          src/cff/cffdriver.c, src/cff/cffload.c, src/cff/cffobjs.c,

          src/cid/cidload.c, src/cid/cidparse.c, src/cid/cidriver.c,

          src/pcf/pcfdriver.c, src/pcf/pcfread.c,

          src/psaux/t1cmap.c, src/psaux/t1decode.c,

          src/pshinter/pshalgo1.c, src/pshinter/pshalgo2.c,
          src/pshinter/pshrec.c,

          src/psnames/psmodule.c,

          src/raster/ftraster.c,

          src/sfnt/sfdriver.c, src/sfnt/ttload.c, src/sfnt/ttpost.c,

          src/smooth/ftgrays.c,

          src/type1/t1afm.c,  src/type1/t1driver.c, src/type1/t1gload.c,
          src/type1/t1load.c, src/type1/t1objs.c,   src/type1/t1parse.c:

            added the new configuration file "ftstdlib.h" used to define
            aliases for all ISO C library functions used by the engine
            (e.g. strlen, qsort, setjmp, etc...)

            this eases the porting of FreeType 2 to exotic environments like
            XFree86 modules/extensions..

            also removed many #include <string.h>, #include <stdlib.h>, etc...
            from the engine's sources where they're not needed..
2002-04-12 09:31:48 +00:00
Werner Lemberg f8ba2005ab * include/freetype/t1tables.h (t1_blend_max): Fix typo.
* src/base/ftstream.c: Simplify FT_ERROR calls.

formatting, copyright update
2002-03-30 13:16:35 +00:00
David Turner 2ded2c1d30 * src/base/ftobjs.c, src/sfnt/ttcmap0.c, src/type1/t1objs.c:
various fixes to make the FT_CMaps support work correctly
          (more tests are still needed)
2002-03-22 22:37:40 +00:00
David Turner ed54f28e4a various fixes to the FT_CMaps support 2002-03-22 17:09:52 +00:00
David Turner e459d742e6 * include/freetype/internal/ftmemory.h, and a lot of other files !!:
changed the names of memory macros. Examples:

              MEM_Set   => FT_MEM_SET
              MEM_Copy  => FT_MEM_COPY
              MEM_Move  => FT_MEM_MOVE

              ALLOC     => FT_ALLOC
              FREE      => FT_FREE
              REALLOC   = >FT_REALLOC

            FT_NEW was introduced to allocate a new object from a _typed_
            pointer..

            note that ALLOC_ARRAY and REALLOC_ARRAY have been replaced
            by FT_NEW_ARRAY and FT_RENEW_ARRAY which take _typed_ pointer
            arguments.

            This results in _lots_ of sources being changed, but makes the
            code more generic and less error-prone..
2002-03-22 13:52:37 +00:00
David Turner e2f4e52ac8 * src/base/ftobjs.c (FT_Get_Next_Char): updated to new FT_CMap
definitions
2002-03-21 15:00:13 +00:00
David Turner 7d3a26425b * renaming stream macros. Examples:
FILE_Skip    => FT_STREAM_SKIP
           FILE_Read    => FT_STREAM_READ
           ACCESS_Frame => FT_FRAME_ENTER
           FORGET_Frame => FT_FRAME_EXIT
           etc...
2002-03-20 10:49:31 +00:00
David Turner b93b0f5f7d * include/freetype/internal/ftobjs.h,
src/base/ftapi.c, src/base/ftobjs.c: updated a few face method
          definitions:

            FT_PSName_Requester     => FT_Face_GetPostscriptNameFunc
            FT_Glyph_Name_Requester => FT_Face_GetGlyphNameFunc
            FT_Name_Index_Requester => FT_Face_GetGlyphNameIndexFunc
2002-03-14 09:28:51 +00:00
David Turner ef3c12650e * include/freetype/internal/ftdriver.h,
include/freetype/internal/ftobjs.h,
          src/base/ftapi.c, src/base/ftobjs.c,
          src/cff/cffdrivr.c, src/cff/cffdrivr.h,
          src/cid/cidriver.c, src/cid/cidriver.h,
          src/pcf/pcfdriver.c, src/pcf/pcfdriver.h,
          src/truetype/ttdriver.c, src/truetype/ttdriver.h,
          src/type1/t1driver.c, src/type1/t1driver.h,
          src/winfonts/winfnt.c, src/winfonts/winfnt.h:
          updating the type definitions for font font drivers
2002-03-14 09:22:48 +00:00