Commit Graph

81 Commits

Author SHA1 Message Date
Moazin Khatti 97c09a803e Add `FT_Glyph` support for OT-SVG glyphs.
* include/freetype/ftglyph.h (FT_SvgGlyphRec, FT_SvgGlyph): New structure.

* src/base/ftglyph.c: Include `otsvg.h`.
(ft_svg_glyph_init, ft_svg_glyph_done, ft_svg_glyph_copy,
ft_svg_glyph_transform, ft_svg_glyph_prepare): New function.
(ft_svg_glyph_class): New class.
(FT_New_Glyph, FT_Glyph_To_Bitmap): Updated to handle OT-SVG glyphs.
* src/base/ftglyph.h: Updated.
2022-01-20 16:45:18 +00:00
Moazin Khatti f93a897afe Add code to load OT-SVG glyph documents.
* include/freetype/config/ftheader.h (FT_OTSVG_H): New macro.
* include/freetype/freetype.h (FT_FACE_FLAG_SVG, FT_HAS_SVG): New macros.
(FT_LOAD_SVG_ONLY): New internal macro.
* include/freetype/ftimage.h (FT_Glyph_Format): New enumeration value
`FT_GLYPH_FORMAT_SVG`.
* include/freetype/internal/ftobjs.h (FT_GLYPH_OWN_GZIP_SVG): New macro.
* include/freetype/internal/fttrace.h: Add `ttsvg` for `ttsvg.c`.
* include/freetype/internal/sfnt.h(load_svg, free_svg, load_svg_doc): New
functions.
* include/freetype/internal/tttypes.h (TT_FaceRec): Add `svg` for
the SVG table.
* include/freetype/otsvg.h (FT_SVG_DocumentRec): New structure to hold the
SVG document and other necessary information of an OT-SVG glyph in a glyph
slot.
* include/freetype/tttags.h (TTAG_SVG): New macro.

* src/base/ftobjs.c: Include `otsvg.h`.
(ft_glyphslot_init): Allocate `FT_SVG_DocumentRec` in `slot->other`
if the SVG table exists.
(ft_glyphslot_clear): Free it upon clean-up if it is a GZIP compressed
glyph.
(ft_glyphslot_done): Free the document data if it is a GZIP compressed
glyph.
(FT_Load_Glyph): Don't auto-hint SVG documents.

* src/cache/ftcbasic.c (ftc_basic_family_load_glyph): Add support for
FT_GLYPH_FORMAT_SVG.

* src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttsvg.c`.
* src/sfnt/sfdriver.c: Include `ttsvg.h`.
(sfnt_interface): Add `tt_face_load_svg`, `tt_face_free_svg` and
`tt_face_load_svg_doc`.
* src/sfnt/sfnt.c: Include `ttsvg.c`.
* src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Add code to load and
free data of the the SVG table.
* src/sfnt/ttsvg.c: New file, implementing `tt_face_load_svg`,
`tt_face_free_svg` and `tt_face_load_svg_doc`.
* src/sfnt/ttsvg.h: Declarations of the SVG functions in
`ttsvg.c`.
2022-01-20 16:45:18 +00:00
Werner Lemberg d0cfb4e1b2 Update all copyright notices. 2022-01-11 10:54:10 +01:00
Alexei Podtelezhnikov d92aa23fd7 Decorate const arguments.
* src/base/ftglyph.c (FT_Glyph_Transform, FT_Glyph_To_Bitmap): Do it.
* include/freetype/ftglyph.h (FT_Glyph_Transform, FT_Glyph_To_Bitmap):
Do it.
2021-08-22 13:12:45 -04: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
Alexei Podtelezhnikov 81445c034a Doc polishing. 2019-06-22 22:54:57 -04:00
Werner Lemberg bf04c59249 Minor doc fixes. 2019-02-25 06:32:26 +01:00
Werner Lemberg 7585997024 Update all copyright notices. 2019-02-23 10:07:09 +01:00
Werner Lemberg f686ad46a3 Update copyright years. 2019-01-22 20:31:44 +01:00
Alexei Podtelezhnikov 8d517e679b Clarification. 2018-11-10 15:47:48 -05: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 86e7385342 Minor comment formatting. 2018-08-06 10:24:08 +02:00
Werner Lemberg 95f7341d81 More minor doc fixes. 2018-06-18 11:10:14 +02:00
Alexei Podtelezhnikov b1a3c59f8d [base] Introduce `FT_New_Glyph'.
This function facilitates access to full capabilities of FreeType
rendering engine for custom glyphs. This can be quite useful for
consistent rendering of mathematical and chemical formulas, e.g.

  https://bugs.chromium.org/p/chromium/issues/detail?id=757078

