Commit Graph

80 Commits

Author SHA1 Message Date
Tuomas Tynkkynen
4df59beb01 fontconfig_210: Remove reference to obsolete patch
Commit 9b049849bfc385604f240157e129f7a8e3530d7f deleted the patch file
(and reference to it from fontconfig default.nix), but left the one in
2.10.nix which break evaluation.

As the package seems to build fine without the patch, just remove the
reference.

cc @ttuegel in case this was not the correct thing to do.
2017-03-30 23:19:45 +03:00
Thomas Tuegel
9b049849bf
freetype: disable PCF long family names
Backported several patches from upstream. The test suite patch for Fontconfig is
no longer necessary.
2017-03-28 17:29:42 -05:00
Thomas Tuegel
65592837b6
freetype: 2.6.5 -> 2.7.1
The Infinality bytecode interpreter is removed in favor of the new v40 TrueType
interpreter. In the past, the Infinality interpreter provided support for
ClearType-style hinting instructions while the default interpreter (then v35)
provided support only for original TrueType-style instructions. The v40
interpreter corrects this deficiency, so the Infinality interpreter is no longer
necessary.

To understand why the Infinality interpreter is no longer necessary, we should
understand how ClearType differs from TrueType and how the v40 interpreter
works. The following is a summary of information available on the FreeType
website [1] mixed with my own editorializing.

TrueType instructions use horizontal and vertical hints to improve glyph
rendering. Before TrueType, fonts were only vertically hinted; horizontal hints
improved rendering by snapping stems to pixel boundaries. Horizontal hinting is
a risk because it can significantly distort glyph shapes and kerning. Extensive
testing at different resolutions is needed to perfect the TrueType
hints. Microsoft invested significant effort to do this with its "Core fonts for
the Web" project, but few other typefaces have seen this level of attention.

With the advent of subpixel rendering, the effective horizontal resolution of
most displays increased significantly. ClearType eschews horizontal hinting in
favor of horizontal supersampling. Most fonts are designed for the Microsoft
bytecode interpreter, which implements a compatibility mode with
TrueType-style (horizontal and vertical) instructions. However, applying the
full horizontal hints to subpixel-rendered fonts leads to color fringes and
inconsistent stem widths. The Infinality interpreter implements several
techniques to mitigate these problems, going so far as to embed font- and
glyph-specific hacks in the interpreter. On the other hand, the v40 interpreter
ignores the horizontal hinting instructions so that glyphs render as they are
intended to on the Microsoft interpreter. Without the horizontal hints, the
problems of glyph and kerning distortion, color fringes, and inconsistent stem
widths--the problems the Infinality interpreter was created to solve--simply
don't occur in the first place.

There are also security concerns which motivate removing the Infinality patches.
Although there is an updated version of the Infinality interpreter for FreeType
2.7, the lack of a consistent upstream maintainer is a security concern. The
interpreter is a Turing-complete virtual machine which has had security
vulnerabilities in the past. While the default interpreter is used in billions
of devices and is maintained by an active developer, the Infinality interpreter
is neither scrutinized nor maintained. We will probably never know if there are
defects in the Infinality interpreter, and if they were discovered they would
likely never be fixed. I do not think that is an acceptable situtation for a
core library like FreeType.

Dropping the Infinality patches means that font rendering will be less
customizable. I think this is an acceptable trade-off. The Infinality
interpreter made many compromises to mitigate the problems with horizontal
hinting; the main purpose of customization is to tailor these compromises to the
user's preferences. The new interpreter does not have to make these compromises
because it renders fonts as their designers intended, so this level of
customization is not necessary.

The Infinality-associated patches are also removed from cairo. These patches
only set the default rendering options in case they aren't set though
Fontconfig. On NixOS, the rendering options are always set in Fontconfig, so
these patches never actually did anything for us!

The Fontconfig test suite is patched to account for a quirk in the way PCF fonts
are named.

The fontconfig option `hintstyle` is no longer configurable in NixOS. This
option selects the TrueType interpreter; the v40 interpreter is `hintslight` and
the older v35 interpreter is `hintmedium` or `hintfull` (which have actually
always been the same thing). The setting may still be changed through the
`localConf` option or by creating a user Fontconfig file.

Users with HiDPI displays should probably disable hinting and antialiasing: at
best they have no visible effect.

The fontconfig-ultimate settings are still available in NixOS, but they are no
longer the default. They still work, but their main purpose is to set rendering
quirks which are no longer necessary and may actually be
detrimental (e.g. setting `hintfull` for some fonts). Also, the vast array of
font substitutions provided is not an appropriate default; the default setting
should be to give the user the font they asked for.

