Commit Graph

25 Commits

Author SHA1 Message Date
Werner Lemberg d0cfb4e1b2 Update all copyright notices. 2022-01-11 10:54:10 +01:00
Nikolaus Waxweiler f1f9705f93 [afshaper] Fix hb_ot_tags_from_script deprecation warning.
* autofit/afshaper.c (af_shaper_get_coverage): Copy the source code
of the function as suggested in
https://github.com/harfbuzz/harfbuzz/issues/2737 and adjust to handle
at most three tags.
2021-01-17 17:33:50 +00:00
Werner Lemberg b6e8a71266 Update all copyright notices. 2021-01-17 07:18:48 +01:00
Werner Lemberg a6adb25626 * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`.
This ensures good logging output, with all lines having a proper
prefix (if requested).
2020-12-05 09:43:45 +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 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
Werner Lemberg a0dd16fb3d Don't use `trace_' prefix for FT_COMPONENT arguments.
* include/freetype/internal/ftdebug.h (FT_TRACE_COMP,
FT_TRACE_COMP_): New auxiliary macros to add `trace_' prefix.
(FT_TRACE): Use `FT_TRACE_COMP'.

*/* (FT_COMPONENT): Updated.
2018-08-15 18:13:17 +02:00
Werner Lemberg 9ac9060df0 [GSoC] src/*.*: Convert block comments to `light' style.
This 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 09:08:41 +02:00
Werner Lemberg e0015f7612 [autofit] Avoid potential SEGV if running out of memory.
Problem reported by Shailesh Mistry <shailesh.mistry@hotmail.co.uk>.

* src/autofit/afshaper.c (af_shaper_buf_create,
af_shaper_buf_destroy) [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Don't
allocate and free a four-byte buffer.  Instead, make those functions
no-ops; the calling functions will provide a pointer to a buffer
instead.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_metrics_check_digits),
src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_check_digits)
[!FT_CONFIG_OPTION_USE_HARFBUZZ]: Use pointer to local variable for
`shaper_buf'.
2018-05-08 11:51:16 +02:00
Werner Lemberg 0a0c22569d Update copyright year. 2018-01-02 09:33:57 +01:00
Behdad Esfahbod 90461c0137 [afshaper] Delay creating `hb_set' objects until needed.
In runs on Noto Naskh Arabic, this results in 89 sets created
instead of 340 before.  Makes auto-hinter setup with HarfBuzz
enabled 20% to 30% faster.

* src/autofit/afshaper.c (af_shaper_get_coverage): Implement it.
2017-10-14 08:42:07 +02:00
suzuki toshiya 21658c31f7 [autofit, sfnt] Fix for `make multi'.
* src/autofit/afshaper.c: Include FT_ADVANCE_H, to use
FT_Get_Advance() in it.
* src/sfnt/ttcmap.c: Include FT_SERVICE_POSTSCRIPT_CMAPS_H
to use PS_Unicodes in it, also include `ttpost.h' to use
tt_face_get_ps_name() in it.
2017-09-12 15:59:18 +09:00
Werner Lemberg 563ae78022 Update copyright year. 2017-01-04 20:16:34 +01:00
Werner Lemberg fb672897f8 [autofix] Complete last autofit commit.
Problem reported by Kostya Serebryany <kcc@google.com>.

* src/autofit/afshaper.c (af_shaper_get_coverage)
[!FT_CONFIG_OPTION_USE_HARFBUZZ]: Update signature.
2016-01-20 21:13:16 +01:00
Werner Lemberg ec776596ce [autofit] Fix handling of default script.
Patch taken from ttfautohint, commit
071ae2c00e0d67f9d19418f4fade1c23d27dc185.

There were two bugs.

  - We now use non-standard script tags like `khms' for special
    purposes.  However, HarfBuzz maps such tags to `DFLT', and
    without this commit the associated lookups were incorrectly
    assigned to the non-standard tags.

  - Let's assume we have a Bengali font, and the font's `DFLT'
    script tag handles the necessary lookups for Bengali, too.
    Without this commit, the `DFLT' lookups were assigned to
    ttfautohint's default script (usually `latn') before the
    standard lookups for Bengali were handled.

    We now have the following order while searching for covered
    glyph indices.

      special features of scripts (e.g. `sups' for Cyrillic)
      Unicode mappings of scripts
      remaining features of scripts (especially important for Indic
        scripts)
      default features of default script

* src/autofit/afshaper.c, src/autofit/afshaper.h
(af_shaper_get_coverage): Add boolean parameter to indicate default
script.
Update all callers.

* src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
Fix search order for coverages.
2016-01-19 19:33:57 +01:00
Werner Lemberg 9adeab6452 Update copyright year. 2016-01-13 11:54:10 +01:00
Werner Lemberg b0de5a82f1 [autofit] Start implementing hinting direction (up/down, down/up).
Right now, it does nothing.

* src/autofit/afscript.h: Add another parameter to `SCRIPT',
specifying hinting direction.

* src/autofit/afglobal.c, scr/autofit/afglobal.h,
src/autofit/afpic.c, src/autofit/afranges.h, src/autofit/afshaper.c,
src/autofit/aftypes.h: Extend `SCRIPT' definitions.
2015-12-23 23:25:03 +01:00
Werner Lemberg 4fe3b55d0b [autofit] Restore OpenType feature check.
This was removed while rewriting the HarfBuzz interface.

* src/autofit/afglobal.h (AF_FaceGlobalsRec): Add `hb_buf' field to
hold internal HarfBuzz buffer, needed for feature comparison.

* src/autofit/afglobal.c (af_face_globals_new,
af_face_globals_free): Initialize and destroy `hb_buf'.

* src/autofit/afshaper.c (af_shaper_get_cluster): Compare character
(cluster) with and without applied feature.

* src/autofit/aflatin.c (af_latin_metrics_init_blues): Fix tracing
message.
2015-12-11 08:08:48 +01:00
Werner Lemberg 3c3d7c212e Another typo. 2015-12-10 11:54:41 +01:00
Werner Lemberg 93fdf4eb89 Formatting. 2015-12-10 11:52:08 +01:00
Werner Lemberg b38ca3cbeb [autofit] Typos.
* src/autofit/afshaper.c (af_shaper_buf_create, af_shaper_get_elem)
[!FT_CONFIG_OPTION_USE_HARFBUZZ]: Make it compile.
2015-12-06 19:48:31 +01:00
Werner Lemberg 24aa9c665e [autofit] Rewrite HarfBuzz interface to support character clusters.
Scripts like Khmer have blue zones that can't be directly
represented by Unicode characters.  Instead, it is necessary to let
HarfBuzz convert character clusters into proper glyph representation
forms, then deriving the blue zone information from the resulting
glyphs.

* src/autofit/hbshim.c, src/autofit/hbshim.h: Replaced by...
* src/autofit/afshaper.c, src/autofit/afshaper.h: ... these two new
files, providing a new API to access HarfBuzz.

The new API manages a HarfBuzz buffer with `af_shaper_buf_create'
and `af_shaper_buf_destroy'.  The buffer receives a UTF8 encoded
string with function `af_shaper_get_cluster', and the resulting
glyph data (indices, advance widths, vertical offsets) can be
iteratively accessed with function `af_shaper_get_elem'.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated.

* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_check_digits):
Updated.

* include/freetype/internal/fttrace.h: s/afharfbuzz/afshaper/.

* src/autofit/afglobal.c: s/hbshim.h/afshaper.h/.
(af_face_globals_compute_style_coverage): Updated.

* src/autofit/afglocal.h: s/hbshim.h/afshaper.h/.

* src/autofit/autofit.c: s/hbshim.c/afshaper.c/.

* src/autofit/Jamfile, src/autofit/rules.mk (AUTOF_DRV_SRC):
Updated.
2015-12-06 18:52:41 +01:00