Commits

Barry Schwartz  committed 868990e

Remove font stuff. Small change to fontshow.mako

  • Participants
  • Parent commits 860b41d

Comments (0)

Files changed (5)

File CF4.egg-info/SOURCES.txt

 cf4/controllers/ebook.py
 cf4/controllers/error.py
 cf4/controllers/font.py
-cf4/controllers/fontserver.py
 cf4/controllers/ligiloj.py
 cf4/controllers/links.py
 cf4/controllers/main.py
 cf4/lib/app_globals.py
 cf4/lib/base.py
 cf4/lib/content_type.py
-cf4/lib/convert_font.py
 cf4/lib/helpers.py
-cf4/lib/serve_font.py
 cf4/model/__init__.py
-cf4/model/webfonts_data.py
+cf4/public/.directory
 cf4/public/.htaccess
 cf4/public/.htaccess~
+cf4/public/Anonymous_esperanto_flag--40x21.png
 cf4/public/base.css
 cf4/public/dispatch.fcgi
 cf4/public/face-smile.png
 cf4/public/face-surprise.png
 cf4/public/favicon.ico
 cf4/public/flecha.png
+cf4/public/flower.jpg
 cf4/public/imageTools.js
+cf4/public/jp_draws_US_Flag--40x21.png
 cf4/public/kevinaj_rss_button.png
 cf4/public/pylons-logo.gif
 cf4/public/reset.css
 cf4/public/risto_pekkala_Dove_flying.png
 cf4/public/contact/contact.css
+cf4/public/contact/contact.css.orig
 cf4/public/contact/drunk.png
-cf4/public/contact/picguide.png
 cf4/public/ebook/index.css
 cf4/public/ebook/liftarn_Writing_My_Master_s_Words.png
-cf4/public/font/BonvenoCF-Light.otf
 cf4/public/font/Gutenberg_press.jpg
-cf4/public/font/Juvelo.otf
 cf4/public/font/bonveno.css
 cf4/public/font/fanwood.css
-cf4/public/font/fanwood.css~
 cf4/public/font/fontshow.css
 cf4/public/font/gb1911.css
 cf4/public/font/goudy.css
 cf4/public/font/index.css
 cf4/public/font/juvelo.css
 cf4/public/font/lindenhill.css
-cf4/public/font/lindenhill.css~
 cf4/public/font/prociono.css
-cf4/public/fontserver/show.css
 cf4/public/links/index.css
 cf4/public/main/main.css
 cf4/public/news/read.css
+cf4/public/non-free/.directory
+cf4/public/non-free/1335189--400x600.jpg
+cf4/public/non-free/1508939--400x600.jpg
 cf4/public/non-free/2006267--411x600.jpg