[1]. https://www.freetype.org/freetype2/docs/subpixel-hinting.html
2017-03-12 17:31:33 -05:00
Vladimír Čunát
09d02f72f6
Re-revert "Merge: glibc: 2.24 -> 2.25"
This reverts commit 55cc7700e968001c9ac79190fbcf25ed3620680a.
I hope most problems have been solved.  /cc #22874.
2017-02-20 21:16:41 +01:00
Vladimír Čunát
55cc7700e9
Revert "Merge: glibc: 2.24 -> 2.25"
This reverts commit 1daf2e26d221712dfbe72f9f6d2f73ef230cc43c, reversing
changes made to c0c50dfcb70d48e5b79c4ae9f1aa9d339af860b4.

It seems this is what has been causing all the reliability problems
on Hydra.  I'm currently unable to find why it happens, so I'm forced
to revert the update for now.  Discussion: #22874.
2017-02-16 18:16:06 +01:00
Vladimír Čunát
7832806e20
fontconfig: fixup fragile build after ab5fe171a
Sometimes it might fail due to timestamps suggesting some files needed
regenerating and failing to find gperf.  Now it should be OK, I hope.
2017-02-15 21:06:27 +01:00
Vladimír Čunát
ab5fe171af
fontconfig: patch to build with glibc-2.25 2017-02-12 11:14:45 +01:00
Alexander Ried
8417c3aae1
fontconfig: 2.11.1 -> 2.12.1
Fixes #19302.
2016-10-11 18:34:36 +02:00
Tuomas Tynkkynen
d3dc3d4130 Merge remote-tracking branch 'dezgeg/shuffle-outputs' into staging
https://github.com/NixOS/nixpkgs/pull/14766
2016-08-30 12:43:37 +03:00
Vladimír Čunát
4f73633f26 treewide: stop using fontbhttf 2016-08-29 22:28:50 +02:00
Tuomas Tynkkynen
a17216af4c treewide: Shuffle outputs
Make either 'bin' or 'out' the first output.
2016-08-29 14:49:51 +03:00
Eric Sagnes
e80e8b9dc9 fontconfig module: respect upstream definitions 2016-08-20 03:21:05 +03:00
Eric Sagnes
cd2948a72e fontconfig: fix etc priority 2016-08-20 03:21:05 +03:00
obadz
cfc0a5415b Revert "fontconfig: fix etc priority"
This reverts commit 1e53d4a7776acbf61f42c094c103652c8068ad64.

Closes #16983

cc @vcunat @ericsagnes @dezgeg
2016-07-15 20:44:21 +02:00
Eric Sagnes
1e53d4a777 fontconfig: fix etc priority 2016-07-09 16:50:13 +02:00
Vladimír Čunát
2c51a075ab makeFontsConf: fix with multiple outputs 2016-02-03 16:57:41 +01:00
Vladimír Čunát
ae74c356d9 Merge recent 'staging' into closure-size
Let's get rid of those merge conflicts.
2016-02-03 16:57:19 +01:00
Nikolay Amiantov
7bd9a5b104 fontconfig: reorder cache dirs 2016-01-29 16:35:59 +03:00
Nikolay Amiantov
893af77556 makeFontsCache: init 2016-01-29 14:41:26 +03:00
Tuomas Tynkkynen
ca2cb493fa fontconfig_210: Split into multiple outputs 2015-10-28 10:17:10 +01:00
Vladimír Čunát
38313d5d87 libxml2,libxslt: split into multiple outputs
Fixed all references, hopefully.
libxml2Python is slightly hacky now, but it seems to work.
2015-10-05 13:44:16 +02:00
Vladimír Čunát
f8c211fd2b fontconfig: split into multiple outputs
Fixed all 'fontconfig}' references as well, hopefully, ugh!
2015-10-05 12:23:56 +02:00
Vladimír Čunát
3938dc3c21 freetype: fix pcf fonts by upstream patches
The problem was uncovered by the last security patches.
Firefox seems to build and work fine.

Includes reverting 374a9cc16271, as this is a proper fix.
2014-12-17 22:12:41 +01:00
Michael Raskin
374a9cc162 Disable fontconfig tests: they break after Freetype security update, and apparently we get something working regardless of the test problems 2014-12-17 16:39:55 +03:00
Thomas Tuegel
322bb7a67b fontconfig: include user config through NixOS module 2014-12-08 10:55:24 -06:00
Domen Kožar
4aa3eec330 Merge branch 'master' into staging
Conflicts:
	pkgs/development/libraries/fontconfig/default.nix
