Commit Graph

461 Commits

Author SHA1 Message Date
Werner Lemberg a56e4bf7a2 Oops! 2018-06-18 23:18:07 +02:00
Werner Lemberg 95f7341d81 More minor doc fixes. 2018-06-18 11:10:14 +02:00
Werner Lemberg ce8517b474 Minor documentation fixes. 2018-06-18 10:22:42 +02:00
Werner Lemberg 877d80944b Introduce `@example:' subsections. 2018-06-18 10:08:17 +02:00
Werner Lemberg fc40469a6f Add example for `FT_Get_Color_Glyph_Layer'. 2018-06-18 09:23:18 +02:00
Nikhil Ramakrishnan e13599a036 Change documentation markup tags to lowercase.
Implemented as per discussion in

  http://lists.nongnu.org/archive/html/freetype-devel/2018-06/msg00073.html

No change in functionality, of course.
2018-06-18 03:40:29 +05:30
Werner Lemberg 19d8687f0b Fix documentation indentation; s/@const/@enum/; harmonize doc keywords. 2018-06-17 11:22:37 +02:00
Werner Lemberg 9b31c44620 Replace `FT_Get_GlyphLayers' with `FT_Get_Color_Glyph_Layer'.
This avoids any additional allocation of COLR related structures in
a glyph slot.

* include/freetype/freetype.h (FT_Glyph_Layer, FT_Glyph_LayerRec,
FT_Get_GlyphLayers): Removed.

* include/freetype/internal/ftobjs.h (FT_Colr_InternalRec): Removed.
(FT_Slot_InternalRec): Remove `color_layers'.

* include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func):
Removed.
(SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Remove
`load_colr_layer'.

* src/base/ftobjs.c (ft_glyph_slot_done): Updated.
(FT_Render_Glyph_Internal): Use `FT_Get_Color_Glyph_Layer'.
(FT_Get_GlyphLayers): Removed.

* src/sfnt/sfdriver.c (sfnt_interface): Updated.

* src/sfnt/ttcolr.c (tt_face_load_colr_layers): Removed.
* src/sfnt/ttcolr.h: Updated.

* src/truetype/ttgload.c (TT_Load_Glyph): Updated.
2018-06-14 21:30:43 +02:00
Werner Lemberg f9d05eb326 Provide iterative API to access `COLR' data.
This solution doesn't store any data in an `FT_GlyphSlot' object.

* include/freetype/freetype.h (FT_LayerIterator): New structure.
(FT_Get_Color_Glyph_Layer): New function.

