Commit Graph

1173 Commits

Author SHA1 Message Date
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 8ab0979d6e Prepare use of pscmap service within CFF module.
* include/freetype/internal/services/svpscmap.h: Include
FT_INTERNAL_OBJECTS_H.
(PS_Unicode_Index_Func): Removed.  Unused.
(PS_Macintosh_Name_Func): Renamed to...
(PS_Macintosh_NameFunc): This.
Update all callers.
(PS_Adobe_Std_Strings_Func): Renamed to...
(PS_Adobe_Std_StringsFunc): This.
Update all callers.
(PS_UnicodesRec): This is the former `PS_Unicodes' structure.
Add `cmap' member.
Update all callers.
(PS_Unicodes): This is now a typedef'd pointer to PS_UnicodesRec.
Update all callers.
(PS_Glyph_NameFunc): New typedef.
(PS_Unicodes_InitFunc): Change arguments to expect a function
and generic data pointer which returns a glyph name from a given
index.

* src/psnames/psmodule.c (ps_unicodes_init, ps_unicodes_char_index,
ps_unicodes_char_next, pscmaps_interface): Updated.

* include/freetype/internal/t1types.h (T1_FaceRec): Updated.

* src/psaux/t1cmap.h (T1_CmapStdRec): Updated.
(T1_CmapUnicode, T1_CmapUnicodeRec): Removed.

* src/psaux/t1cmap.c (t1_get_glyph_name): New callback function.
(t1_cmap_unicode_init, t1_cmap_unicode_done,
t1_cmap_unicode_char_index, t1_cmap_unicode_char_next,
t1_cmap_unicode_class_rec): Updated.

