Commit 5f85bb23 authored by Carlo Landmeter's avatar Carlo Landmeter

testing/freetype-infinality: new aport

parent d926a7a1
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=freetype-infinality
pkgver=2.4.4
pkgrel=0
pkgdesc="TrueType font rendering library with infinality patch"
url="http://www.infinality.net"
arch="all"
license="GPL"
depends=
depends_dev="zlib-dev freetype-dev"
makedepends="$depends_dev"
install=""
subpackages="$pkgname-dev"
replaces="freetype"
source="http://downloads.sourceforge.net/sourceforge/freetype/freetype-$pkgver.tar.bz2
freetype-add-subpixel-hinting-infinality-20101114-1.patch
freetype-enable-subpixel-hinting-infinality-20100909-1.patch
freetype-entire-infinality-patchset-20101114-1.patch
infinality-settings
freetype-2.2.1-enable-valid.patch
freetype2-infinality-protect_null_pointer-goddesse.patch"
_builddir="$srcdir/freetype-$pkgver"
prepare() {
local i
cd "$_builddir"
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
}
build() {
cd "$_builddir"
./configure --prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man
make || return 1
}
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
install -Dm644 "$srcdir/infinality-settings" "$pkgdir/etc/infinality-settings"
}
md5sums="b3e2b6e2f1c3e0dffa1fd2a0f848b671 freetype-2.4.4.tar.bz2
799a2d229c2997a5bb2d5b7c9f92fdba freetype-add-subpixel-hinting-infinality-20101114-1.patch
a88b1a66da44a90c1fdcdeaa39a2dc09 freetype-enable-subpixel-hinting-infinality-20100909-1.patch
6725774b17820f5413cb6a3cf7547f53 freetype-entire-infinality-patchset-20101114-1.patch
416154ff9eb8dfb27e46080f678785b8 infinality-settings
214119610444c9b02766ccee5e220680 freetype-2.2.1-enable-valid.patch
316d2986f9a08e7ceb51fb9d5a5cab38 freetype2-infinality-protect_null_pointer-goddesse.patch"
--- freetype-2.2.1/modules.cfg.orig 2006-07-07 21:01:09.000000000 -0400
+++ freetype-2.2.1/modules.cfg 2006-07-07 21:01:54.000000000 -0400
@@ -110,7 +110,7 @@
AUX_MODULES += cache
# TrueType GX/AAT table validation. Needs ftgxval.c below.
-# AUX_MODULES += gxvalid
+AUX_MODULES += gxvalid
# Support for streams compressed with gzip (files with suffix .gz).
#
@@ -124,7 +124,7 @@
# OpenType table validation. Needs ftotval.c below.
#
-# AUX_MODULES += otvalid
+AUX_MODULES += otvalid
# Auxiliary PostScript driver component to share common code.
#
This source diff could not be displayed because it is too large. You can view the blob instead.
--- freetype-2.4.2.subpixel-patched/include/freetype/config/ftoption.h 2010-09-09 18:08:11.375855632 -0500
+++ freetype-2.4.2.subpixel-enabled/include/freetype/config/ftoption.h 2010-09-09 18:09:48.491864607 -0500
@@ -93,7 +93,7 @@
/* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */
/* */
-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
/*************************************************************************/
@@ -510,7 +510,7 @@
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
/* defined. */
/* */
-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
/*************************************************************************/
@@ -527,7 +527,7 @@
/* This option requires TT_CONFIG_OPTION_SUBPIXEL_HINTING to be */
/* defined. */
/* */
-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING_ADDITIONAL_TWEAKS */
+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING_ADDITIONAL_TWEAKS
/*************************************************************************/
Contributed by goddesse
https://bbs.archlinux.org/viewtopic.php?pid=864901#p864901
diff -Naur freetype-2.4.4/src/base/ftlcdfil.c freetype-2.4.4.new/src/base/ftlcdfil.c
--- freetype-2.4.4/src/base/ftlcdfil.c 2010-12-12 12:05:21.606671258 -0600
+++ freetype-2.4.4.new/src/base/ftlcdfil.c 2010-12-12 12:08:17.726671242 -0600
@@ -180,14 +180,17 @@
else if (strcasecmp(alignment_type_env, "infinality1") == 0) alignment_type = 6;
else alignment_type = 0;
- if ( /*strstr(slot.metrics->root.scaler.face->style_name, "Regular")
- || strstr(slot.metrics->root.scaler.face->style_name, "Book")
- || strstr(slot.metrics->root.scaler.face->style_name, "Medium")
- ||*/ strcasestr(slot->face->style_name, "Italic")
- || strcasestr(slot->face->style_name, "Oblique") )
- alignment_type = 0;
- if ( strcasestr(slot->face->style_name, "Bold") )
- alignment_type = 0;
+ if ( slot->face != NULL && slot->face->style_name != NULL )
+ {
+ if ( /*strstr(slot.metrics->root.scaler.face->style_name, "Regular")
+ || strstr(slot.metrics->root.scaler.face->style_name, "Book")
+ || strstr(slot.metrics->root.scaler.face->style_name, "Medium")
+ ||*/ strcasestr(slot->face->style_name, "Italic")
+ || strcasestr(slot->face->style_name, "Oblique") )
+ alignment_type = 0;
+ if ( strcasestr(slot->face->style_name, "Bold") )
+ alignment_type = 0;
+ }
}
checked_alignment_type = 1;
}
@@ -214,16 +217,19 @@
/*printf("%s,%s ", slot->face->family_name, slot->face->style_name);*/
/*printf("%d ", slot->face->size->metrics.x_ppem);*/
- /* set gamma value to 1 if out of range */
- if ( slot->face->size->metrics.x_ppem >= pseudo_gamma_lt )
+ if ( slot->face && slot->face->size )
{
- pseudo_gamma_value = 1;
- }
+ /* set gamma value to 1 if out of range */
+ if ( slot->face->size->metrics.x_ppem >= pseudo_gamma_lt )
+ {
+ pseudo_gamma_value = 1;
+ }
- /* don't do alignment for < 10 */
- if ( slot->face->size->metrics.x_ppem < 10 )
- {
- alignment_type = 0;
+ /* don't do alignment for < 10 */
+ if ( slot->face->size->metrics.x_ppem < 10 )
+ {
+ alignment_type = 0;
+ }
}
if ( mode == FT_RENDER_MODE_LCD )
@@ -642,7 +648,9 @@
if ( pseudo_gamma_value != 1 )
{
FT_Byte* line = bitmap->buffer;
- float ppem = (float)slot->face->size->metrics.x_ppem;
+ float ppem = 0;
+ if ( slot->face && slot->face->size )
+ ppem = (float)slot->face->size->metrics.x_ppem;
if (ppem >= 5 )
for (height = (FT_UInt)bitmap->rows; height > 0; height--, line += bitmap->pitch )
##################################################################
# INFINALITY ENVIRONMENT VARIABLES FOR EXTRA RUN-TIME OPTIONS
##################################################################
#
# These environment variables require that their respective patches
# from http://www.infinality.net have been applied to the Freetype
# installation you are using. They will do abolutely
# nothing otherwise!
#
# This file should be copied to /etc/profile.d/ for system-wide
# effects and/or included in ~/.bashrc or ~/.bash_profile for per-user
# effects:
#
# . ~/path/to/this/file/infinality-settings
#
# Of course, the per-user settings will override the system-wide
# settings. Default values indicated below will be used when the
# environment variables below are not defined.
##################################################################
# INFINALITY_FT_FILTER_PARAMS
#
# This is a modified version of the patch here:
# http://levelsofdetail.kendeeter.com/2008/12/dynamic_fir_filter_patch.html
#
# Allows you to adjust the FIR filter at runtime instead of at
# compile time. The idea is to have values add up to one, and be
# symmetrical around the middle value. Here are some samples
# of various filter parameters:
#
# Strong Extra Smooth "15e-2 20e-2 30e-2 20e-2 15e-2" (extra smooth, natural weight)
# Extra Smooth "20e-2 20e-2 30e-2 20e-2 20e-2" (extra smooth, extra weight)
# Smooth "15e-2 20e-2 32e-2 20e-2 15e-2" (smooth, natural weight)
# Stronger Gibson "11e-2 22e-2 38e-2 22e-2 11e-2" (smooth, extra weight)
# Gibson "11e-2 22e-2 33e-2 22e-2 11e-2" (smooth, natural weight)
# Freetype Light "00e-2 33e-2 34e-2 33e-2 00e-2" (sharp, natural weight)
# Freetype Default "06e-2 25e-2 44e-2 25e-2 06e-2" (sharp, extra weight) *default
# Extra Sharp "00e-2 35e-2 35e-2 35e-2 00e-2" (extra sharp, extra weight)
#
# Default: [Freetype's default]
# Recommended: "11e-2 22e-2 38e-2 22e-2 11e-2"
#
# Example 1: export INFINALITY_FT_FILTER_PARAMS="11e-2 22e-2 38e-2 22e-2 11e-2"
#
export INFINALITY_FT_FILTER_PARAMS="11e-2 22e-2 38e-2 22e-2 11e-2"
##################################################################
# INFINALITY_FT_STEM_ALIGNMENT_TYPE
#
# This performs analysis on each glyph and determines the best
# subpixel orientation for the glyph. The glyph is not scaled in
# any way, just moved left or right by a subpixel amount. This
# results in subtley cleaner looking fonts, at the expense of
# proper distances between glyphs. This is only active for sizes
# 10 px or greater and does not apply to bold or italic fonts.
#
# Possible values:
# full - Allows a glyph to be moved to the LEFT or RIGHT by 1 subpixel
# Best alignment, Worst positioning
# medium,medium1 - Only allows a glyph to be moved to the LEFT by 1 subpixel
# Good alignment, Good positioning
# medium2 - Only allows a glyph to be moved to the RIGHT by 1 subpixel
# Good alignment, Good positioning
# slight,slight1 - A stricter version of medium
# Minor alignment, Best positioning
# slight2 - A stricter version of medium2
# Minor alignment, Best positioning
# infinality - medium1 when stem < 5 subpixels, full when >= 5 subpixels
# none - Don't do any alignment
#
# Default: none
# Recommended: medium
export INFINALITY_FT_STEM_ALIGNMENT_TYPE=medium
##################################################################
# INFINALITY_FT_AUTOFIT_STEM_SNAP_LIGHT
#
# Cause the height of horizontal stems to snap to integer pixels
# when using light auto-hinting. (This happens automatically
# when using full auto-hinting)
#
# This produces an effect similar to the way Windows renders fonts
# without requiring the font to contain bytecode instructions.
#
# Possible values:
# true - enable stem snapping
# false - do not enable stem snapping
#
# Default: false
# Recommended: true
export INFINALITY_FT_AUTOFIT_STEM_SNAP_LIGHT=true
##################################################################
# INFINALITY_FT_AUTOFIT_EMBOLDEN_LIGHT
#
# Embolden particularly light or thin fonts, like DejaVu Sans Light,
# Inconsolata, Freemono, Courier New, etc. up until stem width is
# 1 pixel wide. This makes these fonts easier to read at lower
# ppems. Only applies when the autohinter is being used.
#
# Possible values:
# true - enable emboldening of light fonts
# false - do not enable emboldening of light fonts
#
# Default: false
# Recommended: true
export INFINALITY_FT_AUTOFIT_EMBOLDEN_LIGHT=true
##################################################################
# INFINALITY_FT_PSEUDO_GAMMA
#
# This does a weighted gamma correction at the LCD filter phase
# prior to the LCD filter.
#
# The first value indicates a px value, the second indicates a
# "gamma" value. All sizes < the px value will be corrected
# on a weighted scale based on the second value.
#
# Values .1 < 1.0 will darken the glyph
# Values > 1.0 will lighten the glyph
#
# Example 1: Darken glyphs that are less than 10 px. With some fonts
# even 5 or 6px is readable!
# export INFINALITY_FT_PSEUDO_GAMMA="10 6e-1"
#
# Example 2: Lighten all glyphs (below 100px)
# export INFINALITY_FT_PSEUDO_GAMMA="100 15e-1"
#
# Default: [No gamma correction]
# Recommended: "9 5e-1"
export INFINALITY_FT_PSEUDO_GAMMA="9 7e-1"
##################################################################
# INFINALITY_FT_AUTOFIT_ADJUST_HEIGHTS
#
# This will slightly stretch some glyphs vertically between 9px
# and 14px (inclusive). Some people may find this more
# aesthetically pleasing. This only applies to fonts that are
# using autohint.
#
# Possible values:
# true - enable height adjustment
# false - do not enable height adjustment
#
# Default: false
export INFINALITY_FT_AUTOFIT_ADJUST_HEIGHTS=true
##################################################################
# INFINALITY_FT_ENHANCED_EMBOLDEN
#
# When doing artificial emboldening, only embolden in the X
# direction, skipping the Y direction. Most people will find this
# more aesthetically pleasing than the default behavior.
#
# Possible values:
# true - enable enhanced emboldening
# false - no not enable enhanced emboldening
#
# Default: false
# Recommended: true
export INFINALITY_FT_ENHANCED_EMBOLDEN=true
##################################################################
# INFINALITY_FT_EMBOLDEN_MAINTAIN_WIDTH
#
# When doing artificial emboldening, don't change the glyph width.
#
# Possible values:
# true - maintain width
# false - do not maintain width
#
# Default: false
# Recommended: true
export INFINALITY_FT_EMBOLDEN_MAINTAIN_WIDTH=true
##################################################################
# INFINALITY_FT_AUTO_AUTOHINT
#
# Automatically use autohint when rendering a font that contains
# no truetype instructions, regardless of what the calling
# program asks for. The truetype hinter will not do a good job
# on these.
#
# Possible values:
# true - automatically use autohint
# false - do not automatically use autohint
#
# Default: false
# Recommended: true
export INFINALITY_FT_AUTO_AUTOHINT=true
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment