Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Change default interpolation to nearest #4622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions 1 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dist
.eggs
# tox testing tool
.tox
setup.cfg

# OS generated files #
######################
Expand Down
6 changes: 5 additions & 1 deletion 6 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ install:
# version since is it basically just a .ttf file
# The current Travis Ubuntu image is to old to search .local/share/fonts so we store fonts in .fonts

# We install ipython to use the console highlighting. From IPython 3 this depends on jsonschema and misture.
# We install ipython to use the console highlighting. From IPython 3 this depends on jsonschema and mistune.
# Neihter is installed as a dependency of IPython since they are not used by the IPython console.
- |
if [[ $BUILD_DOCS == true ]]; then
Expand All @@ -96,7 +96,11 @@ install:
cp tmp/usr/share/fonts/truetype/humor-sans/Humor-Sans.ttf ~/.fonts
cp Felipa-Regular.ttf ~/.fonts
fc-cache -f -v
else
# Use the special local version of freetype for testing
cp .travis/setup.cfg .
fi;

- python setup.py install

script:
Expand Down
2 changes: 2 additions & 0 deletions 2 .travis/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[test]
local_freetype=True
2 changes: 1 addition & 1 deletion 2 INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ libpng 1.2 (or later)
`pytz`
Used to manipulate time-zone aware datetimes.

:term:`freetype` 2.3 or later
:term:`FreeType` 2.3 or later
library for reading true type font files.

``cycler`` 0.9 or later
Expand Down
27 changes: 16 additions & 11 deletions 27 doc/devel/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ Optionally you can install:

- `pep8 <http://pep8.readthedocs.org/en/latest>`_ to test coding standards

Building matplotlib for image comparison tests
----------------------------------------------

matplotlib's test suite makes heavy use of image comparison tests,
meaning the result of a plot is compared against a known good result.
Unfortunately, different versions of FreeType produce differently
formed characters, causing these image comparisons to fail. To make
them reproducible, matplotlib can be built with a special local copy
of FreeType. This is recommended for all matplotlib developers.

Add the following content to a ``setup.cfg`` file at the root of the
matplotlib source directory::

[test]
local_freetype = True

Running the tests
-----------------

Expand Down Expand Up @@ -185,17 +201,6 @@ decorator:
If some variation is expected in the image between runs, this
value may be adjusted.

Freetype version
----------------

Due to subtle differences in the font rendering under different
version of freetype some care must be taken when generating the
baseline images. Currently (early 2015), almost all of the images
were generated using ``freetype 2.5.3-21`` on Fedora 21 and only the
fonts that ship with ``matplotlib`` (regenerated in PR #4031 / commit
005cfde02751d274f2ab8016eddd61c3b3828446) and travis is using
``freetype 2.4.8`` on ubuntu.

Known failing tests
-------------------

Expand Down
4 changes: 2 additions & 2 deletions 4 doc/glossary/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Glossary
EPS
Encapsulated Postscript (`EPS <http://en.wikipedia.org/wiki/Encapsulated_PostScript>`_)

freetype
`freetype <http://www.freetype.org/>`_ is a font rasterization
FreeType
`FreeType <http://www.freetype.org/>`_ is a font rasterization
library used by matplotlib which supports TrueType, Type 1, and
OpenType fonts.

Expand Down
2 changes: 1 addition & 1 deletion 2 doc/users/screenshots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Mathtext_examples

Below is a sampling of the many TeX expressions now supported by matplotlib's
internal mathtext engine. The mathtext module provides TeX style mathematical
expressions using `freetype2 <http://www.freetype.org/>`_
expressions using `FreeType <http://www.freetype.org/>`_
and the BaKoMa computer modern or `STIX <http://www.stixfonts.org>`_ fonts.
See the :mod:`matplotlib.mathtext` module for additional details.

Expand Down
2 changes: 1 addition & 1 deletion 2 doc/users/text_intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ expressions, truetype support for raster and vector outputs, newline
separated text with arbitrary rotations, and unicode support. Because
we embed the fonts directly in the output documents, e.g., for postscript
or PDF, what you see on the screen is what you get in the hardcopy.
`freetype2 <http://www.freetype.org/>`_ support
`FreeType <http://www.freetype.org/>`_ support
produces very nice, antialiased fonts, that look good even at small
raster sizes. matplotlib includes its own
:mod:`matplotlib.font_manager`, thanks to Paul Barrett, which
Expand Down
5 changes: 5 additions & 0 deletions 5 doc/users/whats_new/faster-text-rendering.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Faster text rendering
---------------------

Rendering text in the Agg backend is now less fuzzy and about 20%
faster to draw.
1 change: 0 additions & 1 deletion 1 examples/misc/ftface_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,4 @@

print(dir(font))

cmap = font.get_charmap()
print(font.get_kerning)
7 changes: 1 addition & 6 deletions 7 examples/misc/multiprocess.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# Demo of using multiprocessing for generating data in one process and plotting
# in another.
# Written by Robert Cimrman
# Requires >= Python 2.6 for the multiprocessing module or having the
# standalone processing module installed

from __future__ import print_function
import time
try:
from multiprocessing import Process, Pipe
except ImportError:
from processing import Process, Pipe
from multiprocessing import Process, Pipe
import numpy as np

import matplotlib
Expand Down
2 changes: 1 addition & 1 deletion 2 examples/pylab_examples/font_table_ttf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- noplot -*-
"""
matplotlib has support for freetype fonts. Here's a little example
matplotlib has support for FreeType fonts. Here's a little example
using the 'table' command to build a font table that shows the glyphs
by character code.

Expand Down
19 changes: 16 additions & 3 deletions 19 lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,11 @@ def _forward_ilshift(self, other):


major, minor1, minor2, s, tmp = sys.version_info
_python26 = (major == 2 and minor1 >= 6) or major >= 3
_python27 = (major == 2 and minor1 >= 7)
_python34 = (major == 3 and minor1 >= 4)

if not _python26:
raise ImportError('matplotlib requires Python 2.6 or later')
if not (_python27 or _python34):
raise ImportError('matplotlib requires Python 2.7 or 3.4 or later')


if not compare_versions(numpy.__version__, __version__numpy__):
Expand Down Expand Up @@ -1487,6 +1488,18 @@ def verify_test_dependencies():
if not os.path.isdir(os.path.join(os.path.dirname(__file__), 'tests')):
raise ImportError("matplotlib test data is not installed")

# The version of FreeType to install locally for running the
# tests. This must match the value in `setupext.py`
LOCAL_FREETYPE_VERSION = '2.6.1'

from matplotlib import ft2font
if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
ft2font.__freetype_build_type__ != 'local'):
warnings.warn(
"matplotlib is not built with the correct FreeType version to run "
"tests. Set local_freetype=True in setup.cfg and rebuild. "
"Expect many image comparison failures below.")

try:
import nose
try:
Expand Down
2 changes: 0 additions & 2 deletions 2 lib/matplotlib/_mathtext_data.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
font data tables for truetype and afm computer modern fonts
"""
# this dict maps symbol names to fontnames, glyphindex. To get the
# glyph index from the character code, you have to use get_charmap
from __future__ import (absolute_import, division, print_function,
unicode_literals)

Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.