Commit Graph

1595 Commits

Author SHA1 Message Date
Werner Lemberg 578dafd6b4 Minor comment improvement. 2018-04-03 11:31:22 +02:00
Alexei Podtelezhnikov fa6da7bf6d Documentation improvement. 2018-03-26 21:40:18 -04:00
Werner Lemberg 61ee69a66e Typo. 2018-03-24 05:53:22 +01:00
Werner Lemberg 5955b77b1d Minor documentation improvement. 2018-03-03 09:21:59 +01:00
Werner Lemberg 63aaf89cec s/sub-pixel/subpixel/. 2018-02-17 10:34:47 +01:00
Alexei Podtelezhnikov f4a3255d45 [unix] Use -fvisibility=hidden.
It is now widely recommended that ELF shared libraries hide symbols
except those with explicit __attribute__((visibility("default"))).
This is supported by all major compilers and should rather be an
option in libtool.

* builds/unix/configure.raw: Add -fvisibility=hidden to CFLAGS.
* builds/unix/ftconfig.in, builds/vms/ftconfig.h,
include/freetype/config/ftconfig.h (FT_EXPORT): Use visibility
attribute.
2018-02-04 00:09:02 -05:00
Alexei Podtelezhnikov d2d1750e08 [build] Expand dllexport/dllimport to Cygwin/MinGW.
* include/freetype/config/ftconfig.h: Respect DLL_EXPORT,
s/_MSC_VER/_WIN32/.
* builds/unix/ftconfig.in: Replicate here.
* builds/vms/ftconfig.h: Replicate here.
2018-01-12 23:01:49 -05:00
Alexei Podtelezhnikov e8b38f899c [build] Improve and document MSVC build.
* include/freetype/config/ftconfig.h: Guard dllexport/dllimport
attributes with _DLL and FT2_DLLIMPORT.
* builds/windows/vc2010/index.html: Update documentation.
2018-01-12 08:57:08 -05:00
Werner Lemberg 67a42aa887 * Version 2.9 released.
=======================

Tag sources with `VER-2-9'.

* docs/VERSION.TXT: Add entry for version 2.9.

* README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
builds/windows/vc2005/index.html,
builds/windows/vc2008/freetype.vcproj,
builds/windows/vc2008/index.html,
builds/windows/vc2010/freetype.vcxproj,
builds/windows/vc2010/index.html,
builds/windows/visualc/freetype.dsp,
builds/windows/visualc/freetype.vcproj,
builds/windows/visualc/index.html,
builds/windows/visualce/freetype.dsp,
builds/windows/visualce/freetype.vcproj,
builds/windows/visualce/index.html,
builds/windows/ftver.rc,
builds/wince/vc2005-ce/freetype.vcproj,
builds/wince/vc2005-ce/index.html,
builds/wince/vc2008-ce/freetype.vcproj,
builds/wince/vc2008-ce/index.html: s/2.8.1/2.9/, s/281/29/.

* include/freetype/freetype.h (FREETYPE_MINOR): Set to 9.
(FREETYPE_PATCH): Set to 0.

* builds/unix/configure.raw (version_info): Set to 22:0:16.
* CMakeLists.txt (VERSION_PATCH): Set to 1.
2018-01-08 12:30:04 +01:00
Werner Lemberg 9e7b24f290 Next release will be 2.9. 2018-01-08 11:16:11 +01:00
Werner Lemberg 3758aed760 Add `FT_Done_MM_Var'.
This is necessary in case the application's memory routines differ
from FreeType.  A typical example is a Python application on Windows
that calls FreeType compiled as a DLL via the `ctypes' interface.

* include/freetype/ftmm.h, src/base/ftmm.c (FT_Done_MM_Var): Declare
and define.

* docs/CHANGES: Updated.
2018-01-06 08:39:36 +01:00
Werner Lemberg b720070988 Minor doc fixes. 2018-01-06 08:39:30 +01:00
Alexei Podtelezhnikov 20b3e34846 Move internal LCD-related declarations.
* include/freetype/ftlcdfil.h (ft_lcd_padding, ft_lcd_filter_fir):
Move from here...
* include/freetype/internal/ftobjs.h: ... to here.
2018-01-02 22:12:09 -05:00
Alexei Podtelezhnikov c94d042be6 * include/freetype/config/ftconfig.h (FT_EXPORT, FT_EXPORT_DEF)
[_MSC_VER]: Limit Visual C++ attributes.
2018-01-02 21:38:35 -05:00
Werner Lemberg 0a0c22569d Update copyright year. 2018-01-02 09:33:57 +01:00
Werner Lemberg 8470cee8aa Updated `CHANGES' file. 2017-12-30 20:50:50 +01:00
Werner Lemberg 3cc88e2e44 Fixes for `make multi'.
* include/freetype/internal/ftpsprop.h: Use `FT_BASE_CALLBACK'.
(ps_property_get): Harmonize declaration with corresponding
function typedef.

