Commit Graph

321 Commits

Author SHA1 Message Date
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