freetype2/src/base
Bram Tassyns 4694ea2b95 Improve vertical metrics calculation (Savannah bug #27364).
The calculation of `vertBearingX' is not defined in the OTF font
spec so FreeType does a `best effort' attempt.  However, this value
is defined in the PDF and PostScript specs, and that algorithm is
better than the one FreeType currently uses:

  FreeType: Use the middle of the bounding box as the X coordinate
            of the vertical origin.

  Adobe PDF spec: Use the middle of the horizontal advance vector as
                  the X coordinate of the vertical origin.

FreeType's algorithm goes wrong if you have a really small glyph
(like the full-width, circle-like dot at the end of the sentence, as
used in CJK scripts) with large bearings.  With the FreeType
algorithm this dot gets centered on the baseline; with the PDF
algorithm it gets the correct location (in the top right).  Note
that this is a serious issue, it's like printing the dot at the end
of a Roman sentence at the center of the textline instead of on the
baseline like it should. So i believe the PDF spec's algorithm
should be used in FreeType as well.

The `vertBearingY' value for such small glyphs is also very strange
if no `vmtx' information is present, since the height of the bbox is
not representable for the height of the glyph visually (the
whitespace up to the baseline is part of the glyph).  The fix also
includes some code for a better estimate of `vertBearingY'.

* src/base/ftobjs.c (ft_synthesize_vertical_metrics): `vertBearingX'
is now calculated as described by the Adobe PDF Spec.  Estimate for
`vertBearingY' now works better for small glyphs completely above or
below the baseline into account.

* src/cff/cffgload.c (cff_slot_load): `vertBearingX' is now
calculated as described by the Adobe PDF Spec.  Vertical metrics
information was always ignored when FT_CONFIG_OPTION_OLD_INTERNALS
was not defined.

* src/truetype/ttgload.c (compute_glyph_metrics): `vertBearingX' is
now calculated as described by the Adobe PDF Spec.
2009-09-02 13:06:33 +02:00
..
Jamfile Position Independent Code (PIC) support and infrastructure in base. 2009-04-05 17:59:26 +03:00
basepic.c Position Independent Code (PIC) support and infrastructure in base. 2009-04-05 17:59:26 +03:00
basepic.h Position Independent Code (PIC) support and infrastructure in base. 2009-04-05 17:59:26 +03:00
ftadvanc.c base: Prevent some overflows on LP64 systems. 2009-08-01 00:30:24 +09:00
ftapi.c Remove trailing whitespace. From Alexei. 2007-01-16 06:11:27 +00:00
ftbase.c Position Independent Code (PIC) support and infrastructure in base. 2009-04-05 17:59:26 +03:00
ftbase.h * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler 2008-10-04 11:39:03 +00:00
ftbbox.c Position Independent Code (PIC) support and infrastructure in base. 2009-04-05 17:59:26 +03:00
ftbdf.c * include/freetype/ftbitmap.h (FT_Bitmap_Copy, FT_Bitmap_Embolden), 2005-10-20 02:13:46 +00:00
ftbitmap.c Improve bitmap size or pixel variables for 16-bit systems. 2009-08-01 00:32:06 +09:00
ftcalc.c Improve bitmap size or pixel variables for 16-bit systems. 2009-08-01 00:32:06 +09:00
ftcid.c Extend CID service functions to handle CID-keyed CFFs as CID fonts. 2009-03-11 21:29:54 +00:00
ftdbgmem.c For warning messages, replace FT_ERROR with FT_TRACE0. 2009-06-26 06:15:41 +02:00
ftdebug.c Formatting. 2008-11-29 09:31:44 +00:00
ftfstype.c Formatting, copyright years. 2009-03-03 21:35:32 +00:00
ftgasp.c formatting, copyright years and messages, doc polishing 2007-01-09 10:37:36 +00:00
ftgloadr.c Prevent the overflows by a glyph with too many points or contours. 2009-07-08 14:52:11 +09:00
ftglyph.c base: Remove an unused variable. 2009-08-01 00:32:25 +09:00
ftgxval.c formatting, copyright years 2006-06-25 06:07:14 +00:00
ftinit.c For warning messages, replace FT_ERROR with FT_TRACE0. 2009-06-26 06:15:41 +02:00
ftlcdfil.c Fix stdlib dependencies. 2009-01-12 20:01:10 +00:00
ftmac.c Minor fixes. 2009-01-06 06:59:36 +00:00
ftmm.c Fix some FreeType Coverity issues as reported for Ghostscript. 2009-03-12 08:07:49 +00:00
ftobjs.c Improve vertical metrics calculation (Savannah bug #27364). 2009-09-02 13:06:33 +02:00
ftotval.c Fixes from the gnuwin32 port. 2008-11-24 08:15:05 +00:00
ftoutln.c * src/autofit/afcjk.c, src/base/ftoutln.c, src/base/ftrfork.c, 2008-11-29 22:50:24 +00:00
ftpatent.c ftpatent.c: Fix for unused variable `error'. 2009-08-01 00:30:12 +09:00
ftpfr.c * src/base/ftpfr.c (FT_Get_PFR_Metrics): Protect against NULL 2008-12-21 17:38:23 +00:00
ftpic.c Position Independent Code (PIC) support and infrastructure in base. 2009-04-05 17:59:26 +03:00
ftrfork.c Improve the variable types in raccess_make_file_name(). 2009-08-01 00:30:12 +09:00
ftsnames.c ftnames.c -> ftsnames.c 2009-04-04 09:20:14 +02:00
ftstream.c Don't call `ft_fseek' every time when executing `ft_fread'. 2009-08-03 19:55:58 +02:00
ftstroke.c Handle FT_STROKER_LINECAP_BUTT. 2009-06-08 17:12:40 +02:00
ftsynth.c Improve bitmap size or pixel variables for 16-bit systems. 2009-08-01 00:32:06 +09:00
ftsystem.c Don't call `ft_fseek' every time when executing `ft_fread'. 2009-08-03 19:55:58 +02:00
fttrigon.c base: Prevent some overflows on LP64 systems. 2009-08-01 00:30:24 +09:00
fttype1.c Add new function FT_Get_PS_Font_Private(). 2004-11-12 07:02:45 +00:00
ftutil.c fixing implementation bug in ft_mem_strcpyn 2007-03-08 10:50:38 +00:00
ftwinfnt.c Documentation updates, whitespace. 2004-12-13 23:16:59 +00:00
ftxf86.c Documentation updates, whitespace. 2004-12-13 23:16:59 +00:00
rules.mk ftnames.c -> ftsnames.c 2009-04-04 09:20:14 +02:00