Commit Graph

62 Commits

Author SHA1 Message Date
Werner Lemberg d0cfb4e1b2 Update all copyright notices. 2022-01-11 10:54:10 +01:00
Werner Lemberg b6e8a71266 Update all copyright notices. 2021-01-17 07:18:48 +01: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 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 0a0c22569d Update copyright year. 2018-01-02 09:33:57 +01:00
Alexei Podtelezhnikov 22a7f5b8af Branding fixes. 2017-09-07 22:36:02 -04:00
Alexei Podtelezhnikov 983fb0df5a Typos. 2017-01-24 23:56:59 -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 f57fc59e01 Run `src/tools/update-copyright'. 2015-01-17 20:41:43 +01:00
Werner Lemberg f34f192535 * src/*: Add checks for parameters of API functions where missing.
`API functions' are functions tagged with `FT_EXPORT_DEF'.

Besides trivial fixes, the following changes are included, too.

* src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Set
error code if no service is available.

* src/base/ftinit.c (FT_Done_FreeType): Change return value for
invalid `library' parameter to `Invalid_Library_Handle'.

* src/base/ftobjs.c (FT_New_Size): Change return value for invalid
`asize' parameter to `Invalid_Argument'.

* src/base/ftoutln.c (FT_Outline_Copy): Change return value for
invalid `source' and `target' parameters to `Invalid_Outline'.
(FT_Outline_Done_Internal): Change return value for invalid
`outline' parameter to `Invalid_Outline'.
2014-11-26 21:59:21 +01:00
Werner Lemberg b24e8ba28a [Savannah bug #43682] Add/remove `void' casts to some functions.
We use a cast to indicate that we intentionally ignore a function's
return value.  However, this doesn't apply to API functions where
errors can only happen for trivially invalid input.

* src/base/ftstroke.c (FT_Glyph_Stroke, FT_Glyph_StrokeBorder),
src/base/ftsynth.c (FT_GlyphSlot_Embolden), src/cff/cffgload.c
(cff_slot_load), src/pfr/pfrdrivr.c (pfr_get_kerning),
src/type1/t1load.c (parse_encoding), src/type42/t42parse.c
(t42_parse_encoding): Do it.
2014-11-25 08:30:49 +01:00
Behdad Esfahbod 31e726d939 Fix vertical size of emboldened glyphs.
Cf. https://bugzilla.gnome.org/show_bug.cgi?id=686709

* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Adjust `horiBearingY'
also.
2013-09-20 07:20:53 +02:00
Werner Lemberg 04affa270b * src/base/ftsynth.c (FT_GlyphSlot_Oblique): Fix shear angle.
The old value was far too large (more than 20°).  The new one
corresponds to 12°, quite common in typography.
2012-08-17 09:28:28 +02:00
Alexei Podtelezhnikov cea9d7a682 * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Improve spacing.
* docs/CHANGES: Updated.
2012-06-15 06:33:46 +02:00
Werner Lemberg 5220ef58c5 Fix minor issues reported by <muktha.narayan@wipro.com>.
* src/autofit/aflatin.c (af_latin_compute_stem_width): Remove
redundant conditional check.
* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Ditto.
* src/cff/cffload.c (cff_encoding_load): Remove conditional check
which always evaluates to `true'.
* src/pshinter/pshalgo.c (ps_glyph_interpolate_strong_points):
Ditto.
* src/truetype/ttinterp.c (Ins_IUP): Ditto.
* src/cid/cidgload.c (cid_slot_load_glyph): Don't check for NULL if
value is already dereferenced.
* src/winfonts/winfnt.c (FNT_Load_Glyph): Fix check of `face'.
2010-09-13 07:32:22 +02:00
Werner Lemberg fc58155afc Apply reports from clang static analyzer.
* src/lzw/ftlzw.c (ft_lzw_file_init), src/base/ftstroke.c
(FT_Stroker_ParseOutline), src/base/ftsynth.c
(FT_GlyphSlot_Embolden): Remove dead code.

* src/base/ftpatent.c (_tt_check_patents_in_table): Initialize
`offset_i'.
2010-01-05 20:00:35 +01:00
suzuki toshiya e866cf3f55 Improve bitmap size or pixel variables for 16-bit systems. 2009-08-01 00:32:06 +09:00
Werner Lemberg cfc514ea7e * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Don't use internal
macros so that copying the source code into an application works
out of the box.
2008-12-17 11:03:26 +00:00
Werner Lemberg c8c4cc837c * include/freetype/ftsynth.h, src/basae/ftsynth.c: Move
FT_GlyphSlot_Own_Bitmap to...
* include/freetype/ftbitmap.h, src/base/ftbitmap.c: These files.

* docs/CHANGES: Document it.
2008-12-17 10:50:31 +00:00
Werner Lemberg d60ae949db Formatting. 2006-11-07 09:47:04 +00:00
Werner Lemberg 5e43089b4f * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Handle vertical layout
also.
2006-11-07 09:35:03 +00:00
Werner Lemberg d7e6b76739 Formatting, copyright years, minor cleanups. 2006-02-25 06:24:28 +00:00
Wu, Chia-I (吳佳一) 032646139d * include/freetype/ftbitmap.h (FT_Bitmap_Embolden): Update
documentation.

* include/freetype/ftsynth.h (FT_GlyphSlot_Own_Bitmap),
src/base/ftsynth.c (FT_GlyphSlot_Own_Bitmap): New function to make
sure a glyph slot owns its bitmap.  It is also marked experimental and
due to change.
(FT_GlyphSlot_Embolden): Undo the last change.  It turns out rendering
the outline confuses some applications.
2006-02-24 11:18:40 +00:00
Werner Lemberg d4303da035 formatting, copyright years. 2006-02-23 21:01:34 +00:00
Wu, Chia-I (吳佳一) 890f807a7b * include/freetype/ftoutln.h (enum FT_Orientation): New value
`FT_ORIENTATION_NONE'.

* src/base/ftoutln.c (FT_OUTLINE_GET_CONTOUR, ft_contour_has,
ft_contour_enclosed, ft_outline_get_orientation): Another version of
`FT_Outline_Get_Orientation'.  This version differs from the public
one in that each part (contour not enclosed in another contour) of the
outline is checked for orientation.
(FT_Outline_Embolden): Use `ft_outline_get_orientation'.

* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Render the outline and
use bitmap's embolden routine when the outline one failed.
2006-02-22 20:47:39 +00:00
Werner Lemberg 7b33dca43c Formatting. 2005-06-23 20:31:48 +00:00
Wu, Chia-I (吳佳一) 8cfb220eb9 * include/freetype/internal/ftobjs.h, src/base/ftobjs.c: New function
ft_glyphslot_grid_fit_metrics.

* src/truetype/ttgload.c (compute_glyph_metrics): Use
ft_glyphslot_grid_fit_metrics.

* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
(cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Use
ft_glyphslot_grid_fit_metrics.
FT_Outline_Get_CBox is called twice.

* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Modify metrics to more
reasonable values when emboldening outline glyphs.  The theoretic
ones are unrealistic.
2005-06-20 09:04:50 +00:00
Werner Lemberg 49f4d34ed3 * src/base/ftoutln.c (FT_Outline_Embolden): Strength should be
halved.

* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Change the default
strength.
Don't increase slot->advance.y.



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

* builds/unix/configure.ac (version_info): Set to 9:9:3.
Currently, we are still binary compatible.

* builds/win32/visualc/index.html,
builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype.vcproj: s/219/2110/, s/2.1.9/2.1.10/.

* builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
s/2.1.9/2.1.10/.

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

* ChangeLog: Split off older entries into...
* ChangeLog.20, ChangeLog.21: These new files.



The next release will be 2.2.0, so don't worry about source code
backwards compatibility.

* include/freetype/ftimage.h (FT_Outline_MoveToFunc,
FT_Outline_LineToFunc, FT_Outline_ConicToFunc,
FT_Outline_CubicToFunc, FT_SpanFunc, FT_Raster_RenderFunc),
include/freetype/ftrender.h (FT_Glyph_TransformFunc,
FT_Renderer_RenderFunc, FT_Renderer_TransformFunc): Decorate
parameters with `const' where appropriate.



* src/sfnt/ttsbit.c (tt_face_load_sbit_image): Compute vertBearingY
to make glyphs centered vertically.

* src/truetype/ttgload.c (compute_glyph_metrics): Compute
vertBearingY to make glyphs centered vertically.
Fix some bugs in vertical metrics:

  . loader->pp3.y and loader->pp4.y are in 26.6 format, not in font
    units.
  . As we use the glyph's cbox to calculate the top bearing now
    there iss no need to adjust `top'.



* src/otvalid/otvcommn.h (OTV_OPTIONAL_TABLE): Use FT_UShort to be
in sync with OTV_OPTIONAL_OFFSET.  Reported by YAMATO Masatake.


* docs/release: Update.
2005-06-16 19:07:08 +00:00
Werner Lemberg 71d7628175 * src/base/ftbitmap.c (FT_Bitmap_Embolden): Fix emboldening bitmap
of mode FT_PIXEL_MODE_GRAY.  Also add support for mode
FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V.
(ft_bitmap_assure_buffer): FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V
should have ppb (pixel per byte) 1.
Zero the padding when there's no need to allocate memory.

* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Handle slot->advance
too.
More suited emboldening strength.
2005-05-30 07:54:20 +00:00
Werner Lemberg 3a36ef7e6e * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Initialize `error'. 2005-05-27 04:18:20 +00:00
Werner Lemberg 6d8c18214e * docs/GPL.txt: Update postal address of FSF.
* include/freetype/ftbitmap.h (FT_Bitmap_Embolden): Improve
documentation.

* src/base/ftsynth.c (FT_BOLD_THRESHOLD): Removed.
(FT_GlyphSlot_Embolden): Check whether slot is bitmap owner.
Always modify the metrics.
2005-05-26 21:02:25 +00:00
Werner Lemberg afb2ba5756 * docs/CHANGES: Updated.
* include/freetype/ftbitmap.h (FT_Bitmap_Embolden): New declaration.

* include/freetype/ftoutln.h (FT_Outline_Embolden): New declaration.

* src/base/ftbitmap.c (ft_bitmap_assure_buffer): New auxiliary
function.
(FT_Bitmap_Embolden): New function.

* src/base/ftoutln.c (FT_Outline_Embolden): New function.

* src/base/ftsynth.c: Don't include FT_INTERNAL_CALC_H and
FT_TRIGONOMETRY_H but FT_BITMAP_H.
(FT_GlyphSlot_Embolden): Use FT_Outline_Embolden or
FT_Bitmap_Embolden.
2005-05-25 05:51:01 +00:00
David Turner 01152db10a * src/base/ftsynth.c (FT_GlyphSlot_Embolden): fixing a bug that produced
unpleasant artefacts when trying to embolden very sharp corners.
2005-05-21 10:42:32 +00:00
Werner Lemberg ece8b20e6c Documentation updates, whitespace. 2004-12-13 23:16:59 +00:00
Werner Lemberg 1ec3963dc8 * src/base/ftoutln.c (FT_OrientationExtremumRec,
ft_orientation_extremum_compute): Removed.
(FT_Outline_Get_Orientation): Rewritten, simplified.

* src/autohint/ahglyph.c: Include FT_OUTLINE_H.
(ah_test_extremum, ah_get_orientation): Removed.
(ah_outline_load): Use FT_Outline_Get_Orientation.

* src/base/ftsynth.c (ft_test_extrama, ft_get_orientation): Removed.
(FT_GlyphSlot_Embolden): Use FT_Outline_Get_Orientation.
2004-11-24 07:08:21 +00:00
Werner Lemberg 328abf3094 * src/cff/cffgload.c (cff_lookup_glyph_by_stdcharcode): Handle
CID-keyed fonts.

Remove MS-DOS line endings.

Minor formatting issues.
2003-12-24 13:37:58 +00:00
David Turner 87c0d30fc5 * include/freetype/fttypes.h
src/autofit/afangles.c
        src/autofit/aflatin.c
        src/autohint/ahglyph.c
        src/autohint/ahhint.c
        src/base/ftcalc.c
        src/base/ftgloadr.c
        src/base/ftglyph.c
        src/base/ftobjs.c
        src/base/ftsynth.c
        src/base/fttrigon.c
        src/cff/cffgload.c
        src/cid/cidgload.c
        src/cid/cidload.c
        src/pfr/pfrgload.c
        src/pfr/pfrload.c
        src/pfr/pfrsbit.c
        src/psaux/psobjs.c
        src/pshinter/pshalgo.c
        src/pshinter/pshglob.c
        src/pshinter/pshrec.c
        src/raster/ftrend1.c
        src/sfnt/ttcmap0.c
        src/smooth/ftsmooth.c
        src/truetype/ttdriver.c
        src/truetype/ttgload.c
        src/truetype/ttinterp.c
        src/truetype/ttobjs.c
        src/type1/t1gload.c
        src/winfonts/winfnt.c:

          use of the FT_PAD_XXX and FT_PIX_XXX macros to avoid compiler
          warnings with very pedantic compilers. Hints:  (x) & -64 will
          warn if (x) is not signed.. use (x) & ~63 instead !
2003-12-24 01:10:46 +00:00
Werner Lemberg 0bdf608f3d * src/pshinter/pshalgo1.[ch], src/pshinter/pshalgo2.[ch]: Removed.
* src/pshinter/pshalgo.h: Removed.

* src/pshinter/pshalgo3.[ch]: Renamed to...
* src/pshinter/pshalgo.[ch]: New files.
s/PSH3/PSH/.
s/psh3/psh/.
s/ps3/ps/.

* src/pshinter/pshrec.c, src/pshinter/pshinter.c: Updated.
* src/pshinter/rules.mk, src/pshinter/Jamfile: Updated

* src/pshinter/pshglob.[ch] (psh_dimension_snap_width): Commented
out.

* tests/gview.c: Remove code for pshalgo1 and pshalgo2.
Updated.
2003-05-28 22:42:41 +00:00
Werner Lemberg c8c6bf5c63 Cleanups; adding some copyrights; formatting. 2003-04-23 05:38:13 +00:00
David Turner 3249c62523 * include/freetype/internal/internal.h, include/freetype/ftpfr.h,
src/base/ftpfr.c, src/base/Jamfile, src/descrip.mms, src/rules.mk,
        src/pfr/pfrdrivr.c, src/pfr/pfrobjs.c, src/pfr/pfsobjs.h:

        added PFR-specific public API. Fixed the kerning retrievel routine
        (it returned invalid values when the outline and metrics resolution
        differ)

        * src/base/ftsynth.c: fixed the synthetic emboldener. at last.

        * src/base/ftobjs.c: small internal fix to better support
        bitmap-based font formats
2002-10-31 08:30:19 +00:00
David Turner b08fe2dc7a * massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
    transformations of the sources:

      - trying to convert all enums and constants to CAPITALIZED_STYLE, with
        #define definitions like

          #define  my_old_constants   MY_NEW_CONSTANT

      - big, big update of the documentation comments

    * include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
    include/freetype/ftimage.h: adding support for LCD-optimized rendering
    though the new constants/enums:

      FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
      FT_PIXEL_MODE_LCD,  FT_PIXEL_MODE_LCD_V

    this is still work in progress, don't expect everything to work correctly
    though most of the features have been implemented.

    * adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
    targets:

      FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
      FT_LOAD_TARGET_MONO   :: monochrome bitmaps
      FT_LOAD_TARGET_LCD    :: horizontal RGB/BGR decimated hinting & rendering
      FT_LOAD_TARGET_LCD_V  :: vertical RGB/BGR decimated hinting & rendering

    note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
    behaviour of the font engine is _unchanged_.
2002-08-27 20:20:29 +00:00
David Turner 5c0d3a4dca * src/base/ftobject.c, src/base/ftsynth.c, src/base/ftstroker.c,
src/bdf/bdfdrivr.c: removed compiler warnings
2002-08-22 20:35:36 +00:00
Werner Lemberg 7f74a52a21 Fixing ChangeLog entries.
Some formatting.

* src/truetype/ttgload.c (load_truetype_glyph)
[FT_CONFIG_OPTION_INCREMENTAL]: s/memset/ft_memset/.

* src/autohint/ahhint.c (ah_hint_edges_3): Fix compiler warning.
* src/cff/cffload.c (cff_encoding_load): Remove `memory' variable.
* src/cff/cffcmap.c (cff_cmap_encoding_init): Remove `psnames'
variable.
* src/truetype/ttgload.c (load_truetype_glyph): Remove statement
without effect.
* src/truetype/ttdriver (Get_Char_Index, Get_Next_Char): Removed.
2002-07-26 09:09:10 +00:00