2014-12-07 14:02:48 +01:00
Domen Kožar
a390a9cbc9 fontconfig: current behavior makes substitutes fail 2014-12-01 22:01:29 +01:00
Vladimír Čunát
3ef186bdb4 fontconfig: drop infinality (for now), close #5140
Also the simplify the expression when we rebuild anyway.
2014-11-26 22:04:57 +01:00
Shaun Sharples
61d7fb934b fontconfig: avoid questionmark in patch name on darwin
Close #5135.
@vcunat made this conditional to avoid rebuild for now.
2014-11-26 17:11:44 +01:00
Vladimír Čunát
c0e2aceef4 fontconfig: patch and document 2014-11-05 12:12:30 +01:00
Vladimír Čunát
27968ece0f fontconfig: add an upstream bugfix, remove other config inclusion 2014-10-23 10:49:45 +02:00
Luca Bruno
0927405a37 fontconfig: update 2.10.2 -> 2.11.1. Close #4410, #2050 2014-10-23 10:40:26 +02:00
Vladimír Čunát
b16994f7ce fontconfig: stop using xml:space; vital for nixos+2.11
This is a proper fix for problems described in ec985c8ffa6d29 .
The code is from @lethalman.
2014-09-28 16:57:47 +02:00
Vladimír Čunát
9217c7995c makeFontsConf: give up fontDirectories checks for now
This reverts e26188938c3142 and 77487fe6615f
CC #3515.
2014-08-11 13:53:40 +02:00
Vladimír Čunát
77487fe661 makeFontsConf: fixup to accept older font packages
They contain fonts on the silly path lib/X11/fonts/
2014-08-11 13:07:59 +02:00
Vladimír Čunát
e26188938c makeFontsConf: check for share/fonts/ in fontDirectories
Fixes #3515.
2014-08-10 11:47:07 +02:00
Luca Bruno
d4c946829f fontconfig: revert to sysconfdir=/etc. Closes #3453 2014-08-04 20:21:40 +02:00
Vladimír Čunát
dac60392fc fontconfig: attempt to fix installation on darwin 2014-06-22 11:37:43 +02:00
Vladimír Čunát
c50f0e47e1 freetype: major update, including some CVE security
- There's no fontconfig update yet, as I failed to debug it yet.
- Infinality patches are now taken from a different (maintained) source.
2014-06-17 09:00:29 +02:00
Eelco Dolstra
5ae8ed381c Shut up warning about missing fonts.dtd 2014-04-29 12:27:03 +02:00
Kirill Elagin
8dc287b88c Let users install fonts to their HOME directory 2014-04-29 12:27:03 +02:00
Vladimír Čunát
e40a059714 Revert "fontconfig: update 2.10.2 -> 2.11.0"
This reverts commit 32a4081a7f8a162cb10f3afb8cec57165f05e0b2.

After ec985c8ff the apps linked to 2.11 fontconfig run fine on nixos
with older /etc/fonts/, but the other way won't work.

Unfortunately, I see no easy work-around ATM.
2014-02-20 20:52:27 +01:00
Vladimír Čunát
ab7b06d8c9 fontconfig: propagate freetype as *.pc requires; maintain 2014-02-05 08:16:33 +01:00
Vladimír Čunát
be70104a3a Merge master into x-updates
Conflicts (taken master):
	pkgs/development/compilers/llvm/3.4/llvm.nix
2014-02-04 22:00:09 +01:00
Vladimír Čunát
ec985c8ffa fontconfig: stop using xml:space; vital for nixos+2.11
Since fontconfig-2.11 the xml:space attribute makes it reject
/etc/fonts/fonts.conf, so it renders garbage and eats lots of CPU.

To use anything linked to fontconfig-2.11 you need to have this patch
applied to your running NixOS. That's why I'm pushing it to master
before the fontconfig update (as soon as I found and tested the fix).
2014-02-04 21:58:19 +01:00
Vladimír Čunát
32a4081a7f fontconfig: update 2.10.2 -> 2.11.0
Finally. This was blocking pango update for many months.
Hopefully the infinality patches still work with this release.
2014-02-02 10:46:08 +01:00
Vladimír Čunát
625f40151b Merge branch 'master' into x-updates
Conflicts (a little tricky, I did some cleanup of interacting changes):
	pkgs/development/compilers/llvm/default.nix
	pkgs/development/libraries/libpng/default.nix
	pkgs/tools/package-management/nixops/default.nix
	pkgs/top-level/all-packages.nix
2013-08-02 18:30:53 +02:00
Eelco Dolstra
989c58eb29 Process /etc/fonts/conf.d before upstream fonts/conf.d
Otherwise the user won't be able to override anything specified in
NixOS' /etc/fonts/conf.d, since ~/.config/fontconfig is included from
upstream fonts/conf.5/50-user.conf.
2013-06-27 13:31:35 +02:00
Eelco Dolstra
143473406f freetype: Update to 2.4.12
Also update the Infinality patches.

Note that FreeType 2.5 was released a few days ago, but I don't know
how stable it is.
2013-06-21 18:44:33 +02:00
Vladimír Čunát
2058d95eb4 non-Linux platforms: extend to some important pkgs 2013-06-18 22:03:35 +02:00