* src/type42/t42types.h (T42_FaceRec): Updated.
2006-01-12 08:12:27 +00:00
Suzuki, Toshiya (鈴木俊哉) 356a4d894c * Add declarations of new MacOS-specific APIs 2006-01-12 03:33:16 +00:00
Werner Lemberg 435046b54b Formatting, improving comments. 2006-01-11 10:57:42 +00:00
Werner Lemberg adf828ff95 Fix Savannah bug #15056 and use pscmap service in psaux module.
* include/freetype/internal/services/svpscmap.h (PS_UniMap): Use
FT_UInt32 for `glyph_index'.
(PS_Unicodes_InitFunc): Use FT_String for `glyph_names'.
(PS_Unicodes_CharIndexFunc): Use FT_UInt32 for `unicode'.
(PS_Unicodes_CharNextFunc): Make second argument a pointer to
FT_UInt32.

* src/psnames/psmodule.c (VARIANT_BIT, BASE_GLYPH): New macros.
(ps_unicode_value): Set VARIANT_BIT in return value if glyph is a
variant glyph (this is, it has non-leading `.' in its name).
(compare_uni_maps): Sort base glyphs before variant glyphs.
(ps_unicodes_init): Use FT_String for `glyph_names' argument.
Reallocate only if number of used entries is much smaller.
Updated to handle variant glyphs.
(ps_unicodes_char_index, ps_unicodes_char_next): Prefer base glyphs
over variant glyphs.
Simplify code.

* src/psaux/t1cmap.c (t1_cmap_uni_pair_compare): Removed.
(t1_cmap_unicode_init, t1_cmap_unicode_char_index,
t1_cmap_unicode_char_next): Use pscmap service.
(t1_cmap_unicode_done): Updated.

* src/psaux/t1cmap.h (T1_CMapUniPair): Removed.
(T1_CMapUnicode): Use PS_Unicodes structure.
2006-01-11 10:08:49 +00:00
Suzuki, Toshiya (鈴木俊哉) f8d16cc540 * Fix 'deprecated' warnings in building for MacOS 2006-01-11 09:28:38 +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 30bd284447 * src/base/ftutil.c (ft_highpow2): s/FT_BASE/FT_BASE_DEF/.
Reported by Niels Boldt <nielsboldt@gmail.com>.
2006-01-08 19:38:42 +00:00
Werner Lemberg e8f92af3f0 * src/pcf/pcfread.c (pcf_get_bitmaps): Remove unused variable
`bitmaps'.  From Yu Lei <yulei0@gmail.com>.
2006-01-08 13:43:30 +00:00
Werner Lemberg 05cda08bcb Fix ChangeLog. 2006-01-08 13:37:15 +00:00
Suzuki, Toshiya (鈴木俊哉) 3dfcef690d add '\n' to the end of src/sfnt/ttbdf.c 2005-12-28 06:47:12 +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
Suzuki, Toshiya (鈴木俊哉) 53be6e9b1b ftmac.c counts supported faces only 2005-12-23 12:22:46 +00:00
Werner Lemberg b79b513380 Formatting, improving comments. 2005-12-20 12:01:58 +00:00
Wu, Chia-I (吳佳一) ce34d122ba * src/truetype/ttinterp.c (Update_Max): Set current size of buffer
correctly (so that memory debug system won't panic).
2005-12-17 13:12:49 +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
David Turner db0182f056 small update 2005-12-14 21:16:33 +00:00
David Turner 89a2a4b531 * include/freetype/config/ftoption.h,
include/freetype/config/ftstdlib.h,
        include/freetype/internal/tttypes.h,
        src/sfnt/Jamfile, src/sfnt/rules.mk, src/sfnt/sfdriver.c,
        src/sfnt/ttbdf.h, src/sfnt/ttbdf.c, src/sfnt/sfobjs.c:

        Added support for an embedded 'BDF ' table within SFNT-based
        bitmap font files. This is used to store atoms & properties from
        the original BDF fonts that were used to generate the font file.

        the feature is controled by TT_CONFIG_OPTION_BDF within 'ftoption.h'
        and is used to implement FT_Get_BDF_Property for these font files.

        At the moment, this is still experimental, the BDF table format isn't
        cast into stone yet.
2005-12-14 20:38:15 +00:00
David Turner 8def3c897f * Jamfile: small fix to ensure that ftexport.sym is placed in the
same location than other generated objects (i.e. within the 'objs'
        directory of the current dir)
2005-12-14 16:38:31 +00:00
David Turner 5b5f382b7d * src/autofit/aflatin.c, src/autofit/afhints.c: changed the
implementation of the LIGHT hinting mode to completely disable
        horizontal hinting. This is an experimental effort to integrate
        David Chester's latest patch without fucking the other hinting
        modes as well.

        Note that this doesn't force auto-hinting for all fonts however.
2005-12-14 16:37:15 +00:00
Werner Lemberg 364db0826b * src/sfnt/sfobjc.c (sfnt_init_face): Move tag check to...
* src/sfnt/ttload.c (sfnt_init): Here, before handling TTCs.
2005-12-07 20:34:11 +00:00
Werner Lemberg 3b8db66941 Fix ChangeLog and source code comment. 2005-12-06 10:47:44 +00:00
Wu, Chia-I (吳佳一) a3690cdadd * src/truetype/ttobjs.c (tt_size_init): size->ttmetrics.valid is
initialized twice.
size->strike_index is not initialized.
2005-12-06 08:24:01 +00:00
Werner Lemberg 2a0903a54b * src/type42/t42objs.x (T42_Face_Init): Replace call to
FT_New_Memory_Face with call to FT_Open_Face to pass `params'.
2005-12-03 08:13:43 +00:00
Werner Lemberg 44e47d5fd6 * src/sfnt/ttcmap.c, src/sfnt/ttcmap.h:
s/TT_CMAP_FLAG_OVERLAPPED/TT_CMAP_FLAG_OVERLAPPING/.
2005-11-30 18:47:49 +00:00
Werner Lemberg b5d88e8e0c * docs/CHANGES: Document latest charmap code changes. 2005-11-30 08:55:51 +00:00
Werner Lemberg b797fdb513 * docs/CHANGES: Document ftdump's `-v' option. 2005-11-30 08:48:32 +00:00
Wu, Chia-I (吳佳一) a28bc4c71d * src/sfnt/ttcmap.c (tt_cmap4_char_map_binary,
tt_cmap12_char_map_binary): Fix compiler warnings.
2005-11-30 02:39:10 +00:00
Wu, Chia-I (吳佳一) a0911343ee Major update to distinguish between unsorted and overlapped segments
for cmap format 4.  For overlapped but sorted segments, which is
previously considered unsorted, we still use binary search.

* src/sfnt/ttcmap.h (struct  TT_CMapRec_): Replace `unsorted' by
`flags'.
(TT_CMAP_FLAG_UNSORTED, TT_CMAP_FLAG_OVERLAPPED): New macros.

* src/sfnt/ttcmap.c (OPT_CMAP4): Removed as it is always defined.
(struct TT_CMap4Rec_): Remove `old_charcode' and `table_length'.
(tt_cmap4_reset): Removed.
(tt_cmap4_init): Updated accordingly.
(tt_cmap4_next): Updated accordingly.
Take care of overlapped segments.
(tt_cmap4_validate): Make sure the subtable is large enough.
Do not check glyph_ids because some fonts set the length wrongly.
Also, when all segments have offset 0, glyph_ids is always invalid. It
does not cause any problem so far only because the check misses
equality.
Distinguish between unsorted and overlapped segments.
(tt_cmap4_char_map_linear, tt_cmap4_char_map_binary): New functions to
do "charcode => glyph index" by linear/binary search.
(tt_cmap4_char_index, tt_cmap4_char_next): Use
tt_cmap4_char_map_linear and tt_cmap4_char_map_binary.
(tt_face_build_cmaps): Treat the return value of validator as flags
for cmap.
2005-11-29 11:32:53 +00:00
Wu, Chia-I (吳佳一) 569ec4ee2a * src/sfnt/ttcmap.c (struct TT_CMap12Rec_, tt_cmap12_init,
tt_cmap12_next): New struct/function for fast "next char".
(tt_cmap12_char_map_binary): New function to do "charcode => glyph
index" by binary search.
(tt_cmap12_char_index, tt_cmap12_char_next): Use
tt_cmap12_char_map_binary.
(tt_face_build_cmaps): Check table and offset correctly (equality is
missing).
2005-11-29 11:27:51 +00:00
Detlef Würkner df1598e316 2005-11-15 Detlef Wrkner <TetiSoft@apg.lahn.de>
* builds/amiga/smakefile: Adjusted the compiler options
	to the current sources, now really builds the gxvalid, gzip
	and psnames modules.

	* builds/amiga/src/base/ftsystem.c: The assumed Seek() position
	in the file cache was off by one byte which could cause false
	errors in font files.
2005-11-25 08:04:09 +00:00
Suzuki, Toshiya (鈴木俊哉) 6b1c597cba MPW makefiles are updated to build all available modules 2005-11-24 05:16:57 +00:00
Werner Lemberg 67ba21189a * src/bdf/bdfdrivr.c (bdf_interpret_style, BDF_Face_Done): Fix small
memory leak.
2005-11-21 17:32:03 +00:00
Werner Lemberg 840232ad2c * src/sfnt/ttload.c (sfnt_init): Add tracing message. 2005-11-21 12:36:42 +00:00
Wu, Chia-I (吳佳一) 275be9ba6d * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): image_offset is
added to image_start twice when image_format is 2 or 5.
2005-11-21 03:05:34 +00:00
Wu, Chia-I (吳佳一) d81947e429 * src/sfnt/sfobjs.c (sfnt_init_face): Check that format_tag is known
before loading the table directory.