* include/freety[e/internal/fttrace.h: Add `trace_psprops'.

* src/base/ftpsprop.c: Include necessary header files.
(FT_COMPONENT): Define.
(ps_property_set): Tag with `FT_BASE_CALLBACK_DEF'.
(ps_property_get): Tag with `FT_BASE_CALLBACK_DEF'.
Harmonize declaration with corresponding function typedef.
2017-12-27 08:19:09 +01:00
Werner Lemberg 1063690174 Provide support for intra-module callback functions.
This is needed especially for `make multi' with C++.

* include/freetype/config/ftconfig.h (FT_BASE_CALLBACK,
FT_BASE_CALLBACK_DEF): New macros.
2017-12-27 08:13:13 +01:00
Werner Lemberg dd6330d74b Add missing ChangeLog entry, copyright notices, whitespace, formatting. 2017-12-27 08:06:47 +01:00
Ewald Hew a956e36c8d Move PostScript drivers' property handlers to `base'
This reduces the amount of duplicated code across PostScript drivers.

* src/cff/cffdrivr.c, src/cid/cidriver.c, src/type1/t1driver.c
({cff,cid,t1}_property_{get,set}): Moved to...
* include/freetype/internal/ftpsprop.h: ...this new file.
(ps_property_{get,set}): New functions to replace moved ones.
* src/base/ftpsprop.c: Implement above functions.

* include/freetype/internal/internal.h (FT_INTERNAL_POSTSCRIPT_PROPS_H):
New macro.
* src/cff/cffdrivr.c, src/cid/cidriver.c, src/type1/t1driver.c: Updated.

* src/base/Jamfile, src/base/rules.mk, src/base/ftbase.c: Updated.
2017-12-25 12:53:21 +08:00
Werner Lemberg 08cd62deed Speed up FT_Set_Var_{Design,Blend}_Coordinates if curr == new.
We exit early if the current design or blend coordinates are
identical to the new ones.

* src/truetype/ttgxvar.c (tt_set_mm_blend, TT_Set_Var_Design):
Implement it, returning internal error code -1 if there will be no
variation change.

* src/type1/t1load.c (t1_set_mm_blend): Ditto.

* src/base/ftmm.c (FT_Set_Var_Design_Coordinates,
FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates): Updated.
2017-12-20 22:06:19 +01:00
Werner Lemberg 81dea49321 Documentation fixes for the last few commits. 2017-12-08 20:32:23 +01:00
Werner Lemberg 98ba0c4a37 New `ftdriver.h' file, covering all driver modules.
This reduces redundancy and increases synergy; it also reduces the
number of header files.

* include/freetype/config/ftheader.h (FT_DRIVER_H): New macro.
(FT_AUTOHINTER_H, FT_CFF_DRIVER_H, FT_TRUETYPE_DRIVER_H,
FT_PCF_DRIVER_H, FT_TYPE1_DRIVER_H): Make them aliases to
FT_DRIVER_H.

* include/freetype/ftautoh.h, include/freetype/ftcffdrv.h,
include/freetype/ftpcfdrv.h, include/freetype/ftt1drv.h,
include/freetype/ftttdrv.h: Replaced with...
* include/freetype/ftdriver.h: ...this new file.
(FT_CFF_HINTING_ADOBE, FT_T1_HINTING_ADOBE): Renamed to...
(FT_HINTING_ADOBE): ... this new macro.
(FT_CFF_HINTING_FREETYPE, FT_T1_HINTING_FREETYPE): Renamed to...
(FT_HINTING_FREETYPE): ... this new macro.

* src/*/*: Updated accordingly.
2017-12-08 18:41:49 +01:00
Werner Lemberg bef8de2a85 Move `ftdriver.h' to `ftdrv.h'.
* include/freetype/internal/ftdriver.h: Renamed to...
* include/freetype/internal/ftdrv.h: ... this name.

* include/freetype/internal/internal.h (FT_INTERNAL_DRIVER_H):
Updated.
2017-12-08 10:02:12 +01:00
Werner Lemberg c3cbb440af Use ASCII only in public header files (#50858). 2017-12-07 16:26:36 +01:00
Werner Lemberg 63b91548e0 Fix `make multi'.
* include/freetype/internal/fttrace.h: Remove unused tracing macros.
s/pshalgo2/pshalgo/.
Add `trace_cffdecode'.
* src/pshinter/pshalgo.c (FT_COMPONENT): Updated.

* src/cff/cffload.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H.
* src/cff/cffobjs.c: Include FT_SERVICE_METRICS_VARIATIONS_H and
FT_SERVICE_CFF_TABLE_LOAD_H.

* src/cid/cidriver.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H.

* src/psaux/cffdecode.c: Include FT_FREETYPE_H and
FT_INTERNAL_DEBUG_H.
(FT_COMPONENT): Define.
* src/psaux/cffdecode.h: Include FT_INTERNAL_POSTSCRIPT_AUX_H.
* src/psaux/psauxmod.h: Include FT_INTERNAL_POSTSCRIPT_AUX_H.
Declare `cff_builder_funcs' and `ps_builder_funcs'.
* src/psaux/psft.c: Include `psobjs.h' and `cffdecode.h'.
* src/psaux/psobjs.c : Include `psauxmod.h'.
2017-12-07 14:33:44 +01:00
Werner Lemberg 7ec1345d13 * include/freetype/config/ftheader.h: Some clean-up.
This commit removes documentation of deprecated macros and does some
minor streamlining.
2017-12-07 14:21:39 +01:00
Werner Lemberg ed7f091323 New header file `ftparams.h' that collects all parameter tags.
* include/freetype/config/ftheader.h (FT_PARAMETER_TAGS_H): New
macro.
(FT_TRUETYPE_UNPATENTED_H, FT_UNPATENTED_HINTING_H): Define it to
`ftparams.h'.

* include/freetype/ftautoh.h, include/freetype/ftcffdrv.h,
include/freetype/ftincrem.h, include/freetype/ftlcdfil.h,
include/freetype/ftsnames.h, include/freetype/ftt1drv.h: Include
FT_PARAMETER_TAGS_H.
Move FT_PARAM_TAG_XXX definitions to...
* include/freetype/ftparams.h: ...this new file.

* include/freetype/ttunpat.h: Remove.  No longer needed.
2017-12-06 23:15:54 +01:00
Werner Lemberg 87ddad2007 Update or fix links to use the https protocol instead of http. 2017-12-04 20:43:30 +01:00
Werner Lemberg 8f4851997b [unix] Install a massaged `ftoption.h' file (#51780).
* builds/unix/configure.raw (ftoption_set, ftoption_unset): New
auxiliary functions to construct...
(FTOPTION_H_SED): ... this new variable.
Apply it as a sed argument while copying `ftoption.h' to the
`builds/unix' directory (using `AC_CONFIG_FILES').
Simplify code of test that checks cpp's computation of bit length
(the test previously created an empty `ftoption.h' file and deleted
it immediately afterwards); without this change, it can happen on my
GNU/Linux box that `configure's execution of `config.status' doesn't
create `ftoption.h' (no idea why this happens).

* builds/unix/install.mk (install): Install
`builds/unix/ftoption.h'.

* builds/unix/unix-def.in (DISTCLEAN): Updated.

* builds/unix/.gitignore: Updated.
2017-11-25 11:30:38 +01:00
Ewald Hew b9bd2d14e2 [psaux] Fix CFF advance widths. (#52466)
Glyph advance widths were being written to the new `PS_Decoder' but not
saved to the underlying format specific decoder. This caused pure CFF
fonts to have bad advance width.

* include/freetype/internal/psaux.h (PS_Decoder): Change `glyph_width'
field to pointer.
Remove unused fields.
* src/psaux/psobjs.c (ps_decoder_init): Change `glyph_width' from copy
to reference.
Remove unused.
* src/psaux/psft.c (cf2_setGlyphWidth): Update code.
2017-11-22 12:38:36 +08:00
Vlad Tsyrklevich 954710ddd7 * include/freetype/ftrender.h: Fix `FT_Renderer_RenderFunc' type. 2017-11-15 23:06:29 +01:00
Ewald Hew dff40d03df Add T1_CONFIG_OPTION_OLD_ENGINE configuration option.
This controls whether the old Type 1 engine gets compiled into FreeType.
It is disabled by default.

* devel/ftoption.h, include/freetype/config/ftoption.h
(T1_CONFIG_OPTION_OLD_ENGINE): New macro.

* include/freetype/internal/psaux.h (PS_Decoder): Remove unused field.
* include/freetype/internal/psaux.h, src/cid/cidgload.c
(cid_load_glyph), src/psaux/psauxmod.c, src/psaux/psobjs.c
(ps_builder_add_point), src/psaux/t1decode.c
(t1_lookup_glyph_by_stdcharcode, t1_decoder_parse_glyph,
t1operator_seac, t1_decoder_parse_charstrings), src/psaux/t1decode.h,
src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Surround
relevant code with macro.
Minor code changes.
2017-10-12 18:32:50 +08:00
Ewald Hew 78df3c27b6 Extract width parsing from Type 1 parser.
Duplicate the fast advance width calculations from the old parser. This
is to facilitate adding options for compiling out the old parser.

* src/psaux/t1decode.{c,h} (t1_decoder_parse_metrics): New function.
* include/freetype/internal/psaux.h (T1_Decoder_Funcs): New entry
`parse_metrics'.
* src/psaux/psauxmod.c: Set the new entry.

* src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String),
src/cid/cidgload.c (cid_load_glyph): Separate
conditional for selecting engine.
2017-10-12 18:32:50 +08:00
Werner Lemberg 08e2e311ef Document global size metrics needed for native bytecode hinting (#52165). 2017-10-08 10:37:50 +02:00
Werner Lemberg 91448669a2 Prevent creation of an incorrect documentation entry. 2017-10-08 10:23:47 +02:00
Werner Lemberg 7bfcaacaf5 [sfnt] Adjust behaviour of PS font names for variation fonts.
* src/sfnt/sfdriver.c (sfnt_get_var_ps_name): Use a named instance's
PS name only if no variation is applied.
2017-10-07 13:14:38 +02:00
Werner Lemberg f89c67f043 [cff, truetype] Adjust behaviour of named instances.
This commit completely separates the interaction between named
instances and variation functions.  In particular, resetting the
variation returns to the current named instance (if set) and not to
the base font.

As a side effect, variation functions no longer change the named
instance index.

* src/cff/cffobjs.c (cff_face_init): Use MM service's `set_instance'
function.
Also apply `MVAR' table to named instances.

* src/truetype/ttgxvar.c (TT_Get_MM_Var): Add cast.
(tt_set_mm_blend): No longer check whether requested variation
coincides with a named instance.
(TT_Set_Var_Design): Use current named instance for default
coordinates.
* src/truetype/ttobjs.c (tt_face_init): Use `TT_Set_Named_Instance'.
2017-10-07 13:10:53 +02:00
Werner Lemberg 8c92f7622c Make `FT_FACE_FLAG_VARIATION' work.
* include/freetype/internal/tttypes.h (TT_Face): Remove
`is_default_instance'; this can be replaced with a combination of
`FT_IS_VARIATION' and `FT_IS_INSTANCE'.

* src/cff/cffdrivr.c (cff_get_advances): Updated.

* src/sfnt/sfdriver.c (sfnt_get_ps_name), src/sfnt/sfobjs.c
(sfnt_init_face): Updated.

* src/truetype/ttdriver.c (tt_get_advances), src/truetype/ttgload.c
(TT_Process_Simple_Glyph, load_truetype_glyph, IS_DEFAULT_INSTANCE),
src/truetype/ttgxvar.c (tt_set_mm_blend): Updated.
* src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design):
Handle `FT_FACE_FLAG_VARIATION'.

* src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_Design): Handle
`FT_FACE_FLAG_VARIATION'.
2017-10-07 12:12:49 +02:00
Werner Lemberg dd8539ef82 New function `FT_Set_Named_Instance'.
No effect yet.

* src/base/ftmm.c (FT_Set_Named_Instance): New function.

* include/freetype/ftmm.h: Updated.
2017-10-07 11:40:03 +02:00
Werner Lemberg b3f9c4f2f6 Add macros for checking whether a font variation is active.
* include/freetype/freetype.h (FT_FACE_FLAG_VARIATION,
FT_IS_VARIATION): New macros.
No effect yet.
2017-10-07 11:34:23 +02:00
Werner Lemberg e23fe2adbc Add framework for setting named instance in MM service.
* include/freetype/internal/services/svmm.h (FT_Set_Instance_Func):
New function typedef.
(MultiMasters): Add `set_instance' member.
(FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.

* src/cff/cffdrivr.c (cff_service_multi_masters),
src/truetype/ttdriver (tt_service_gx_multi_masters),
src/type1/t1driver.c (t1_service_multi_masters): Updated.
2017-10-07 11:25:04 +02:00
John Tytgat 1df35d94c7 [cff] Add support for `FSType'.
* include/freetype/internal/cfftypes.h (CFF_FontRec): Add
`font_extra' entry.

* src/cff/cffdrivr.c (cff_ps_get_font_extra): New function to
retrieve FSType info from the embedded PostScript data.
(cff_service_ps_info): Register function.

* src/cff/cffload.c (cff_font_done): Free `font_extra'.
2017-10-04 22:46:36 +02:00
Werner Lemberg 2127f07624 [include] Whitespace. 2017-10-01 00:41:07 +02:00
Alexei Podtelezhnikov c26f7f975b Bitmap metrics presetting [2/2].
* src/base/ftobjs.c (FT_Load_Glyph): Preset the bitmap metrics when
appropriate but `FT_Render_Glyph' is not called.
* include/freetype/freetype.h (FT_GlyphSlotRec): Document the change.
2017-09-29 00:13:19 -04:00
Alexei Podtelezhnikov 61d1818b5e Bitmap metrics presetting [1/2].
This mainly just extracts the code for presetting the bitmap metrics
from the monochrome, grayscale, and LCD renderers into a separate
function.

* src/base/ftobjs.c (ft_glyphslot_preset_bitmap): New function that
calculates prespective bitmap metrics for the given rendering mode.
* include/freetype/internal/ftobjs.h (ft_glyphslot_preset_bitmap):
Declare it.

* src/base/ftlcdfil.c (ft_lcd_padding): New helper function that adds
padding to CBox taking into account pecularities of LCD rendering.
* include/freetype/ftlcdfil.h (ft_lcd_padding): Declare it.

* src/raster/ftrend1.c (ft_raster1_render): Reworked to use
`ft_glyphslot_preset_bitmap'.
* src/smooth/ftsmooth.c (ft_smooth_render_generic): Ditto.
(ft_smooth_render_lcd, ft_smooth_render_lcd): The pixel_mode setting
is moved to `ft_glyphslot_preset_bitmap'.
2017-09-28 00:20:50 -04:00
Werner Lemberg 12ae57d992 Copyright notices, formatting, whitespace, minor doc fixes. 2017-09-26 12:53:41 +02:00
Ewald Hew a1a6a1f679 Minor fixes.
* include/freetype/internal/psaux.h, src/psaux/psobjs.{c,h}:
Rearrange `ps_builder_init' arguments to conventional order.

* src/psaux/psft.c (cf2_decoder_parse_charstrings): Add a check and
notice for `SubFont' in Type 1 mode.
2017-09-25 09:26:59 +02:00
Ewald Hew 6e7da50bc3 Documentation fixes. 2017-09-25 09:26:59 +02:00
Ewald Hew ebb1735aa7 Move `psdecode' into `psobjs'.
As the former only contains a single procedure, move it into
`psobjs' for simplicity.  Also change the parameter order to the
conventional one.

* src/psaux/psdecode.c (ps_decoder_init): Moved to...
* src/psaux/psobjs.c: ...Here.
* src/psaux/psdecode.h, src/psaux/psobjs.h: Ditto.

* include/freetype/internal/psaux.h (PSAux_ServiceRec): Update
`ps_decoder_init' function signature.

* src/cff/cffgload.c, src/cid/cidgload.c, src/type1/t1gload.c:
Update calls.

* src/psaux/psaux.c, src/psaux/psauxmod.c: Update includes.

* src/psaux/Jamfile (_sources), src/psaux/rules.mk (PSAUX_DRV_SRC):
Update file references.
2017-09-25 09:26:59 +02:00