* include/freetype/ftglyph.h, src/base/ftglyph.c (FT_New_Glyph): New
function.
2018-06-17 22:33:29 -04: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
Nikhil Ramakrishnan a150b5ab53 Minor formatting. 2018-06-16 15:53:15 +05:30
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 78db8a2570 Typo. 2018-05-13 11:53:01 +02:00
Werner Lemberg 0a0c22569d Update copyright year. 2018-01-02 09:33:57 +01:00
Werner Lemberg c3cbb440af Use ASCII only in public header files (#50858). 2017-12-07 16:26:36 +01:00
Werner Lemberg a607e3919d Minor comment. 2017-06-01 17:03:07 +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
Alexei Podtelezhnikov a32270ae0e Typos. 2017-01-19 23:01:44 -05:00
Werner Lemberg 563ae78022 Update copyright year. 2017-01-04 20:16:34 +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
Werner Lemberg 392cf22f8a Another adjustment to header locations.
This change is a result of a discussion thread on freetype-devel

  http://lists.nongnu.org/archive/html/freetype-devel/2015-06/msg00041.html

Re-introduce the `freetype2' subdirectory for all FreeType header
files after installation, and rename the `freetype2' subdirectory in
the git repository to `freetype'.

* include/freetype2: Renamed to...
* include/freetype: This.

* CMakeLists.txt (PUBLIC_HEADERS, PUBLIC_CONFIG_HEADERS,
PRIVATE_HEADERS): Updated.
Update creation of `ftconfig.h'.
Install generated `ftconfig.h'.

* Jamfile (HDRMACRO, RefDoc), autogen.sh: Updated.

* builds/amiga/include/config/ftconfig.h, builds/freetype.mk
(PUBLIC_DIR), builds/symbian/bld.inf, builds/toplevel.mk (work),
builds/unix/freetype2.in: Updated.

* builds/unix/freetype-config.in: Updated.
* builds/unix/configure.raw: Don't check for `rmdir'.
* builds/unix/unix-def.in (DELDIR): Use `rm -rf', which is portable
according to the autoconf info manual.
* builds/unix/install.mk (install, uninstall,
distclean_project_unix): Update and simplify.

* builds/wince/*, builds/windows/*: Updated.

* devel/ft2build.h, include/ft2build.h: Updated.

* include/freetype2/config/ftheader.h,
include/freetype2/internal/ftserv.h,
include/freetype2/internal/internal.h: Update all header file
macros.

* src/tools/chktrcmp.py (TRACE_DEF_FILES): Updated.

* docs/*: Updated.
2015-06-26 06:48:00 +02:00
Werner Lemberg fae3820764 Simplify header file hierarchy.
This large patch changes the header file directory layout from
`include/freetype/...' to `include/...', effectively removing one
level.  Since the file `ft2build.h' is also located in `include'
(and it stays there even after installation), all FreeType header
files are now in a single directory.

Applications that use (a) `freetype-config' or FreeType's
`pkg-config' file to get the include directory for the compiler, and
(b) the documented way for header inclusion like

  #include <ft2build.h>
  #include FT_FREETYPE_H
  ...

don't need any change to the source code.

* include/freetype/*: Move up to...
* include/*: ... this directory.

* builds/amiga/include/freetype/*: Move up to...
* builds/amiga/include/*: ... this directory.

*/*: Essentially do `s@/freetype/@/@' where appropriate.

* CMakeList.txt: Simplify.
* builds/unix/freetype-config.in, builds/unix/freetype2.in: For
`--cflags', return a single directory.
* builds/unix/install.mk (install): No longer try to remove `cache'
and `internal' subdirectories; instead, remove the `freetype'
subdirectory.
2013-11-13 08:55:46 +01:00
Werner Lemberg 00ea2a133b [doc] s/which/that/ where appropriate.
Note that this is a try by a non-native English speaker whose mother
language (German) doesn't have this distinction at all...
2013-09-03 11:33:10 +02:00
Alexei Podtelezhnikov a692170a23 Call it fixed-point. 2013-01-12 19:17:05 -05:00
Werner Lemberg b9baff23f4 Document BBox and CBox computation problems for tricky fonts. 2011-04-13 00:29:41 +02:00
Werner Lemberg e1e723012d Documentation typo. 2009-10-18 09:47:52 +02:00
Werner Lemberg 45f8c5e589 Minor typos. 2009-03-03 14:26:47 +00:00
Werner Lemberg da32d7054d Add one more example to the documentation of FT_Glyph_To_Bitmap. 2008-08-06 09:09:41 +00:00
Werner Lemberg 293a877a99 Minor documentation improvements. 2008-08-05 18:36:15 +00:00
Werner Lemberg c86f86112f Minor documentation improvement. 2008-08-05 11:18:45 +00:00
Werner Lemberg 8a9b63913f Improve navigation in API reference.
* src/tools/docmaker/tohtml.py (html_header_3): Renamed to...
(html_header_6): This.
(html_header_3, html_header_3i, html_header_4, html_header_5,
html_header_5t): New strings.
(toc_footer_start, toc_footer_end): New strings.
(HtmlFormatter::html_header): Updated.
(HtmlFormatter::html_index_header, HtmlFormatter::html_toc_header):
New strings.
(HtmlFormatter::index_enter): Use `html_index_header'.
(HtmlFormatter::index_exit): Print `html_footer'.
(HtmlFormatter::toc_enter): Use `html_toc_header'.
(HtmlFormatter::toc_exit): Print proper footer.

Convert ~ to non-breakable space.

* src/tools/docmaker/tohtml.py (make_html_para): Implement it.
Update header files accordingly.

Many other minor documentation fixes.
2008-06-26 19:56:51 +00:00
Werner Lemberg 8271e5e443 whitespace 2008-04-13 21:59:29 +00:00
Werner Lemberg e12a471f6a * src/tools/docmaker/tohtml.py (html_header_1): Use `utf-8' charset.
Convert some files to UTF-8.
2006-05-12 14:20:43 +00:00
Werner Lemberg 6756dc15ba * src/tools/docmaker/sources.py (re_source_keywords): Add word
boundary markers.
* src/tools/docmaker/content.py (re_field): Allow `.' in field names
(but not at the beginning or end).

* include/freetype/*: Many minor documentation improvements (adding
links, spelling errors, etc.).
2006-05-12 08:00:13 +00:00
Werner Lemberg 8a8c6022bf Formatting, copyright years, documentation. 2006-04-22 12:24:52 +00:00
David Turner 7dc7f21533 doc updates
- fixing FT_Stroker_New to use a FT_Library instead of a FT_Memory

i know, i know, the ChangeLog will be updated later
2006-04-13 16:31:02 +00:00
Werner Lemberg 5f5f6b3662 Fix documentation error. 2003-11-12 15:15:49 +00:00
Werner Lemberg ab3e914000 * include/freetype/*: Add a guard to all public header files which
load FT_FREETYPE_H to reject freetype.h from FreeType 1.
2003-11-04 07:44:19 +00:00
Werner Lemberg 7418415f48 Minor documentation improvements. 2003-10-18 16:56:13 +00:00
Werner Lemberg f9d864a916 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
* builds/unix/configure.ac (version_info): Set to 10:0:3.
* builds/unix/configure: Updated.
* builds/freetype.mk (refdoc): Fix --title.

* docs/CHANGES, docs/VERSION.DLL, README: Updated.

* src/tools/docmaker/sources.py (re_crossref): Fix regular
expression to handle trailing punctuation characters.
* src/tools/docmaker/tohtml.py (make_html_word): Updated.

* docs/release: New file.
2003-07-25 05:57:21 +00:00