-cf4/public/non-free/canoeing.jpg
-cf4/public/non-free/couch.jpg
-cf4/public/non-free/daydreaming.jpg
-cf4/public/non-free/dog.jpg
-cf4/public/non-free/food-on-a-stick.jpg
-cf4/public/non-free/girl-on-bench.jpg
-cf4/public/non-free/holiday-time.jpg
-cf4/public/non-free/ice-cream.jpg
-cf4/public/non-free/lockers.jpg
-cf4/public/non-free/peeking.jpg
-cf4/public/non-free/seminar.jpg
-cf4/public/rubbish/index.css
+cf4/public/non-free/2570932--360x477.jpg
+cf4/public/non-free/2897971-400x557.jpg
+cf4/public/non-free/3068928-modified.jpg
+cf4/public/non-free/3283726--400x600.jpg
+cf4/public/non-free/stockxpertcom_id361895_jpg_ba0c4566b52b4775fbd6d386e2bfabf2-modified.jpg
+cf4/public/webfontkit/bonveno/BonvenoCF-Light-webfont.eot
+cf4/public/webfontkit/bonveno/BonvenoCF-Light-webfont.svg
+cf4/public/webfontkit/bonveno/BonvenoCF-Light-webfont.ttf
+cf4/public/webfontkit/bonveno/BonvenoCF-Light-webfont.woff
+cf4/public/webfontkit/bonveno/GNU General Public License V2.txt
+cf4/public/webfontkit/bonveno/demo.html
+cf4/public/webfontkit/bonveno/stylesheet.css
+cf4/public/webfontkit/fanwood/FanwoodTTItalic-demo.html
+cf4/public/webfontkit/fanwood/FanwoodTTRegular-demo.html
+cf4/public/webfontkit/fanwood/fanwoodtt-italic-webfont.eot
+cf4/public/webfontkit/fanwood/fanwoodtt-italic-webfont.svg
+cf4/public/webfontkit/fanwood/fanwoodtt-italic-webfont.ttf
+cf4/public/webfontkit/fanwood/fanwoodtt-italic-webfont.woff
+cf4/public/webfontkit/fanwood/fanwoodtt-webfont.eot
+cf4/public/webfontkit/fanwood/fanwoodtt-webfont.svg
+cf4/public/webfontkit/fanwood/fanwoodtt-webfont.ttf
+cf4/public/webfontkit/fanwood/fanwoodtt-webfont.woff
+cf4/public/webfontkit/fanwood/generator_config.txt
+cf4/public/webfontkit/fanwood/stylesheet.css
+cf4/public/webfontkit/fanwood/specimen_files/easytabs.js
+cf4/public/webfontkit/fanwood/specimen_files/fanwoodtt-cleartype.png
+cf4/public/webfontkit/fanwood/specimen_files/fanwoodtt-italic-cleartype.png
+cf4/public/webfontkit/fanwood/specimen_files/grid_12-825-55-15.css
+cf4/public/webfontkit/fanwood/specimen_files/specimen_stylesheet.css
+cf4/public/webfontkit/fanwoodtext/FanwoodTextTTItalic-demo.html
+cf4/public/webfontkit/fanwoodtext/FanwoodTextTTRegular-demo.html
+cf4/public/webfontkit/fanwoodtext/fanwoodtexttt-italic-webfont.eot
+cf4/public/webfontkit/fanwoodtext/fanwoodtexttt-italic-webfont.svg
+cf4/public/webfontkit/fanwoodtext/fanwoodtexttt-italic-webfont.ttf
+cf4/public/webfontkit/fanwoodtext/fanwoodtexttt-italic-webfont.woff
+cf4/public/webfontkit/fanwoodtext/fanwoodtexttt-webfont.eot
+cf4/public/webfontkit/fanwoodtext/fanwoodtexttt-webfont.svg
+cf4/public/webfontkit/fanwoodtext/fanwoodtexttt-webfont.ttf
+cf4/public/webfontkit/fanwoodtext/fanwoodtexttt-webfont.woff
+cf4/public/webfontkit/fanwoodtext/generator_config.txt
+cf4/public/webfontkit/fanwoodtext/stylesheet.css
+cf4/public/webfontkit/fanwoodtext/specimen_files/easytabs.js
+cf4/public/webfontkit/fanwoodtext/specimen_files/fanwoodtexttt-cleartype.png
+cf4/public/webfontkit/fanwoodtext/specimen_files/fanwoodtexttt-italic-cleartype.png
+cf4/public/webfontkit/fanwoodtext/specimen_files/grid_12-825-55-15.css
+cf4/public/webfontkit/fanwoodtext/specimen_files/specimen_stylesheet.css
+cf4/public/webfontkit/gb1911/GoudyBookletter1911TTRegular-demo.html
+cf4/public/webfontkit/gb1911/generator_config.txt
+cf4/public/webfontkit/gb1911/goudybookletter1911tt-webfont.eot
+cf4/public/webfontkit/gb1911/goudybookletter1911tt-webfont.svg
+cf4/public/webfontkit/gb1911/goudybookletter1911tt-webfont.ttf
+cf4/public/webfontkit/gb1911/goudybookletter1911tt-webfont.woff
+cf4/public/webfontkit/gb1911/stylesheet.css
+cf4/public/webfontkit/gb1911/specimen_files/easytabs.js
+cf4/public/webfontkit/gb1911/specimen_files/goudybookletter1911tt-cleartype.png
+cf4/public/webfontkit/gb1911/specimen_files/grid_12-825-55-15.css
+cf4/public/webfontkit/gb1911/specimen_files/specimen_stylesheet.css
+cf4/public/webfontkit/goudy/SortsMillGoudyTTItalic-demo.html
+cf4/public/webfontkit/goudy/SortsMillGoudyTTRegular-demo.html
+cf4/public/webfontkit/goudy/generator_config.txt
+cf4/public/webfontkit/goudy/goudystmtt-italic-webfont.eot
+cf4/public/webfontkit/goudy/goudystmtt-italic-webfont.svg
+cf4/public/webfontkit/goudy/goudystmtt-italic-webfont.ttf
+cf4/public/webfontkit/goudy/goudystmtt-italic-webfont.woff
+cf4/public/webfontkit/goudy/goudystmtt-webfont.eot
+cf4/public/webfontkit/goudy/goudystmtt-webfont.svg
+cf4/public/webfontkit/goudy/goudystmtt-webfont.ttf
+cf4/public/webfontkit/goudy/goudystmtt-webfont.woff
+cf4/public/webfontkit/goudy/stylesheet.css
+cf4/public/webfontkit/goudy/specimen_files/easytabs.js
+cf4/public/webfontkit/goudy/specimen_files/goudystmtt-cleartype.png
+cf4/public/webfontkit/goudy/specimen_files/goudystmtt-italic-cleartype.png
+cf4/public/webfontkit/goudy/specimen_files/grid_12-825-55-15.css
+cf4/public/webfontkit/goudy/specimen_files/specimen_stylesheet.css
+cf4/public/webfontkit/juvelo/JuveloRegular-demo.html
+cf4/public/webfontkit/juvelo/generator_config.txt
+cf4/public/webfontkit/juvelo/juvelo-webfont.eot
+cf4/public/webfontkit/juvelo/juvelo-webfont.svg
+cf4/public/webfontkit/juvelo/juvelo-webfont.ttf
+cf4/public/webfontkit/juvelo/juvelo-webfont.woff
+cf4/public/webfontkit/juvelo/stylesheet.css
+cf4/public/webfontkit/juvelo/specimen_files/easytabs.js
+cf4/public/webfontkit/juvelo/specimen_files/grid_12-825-55-15.css
+cf4/public/webfontkit/juvelo/specimen_files/juvelo-cleartype.png
+cf4/public/webfontkit/juvelo/specimen_files/specimen_stylesheet.css
+cf4/public/webfontkit/kristi/Kristi SIL OFL Font License.txt
+cf4/public/webfontkit/kristi/Kristi-webfont.eot
+cf4/public/webfontkit/kristi/Kristi-webfont.svg
+cf4/public/webfontkit/kristi/Kristi-webfont.ttf
+cf4/public/webfontkit/kristi/Kristi-webfont.woff
+cf4/public/webfontkit/kristi/demo.html
+cf4/public/webfontkit/kristi/stylesheet.css
+cf4/public/webfontkit/lindenhill/LindenHillTTItalic-demo.html
+cf4/public/webfontkit/lindenhill/LindenHillTTRegular-demo.html
+cf4/public/webfontkit/lindenhill/generator_config.txt
+cf4/public/webfontkit/lindenhill/lindenhilltt-italic-webfont.eot
+cf4/public/webfontkit/lindenhill/lindenhilltt-italic-webfont.svg
+cf4/public/webfontkit/lindenhill/lindenhilltt-italic-webfont.ttf
+cf4/public/webfontkit/lindenhill/lindenhilltt-italic-webfont.woff
+cf4/public/webfontkit/lindenhill/lindenhilltt-webfont.eot
+cf4/public/webfontkit/lindenhill/lindenhilltt-webfont.svg
+cf4/public/webfontkit/lindenhill/lindenhilltt-webfont.ttf
+cf4/public/webfontkit/lindenhill/lindenhilltt-webfont.woff
+cf4/public/webfontkit/lindenhill/stylesheet.css
+cf4/public/webfontkit/lindenhill/specimen_files/easytabs.js
+cf4/public/webfontkit/lindenhill/specimen_files/grid_12-825-55-15.css
+cf4/public/webfontkit/lindenhill/specimen_files/lindenhilltt-cleartype.png
+cf4/public/webfontkit/lindenhill/specimen_files/lindenhilltt-italic-cleartype.png
+cf4/public/webfontkit/lindenhill/specimen_files/specimen_stylesheet.css
+cf4/public/webfontkit/prociono/ProcionoTTRegular-demo.html
+cf4/public/webfontkit/prociono/generator_config.txt
+cf4/public/webfontkit/prociono/procionott-webfont.eot
+cf4/public/webfontkit/prociono/procionott-webfont.svg
+cf4/public/webfontkit/prociono/procionott-webfont.ttf
+cf4/public/webfontkit/prociono/procionott-webfont.woff
+cf4/public/webfontkit/prociono/stylesheet.css
+cf4/public/webfontkit/prociono/specimen_files/easytabs.js
+cf4/public/webfontkit/prociono/specimen_files/grid_12-825-55-15.css
+cf4/public/webfontkit/prociono/specimen_files/procionott-cleartype.png
+cf4/public/webfontkit/prociono/specimen_files/specimen_stylesheet.css
 cf4/templates/base.mako
 cf4/templates/contact/contact.mako