* include/freetype/internal/sfnt.h (TT_Get_Colr_Layer_Func): New
function type.
(SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Add it.

* src/base/ftobjs.c (FT_Get_Color_Glyph_Layer): Implement it.

* src/sfnt/ttcolr.c (tt_face_get_colr_layer): New function.
* src/sfnt/ttcolr.h: Updated.

* src/sfnt/sfdriver.c (sfnt_interface): Updated.
2018-06-14 21:17:17 +02:00
Werner Lemberg 33ac83e376 Add glyph index and glyph load flags to glyph slot.
* include/freetype/freetype.h (FT_GlyphSlotRec): Rename unused
`reserved' field to `glyph_index'.

* include/freetype/internal/ftobjs.h (FT_Slot_InternalRec): Add
`load_flags' field.

* src/base/ftobjs.c (FT_Load_Glyph): Set new fields.
2018-06-14 21:00:23 +02:00
Alexei Podtelezhnikov 04338a5e52 Doc fixes and improvements. 2018-06-12 21:59:15 -04:00
Alexei Podtelezhnikov 8f1ed54877 [base] API for Harmony LCD rendering.
This introduces `FT_Library_SetLcdGeometry' for setting up arbitrary
LCD subpixel geometry including non-striped patterns.

* src/base/ftlcdfil.c (FT_Library_SetLcdGeometry): New function.
* include/freetype/ftlcdfil.h: Document it.
* include/freetype/freetype.h: Minor.
* include/freetype/ftchapters.h: Minor.
2018-06-07 02:48:48 -04:00
Werner Lemberg f999375a9a [GSoC] include/*.*, devel/*.*: Convert block comments to `light' style.
This second and final monster commit was created by applying Nikhil's
scripts `docconverter.py' and `markify.py' to all C header and source files,
followed up by minor manual clean-up.

No change in functionality, of course.

I used commit f7419907bc6044b9b7057f9789866426c804ba82 from
https://github.com/nikramakrishnan/freetype-docs.git.
2018-06-03 22:00:42 +02:00
Werner Lemberg dc170dea33 Typos. 2018-06-03 21:23:52 +02:00
Werner Lemberg ae2cd1b749 Various minor color fixes.
* include/freetype/config/ftheader.h (FT_COLOR_H): New macro.

* include/freetype/internal/ftobjs.h (FT_Colr_Internal): Change
type of `load_flags' to `FT_Int32'.

* include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func): Change
type of `idx' to `FT_UInt'.
(TT_Blend_Colr_Func): Change type of `color_index' to `FT_UInt'.

* src/base/ftobjs.c (FT_Render_Glyph_Internal): Change type of
`load_flags' to `FT_Int32'.

* src/sfnt/ttcolr.c (find_base_glyph_record,
tt_face_load_colr_layers): Change type of `glyph_id' to `FT_UInt'.
(tt_face_find_color, tt_face_colr_blend_layer): Change type of
`color_index' to `FT_UInt'.
Fix signedness and type issues.

* src/sfnt/ttcolr.h: Updated.
2018-05-30 09:34:57 +02:00
Werner Lemberg 583dabf291 Add function `FT_Get_GlyphLayers' to access `COLR' table data.
* include/freetype/internal/ftobjs.h (FT_Glyph_LayerRec): Move this
structure to...
* include/freetype/freetype.h (FT_Glyph_LayerRec): ... this
header file.
(FT_Glyph_Layer): New typedef.
Update code to use it where appropriate.

* src/base/ftobjs.c (FT_Get_GlyphLayers): New function.
2018-05-16 21:21:18 +02:00
Werner Lemberg 86bc8a9505 * Version 2.9.1 released.
=========================

Tag sources with `VER-2-9-1'.

* docs/VERSION.TXT: Add entry for version 2.9.1.
* docs/CHANGES: Updated.

* README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
src/base/ftver.rc, 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/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.9/2.9.1/, s/29/291/.

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

* builds/unix/configure.raw (version_info): Set to 22:1:16.
* CMakeLists.txt (VERSION_PATCH): Set to 1.

* include/freetype/ftgasp.h: Use FT_BEGIN_HEADER and FT_END_HEADER.
2018-05-01 20:37:24 +02:00
Alexei Podtelezhnikov 92e4662ba6 Documentation tweaks. 2018-04-19 17:57:42 -04:00
Alexei Podtelezhnikov fa6da7bf6d Documentation improvement. 2018-03-26 21:40:18 -04: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
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 b720070988 Minor doc fixes. 2018-01-06 08:39:30 +01:00
Werner Lemberg 0a0c22569d Update copyright year. 2018-01-02 09:33:57 +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 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 08e2e311ef Document global size metrics needed for native bytecode hinting (#52165). 2017-10-08 10:37:50 +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 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
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
Werner Lemberg 1ad07c1c79 Add some `since' fields (back to version 2.4.8). 2017-09-21 14:56:58 +02:00
Werner Lemberg 39ce3ac499 * Version 2.8.1 released.
=========================

Tag sources with `VER-2-8-1'.

* docs/VERSION.TXT: Add entry for version 2.8.1.
* docs/CHANGES: Updated.

* 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/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/2.8.1/, s/28/281/.

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

* builds/unix/configure.raw (version_info): Set to 21:0:15.
* CMakeLists.txt (VERSION_PATCH): Set to 1.
2017-09-16 19:08:17 +02:00
Alexei Podtelezhnikov d1b6c6e211 Typo. 2017-09-10 22:35:21 -04:00
Alexei Podtelezhnikov 410f3799b6 [smooth] Harmony LCD rendering.
This is a new technology for LCD-optimized rendering. It capitalizes
on the fact that each color channel grid is shifted by a third of a
pixel.  Therefore it is logical to render 3 separate monochrome
bitmaps shifting the outline by 1/3 pixel, and then combine them.
Importantly, the resulting output does not require additional LCD
filtering.

* src/smooth/ftsmooth.c (ft_smooth_render_generic)
[!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Implement new LCD-optimized
rendering.

* include/freetype/ftlcdfil.h, include/freetype/freetype.h,
include/freetype/config/ftoption.h, devel/ftoption.h: Updated
documentation.
2017-08-08 22:29:51 -04:00
Werner Lemberg b5cab5c9ca Document how to scale manually. 2017-07-12 21:58:35 +02:00
Alexei Podtelezhnikov 762de5e285 Tweak suggested use of `lsb_delta' and `rsb_delta'. 2017-07-06 22:31:57 -04:00
Werner Lemberg 79e3789f81 * src/winfonts/winfnt.c (FNT_Face_Init): Don't set active encoding.
FreeType only sets a default active encoding for Unicode.
2017-06-14 07:51:04 +02:00
Werner Lemberg fbe2fe4c75 Handle some integer overflow run-time errors (#46149, #48979).
This commit (mainly for 32bit CPUs) is the first of a series of
similar commits to handle known integer overflows.  Basically, all
of them are harmless, since they affect rendering of glyphs only,
not posing security threats.  It is expected that fuzzying will show
up more overflows, to be fixed in due course.

The idea is to mark places where overflows can occur, using macros
that simply cast to unsigned integers, because overflow arithmetic
is well defined in this case.  Doing so suppresses run-time errors
of sanitizers without adding computational overhead.

* include/freetype/internal/ftcalc.h (OVERFLOW_ADD_INT,
OVERFLOW_SUB_INT, OVERFLOW_MUL_INT, OVERFLOW_ADD_LONG,
OVERFLOW_SUB_LONG, OVERFLOW_MUL_LONG): New macros.

* src/base/ftcalc.c (FT_RoundFix, FT_CeilFix, FT_Matrix_Multiply,
FT_Matrix_Multiply_Scaled, FT_Vector_Transform_Scaled,
ft_corner_orientation): Use new macros.

* src/base/ftoutln.c (FT_Outline_Get_Orientation): Use new macros.
2017-05-29 13:29:28 +02:00
Werner Lemberg a12a34451a * Version 2.8 released.
=======================

Tag sources with `VER-2-8'.

* docs/VERSION.TXT: Add entry for version 2.8.
* docs/CHANGES: Updated.

* 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/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.7.1/2.8/, s/271/28/.

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

* builds/unix/configure.raw (version_info): Set to 20:0:14.
* CMakeLists.txt (VERSION_MINOR): Set to 8.
(VERSION_PATCH): Set to 0.
2017-05-13 06:29:04 +02:00
Werner Lemberg 8cd31eb7b0 */*: s/backwards compatibility/backward compatibility/. 2017-05-03 23:54:29 +02:00
Werner Lemberg ba40054c2d [autofit] Remove `slight' auto-hint mode again.
A poll on freetype-devel favoured changes directly applied to
`light'.

* include/freetype/freetype.h (FT_LOAD_TARGET_SLIGHT,
FT_RENDER_MODE_SLIGHT): Removed.

* src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c
(af_latin_hints_init), src/autofit/aflatin2.c
(af_latin2_hints_init): Revert change from 2017-04-22.

* src/autofit/afloader.c (af_loader_load_glyph) Remove references to
FT_RENDER_MODE_SLIGHT.
[AF_CONFIG_OPTION_TT_SIZE_METRICS]: Enable TrueType-like metrics
unconditionally.

* src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Revert change from
2017-04-22.

* src/base/ftobjs.c (FT_Load_Glyph): Revert change from 2017-04-22.

* src/pshinter/pshalgo.c (ps_hints_apply): Revert change from
2017-04-22.

* src/smooth/ftsmooth.c (ft_smooth_render): Revert change from
2017-04-22.

* docs/CHANGES: Updated.
2017-05-02 12:32:19 +02:00
Werner Lemberg 785833d96e * src/truetype/ttdriver.c (tt_size_request): Properly check `error'.
Reported by Earnestly <zibeon@googlemail.com> in

  http://lists.nongnu.org/archive/html/freetype/2017-04/msg00031.html
2017-04-29 06:47:14 +02:00
Werner Lemberg 0a5315d141 Introduce AF_CONFIG_OPTION_TT_SIZE_METRICS configuration option.
* include/freetype/config/ftoption.h
(AF_CONFIG_OPTION_TT_SIZE_METRICS): New option, commented out by
default.

* src/autofit/afloader.c (af_loader_load_glyph): Use
AF_CONFIG_OPTION_TT_SIZE_METRICS to guard the corresponding code.
2017-04-27 13:02:24 +02:00
Werner Lemberg ab10ffcdd5 * include/freetype/freetype.h (FT_Render_Mode): Fix order.
This retains backwards compatibility.

Noted by Alexei.
2017-04-26 13:41:40 +02:00
Werner Lemberg 5aa6716a5e Add new `slight' auto-hinting mode.
This mode uses fractional advance widths and doesn't scale glyphs
horizontally, only applying vertical scaling and hinting.

At the same time, the behaviour of the `light' auto-hinter gets
restored for backwards compatibility: Both vertical and horizontal
scaling is again based on rounded metrics values (this was changed
in a commit from 2017-03-30 as a side effect).  To be more precise,
the behaviour is restored for TrueType fonts only; for other font
formats like Type 1, this is a new feature of the `light' hinting
mode.

* include/freetype/freetype.h (FT_LOAD_TARGET_SLIGHT): New macro.
(FT_RENDER_MODE_SLIGHT): New render mode.

* include/freetype/internal/ftobjs.h (FT_Size_InternalRec): Add
`autohint_mode' and `autohint_metrics' fields.

* src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c
(af_latin_hints_init), src/autofit/aflatin2 (af_latin2_hints_init):
Updated.

* src/autofit/afloader.c (af_loader_embolden_glyph_in_slot): Use
`autohint_metrics'.
(af_loader_load_glyph): s/internal/slot_internal/.
Initialize `autohint_metrics' and `autohint_mode' depending on
current auto-hint mode.
Use `autohint_metrics'.
Updated.

* src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Updated.

* src/base/ftobjs.c (FT_Load_Glyph): Updated.
(FT_New_Size): Allocate `internal' object.

* src/pshinter/pshalgo.c (ps_hints_apply): Updated.

* src/smooth/ftsmooth.c (ft_smooth_render): Updated.
2017-04-26 11:39:53 +02:00
Werner Lemberg 69da54cacc Document that some FT_Size_Metrics values are always rounded. 2017-04-26 09:58:28 +02:00
Werner Lemberg 7fa5743ae6 freetype.h: Avoid non-ASCII character (#50858). 2017-04-23 13:57:37 +02:00
Alexei Podtelezhnikov 54b58097ee [autofit] Disable stem adjustment for `FT_LOAD_TARGET_LCD'.
* include/freetype/freetype.h (FT_LOAD_TARGET_LCD): Document it.
* src/autofit/afcjk.c (af_cjk_hints_init): Updated.
* src/autofit/aflatin.c (af_latin_hints_init): Ditto.
* src/autofit/aflatin2.c (af_latin2_hints_init): Ditto.
2017-03-31 22:41:53 -04:00
Werner Lemberg 34010f7c47 [sfnt] Implement PS names for font instances [3/3].
Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT.

* include/freetype/internal/tttypes.h (TT_FaceRec): New fields
`var_postscript_prefix' and `var_postscript_prefix_len'.

* src/sfnt/sfdriver.c: Include FT_TRUETYPE_IDS_H.
(sfnt_is_alphanumeric): New wrapperfunction for `ft_isalnum'.
(get_win_string, get_apple_string): Remove `const' from return
value.
(MAX_VALUE_DESCRIPTOR_LEN, MAX_PS_NAME_LEN): New macros.
(hexdigits): New array.
(sfnt_get_var_ps_name): New function, implementing Adobe TechNote
5902 to construct a PS name for a variation font instance.
(sfnt_get_ps_name): Call `sfnt_get_var_ps_name' for font instances.

* src/sfnt/sfobjs.c (sfnt_done_face): Updated.

* src/truetype/ttgxvar.c (tt_set_mm_blend): Reset
`face->postscript_name' to trigger recalculation for new instance
parameters.
2017-03-14 21:50:22 +01:00
Alexei Podtelezhnikov 7d7aae1de3 Typos. 2017-03-07 22:21:26 -05:00
Werner Lemberg f27992f295 Minor documentation fixes. 2017-03-06 20:45:08 +01:00
Alexei Podtelezhnikov 73a7ce3d00 * include/freetype/freetype.h (FT_Face_Properties): Fix bad example, typo. 2017-02-21 21:43:37 -05:00
Werner Lemberg ca1486c32a [cff] Introduce `random-seed' property (1/2).
We need this for support of the `random' operator.

* include/freetype/ftcffdrv.h (FT_PARAM_TAG_RANDOM_SEED): New macro.

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

* src/cff/cffobjs.h (CFF_DriverRec): New field `random_seed'.
2017-02-20 08:55:26 +01:00
Nikolaus Waxweiler 2b0ac18990 Add face property for stem darkening.
* include/freetype/ftautoh.h (FT_PARAM_TAG_STEM_DARKENING): New
macro.

* include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Add
`no_stem_darkening' field.

* src/autofit/afloader.c (af_loader_load_glyph),
src/autofit/afmodule.c (af_property_set): Updated.

* src/base/ftobjs.c: Include FT_AUTOHINTER_H.
(ft_open_face_internal): Updated.
(FT_Face_Properties): Handle FT_PARAM_TAG_STEM_DARKENING.

* src/cff/cf2ft.c (cf2_decoder_parse_charstrings): Updated.

* src/cff/cffdrivr.c (cff_property_set): Updated.
2017-02-18 10:42:23 +01:00
Nikolaus Waxweiler 2e9519885b Add face property for LCD filter weights.
* include/freetype/ftlcdfil.h (FT_PARAM_TAG_LCD_FILTER_WEIGHTS,
FT_LCD_FILTER_FIVE_TAPS): New macros.
(FT_LcdFiveTapFilter): New typedef.

* include/freetype/ftobjs.h (FT_Face_InternalRec)
[FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Add `lcd_weights' field.
(FT_Bitmap_LcdFilterFunc): Change third argument to weights array.
(ft_lcd_filter_fir): New prototype.
(FT_LibraryRec): Updated.

* src/base/ftlcdfil.c (_ft_lcd_filter_fir): Renamed to...
(ft_lcd_filter_dir): ... this base function.
Updated.
(_ft_lcd_filter_legacy): Updated.
(FT_Library_SetLcdFilterWeights, FT_Library_SetLcdFilter): Updated.

* src/base/ftobjs.c (ft_open_face_internal): Updated.
(FT_Face_Properties): Handle FT_PARAM_TAG_LCD_FILTER_WEIGHTS.

* src/smooth/ftsmooth.c (ft_smooth_render_generic)
[FT_CONFIG_OPTION_SUBPIXEL_RENDERING: Handle LCD weights from
`FT_Face_Internal'.
2017-02-16 20:45:45 +01:00
Nikolaus Waxweiler 64cdee7348 Add new function `FT_Face_Properties'.
This commit provides the framework, to be filled with something
useful in the next commits.

* include/freetype/freetype.h (FT_Face_Properties): Declare.

* src/base/ftobjs.c (FT_Face_Properties): New function.
2017-02-15 08:06:35 +01:00
Werner Lemberg 144d10873d Add comment that we don't use VORG table. 2017-02-06 07:54:59 +01:00
Werner Lemberg 1c19b54999 freetype.h: Improve Unicode Variation Sequence documentation. 2017-01-28 11:39:51 +01:00
Werner Lemberg 464b16ba46 s/GB2312/PRC/.
* include/freetype/freetype.h (FT_ENCODING_PRC): New enum value.
(FT_ENCODING_GB2312): Deprecated.

* include/freetype/ttnameid.h (TT_MS_ID_PRC): New macro.
(TT_MS_ID_GB2312): Deprecated.

* src/sfnt/sfobjs.c (sfnt_find_encoding): Updated.

* docs/CHANGES: Updated.
2017-01-27 08:45:46 +01:00
Alexei Podtelezhnikov 983fb0df5a Typos. 2017-01-24 23:56:59 -05:00
Werner Lemberg 693f56ffcd [base] Add `FT_Set_Default_Properties' (#49187).
* include/freetype/ftmodapi.h: Add declaration.

* src/base/ftinit.c (ft_set_default_properties): Renamed to...
(FT_Set_Default_Properties): ... this.
(FT_Init_FreeType): Updated.

* docs/CHANGES: Updated.
2017-01-23 12:53:18 +01:00
Alexei Podtelezhnikov a32270ae0e Typos. 2017-01-19 23:01:44 -05:00
Werner Lemberg 8013d89f7f ftsnames.h, ttnameid.h, tttables.h: Revise documentation.
Show more macros in the reference: TT_MAC_LANGID_XXX, TT_MS_LANGID_XXX,
TT_NAME_ID_XXX, TT_UCR_XXX.

This commit is viewed best with

  git diff --color-words='[^*/ ]+'
2017-01-17 12:39:53 +01:00
Werner Lemberg 8665e3f4af freetype.h: Revise documentation.
This commit is viewed best with

  git diff --color-words='[^*/ ]+'
2017-01-15 15:23:06 +01:00
Werner Lemberg 563ae78022 Update copyright year. 2017-01-04 20:16:34 +01:00
Werner Lemberg 069083cccd * Version 2.7.1 released.
=========================

Tag sources with `VER-2-7-1'.

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

* 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/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.7/2.7.1/, s/27/271/.

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

* builds/unix/configure.raw (version_info): Set to 19:0:13.
* CMakeLists.txt (VERSION_PATCH): Set to 1.
2016-12-30 21:16:46 +01:00
Werner Lemberg 9e7748f55c Improve documentation of `lsb_delta' and `rsb_delta' (#19044). 2016-11-17 08:04:52 +01:00
Werner Lemberg d8a83232af Minor documentation improvement. 2016-11-06 12:33:18 +01:00
Werner Lemberg 37e193e935 Introduce a way of quickly retrieving (embedded) bitmap metrics.
`FT_Load_Glyph' doesn't generate a bitmap for a non-bitmap glyph
until the user calls `FT_Render_Glyph'.  However, it always
allocates memory for bitmaps and copies or decodes the contents of a
bitmap glyph, which can be quite slow for PNG data.

* include/freetype/freetype.h (FT_LOAD_BITMAP_METRICS_ONLY): New
macro.

* src/base/ftobjs.c (FT_Load_Glyph): Unset FT_LOAD_RENDER if
FT_LOAD_BITMAP_METRICS_ONLY is used.

* src/sfnt/ttsbit.c (tt_sbit_decoder_alloc_bitmap,
tt_sbit_decoder_load_bitmap): Add argument to control allocation of
the glyph slot.
(tt_sbit_decoder_load_image, tt_sbit_decoder_load_compound,
tt_face_load_sbit_image): Updated.

* src/pcf/pcfdrivr.c (PCF_Glyph_Load): Quickly exit if
`FT_LOAD_BITMAP_METRICS_ONLY' is set.

* src/pfr/pfrsbit.c, src/pfr/pfrsbit.h (pfr_slot_load_bitmap): Add
argument to control allocation of the glyph slot.
* src/pfr/pfrobjs (pfr_slot_load): Updated.

* src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto.

* docs/CHANGES: Updated.
2016-11-06 12:32:51 +01:00
Werner Lemberg bfa83bdc27 Comments. 2016-09-29 19:51:28 +02:00
Werner Lemberg d609b7c158 [sfnt] Don't provide (completely) broken strike data.
FreeType tries to sanitize strike header data; we now reject
completely broken ones.

* include/freetype/internal/tttypes.h (TT_FaceRec): New
`sbit_strike_map' array pointer.

* src/base/ftobjs.c (FT_Match_Size): Reject matches where either
width or height would be zero.
Add tracing message in case of error.

* src/sfnt/sfobjs.c (sfnt_load_face): Populate `sbit_strike_map',
only using (more or less) valid strike header data for
FT_Face's `available_sizes' array.
(sfnt_done_face): Updated.

* src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Use
`sbit_strike_map'.
(tt_face_load_strike_metrics): Improve tracing.

* src/truetype/ttdriver.c (tt_size_select): Use `sbit_strike_map'.
2016-09-09 22:11:07 +02:00
Werner Lemberg d2d5968aed * Version 2.7 released.
=======================

Tag sources with `VER-2-7'.

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

* 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/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.6.5/2.7/, s/265/27/.

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

* builds/unix/configure.raw (version_info): Set to 18:6:12.
* CMakeLists.txt (VERSION_MINOR): Set to 7.
(VERSION_PATCH): Set to 0.

* docs/CHANGES: Updated.
2016-09-08 09:04:32 +02:00
Werner Lemberg 4927953f6c MInor. 2016-08-22 07:30:38 +02:00
Werner Lemberg 6432b8c490 Update documentation of size requests. 2016-08-21 10:50:46 +02:00
Werner Lemberg ff655437e3 * include/freetype/freetype.h (FT_IS_NAMED_INSTANCE): New macro. 2016-07-14 15:01:55 +02:00
Werner Lemberg f9b1871ded * Version 2.6.5 released.
=========================

Tag sources with `VER-2-6-5'.

* include/freetype/config/ftoption.h
(TT_CONFIG_OPTION_SUBPIXEL_HINTING): Comment out.

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

* 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/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.6.4/2.6.5/, s/264/265/.

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

* builds/unix/configure.raw (version_info): Set to 18:5:12.
* CMakeLists.txt (VERSION_PATCH): Set to 5.

* docs/CHANGES: Updated.
2016-07-12 06:18:49 +02:00
Werner Lemberg d80fe69651 * Version 2.6.4 released.
=========================

Tag sources with `VER-2-6-4'.

* docs/VERSION.TXT: Update documentation and bump version number to
2.6.4.

* 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/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.6.3/2.6.4/, s/263/264/.

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

* builds/unix/configure.raw (version_info): Set to 18:4:12.
* CMakeLists.txt (VERSION_PATCH): Set to 4.

* docs/CHANGES: Updated.
2016-07-05 15:40:19 +02:00
Werner Lemberg d89f64627b More info on `FT_Err_Glyph_Too_Big'. 2016-06-25 08:14:36 +02:00
Alexei Podtelezhnikov cdc8f4d933 Duplicates. 2016-05-07 23:17:57 -04:00
Alexei Podtelezhnikov 500bcbdded Duplicates. 2016-05-07 22:28:43 -04:00
Werner Lemberg d9fb2175c4 Minor.
* include/freetype/freetype.h (FT_HAS_*, FT_IS_*): Protect macro
argument with parentheses.
2016-04-24 15:27:32 +02:00
Alexei Podtelezhnikov bbcb97793e Typos. 2016-04-13 00:11:52 -04:00
Alexei Podtelezhnikov e85422606d Typos. 2016-04-08 23:21:34 -04:00
Alexei Podtelezhnikov 34207080c6 Typos. 2016-04-08 00:38:49 -04:00
Werner Lemberg 44accb9e2e Version 2.6.3 released. 2016-02-08 19:51:40 +01:00
Nikolaus Waxweiler 1d8d0b4ef9 Remove unpatented hinter (3/3).
* include/freetype/config/ftoption.h
(TT_CONFIG_OPTION_UNPATENTED_HINTING): Remove.

* include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Remove
`ignore_unpatented_hinter' field.
Update users.
(FT_DEBUG_HOOK_UNPATENTED_HINTING): Remove.
Update users.

* include/freetype/internal/tttypes.h (TT_FaceRec): Remove
`unpatented_hinting' field.
Update users.

* src/base/ftpatent.c (_tt_check_patents_in_range,
_tt_check_patents_in_table, _tt_face_check_patents): Remove.
(FT_Face_CheckTrueTypePatents, FT_Face_SetUnpatentedHinting):
Replace code with dummies.

* src/truetype/ttobjs.c (tt_face_init): Remove now defunct code.
* src/truetype/ttobjs.h (TT_GraphicsState): Remove `both_x_axis'
field.
2016-01-28 14:11:14 +01:00
Derek B. Noonburg 4cdfefd4bd [truetype] Add another tricky font.
* src/truetype/ttobjs.c (TRICK_SFNT_IDS_NUM_FACES): Increase.
(sfnt_id): Add variant of `DFKaiShu'.
2016-01-19 07:12:44 +01:00
Werner Lemberg 9adeab6452 Update copyright year. 2016-01-13 11:54:10 +01:00
Werner Lemberg 37412ff9f4 Don't use macro names that contain `__' [1/2].
Such macro names are reserved for both C and C++.

*/*: Replace macros of the form `__XXX_H__' with `XXX_H_'.
2016-01-12 21:37:13 +01:00
Alexei Podtelezhnikov 1b740a0076 Minor rearrangement. 2015-12-02 00:30:57 -05:00
Werner Lemberg 66cf29b1bc * Version 2.6.2 released.
=========================

Tag sources with `VER-2-6-2'.

* docs/VERSION.DLL: Update documentation and bump version number to
2.6.2.

* 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/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.6.1/2.6.2/, s/261/262/.

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

* builds/unix/configure.raw (version_info): Set to 18:2:12.
* CMakeLists.txt (VERSION_PATCH): Set to 2.

* docs/CHANGES: Updated.
2015-11-28 19:08:05 +01:00
Nikolaus Waxweiler 25b1330a4d Minor documentation improvements. 2015-11-28 18:07:53 +01:00
Nikolaus Waxweiler 01ce1c6a99 Change default LCD filter to be normalized and color-balanced.
Update documentation.

* src/base/ftlcdfil.c (FT_Library_SetLcdFilter): Update
`default_filter'.
2015-11-28 12:04:28 +01:00
Jan Alexander Steffens (heftig) ccd3188af1 Allow native CFF hinter in FT_RENDER_MODE_LIGHT.
Both the native CFF hinter and the auto-hinter now have a very
similar rendering style.

* include/freetype/freetype.h: Mention that FT_LOAD_TARGET_LIGHT no
longer implies FT_LOAD_FORCE_AUTOHINT.

* include/freetype/ftmodapi.h (FT_MODULE_DRIVER_HINTS_LIGHTLY): New
macro.

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

* src/cff/cffdrivr.c (cff_driver_class): Use it.

* src/base/ftobjs.c (FT_Load_Glyph): Update auto-hinter selection
logic.
2015-11-10 22:33:45 +01:00
Werner Lemberg 8cabd919ca * Version 2.6.1 released.
=========================

Tag sources with `VER-2-6-1'.

* docs/VERSION.DLL: Update documentation and bump version number to
2.6.1.

* 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/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.6/2.6.1/, s/26/261/.

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

* builds/unix/configure.raw (version_info): Set to 18:1:12.
* CMakeLists.txt (VERSION_PATCH): Set to 1.

* src/autofit/afmodule.c [AF_DEBUG_AUTOFIT]: Ensure C linking for
dumping functions.
2015-10-04 08:18:01 +02:00
Hin-Tak Leung 265ade8e80 Add new FT_LOAD_COMPUTE_METRICS load flag.
* include/freetype/freetype.h (FT_LOAD_COMPUTE_METRICS): New macro.
* src/truetype/ttgload.c (compute_glyph_metrics): Usage.
2015-09-26 14:51:30 +02:00
Werner Lemberg 5339c75ee6 [sfnt] Better checks for invalid cmaps (2/2) (#46019).
While the current code in `FT_Get_Next_Char' correctly rejects
out-of-bounds glyph indices, it can be extremely slow for malformed
cmaps that use 32bit values.  This commit tries to improve that.

* src/sfnt/ttcmap.c (tt_cmap8_char_next, tt_cmap12_next,
tt_cmap12_char_map_binary, tt_cmap13_next,
tt_cmap13_char_map_binary): Reject glyph indices larger than or
equal to the number of glyphs.
2015-09-24 13:39:44 +02:00