Skip to content

Commit

Permalink
Merge branch 'release/0.31.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
xrotwang committed Feb 6, 2015
2 parents 3aa1cc3 + cecdd8e commit 4b28ae1
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Expand Up @@ -2,6 +2,12 @@
Changes
-------

0.31.4
~~~~~~

Added support for using CharisSIL fonts when creating PDFs with Pisa.


0.31.3
~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion clld/__init__.py
Expand Up @@ -5,7 +5,7 @@
from clld import interfaces


__version__ = "0.31.3"
__version__ = "0.31.4"


class Resource(namedtuple('Resource', 'name model interface with_index with_rdfdump')):
Expand Down
5 changes: 5 additions & 0 deletions clld/tests/test_web_util_helpers.py
Expand Up @@ -11,6 +11,11 @@


class Tests(TestWithEnv):
def test_charis_font_spec_css(self):
from clld.web.util.helpers import charis_font_spec_css

assert charis_font_spec_css()

def test_collapsed(self):
from clld.web.util.helpers import collapsed

Expand Down
Binary file added clld/web/static/fonts/CharisSIL-B.ttf
Binary file not shown.
Binary file added clld/web/static/fonts/CharisSIL-BI.ttf
Binary file not shown.
Binary file added clld/web/static/fonts/CharisSIL-I.ttf
Binary file not shown.
Binary file added clld/web/static/fonts/CharisSIL-R.ttf
Binary file not shown.
3 changes: 3 additions & 0 deletions clld/web/templates/language/snippet_html.mako
Expand Up @@ -24,5 +24,8 @@
% endif
% else:
<h3>${h.link(request, ctx)}</h3>
% if ctx.description:
<p>${ctx.description}</p>
% endif
${h.format_coordinates(ctx)}
% endif
33 changes: 33 additions & 0 deletions clld/web/util/helpers.py
Expand Up @@ -4,6 +4,7 @@
.. note:: This module is available within Mako templates as ``h``.
"""
from __future__ import unicode_literals
import os
import re
from itertools import groupby # we just import this to have it available in templates!
assert groupby # appease pyflakes
Expand Down Expand Up @@ -31,6 +32,7 @@
from pyramid.interfaces import IRoutesMapper
from purl import URL

import clld
from clld import interfaces
from clld import RESOURCES
from clld.web.util.htmllib import HTML, literal
Expand Down Expand Up @@ -678,3 +680,34 @@ def collapsed(id_, content, button_content=None):
button_content or icon('plus-sign'),
**{'class': 'btn', 'data-toggle': 'collapse', 'data-target': '#%s' % id_})),
HTML.div(content, id=id_, class_='collapse'))


def static_path(*comps):
return os.path.abspath(
os.path.join(os.path.dirname(clld.__file__), 'web', 'static', *comps))


def charis_font_spec_css():
"""Font spec for using CharisSIL with Pisa (xhtml2pdf)."""
return """
@font-face {{
font-family: 'charissil';
src: url('{0}/CharisSIL-R.ttf');
}}
@font-face {{
font-family: 'charissil';
font-style: italic;
src: url('{0}/CharisSIL-I.ttf');
}}
@font-face {{
font-family: 'charissil';
font-weight: bold;
src: url('{0}/CharisSIL-B.ttf');
}}
@font-face {{
font-family: 'charissil';
font-weight: bold;
font-style: italic;
src: url('{0}/CharisSIL-BI.ttf');
}}
""".format(static_path('fonts'))
4 changes: 2 additions & 2 deletions docs/conf.py
Expand Up @@ -51,10 +51,10 @@
# built documents.
#
# The full version, including alpha/beta/rc tags.
release = '0.31.3'
release = '0.31.4'

# The short X.Y version.
version = '0.31.3'
version = '0.31.4'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -80,7 +80,7 @@
]

setup(name='clld',
version='0.31.3',
version='0.31.4',
description=(
'Python library supporting the development of cross-linguistic databases'),
long_description=README + '\n\n' + CHANGES,
Expand Down

0 comments on commit 4b28ae1

Please sign in to comment.