-cf4/templates/contact/contact.mako~
 cf4/templates/ebook/index.mako
 cf4/templates/font/bonveno.mako
 cf4/templates/font/fanwood.mako
-cf4/templates/font/fanwood.mako~
 cf4/templates/font/fontshow.mako
 cf4/templates/font/gb1911.mako
 cf4/templates/font/goudy.mako
 cf4/templates/font/juvelo.mako
 cf4/templates/font/lindenhill.mako
 cf4/templates/font/prociono.mako
-cf4/templates/fontserver/show.mako
 cf4/templates/links/index.mako
 cf4/templates/main/main.mako
 cf4/templates/news/read.mako
-cf4/templates/rubbish/index.mako
 cf4/tests/__init__.py
 cf4/tests/test_models.py
 cf4/tests/functional/__init__.py

File cf4/lib/convert_font.py

-# Copyright (c) 2010 Barry Schwartz
-#
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this software and associated documentation
-# files (the "Software"), to deal in the Software without
-# restriction, including without limitation the rights to use,
-# copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following
-# conditions:
-# 
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-
-#--------------------------------------------------------------------------
-
-import subprocess
-
-from . import serve_font
-from pylons import config
-
-#--------------------------------------------------------------------------
-
-def convert_font(font_ident, extension, fonts_dir):
-    if serve_font.font_file_exists(font_ident, '.ttf', fonts_dir):
-        try:
-            target_font = serve_font.font_file(font_ident, extension, fonts_dir)
-            ttf_font = serve_font.font_file(font_ident, '.ttf', fonts_dir)
-            if extension == '.woff':
-                subprocess.call([config['app_conf']['sfnt2woff'], ttf_font],
-                                cwd = fonts_dir)
-            elif extension == '.ttf.jgz':
-                with open(target_font, 'wb') as f:
-                    subprocess.call([config['app_conf']['gzip'], '-c', ttf_font],
-                                    stdout = f, cwd = fonts_dir)
-            elif extension == '.eot':
-                print([config['app_conf']['make_eot'], '-n', 'dummyname', ttf_font])
-                subprocess.call([config['app_conf']['make_eot'], '-n', 'dummyname', ttf_font],
-                                cwd = fonts_dir)
-            elif extension == '.eot.jgz':
-                # Make an .eot font.
-                subprocess.call([config['app_conf']['make_eot'], '-n', 'dummyname', ttf_font],
-                                cwd = fonts_dir)
-                # Compress it.
-                # FIXME: Don't gzip-compress the .eot if it already is compressed.
-                eot_font = serve_font.font_file(font_ident, '.eot', fonts_dir)
-                with open(target_font, 'wb') as f:
-                    subprocess.call([config['app_conf']['gzip'], '-c', eot_font],
-                                    stdout = f, cwd = fonts_dir)
-        except:
-            pass
-
-#--------------------------------------------------------------------------

