svn commit: r452905 - in head/print/freetype2: . files
Kurt Jaeger
pi at FreeBSD.org
Thu Oct 26 06:20:55 UTC 2017
Author: pi
Date: Thu Oct 26 06:20:53 2017
New Revision: 452905
URL: https://svnweb.freebsd.org/changeset/ports/452905
Log:
print/freetype2: fix incorrect line spacing for some fonts
Problem description: After updating to print/freetypw2-2.8.0 using
Bitstream Vera Sans Mono the vertical pitch increases and significantly
add of the size of the window. See attached images.
See PR for lots of links to related reports upstream
and on other platforms.
PR: 219608
Submitted by: lightside at gmx.com
Reported by: Kevin Oberman <rkoberman at gmail.com>
Added:
head/print/freetype2/files/extra-patch-fix_size_metrics.diff (contents, props changed)
Modified:
head/print/freetype2/Makefile
Modified: head/print/freetype2/Makefile
==============================================================================
--- head/print/freetype2/Makefile Thu Oct 26 05:30:35 2017 (r452904)
+++ head/print/freetype2/Makefile Thu Oct 26 06:20:53 2017 (r452905)
@@ -3,6 +3,7 @@
PORTNAME= freetype2
PORTVERSION= 2.8
+PORTREVISION= 1
CATEGORIES= print
MASTER_SITES= http://savannah.nongnu.org/download/freetype/ \
SF/freetype/${PORTNAME}/${PORTVERSION:C/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/}/ \
@@ -36,10 +37,12 @@ PORTDOCS= reference CHANGES formats.txt LICENSE.TXT ra
CPE_PRODUCT= freetype
CPE_VENDOR= freetype
-OPTIONS_DEFINE= DEBUG DOCS LCD_FILTERING PNG TABLE_VALIDATION \
- TT_SIZE_METRICS
+OPTIONS_DEFINE= DEBUG DOCS LCD_FILTERING LONG_PCF_NAMES PNG \
+ TABLE_VALIDATION
OPTIONS_GROUP= SUBPIXEL_HINTING
OPTIONS_GROUP_SUBPIXEL_HINTING= V38 V40
+OPTIONS_RADIO= SIZE_METRICS_CHOICE
+OPTIONS_RADIO_SIZE_METRICS_CHOICE= FIX_SIZE_METRICS TT_SIZE_METRICS
OPTIONS_DEFAULT= LCD_FILTERING V40
PNG_DESC= Png compressed OpenType embedded bitmaps support
@@ -48,11 +51,16 @@ PNG_CONFIGURE_WITH= png
TABLE_VALIDATION_DESC= TrueType GX/AAT and OpenType table validation
-TT_SIZE_METRICS_DESC= TrueType-like size metrics for 'light' (V40) auto-hinting
+SIZE_METRICS_CHOICE_DESC= Size metrics for TrueType fonts
+FIX_SIZE_METRICS_DESC= Fix metrics on size request for scalable fonts (alternative method)
+FIX_SIZE_METRICS_EXTRA_PATCHES= ${FILESDIR}/extra-patch-fix_size_metrics.diff
+TT_SIZE_METRICS_DESC= TrueType-like size metrics for 'light' auto-hinting
LCD_FILTERING_DESC?= Sub-pixel rendering (patented)
LCD_FILTERING_CFLAGS= -DFT_CONFIG_OPTION_SUBPIXEL_RENDERING
+LONG_PCF_NAMES_DESC= Enable long PCF family names
+
SUBPIXEL_HINTING_DESC= Sub-pixel hinting support
V38_DESC= v38 mode (Infinality code)
V38_VARS= SUBPIXEL_HINTING_MODE+=1
@@ -88,6 +96,11 @@ post-patch-DEBUG-on:
@${REINPLACE_CMD} -i '.debug.bak' \
-e 's|.*\(#define FT_DEBUG_LEVEL_TRACE\).*|\1|' \
-e 's|.*\(#define FT_DEBUG_MEMORY\).*|\1|' \
+ ${WRKSRC}/include/freetype/config/ftoption.h
+
+post-patch-LONG_PCF_NAMES-on:
+ @${REINPLACE_CMD} -i '.names.bak' \
+ -e 's|.*\(#define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES\).*|\1|' \
${WRKSRC}/include/freetype/config/ftoption.h
post-patch-TABLE_VALIDATION-on:
Added: head/print/freetype2/files/extra-patch-fix_size_metrics.diff
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/print/freetype2/files/extra-patch-fix_size_metrics.diff Thu Oct 26 06:20:53 2017 (r452905)
@@ -0,0 +1,46 @@
+# Fix metrics on size request for scalable fonts.
+# Based on b0962ac34e66052ccfee7996e5468f30d4bd5a72 commit with changes for new version.
+# Reverts bcc74f4dafee25ea89f1d3144646cba7e30f9908 commit for src/truetype/ttdriver.c file.
+# Adapts 8ab08cff63eeb23b6c9f2c4470ae9809f2acf244 commit for src/truetype/ttobjs.c file.
+
+--- src/truetype/ttdriver.c.orig 2017-04-29 04:38:17 UTC
++++ src/truetype/ttdriver.c
+@@ -357,6 +357,8 @@
+ if ( FT_IS_SCALABLE( size->face ) )
+ {
+ error = tt_size_reset( ttsize, 0 );
++ if ( !error )
++ ttsize->root.metrics = *ttsize->metrics;
+
+ #ifdef TT_USE_BYTECODE_INTERPRETER
+ /* for the `MPS' bytecode instruction we need the point size */
+--- src/truetype/ttobjs.c.orig 2017-05-07 11:05:56 UTC
++++ src/truetype/ttobjs.c
+@@ -1262,6 +1262,13 @@
+ /* */
+ if ( face->header.Flags & 8 )
+ {
++ if ( !only_height )
++ {
++ size_metrics->x_scale = FT_DivFix( size_metrics->x_ppem << 6,
++ face->root.units_per_EM );
++ size_metrics->y_scale = FT_DivFix( size_metrics->y_ppem << 6,
++ face->root.units_per_EM );
++ }
+ /* the TT spec always asks for ROUND, not FLOOR or CEIL */
+ size_metrics->ascender = FT_PIX_ROUND(
+ FT_MulFix( face->root.ascender,
+@@ -1283,11 +1290,12 @@
+ {
+ /* base scaling values on integer ppem values, */
+ /* as mandated by the TrueType specification */
++/*
+ size_metrics->x_scale = FT_DivFix( size_metrics->x_ppem << 6,
+ face->root.units_per_EM );
+ size_metrics->y_scale = FT_DivFix( size_metrics->y_ppem << 6,
+ face->root.units_per_EM );
+-
++*/
+ size_metrics->max_advance = FT_PIX_ROUND(
+ FT_MulFix( face->root.max_advance_width,
+ size_metrics->x_scale ) );
More information about the svn-ports-head
mailing list