6838 Commits

Author SHA1 Message Date
preversewharf45
1d5d8ff288 * src/sdf/ftsdfrend.c (sdf_shape_dump): Use %ld' to printf signed long'. 2020-08-02 16:33:18 +05:30
Anuj Verma
44e16a0be6 * src/sdf/ftsdfrend.c (ft_sdf_render): Don't negate unsigned integers. 2020-08-02 16:33:18 +05:30
Anuj Verma
4fcc1653ca * src/sdf/ftsdf.c: Use ASCII single quote ('). 2020-08-02 16:33:18 +05:30
Anuj Verma
ddf631729e [sdf] Added function to find shortest distance from a point to a cubic. 2020-08-02 16:33:18 +05:30
Anuj Verma
5baa2cefc6 * src/sdf/ftsdf.c (sdf_contour_get_min_distance): Use epsilon. 2020-08-02 16:33:18 +05:30
Anuj Verma
76e67227ec * src/sdf/ftsdf.c (sdf_shape_dump): Add more info to the debug output. 2020-08-02 16:33:18 +05:30
Anuj Verma
3e52d1a7a8 * src/sdf/ftsdf.c (MAX_NEWTON_DIVISIONS): Renamed to avoid confusion. 2020-08-02 16:33:18 +05:30
Anuj Verma
363f1e8de1 [sdf] Added Newton's method for conic curve. 2020-08-02 16:33:17 +05:30
Anuj Verma
be3b7d7945 * src/sdf/ftsdf.c: More comments and code style fix. 2020-08-02 16:33:17 +05:30
Anuj Verma
d0e3074738 [sdf] Make squared distances toggleable. 2020-08-02 16:33:17 +05:30
Anuj Verma
97474a7072 * src/sdf/ftsdf.c (get_min_distance_conic): Use 0, 1 in case of 0 roots. 2020-08-02 16:33:17 +05:30
Anuj Verma
f9b4f37433 [sdf] Added function to find shortest distance from a point to a conic. 2020-08-02 16:33:17 +05:30
Anuj Verma
5cbcab183a * src/sdf/ftsdf.c (get_min_distance_line): Minor bug 2020-08-02 16:33:17 +05:30
Anuj Verma
c8e3c5a420 * src/sdf/ftsdf.c: Refactored the code. 2020-08-02 16:33:17 +05:30
Anuj Verma
f1de833a9d [sdf] Added functions to solve polynomial equations. 2020-08-02 16:33:17 +05:30
Anuj Verma
92a5312036 * src/sdf/ftsdf.c: Use FT_16D16 instead of FT_Fixed to avoid confusion. 2020-08-02 16:33:17 +05:30
Anuj Verma
811b6a7177 * src/sdf/ftsdf.c (cube_root, arc_cos): Added a few math functions. 2020-08-02 16:33:17 +05:30
Anuj Verma
38df99a1b4 [sdf] Fixed compilation under gnumake. 2020-08-02 16:33:17 +05:30
Anuj Verma
96883decbb [sdf] Added function to resolve corners. 2020-08-02 16:33:17 +05:30
Anuj Verma
03e6debb80 [sdf] The module can now generate SDF for outline with only lines. 2020-08-02 16:33:17 +05:30
Anuj Verma
063b65d583 [sdf] Added function to find shortest distance from a point to a line. 2020-08-02 16:33:17 +05:30
Anuj Verma
186cc478ae * src/sdf/ftsdf.c: Manually iterate through the lists. 2020-08-02 16:33:17 +05:30
Anuj Verma
e9fce03032 [sdf] Added basic outline of the functions required to generate sdf. 2020-08-02 16:33:17 +05:30
Anuj Verma
6d4e00ae37 [sdf] Added `SDF_Raster_Params'. 2020-08-02 16:33:17 +05:30
Anuj Verma
3ebcbd7066 * include/freetype/ftimage.h (FT_RASTER_FLAG_): Added a new raster flag. 2020-08-02 16:33:16 +05:30
Anuj Verma
f02d1acb89 * src/sdf/ftsdf.c (sdf_shape_dump): Use FT_TRACEX' instead of printf'. 2020-08-02 16:33:16 +05:30
Anuj Verma
63c2ac5fae * src/sdf/ftsdf.c (sdf_shape_dump): Added debugging function. 2020-08-02 16:33:16 +05:30
Anuj Verma
2f0d349d8c [sdf] Added functions to de-allocate `SDF_' structs. 2020-08-02 16:33:16 +05:30
Anuj Verma
54ff90398a [sdf] Decompose outline and store it in a `SDF_Shape'. 2020-08-02 16:33:16 +05:30
Anuj Verma
38bc88ae6f [sdf] Added essential enums and structs required. 2020-08-02 16:33:16 +05:30
Anuj Verma
d21ceef7b4 [sdf] Added functionality to set and get module properties. 2020-08-02 16:33:16 +05:30
Anuj Verma
29c92db771 [sdf] Implemented a few functions required by a renderer module. 2020-08-02 16:33:16 +05:30
Anuj Verma
c9d1149923 * include/freetype/ftimage.h (FT_Render_Mode_): Added new pixel mode. 2020-08-02 16:33:16 +05:30
Anuj Verma
08ba8d1422 added new `FT_RENDER_MODE_SDF' 2020-08-02 16:33:16 +05:30
Anuj Verma
e408bda4f9 author check 2020-08-02 16:33:16 +05:30
preversewharf45
185d07b0cd added the structure of new `sdf' module 2020-08-02 16:33:16 +05:30
Alexei Podtelezhnikov
986a340dd5 Unbreak compilation. 2020-07-28 23:20:59 -04:00
Alexei Podtelezhnikov
f76f7fdecd Hide internal functions with SunPro.
* include/freetype/internal/compiler-macros.h
(FT_INTERNAL_FUNCTION_ATTRIBUTE) <__SUNPRO_C>: Define as __hidden.
2020-07-28 23:13:51 -04:00
Anuj Verma
3273521f40 Fix static compilation with Visual C.
* include/freetype/internal/compiler-macros.h
(FT_INTERNAL_FUNCTION_ATTRIBUTE) <_WIN32>: Define as empty.
2020-07-28 18:34:37 +02:00
Werner Lemberg
fffc303a7f Formatting, improving comments. 2020-07-28 18:33:15 +02:00
Priyesh Kumar
53be1753de Fix `-Wformat' compiler warnings.
* src/*: Fix format specifiers.

* builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
2020-07-28 07:33:40 +02:00
Werner Lemberg
8cfc41ae95 Fix `-Wformat' compiler warnings.
Problem reported by Priyesh kumar <priyeshkkumar@gmail.com>

* src/base/ftoutln.c (FT_Outline_Decompose): Fix number of arguments
to tracing macro.

* src/bdf/bdfdrivr.c (bdf_cmap_char_next, bdf_get_bdf_property):
Ditto.

* src/cache/ftcbasic.c (ftc_basic_family_get_count): Ditto.
Reformulate message.

* src/pcf/pcfdrivr.c (pcf_get_bdf_property): Ditto.

* src/sfnt/sfwoff2.c (woff2_open_font): Ditto.
Trace table offset, too.

* src/truetype/ttgxvar.c (ft_var_apply_tuple): Ditto.
2020-07-25 12:23:22 +02:00
Werner Lemberg
b6183ea369 * src/sfnt/sfwoff2.c (woff2_decompress): Fix compiler warning.
Reported by Hin-Tak.
2020-07-23 13:03:22 +02:00
David Turner
ee19a6cbbc Add .clang-format file
This file can be used to reformat FreeType sources and commits
using one of these methods:

- Direct formatting of a whole file:

    clang-format -i path/to/file

  For example, to reformat all sources at once:

    echo builds/unix/ftconfig.h.in $(git ls-files *.[hc]) | xargs clang-format -i

- Only reformat the changed lines in the current work directoy:

    git clang-format

The style settings in this file are very close to the FreeType
formatting style, with the following exceptions which are not supported
here:

- Mminimal 2-space margin on each non-empty line.
  (no left margin instead).

- 2 empty lines between variable declarations and statements in C blocks.
  (only 1 is kept).

    {
      int  x = ...;

      foo(x);
    }

  becomes

    {
      int x = ...;

      foo(x);
    }

- Aignment of declarations uses 2 spaces to separate types and variable
  names (only 1 space is kept).

     int  x;    =>   int x;
     int  y;         int y;

- The start used for output parameters in function signature should be
  near the variable name (always near the type).

    void foo(int* input_ptr, int *output_ptr)
      => void foo(int* input_ptr, int* output_ptr)
2020-07-16 15:51:06 +02:00
Werner Lemberg
b7c467b6ef [doc] Stem darkening is off by default for CFF driver.
Bug reported by Ishi Tatsuyuki <ishitatsuyuki@gmail.com>.
2020-07-15 09:15:25 +02:00
David Turner
5fe7c044c2 freetype.h (FT_Set_Transform): Minor documentation update.
In order to mention the limited accuracy of `FT_Matrix' coefficients
and encourage client code to perform the transform themselves with
floating point values instead.
2020-07-14 16:25:59 +02:00
Werner Lemberg
95de21ab19 README: Add information on contributing patches. 2020-07-14 08:32:45 +02:00
Werner Lemberg
c922ffa5d2 * builds/unix/configure.raw: Fix inclusion of `ftoption.h'. 2020-07-12 07:52:55 +02:00
Ben Wagner
b1286b32a9 Document `FT_Face_Rec_::box' with variable fonts (#54969).
As pointed out in the "Note:" in the section of

  https://docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview#variation-data-tables-and-miscellaneous-requirements

  ... the xMin, yMin, xMax, yMax, macStyle and lowestRecPPEM fields in
  the font header ('head') table are not supported by variation data and
  should only be used in relation to the default instance for the font.

Document that `FT_Face_Rec_::box' does not vary with OpenType variable
fonts.
2020-07-10 18:07:11 +02:00
Werner Lemberg
96fb73efd5 Fix clang warnings.
* include/freetype/internal/autohint.h
(FT_DECLARE_AUTOHINTER_INTERFACE): New macro.
* src/autofit/afmodule.h: Use it to declare
`af_autofitter_interface'.

* include/freetype/internal/ftobjs.h (FT_DECLARE_GLYPH): New macro.
* src/base/ftbase.h: Use it to declare `ft_bitmap_glyph_class' and
`ft_outline_glyph_class'.

* src/base/ftglyph.c: Include `ftbase.h'.

* src/cff/cffparse.c (cff_parser_run): Fix type of `t2_size'.

* src/pcf/pcfdrivr.c (pcf_cmap_char_next): Fix type of `result'.

* src/psaux/psauxmod.c (psaux_module_class): Use `FT_DEFINE_MODULE'.
* src/psaux/psauxmod.h: Declare `afm_parser_funcs',
`t1_cmap_classes', `cff_decoder_funcs', and `psaux_module_class'.

* src/pshinter/pshmod.c: Include `pshmod.h'.

* src/sfnt/sfwoff2.c (ROUND4, WRITE_SHORT): Fix implicit sign
conversion.
(compute_ULong_sum): Fix return type.
Fix implicit sign conversion.
(store_points): Fix type of `last_flag', `repeat_count', and `flag'.
Use casts to avoid warnings.
(reconstruct_glyf): Fix implicit sign conversion.
Use cast to avoid warning.
(get_x_mins): Fix implicit sign conversion.
* src/sfnt/ttcmap.c: Undef `TTCMAPCITEM'.
* src/sfnt/ttcmap.h: Define `TTCMAPCITEM' and include `ttcmapc.h' to
declare cmap classes.

* src/smooth/ftsmooth.c (ft_smooth_overlap_spans): Use cast.

* src/truetype/ttinterp.c (Ins_MIAP): Fix typo.
2020-07-07 16:58:14 +02:00