File cf4/lib/serve_font.py

-# Copyright (c) 2010 Barry Schwartz
-#
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this software and associated documentation
-# files (the "Software"), to deal in the Software without
-# restriction, including without limitation the rights to use,
-# copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following
-# conditions:
-# 
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-
-# This Python module is based in part on the Ruby program "Fontue"
-# (http://fontue.com), which is
-#
-#    Copyright (c) 2010 Garrick Van Buren, Working Pathways, Inc.
-
-#--------------------------------------------------------------------------
-
-import os
-import re
-import stat
-
-from email.utils import formatdate
-from pylons import config, request, response
-
-def error_respond(message):
-    response.status = '404 NOT FOUND'
-    response.content_type = 'text/html'
-    return ['<p>404 NOT FOUND<hr/>' + message + '</p>']
-
-#--------------------------------------------------------------------------
-
-woff_re = re.compile('Firefox/[3-9]|Konqueror/[4-9]')
-eot_re = re.compile('\sMSIE\s')
-gzip_re = re.compile('(^\s*gzip\s*$|\s*gzip\s*,|,\s*gzip\s*$|,\s*gzip\s*,)')
-font_ident_re = re.compile('^[0-9a-zA-Z_-]+$')
-
-def likes_woff(user_agent):
-    return woff_re.search(user_agent) is not None
-
-def likes_eot(user_agent):
-    return eot_re.search(user_agent) is not None
-
-def likes_gzip(environ):
-    try:
-        acceptable_encodings = environ['HTTP_ACCEPT_ENCODING']
-        gzip_is_acceptable = (gzip_re.search(environ['HTTP_ACCEPT_ENCODING']) is not None)
-    except:
-        gzip_is_acceptable = False
-    return gzip_is_acceptable
-
-def font_file(font_ident, extension, fonts_dir):
-    return os.path.join(fonts_dir, font_ident + extension)
-
-def font_file_exists(font_ident, extension, fonts_dir):
-    font = font_file(font_ident, extension, fonts_dir)
-    return os.path.isfile(font)
-
-def feed_file_data(f, buffer_size = 8192):
-    s = f.read(buffer_size)
-    while s != '':
-        yield s
-        s = f.read(buffer_size)
-    f.close()
-
-#--------------------------------------------------------------------------
-
-def serve_font(font_ident):
-
-    if font_ident is None:
-        return error_respond('The font identifier is missing from the URL')
-
-    if 'HTTP_USER_AGENT' not in request.environ:
-        return error_respond('Font service requires HTTP_USER_AGENT, which is missing')
-
-    if font_ident_re.search(font_ident) is None:
-        return error_respond('Font identifier contains unsupported characters')
-
-    user_agent = request.environ['HTTP_USER_AGENT']
-    gzippable = likes_gzip(request.environ)
-    fonts_dir = config['app_conf']['webfonts_dir']
-
-    # TODO: Support SVG fonts, with content type image/svg+xml.
-
-    if likes_woff(user_agent) and font_file_exists(font_ident, '.woff', fonts_dir):
-        font = font_file(font_ident, '.woff', fonts_dir)
-        content_type = 'application/octet-stream'
-        encoding = None
-
-    elif likes_eot(user_agent) and gzippable and font_file_exists(font_ident, '.eot.jgz', fonts_dir):
-        font = font_file(font_ident, '.eot.jgz', fonts_dir)
-        content_type = 'application/octet-stream'
-        encoding = 'gzip'
-
-    elif likes_eot(user_agent) and font_file_exists(font_ident, '.eot', fonts_dir):
-        font = font_file(font_ident, '.eot', fonts_dir)
-        content_type = 'application/octet-stream'
-        encoding = None
-
-    elif gzippable and font_file_exists(font_ident, '.ttf.jgz', fonts_dir):
-        font = font_file(font_ident, '.ttf.jgz', fonts_dir)
-        content_type = 'application/octet-stream'
-        encoding = 'gzip'
-
-    elif font_file_exists(font_ident, '.ttf', fonts_dir):
-        font = font_file(font_ident, '.ttf', fonts_dir)
-        content_type = 'application/octet-stream'
-        encoding = None
-
-    elif gzippable and font_file_exists(font_ident, '.otf.jgz', fonts_dir):
-        font = font_file(font_ident, '.otf.jgz', fonts_dir)
-        content_type = 'application/octet-stream'
-        encoding = 'gzip'
-
-    elif font_file_exists(font_ident, '.otf', fonts_dir):
-        font = font_file(font_ident, '.otf', fonts_dir)
-        content_type = 'application/octet-stream'
-        encoding = None
-
-    else:
-        return error_respond('Font not found')
-
-    stat_buf = os.stat(font)
-    font_size = stat_buf[stat.ST_SIZE]
-    mtime = formatdate(stat_buf[stat.ST_MTIME], usegmt = True)
-    now = formatdate(usegmt = True)
-    etag = str(stat_buf[stat.ST_MTIME]) + ':' + str(font_size)
-    one_year = 60 * 60 * 24 * 365
-
-    f = open(font, 'rb')
-    if not f:
-        return error_respond('Font cannot be opened for reading')
-
-    if 'HTTP_IF_NONE_MATCH' in request.environ and etag == request.environ['HTTP_IF_NONE_MATCH']:
-
-        headers = []
-        headers.append(('Date', now))
-        response.headerlist = headers
-        response.status = '304 NOT MODIFIED'
-        return []
-
-    else:
-        headers = []
-        headers.append(('Date', now))
-        headers.append(('Last-Modified', mtime))
-        headers.append(('Content-Type', content_type))
-        headers.append(('Content-Length', str(font_size)))
-        if encoding is not None:
-            headers.append(('Content-Encoding', encoding))
-        headers.append(('Content-Disposition', 'inline;filename=' + os.path.basename(font).encode()))
-        headers.append(('Cache-Control', 'max-age=' + str(one_year) + ',public'))
-        headers.append(('Access-Control-Allow-Origin', '*'))
-        headers.append(('ETag', etag))
-        response.headerlist = headers
-        return feed_file_data(f)
-
-#--------------------------------------------------------------------------

