Commit Graph

92 Commits

Author SHA1 Message Date
Werner Lemberg c52f44d4fd Whitespace. 2011-11-30 10:46:53 +01:00
Werner Lemberg f8f576d1d4 Addition to last commit. 2011-11-26 18:07:30 +01:00
Chris Liddell 8b90cf0b42 Add FT_Get_PS_Font_Value() API.
This allows a Type 1 font face to be interrogated to retrieve most
of the dictionary keys (keys not relevant to FreeType's Type 1
interpreter are not available).

* include/freetype/internal/services/svpsinfo.h
(PS_GetFontValueFunc): New typedef.
(PSInfo): Add `ps_get_font_value'.
(FT_DEFINE_SERVICE_PSINFOREC): Updated.

* include/freetype/internal/t1types.h (T1_EncodingType): Moved to...
* include/freetype/t1tables.h: Here.
(PS_Dict_Keys): New enumeration.
(FT_Get_PS_Font_Value): New declaration.

* src/base/fttype1.c (FT_Get_PS_Font_Value): New function.

* src/type1/t1driver.c (t1_ps_get_font_value): This new function
does the real job.
(t1_service_ps_info): Add it.

* src/cff/cffdrivr.c (cff_service_ps_info), src/cid/cidriver.c
(cid_service_ps_info), src/type42/t42drivr.c (t42_service_ps_info):
Updated.
2011-11-13 16:30:59 +01:00
suzuki toshiya e62c876bb0 Fix g++4.6 compiler warnings in module drivers.
The background is same with previous commit.

* src/truetype/ttgxvar.c (ft_var_readpackedpoints):
Init `points'.  (TT_Vary_Get_Glyph_Deltas): Init
`delta_xy'.  (TT_Get_MM_Var): Init `mmvar'.
* src/type1/t1load.c (T1_Get_MM_Var): Ditto.
* src/cff/cffdrivr.c (cff_ps_get_font_info): Init
`font_info'.
* src/cff/cffload.c (cff_index_get_pointers): Init `t'.
(cff_font_load): Init `sub'.
* src/cff/cffobjs.c (cff_size_init): Init `internal'.
(cff_face_init): Init `cff'.
* src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps):
Init `snaps'.
* src/pcf/pcfread.c (pcf_get_properties): Init `properties'.
(pcf_get_bitmaps): Init `offsets'.  (pcf_get_encodings):
Init `tmpEncoding'.
* src/sfnt/ttload.c (tt_face_load_gasp): Init `gaspranges'.
* src/sfnt/ttsbit.c (Load_SBit_Image): Init `components'.
* src/cache/ftcmru.c (FTC_MruList_New): Init `node'.
* src/gzip/ftgzip.c (FT_Stream_OpenGzip): Init `zip' and
`zip_buff'.
* src/lzw/ftlzw.c (FT_Stream_OpenLZW): Init `zip'.
* src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Init `zip'.
2011-06-15 02:48:33 +09:00
Werner Lemberg f765e4403c */*: Use module specific error names where appropriate. 2010-06-24 10:34:29 +02:00
Werner Lemberg 03b3da8bb6 Improve CFF string (especially glyphname) lookup performance.
We do this by avoiding memory allocation and file I/O.  This is
Savannah patch #7104.

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

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

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

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

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

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

* src/cff/cffgload.c: Don't include FT_INTERNAL_POSTSCRIPT_HINTS_H.
(cff_decoder_init, cff_decoder_prepare): Updated.
2010-03-02 13:00:55 +01:00
suzuki toshiya d9145241fe Prevent NULL pointer dereference passed to FT_Module_Requester. 2010-02-05 02:58:24 +09:00
suzuki toshiya e866cf3f55 Improve bitmap size or pixel variables for 16-bit systems. 2009-08-01 00:32:06 +09:00
suzuki toshiya 072e55233e cff: Cast the long variables to 32-bit for LP64 systems. 2009-08-01 00:30:23 +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
Oran Agra cb3b61416b Position Independent Code (PIC) support in cff driver.
* include/freetype/internal/services/svcid.h add macros to init
instances of FT_Service_CIDRec.
* include/freetype/internal/services/svpsinfo.h add macros to init
instances of FT_Service_PsInfoRec.

* src/cff/cffcmap.h declare cff_cmap_encoding_class_rec
and cff_cmap_unicode_class_rec using macros from
ftobjs.h, when FT_CONFIG_OPTION_PIC is defined create and destroy
functions will be declared.
* src/cff/cffcmap.c when FT_CONFIG_OPTION_PIC is defined
the following structs:
cff_cmap_encoding_class_rec and cff_cmap_unicode_class_rec
will have functions to init or create and destroy them
instead of being allocated in the global scope.

* src/cff/cffdrivr.h declare cff_driver_class using macros from
ftdriver.h, when FT_CONFIG_OPTION_PIC is defined create and destroy
functions will be declared.
* src/cff/cffdrivr.c when FT_CONFIG_OPTION_PIC is defined
the following structs:
cff_service_glyph_dict, cff_service_ps_info, cff_service_ps_name
cff_service_get_cmap_info, cff_service_cid_info, cff_driver_class,
and cff_services array
will have functions to init or create and destroy them
instead of being allocated in the global scope.
And macros will be used from cffpic.h in order to access them
from the pic_container.
Use macros from cffpic.h in order to access the
structs allocated in cffcmap.c

* src/cff/cffobjs.c Use macros from cffpic.h in order to access the
structs allocated in cffcmap.c

* src/cff/parser.c when FT_CONFIG_OPTION_PIC is defined
implement functions to create and destroy cff_field_handlers array
instead of being allocated in the global scope.
And macros will be used from cffpic.h in order to access it
from the pic_container.

New Files:
* src/cff/cffpic.h declare struct to hold PIC globals for cff
driver and macros to access them.
* src/cff/cffpic.c implement functions to allocate, destroy and
initialize PIC globals for cff driver.

* src/cff/cff.c add new file to build: cffpic.c.
* src/cff/jamfile add new files to FT2_MULTI build: cffpic.c.
2009-04-05 18:12:03 +03:00
Werner Lemberg 86e041b5a8 Remove redundant header inclusions.
This covers many Ghostscript Coverity issues.

* src/*: Do it.
2009-03-21 08:51:44 +01: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 07e818170f Extend CID service functions to handle CID-keyed CFFs as CID fonts.
* include/freetype/ftcid.h (FT_Get_CID_Is_Internally_CID_keyed,
FT_Get_CID_From_Glyph_Index): New functions.

* include/freetype/internal/services/svcid.h
(FT_CID_GetIsInternallyCIDKeyedFunc,
FT_CID_GetCIDFromGlyphIndexFunc): New function typedefs.
(CID Service): Use them.

* src/base/ftcid.c: Include FT_CID_H.
(FT_Get_CID_Is_Internally_CID_keyed, FT_Get_CID_From_Glyph_Index):
New functions.

* src/cff/cffdrivr.c (cff_get_is_cid, cff_get_cid_from_glyph_index):
New functions.
(cff_service_cid_info): Add them.
* src/cff/cffload.c (cff_font_load): Don't free `font->charset.sids'
-- it is needed for access as a CID-keyed font.  It gets deleted
later on.

* src/cid/cidriver.c (cid_get_is_cid, cid_get_cid_from_glyph_index):
New functions.
(cid_service_cid_info): Add them.

* docs/CHANGES: Updated.
2009-03-11 21:29:54 +00:00
David Turner 01ca4da203 Remove ABI-breaking field in public PS_InfoFontRec definition.
Instead, we define a new internal PS_FontExtraRec structure to
    hold the additionnal field, then place it in various internal
    positions of the corresponding FT_Face derived objects.
2009-03-03 13:28:59 +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
Suzuki, Toshiya (鈴木俊哉) 759c07d149 load_flags of FT_Get_Advance(), FT_Get_Advances() and backends are declared as FT_Int32 to match the flags of FT_Load_Glyph() 2009-01-09 11:11:53 +00:00
Suzuki, Toshiya (鈴木俊哉) a7c00b79e0 load_flags of FT_Get_Advance(), FT_Get_Advances() and backends are declared as FT_UInt32 for 16-bit platforms 2009-01-09 07:21:16 +00:00
Werner Lemberg 312043f41b * src/cff/cffdrivr.c (cff_get_cmap_info): Initialize `format' field.
This fixes Savannah bug #24819.

Document `format' field of TT_CMapInfo.
2008-11-12 06:29:41 +00:00
Werner Lemberg b211651ac9 * autogen.sh, builds/unix/configure.raw,
include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: Minor
beautifying.

* include/freetype/ftadvanc.h, include/freetype/ftgasp.h,
include/freetype/ftlcdfil.h: Protect against FreeType 1.
Some other minor fixes.

* devel/ftoption.h: Synchronize with
include/freetype/config/ftoption.h.

Formatting, documentation improvements.
2008-09-12 16:27:48 +00:00
David Turner 28534d616b * include/freetype/ftadvanc.h, src/base/ftadvanc.c,
include/freetype/config/ftheader.h, include/freetype/freetype.h,
    src/base/Jamfile, src/base/rules.mk, src/cff/cffdrivr.c,
    src/cff/cffgload.c, src/cff/cffgload.h, src/truetype/ttdriver.c,
    src/truetype/ttgload.h, src/truetype/ttgload.c, src/type1/t1driver.c,
    src/type1/t1gload.h, src/type1/t1gload.c:
    Add a new header named FT_ADVANCES_H declaring some new APIs
    to extract the advances of one or more glyphs without necessarily
    loading their outlines. Also provide 'fast loaders' for the
    TrueType, Type1 and CFF font drivers (more to come later)

    * autogen.sh: add checks for minimum version of the 'autotools'
    stuff.
2008-09-01 21:35:21 +00:00
Werner Lemberg 048b756389 * src/psaux/psconv.c (PS_Conv_ToFixed): Increase precision if
integer part is zero.
2008-04-13 05:55:36 +00:00
Werner Lemberg 210d61894b Fix support for subsetted CID-keyed CFFs.
* include/freetype/freetype.h (FT_FACE_FLAG_CID_KEYED,
FT_IS_CID_KEYED): New macros.

* src/cff/cffobjs.c (cff_face_init): Set number of glyphs to the
maximum CID value in CID-keyed CFFs.
Handle FT_FACE_FLAG_CID_KEYED flag.

* docs/CHANGES: Document it.


Fix CFF font matrix calculation and improve precision.

* src/cff/cffparse.c (cff_parse_real): Increase precision if integer
part is zero.
(cff_parse_font_matrix): Simplify computation of `units_per_em';
this prevents overflow also.


Support FT_Get_CID_Registry_Ordering_Supplement for PS CID fonts.

* src/cid/cidriver.c: Include FT_SERVICE_CID_H.
(cid_get_ros): New function.
(cid_service_cid_info): New service structure.
(cid_services): Register it.
2008-04-01 05:55:48 +00:00
Werner Lemberg ef915c36f4 * docs/CHANGES: Updated.
Add new service for getting the ROS from a CID font.

* include/freetype/config/ftheader.h (FT_CID_H): New macro.
* include/freetype/ftcid.h: New file.

* include/freetype/internal/ftserv.h (FT_SERVIVE_CID_H): New macro.
* include/freetype/internal/services/svcid.h: New file.

* src/base/ftcid.c: New file.

* src/cff/cffdrivr.c: Include FT_SERVICE_CID_H.
(cff_get_ros): New function.
(cff_service_cid_info): New service structure.
(cff_services): Register it.

* src/cff/cffload.c (cff_font_done): Free registry and ordering.

* src/cff/cfftypes.h (CFF_FontRec): Add `registry' and `ordering'.

* modules.cfg (BASE_EXTENSIONS): Add ftcid.c.
2007-07-16 20:46:05 +00:00
Werner Lemberg 2f10956744 Add support for postscript name service to CFF driver.
* src/cff/cffdrivr.c: Include FT_SERVICE_POSTSCRIPT_NAME_H.
(cff_get_ps_name): New function.
(cff_service_ps_name): New service structure.
(cff_services): Register it.
2007-07-11 05:32:00 +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
David Turner c0f9c4aadd introduce ft_mem_dup, ft_mem_strdup and ft_mem_strcpyn, and the corresponding
macros to use them (e.g. FT_STRDUP, FT_DUP and FT_STRCPYN)

modify the code to use them instead of raw mallocs/strcpy
2007-02-12 14:55:03 +00:00
Werner Lemberg 8f47453b6a * src/cff/cffdrivr.c (cff_get_name_index): Protect against NULL
pointer.
2007-02-07 08:31:01 +00:00
Werner Lemberg b4142d5126 Whitespace and spelling fixes from Alexei.
Formatting, copyright years.
2007-01-17 12:45:26 +00:00
David Turner 2212272992 * src/autofit/aflatin.c, src/cff/cffdriver.c, src/truetype/ttobjs.c,
src/truetype/ttinterp.c: fixing compiler warnings
2007-01-16 20:06:44 +00:00
Werner Lemberg ac250b228a Add FT_Get_PS_Font_Info interface to CFF driver.
* src/cff/cfftypes.h: Include FT_TYPE1_TABLES_H.
(CFF_FontRec): Add `font_info' field.

* src/cff/cffload.c: Include FT_TYPE1_TABLES_H.
(cff_font_done): Free font->font_info if necessary.

* src/cff/cffdrvr.c (cff_ps_get_font_info): New function.
(cff_service_ps_info): Register cff_ps_get_font_info.
2007-01-13 14:01:36 +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 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 f13516c832 Various fixes for C and C++ compiling.
* src/autofit/*: Add copyright messages.
  Formatting.

* src/autofit/afhints.c (af_glyph_hints_done): Don't use
`AF_Dimension' but `int' for loop counter.

* src/autofit/aflatin.c (af_latin_metrics_init_widths): Don't use
`AF_Dimension' but `int' for loop counter.
Use proper enumeration value for `render_mode'.
(af_latin_metrics_scale_dim): Don't shadow variables.
(af_latin_hints_compute_segments): Use proper cast for `major_dir'
and `segment_dir'.
(af_latin_align_linked_edge, af_latin_hint_edges): Fix arguments of call to
`af_latin_compute_stem_width'.
(af_latin_hints_apply): Don't use `AF_Dimension' but `int' for loop
counter.

* src/base/ftdbgmem.c (ft_mem_table_get_source, FT_DumpMemory): Use
proper cast for memory allocation.

* src/cff/cffdrivr.c (cff_get_kerning): Use proper cast for
initialization of `sfnt'.

* src/sfnt/sfdriver.c: Include `ttkern.h'.

* src/sfnt/ttkern.c (tt_face_get_kerning): Don't shadow variables.

* src/truetype/ttgload.c: Include `ttpload.h'.

* src/truetype/ttpload.c (tt_face_load_loca) [FT_OPTIMIZE_MEMORY]:
Remove redundant variable.
2005-03-03 17:09:08 +00:00
Werner Lemberg e793092d0a Formatting.
* src/truetype/ttpload.c (tt_face_load_loca): Fix typo.

* src/sfnt/ttkern.c: Include `ttkern.h'.
(FT_COMPONENT): Updated.

* include/freetype/internal/fttrace.h: Add entry for `ttkern'.

* src/sfnt/ttsbit0.c: s/FT_Err_/SFNT_Err_/.
Decorate constants with `U' and `L' where necessary.

* src/sfnt/ttcmap.c (tt_cmap4_next): Remove unused variable.
2005-03-01 02:13:50 +00:00
David Turner e5680279b2 * many, many files: several memory optimizations were implemented to
drastically reduce the heap usage of FreeType, especially in the case
  of memory-mapped files. The idea is to avoid loading and decoding tables
  in the heap, and instead access the raw data whenever possible (i.e.
  when it doesn't compromise performance).

  This had several impacts: first, opening vera.ttf uses a ridiculous amount
  of memory (when the FT_Library footprint is accounted for), until you start
  loading glyphs. Even then, you'll save at least 20 Kb compared to the non
  optimized case. performance of various operations, including open/close
  has also been dramatically improved.

  More optimisations to come. The auto-hinter eats memory like crazy? This
  must be stopped...
2005-02-26 00:12:04 +00:00
Werner Lemberg 3605e470c1 Add new function FT_Get_PS_Font_Private().
* include/freetype/internal/services/svpsinfo.h
(PS_GetFontPrivateFunc): New service function.

* include/freetype/t1tables.h, src/base/fttype1.c
(FT_Get_PS_Font_Private): New function.

* src/type1/t1driver.c (t1_ps_get_font_private): New function.
(t1_service_ps_info): Updated.

* src/cff/cffdrivr.c (cff_service_ps_info): Updated.
* src/cid/cidriver.c (cid_service_ps_info): Updated.
* src/type42/t42drivr.c (t42_ps_get_font_private): New function.
(t42_service_ps_info): Updated.

* src/type42/t42parse.c (t42_parse_dict): Remove compiler warning.
2004-11-12 07:02:45 +00:00
Werner Lemberg 2b54eba36b * src/cff/cffobjs.c (cff_size_done, cff_size_init, cff_size_reset,
cff_slot_done, cff_slot_init, cff_face_init, cff_face_done): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.

* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.

* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 07:08:14 +00:00
Werner Lemberg 3bcad43998 * src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.

* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.

* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.

* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.

* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.

* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.

* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.

* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 11:48:35 +00:00
Werner Lemberg bfb712fb36 Add embedded bitmap support to CFF driver.
* src/cff/cffobjs.h (CFF_SizeRec): New structure.

* src/cff/cffgload.c (cff_builder_init): Updated.
(cff_slot_load): Updated.
[TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Load sbit.

* src/cff/cffobjs.c (sbit_size_reset)
[TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: New function.
(cff_size_get_globals_funcs, cff_size_done, cff_size_init): Updated.
(cff_size_reset): Updated.
[TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Call sbit_size_reset.

* src/cff/cffdrivr.c (Load_Glyph): Updated.
(cff_driver_class): Use CFF_SizeRec.

* docs/CHANGES: Updated.
2004-03-03 08:21:12 +00:00
Werner Lemberg 8f1edf742e * src/base/ftstroke.c (FT_Glyph_StrokeBorder): Fix enum handling.
* src/cff/cffdrivr.c (cff_get_cmap_info): Remove compiler warning.
2004-02-20 01:39:05 +00:00
Werner Lemberg 6cda9c489d * include/freetype/ftcache.h: Delete duplicated definition of
FTC_FaceID.

* src/cff/cffdrivr.c (cff_get_cmap_info): Call sfnt module's TT CMap
Info service function if the cmap comes from sfnt.  Return 0 if the
cmap is sythesized in cff module.

Formatting; updating copyright.
2004-01-22 09:07:12 +00:00
Werner Lemberg 3d780173fe Make `FT_Get_CMap_Language_ID' work with CFF. Bug reported by
Steve Hartwell <shspamsink@comcast.net>.

* src/cff/cffdrivr.c: Include FT_SERVICE_TT_CMAP_H.
(cff_services): Added an entry for FT_SERVICE_ID_TT_CMAP.
(cff_get_cmap_info): New function.
(cff_service_get_cmap_info) New entry for cff_services.

* src/sfnt/ttcmap0.c: Exit loop after a format match has been found.
Suggested by Steve Hartwell <shspamsink@comcast.net>.
2004-01-11 10:01:08 +00:00
Werner Lemberg fb4bfddb1a * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Add
cast.
* src/cff/cffdrivr.c (cff_ps_has_glyph_names): Assure that return
value is either 0 or 1.
2003-12-13 18:42:31 +00:00
Werner Lemberg b36d4a53e9 * src/cff/cffdrivr.c (cff_get_glyph_name): Improve error message.
(cff_get_name_index): Return if no PSNames service is available.
(cff_ps_has_glyph_names): Handle CID-keyed fonts correctly.
* src/cff/cfftypes.h (CFF_CharsetRec): New field `cids', used for
CID-keyed fonts.  This is the inverse mapping of `sids'.
* src/cff/cffload.c (cff_charset_load): New argument `invert'.
Initialize charset->cids if `invert' is set.
(cff_font_load): In call to cff_charset_load, set `invert' to true
for CID-keyed fonts.
* src/cff/cffgload.c (cff_slot_load): Handle glyph index as CID
and map it to the real glyph index.

* docs/CHANGES: Updated.
2003-12-12 15:38:39 +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
David Turner 7760595f84 * include/freetype/internal/bdftypes.h: removed obsolete header
* include/freetype/internal/cfftypes.h, src/cff/cfftypes.h,
        src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h,
        include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from
        'include/freetype/internal' to 'src/cff' since no other modules needs
        to known about these types

        * include/freetype/internal/t42types.h,
        include/freetype/internal/internal.h, src/type42/t42objs.h,
        src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from
        'include/freetype/internal' to 'src/type42' since no other modules needs
        to known about these types

        * src/gzip/infblock.c: removing compiler warning

        * include/freetype/internal/services/svpsinfo.h,
        include/freetype/internal/ftserv.h, src/cff/cffdrivr.c,
        src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c,
        src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined
        in "svpsinfo.h", removing some sad hacks.
2003-10-29 21:43:52 +00:00
Werner Lemberg 1c0b8e9d72 Only whitespace changes. 2003-10-23 04:54:14 +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