Commit Graph

45 Commits

Author SHA1 Message Date
Werner Lemberg 82ce172669 The 'COLR' v1 API will no longer be experimental in the next release. 2023-01-19 07:17:14 +01:00
Werner Lemberg 65f8523706 Update all copyright notices. 2023-01-17 09:18:25 +01:00
Ivan Panchenko 05e1b37e3d * include/freetype/*: Fix documentation typos. 2022-10-24 06:52:06 +02:00
Dominik Röttsches 3414fef74f [sfnt] Support variable 'COLR' v1 color lines.
* include/freetype/ftcolor.h (FT_ColorStopIterator): Add field
`read_variable` to indicate whether a variation index base should be read.

* src/sfnt/ttcolr.c: (FT_PaintFormat_Internal): New enumerations
`FT_COLR_PAINTFORMAT_INTERNAL_VAR_LINEAR_GRADIENT`
`FT_COLR_PAINTFORMAT_INTERNAL_VAR_RADIAL_GRADIENT`, and
`FT_COLR_PAINTFORMAT_INTERNAL_VAR_SWEEP_GRADIENT`.
(read_color_line): New parameter `read_variable`; update callers.
(read_paint): Handle new enumerations.
2022-07-08 11:51:07 +02:00
Dominik Röttsches 117df36b4c [sfnt] Upgrade stop_offset to FT_Fixed from FT_F2Dot14 2022-06-22 09:33:20 +00:00
Ben Wagner a1ca701023 [sfnt] Correct FT_ColorStopIterator documentation.
* include/freetype/ftcolor.h (FT_ColorStopIterator): the user should not
 set `p` to NULL before calling `FT_Get_Colorline_Stops`. `p` and
`num_color_stops` are set by `FT_Get_Paint`. `p` and
`current_color_stop` are updated by `FT_Get_Colorline_Stops`.
2022-04-04 15:28:54 -04:00
Werner Lemberg d0cfb4e1b2 Update all copyright notices. 2022-01-11 10:54:10 +01:00
Dominik Röttsches d3d3ff76d1 [sfnt] Clarify `COLR` v1 FT_Paint* format representations
* include/freetype/ftcolor.h (FT_PaintLinearGradient,
FT_PaintRadialGradient, FT_PaintSweepGradient, FT_PaintTransform,
FT_PaintTranslate, FT_PaintScale, FT_PaintRotate, FT_PaintSkew): Clarify
16.16 fixed point representation of struct fields.
* src/sfnt/ttcolr.c (read_paint): Shift coordinates for
FT_PaintLinearGradient, FT_PaintRadialGradient, FT_PaintSweepGradient
accordingly.

Fixes: https://gitlab.freedesktop.org/freetype/freetype/-/issues/1110
2021-11-03 08:28:10 +00:00
Dominik Röttsches e40ae7569a [sfnt] Add missing blend mode 'plus' to 'COLR' v1.
* include/freetype/ftcolor.h (FT_Composite_Mode): Add missing blend mode
'plus' after it was added to the spec.
2021-08-09 19:25:26 +02:00
Dominik Röttsches 47cf8ebf4a [sfnt] Add API for retrieving a 'COLR' v1 'ClipBox' table.
The optional 'COLR' v1 glyph-specific clip box helps upstream graphics
libraries allocate a sufficiently large bitmap for a glyph without having to
traverse the glyph graph for that.  See

  https://github.com/googlefonts/colr-gradients-spec/issues/251

for background on the introduction of this specification change.

* include/freetype/ftcolor.h (FT_ClipBox): New structure.
(FT_Get_Color_Glyph_ClipBox): New function declaration.

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

* src/base/ftobjs.c (FT_Get_Color_Glyph_ClipBox): New function to link API
with SFNT implementation.

* src/sfnt/sfdriver.c (sfnt_interface): Updated.
* src/sfnt/ttcolr.c (Colr): New field `clip_list`.
(tt_face_load_colr): Parse global clip list offset.
(tt_face_get_color_glyph_clipbox): New function to find the clip box for a
glyph id from the clip list array.
* src/sfnt/ttcolr.h: Updated.
2021-08-07 14:44:05 +02:00
Dominik Röttsches 30a82e1e5d [sfnt] 'COLR' v1 PaintSweepGradient spec update
* src/sfnt/ttcolr.c (read_paint): PaintSweepGradient follows other
spec changes and now has the angles specified as F2DOT14, reflect
that in the implementation.
* include/freetype/ftcolor.h (FT_PaintSweepGradient): Update
documentation.
2021-07-29 06:12:51 +00:00
Dominik Röttsches 66189807b8 [sfnt] 'COLR' v1 PaintSkew related spec updates
* src/sfnt/ttcolr.c (read_paint): Implement spec changes around
PaintSkew, PaintSkewAroundCenter.  Update parsing to read shorter
values as changed in the spec.
* include/freetype/ftcolor.h (FT_PaintSkew): Update documentation.
2021-07-29 06:01:34 +00:00
Dominik Röttsches 48df0fa652 [sfnt] PaintRotate/PaintRotateAroundCenter spec updates
* src/sfnt/ttcolr.c (read_paint): Implement spec change where
PaintRotate and PaintRotateAroundCenter were split for a more
compact format definition.  Update parsing to read shorter values
as changed in the spec.
* include/freetype/ftcolor.h (FT_PaintRotate): Update documentation.
2021-07-29 05:59:30 +00:00
Dominik Röttsches 286da6c528 [sfnt] Support PaintScale in 'COLR' v1 parsing.
* include/freetype/ftcolor.h (FT_PaintFormat): Renumber values, add
`FT_COLR_PAINTFORMAT_SCALE`.
(FT_PaintScale): New structure to represent 'PaintScale*' tables.
(FT_COLR_Paint): Updated.

* src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration.
(read_paint): Parse 'PaintScale' and friends.
2021-07-01 06:49:03 +02:00
Werner Lemberg e1b1b5422c ftcolor.h: Minor grammar fix. 2021-06-29 06:07:00 +02:00
Dominik Röttsches 4cb21b9a92 [sfnt] s/PaintTransformed/PaintTransform/, s/transformed/transform/.
* include/freetype/ftcolor.h (FT_PaintTransformed, FT_PaintFormat,
FT_COLR_Paint): Do it to make it harmonize with other names such as
'PaintTranslate'.

* src/sfnt/ttcolr.c (read_paint, tt_face_get_paint): Ditto.
2021-06-22 20:50:48 +02:00
Dominik Röttsches 284eec1e18 Move 'COLR' API to `ftcolor.h`.
* include/freetype/freetype.h: Cut section layer managament
containing 'COLR' v0 and v1 API and move it to `ftcolor.h` as
requested by Werner on freetype-devel.
* include/freetype/ftcolor.h: Paste that section.
2021-06-22 20:33:33 +02:00
Werner Lemberg b6e8a71266 Update all copyright notices. 2021-01-17 07:18:48 +01:00
Werner Lemberg 1658685967 Remove redundant inclusion of `ft2build.h'.
* */*: Remove `#include <ft2build.h>' where possible.

* include/freetype/freetype.h: Remove cpp error about missing
inclusion of `ft2build.h'.
2020-06-13 21:15:45 +02:00
David Turner e13391333f Make macros for header file names optional.
We no longer have to take care of the 8.3 file name limit; this
allows us (a) to introduce longer, meaningful file names, and (b) to
avoid macro names in `#include' lines altogether since some
compilers (most notably Visual C++) doesn't support this properly.

*/*: Replace

   #include FOO_H

with

   #include <freetype/foo.h>

or something similar.  Also update the documentation.
2020-06-08 13:31:55 +02:00
Werner Lemberg e5038be704 Update all copyright notices. 2020-01-19 17:05:19 +01:00
Werner Lemberg 734d60f63c Another minor documentation improvement. 2019-08-06 20:38:17 +02:00
Werner Lemberg ad3443c931 Minor documentation improvement. 2019-08-05 10:00:41 +02:00
Werner Lemberg 4d51f78de9 More documentation updates.
In particular, mark the new behaviour of `FT_LOAD_COLOR' as experimental.
2019-02-23 11:21:48 +01:00
Werner Lemberg 7585997024 Update all copyright notices. 2019-02-23 10:07:09 +01:00
Werner Lemberg a346abc093 s/`....`/'....'/ for SFNT table tags in documentation. 2019-02-21 09:19:47 +01:00
Werner Lemberg 8de11f3def s/NULL/`NULL`/ in documentation. 2019-02-20 16:19:19 +01:00
Werner Lemberg f92fa39341 Minor documentation fixes. 2019-02-20 16:04:48 +01:00
Werner Lemberg f686ad46a3 Update copyright years. 2019-01-22 20:31:44 +01:00
Werner Lemberg 9789c75b1a More '...' vs. `...` fixes in API documentation. 2018-09-04 10:37:44 +02:00
Nikhil Ramakrishnan ae5d1a4cec * include/*.*: Convert comments to markdown.
This commit was created by applying scripts `markify.py' and
`markdown-format.bash' to all C header files, followed by minor
clean-up.

No change in functionality, of course.

Scripts used:
https://github.com/nikramakrishnan/freetype-docs.git: Commit dfce31e.

http://lists.nongnu.org/archive/html/freetype-devel/2018-08/msg00013.html:
With patches applied.
2018-08-25 16:16:56 +05:30
Werner Lemberg 7edc937fe6 s/palette_types/palette_flags/.
Suggested by Behdad.
2018-07-02 11:50:04 +02:00
Werner Lemberg 9027233f75 s/FT_PALETTE_USABLE_WITH_/FT_PALETTE_FOR_/.
* include/freetype/ftcolor.h, include/freetype/internal/sfnt.h,
src/sfnt/ttcolr.c: Do it.
2018-06-21 00:21:09 +02:00
Werner Lemberg 95f7341d81 More minor doc fixes. 2018-06-18 11:10:14 +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 b18f5e7c62 Minor doc fixes. 2018-06-11 09:02:25 +02:00
Werner Lemberg d8b8b6e34e s/FT_Palette/FT_Palette_Data/, s/palette/palette_data/.
* include/freetype/ftcolor.h, include/freetype/internal/tttypes.h,
src/base/ftcolor.c, src/sfnt/sfobjs.c, src/sfnt/ttcolr.c: Updated.
2018-06-10 21:37:15 +02:00
Werner Lemberg 44580515d8 Minor. 2018-06-07 06:49:44 +02:00
Werner Lemberg f87ced9dc9 ftcolor.h: Redesign API.
While going to implement it I noticed that I need access to most of
the `CPAL' elements; I thus plan to add a `cpal' field to
`TT_FaceRec', which makes most of the previously suggested API
functions obsolete because the fields will be directly accessable.
2018-06-06 17:49:17 +02:00
Werner Lemberg 7c7004d60c New `ftcolor.h' draft. 2018-06-06 17:37:51 +02: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 db7c406084 ftcolor.h: Improve API design, fix typos (#54011, #54014).
* include/freetype/ftcolor.h (FT_Palette_Get_Names): Replace with...
(FT_Palette_Get_Name_IDs): ... this function.
(FT_Palette_Get_Entry_Names): Replace with...
(FT_Palette_Get_Entry_Name_IDs): ... this function
s/FT_Palette_Set_Foreground_COlor/FT_Palette_Set_Foreground_Color/.
2018-05-30 21:23:10 +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 93363cd737 * include/freetype/ftcolor.h: New file.
This is an interface to the `CPAL' OpenType table.  No
implementation yet.
2018-05-20 22:50:36 +02:00