File cf4/model/webfonts_data.py

-# Copyright (c) 2010 Barry Schwartz
-#
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this software and associated documentation
-# files (the "Software"), to deal in the Software without
-# restriction, including without limitation the rights to use,
-# copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following
-# conditions:
-# 
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-
-#--------------------------------------------------------------------------
-
-import fontforge
-import os
-import transaction
-
-from copy import copy
-from pylons import config
-from cf4.lib import convert_font, serve_font
-
-from tokyo.cabinet import TDB, TDBOREADER, TDBOWRITER, TDBOCREAT, TDBOTRUNC
-
-#--------------------------------------------------------------------------
-
-def examine_font(fonts_dir, file_name):
-    f = fontforge.open(os.path.join(fonts_dir, file_name))
-    data = {
-        'file'     : file_name,
-        'ident'    : file_name[:-4],
-        'family'   : f.familyname,
-        'fullname' : f.fullname,
-        }
-    f.close()
-    return data
-
-def examine_fonts_dir(fonts_dir):
-    file_list = os.listdir(fonts_dir)
-    fonts = []
-    for file_name in file_list:
-        if file_name[-4:] in ('.ttf', '.otf'):
-            font_data = examine_font(fonts_dir, file_name)
-            fonts.append(font_data)
-    fonts.sort(key = (lambda font : (font['family'], font['fullname'])))
-    return fonts
-
-class webfonts:
-
-    directory = config['app_conf']['webfonts_dir']
-    database = config['app_conf']['webfonts_db']
-    db = TDB()
-
-    @classmethod
-    def prepare(self):
-
-        fonts = examine_fonts_dir(self.directory)
-
-        for font in fonts:
-            ident = font['ident']
-            if not serve_font.font_file_exists(ident, '.woff', self.directory):
-                convert_font.convert_font(ident, '.woff', self.directory)
-            if not serve_font.font_file_exists(ident, '.ttf.jgz', self.directory):
-                convert_font.convert_font(ident, '.ttf.jgz', self.directory)
-            if not serve_font.font_file_exists(ident, '.eot', self.directory):
-                convert_font.convert_font(ident, '.eot', self.directory)
-            if not serve_font.font_file_exists(ident, '.eot.jgz', self.directory):
-                convert_font.convert_font(ident, '.eot.jgz', self.directory)
-
-        self.db.open(self.database, TDBOWRITER | TDBOCREAT | TDBOTRUNC)
-        i = 0
-        for font in fonts:
-            self.db[str(i)] = font
-            i += 1
-        self.db.close()
-
-    @classmethod
-    def check(self):
-        if not os.path.exists(self.database):
-            webfonts.prepare()
-
-    @classmethod
-    def the_fonts(self):
-        self.check()
-        self.db.open(self.database, TDBOREADER)
-        fonts = []
-        for i in range(0, len(self.db)):
-            fonts.append(self.db[str(i)])
-        self.db.close()
-        return fonts
-
-    @classmethod
-    def note_contents(self, font_ident):
-        contents = ''
-        try:
-            f = open(os.path.join(webfonts.directory, font_ident + '.note'))
-            contents = f.read()
-            f.close()
-        except:
-            pass
-        return contents
-
-#--------------------------------------------------------------------------

File cf4/templates/font/fontshow.mako

 
   <div id="download">
     <a href="${c.download_url}">
-      <img alt="download arrow" src="/flecha.png" class="download-arrow" /> <p>${_(u'Download')}</p>
+      <img alt="" src="/flecha.png" class="download-arrow" /> <p>${_(u'Download')}</p>
     </a>
   </div>