* src/sfnt/ttload.c (tt_face_load_sfnt_header,
tt_face_load_directory): Delay sfnt_dir_check from
tt_face_load_sfnt_header to tt_face_load_directory.
2005-11-21 03:04:03 +00:00
Wu, Chia-I (吳佳一) 6f1eca0460 * src/sfnt/ttload.c (sfnt_dir_check): Clean up and return correct
error code.
(sfnt_init): New function to fill in face->ttc_header.  A non-TTC font
is synthesized into a TTC font with one offset table.
(tt_face_load_sfnt_header): Use sfnt_init.
Fix an invalid access when the font is TTC and face_index is -1.
2005-11-20 08:24:24 +00:00
Werner Lemberg 6c99045972 * src/sfnt/ttload.c (tt_face_load_metrics): Ignore excess number
of metrics instead of aborting.  Patch suggested by Derek Noonburg.

* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
(cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Scale
the glyph properly if no hinter is available.

* docs/CHANGES: Mention scaling bug.
2005-11-18 21:10:59 +00:00
Werner Lemberg 1a293d6c73 * src/sfnt/ttload.c (tt_face_load_metrics): Ignore excess number
of metrics instead of aborting.  Patch suggested by Derek Noonburg.
2005-11-18 08:23:06 +00:00
Suzuki, Toshiya (鈴木俊哉) 8d81d41ae3 add FT_TrueTypeGX_Free() etc to free the buffers allocated by gxvalid, otvalid 2005-11-18 07:47:06 +00:00
Wu, Chia-I (吳佳一) cb18238109 * builds/unix/ftsystem.c (FT_Stream_Open, FT_New_Memory,
FT_Done_Memory), builds/vms/ftsystem.c (FT_Stream_Open, FT_New_Memory,
FT_Done_Memory), builds/win32/ftdebug.c (FT_Message, FT_Panic):
s/FT_EXPORT/FT_BASE/.
2005-11-18 04:29:31 +00:00
Detlef Würkner 0acfc1f833 2005-11-17 Detlef Wrkner <TetiSoft@apg.lahn.de>
* builds/amiga/src/base/ftdebug.c (FT_Trace_Get_Count,
	FT_Trace_Get_Name, FT_Message, FT_Panic),
	builds/amiga/src/base/ftsystem.c (FT_New_Memory, FT_Done_Memory,
	FT_Stream_Open): s/FT_EXPORT/FT_BASE/.
2005-11-17 16:54:54 +00:00
Detlef Würkner 4859ac4add Add ChangeLog entry. 2005-11-17 14:21:07 +00:00
Werner Lemberg cfc0cf2e78 Add vertical metrics support to OpenType CFF outlines. Based on a
patch from Mike Moening <MikeM@RetekSolutions.com>

* src/cff/cffgload.c (cff_face_get_vertical_metrics): New function.
(cff_slot_load): Use cff_face_get_vertical_metrics.

* docs/CHANGES: Updated.
2005-11-17 08:12:00 +00:00
Wu, Chia-I (吳佳一) 35bfc0f1b9 * src/base/ftcalc.c (FT_MulTo64): Commented out.
* include/freetype/internal/ftcalc.h (FT_SqrtFixed), src/base/ftcalc.c
(FT_SqrtFixed), include/freetype/internal/ftdebug.h
(FT_Trace_Get_Count, FT_Trace_Get_Name, FT_Message, FT_Panic),
src/base/ftdebug.c (FT_Trace_Get_Count, FT_Trace_Get_Name, FT_Message,
FT_Panic), include/freetype/internal/ftobjs.h (FT_New_Memory,
FT_Done_Memory), include/freetype/internal/ftstream.h
(FT_Stream_Open), src/base/ftsystem.c (FT_New_Memory, FT_Done_Memory,
FT_Stream_Open): s/FT_EXPORT/FT_BASE/.

* builds/exports.mk: Manually add TT_New_Context to EXPORTS_LIST too.
2005-11-17 01:53:07 +00:00
Werner Lemberg 674ba91f12 formatting 2005-11-16 18:09:27 +00:00
David Turner f7cc181425 * src/base/fttrigon.c (ft_trig_prenorm): fixed a bug that created
invalid computations, resulting in very weird bugs in TrueType
	bytecode hinted fonts

	* src/truetype/ttinterp.c: redefined FT_UNUSED_EXEC to not perform
	a structure copy each time. Wooot. !
2005-11-15 17:30:56 +00:00
Werner Lemberg d829ff768b * src/cache/ftccache.c (FTC_Cache_Clear), src/cache/ftcmanag.c
(FTC_Manager_Check): Remove FT_EXPORT_DEF tag.

* src/base/ftcalc.c (FT_Add64): Remove FT_EXPORT_DEF tag.
(FT_Div64by32, FT_Sqrt32): Commented out.  Unused.

* include/freetype/internal/ftcalc.h (SQRT_32): Removed.  Unused.
(FT_Sqrt32): Commented out.  Unused.

* include/freetype/cache/ftccache.h:
s/ftc_node_destroy/FTC_Node_Destroy/.

* src/cache/ftccback.h (ftc_node_destroy): New declaration.

* src/cache/ftccache.c (ftc_node_destroy): Use FT_LOCAL_DEF tag.
(FTC_Node_Destroy): New exported wrapper function for
ftc_node_destroy.

* src/cache/ftcmanag.c: Include ftccback.c.
2005-11-12 17:07:11 +00:00
Werner Lemberg cee37a3b0a Clean-up. 2005-11-12 07:34:40 +00:00