From: Radek Czajka Date: Tue, 9 Jun 2020 21:08:53 +0000 (+0200) Subject: Introduce src dir. X-Git-Tag: 1.9~8 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/fefdce4e24f9e397df5538fe6e7f54b5ece4d841 Introduce src dir. --- diff --git a/MANIFEST.in b/MANIFEST.in index af6efac..a262372 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,12 +4,12 @@ include NOTICE include tox.ini recursive-include scripts *.py *.css recursive-include tests *.py *.xml *.html *.out *.txt *.jpeg -include librarian/xslt/*.xslt -include librarian/xslt/*.xml -include librarian/epub/* -include librarian/pdf/* -include librarian/fb2/* -include librarian/fonts/* -graft librarian/res -graft librarian/font-optimizer +include src/librarian/xslt/*.xslt +include src/librarian/xslt/*.xml +include src/librarian/epub/* +include src/librarian/pdf/* +include src/librarian/fb2/* +include src/librarian/fonts/* +graft src/librarian/res +graft src/librarian/font-optimizer diff --git a/librarian/__init__.py b/librarian/__init__.py deleted file mode 100644 index 119b6b1..0000000 --- a/librarian/__init__.py +++ /dev/null @@ -1,279 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import print_function, unicode_literals - -import os -import re -import shutil -from tempfile import NamedTemporaryFile -import urllib -from lxml import etree -import six -from six.moves.urllib.request import FancyURLopener -from .util import makedirs - - -@six.python_2_unicode_compatible -class UnicodeException(Exception): - def __str__(self): - """ Dirty workaround for Python Unicode handling problems. """ - args = self.args[0] if len(self.args) == 1 else self.args - try: - message = six.text_type(args) - except UnicodeDecodeError: - message = six.text_type(args, encoding='utf-8', errors='ignore') - return message - -class ParseError(UnicodeException): - pass - -class ValidationError(UnicodeException): - pass - -class NoDublinCore(ValidationError): - """There's no DublinCore section, and it's required.""" - pass - -class NoProvider(UnicodeException): - """There's no DocProvider specified, and it's needed.""" - pass - -class XMLNamespace(object): - '''A handy structure to repsent names in an XML namespace.''' - - def __init__(self, uri): - self.uri = uri - - def __call__(self, tag): - return '{%s}%s' % (self.uri, tag) - - def __contains__(self, tag): - return tag.startswith('{' + str(self) + '}') - - def __repr__(self): - return 'XMLNamespace(%r)' % self.uri - - def __str__(self): - return '%s' % self.uri - -class EmptyNamespace(XMLNamespace): - def __init__(self): - super(EmptyNamespace, self).__init__('') - - def __call__(self, tag): - return tag - -# some common namespaces we use -XMLNS = XMLNamespace('http://www.w3.org/XML/1998/namespace') -RDFNS = XMLNamespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#') -DCNS = XMLNamespace('http://purl.org/dc/elements/1.1/') -XINS = XMLNamespace("http://www.w3.org/2001/XInclude") -XHTMLNS = XMLNamespace("http://www.w3.org/1999/xhtml") -NCXNS = XMLNamespace("http://www.daisy.org/z3986/2005/ncx/") -OPFNS = XMLNamespace("http://www.idpf.org/2007/opf") -PLMETNS = XMLNamespace("http://dl.psnc.pl/schemas/plmet/") - -WLNS = EmptyNamespace() - - -@six.python_2_unicode_compatible -class WLURI(object): - """Represents a WL URI. Extracts slug from it.""" - slug = None - - example = 'http://wolnelektury.pl/katalog/lektura/template/' - _re_wl_uri = re.compile(r'http://(www\.)?wolnelektury.pl/katalog/lektur[ay]/' - '(?P[-a-z0-9]+)/?$') - - def __init__(self, uri): - uri = six.text_type(uri) - self.uri = uri - self.slug = uri.rstrip('/').rsplit('/', 1)[-1] - - @classmethod - def strict(cls, uri): - match = cls._re_wl_uri.match(uri) - if not match: - raise ValidationError(u'Invalid URI (%s). Should match: %s' % ( - uri, cls._re_wl_uri.pattern)) - return cls(uri) - - @classmethod - def from_slug(cls, slug): - """Contructs an URI from slug. - - >>> print(WLURI.from_slug('a-slug').uri) - http://wolnelektury.pl/katalog/lektura/a-slug/ - - """ - uri = 'http://wolnelektury.pl/katalog/lektura/%s/' % slug - return cls(uri) - - def __str__(self): - return self.uri - - def __eq__(self, other): - return self.slug == other.slug - - -class DocProvider(object): - """Base class for a repository of XML files. - - Used for generating joined files, like EPUBs. - """ - - def by_slug(self, slug): - """Should return a file-like object with a WL document XML.""" - raise NotImplementedError - - def by_uri(self, uri, wluri=WLURI): - """Should return a file-like object with a WL document XML.""" - wluri = wluri(uri) - return self.by_slug(wluri.slug) - - -class DirDocProvider(DocProvider): - """ Serve docs from a directory of files in form .xml """ - - def __init__(self, dir_): - self.dir = dir_ - self.files = {} - - def by_slug(self, slug): - fname = slug + '.xml' - return open(os.path.join(self.dir, fname), 'rb') - - -from . import dcparser - -DEFAULT_BOOKINFO = dcparser.BookInfo( - { RDFNS('about'): u'http://wiki.wolnepodreczniki.pl/Lektury:Template'}, - { DCNS('creator'): [u'Some, Author'], - DCNS('title'): [u'Some Title'], - DCNS('subject.period'): [u'Unknown'], - DCNS('subject.type'): [u'Unknown'], - DCNS('subject.genre'): [u'Unknown'], - DCNS('date'): ['1970-01-01'], - DCNS('language'): [u'pol'], - # DCNS('date'): [creation_date], - DCNS('publisher'): [u"Fundacja Nowoczesna Polska"], - DCNS('description'): - [u"""Publikacja zrealizowana w ramach projektu - Wolne Lektury (http://wolnelektury.pl). Reprodukcja cyfrowa - wykonana przez Bibliotekę Narodową z egzemplarza - pochodzącego ze zbiorów BN."""], - DCNS('identifier.url'): [WLURI.example], - DCNS('rights'): - [u"Domena publiczna - zm. [OPIS STANU PRAWNEGO TEKSTU]"] }) - -def xinclude_forURI(uri): - e = etree.Element(XINS("include")) - e.set("href", uri) - return etree.tostring(e, encoding='unicode') - -def wrap_text(ocrtext, creation_date, bookinfo=DEFAULT_BOOKINFO): - """Wrap the text within the minimal XML structure with a DC template.""" - bookinfo.created_at = creation_date - - dcstring = etree.tostring(bookinfo.to_etree(), \ - method='xml', encoding='unicode', pretty_print=True) - - return u'\n' + dcstring + u'\n\n' + ocrtext + \ - u'\n\n' - - -def serialize_raw(element): - b = u'' + (element.text or '') - - for child in element.iterchildren(): - e = etree.tostring(child, method='xml', encoding='unicode', - pretty_print=True) - b += e - - return b - -SERIALIZERS = { - 'raw': serialize_raw, -} - -def serialize_children(element, format='raw'): - return SERIALIZERS[format](element) - -def get_resource(path): - return os.path.join(os.path.dirname(__file__), path) - - -class OutputFile(object): - """Represents a file returned by one of the converters.""" - - _bytes = None - _filename = None - - def __del__(self): - if self._filename: - os.unlink(self._filename) - - def __nonzero__(self): - return self._bytes is not None or self._filename is not None - - @classmethod - def from_bytes(cls, bytestring): - """Converter returns contents of a file as a string.""" - - instance = cls() - instance._bytes = bytestring - return instance - - @classmethod - def from_filename(cls, filename): - """Converter returns contents of a file as a named file.""" - - instance = cls() - instance._filename = filename - return instance - - def get_bytes(self): - """Get file's contents as a bytestring.""" - - if self._filename is not None: - with open(self._filename, 'rb') as f: - return f.read() - else: - return self._bytes - - def get_file(self): - """Get file as a file-like object.""" - - if self._bytes is not None: - return six.BytesIO(self._bytes) - elif self._filename is not None: - return open(self._filename, 'rb') - - def get_filename(self): - """Get file as a fs path.""" - - if self._filename is not None: - return self._filename - elif self._bytes is not None: - temp = NamedTemporaryFile(prefix='librarian-', delete=False) - temp.write(self._bytes) - temp.close() - self._filename = temp.name - return self._filename - else: - return None - - def save_as(self, path): - """Save file to a path. Create directories, if necessary.""" - - dirname = os.path.dirname(os.path.abspath(path)) - makedirs(dirname) - shutil.copy(self.get_filename(), path) - - -class URLOpener(FancyURLopener): - version = 'FNP Librarian (http://github.com/fnp/librarian)' -urllib._urlopener = URLOpener() diff --git a/librarian/book2anything.py b/librarian/book2anything.py deleted file mode 100755 index 948d9fd..0000000 --- a/librarian/book2anything.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import print_function, unicode_literals - -import os.path -import optparse -import six -from librarian import DirDocProvider, ParseError -from librarian.parser import WLDocument -from librarian.cover import make_cover - - -class Option(object): - """Option for optparse. Use it like `optparse.OptionParser.add_option`.""" - def __init__(self, *names, **options): - self.names = names - self.options = options - - def add(self, parser): - parser.add_option(*self.names, **self.options) - - def name(self): - return self.options['dest'] - - def value(self, options): - return getattr(options, self.name()) - - -class Book2Anything(object): - """A class for creating book2... scripts. - - Subclass it for any format you want to convert to. - """ - format_name = None # Set format name, like "PDF". - ext = None # Set file extension, like "pdf". - uses_cover = False # Can it add a cover? - cover_optional = True # Only relevant if uses_cover - uses_provider = False # Does it need a DocProvider? - transform = None # Transform method. Uses WLDocument.as_{ext} by default. - parser_options = [] # List of Option objects for additional parser args. - transform_options = [] # List of Option objects for additional transform args. - transform_flags = [] # List of Option objects for supported transform flags. - - @classmethod - def run(cls): - # Parse commandline arguments - usage = """Usage: %%prog [options] SOURCE [SOURCE...] - Convert SOURCE files to %s format.""" % cls.format_name - - parser = optparse.OptionParser(usage=usage) - - parser.add_option('-v', '--verbose', action='store_true', dest='verbose', default=False, - help='print status messages to stdout') - parser.add_option('-d', '--make-dir', action='store_true', dest='make_dir', default=False, - help='create a directory for author and put the output file in it') - parser.add_option('-o', '--output-file', dest='output_file', metavar='FILE', - help='specifies the output file') - parser.add_option('-O', '--output-dir', dest='output_dir', metavar='DIR', - help='specifies the directory for output') - if cls.uses_cover: - if cls.cover_optional: - parser.add_option('-c', '--with-cover', action='store_true', dest='with_cover', default=False, - help='create default cover') - parser.add_option('-C', '--image-cache', dest='image_cache', metavar='URL', - help='prefix for image download cache' + - (' (implies --with-cover)' if cls.cover_optional else '')) - for option in cls.parser_options + cls.transform_options + cls.transform_flags: - option.add(parser) - - options, input_filenames = parser.parse_args() - - if len(input_filenames) < 1: - parser.print_help() - return 1 - - # Prepare additional args for parser. - parser_args = {} - for option in cls.parser_options: - parser_args[option.name()] = option.value(options) - # Prepare additional args for transform method. - transform_args = {} - for option in cls.transform_options: - transform_args[option.name()] = option.value(options) - # Add flags to transform_args, if any. - transform_flags = [flag.name() for flag in cls.transform_flags if flag.value(options)] - if transform_flags: - transform_args['flags'] = transform_flags - if options.verbose: - transform_args['verbose'] = True - # Add cover support, if any. - if cls.uses_cover: - if options.image_cache: - def cover_class(book_info, *args, **kwargs): - return make_cover(book_info, image_cache=options.image_cache, *args, **kwargs) - transform_args['cover'] = cover_class - elif not cls.cover_optional or options.with_cover: - transform_args['cover'] = make_cover - - # Do some real work - try: - for main_input in input_filenames: - if options.verbose: - print(main_input) - - if isinstance(main_input, six.binary_type): - main_input = main_input.decode('utf-8') - - # Where to find input? - if cls.uses_provider: - path, fname = os.path.realpath(main_input).rsplit('/', 1) - provider = DirDocProvider(path) - else: - provider = None - - # Where to write output? - if not (options.output_file or options.output_dir): - output_file = os.path.splitext(main_input)[0] + '.' + cls.ext - else: - output_file = options.output_file - - # Do the transformation. - doc = WLDocument.from_file(main_input, provider=provider, **parser_args) - transform = cls.transform - if transform is None: - transform = getattr(WLDocument, 'as_%s' % cls.ext) - output = transform(doc, **transform_args) - - doc.save_output_file(output, output_file, options.output_dir, options.make_dir, cls.ext) - - except ParseError as e: - print('%(file)s:%(name)s:%(message)s' % { - 'file': main_input, - 'name': e.__class__.__name__, - 'message': e - }) diff --git a/librarian/cover.py b/librarian/cover.py deleted file mode 100644 index 0f38ec3..0000000 --- a/librarian/cover.py +++ /dev/null @@ -1,614 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import unicode_literals - -import re -from PIL import Image, ImageFont, ImageDraw, ImageFilter -from six import BytesIO -from librarian import get_resource, OutputFile, URLOpener - - -class Metric(object): - """Gets metrics from an object, scaling it by a factor.""" - def __init__(self, obj, scale): - self._obj = obj - self._scale = float(scale) - - def __getattr__(self, name): - src = getattr(self._obj, name) - if src and self._scale: - return type(src)(self._scale * src) - else: - return src - - -class TextBox(object): - """Creates an Image with a series of centered strings.""" - - SHADOW_X = 3 - SHADOW_Y = 3 - SHADOW_BLUR = 3 - - def __init__(self, max_width, max_height, padding_x=None, padding_y=None): - if padding_x is None: - padding_x = self.SHADOW_X + self.SHADOW_BLUR - if padding_y is None: - padding_y = self.SHADOW_Y + self.SHADOW_BLUR - - self.max_width = max_width - self.max_text_width = max_width - 2 * padding_x - self.padding_y = padding_y - self.height = padding_y - self.img = Image.new('RGBA', (max_width, max_height)) - self.draw = ImageDraw.Draw(self.img) - self.shadow_img = None - self.shadow_draw = None - - def skip(self, height): - """Skips some vertical space.""" - self.height += height - - def text(self, text, color='#000', font=None, line_height=20, - shadow_color=None): - """Writes some centered text.""" - text = re.sub(r'\s+', ' ', text) - if shadow_color: - if not self.shadow_img: - self.shadow_img = Image.new('RGBA', self.img.size) - self.shadow_draw = ImageDraw.Draw(self.shadow_img) - while text: - line = text - line_width = self.draw.textsize(line, font=font)[0] - while line_width > self.max_text_width: - parts = line.rsplit(' ', 1) - if len(parts) == 1: - line_width = self.max_text_width - break - line = parts[0] - line_width = self.draw.textsize(line, font=font)[0] - line = line.strip() + ' ' - - pos_x = (self.max_width - line_width) // 2 - - if shadow_color: - self.shadow_draw.text( - (pos_x + self.SHADOW_X, self.height + self.SHADOW_Y), - line, font=font, fill=shadow_color - ) - - self.draw.text((pos_x, self.height), line, font=font, fill=color) - self.height += line_height - # go to next line - text = text[len(line):] - - def image(self): - """Creates the actual Image object.""" - image = Image.new('RGBA', (self.max_width, - self.height + self.padding_y)) - if self.shadow_img: - shadow = self.shadow_img.filter(ImageFilter.BLUR) - image.paste(shadow, (0, 0), shadow) - image.paste(self.img, (0, 0), self.img) - else: - image.paste(self.img, (0, 0)) - return image - - -class Cover(object): - """Abstract base class for cover images generator.""" - width = 600 - height = 800 - background_color = '#fff' - background_img = None - - author_top = 100 - author_margin_left = 20 - author_margin_right = 20 - author_lineskip = 40 - author_color = '#000' - author_shadow = None - author_font_ttf = get_resource('fonts/DejaVuSerif.ttf') - author_font_size = 30 - - title_top = 100 - title_margin_left = 20 - title_margin_right = 20 - title_lineskip = 54 - title_color = '#000' - title_shadow = None - title_font_ttf = get_resource('fonts/DejaVuSerif.ttf') - title_font_size = 40 - - logo_bottom = None - logo_width = None - uses_dc_cover = False - - format = 'JPEG' - scale = 1 - scale_after = 1 - - exts = { - 'JPEG': 'jpg', - 'PNG': 'png', - } - - mime_types = { - 'JPEG': 'image/jpeg', - 'PNG': 'image/png', - } - - def __init__(self, book_info, format=None, width=None, height=None): - self.authors = [auth.readable() for auth in book_info.authors] - self.title = book_info.title - if format is not None: - self.format = format - if width and height: - self.height = int(round(height * self.width / width)) - scale = max(float(width or 0) / self.width, float(height or 0) / self.height) - if scale >= 1: - self.scale = scale - elif scale: - self.scale_after = scale - - def pretty_authors(self): - """Allows for decorating authors' names.""" - return [self.authors] - - def pretty_title(self): - """Allows for decorating title.""" - return self.title - - def image(self): - metr = Metric(self, self.scale) - img = Image.new('RGB', (metr.width, metr.height), self.background_color) - - if self.background_img: - background = Image.open(self.background_img) - img.paste(background, None, background) - del background - - # WL logo - if metr.logo_width: - logo = Image.open(get_resource('res/wl-logo.png')) - logo = logo.resize((metr.logo_width, int(round(logo.size[1] * metr.logo_width / logo.size[0])))) - img.paste(logo, ((metr.width - metr.logo_width) // 2, img.size[1] - logo.size[1] - metr.logo_bottom)) - - top = metr.author_top - tbox = TextBox( - metr.width - metr.author_margin_left - metr.author_margin_right, - metr.height - top, - ) - - author_font = ImageFont.truetype( - self.author_font_ttf, metr.author_font_size) - for pa in self.pretty_authors(): - tbox.text(pa, self.author_color, author_font, metr.author_lineskip, self.author_shadow) - text_img = tbox.image() - img.paste(text_img, (metr.author_margin_left, top), text_img) - - top += text_img.size[1] + metr.title_top - tbox = TextBox( - metr.width - metr.title_margin_left - metr.title_margin_right, - metr.height - top, - ) - title_font = ImageFont.truetype( - self.title_font_ttf, metr.title_font_size) - tbox.text(self.pretty_title(), self.title_color, title_font, metr.title_lineskip, self.title_shadow) - text_img = tbox.image() - img.paste(text_img, (metr.title_margin_left, top), text_img) - - return img - - def final_image(self): - img = self.image() - if self.scale_after != 1: - img = img.resize(( - int(round(img.size[0] * self.scale_after)), - int(round(img.size[1] * self.scale_after))), - Image.ANTIALIAS) - return img - - def mime_type(self): - return self.mime_types[self.format] - - def ext(self): - return self.exts[self.format] - - def save(self, *args, **kwargs): - default_kwargs = { - 'format': self.format, - 'quality': 95, - } - default_kwargs.update(kwargs) - return self.final_image().save(*args, **default_kwargs) - - def output_file(self, *args, **kwargs): - imgstr = BytesIO() - self.save(imgstr, *args, **kwargs) - return OutputFile.from_bytes(imgstr.getvalue()) - - -class WLCover(Cover): - """Wolne Lektury cover without logos.""" - width = 600 - height = 833 - uses_dc_cover = True - author_font_ttf = get_resource('fonts/JunicodeWL-Regular.ttf') - author_font_size = 20 - author_lineskip = 30 - title_font_ttf = get_resource('fonts/DejaVuSerif-Bold.ttf') - title_font_size = 30 - title_lineskip = 40 - title_box_width = 350 - - box_top_margin = 100 - box_bottom_margin = 100 - box_padding_y = 20 - box_above_line = 10 - box_below_line = 15 - box_line_left = 75 - box_line_right = 275 - box_line_width = 2 - - logo_top = 15 - logo_width = 140 - - bar_width = 35 - bar_color = '#000' - box_position = 'middle' - background_color = '#444' - author_color = '#444' - background_img = get_resource('res/cover.png') - format = 'JPEG' - - epoch_colors = { - u'Starożytność': '#9e3610', - u'Średniowiecze': '#564c09', - u'Renesans': '#8ca629', - u'Barok': '#a6820a', - u'Oświecenie': '#f2802e', - u'Romantyzm': '#db4b16', - u'Pozytywizm': '#961060', - u'Modernizm': '#7784e0', - u'Dwudziestolecie międzywojenne': '#3044cf', - u'Współczesność': '#06393d', - } - - kind_box_position = { - u'Liryka': 'top', - u'Epika': 'bottom', - } - - def __init__(self, book_info, format=None, width=None, height=None, bleed=0): - super(WLCover, self).__init__(book_info, format=format, width=width, height=height) - # Set box position. - self.box_position = book_info.cover_box_position or \ - self.kind_box_position.get(book_info.kind, self.box_position) - # Set bar color. - if book_info.cover_bar_color == 'none': - self.bar_width = 0 - else: - self.bar_color = book_info.cover_bar_color or \ - self.epoch_colors.get(book_info.epoch, self.bar_color) - # Set title color. - self.title_color = self.epoch_colors.get(book_info.epoch, self.title_color) - - self.bleed = bleed - self.box_top_margin += bleed - self.box_bottom_margin += bleed - self.bar_width += bleed - - if book_info.cover_url: - url = book_info.cover_url - bg_src = None - if bg_src is None: - bg_src = URLOpener().open(url) - self.background_img = BytesIO(bg_src.read()) - bg_src.close() - - def pretty_authors(self): - return [a.upper() for a in self.authors] - - def add_box(self, img): - if self.box_position == 'none': - return img - - metr = Metric(self, self.scale) - - # Write author name. - box = TextBox(metr.title_box_width, metr.height, padding_y=metr.box_padding_y) - author_font = ImageFont.truetype( - self.author_font_ttf, metr.author_font_size) - for pa in self.pretty_authors(): - box.text(pa, - font=author_font, - line_height=metr.author_lineskip, - color=self.author_color, - shadow_color=self.author_shadow) - - box.skip(metr.box_above_line) - box.draw.line((metr.box_line_left, box.height, metr.box_line_right, box.height), - fill=self.author_color, width=metr.box_line_width) - box.skip(metr.box_below_line) - - # Write title. - title_font = ImageFont.truetype( - self.title_font_ttf, metr.title_font_size) - box.text(self.pretty_title(), - line_height=metr.title_lineskip, - font=title_font, - color=self.title_color, - shadow_color=self.title_shadow) - - box_img = box.image() - - # Find box position. - if self.box_position == 'top': - box_top = metr.box_top_margin - elif self.box_position == 'bottom': - box_top = metr.height - metr.box_bottom_margin - box_img.size[1] - else: # Middle. - box_top = (metr.height - box_img.size[1]) // 2 - - box_left = metr.bar_width + (metr.width - metr.bar_width - box_img.size[0]) // 2 - - # Draw the white box. - ImageDraw.Draw(img).rectangle( - (box_left, box_top, box_left + box_img.size[0], box_top + box_img.size[1]), fill='#fff') - # Paste the contents into the white box. - img.paste(box_img, (box_left, box_top), box_img) - return img - - def add_cut_lines(self, img): - line_ratio = 0.5 - if self.bleed == 0: - return img - metr = Metric(self, self.scale) - draw = ImageDraw.Draw(img) - for corner_x, corner_y in ((0, 0), (metr.width, 0), (0, metr.height), (metr.width, metr.height)): - dir_x = 1 if corner_x == 0 else -1 - dir_y = 1 if corner_y == 0 else -1 - for offset in (-1, 0, 1): - draw.line((corner_x, corner_y + dir_y * metr.bleed + offset, - corner_x + dir_x * metr.bleed * line_ratio, corner_y + dir_y * metr.bleed + offset), - fill='black' if offset == 0 else 'white', width=1) - draw.line((corner_x + dir_x * metr.bleed + offset, corner_y, - corner_x + dir_x * metr.bleed + offset, corner_y + dir_y * metr.bleed * line_ratio), - fill='black' if offset == 0 else 'white', width=1) - return img - - def image(self): - metr = Metric(self, self.scale) - img = Image.new('RGB', (metr.width, metr.height), self.background_color) - draw = ImageDraw.Draw(img) - - draw.rectangle((0, 0, metr.bar_width, metr.height), fill=self.bar_color) - - if self.background_img: - src = Image.open(self.background_img) - trg_size = (metr.width - metr.bar_width, metr.height) - if src.size[0] * trg_size[1] < src.size[1] * trg_size[0]: - resized = ( - trg_size[0], - int(round(src.size[1] * trg_size[0] / src.size[0])) - ) - cut = (resized[1] - trg_size[1]) // 2 - src = src.resize(resized, Image.ANTIALIAS) - src = src.crop((0, cut, src.size[0], src.size[1] - cut)) - else: - resized = ( - int(round(src.size[0] * trg_size[1] / src.size[1])), - trg_size[1], - ) - cut = (resized[0] - trg_size[0]) // 2 - src = src.resize(resized, Image.ANTIALIAS) - src = src.crop((cut, 0, src.size[0] - cut, src.size[1])) - - img.paste(src, (metr.bar_width, 0)) - del src - - img = self.add_box(img) - - # img = self.add_cut_lines(img) - - return img - - -class WLNoBoxCover(WLCover): - def add_box(self, img): - return img - - -class LogoWLCover(WLCover): - gradient_height = 90 - gradient_logo_height = 60 - gradient_logo_margin_right = 30 - gradient_logo_spacing = 40 - gradient_color = '#000' - gradient_opacity = .6 - gradient_logos = [ - 'res/wl-logo-white.png', - 'res/fnp-logo-white.png', - ] - - def __init__(self, book_info, *args, **kwargs): - super(LogoWLCover, self).__init__(book_info, *args, **kwargs) - self.gradient_height += self.bleed - self.gradient_logo_margin_right += self.bleed - - self.additional_cover_logos = [ - BytesIO(URLOpener().open(cover_logo_url).read()) - for cover_logo_url in book_info.cover_logo_urls - ] - - def image(self): - img = super(LogoWLCover, self).image() - metr = Metric(self, self.scale) - gradient = Image.new('RGBA', (metr.width - metr.bar_width, metr.gradient_height), self.gradient_color) - gradient_mask = Image.new('L', (metr.width - metr.bar_width, metr.gradient_height)) - draw = ImageDraw.Draw(gradient_mask) - for line in range(0, metr.gradient_height): - draw.line( - (0, line, metr.width - metr.bar_width, line), - fill=int(255 * self.gradient_opacity * line / metr.gradient_height)) - img.paste(gradient, (metr.bar_width, metr.height - metr.gradient_height), mask=gradient_mask) - - cursor = metr.width - metr.gradient_logo_margin_right - logo_top = int(metr.height - metr.gradient_height / 2 - metr.gradient_logo_height / 2 - metr.bleed / 2) - - logos = [get_resource(logo_path) for logo_path in self.gradient_logos[::-1]] - logos = logos + self.additional_cover_logos - logos = [Image.open(logo_bytes).convert('RGBA') for logo_bytes in logos] - - # See if logos fit into the gradient. If not, scale down accordingly. - space_for_logos = metr.width - metr.bar_width - 2 * metr.gradient_logo_margin_right - widths = [logo.size[0] * metr.gradient_logo_height / logo.size[1] for logo in logos] - taken_space = sum(widths) + (len(logos) - 1) * (metr.gradient_logo_spacing) - logo_scale = space_for_logos / taken_space if taken_space > space_for_logos else 1 - logo_top += int(metr.gradient_logo_height * (1 - logo_scale) / 2) - - for i, logo in enumerate(logos): - logo = logo.resize( - ( - int(round(widths[i] * logo_scale)), - int(round(metr.gradient_logo_height * logo_scale)) - ), - Image.ANTIALIAS) - cursor -= logo.size[0] - img.paste(logo, (cursor, logo_top), mask=logo) - cursor -= int(round(metr.gradient_logo_spacing * logo_scale)) - - return img - - -class EbookpointCover(LogoWLCover): - gradient_logo_height = 58 - gradient_logo_spacing = 25 - gradient_logos = [ - 'res/ebookpoint-logo-white.png', - 'res/wl-logo-white.png', - 'res/fnp-logo-white.png', - ] - - -class VirtualoCover(Cover): - width = 600 - height = 730 - author_top = 73 - title_top = 73 - logo_bottom = 25 - logo_width = 250 - - -class PrestigioCover(Cover): - width = 580 - height = 783 - background_img = get_resource('res/cover-prestigio.png') - - author_top = 446 - author_margin_left = 118 - author_margin_right = 62 - author_lineskip = 60 - author_color = '#fff' - author_shadow = '#000' - author_font_ttf = get_resource('fonts/JunicodeWL-Italic.ttf') - author_font_size = 50 - - title_top = 0 - title_margin_left = 118 - title_margin_right = 62 - title_lineskip = 60 - title_color = '#fff' - title_shadow = '#000' - title_font_ttf = get_resource('fonts/JunicodeWL-Italic.ttf') - title_font_size = 50 - - def pretty_title(self): - return u"„%s”" % self.title - - -class BookotekaCover(Cover): - width = 2140 - height = 2733 - background_img = get_resource('res/cover-bookoteka.png') - - author_top = 480 - author_margin_left = 307 - author_margin_right = 233 - author_lineskip = 156 - author_color = '#d9d919' - author_font_ttf = get_resource('fonts/JunicodeWL-Regular.ttf') - author_font_size = 130 - - title_top = 400 - title_margin_left = 307 - title_margin_right = 233 - title_lineskip = 168 - title_color = '#d9d919' - title_font_ttf = get_resource('fonts/JunicodeWL-Regular.ttf') - title_font_size = 140 - - format = 'PNG' - - -class GandalfCover(Cover): - width = 600 - height = 730 - background_img = get_resource('res/cover-gandalf.png') - author_font_ttf = get_resource('fonts/JunicodeWL-Regular.ttf') - author_font_size = 30 - title_font_ttf = get_resource('fonts/JunicodeWL-Regular.ttf') - title_font_size = 40 - logo_bottom = 25 - logo_width = 250 - format = 'PNG' - - -class KMLUCover(LogoWLCover): - gradient_logo_height = 58 - gradient_logo_spacing = 25 - gradient_logos = [ - 'res/kmlu-logo-white.png', - 'res/wl-logo-white.png', - 'res/fnp-logo-white.png', - ] - - -class MPWCover(LogoWLCover): - gradient_logo_height = 58 - gradient_logo_spacing = 25 - gradient_logos = [ - 'res/mpw-logo-white.png', - 'res/wl-logo-white.png', - 'res/fnp-logo-white.png', - ] - - -class AtriumCover(LogoWLCover): - gradient_logo_height = 58 - gradient_logo_spacing = 25 - gradient_logos = [ - 'res/atrium-logo.png', - 'res/wl-logo-white.png', - 'res/fnp-logo-white.png', - ] - - -COVER_CLASSES = { - 'default': LogoWLCover, - 'kmlu': KMLUCover, - 'mpw': MPWCover, - 'atrium': AtriumCover, -} - - -def make_cover(book_info, *args, **kwargs): - if 'cover_class' in kwargs: - cover_class_name = kwargs.pop('cover_class') - else: - cover_class_name = book_info.cover_class - cover_class = COVER_CLASSES[cover_class_name] - return cover_class(book_info, *args, **kwargs) diff --git a/librarian/dcparser.py b/librarian/dcparser.py deleted file mode 100644 index 92afc01..0000000 --- a/librarian/dcparser.py +++ /dev/null @@ -1,482 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import unicode_literals - -from xml.parsers.expat import ExpatError -from datetime import date -from functools import total_ordering -import time -import re -import six -from librarian.util import roman_to_int - -from librarian import (ValidationError, NoDublinCore, ParseError, DCNS, RDFNS, - XMLNS, WLURI, WLNS, PLMETNS) - -import lxml.etree as etree # ElementTree API using libxml2 -from lxml.etree import XMLSyntaxError - - -class TextPlus(six.text_type): - pass - - -class DatePlus(date): - pass - - -# ============== -# = Converters = -# ============== -@six.python_2_unicode_compatible -@total_ordering -class Person(object): - """Single person with last name and a list of first names.""" - def __init__(self, last_name, *first_names): - self.last_name = last_name - self.first_names = first_names - - @classmethod - def from_text(cls, text): - parts = [token.strip() for token in text.split(',')] - if len(parts) == 1: - surname = parts[0] - names = [] - elif len(parts) != 2: - raise ValueError("Invalid person name. There should be at most one comma: \"%s\"." % text.encode('utf-8')) - else: - surname = parts[0] - if len(parts[1]) == 0: - # there is no non-whitespace data after the comma - raise ValueError("Found a comma, but no names given: \"%s\" -> %r." % (text, parts)) - names = parts[1].split() - return cls(surname, *names) - - def readable(self): - return u" ".join(self.first_names + (self.last_name,)) - - def __eq__(self, right): - return self.last_name == right.last_name and self.first_names == right.first_names - - def __lt__(self, other): - return (self.last_name, self.first_names) < (other.last_name, other.first_names) - - def __hash__(self): - return hash((self.last_name, self.first_names)) - - def __str__(self): - if len(self.first_names) > 0: - return '%s, %s' % (self.last_name, ' '.join(self.first_names)) - else: - return self.last_name - - def __repr__(self): - return 'Person(last_name=%r, first_names=*%r)' % (self.last_name, self.first_names) - - -def as_date(text): - """Dates for digitization of pictures. It seems we need the following: -ranges: '1350-1450', -centuries: "XVIII w.' -half centuries/decades: '2 poł. XVIII w.', 'XVII w., l. 20' -later-then: 'po 1450' -circa 'ok. 1813-1814', 'ok.1876-ok.1886 -turn: 1893/1894 -for now we will translate this to some single date losing information of course. - """ - try: - # check out the "N. poł X w." syntax - if isinstance(text, six.binary_type): - text = text.decode("utf-8") - - century_format = u"(?:([12]) *poł[.]? +)?([MCDXVI]+) *w[.,]*(?: *l[.]? *([0-9]+))?" - vague_format = u"(?:po *|ok. *)?([0-9]{4})(-[0-9]{2}-[0-9]{2})?" - - m = re.match(century_format, text) - m2 = re.match(vague_format, text) - if m: - half = m.group(1) - decade = m.group(3) - century = roman_to_int(m.group(2)) - if half is not None: - if decade is not None: - raise ValueError("Bad date format. Cannot specify both half and decade of century") - half = int(half) - t = ((century*100 + (half-1)*50), 1, 1) - else: - decade = int(decade or 0) - t = ((century*100 + decade), 1, 1) - elif m2: - year = m2.group(1) - mon_day = m2.group(2) - if mon_day: - t = time.strptime(year + mon_day, "%Y-%m-%d") - else: - t = time.strptime(year, '%Y') - else: - raise ValueError - - return DatePlus(t[0], t[1], t[2]) - except ValueError as e: - raise ValueError("Unrecognized date format. Try YYYY-MM-DD or YYYY.") - - -def as_person(text): - return Person.from_text(text) - - -def as_unicode(text): - if isinstance(text, six.text_type): - return text - else: - return TextPlus(text.decode('utf-8')) - - -def as_wluri_strict(text): - return WLURI.strict(text) - - -class Field(object): - def __init__(self, uri, attr_name, validator=as_unicode, strict=None, multiple=False, salias=None, **kwargs): - self.uri = uri - self.name = attr_name - self.validator = validator - self.strict = strict - self.multiple = multiple - self.salias = salias - - self.required = kwargs.get('required', True) and 'default' not in kwargs - self.default = kwargs.get('default', [] if multiple else [None]) - - def validate_value(self, val, strict=False): - if strict and self.strict is not None: - validator = self.strict - else: - validator = self.validator - try: - if self.multiple: - if validator is None: - return val - new_values = [] - for v in val: - nv = v - if v is not None: - nv = validator(v) - if hasattr(v, 'lang'): - setattr(nv, 'lang', v.lang) - new_values.append(nv) - return new_values - elif len(val) > 1: - raise ValidationError("Multiple values not allowed for field '%s'" % self.uri) - elif len(val) == 0: - raise ValidationError("Field %s has no value to assign. Check your defaults." % self.uri) - else: - if validator is None or val[0] is None: - return val[0] - nv = validator(val[0]) - if hasattr(val[0], 'lang'): - setattr(nv, 'lang', val[0].lang) - return nv - except ValueError as e: - raise ValidationError("Field '%s' - invald value: %s" % (self.uri, e.message)) - - def validate(self, fdict, fallbacks=None, strict=False): - if fallbacks is None: - fallbacks = {} - if self.uri not in fdict: - if not self.required: - # Accept single value for single fields and saliases. - if self.name in fallbacks: - if self.multiple: - f = fallbacks[self.name] - else: - f = [fallbacks[self.name]] - elif self.salias and self.salias in fallbacks: - f = [fallbacks[self.salias]] - else: - f = self.default - else: - raise ValidationError("Required field %s not found" % self.uri) - else: - f = fdict[self.uri] - - return self.validate_value(f, strict=strict) - - def __eq__(self, other): - if isinstance(other, Field) and other.name == self.name: - return True - return False - - -class DCInfo(type): - def __new__(mcs, classname, bases, class_dict): - fields = list(class_dict['FIELDS']) - - for base in bases[::-1]: - if hasattr(base, 'FIELDS'): - for field in base.FIELDS[::-1]: - try: - fields.index(field) - except ValueError: - fields.insert(0, field) - - class_dict['FIELDS'] = tuple(fields) - return super(DCInfo, mcs).__new__(mcs, classname, bases, class_dict) - - -class WorkInfo(six.with_metaclass(DCInfo, object)): - FIELDS = ( - Field(DCNS('creator'), 'authors', as_person, salias='author', multiple=True), - Field(DCNS('title'), 'title'), - Field(DCNS('type'), 'type', required=False, multiple=True), - - Field(DCNS('contributor.editor'), 'editors', - as_person, salias='editor', multiple=True, required=False), - Field(DCNS('contributor.technical_editor'), 'technical_editors', - as_person, salias='technical_editor', multiple=True, required=False), - Field(DCNS('contributor.funding'), 'funders', salias='funder', multiple=True, required=False), - Field(DCNS('contributor.thanks'), 'thanks', required=False), - - Field(DCNS('date'), 'created_at'), - Field(DCNS('date.pd'), 'released_to_public_domain_at', as_date, required=False), - Field(DCNS('publisher'), 'publisher', multiple=True), - - Field(DCNS('language'), 'language'), - Field(DCNS('description'), 'description', required=False), - - Field(DCNS('source'), 'source_name', required=False), - Field(DCNS('source.URL'), 'source_urls', salias='source_url', multiple=True, required=False), - Field(DCNS('identifier.url'), 'url', WLURI, strict=as_wluri_strict), - Field(DCNS('rights.license'), 'license', required=False), - Field(DCNS('rights'), 'license_description'), - - Field(PLMETNS('digitisationSponsor'), 'sponsors', multiple=True, required=False), - Field(WLNS('digitisationSponsorNote'), 'sponsor_note', required=False), - Field(WLNS('developmentStage'), 'stage', required=False), - ) - - @classmethod - def from_bytes(cls, xml, *args, **kwargs): - return cls.from_file(six.BytesIO(xml), *args, **kwargs) - - @classmethod - def from_file(cls, xmlfile, *args, **kwargs): - desc_tag = None - try: - iter = etree.iterparse(xmlfile, ['start', 'end']) - for (event, element) in iter: - if element.tag == RDFNS('RDF') and event == 'start': - desc_tag = element - break - - if desc_tag is None: - raise NoDublinCore("DublinCore section not found. \ - Check if there are rdf:RDF and rdf:Description tags.") - - # continue 'till the end of RDF section - for (event, element) in iter: - if element.tag == RDFNS('RDF') and event == 'end': - break - - # if there is no end, Expat should yell at us with an ExpatError - - # extract data from the element and make the info - return cls.from_element(desc_tag, *args, **kwargs) - except XMLSyntaxError as e: - raise ParseError(e) - except ExpatError as e: - raise ParseError(e) - - @classmethod - def from_element(cls, rdf_tag, *args, **kwargs): - # the tree is already parsed, so we don't need to worry about Expat errors - field_dict = {} - desc = rdf_tag.find(".//" + RDFNS('Description')) - - if desc is None: - raise NoDublinCore("There must be a '%s' element inside the RDF." % RDFNS('Description')) - - lang = None - p = desc - while p is not None and lang is None: - lang = p.attrib.get(XMLNS('lang')) - p = p.getparent() - - for e in desc.getchildren(): - fv = field_dict.get(e.tag, []) - if e.text is not None: - text = e.text - if not isinstance(text, six.text_type): - text = text.decode('utf-8') - val = TextPlus(text) - val.lang = e.attrib.get(XMLNS('lang'), lang) - if e.tag == 'meta': - meta_id = e.attrib.get('id') - if meta_id and meta_id.endswith('-id'): - field_dict[meta_id] = [val.replace('ISBN-', 'ISBN ')] - else: - val = e.text - fv.append(val) - field_dict[e.tag] = fv - - return cls(desc.attrib, field_dict, *args, **kwargs) - - def __init__(self, rdf_attrs, dc_fields, fallbacks=None, strict=False): - """rdf_attrs should be a dictionary-like object with any attributes of the RDF:Description. - dc_fields - dictionary mapping DC fields (with namespace) to list of text values for the - given field. """ - - self.about = rdf_attrs.get(RDFNS('about')) - self.fmap = {} - - for field in self.FIELDS: - value = field.validate(dc_fields, fallbacks=fallbacks, strict=strict) - setattr(self, 'prop_' + field.name, value) - self.fmap[field.name] = field - if field.salias: - self.fmap[field.salias] = field - - def __getattribute__(self, name): - try: - field = object.__getattribute__(self, 'fmap')[name] - value = object.__getattribute__(self, 'prop_'+field.name) - if field.name == name: - return value - else: # singular alias - if not field.multiple: - raise "OUCH!! for field %s" % name - - return value[0] if value else None - except (KeyError, AttributeError): - return object.__getattribute__(self, name) - - def __setattr__(self, name, newvalue): - try: - field = object.__getattribute__(self, 'fmap')[name] - if field.name == name: - object.__setattr__(self, 'prop_'+field.name, newvalue) - else: # singular alias - if not field.multiple: - raise "OUCH! while setting field %s" % name - - object.__setattr__(self, 'prop_'+field.name, [newvalue]) - except (KeyError, AttributeError): - return object.__setattr__(self, name, newvalue) - - def update(self, field_dict): - """Update using field_dict. Verify correctness, but don't check if all - required fields are present.""" - for field in self.FIELDS: - if field.name in field_dict: - setattr(self, field.name, field_dict[field.name]) - - def to_etree(self, parent=None): - """XML representation of this object.""" - # etree._namespace_map[str(self.RDF)] = 'rdf' - # etree._namespace_map[str(self.DC)] = 'dc' - - if parent is None: - root = etree.Element(RDFNS('RDF')) - else: - root = parent.makeelement(RDFNS('RDF')) - - description = etree.SubElement(root, RDFNS('Description')) - - if self.about: - description.set(RDFNS('about'), self.about) - - for field in self.FIELDS: - v = getattr(self, field.name, None) - if v is not None: - if field.multiple: - if len(v) == 0: - continue - for x in v: - e = etree.Element(field.uri) - if x is not None: - e.text = six.text_type(x) - description.append(e) - else: - e = etree.Element(field.uri) - e.text = six.text_type(v) - description.append(e) - - return root - - def serialize(self): - rdf = {'about': {'uri': RDFNS('about'), 'value': self.about}} - - dc = {} - for field in self.FIELDS: - v = getattr(self, field.name, None) - if v is not None: - if field.multiple: - if len(v) == 0: - continue - v = [six.text_type(x) for x in v if x is not None] - else: - v = six.text_type(v) - - dc[field.name] = {'uri': field.uri, 'value': v} - rdf['fields'] = dc - return rdf - - def to_dict(self): - result = {'about': self.about} - for field in self.FIELDS: - v = getattr(self, field.name, None) - - if v is not None: - if field.multiple: - if len(v) == 0: - continue - v = [six.text_type(x) for x in v if x is not None] - else: - v = six.text_type(v) - result[field.name] = v - - if field.salias: - v = getattr(self, field.salias) - if v is not None: - result[field.salias] = six.text_type(v) - - return result - - -class BookInfo(WorkInfo): - FIELDS = ( - Field(DCNS('audience'), 'audiences', salias='audience', multiple=True, required=False), - - Field(DCNS('subject.period'), 'epochs', salias='epoch', multiple=True, required=False), - Field(DCNS('subject.type'), 'kinds', salias='kind', multiple=True, required=False), - Field(DCNS('subject.genre'), 'genres', salias='genre', multiple=True, required=False), - - Field(DCNS('subject.location'), 'location', required=False), - - Field(DCNS('contributor.translator'), 'translators', - as_person, salias='translator', multiple=True, required=False), - Field(DCNS('relation.hasPart'), 'parts', WLURI, strict=as_wluri_strict, multiple=True, required=False), - Field(DCNS('relation.isVariantOf'), 'variant_of', WLURI, strict=as_wluri_strict, required=False), - - Field(DCNS('relation.coverImage.url'), 'cover_url', required=False), - Field(DCNS('relation.coverImage.attribution'), 'cover_by', required=False), - Field(DCNS('relation.coverImage.source'), 'cover_source', required=False), - # WLCover-specific. - Field(WLNS('coverBarColor'), 'cover_bar_color', required=False), - Field(WLNS('coverBoxPosition'), 'cover_box_position', required=False), - Field(WLNS('coverClass'), 'cover_class', default=['default']), - Field(WLNS('coverLogoUrl'), 'cover_logo_urls', multiple=True, required=False), - - Field('pdf-id', 'isbn_pdf', required=False), - Field('epub-id', 'isbn_epub', required=False), - Field('mobi-id', 'isbn_mobi', required=False), - Field('txt-id', 'isbn_txt', required=False), - Field('html-id', 'isbn_html', required=False), - ) - - -def parse(file_name, cls=BookInfo): - return cls.from_file(file_name) diff --git a/librarian/embeds/__init__.py b/librarian/embeds/__init__.py deleted file mode 100644 index fa74530..0000000 --- a/librarian/embeds/__init__.py +++ /dev/null @@ -1,58 +0,0 @@ -from __future__ import unicode_literals - -import importlib -from lxml import etree - -known_types = { - 'application/mathml+xml': 'librarian.embeds.mathml.MathML', - 'application/x-latex': 'librarian.embeds.latex.LaTeX', -} - -class Embed(): - @classmethod - def transforms_to(cls, mime_types, downgrade=False): - matches = set() - for name, method in cls.__dict__.iteritems(): - if hasattr(method, "embed_converts_to"): - conv_type, conv_downgrade = method.embed_converts_to - if downgrade == conv_downgrade and conv_type in mime_types: - matches.add(conv_type) - return matches - - def transform_to(self, mime_type, downgrade=False): - for name, method in type(cls).__dict__.iteritems(): - if hasattr(method, "embed_converts_to"): - conv_type, conv_downgrade = method.embed_converts_to - if downgrade == conv_downgrade and conv_type == mime_type: - return method(self) - - -class DataEmbed(Embed): - def __init__(self, data=None): - self.data = data - -class TreeEmbed(Embed): - def __init__(self, tree=None): - if isinstance(tree, etree._Element): - tree = etree.ElementTree(tree) - self.tree = tree - -def converts_to(mime_type, downgrade=False): - def decorator(method): - method.embed_converts_to = mime_type, downgrade - return method - return decorator - -def downgrades_to(mime_type): - return converts_to(mime_type, True) - -def create_embed(mime_type, tree=None, data=None): - embed = known_types.get(mime_type) - if embed is None: - embed = DataEmbed if tree is None else TreeEmbed - else: - mod_name, cls_name = embed.rsplit('.', 1) - mod = importlib.import_module(mod_name) - embed = getattr(mod, cls_name) - - return embed(data if tree is None else tree) diff --git a/librarian/embeds/latex.py b/librarian/embeds/latex.py deleted file mode 100644 index 8425d03..0000000 --- a/librarian/embeds/latex.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import os -import shutil -from subprocess import call, PIPE -from tempfile import mkdtemp -from librarian import get_resource -from . import DataEmbed, create_embed, downgrades_to - - -class LaTeX(DataEmbed): - @downgrades_to('image/png') - def to_png(self): - tmpl = open(get_resource('res/embeds/latex/template.tex'), 'rb').read().decode('utf-8') - tempdir = mkdtemp('-librarian-embed-latex') - fpath = os.path.join(tempdir, 'doc.tex') - with open(fpath, 'wb') as f: - f.write((tmpl % {'code': self.data}).encode('utf-8')) - call(['xelatex', '-interaction=batchmode', '-output-directory', tempdir, fpath], stdout=PIPE, stderr=PIPE) - call(['convert', '-density', '150', os.path.join(tempdir, 'doc.pdf'), '-trim', - os.path.join(tempdir, 'doc.png')]) - pngdata = open(os.path.join(tempdir, 'doc.png'), 'rb').read() - shutil.rmtree(tempdir) - return create_embed('image/png', data=pngdata) diff --git a/librarian/embeds/mathml.py b/librarian/embeds/mathml.py deleted file mode 100644 index 564a9f4..0000000 --- a/librarian/embeds/mathml.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from lxml import etree -import six -from librarian import get_resource -from . import TreeEmbed, create_embed, downgrades_to - - -class MathML(TreeEmbed): - @downgrades_to('application/x-latex') - def to_latex(self): - """ - >>> print(MathML(etree.fromstring('a < b')).to_latex().data.strip()) - a < b - - >>> print(MathML(etree.fromstring('< & &lt; A')).to_latex().data.strip()) - < & < A - - """ - xslt = etree.parse(get_resource('res/embeds/mathml/mathml2latex.xslt')) - output = self.tree.xslt(xslt) - text = six.text_type(output) - # Workaround for entities being preserved in output. But there should be a better way. - text = text.replace('<', '<').replace('&', '&') - return create_embed('application/x-latex', data=text) diff --git a/librarian/epub.py b/librarian/epub.py deleted file mode 100644 index be9488a..0000000 --- a/librarian/epub.py +++ /dev/null @@ -1,718 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import print_function, unicode_literals - -import os -import os.path -import re -import subprocess -from six import BytesIO -from copy import deepcopy -from mimetypes import guess_type - -from lxml import etree -import zipfile -from tempfile import mkdtemp, NamedTemporaryFile -from shutil import rmtree - -from librarian import RDFNS, WLNS, NCXNS, OPFNS, XHTMLNS, DCNS, OutputFile -from librarian.cover import make_cover - -from librarian import functions, get_resource - -from librarian.hyphenator import Hyphenator - -functions.reg_person_name() -functions.reg_lang_code_3to2() - - -def squeeze_whitespace(s): - return re.sub(b'\\s+', b' ', s) - - -def set_hyph_language(source_tree): - def get_short_lng_code(text): - result = '' - text = ''.join(text) - with open(get_resource('res/ISO-639-2_8859-1.txt'), 'rb') as f: - for line in f.read().decode('latin1').split('\n'): - list = line.strip().split('|') - if list[0] == text: - result = list[2] - if result == '': - return text - else: - return result - bibl_lng = etree.XPath('//dc:language//text()', - namespaces={'dc': str(DCNS)})(source_tree) - short_lng = get_short_lng_code(bibl_lng[0]) - try: - return Hyphenator(get_resource('res/hyph-dictionaries/hyph_' + - short_lng + '.dic')) - except: - pass - - -def hyphenate_and_fix_conjunctions(source_tree, hyph): - texts = etree.XPath('/utwor/*[2]//text()')(source_tree) - for t in texts: - parent = t.getparent() - if hyph is not None: - newt = '' - wlist = re.compile(r'\w+|[^\w]', re.UNICODE).findall(t) - for w in wlist: - newt += hyph.inserted(w, u'\u00AD') - else: - newt = t - newt = re.sub(r'(?<=\s\w)\s+', u'\u00A0', newt) - if t.is_text: - parent.text = newt - elif t.is_tail: - parent.tail = newt - - -def inner_xml(node): - """ returns node's text and children as a string - - >>> print(inner_xml(etree.fromstring('xyz'))) - xyz - """ - - nt = node.text if node.text is not None else '' - return ''.join([nt] + [etree.tostring(child, encoding='unicode') for child in node]) - - -def set_inner_xml(node, text): - """ sets node's text and children from a string - - >>> e = etree.fromstring('bxx') - >>> set_inner_xml(e, 'xyz') - >>> print(etree.tostring(e, encoding='unicode')) - xyz - """ - - p = etree.fromstring('%s' % text) - node.text = p.text - node[:] = p[:] - - -def node_name(node): - """ Find out a node's name - - >>> print(node_name(etree.fromstring('XYZ'))) - XYZ - """ - - tempnode = deepcopy(node) - - for p in ('pe', 'pa', 'pt', 'pr', 'motyw'): - for e in tempnode.findall('.//%s' % p): - t = e.tail - e.clear() - e.tail = t - etree.strip_tags(tempnode, '*') - return tempnode.text - - -def xslt(xml, sheet, **kwargs): - if isinstance(xml, etree._Element): - xml = etree.ElementTree(xml) - with open(sheet) as xsltf: - transform = etree.XSLT(etree.parse(xsltf)) - params = dict((key, transform.strparam(value)) for key, value in kwargs.items()) - return transform(xml, **params) - - -def replace_characters(node): - def replace_chars(text): - if text is None: - return None - return text.replace(u"\ufeff", u"")\ - .replace("---", u"\u2014")\ - .replace("--", u"\u2013")\ - .replace(",,", u"\u201E")\ - .replace('"', u"\u201D")\ - .replace("'", u"\u2019") - if node.tag in ('uwaga', 'extra'): - t = node.tail - node.clear() - node.tail = t - node.text = replace_chars(node.text) - node.tail = replace_chars(node.tail) - for child in node: - replace_characters(child) - - -def find_annotations(annotations, source, part_no): - for child in source: - if child.tag in ('pe', 'pa', 'pt', 'pr'): - annotation = deepcopy(child) - number = str(len(annotations) + 1) - annotation.set('number', number) - annotation.set('part', str(part_no)) - annotation.tail = '' - annotations.append(annotation) - tail = child.tail - child.clear() - child.tail = tail - child.text = number - if child.tag not in ('extra', 'uwaga'): - find_annotations(annotations, child, part_no) - - -class Stanza(object): - """ - Converts / verse endings into verse elements in a stanza. - - Slashes may only occur directly in the stanza. Any slashes in subelements - will be ignored, and the subelements will be put inside verse elements. - - >>> s = etree.fromstring("a c c/\\nbx/\\nyc/ \\nd") - >>> Stanza(s).versify() - >>> print(etree.tostring(s, encoding='unicode')) - a ccbx/ - ycd - - """ - def __init__(self, stanza_elem): - self.stanza = stanza_elem - self.verses = [] - self.open_verse = None - - def versify(self): - self.push_text(self.stanza.text) - for elem in self.stanza: - self.push_elem(elem) - self.push_text(elem.tail) - tail = self.stanza.tail - self.stanza.clear() - self.stanza.tail = tail - self.stanza.extend(verse for verse in self.verses if verse.text or len(verse) > 0) - - def open_normal_verse(self): - self.open_verse = self.stanza.makeelement("wers_normalny") - self.verses.append(self.open_verse) - - def get_open_verse(self): - if self.open_verse is None: - self.open_normal_verse() - return self.open_verse - - def push_text(self, text): - if not text: - return - for i, verse_text in enumerate(re.split(r"/\s*\n", text)): - if i: - self.open_normal_verse() - if not verse_text.strip(): - continue - verse = self.get_open_verse() - if len(verse): - verse[-1].tail = (verse[-1].tail or "") + verse_text - else: - verse.text = (verse.text or "") + verse_text - - def push_elem(self, elem): - if elem.tag.startswith("wers"): - verse = deepcopy(elem) - verse.tail = None - self.verses.append(verse) - self.open_verse = verse - else: - appended = deepcopy(elem) - appended.tail = None - self.get_open_verse().append(appended) - - -def replace_by_verse(tree): - """ Find stanzas and create new verses in place of a '/' character """ - - stanzas = tree.findall('.//' + WLNS('strofa')) - for stanza in stanzas: - Stanza(stanza).versify() - - -def add_to_manifest(manifest, partno): - """ Adds a node to the manifest section in content.opf file """ - - partstr = 'part%d' % partno - e = manifest.makeelement( - OPFNS('item'), attrib={'id': partstr, 'href': partstr + '.html', - 'media-type': 'application/xhtml+xml'} - ) - manifest.append(e) - - -def add_to_spine(spine, partno): - """ Adds a node to the spine section in content.opf file """ - - e = spine.makeelement(OPFNS('itemref'), attrib={'idref': 'part%d' % partno}) - spine.append(e) - - -class TOC(object): - def __init__(self, name=None, part_href=None): - self.children = [] - self.name = name - self.part_href = part_href - self.sub_number = None - - def add(self, name, part_href, level=0, is_part=True, index=None): - assert level == 0 or index is None - if level > 0 and self.children: - return self.children[-1].add(name, part_href, level - 1, is_part) - else: - t = TOC(name) - t.part_href = part_href - if index is not None: - self.children.insert(index, t) - else: - self.children.append(t) - if not is_part: - t.sub_number = len(self.children) + 1 - return t.sub_number - - def append(self, toc): - self.children.append(toc) - - def extend(self, toc): - self.children.extend(toc.children) - - def depth(self): - if self.children: - return max((c.depth() for c in self.children)) + 1 - else: - return 0 - - def href(self): - src = self.part_href - if self.sub_number is not None: - src += '#sub%d' % self.sub_number - return src - - def write_to_xml(self, nav_map, counter=1): - for child in self.children: - nav_point = nav_map.makeelement(NCXNS('navPoint')) - nav_point.set('id', 'NavPoint-%d' % counter) - nav_point.set('playOrder', str(counter)) - - nav_label = nav_map.makeelement(NCXNS('navLabel')) - text = nav_map.makeelement(NCXNS('text')) - if child.name is not None: - text.text = re.sub(r'\n', ' ', child.name) - else: - text.text = child.name - nav_label.append(text) - nav_point.append(nav_label) - - content = nav_map.makeelement(NCXNS('content')) - content.set('src', child.href()) - nav_point.append(content) - nav_map.append(nav_point) - counter = child.write_to_xml(nav_point, counter + 1) - return counter - - def html_part(self, depth=0): - texts = [] - for child in self.children: - texts.append( - "
%s
" % - (depth, child.href(), child.name)) - texts.append(child.html_part(depth + 1)) - return "\n".join(texts) - - def html(self): - with open(get_resource('epub/toc.html'), 'rb') as f: - t = f.read().decode('utf-8') - return t % self.html_part() - - -def used_chars(element): - """ Lists characters used in an ETree Element """ - chars = set((element.text or '') + (element.tail or '')) - for child in element: - chars = chars.union(used_chars(child)) - return chars - - -def chop(main_text): - """ divide main content of the XML file into chunks """ - - # prepare a container for each chunk - part_xml = etree.Element('utwor') - etree.SubElement(part_xml, 'master') - main_xml_part = part_xml[0] # master - - last_node_part = False - - # the below loop are workaround for a problem with epubs in drama ebooks without acts - is_scene = False - is_act = False - for one_part in main_text: - name = one_part.tag - if name == 'naglowek_scena': - is_scene = True - elif name == 'naglowek_akt': - is_act = True - - for one_part in main_text: - name = one_part.tag - if is_act is False and is_scene is True: - if name == 'naglowek_czesc': - yield part_xml - last_node_part = True - main_xml_part[:] = [deepcopy(one_part)] - elif not last_node_part and name == "naglowek_scena": - yield part_xml - main_xml_part[:] = [deepcopy(one_part)] - else: - main_xml_part.append(deepcopy(one_part)) - last_node_part = False - else: - if name == 'naglowek_czesc': - yield part_xml - last_node_part = True - main_xml_part[:] = [deepcopy(one_part)] - elif not last_node_part and name in ("naglowek_rozdzial", "naglowek_akt", "srodtytul"): - yield part_xml - main_xml_part[:] = [deepcopy(one_part)] - else: - main_xml_part.append(deepcopy(one_part)) - last_node_part = False - yield part_xml - - -def transform_chunk(chunk_xml, chunk_no, annotations, empty=False, _empty_html_static=[]): - """ transforms one chunk, returns a HTML string, a TOC object and a set of used characters """ - - toc = TOC() - for element in chunk_xml[0]: - if element.tag == "naglowek_czesc": - toc.add(node_name(element), "part%d.html#book-text" % chunk_no) - elif element.tag in ("naglowek_rozdzial", "naglowek_akt", "srodtytul"): - toc.add(node_name(element), "part%d.html" % chunk_no) - elif element.tag in ('naglowek_podrozdzial', 'naglowek_scena'): - subnumber = toc.add(node_name(element), "part%d.html" % chunk_no, level=1, is_part=False) - element.set('sub', str(subnumber)) - if empty: - if not _empty_html_static: - _empty_html_static.append(open(get_resource('epub/emptyChunk.html')).read()) - chars = set() - output_html = _empty_html_static[0] - else: - find_annotations(annotations, chunk_xml, chunk_no) - replace_by_verse(chunk_xml) - html_tree = xslt(chunk_xml, get_resource('epub/xsltScheme.xsl')) - chars = used_chars(html_tree.getroot()) - output_html = etree.tostring( - html_tree, pretty_print=True, xml_declaration=True, - encoding="utf-8", - doctype='' - ) - return output_html, toc, chars - - -def transform(wldoc, verbose=False, style=None, html_toc=False, - sample=None, cover=None, flags=None, hyphenate=False, ilustr_path='', output_type='epub'): - """ produces a EPUB file - - sample=n: generate sample e-book (with at least n paragraphs) - cover: a cover.Cover factory or True for default - flags: less-advertising, without-fonts, working-copy - """ - - def transform_file(wldoc, chunk_counter=1, first=True, sample=None): - """ processes one input file and proceeds to its children """ - - replace_characters(wldoc.edoc.getroot()) - - hyphenator = set_hyph_language(wldoc.edoc.getroot()) if hyphenate else None - hyphenate_and_fix_conjunctions(wldoc.edoc.getroot(), hyphenator) - - # every input file will have a TOC entry, - # pointing to starting chunk - toc = TOC(wldoc.book_info.title, "part%d.html" % chunk_counter) - chars = set() - if first: - # write book title page - html_tree = xslt(wldoc.edoc, get_resource('epub/xsltTitle.xsl'), outputtype=output_type) - chars = used_chars(html_tree.getroot()) - html_string = etree.tostring( - html_tree, pretty_print=True, xml_declaration=True, - encoding="utf-8", - doctype='' - ) - zip.writestr('OPS/title.html', squeeze_whitespace(html_string)) - # add a title page TOC entry - toc.add(u"Strona tytułowa", "title.html") - elif wldoc.book_info.parts: - # write title page for every parent - if sample is not None and sample <= 0: - chars = set() - html_string = open(get_resource('epub/emptyChunk.html')).read() - else: - html_tree = xslt(wldoc.edoc, get_resource('epub/xsltChunkTitle.xsl')) - chars = used_chars(html_tree.getroot()) - html_string = etree.tostring( - html_tree, pretty_print=True, xml_declaration=True, - encoding="utf-8", - doctype='' - ) - zip.writestr('OPS/part%d.html' % chunk_counter, squeeze_whitespace(html_string)) - add_to_manifest(manifest, chunk_counter) - add_to_spine(spine, chunk_counter) - chunk_counter += 1 - - if len(wldoc.edoc.getroot()) > 1: - # rdf before style master - main_text = wldoc.edoc.getroot()[1] - else: - # rdf in style master - main_text = wldoc.edoc.getroot()[0] - if main_text.tag == RDFNS('RDF'): - main_text = None - - if main_text is not None: - for chunk_xml in chop(main_text): - empty = False - if sample is not None: - if sample <= 0: - empty = True - else: - sample -= len(chunk_xml.xpath('//strofa|//akap|//akap_cd|//akap_dialog')) - chunk_html, chunk_toc, chunk_chars = transform_chunk(chunk_xml, chunk_counter, annotations, empty) - - toc.extend(chunk_toc) - chars = chars.union(chunk_chars) - zip.writestr('OPS/part%d.html' % chunk_counter, squeeze_whitespace(chunk_html)) - add_to_manifest(manifest, chunk_counter) - add_to_spine(spine, chunk_counter) - chunk_counter += 1 - - for child in wldoc.parts(): - child_toc, chunk_counter, chunk_chars, sample = transform_file( - child, chunk_counter, first=False, sample=sample) - toc.append(child_toc) - chars = chars.union(chunk_chars) - - return toc, chunk_counter, chars, sample - - document = deepcopy(wldoc) - del wldoc - - if flags: - for flag in flags: - document.edoc.getroot().set(flag, 'yes') - - document.clean_ed_note() - document.clean_ed_note('abstrakt') - - # add editors info - editors = document.editors() - if editors: - document.edoc.getroot().set('editors', u', '.join(sorted( - editor.readable() for editor in editors))) - if document.book_info.funders: - document.edoc.getroot().set('funders', u', '.join( - document.book_info.funders)) - if document.book_info.thanks: - document.edoc.getroot().set('thanks', document.book_info.thanks) - - opf = xslt(document.book_info.to_etree(), get_resource('epub/xsltContent.xsl')) - manifest = opf.find('.//' + OPFNS('manifest')) - guide = opf.find('.//' + OPFNS('guide')) - spine = opf.find('.//' + OPFNS('spine')) - - output_file = NamedTemporaryFile(prefix='librarian', suffix='.epub', delete=False) - zip = zipfile.ZipFile(output_file, 'w', zipfile.ZIP_DEFLATED) - - functions.reg_mathml_epub(zip) - - if os.path.isdir(ilustr_path): - ilustr_elements = set(ilustr.get('src') for ilustr in document.edoc.findall('//ilustr')) - for i, filename in enumerate(os.listdir(ilustr_path)): - if filename not in ilustr_elements: - continue - file_path = os.path.join(ilustr_path, filename) - zip.write(file_path, os.path.join('OPS', filename)) - image_id = 'image%s' % i - manifest.append(etree.fromstring( - '' % (image_id, filename, guess_type(file_path)[0]))) - - # write static elements - mime = zipfile.ZipInfo() - mime.filename = 'mimetype' - mime.compress_type = zipfile.ZIP_STORED - mime.extra = b'' - zip.writestr(mime, b'application/epub+zip') - zip.writestr( - 'META-INF/container.xml', - b'' - b'' - b'' - b'' - ) - zip.write(get_resource('res/wl-logo-small.png'), - os.path.join('OPS', 'logo_wolnelektury.png')) - zip.write(get_resource('res/jedenprocent.png'), - os.path.join('OPS', 'jedenprocent.png')) - if not style: - style = get_resource('epub/style.css') - zip.write(style, os.path.join('OPS', 'style.css')) - - if cover: - if cover is True: - cover = make_cover - - cover_file = BytesIO() - bound_cover = cover(document.book_info) - bound_cover.save(cover_file) - cover_name = 'cover.%s' % bound_cover.ext() - zip.writestr(os.path.join('OPS', cover_name), cover_file.getvalue()) - del cover_file - - cover_tree = etree.parse(get_resource('epub/cover.html')) - cover_tree.find('//' + XHTMLNS('img')).set('src', cover_name) - zip.writestr('OPS/cover.html', etree.tostring( - cover_tree, pretty_print=True, xml_declaration=True, - encoding="utf-8", - doctype='' - )) - - if bound_cover.uses_dc_cover: - if document.book_info.cover_by: - document.edoc.getroot().set('data-cover-by', document.book_info.cover_by) - if document.book_info.cover_source: - document.edoc.getroot().set('data-cover-source', document.book_info.cover_source) - - manifest.append(etree.fromstring( - '')) - manifest.append(etree.fromstring( - '' % (cover_name, bound_cover.mime_type()))) - spine.insert(0, etree.fromstring('')) - opf.getroot()[0].append(etree.fromstring('')) - guide.append(etree.fromstring('')) - - annotations = etree.Element('annotations') - - toc_file = etree.fromstring( - b'' - b'' - b'' - ) - nav_map = toc_file[-1] - - if html_toc: - manifest.append(etree.fromstring( - '')) - spine.append(etree.fromstring( - '')) - guide.append(etree.fromstring('')) - - toc, chunk_counter, chars, sample = transform_file(document, sample=sample) - - if len(toc.children) < 2: - toc.add(u"Początek utworu", "part1.html") - - # Last modifications in container files and EPUB creation - if len(annotations) > 0: - toc.add("Przypisy", "annotations.html") - manifest.append(etree.fromstring( - '')) - spine.append(etree.fromstring( - '')) - replace_by_verse(annotations) - html_tree = xslt(annotations, get_resource('epub/xsltAnnotations.xsl')) - chars = chars.union(used_chars(html_tree.getroot())) - zip.writestr('OPS/annotations.html', etree.tostring( - html_tree, pretty_print=True, xml_declaration=True, - encoding="utf-8", - doctype='' - )) - - toc.add("Wesprzyj Wolne Lektury", "support.html") - manifest.append(etree.fromstring( - '')) - spine.append(etree.fromstring( - '')) - html_string = open(get_resource('epub/support.html'), 'rb').read() - chars.update(used_chars(etree.fromstring(html_string))) - zip.writestr('OPS/support.html', squeeze_whitespace(html_string)) - - toc.add("Strona redakcyjna", "last.html") - manifest.append(etree.fromstring( - '')) - spine.append(etree.fromstring( - '')) - html_tree = xslt(document.edoc, get_resource('epub/xsltLast.xsl'), outputtype=output_type) - chars.update(used_chars(html_tree.getroot())) - zip.writestr('OPS/last.html', squeeze_whitespace(etree.tostring( - html_tree, pretty_print=True, xml_declaration=True, - encoding="utf-8", - doctype='' - ))) - - if not flags or 'without-fonts' not in flags: - # strip fonts - tmpdir = mkdtemp('-librarian-epub') - try: - cwd = os.getcwd() - except OSError: - cwd = None - - os.chdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'font-optimizer')) - for fname in 'DejaVuSerif.ttf', 'DejaVuSerif-Bold.ttf', 'DejaVuSerif-Italic.ttf', 'DejaVuSerif-BoldItalic.ttf': - optimizer_call = ['perl', 'subset.pl', '--chars', - ''.join(chars).encode('utf-8'), - get_resource('fonts/' + fname), - os.path.join(tmpdir, fname)] - env = {"PERL_USE_UNSAFE_INC": "1"} - if verbose: - print("Running font-optimizer") - subprocess.check_call(optimizer_call, env=env) - else: - dev_null = open(os.devnull, 'w') - subprocess.check_call(optimizer_call, stdout=dev_null, stderr=dev_null, env=env) - zip.write(os.path.join(tmpdir, fname), os.path.join('OPS', fname)) - manifest.append(etree.fromstring( - '' % (fname, fname))) - rmtree(tmpdir) - if cwd is not None: - os.chdir(cwd) - zip.writestr('OPS/content.opf', etree.tostring(opf, pretty_print=True, - xml_declaration=True, encoding="utf-8")) - title = document.book_info.title - attributes = "dtb:uid", "dtb:depth", "dtb:totalPageCount", "dtb:maxPageNumber" - for st in attributes: - meta = toc_file.makeelement(NCXNS('meta')) - meta.set('name', st) - meta.set('content', '0') - toc_file[0].append(meta) - toc_file[0][0].set('content', str(document.book_info.url)) - toc_file[0][1].set('content', str(toc.depth())) - set_inner_xml(toc_file[1], ''.join(('', title, ''))) - - # write TOC - if html_toc: - toc.add(u"Spis treści", "toc.html", index=1) - zip.writestr('OPS/toc.html', toc.html().encode('utf-8')) - toc.write_to_xml(nav_map) - zip.writestr('OPS/toc.ncx', etree.tostring(toc_file, pretty_print=True, - xml_declaration=True, encoding="utf-8")) - zip.close() - - return OutputFile.from_filename(output_file.name) diff --git a/librarian/epub/cover.html b/librarian/epub/cover.html deleted file mode 100644 index 784067c..0000000 --- a/librarian/epub/cover.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Okładka - - - -
- Okładka -
- - \ No newline at end of file diff --git a/librarian/epub/emptyChunk.html b/librarian/epub/emptyChunk.html deleted file mode 100644 index 1452a99..0000000 --- a/librarian/epub/emptyChunk.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - WolneLektury.pl - - - \ No newline at end of file diff --git a/librarian/epub/style.css b/librarian/epub/style.css deleted file mode 100644 index 82ad4b9..0000000 --- a/librarian/epub/style.css +++ /dev/null @@ -1,390 +0,0 @@ -@page { - margin: 5pt; -} -@font-face { - font-family: "DejaVu Serif"; - font-weight: normal; - font-style: normal; - src: url(DejaVuSerif.ttf); -} -@font-face { - font-family: "DejaVu Serif"; - font-weight: bold; - font-style: normal; - src: url(DejaVuSerif-Bold.ttf); -} -@font-face { - font-family: "DejaVu Serif"; - font-weight: normal; - font-style: italic; - src: url(DejaVuSerif-Italic.ttf); -} -@font-face { - font-family: "DejaVu Serif"; - font-weight: bold; - font-style: italic; - src: url(DejaVuSerif-BoldItalic.ttf); -} - -body, p, h1, h2, h3, h4 { - font-family: "DejaVu Serif", serif; -} - - -body -{ - line-height: 1.5em; - margin: 0; -} - -a -{ - text-decoration: none; - color: #00e; -} - -a img { - border: 0; -} - -#book-text { - margin: 0; -} - -/* =================================================== */ -/* = Common elements: headings, paragraphs and lines = */ -/* =================================================== */ - - -.h2 -{ - font-size: 2em; - margin: 0; - margin-top: 1.5em; - font-weight: bold; - line-height: 1.5em; -} - -.h3 -{ - text-align:left; - font-size: 1.5em; - margin-top: 1.5em; - font-weight: normal; - line-height: 1.5em; -} - -.h4 -{ - font-size: 1em; - margin: 0; - margin-top: 1.5em; - line-height: 1.5em; -} - -p -{ - margin: 0; -} - -/* ======================== */ -/* = Footnotes and themes = */ -/* ======================== */ - -.theme-begin -{ - border-left: 0.1em solid #DDDDDD; - color: #777; - padding: 0 0.5em; - width: 7.5em; - font-style: normal; - font-weight: normal; - font-size: 0.875em; - float: right; - margin-right: -9.5em; - clear: both; - left: 40em; - line-height: 1.5em; - text-align: left; -} - -.annotation -{ - margin-bottom: 0.3em; - text-align: justify; -} - -.block -{ - font-size: 0.875em; - padding: 1em; -} - - -/* ============= */ -/* = Numbering = */ -/* ============= */ - -.anchor sup -{ - line-height: 0; - font-size: 0.7em; -} - -/* =================== */ -/* = Custom elements = */ -/* =================== */ - -.title-page -{ - margin-top: 1.5em; -} - -.title -{ - font-size: 3em; - text-align: center; - line-height: 1.5em; - font-weight: bold; -} - -.author -{ - margin: 0; - text-align: center; - font-weight: bold; - - font-size: 1.5em; - line-height: 1.5em; - margin-bottom: 0.25em; -} - -.intitle -{ - margin: 0; - text-align: center; - font-weight: bold; - - font-size: 1.5em; - line-height: 1.5em; - margin-bottom: 0.25em; -} - -.insubtitle -{ - margin: 0; - text-align: center; - font-weight: bold; - - font-size: 1em; - line-height: 1.5em; - margin-bottom: 0.25em; -} - -.collection -{ - margin: 0; - text-align: center; - font-weight: bold; - - font-size: 1.125em; - line-height: 1.5em; - margin-bottom: -0.25em; -} - -.subtitle -{ - margin: 0; - text-align: center; - font-weight: bold; - - font-size: 1.5em; - line-height: 1.5em; - margin-top: -0.25em; -} - -div.didaskalia -{ - font-style: italic; - margin-top: 0.5em; - margin-bottom: 0.5em; - margin-left: 1.5em; -} - -.kwestia -{ - margin-top: 0.5em; -} - -.paragraph -{ - text-align: justify; - margin: 0; - text-indent: 1.2em; -} - -h1 + .paragraph, h2 + .paragraph -{ - text-indent: 0; -} - -h2 + .paragraph:first-letter -{ - font-size: 1.6em; -} - -.motto -{ - text-align: justify; - font-style: italic; - margin-top: 1.5em; -} - -.motto_podpis, .motto_podpis .paragraph -{ - font-size: 0.875em; - text-align: right; - font-style: italic; -} - -.fragment -{ - border-bottom: 0.1em solid #999; - padding-bottom: 1.5em; -} - -.dedication, .dedication .paragraph -{ - text-align: right; - font-style: italic; -} - -.note -{ - text-align: right; - font-style: italic; - margin-top: 1em; - margin-bottom: 0.5em; -} - -.note .paragraph -{ - text-align: justify; -} - -.frame -{ - border: 1px darkgray solid; - padding: 1em; - margin-top: 1em; - margin-bottom: 1em; -} - -hr.spacer -{ - height: 3em; - visibility: hidden; -} - -hr.spacer-line -{ - margin: 0; - margin-top: 1.5em; - margin-bottom: 1.5em; - border: none; - border-bottom: 0.1em solid #000; -} - -.spacer-asterisk -{ - padding: 0; - margin: 0; - margin-top: 1.5em; - margin-bottom: 1.5em; - text-align: center; -} - -div.person-list ol -{ - list-style: none; - padding: 0; - padding-left: 1.5em; -} - -.place-and-time -{ - font-style: italic; -} - -em.math -{ - font-style: italic; -} -em.foreign-word -{ - font-style: italic; -} -em.book-title -{ - font-style: italic; -} -em.didaskalia -{ - font-style: italic; -} - -em.author-emphasis -{ - letter-spacing: 0.1em; -} - -em.wieksze-odstepy -{ - font-style: normal; - word-spacing: 1em; -} - -.person-list em.person -{ - font-style: normal; - /*font-variant: small-caps;*/ - text-transform: uppercase; -} - -.info -{ - text-align: center; - margin-bottom: 1em; -} -.info div -{ - text-align: center; -} - -.info img -{ - margin: 0; - margin-left: 2em; - margin-right: 2em; -} - -p.minor-info { - text-align: center; - margin-bottom: 1em; - font-size: 0.75em; -} -p.footer { - margin-top: 2em; -} - -table { - border-collapse: collapse; - width: 100%; -} -table.border th, table.border td { - border: 1px solid black; -} - -th, td { - vertical-align: top; -} \ No newline at end of file diff --git a/librarian/epub/support.html b/librarian/epub/support.html deleted file mode 100755 index 9010693..0000000 --- a/librarian/epub/support.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Wesprzyj Wolne Lektury - - - -
- -

Wesprzyj Wolne Lektury!

- -

- Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji - pożytku publicznego działającej na rzecz wolności korzystania - z dóbr kultury.

- -

- Co roku do domeny publicznej przechodzi twórczość kolejnych autorów. - Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie. -

- -

- Jak możesz pomóc? -

- -

- Logo 1%
- Przekaż 1% podatku na rozwój Wolnych Lektur:
- Fundacja Nowoczesna Polska
- KRS 0000070056 -

- -

- Dołącz do Towarzystwa Przyjaciół Wolnych Lektur i pomóż nam rozwijać bibliotekę. -

- -

- Przekaż darowiznę na konto: - szczegóły - na stronie Fundacji. -

- -
- - diff --git a/librarian/epub/toc.html b/librarian/epub/toc.html deleted file mode 100755 index 3ff7556..0000000 --- a/librarian/epub/toc.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - WolneLektury.pl - - - -
-

Spis treści

- %s -
- - diff --git a/librarian/epub/xsltAnnotations.xsl b/librarian/epub/xsltAnnotations.xsl deleted file mode 100644 index 5588d3e..0000000 --- a/librarian/epub/xsltAnnotations.xsl +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - <xsl:text>Przypisy</xsl:text> - - - -
-
-

- Przypisy: -

- -
-
- - -
- - - - - - -

. [przypis autorski] [przypis tłumacza] [przypis redakcyjny] [przypis edytorski]

- -
- - - - - - - - -

- -

-
- - -
- -
-
- - - - „ - - ” - - - - -

- -

-
- -
diff --git a/librarian/epub/xsltChunkTitle.xsl b/librarian/epub/xsltChunkTitle.xsl deleted file mode 100644 index 8c0e09a..0000000 --- a/librarian/epub/xsltChunkTitle.xsl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - <xsl:text>Strona tytułowa</xsl:text> - - - -
-
- -
-
- - -
- - - - - - - - - - -

- -

-
- -
diff --git a/librarian/epub/xsltContent.xsl b/librarian/epub/xsltContent.xsl deleted file mode 100644 index 24315c5..0000000 --- a/librarian/epub/xsltContent.xsl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - , - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/librarian/epub/xsltLast.xsl b/librarian/epub/xsltLast.xsl deleted file mode 100644 index e29c5f4..0000000 --- a/librarian/epub/xsltLast.xsl +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - <xsl:text>Strona redakcyjna</xsl:text> - - - -
-

- - - Ten utwór jest udostępniony na licencji - - - - - - - - - Ten utwór nie jest objęty majątkowym prawem autorskim i znajduje się w domenie - publicznej, co oznacza że możesz go swobodnie wykorzystywać, publikować - i rozpowszechniać. Jeśli utwór opatrzony jest dodatkowymi materiałami - (przypisy, motywy literackie etc.), które podlegają prawu autorskiemu, to - te dodatkowe materiały udostępnione są na licencji - Creative Commons - Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL. - - -

- -

Źródło: - - - - - , - - -

- - -

Tekst opracowany na podstawie:

-
- - -

- Wydawca: - - - , - -

-
- - -

-
- - - - - - -

Okładka na podstawie: - - - - - - - - - - - - - -

-
- - - - -

ISBN

-
- -

 

-

- Plik wygenerowany dnia . -

- -
- - -
- - - - - - - -

- Opracowanie redakcyjne i przypisy: - .

-
-
- - - -

Publikację wsparli i wsparły: - .

-
-
- - - - -
diff --git a/librarian/epub/xsltScheme.xsl b/librarian/epub/xsltScheme.xsl deleted file mode 100644 index 724d983..0000000 --- a/librarian/epub/xsltScheme.xsl +++ /dev/null @@ -1,405 +0,0 @@ - - - - - - - - - - - - - WolneLektury.pl - - - - - book-text - - - - - - - - - - - - - - - - - -
- -
-
- - -
-
- -
-
    - -
-
-
- - -
- -
-
- - -
- -
-
- - -
- -
-
- - -
- -
-
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - -

- -

-
- - - - -

- -

-
- - - - -

- -

-
- - - - -

- -

-
- - - - -

- -

-
- - -

- -

-
- - - -

- -

-
- - - -

- -

-
- - -

- -

-
- - -

- -

-
- - -

- -

-
- - -

- -

-
- - - -

- -

-
- - -
- -
-
- - -
- -
-
- - -

- -

-
- - -
- -
 
-
- - -
- -  
-
- - -
- -  
-
- - -
- -  
-
- - -
- -  
-
- - -
- - margin-left: em; - - -  
-
- - -
- -  
-
- - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - „ - - ” - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  • - -
  • -
    - - - - - - -

     

    -
    - - -

    *

    -
    - - -
    -
    - - - - - - - - - - - - - - - - - - -
    -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    diff --git a/librarian/epub/xsltTitle.xsl b/librarian/epub/xsltTitle.xsl deleted file mode 100644 index 0a7279b..0000000 --- a/librarian/epub/xsltTitle.xsl +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - <xsl:text>Strona tytułowa</xsl:text> - - - -
    -
    - - - - - - - - - - -
    - -

     

    - - - - -

    [Kopia robocza]

    -
    - - -

    - - - - - Ta lektura, - podobnie jak tysiące innych, jest dostępna on-line na stronie - wolnelektury.pl. -

    -
    - - -

    -
    - -

    - Utwór opracowany został w ramach projektu Wolne Lektury przez fundację Nowoczesna Polska. -

    - - - - -

    ISBN

    -
    - - -
    - - -
    - - - - - - - - - - -

    - -

    -
    - - -

    - -

    -
    - - - -

    - tłum. - - , - - -

    -
    -
    - - - - - - -

    - -

    -
    - - -

    - -

    -
    - - -

    - -

    -
    - - -

    - -

    -
    - - -

    - -

    -
    - - - - - - - -
    diff --git a/librarian/fb2.py b/librarian/fb2.py deleted file mode 100644 index 6dd1c35..0000000 --- a/librarian/fb2.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import unicode_literals - -import os.path -from copy import deepcopy -from lxml import etree -import six - -from librarian import functions, OutputFile -from .epub import replace_by_verse - - -functions.reg_substitute_entities() -functions.reg_person_name() - - -def sectionify(tree): - """Finds section headers and adds a tree of _section tags.""" - sections = [ - 'naglowek_czesc', - 'naglowek_akt', 'naglowek_rozdzial', 'naglowek_scena', - 'naglowek_podrozdzial'] - section_level = dict((v, k) for (k, v) in enumerate(sections)) - - # We can assume there are just subelements an no text at section level. - for level, section_name in reversed(list(enumerate(sections))): - for header in tree.findall('//' + section_name): - section = header.makeelement("_section") - header.addprevious(section) - section.append(header) - sibling = section.getnext() - while (sibling is not None and - section_level.get(sibling.tag, 1000) > level): - section.append(sibling) - sibling = section.getnext() - - -def transform(wldoc, verbose=False, - cover=None, flags=None): - """ produces a FB2 file - - cover: a cover.Cover object or True for default - flags: less-advertising, working-copy - """ - - document = deepcopy(wldoc) - del wldoc - - if flags: - for flag in flags: - document.edoc.getroot().set(flag, 'yes') - - document.clean_ed_note() - document.clean_ed_note('abstrakt') - - style_filename = os.path.join(os.path.dirname(__file__), 'fb2/fb2.xslt') - style = etree.parse(style_filename) - - replace_by_verse(document.edoc) - sectionify(document.edoc) - - result = document.transform(style) - - return OutputFile.from_bytes(six.text_type(result).encode('utf-8')) - -# vim:et diff --git a/librarian/fb2/description.xslt b/librarian/fb2/description.xslt deleted file mode 100644 index 6d7383f..0000000 --- a/librarian/fb2/description.xslt +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - literature - - - - - - - - - - - book2fb2 - - - - - 0 - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/librarian/fb2/drama.xslt b/librarian/fb2/drama.xslt deleted file mode 100755 index ab8fb06..0000000 --- a/librarian/fb2/drama.xslt +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - -

    -
    - - -

    -
    - - -

    -
    - - - - - -
    diff --git a/librarian/fb2/fb2.xslt b/librarian/fb2/fb2.xslt deleted file mode 100644 index 2f322e8..0000000 --- a/librarian/fb2/fb2.xslt +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <xsl:apply-templates mode="title" - select="autor_utworu|dzielo_nadrzedne|nazwa_utworu|podtytul"/> - <xsl:call-template name="translators" /> - - - - -

    - Utwór opracowany został w ramach projektu - Wolne Lektury - przez fundację - Nowoczesna Polska. -

    -
    - - - -
    - - - - - - - -

    -
    - - - -

    - tłum. - - , - - -

    -
    -
    - - - - - - - - -
    diff --git a/librarian/fb2/footnotes.xslt b/librarian/fb2/footnotes.xslt deleted file mode 100644 index 2fe3d4e..0000000 --- a/librarian/fb2/footnotes.xslt +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - fn - -

    - - [przypis autorski] - - - [przypis tłumacza] - - - [przypis redakcyjny] - - - [przypis edytorski] -

    -
    -
    - - - - - - - note - #fn - - [ - - ] - - -
    diff --git a/librarian/fb2/inline.xslt b/librarian/fb2/inline.xslt deleted file mode 100644 index 351d13c..0000000 --- a/librarian/fb2/inline.xslt +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - „ - - ” - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/librarian/fb2/paragraphs.xslt b/librarian/fb2/paragraphs.xslt deleted file mode 100644 index e2dc26b..0000000 --- a/librarian/fb2/paragraphs.xslt +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - -

    -
    - - - - - - -

    -
    - - - - - - -

    *

    -
    - - -

    ————————

    -
    - - -
    -
    - - - - - - - - - - - - - - -
    diff --git a/librarian/fb2/poems.xslt b/librarian/fb2/poems.xslt deleted file mode 100644 index 257795b..0000000 --- a/librarian/fb2/poems.xslt +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/librarian/fb2/sections.xslt b/librarian/fb2/sections.xslt deleted file mode 100644 index 80ffb65..0000000 --- a/librarian/fb2/sections.xslt +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -
    - - - - - - - - - - -
    -
    - - - -
    - - - -
    - -
    -
    - - - - <p><xsl:apply-templates mode="inline"/></p> - -
    diff --git a/librarian/fn_qualifiers.py b/librarian/fn_qualifiers.py deleted file mode 100644 index 51168e4..0000000 --- a/librarian/fn_qualifiers.py +++ /dev/null @@ -1,198 +0,0 @@ -# -*- coding: utf-8 -""" -List of standard footnote qualifiers. -This file is generated by scripts/fn_qualifiers_list_from_wiki.py, -do not edit it. -""" -from __future__ import unicode_literals - - -FN_QUALIFIERS = { - 'a.': 'albo', - 'alb.': 'albański', - 'amer.': 'amerykański, amerykańskie', - 'anat.': 'anatomiczne', - 'ang.': 'angielski, angielskie', - 'antr.': 'antropologia, antropologiczny', - 'ar.': 'arabski', - 'archeol.': 'archeologia, archeologiczny', - 'archit.': 'architektura', - 'astr.': 'astronomia', - 'austr.': 'austriacki', - 'austral.': 'australijski', - 'B.': 'biernik', - 'białorus.': 'białoruski', - 'biol.': 'biologia, biologiczny', - 'blm': 'bez liczby mnogiej', - 'blp': 'bez liczby pojedynczej', - 'bot.': 'botanika', - 'bułg.': 'bułgarski', - 'C.': 'celownik', - 'celt.': 'celtycki', - 'chem.': 'chemiczny', - 'chiń.': 'chiński', - 'chrześc.': 'chrześcijański, chrześcijaństwo', - 'cz.': 'czas (gramatyczny)', - 'cz.przesz.': 'czas przeszły', - 'cz.przysz.': 'czas przyszły', - 'cz.ter.': 'czas teraźniejszy', - 'czas.': 'czasownik', - 'czes.': 'czeski', - 'D.': 'dopełniacz', - 'daw.': 'dawne', - 'dk': 'dokonane', - 'druk.': 'drukarstwo, drukowany', - 'dziec.': 'dziecięcy', - 'egip.': 'egipski', - 'ekon.': 'ekonomiczny', - 'elektr.': 'elektryczny', - 'etn.': 'etnografia, etniczny', - 'euf.': 'eufemizm', - 'film.': 'filmowy', - 'filoz.': 'filozoficzny', - 'fiń.': 'fiński', - 'fiz.': 'fizyka', - 'fizjol.': 'fizjologia', - 'fot.': 'fotografia, fotograficzny', - 'fr.': 'francuski', - 'fraz.': 'frazeologia, frazeologiczny', - 'fragm.': 'fragment', - 'genet.': 'genetyka, genetyczny', - 'geogr.': 'geografia, geograficzny', - 'geol.': 'geologia', - 'geom.': 'geometria', - 'gr.': 'grecki', - 'gw.': 'gwara, gwarowe', - 'hand.': 'handel, handlowy', - 'hebr.': 'hebrajski', - 'hind.': 'hinduski', - 'hist.': 'historia, historyczny', - 'hiszp.': 'hiszpański', - 'hol.': 'holenderski', - 'im.': 'imienia', - 'imiesł.': 'imiesłów, imiesłowowy', - 'in.': 'inne, inny', - 'inf.': 'informacja', - 'inform.': 'informatyka', - 'irl.': 'irlandzki', - 'iron.': 'ironicznie', - 'isl.': 'islandzki', - 'itd.': 'i tak dalej', - 'itp.': 'i tym podobne', - 'jap.': 'japoński', - 'jęz.': 'język, językowy, językoznawstwo', - 'kg': 'kilogram', - 'km': 'kilometr', - 'lit.': 'literacki, literatura', - 'lm': 'liczba mnoga', - 'łac.': 'łacina, łacińskie', - 'M.': 'mianownik', - 'm.': 'męski', - 'mat.': 'matematyka', - 'med.': 'medyczne', - 'meteor.': 'meteorologia, meteorologiczny', - 'min.': 'minuta', - 'm.in.': 'między innymi', - 'miner.': 'mineralogia', - 'mit.': 'mitologia', - 'mit. germ.': 'mitologia germańska', - 'mit. gr.': 'mitologia grecka', - 'mit. rzym.': 'mitologia rzymska', - 'mors.': 'morskie', - 'm.-os.': 'męskoosobowy', - 'Ms.': 'miejscownik', - 'muz.': 'muzyczny', - 'N.': 'narzędnik', - 'n.': 'nijaki', - 'ndk': 'niedokonany', - 'ndm': 'nieodmienny', - 'n.e.': 'nasza era', - 'nieos.': 'nieosobowy', - 'niem.': 'niemiecki', - 'norw.': 'norweski', - 'np.': 'na przykład', - 'obelż.': 'obelżywie', - 'odm.': 'odmienny', - 'ok.': 'około', - 'os.': 'osoba, osobowy', - 'płd.': 'południowy', - 'płn.': 'północny', - 'p.n.e.': 'przed naszą erą', - 'pocz.': 'początek', - 'poet.': 'poetyckie', - 'pogard.': 'pogardliwe', - 'pol.': 'polski', - 'polit.': 'polityczny', - 'poł.': 'połowa', - 'popr.': 'poprawnie', - 'por.': 'porównaj', - 'port.': 'portugalski', - 'posp.': 'pospolity', - 'pot.': 'potocznie', - 'praw.': 'prawo, prawnicze', - 'przen.': 'przenośnie', - 'przestarz.': 'przestarzałe', - 'przesz.': 'przeszły', - 'przym.': 'przymiotnik', - 'przysł.': 'przysłowiowy', - 'przysłów.': 'przysłówek', - 'przysz.': 'przyszły', - 'psychol.': 'psychologia, psychologiczny', - 'r.': 'rok', - 'r.m.': 'rodzaj męski', - 'r.n.': 'rodzaj nijaki', - 'r.ż.': 'rodzaj żeński', - 'reg.': 'regionalne', - 'rel.': 'religijny, religioznawstwo', - 'rodz.': 'rodzaj', - 'roln.': 'rolnictwo, rolniczy', - 'ros.': 'rosyjski', - 'rub.': 'rubasznie', - 'rum.': 'rumuński', - 'rzad.': 'rzadki', - 'rzecz.': 'rzeczownik', - 'rzym.': 'rzymski', - 'skand.': 'skandynawski', - 'skrót.': 'skrótowiec', - 'słowac.': 'słowacki', - 'socjol.': 'socjologiczny', - 'sport.': 'sportowy', - 'st.': 'stopień', - 'starop.': 'staropolskie', - 'staroż.': 'starożytny', - 'szt.': 'sztuka', - 'szwedz.': 'szwedzki', - 'śr.': 'środek, środkowy', - 'środ.': 'środowiskowy', - 'teatr.': 'teatralny', - 'techn.': 'techniczny', - 'temp.': 'temperatura', - 'ter.': 'teraźniejszy', - 'tur.': 'turecki', - 'tur.-tat.': 'turecko-tatarski', - 'tys.': 'tysiąc', - 'tzn.': 'to znaczy', - 'uczn.': 'uczniowski', - 'ukr.': 'ukraiński', - 'urb.': 'urbanistyka', - 'W.': 'wołacz', - 'w.': 'wiek', - 'węg.': 'węgierski', - 'wg': 'według', - 'wł.': 'włoski', - 'wojsk.': 'wojskowy', - 'wsch.': 'wschodni', - 'współ.': 'współcześnie', - 'wulg.': 'wulgarne', - 'wym.': 'wymawiaj', - 'zach.': 'zachodnie', - 'zdr.': 'zdrobnienie', - 'zgr.': 'zgrubienie', - 'zn.': 'znaczy, znaczenie', - 'zob.': 'zobacz', - 'zool.': 'zoologia', - 'zwł.': 'zwłaszcza', - 'ż.': 'żeński', - 'żart.': 'żartobliwie', - 'żegl.': 'żeglarskie', - } diff --git a/librarian/font-optimizer/.hg/00changelog.i b/librarian/font-optimizer/.hg/00changelog.i deleted file mode 100644 index d3a8311..0000000 Binary files a/librarian/font-optimizer/.hg/00changelog.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/branch b/librarian/font-optimizer/.hg/branch deleted file mode 100644 index 4ad96d5..0000000 --- a/librarian/font-optimizer/.hg/branch +++ /dev/null @@ -1 +0,0 @@ -default diff --git a/librarian/font-optimizer/.hg/branchheads.cache b/librarian/font-optimizer/.hg/branchheads.cache deleted file mode 100644 index 12049da..0000000 --- a/librarian/font-optimizer/.hg/branchheads.cache +++ /dev/null @@ -1,2 +0,0 @@ -136826b53242c388267996d1febb0fea90193a06 28 -136826b53242c388267996d1febb0fea90193a06 default diff --git a/librarian/font-optimizer/.hg/dirstate b/librarian/font-optimizer/.hg/dirstate deleted file mode 100644 index 2c2e4dc..0000000 Binary files a/librarian/font-optimizer/.hg/dirstate and /dev/null differ diff --git a/librarian/font-optimizer/.hg/hgrc b/librarian/font-optimizer/.hg/hgrc deleted file mode 100644 index 5945460..0000000 --- a/librarian/font-optimizer/.hg/hgrc +++ /dev/null @@ -1,2 +0,0 @@ -[paths] -default = http://bitbucket.org/philip/font-optimizer diff --git a/librarian/font-optimizer/.hg/requires b/librarian/font-optimizer/.hg/requires deleted file mode 100644 index 5175383..0000000 --- a/librarian/font-optimizer/.hg/requires +++ /dev/null @@ -1,3 +0,0 @@ -revlogv1 -store -fncache diff --git a/librarian/font-optimizer/.hg/store/00changelog.i b/librarian/font-optimizer/.hg/store/00changelog.i deleted file mode 100644 index 589167b..0000000 Binary files a/librarian/font-optimizer/.hg/store/00changelog.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/00manifest.i b/librarian/font-optimizer/.hg/store/00manifest.i deleted file mode 100644 index a0513b1..0000000 Binary files a/librarian/font-optimizer/.hg/store/00manifest.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/.hgignore.i b/librarian/font-optimizer/.hg/store/data/.hgignore.i deleted file mode 100644 index d5dd3e2..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/.hgignore.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/_font/_e_o_t_wrapper.pm.i b/librarian/font-optimizer/.hg/store/data/_font/_e_o_t_wrapper.pm.i deleted file mode 100644 index 1ad7150..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/_font/_e_o_t_wrapper.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/_font/_subsetter.pm.i b/librarian/font-optimizer/.hg/store/data/_font/_subsetter.pm.i deleted file mode 100644 index 5d17c4e..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/_font/_subsetter.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/_font/_subsetter/_normalization_data.pm.i b/librarian/font-optimizer/.hg/store/data/_font/_subsetter/_normalization_data.pm.i deleted file mode 100644 index 93d459c..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/_font/_subsetter/_normalization_data.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/_font/_subsetter/create-data.pl.i b/librarian/font-optimizer/.hg/store/data/_font/_subsetter/create-data.pl.i deleted file mode 100644 index 5ba7451..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/_font/_subsetter/create-data.pl.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/_l_i_c_e_n_s_e.i b/librarian/font-optimizer/.hg/store/data/_l_i_c_e_n_s_e.i deleted file mode 100644 index d0cc9aa..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/_l_i_c_e_n_s_e.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/_r_e_a_d_m_e.txt.i b/librarian/font-optimizer/.hg/store/data/_r_e_a_d_m_e.txt.i deleted file mode 100644 index b845651..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/_r_e_a_d_m_e.txt.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/convert-eot.pl.i b/librarian/font-optimizer/.hg/store/data/convert-eot.pl.i deleted file mode 100644 index 25a4a4b..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/convert-eot.pl.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/.cvsignore.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/.cvsignore.i deleted file mode 100644 index 304249e..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/.cvsignore.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_c_o_p_y_i_n_g.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_c_o_p_y_i_n_g.i deleted file mode 100644 index d0f0482..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_c_o_p_y_i_n_g.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_changes.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_changes.i deleted file mode 100644 index e022e4a..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_changes.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_m_a_n_i_f_e_s_t._s_k_i_p.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_m_a_n_i_f_e_s_t._s_k_i_p.i deleted file mode 100644 index 57b5f9d..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_m_a_n_i_f_e_s_t._s_k_i_p.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_makefile._p_l.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_makefile._p_l.i deleted file mode 100644 index e008707..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_makefile._p_l.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_r_e_a_d_m_e._t_x_t.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_r_e_a_d_m_e._t_x_t.i deleted file mode 100644 index 8cc6335..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_r_e_a_d_m_e._t_x_t.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_t_o_d_o.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_t_o_d_o.i deleted file mode 100644 index 690178c..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_t_o_d_o.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f.pm.i deleted file mode 100644 index 8b3c878..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_a_a_t_kern.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_a_a_t_kern.pm.i deleted file mode 100644 index 61243bc..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_a_a_t_kern.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_a_a_tutils.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_a_a_tutils.pm.i deleted file mode 100644 index 81cb366..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_a_a_tutils.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_anchor.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_anchor.pm.i deleted file mode 100644 index 831f79c..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_anchor.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_bsln.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_bsln.pm.i deleted file mode 100644 index da72a7f..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_bsln.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_changes.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_changes.i deleted file mode 100644 index ba56a59..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_changes.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_cmap.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_cmap.pm.i deleted file mode 100644 index 6ca0ef4..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_cmap.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_coverage.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_coverage.pm.i deleted file mode 100644 index fbab57c..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_coverage.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_cvt__.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_cvt__.pm.i deleted file mode 100644 index c9d0313..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_cvt__.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_delta.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_delta.pm.i deleted file mode 100644 index c765c0c..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_delta.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_dumper.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_dumper.pm.i deleted file mode 100644 index 6f21a21..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_dumper.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_e_b_d_t.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_e_b_d_t.pm.i deleted file mode 100644 index b189d1c..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_e_b_d_t.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_e_b_l_c.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_e_b_l_c.pm.i deleted file mode 100644 index 3ff5901..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_e_b_l_c.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fdsc.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fdsc.pm.i deleted file mode 100644 index 0cdb3e4..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fdsc.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_feat.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_feat.pm.i deleted file mode 100644 index 77d19bc..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_feat.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fmtx.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fmtx.pm.i deleted file mode 100644 index eab522e..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fmtx.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_font.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_font.pm.i deleted file mode 100644 index 6749bda..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_font.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fpgm.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fpgm.pm.i deleted file mode 100644 index 7a3472b..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fpgm.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_d_e_f.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_d_e_f.pm.i deleted file mode 100644 index 7ee4f49..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_d_e_f.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_p_o_s.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_p_o_s.pm.i deleted file mode 100644 index 2cb1d44..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_p_o_s.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_s_u_b.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_s_u_b.pm.i deleted file mode 100644 index c15662e..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_s_u_b.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_glyf.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_glyf.pm.i deleted file mode 100644 index 0d9f502..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_glyf.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_glyph.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_glyph.pm.i deleted file mode 100644 index 59cfdd5..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_glyph.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_gr_feat.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_gr_feat.pm.i deleted file mode 100644 index 390bb2d..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_gr_feat.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hdmx.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hdmx.pm.i deleted file mode 100644 index df875b2..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hdmx.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_head.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_head.pm.i deleted file mode 100644 index 2a27c08..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_head.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hhea.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hhea.pm.i deleted file mode 100644 index 2048db2..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hhea.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hmtx.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hmtx.pm.i deleted file mode 100644 index ccebc5b..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hmtx.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern.pm.i deleted file mode 100644 index ab7c2fa..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_class_array.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_class_array.pm.i deleted file mode 100644 index f8d3ac1..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_class_array.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_compact_class_array.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_compact_class_array.pm.i deleted file mode 100644 index ae4c920..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_compact_class_array.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_ordered_list.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_ordered_list.pm.i deleted file mode 100644 index 1ee7c8a..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_ordered_list.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_state_table.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_state_table.pm.i deleted file mode 100644 index 8473671..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_state_table.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_subtable.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_subtable.pm.i deleted file mode 100644 index a171a02..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_subtable.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_l_t_s_h.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_l_t_s_h.pm.i deleted file mode 100644 index cdb08e4..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_l_t_s_h.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_loca.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_loca.pm.i deleted file mode 100644 index 0e9131d..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_loca.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_manual.pod.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_manual.pod.i deleted file mode 100644 index 94fb1f9..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_manual.pod.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_maxp.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_maxp.pm.i deleted file mode 100644 index 1e8a342..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_maxp.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort.pm.i deleted file mode 100644 index 2d39c95..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_chain.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_chain.pm.i deleted file mode 100644 index 2ec8260..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_chain.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_contextual.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_contextual.pm.i deleted file mode 100644 index d366880..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_contextual.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_insertion.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_insertion.pm.i deleted file mode 100644 index 05e84e1..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_insertion.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_ligature.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_ligature.pm.i deleted file mode 100644 index c36b902..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_ligature.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_noncontextual.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_noncontextual.pm.i deleted file mode 100644 index 6f3dd29..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_noncontextual.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_rearrangement.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_rearrangement.pm.i deleted file mode 100644 index fba11e9..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_rearrangement.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_subtable.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_subtable.pm.i deleted file mode 100644 index 93a96a6..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_subtable.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_name.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_name.pm.i deleted file mode 100644 index 77d07a6..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_name.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_o_s__2.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_o_s__2.pm.i deleted file mode 100644 index 680915c..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_o_s__2.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_o_t_tags.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_o_t_tags.pm.i deleted file mode 100644 index 35d40fd..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_o_t_tags.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_old_cmap.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_old_cmap.pm.i deleted file mode 100644 index e28e8f5..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_old_cmap.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_old_mort.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_old_mort.pm.i deleted file mode 100644 index 8569493..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_old_mort.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_p_c_l_t.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_p_c_l_t.pm.i deleted file mode 100644 index 8d8f7e3..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_p_c_l_t.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_p_s_names.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_p_s_names.pm.i deleted file mode 100644 index 6f687e2..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_p_s_names.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_post.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_post.pm.i deleted file mode 100644 index 43aea94..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_post.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_prep.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_prep.pm.i deleted file mode 100644 index 83259b6..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_prep.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_prop.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_prop.pm.i deleted file mode 100644 index 1885a0f..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_prop.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_segarr.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_segarr.pm.i deleted file mode 100644 index eb03abd..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_segarr.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_sill.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_sill.pm.i deleted file mode 100644 index c30cc85..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_sill.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_table.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_table.pm.i deleted file mode 100644 index 3ca1604..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_table.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_ttc.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_ttc.pm.i deleted file mode 100644 index 366ba1a..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_ttc.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_ttopen.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_ttopen.pm.i deleted file mode 100644 index bb07642..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_ttopen.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_useall.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_useall.pm.i deleted file mode 100644 index 727a333..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_useall.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_utils.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_utils.pm.i deleted file mode 100644 index 5bf9612..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_utils.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_vhea.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_vhea.pm.i deleted file mode 100644 index 1972e4b..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_vhea.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_vmtx.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_vmtx.pm.i deleted file mode 100644 index 3756ed1..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_vmtx.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_win32.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_win32.pm.i deleted file mode 100644 index 25b5628..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_win32.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_x_m_lparse.pm.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_x_m_lparse.pm.i deleted file mode 100644 index 2bbc5ae..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_x_m_lparse.pm.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/ttfmod.pl.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/ttfmod.pl.i deleted file mode 100644 index e50d2ca..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/ttfmod.pl.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/_o_f_l.txt.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/_o_f_l.txt.i deleted file mode 100644 index 0b8fb4b..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/_o_f_l.txt.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/tags.t.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/tags.t.i deleted file mode 100644 index 4181bf2..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/tags.t.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/testfont.ttf.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/testfont.ttf.i deleted file mode 100644 index 57ac10e..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/testfont.ttf.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/ttfcopy.t.i b/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/ttfcopy.t.i deleted file mode 100644 index 5ce2b98..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/ttfcopy.t.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/gen-tests.pl.i b/librarian/font-optimizer/.hg/store/data/gen-tests.pl.i deleted file mode 100644 index 815d800..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/gen-tests.pl.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/list-features.pl.i b/librarian/font-optimizer/.hg/store/data/list-features.pl.i deleted file mode 100644 index 1b72a5d..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/list-features.pl.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/modify-names.pl.i b/librarian/font-optimizer/.hg/store/data/modify-names.pl.i deleted file mode 100644 index dfd5924..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/modify-names.pl.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/obfuscate-font.pl.i b/librarian/font-optimizer/.hg/store/data/obfuscate-font.pl.i deleted file mode 100644 index 7853c72..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/obfuscate-font.pl.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/obfuscate-names.pl.i b/librarian/font-optimizer/.hg/store/data/obfuscate-names.pl.i deleted file mode 100644 index 4120d0e..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/obfuscate-names.pl.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/subset.pl.i b/librarian/font-optimizer/.hg/store/data/subset.pl.i deleted file mode 100644 index 6dd0437..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/subset.pl.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/data/t/subsetter.pl.i b/librarian/font-optimizer/.hg/store/data/t/subsetter.pl.i deleted file mode 100644 index 122eaa2..0000000 Binary files a/librarian/font-optimizer/.hg/store/data/t/subsetter.pl.i and /dev/null differ diff --git a/librarian/font-optimizer/.hg/store/fncache b/librarian/font-optimizer/.hg/store/fncache deleted file mode 100644 index f8f8690..0000000 --- a/librarian/font-optimizer/.hg/store/fncache +++ /dev/null @@ -1,94 +0,0 @@ -data/.hgignore.i -data/Font/EOTWrapper.pm.i -data/Font/Subsetter.pm.i -data/Font/Subsetter/NormalizationData.pm.i -data/Font/Subsetter/create-data.pl.i -data/LICENSE.i -data/README.txt.i -data/convert-eot.pl.i -data/ext/Font-TTF/.cvsignore.i -data/ext/Font-TTF/COPYING.i -data/ext/Font-TTF/Changes.i -data/ext/Font-TTF/MANIFEST.SKIP.i -data/ext/Font-TTF/Makefile.PL.i -data/ext/Font-TTF/README.TXT.i -data/ext/Font-TTF/TODO.i -data/ext/Font-TTF/lib/Font/TTF.pm.i -data/ext/Font-TTF/lib/Font/TTF/AATKern.pm.i -data/ext/Font-TTF/lib/Font/TTF/AATutils.pm.i -data/ext/Font-TTF/lib/Font/TTF/Anchor.pm.i -data/ext/Font-TTF/lib/Font/TTF/Bsln.pm.i -data/ext/Font-TTF/lib/Font/TTF/Changes.i -data/ext/Font-TTF/lib/Font/TTF/Cmap.pm.i -data/ext/Font-TTF/lib/Font/TTF/Coverage.pm.i -data/ext/Font-TTF/lib/Font/TTF/Cvt_.pm.i -data/ext/Font-TTF/lib/Font/TTF/Delta.pm.i -data/ext/Font-TTF/lib/Font/TTF/Dumper.pm.i -data/ext/Font-TTF/lib/Font/TTF/EBDT.pm.i -data/ext/Font-TTF/lib/Font/TTF/EBLC.pm.i -data/ext/Font-TTF/lib/Font/TTF/Fdsc.pm.i -data/ext/Font-TTF/lib/Font/TTF/Feat.pm.i -data/ext/Font-TTF/lib/Font/TTF/Fmtx.pm.i -data/ext/Font-TTF/lib/Font/TTF/Font.pm.i -data/ext/Font-TTF/lib/Font/TTF/Fpgm.pm.i -data/ext/Font-TTF/lib/Font/TTF/GDEF.pm.i -data/ext/Font-TTF/lib/Font/TTF/GPOS.pm.i -data/ext/Font-TTF/lib/Font/TTF/GSUB.pm.i -data/ext/Font-TTF/lib/Font/TTF/Glyf.pm.i -data/ext/Font-TTF/lib/Font/TTF/Glyph.pm.i -data/ext/Font-TTF/lib/Font/TTF/GrFeat.pm.i -data/ext/Font-TTF/lib/Font/TTF/Hdmx.pm.i -data/ext/Font-TTF/lib/Font/TTF/Head.pm.i -data/ext/Font-TTF/lib/Font/TTF/Hhea.pm.i -data/ext/Font-TTF/lib/Font/TTF/Hmtx.pm.i -data/ext/Font-TTF/lib/Font/TTF/Kern.pm.i -data/ext/Font-TTF/lib/Font/TTF/Kern/ClassArray.pm.i -data/ext/Font-TTF/lib/Font/TTF/Kern/CompactClassArray.pm.i -data/ext/Font-TTF/lib/Font/TTF/Kern/OrderedList.pm.i -data/ext/Font-TTF/lib/Font/TTF/Kern/StateTable.pm.i -data/ext/Font-TTF/lib/Font/TTF/Kern/Subtable.pm.i -data/ext/Font-TTF/lib/Font/TTF/LTSH.pm.i -data/ext/Font-TTF/lib/Font/TTF/Loca.pm.i -data/ext/Font-TTF/lib/Font/TTF/Manual.pod.i -data/ext/Font-TTF/lib/Font/TTF/Maxp.pm.i -data/ext/Font-TTF/lib/Font/TTF/Mort.pm.i -data/ext/Font-TTF/lib/Font/TTF/Mort/Chain.pm.i -data/ext/Font-TTF/lib/Font/TTF/Mort/Contextual.pm.i -data/ext/Font-TTF/lib/Font/TTF/Mort/Insertion.pm.i -data/ext/Font-TTF/lib/Font/TTF/Mort/Ligature.pm.i -data/ext/Font-TTF/lib/Font/TTF/Mort/Noncontextual.pm.i -data/ext/Font-TTF/lib/Font/TTF/Mort/Rearrangement.pm.i -data/ext/Font-TTF/lib/Font/TTF/Mort/Subtable.pm.i -data/ext/Font-TTF/lib/Font/TTF/Name.pm.i -data/ext/Font-TTF/lib/Font/TTF/OS_2.pm.i -data/ext/Font-TTF/lib/Font/TTF/OTTags.pm.i -data/ext/Font-TTF/lib/Font/TTF/OldCmap.pm.i -data/ext/Font-TTF/lib/Font/TTF/OldMort.pm.i -data/ext/Font-TTF/lib/Font/TTF/PCLT.pm.i -data/ext/Font-TTF/lib/Font/TTF/PSNames.pm.i -data/ext/Font-TTF/lib/Font/TTF/Post.pm.i -data/ext/Font-TTF/lib/Font/TTF/Prep.pm.i -data/ext/Font-TTF/lib/Font/TTF/Prop.pm.i -data/ext/Font-TTF/lib/Font/TTF/Segarr.pm.i -data/ext/Font-TTF/lib/Font/TTF/Sill.pm.i -data/ext/Font-TTF/lib/Font/TTF/Table.pm.i -data/ext/Font-TTF/lib/Font/TTF/Ttc.pm.i -data/ext/Font-TTF/lib/Font/TTF/Ttopen.pm.i -data/ext/Font-TTF/lib/Font/TTF/Useall.pm.i -data/ext/Font-TTF/lib/Font/TTF/Utils.pm.i -data/ext/Font-TTF/lib/Font/TTF/Vhea.pm.i -data/ext/Font-TTF/lib/Font/TTF/Vmtx.pm.i -data/ext/Font-TTF/lib/Font/TTF/Win32.pm.i -data/ext/Font-TTF/lib/Font/TTF/XMLparse.pm.i -data/ext/Font-TTF/lib/ttfmod.pl.i -data/ext/Font-TTF/t/OFL.txt.i -data/ext/Font-TTF/t/tags.t.i -data/ext/Font-TTF/t/testfont.ttf.i -data/ext/Font-TTF/t/ttfcopy.t.i -data/gen-tests.pl.i -data/list-features.pl.i -data/modify-names.pl.i -data/obfuscate-font.pl.i -data/obfuscate-names.pl.i -data/subset.pl.i -data/t/subsetter.pl.i diff --git a/librarian/font-optimizer/.hg/store/undo b/librarian/font-optimizer/.hg/store/undo deleted file mode 100644 index d1ad357..0000000 Binary files a/librarian/font-optimizer/.hg/store/undo and /dev/null differ diff --git a/librarian/font-optimizer/.hg/tags.cache b/librarian/font-optimizer/.hg/tags.cache deleted file mode 100644 index b27879b..0000000 --- a/librarian/font-optimizer/.hg/tags.cache +++ /dev/null @@ -1,2 +0,0 @@ -28 136826b53242c388267996d1febb0fea90193a06 - diff --git a/librarian/font-optimizer/.hg/undo.branch b/librarian/font-optimizer/.hg/undo.branch deleted file mode 100644 index 331d858..0000000 --- a/librarian/font-optimizer/.hg/undo.branch +++ /dev/null @@ -1 +0,0 @@ -default \ No newline at end of file diff --git a/librarian/font-optimizer/.hg/undo.desc b/librarian/font-optimizer/.hg/undo.desc deleted file mode 100644 index 4f5da8a..0000000 --- a/librarian/font-optimizer/.hg/undo.desc +++ /dev/null @@ -1,3 +0,0 @@ -0 -pull -http://bitbucket.org/philip/font-optimizer diff --git a/librarian/font-optimizer/.hg/undo.dirstate b/librarian/font-optimizer/.hg/undo.dirstate deleted file mode 100644 index e69de29..0000000 diff --git a/librarian/font-optimizer/.hgignore b/librarian/font-optimizer/.hgignore deleted file mode 100644 index 5fe60d8..0000000 --- a/librarian/font-optimizer/.hgignore +++ /dev/null @@ -1,4 +0,0 @@ -~$ -^testoutput/ -^testfonts/ -^tmp/ diff --git a/librarian/font-optimizer/Font/EOTWrapper.pm b/librarian/font-optimizer/Font/EOTWrapper.pm deleted file mode 100644 index 297b930..0000000 --- a/librarian/font-optimizer/Font/EOTWrapper.pm +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright (c) 2009 Philip Taylor -# -# 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. - -package Font::EOTWrapper; - -use strict; -use warnings; - -use Font::TTF::Font; -use Encode; - -use constant TTEMBED_SUBSET => 0x00000001; -use constant TTEMBED_TTCOMPRESSED => 0x00000004; -use constant TTEMBED_XORENCRYPTDATA => 0x10000000; -use constant DEFAULT_CHARSET => 0x01; - -sub convert { - my ($in_fn, $out_fn) = @_; - - my $font_data = do { - open my $fh, $in_fn or die "Failed to open $in_fn: $!"; - binmode $fh; - local $/; - <$fh> - }; - - my $font = Font::TTF::Font->open($in_fn) or die "Failed to open $in_fn: $!"; - - open my $out, '>', $out_fn or die "Failed to open $out_fn: $!"; - binmode $out; - - $font->{name}->read if $font->{name}; - - my $os2 = $font->{'OS/2'}; - $os2->read; - - my $rootString = ''; - - my $header = ''; - $header .= pack V => length($font_data); - $header .= pack V => 0x00020001; - $header .= pack V => TTEMBED_SUBSET; - $header .= pack C10 => map $os2->{$_}, qw(bFamilyType bSerifStyle bWeight bProportion bContrast bStrokeVariation bArmStyle bLetterform bMidline bXheight); - $header .= pack C => DEFAULT_CHARSET; - $header .= pack C => (($os2->{fsSelection} & 1) ? 1 : 0); - $header .= pack V => $os2->{usWeightClass}; - $header .= pack v => $os2->{fsType}; - $header .= pack v => 0x504C; - $header .= pack VVVV => map $os2->{$_}, qw(ulUnicodeRange1 ulUnicodeRange2 ulUnicodeRange3 ulUnicodeRange4); - $header .= pack VV => map $os2->{$_}, qw(ulCodePageRange1 ulCodePageRange2); - $header .= pack V => $font->{head}{checkSumAdjustment}; - $header .= pack VVVV => 0, 0, 0, 0; - $header .= pack v => 0; - $header .= pack 'v/a*' => encode 'utf-16le' => $font->{name}->find_name(1); # family name - $header .= pack v => 0; - $header .= pack 'v/a*' => encode 'utf-16le' => $font->{name}->find_name(2); # style name - $header .= pack v => 0; - $header .= pack 'v/a*' => encode 'utf-16le' => $font->{name}->find_name(5); # version name - $header .= pack v => 0; - $header .= pack 'v/a*' => encode 'utf-16le' => $font->{name}->find_name(4); # full name - $header .= pack v => 0; - $header .= pack 'v/a*' => encode 'utf-16le' => $rootString; - - $out->print(pack V => 4 + length($header) + length($font_data)); - $out->print($header); - $out->print($font_data); - - $font->release; -} - -sub extract { - my ($in_fn, $out_fn) = @_; - - my $eot_data = do { - open my $fh, $in_fn or die "Failed to open $in_fn: $!"; - binmode $fh; - local $/; - <$fh> - }; - - die "Error: EOT too small" if length $eot_data < 16; - - my ($eot_size, $font_data_size, $version, $flags) = unpack VVVV => substr $eot_data, 0, 16; - - die "Error: Invalid EOTSize ($eot_size, should be ".(length $eot_data).")" if $eot_size != length $eot_data; - die "Error: Invalid Version ($version)" if not ($version == 0x00020000 or $version == 0x00020001 or $version == 0x00020002); - die "Error: Can't handle compressed fonts" if $flags & TTEMBED_TTCOMPRESSED; - - # Skip the header fields - my $rest = substr $eot_data, 16+66; - - my ($family_name, $style_name, $version_name, $full_name, $rest2) = unpack 'v/a* xx v/a* xx v/a* xx v/a* a*' => $rest; - - my $font_data; - if ($version == 0x00020000) { # not 0x00010000 - spec is wrong (http://lists.w3.org/Archives/Public/www-font/2009JulSep/0862.html) - $font_data = $rest2; - } elsif ($version == 0x00020001) { - my ($root, $data) = unpack 'xx v/a* a*' => $rest2; - $font_data = $data; - } elsif ($version == 0x00020002) { - my ($root, $root_checksum, $eudc_codepage, $signature, $eudc_flags, $eudc_font, $data) - = unpack 'xx v/a* V V xx v/a* V v/a* a*' => $rest2; - $font_data = $data; - } - - if ($flags & TTEMBED_XORENCRYPTDATA) { - $font_data ^= ("\x50" x length $font_data); - } - - open my $fh, '>', $out_fn or die "Failed to open $out_fn: $!"; - binmode $fh; - print $fh $font_data; -} - -# sub rootStringChecksum { -# my $s = 0; -# $s += $_ for unpack 'C*', $_[0]; -# return $s ^ 0x50475342; -# } - -1; diff --git a/librarian/font-optimizer/Font/Subsetter.pm b/librarian/font-optimizer/Font/Subsetter.pm deleted file mode 100644 index 7aa60dc..0000000 --- a/librarian/font-optimizer/Font/Subsetter.pm +++ /dev/null @@ -1,1606 +0,0 @@ -# Copyright (c) 2009 Philip Taylor -# -# 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. - -package Font::Subsetter; - -use strict; -use warnings; - -use Carp; -use Unicode::Normalize(); -use Digest::SHA qw(sha1_hex); -use Encode; - -use Font::TTF; -use Font::TTF::Font; - -if ($Font::TTF::VERSION =~ /^0\.([0-3].|4[0-5])$/) { - die "You are using an old version of Font::TTF ($Font::TTF::VERSION) - you need at least v0.46, and preferably the latest SVN trunk from ."; -} - -# Tables can be: -# REQUIRED - will fail if it's not present -# FORBIDDEN - will fail if it's present -# OPTIONAL - will be accepted regardless of whether it's there or not -# IGNORED - like OPTIONAL, but no processing will take place -# UNFINISHED - will emit a warning if it's present, because the code doesn't handle it properly yet -# DROP - will be deleted from the font -# The default for unmentioned tables is FORBIDDEN -my %font_tables = ( - 'cmap' => ['REQUIRED'], - 'head' => ['REQUIRED'], - 'hhea' => ['REQUIRED'], - 'hmtx' => ['REQUIRED'], - 'maxp' => ['REQUIRED'], - 'name' => ['REQUIRED'], - 'OS/2' => ['REQUIRED'], - 'post' => ['REQUIRED'], - # TrueType outlines: - 'cvt ' => ['IGNORED'], - 'fpgm' => ['IGNORED'], - 'glyf' => ['IGNORED'], - 'loca' => ['OPTIONAL'], - 'prep' => ['OPTIONAL'], - # PostScript outlines: (TODO: support these?) - 'CFF ' => ['FORBIDDEN'], - 'VORG' => ['FORBIDDEN'], - # Bitmap glyphs: (TODO: support these?) - 'EBDT' => ['DROP', 'embedded bitmap glyphs will be lost'], - 'EBLC' => ['DROP', 'embedded bitmap glyphs will be lost'], - 'EBSC' => ['DROP', 'embedded bitmap glyphs will be lost'], - # Advanced typographic tables: - 'BASE' => ['UNFINISHED'], - 'GDEF' => ['OPTIONAL'], - 'GPOS' => ['OPTIONAL'], - 'GSUB' => ['OPTIONAL'], - 'JSTF' => ['UNFINISHED'], - # OpenType tables: - 'DSIG' => ['DROP'], # digital signature - don't need it here - 'gasp' => ['IGNORED'], - 'hdmx' => ['OPTIONAL'], - 'kern' => ['OPTIONAL'], - 'LTSH' => ['OPTIONAL'], - 'PCLT' => ['UNFINISHED'], - 'VDMX' => ['IGNORED'], - 'vhea' => ['UNFINISHED'], - 'vmtx' => ['UNFINISHED'], - # SIL Graphite tables: - 'Feat' => ['DROP'], - 'Silf' => ['DROP'], - 'Sill' => ['DROP'], - 'Silt' => ['DROP'], - 'Glat' => ['DROP'], - 'Gloc' => ['DROP'], - # FontForge tables: - 'PfEd' => ['DROP'], - 'FFTM' => ['DROP'], - # Apple Advanced Typography tables: - # (These get dropped because it's better to use cross-platform features instead) - 'feat' => ['DROP'], - 'morx' => ['DROP'], - 'prop' => ['DROP'], - # Undocumented(?) extension for some kind of maths stuff - 'MATH' => ['DROP'], -); - -sub check_tables { - my ($self) = @_; - my $font = $self->{font}; - - my @tables = grep /^[^ ]...$/, sort keys %$font; - for (@tables) { - my $t = $font_tables{$_}; - if (not $t) { - die "Uses unrecognised table '$_'\n"; - } else { - my $status = $t->[0]; - if ($status eq 'FORBIDDEN') { - die "Uses forbidden table '$_'\n"; - } elsif ($status eq 'UNFINISHED') { - warn "Uses unhandled table '$_'\n"; - } elsif ($status eq 'DROP') { - my $note = ($t->[1] ? ' - '.$t->[1] : ''); - warn "Dropping table '$_'$note\n"; - delete $font->{$_}; - } elsif ($status eq 'OPTIONAL') { - } elsif ($status eq 'IGNORED') { - } elsif ($status eq 'REQUIRED') { - } else { - die "Invalid table status $status"; - } - } - } - # TODO: check required tables are present - # TODO: check TrueType or PostScript tables are present -} - -sub read_tables { - my ($self) = @_; - my $font = $self->{font}; - - # Read all the tables that will be needed in the future. - # (In particular, read them before modifying numGlyphs, - # beacuse they often depend on that value.) - for (qw( - cmap hmtx name OS/2 post - glyf loca - BASE GDEF GPOS GSUB JSTF - hdmx kern LTSH - )) { - $font->{$_}->read if $font->{$_}; - } -} - -sub find_codepoint_glyph_mappings { - my ($self) = @_; - my $font = $self->{font}; - - # Find the glyph->codepoint mappings - - my %glyphs; - for my $table (@{$font->{cmap}{Tables}}) { - for my $cp (keys %{$table->{val}}) { - - my $ucp; # Unicode code point - - if ($table->{Platform} == 0 # Unicode - or ($table->{Platform} == 3 and # Windows - ($table->{Encoding} == 1 or # Unicode BMP - $table->{Encoding} == 10)) # Unicode full - ) { - $ucp = $cp; - } elsif ($table->{Platform} == 1 # Mac - and $table->{Encoding} == 0) # Roman - { - $ucp = ord(decode('MacRoman', pack C => $cp)); - } else { - # This table might not map directly onto Unicode codepoints, - # so warn about it - warn "Unrecognised cmap table type (platform $table->{Platform}, encoding $table->{Encoding}) - ignoring its character/glyph mappings\n"; - next; - } - - my $g = $table->{val}{$cp}; # glyph id - $glyphs{$g}{$ucp} = 1; - } - } - $self->{glyphs} = \%glyphs; -} - -sub expand_wanted_chars { - my ($self, $chars) = @_; - # OS X browsers (via ATSUI?) appear to convert text into - # NFC before rendering it. - # So input like "i{combining grave}" is converted to "{i grave}" - # before it's even passed to the font's substitution tables. - # So if @chars contains i and {combining grave}, then we have to - # add {i grave} because that might get used. - # - # So... Include all the unchanged characters. Also include the NFC - # of each character. Then use NormalizationData to add any characters - # that can result from NFCing a string of the wanted characters. - - if (0) { # change to 1 to disable all this fancy stuff - my %cs = map { ord $_ => 1 } split '', $chars; - return %cs; - } - - my %cs = map { ord $_ => 1, ord Unicode::Normalize::NFC($_) => 1 } split '', $chars; - require Font::Subsetter::NormalizationData; - my %new_cs; - for my $c (@Font::Subsetter::NormalizationData::data) { - # Skip this if we've already got the composed character - next if $cs{$c->[0]}; - # Skip this if we don't have all the decomposed characters - next if grep !$cs{$_}, @{$c}[1..$#$c]; - # Otherwise we want the composed character - $new_cs{$c->[0]} = 1; - } - $cs{$_} = 1 for keys %new_cs; - return %cs; -} - -sub want_feature { - my ($self, $wanted, $feature) = @_; - # If no feature list was specified, accept all features - return 1 if not $wanted; - # Otherwise find the four-character tag - $feature =~ /^(\w{4})( _\d+)?$/ or die "Unrecognised feature tag syntax '$feature'"; - return $wanted->{$1} if exists $wanted->{$1}; - return $wanted->{DEFAULT} if exists $wanted->{DEFAULT}; - return 1; -} - -sub find_wanted_lookup_ids { - my ($self, $table) = @_; - - # If we wanted to include all lookups: - # return 0..$#{$table->{LOOKUP}}; - # but actually we only want ones used by wanted features - - my %lookups; - for my $feat_tag (@{$table->{FEATURES}{FEAT_TAGS}}) { - next if not $self->want_feature($self->{features}, $feat_tag); - for (@{$table->{FEATURES}{$feat_tag}{LOOKUPS}}) { - $lookups{$_} = 1; - } - } - - # Iteratively add any chained lookups - my $changed = 1; - while ($changed) { - $changed = 0; - for my $lookup_id (0..$#{$table->{LOOKUP}}) { - next unless $lookups{$lookup_id}; - my $lookup = $table->{LOOKUP}[$lookup_id]; - for my $sub (@{$lookup->{SUB}}) { - if ($sub->{ACTION_TYPE} eq 'l') { - for my $rule (@{$sub->{RULES}}) { - for my $chain (@$rule) { - for my $action (@{$chain->{ACTION}}) { - for (0..@$action/2-1) { - # action is array of (offset, lookup) - $changed = 1 if not $lookups{$action->[$_*2+1]}; - $lookups{$action->[$_*2+1]} = 1; - } - } - } - } - } - } - } - } - - my @keys = sort { $a <=> $b } keys %lookups; - return @keys; -} - -sub find_wanted_glyphs { - my ($self, $chars) = @_; - my $font = $self->{font}; - - my %wanted_chars = $self->expand_wanted_chars($chars); - $self->{wanted_glyphs} = {}; - - # http://www.microsoft.com/typography/otspec/recom.htm suggests that fonts - # should include .notdef, .null, CR, space; so include them all here, if they - # are already defined - if ($font->{post}{VAL}) { - for my $gid (0..$#{$font->{loca}{glyphs}}) { - my $name = $font->{post}{VAL}[$gid]; - if ($name and ($name eq '.notdef' or $name eq '.null' or $name eq 'CR' or $name eq 'space')) { - $self->{wanted_glyphs}{$gid} = 1; - } - } - } else { - # If post.FormatType == 3 then we don't have any glyph names - # so just assume it's the first four - $self->{wanted_glyphs}{$_} = 1 for 0..3; - } - - # We want any glyphs used directly by any characters we want - for my $gid (keys %{$self->{glyphs}}) { - for my $cp (keys %{$self->{glyphs}{$gid}}) { - $self->{wanted_glyphs}{$gid} = 1 if $wanted_chars{$cp}; - } - } - - # Iteratively find new glyphs, until convergence - my @newly_wanted_glyphs = keys %{$self->{wanted_glyphs}}; - while (@newly_wanted_glyphs) { - my @new_glyphs; - - if ($font->{GSUB}) { - - # Handle ligatures and similar things - # (e.g. if we want 'f' and 'i', we want the 'fi' ligature too) - # (NOTE: a lot of this code is duplicating the form of - # fix_gsub, so they ought to be kept roughly in sync) - # - # TODO: There's probably loads of bugs in here, so it - # should be checked and tested more - - for my $lookup_id ($self->find_wanted_lookup_ids($font->{GSUB})) { - my $lookup = $font->{GSUB}{LOOKUP}[$lookup_id]; - for my $sub (@{$lookup->{SUB}}) { - - # Handle the glyph-delta case - if ($sub->{ACTION_TYPE} eq 'o') { - my $adj = $sub->{ADJUST}; - if ($adj >= 32768) { $adj -= 65536 } # fix Font::TTF::Bug (http://rt.cpan.org/Ticket/Display.html?id=42727) - my @covs = $self->coverage_array($sub->{COVERAGE}); - for (@covs) { - # If we want the coveraged glyph, we also want - # that glyph plus delta - if ($self->{wanted_glyphs}{$_}) { - my $new = $_ + $adj; - next if $self->{wanted_glyphs}{$new}; - push @new_glyphs, $new; - $self->{wanted_glyphs}{$new} = 1; - } - } - next; - } - - # Collect the rules which might match initially something - my @rulesets; - if ($sub->{RULES}) { - if (($lookup->{TYPE} == 5 or $lookup->{TYPE} == 6) - and $sub->{FORMAT} == 2) { - # RULES corresponds to class values - # TODO: ought to filter this by classes that contain wanted glyphs - push @rulesets, @{$sub->{RULES}}; - } elsif (($lookup->{TYPE} == 5 or $lookup->{TYPE} == 6) - and $sub->{FORMAT} == 3) { - # COVERAGE is empty; accept all the RULEs, and - # we'll look inside their MATCHes later - push @rulesets, @{$sub->{RULES}}; - } else { - # COVERAGE lists glyphs, and there's a RULE for - # each, so extract the RULEs for wanted COVERAGE - # values - my @covs = $self->coverage_array($sub->{COVERAGE}); - die unless @{$sub->{RULES}} == @covs; - for my $i (0..$#covs) { - if ($self->{wanted_glyphs}{$covs[$i]}) { - push @rulesets, $sub->{RULES}[$i]; - } - } - } - } - - # Collect the rules whose MATCH matches - my @rules; - RULE: for my $rule (map @$_, @rulesets) { - if (not defined $sub->{MATCH_TYPE}) { - # No extra matching other than COVERAGE, - # so just accept this rule - } elsif ($sub->{MATCH_TYPE} eq 'g') { - # RULES->MATCH/PRE/POST are arrays of glyphs that must all match - for my $c (qw(MATCH PRE POST)) { - next unless $rule->{$c}; - next RULE if grep { not $self->{wanted_glyphs}{$_} } @{$rule->{$c}}; - } - } elsif ($sub->{MATCH_TYPE} eq 'o') { - # RULES->MATCH/PRE/POST are arrays of coverage tables, - # and at least one glyph from each table must match - die unless @{$sub->{RULES}} == 1; - die unless @{$sub->{RULES}[0]} == 1; - for my $c (qw(MATCH PRE POST)) { - next unless $sub->{RULES}[0][0]{$c}; - for (@{$sub->{RULES}[0][0]{$c}}) { - my $matched = 0; - for (keys %{$_->{val}}) { - if ($self->{wanted_glyphs}{$_}) { - $matched = 1; - last; - } - } - next RULE if not $matched; - } - } - } elsif ($sub->{MATCH_TYPE} eq 'c') { - # TODO: only includes rules using classes that contain - # wanted glyphs. - # For now, just conservatively accept everything. - } else { - die "Invalid MATCH_TYPE"; - } - push @rules, $rule; - } - - # Find the glyphs in the relevant actions - for my $rule (@rules) { - if ($sub->{ACTION_TYPE} eq 'g') { - die unless $rule->{ACTION}; - for my $new (@{$rule->{ACTION}}) { - next if $self->{wanted_glyphs}{$new}; - push @new_glyphs, $new; - $self->{wanted_glyphs}{$new} = 1; -# warn "adding $new"; - } - } elsif ($sub->{ACTION_TYPE} eq 'l') { - # do nothing - this is just a lookup to run some other rules - } elsif ($sub->{ACTION_TYPE} eq 'a') { - # do nothing - we don't want the alternative glyphs - } else { - die "Invalid ACTION_TYPE"; - } - } - } - } - } - - @newly_wanted_glyphs = @new_glyphs; - } - - # Now we want to add glyphs that are used for composite rendering, - # which don't participate in any GSUB behaviour - @newly_wanted_glyphs = keys %{$self->{wanted_glyphs}}; - while (@newly_wanted_glyphs) { - my @new_glyphs; - - if ($font->{loca}) { - # If we want a composite glyph, we want all of its - # component glyphs too - # (e.g. á is the 'a' glyph plus the acute glyph): - for my $gid (@newly_wanted_glyphs) { - my $glyph = $font->{loca}{glyphs}[$gid]; - next unless $glyph; - $glyph->read; - next unless $glyph->{numberOfContours} == -1; - $glyph->read_dat; - for (@{$glyph->{comps}}) { - next if $self->{wanted_glyphs}{$_->{glyph}}; - push @new_glyphs, $_->{glyph}; - $self->{wanted_glyphs}{$_->{glyph}} = 1; - } - $glyph->update; - } - } - - @newly_wanted_glyphs = @new_glyphs; - } -} - -sub update_classdef_table { - my ($self, $table) = @_; - die "Expected table" if not $table; - die "Expected classdef" if $table->{cover}; - my @vals; - for my $gid (keys %{$table->{val}}) { - next if not $self->{wanted_glyphs}{$gid}; - my $v = $table->{val}{$gid}; - push @vals, $self->{glyph_id_old_to_new}{$gid}, $v; - } - my $ret = new Font::TTF::Coverage(0, @vals); - # Font::TTF bug (http://rt.cpan.org/Ticket/Display.html?id=42716): - # 'max' is not set by new(), so do it manually: - my $max = 0; - for (values %{$ret->{val}}) { $max = $_ if $_ > $max } - $ret->{max} = $max; - return $ret; -} - -# Returns a map such that map[old_class_value] = new_class_value -# (or undef if the class is removed) -# This differs from update_classdef_table in that it can -# reorder and optimise the class ids -sub update_mapped_classdef_table { - my ($self, $table) = @_; - die "Expected table" if not $table; - die "Expected classdef" if $table->{cover}; - my @vals; - my %used_classes; - $used_classes{0} = 1; # 0 is implicitly in every classdef - for my $gid (keys %{$table->{val}}) { - next if not $self->{wanted_glyphs}{$gid}; - my $v = $table->{val}{$gid}; - push @vals, $self->{glyph_id_old_to_new}{$gid}, $v; - $used_classes{$v} = 1; - } - - my @map_new_to_old = sort { $a <=> $b } keys %used_classes; - my @map_old_to_new; - $map_old_to_new[$map_new_to_old[$_]] = $_ for 0..$#map_new_to_old; - - # Update the class numbers - for (0..@vals/2-1) { - $vals[$_*2+1] = $map_old_to_new[$vals[$_*2+1]]; - } - - my $ret = new Font::TTF::Coverage(0, @vals); - # Font::TTF bug (http://rt.cpan.org/Ticket/Display.html?id=42716): - # 'max' is not set by new(), so do it manually: - my $max = 0; - for (values %{$ret->{val}}) { $max = $_ if $_ > $max } - $ret->{max} = $max; - return ($ret, \@map_old_to_new, \@map_new_to_old); -} - -# Removes unwanted glyphs from a coverage table, for -# cases where nobody else is referring to indexes in this table -sub update_coverage_table { - my ($self, $table) = @_; - die "Expected table" if not $table; - die "Expected cover" if not $table->{cover}; - my @vals = keys %{$table->{val}}; - @vals = grep $self->{wanted_glyphs}{$_}, @vals; - @vals = sort { $a <=> $b } @vals; - @vals = map $self->{glyph_id_old_to_new}{$_}, @vals; - return new Font::TTF::Coverage(1, @vals); -} - -# Returns a map such that map[new_coverage_index] = old_coverage_index -sub update_mapped_coverage_table { - my ($self, $table) = @_; - die "Expected table" if not $table; - die "Expected coverage" if not $table->{cover}; - - my @map; - my @new_vals; - # Get the covered values (in order) - my @vals = $self->coverage_array($table); - for my $i (0..$#vals) { - # Create a new list of all the wanted values - if ($self->{wanted_glyphs}{$vals[$i]}) { - push @new_vals, $self->{glyph_id_old_to_new}{$vals[$i]}; - push @map, $i; - } - } - return (new Font::TTF::Coverage(1, @new_vals), @map); -} - -sub coverage_array { - my ($self, $table) = @_; - Carp::confess "Expected table" if not $table; - return sort { $table->{val}{$a} <=> $table->{val}{$b} } keys %{$table->{val}}; -} - -sub empty_coverage { - my ($self, $table) = @_; - Carp::confess "Expected table" if not $table; - return 1 if not $table->{val}; - return 1 if not keys %{$table->{val}}; - return 0; -} - -# Update the loca table to delete unwanted glyphs. -# Must be called before all the other fix_* methods. -sub remove_unwanted_glyphs { - my ($self) = @_; - my $font = $self->{font}; - - return unless $font->{loca}; - - my %glyph_id_old_to_new; - my %glyph_id_new_to_old; - - my $glyphs = $font->{loca}{glyphs}; - my @new_glyphs; - for my $i (0..$#$glyphs) { - if ($self->{wanted_glyphs}{$i}) { - push @new_glyphs, $glyphs->[$i]; - $glyph_id_old_to_new{$i} = $#new_glyphs; - $glyph_id_new_to_old{$#new_glyphs} = $i; - } - } - $font->{loca}{glyphs} = \@new_glyphs; - $font->{maxp}{numGlyphs} = scalar @new_glyphs; - - $self->{glyph_id_old_to_new} = \%glyph_id_old_to_new; - $self->{glyph_id_new_to_old} = \%glyph_id_new_to_old; -} - - -# Only the platform=3 encoding=1 cmap is really needed -# (for Windows, OS X, Linux), so save space (and potentially -# enhance cross-platformness) by stripping out all the others. -# (But keep platform=3 encoding=10 too, for UCS-4 characters.) -# (And Opera 10 on OS X wants one with platform=0 too.) -sub strip_cmap { - my ($self) = @_; - my $font = $self->{font}; - - if (not grep { $_->{Platform} == 3 and $_->{Encoding} == 1 } @{$font->{cmap}{Tables}}) { - warn "No cmap found with platform=3 encoding=1 - the font is likely to not work on Windows.\n"; - # Stop now, instead of stripping out all of the cmap tables - return; - } - - my @matched_tables = grep { - ($_->{Platform} == 3 and ($_->{Encoding} == 1 || $_->{Encoding} == 10)) - or ($_->{Platform} == 0) - } @{$font->{cmap}{Tables}}; - - $font->{cmap}{Tables} = \@matched_tables; -} - -# Only the platform=3 encoding=1 names are really needed -# (for Windows, OS X, Linux), so save space (and potentially -# enhance cross-platformness) by stripping out all the others. -sub strip_name { - my ($self) = @_; - my $font = $self->{font}; - - for my $id (0..$#{$font->{name}{strings}}) { - my $str = $font->{name}{strings}[$id]; - next if not $str; - my $plat = 3; - my $enc = 1; - my $langs = $str->[$plat][$enc]; - if (not $langs) { - warn "No name found with id=$id with platform=3 encoding=1 - the font is likely to not work on Windows.\n" - unless $id == 18; # warn except for some Mac-specific names - return; - } - $font->{name}{strings}[$id] = []; - $font->{name}{strings}[$id][$plat][$enc] = $langs; - # NOTE: this keeps all the languages for each string, which is - # potentially wasteful if there are lots (but in practice most fonts - # seem to only have English) - } -} - -sub fix_cmap { - my ($self) = @_; - my $font = $self->{font}; - - # Delete mappings for unwanted glyphs - - for my $table (@{$font->{cmap}{Tables}}) { - # (Already warned about unrecognised table types - # in find_codepoint_glyph_mappings) - my %new_vals; - for my $cp (keys %{$table->{val}}) { - my $gid = $table->{val}{$cp}; - if ($self->{wanted_glyphs}{$gid}) { - $new_vals{$cp} = $self->{glyph_id_old_to_new}{$gid}; - } - } - $table->{val} = \%new_vals; - if ($table->{Format} == 0) { - @{$table->{val}}{0..255} = map { defined($_) ? $_ : 0 } @{$table->{val}}{0..255}; - } - } -} - -sub fix_head { - # TODO: Should think about: - # created - # modified - # xMin (depends on glyph data) - # yMin (depends on glyph data) - # xMax (depends on glyph data) - # yMax (depends on glyph data) -} - -sub fix_hhea { - # TODO: Should think about: - # advanceWidthMax (depends on hmtx) - # minLeftSideBearing (depends on hmtx) - # minRightSideBearing (depends on hmtx) - # xMaxExtent (depends on hmtx) -} - -sub fix_hmtx { - my ($self) = @_; - my $font = $self->{font}; - - # Map the advance/lsb arrays from old to new glyph ids - my @new_advances; - my @new_lsbs; - for my $gid (0..$font->{maxp}{numGlyphs}-1) { - push @new_advances, $font->{hmtx}{advance}[$self->{glyph_id_new_to_old}{$gid}]; - push @new_lsbs, $font->{hmtx}{lsb}[$self->{glyph_id_new_to_old}{$gid}]; - } - $font->{hmtx}{advance} = \@new_advances; - $font->{hmtx}{lsb} = \@new_lsbs; -} - -sub fix_maxp { # Must come after loca, prep, fpgm - my ($self) = @_; - my $font = $self->{font}; - - # Update some of the 'max' values that Font::TTF - # is capable of updating - $font->{maxp}->update; -} - -sub fix_os_2 { # Must come after cmap, hmtx, hhea, GPOS, GSUB - my ($self) = @_; - my $font = $self->{font}; - - # Update some of the metric values that Font::TTF - # is capable of updating - $font->{'OS/2'}->update; - - if ($font->{'OS/2'}{Version} >= 2) { - # TODO: handle cases where these are non-default - warn "Unexpected defaultChar $font->{'OS/2'}{defaultChar}\n" - unless $font->{'OS/2'}{defaultChar} == 0; - warn "Unexpected breakChar $font->{'OS/2'}{breakChar}\n" - unless $font->{'OS/2'}{breakChar} == 0x20; - } -} - -sub fix_post { - my ($self) = @_; - my $font = $self->{font}; - - if ($font->{post}{FormatType} == 0) { - warn "Invalid 'post' table type. (If you're using the obfuscate-font.pl script, make sure it comes *after* the subsetting.)\n"; - } - - # Update PostScript name mappings for new glyph ids - if ($font->{post}{VAL}) { - my @new_vals; - for my $gid (0..$font->{maxp}{numGlyphs}-1) { - push @new_vals, $font->{post}{VAL}[$self->{glyph_id_new_to_old}{$gid}]; - } - $font->{post}{VAL} = \@new_vals; - } -} - - - - -sub fix_loca { - my ($self) = @_; - my $font = $self->{font}; - - # remove_unwanted_glyphs has already removed some - # of the glyph data from this table - - # Update references inside composite glyphs - for my $glyph (@{$font->{loca}{glyphs}}) { - next unless $glyph; - $glyph->read; - next unless $glyph->{numberOfContours} == -1; - $glyph->read_dat; - for (@{$glyph->{comps}}) { - # (find_unwanted_glyphs guarantees that the - # component glyphs will be present) - $_->{glyph} = $self->{glyph_id_old_to_new}{$_->{glyph}}; - } - } -} - - - -sub fix_gdef { - my ($self) = @_; - my $font = $self->{font}; - - if ($font->{GDEF}{GLYPH}) { - $font->{GDEF}{GLYPH} = $self->update_classdef_table($font->{GDEF}{GLYPH}); - if ($self->empty_coverage($font->{GDEF}{GLYPH})) { - delete $font->{GDEF}{GLYPH}; - } - } - - if ($font->{GDEF}{MARKS}) { - $font->{GDEF}{MARKS} = $self->update_classdef_table($font->{GDEF}{MARKS}); - if ($self->empty_coverage($font->{GDEF}{MARKS})) { - delete $font->{GDEF}{MARKS}; - } - } - - if ($font->{GDEF}{ATTACH}) { - die "TODO" if $font->{GDEF}{ATTACH}{POINTS}; - $font->{GDEF}{ATTACH}{COVERAGE} = $self->update_coverage_table($font->{GDEF}{ATTACH}{COVERAGE}); - if ($self->empty_coverage($font->{GDEF}{ATTACH}{COVERAGE})) { - delete $font->{GDEF}{ATTACH}; - } - } - - if ($font->{GDEF}{LIG}) { - - if ($font->{GDEF}{LIG}{LIGS}) { - die "GDEF LIG LIGS != COVERAGE" if - @{$font->{GDEF}{LIG}{LIGS}} != keys %{$font->{GDEF}{LIG}{COVERAGE}{val}}; - - my @coverage_map; - ($font->{GDEF}{LIG}{COVERAGE}, @coverage_map) = $self->update_mapped_coverage_table($font->{GDEF}{LIG}{COVERAGE}); - $font->{GDEF}{LIG}{LIGS} = [ map $font->{GDEF}{LIG}{LIGS}[$_], @coverage_map ]; - - } else { - $font->{GDEF}{LIG}{COVERAGE} = $self->update_coverage_table($font->{GDEF}{LIG}{COVERAGE}); - } - - if ($self->empty_coverage($font->{GDEF}{LIG}{COVERAGE})) { - delete $font->{GDEF}{LIG}; - } - } - -} - -sub fix_ttopen { - my ($self, $table, $inner) = @_; - - my @lookups; - my %lookup_map; - for my $lookup_id ($self->find_wanted_lookup_ids($table)) { - my $lookup = $table->{LOOKUP}[$lookup_id]; - my @subtables; - for my $sub (@{$lookup->{SUB}}) { - if ($inner->($lookup, $sub)) { - push @subtables, $sub; - } - } - - # Only keep lookups that have some subtables - if (@subtables) { - $lookup->{SUB} = \@subtables; - push @lookups, $lookup; - $lookup_map{$lookup_id} = $#lookups; - } - } - - $table->{LOOKUP} = \@lookups; - - # Update lookup references inside actions - for my $lookup (@{$table->{LOOKUP}}) { - for my $sub (@{$lookup->{SUB}}) { - if ($sub->{ACTION_TYPE} eq 'l') { - for my $rule (@{$sub->{RULES}}) { - for my $chain (@$rule) { - my @actions; - for my $action (@{$chain->{ACTION}}) { - my @steps; - for (0..@$action/2-1) { - # action is array of (offset, lookup) - # so just update the lookup - if (exists $lookup_map{$action->[$_*2+1]}) { - push @steps, ($action->[$_*2], $lookup_map{$action->[$_*2+1]}); - } - } - push @actions, \@steps; - } - $chain->{ACTION} = \@actions; - } - } - } - } - } - - # Remove all features that are not wanted - # and update all references to those features (in the languages list), - # and update the features' lookup references - - my @features; # array of [tag, feature] - my %kept_features; - for my $feat_tag (@{$table->{FEATURES}{FEAT_TAGS}}) { - next unless $self->want_feature($self->{features}, $feat_tag); # drop unwanted features - my $feat = $table->{FEATURES}{$feat_tag}; - $feat->{LOOKUPS} = [ map { exists $lookup_map{$_} ? ($lookup_map{$_}) : () } @{$feat->{LOOKUPS}} ]; - next unless @{$feat->{LOOKUPS}}; # drop empty features to save some space - push @features, [ $feat_tag, $feat ]; - $kept_features{$feat_tag} = 1; - } - - $table->{FEATURES} = { - FEAT_TAGS => [map $_->[0], @features], - map +($_->[0] => $_->[1]), @features, - }; - - # Remove any references from scripts to features that no longer exist - for my $script_tag (keys %{$table->{SCRIPTS}}) { - my $script = $table->{SCRIPTS}{$script_tag}; - for my $tag ('DEFAULT', @{$script->{LANG_TAGS}}) { - next if $script->{$tag}{' REFTAG'}; # ignore langs that are just copies of another - $script->{$tag}{FEATURES} = [ - grep $kept_features{$_}, @{$script->{$tag}{FEATURES}} - ]; - - } - } - - # TODO: it'd be nice to delete languages that have no features - -} - -sub fix_gpos { - my ($self) = @_; - my $font = $self->{font}; - - $self->fix_ttopen($font->{GPOS}, - sub { - my ($lookup, $sub) = @_; - - # There's always a COVERAGE here first. - # (If it's empty, the client will skip the entire subtable, - # so we could delete it entirely, but that would involve updating - # the FEATURES->*->LOOKUPS lists too, so don't do that yet.) - # - # The rest depends on Type: - # - # Lookup Type 1 (Single Adjustment Positioning Subtable): - # Format 1: Just COVERAGE, applies same value to all - # Format 2: Just COVERAGE, RULES[n] gives value for each - # - # Lookup Type 2 (Pair Adjustment Positioning Subtable): - # Format 1: COVERAGE gives first glyph, RULES[n][m]{MATCH}[0] gives second glyph - # Format 2: COVERAGE gives first glyph, CLASS gives first glyph class, MATCH[0] gives second glyph class - # - # Lookup Type 3 (Cursive Attachment Positioning Subtable): - # Format 1: Just COVERAGE, RULES[n] gives value for each - # - # Lookup Type 4 (MarkToBase Attachment Positioning Subtable): - # Format 1: MATCH[0] gives mark coverage, COVERAGE gives base coverage, MARKS[n] per mark, RULES[n] per base - # - # Lookup Type 5 (MarkToLigature Attachment Positioning Subtable): - # Format 1: pretty much the same as 4, but s/base/ligature/ - # - # Lookup Type 6 (MarkToMark Attachment Positioning Subtable): - # Format 1: pretty much the same as 4, but s/base/mark/ - # - # Lookup Type 7 (Contextual Positioning Subtables): - # Format 1: COVERAGE gives first glyph, RULES[n][m]{MATCH}[o] gives next glyphs - # Format 2: COVERAGE gives first glyph, CLASS gives classes to glyphs, RULES[n] is per class - # Format 3: COVERAGE absent, RULES[0][0]{MATCH}[o] gives glyph coverages - # - # Lookup Type 8 (Chaining Contextual Positioning Subtable): - # Format 1: COVERAGE gives first glyph, RULES[n][m]{PRE/MATCH/POST} give context glyphs - # Format 2: COVERAGE gives first glyph, PRE_CLASS/CLASS/POST_CLASS give classes - # Format 3: COVERAGE absent, RULES[0][0]{PRE/MATCH/POST}[o] give coverages - # - # Lookup Type 9 (Extension Positioning): - # Not supported - - die if $lookup->{TYPE} >= 9; - - # Update the COVERAGE table, and remember some mapping - # information to update things that refer to the table - my @coverage_map; - my $old_coverage_count; - if ($sub->{COVERAGE}) { - $old_coverage_count = scalar keys %{$sub->{COVERAGE}{val}}; - ($sub->{COVERAGE}, @coverage_map) = $self->update_mapped_coverage_table($sub->{COVERAGE}); - - # If there's no coverage left, then drop this subtable - return 0 if $self->empty_coverage($sub->{COVERAGE}); - } - - if ($sub->{RULES} and $sub->{COVERAGE} and not - # Skip cases where RULES is indexed by CLASS, not COVERAGE - (($lookup->{TYPE} == 2 or - $lookup->{TYPE} == 7 or - $lookup->{TYPE} == 8) - and $sub->{FORMAT} == 2) - ) { - # There's a RULES array per COVERAGE entry, so - # shuffle them around to match the new COVERAGE - if (@{$sub->{RULES}} != $old_coverage_count) { - die "Internal error: RULES ($sub->{RULES}) does not match COVERAGE ($sub->{COVERAGE}) -- " - . @{$sub->{RULES}} . " vs $old_coverage_count."; - } - $sub->{RULES} = [ map $sub->{RULES}[$_], @coverage_map ]; - } - - if (not defined $sub->{MATCH_TYPE} or $sub->{MATCH_TYPE} eq 'g') { - if ($sub->{MATCH}) { - die unless @{$sub->{MATCH}} == 1; - die unless $sub->{MARKS}; - die unless @{$sub->{MARKS}} == keys %{$sub->{MATCH}[0]{val}}; - my @match_map; - ($sub->{MATCH}[0], @match_map) = $self->update_mapped_coverage_table($sub->{MATCH}[0]); - - # If there's no coverage left, then drop this subtable - return 0 if $self->empty_coverage($sub->{MATCH}[0]); - - # Update MARKS to correspond to the new MATCH coverage - $sub->{MARKS} = [ map $sub->{MARKS}[$_], @match_map ]; - } - - # RULES->MATCH is an array of glyphs, so translate them all - for (@{$sub->{RULES}}) { - for (@$_) { - $_->{MATCH} = [ map $self->{glyph_id_old_to_new}{$_}, - grep $self->{wanted_glyphs}{$_}, @{$_->{MATCH}} ]; - } - } - } elsif ($sub->{MATCH_TYPE}) { - if ($sub->{MATCH_TYPE} eq 'o') { - # RULES->MATCH/PRE/POST are arrays of coverage tables, so translate them all - die unless @{$sub->{RULES}} == 1; - die unless @{$sub->{RULES}[0]} == 1; - my $r = $sub->{RULES}[0][0]; - for my $c (qw(MATCH PRE POST)) { - $r->{$c} = [ map $self->update_coverage_table($_), @{$r->{$c}} ] if $r->{$c}; - } - } elsif ($sub->{MATCH_TYPE} eq 'c') { - die "Didn't expect any rule matches" if grep $_->{MATCH}, map @$_, @{$sub->{RULES}}; - die unless @{$sub->{MATCH}} == 1; - - my $class_map; - ($sub->{CLASS}, undef, $class_map) = $self->update_mapped_classdef_table($sub->{CLASS}); - # Special case: If this results in an empty CLASS, it'll - # break in FF3.5 on Linux, so assign all the COVERAGE glyphs onto - # class 1 and update $class_map appropriately - if ($sub->{CLASS}{max} == 0) { - $sub->{CLASS} = new Font::TTF::Coverage(0, map +($_ => 1), keys %{$sub->{COVERAGE}{val}}); - $class_map = [0, 0]; # just duplicate class 0 into class 1 (this is a bit inefficient) - } - - $sub->{RULES} = [ @{$sub->{RULES}}[@$class_map] ]; - - # Update the MATCH classdef table - my $match_map; - ($sub->{MATCH}[0], undef, $match_map) = $self->update_mapped_classdef_table($sub->{MATCH}[0]); - - # If the MATCH table is now empty, drop this lookup - # (else FF3.5 on Linux drops the GPOS table entirely) - return 0 if @$match_map <= 1; - - # RULES[n] is a list of substitutions per MATCH class, so - # update all those lists for the new classdef - $sub->{RULES} = [ map { [ @{$_}[@$match_map] ] } @{$sub->{RULES}} ]; - - } else { - die "Invalid MATCH_TYPE"; - } - } - - if (($lookup->{TYPE} == 7 or - $lookup->{TYPE} == 8) - and $sub->{FORMAT} == 2) { - # Update some class tables - for my $c (qw(CLASS PRE_CLASS POST_CLASS)) { - $sub->{$c} = $self->update_classdef_table($sub->{$c}) if $sub->{$c}; - } - } - - return 1; - } - ); -} - -sub fix_gsub { - my ($self) = @_; - my $font = $self->{font}; - - $self->fix_ttopen($font->{GSUB}, - sub { - my ($lookup, $sub) = @_; - - # There's always a COVERAGE here first. - # (If it's empty, the client will skip the entire subtable, - # so we could delete it entirely, but that would involve updating - # the FEATURES->*->LOOKUPS lists and Contextual subtable indexes - # too, so don't do that yet.) - # - # The rest depends on Type: - # - # Lookup Type 1 (Single Substitution Subtable): - # Format 1: Just COVERAGE, and ADJUST gives glyph id delta - # Format 2: Just COVERAGE, then RULES[n]{ACTION}[0] gives replacement glyph for each - # - # Lookup Type 2 (Multiple Substitution Subtable): - # Format 1: Just COVERAGE, then RULES[n]{ACTION} gives replacement glyphs (must be at least 1) - # - # Lookup Type 3 (Alternate Substitution Subtable): - # Format 1: Just COVERAGE, then RULES[n]{ACTION} gives alternate glyphs - # [This can just be deleted since we have no way to use those glyphs] - # - # Lookup Type 4 (Ligature Substitution Subtable): - # Format 1: COVERAGE gives first glyph, RULES[n]{MATCH}[m] gives next glyphs to match, RULES[n]{ACTION}[0] gives replacement glyph - # - # Lookup Type 5 (Contextual Substitution Subtable): - # Format *: like type 7 in GPOS, but ACTION gives indexes into GSUB{LOOKUP} - # - # Lookup Type 6 (Chaining Contextual Substitution Subtable): - # Format *: like type 8 in GPOS, but ACTION gives indexes into GSUB{LOOKUP} - # - # Lookup Type 7 (Extension Substitution): - # Blah - - die if $lookup->{TYPE} >= 7; - - # Update the COVERAGE table, and remember some mapping - # information to update things that refer to the table - my @coverage_map; - my $old_coverage_count; - if ($sub->{COVERAGE}) { - $old_coverage_count = scalar keys %{$sub->{COVERAGE}{val}}; - ($sub->{COVERAGE}, @coverage_map) = $self->update_mapped_coverage_table($sub->{COVERAGE}); - - # If there's no coverage left, then drop this subtable - return 0 if $self->empty_coverage($sub->{COVERAGE}); - } - - if ($sub->{ACTION_TYPE} eq 'o') {; - my $adj = $sub->{ADJUST}; - if ($adj >= 32768) { $adj -= 65536 } # fix Font::TTF::Bug (http://rt.cpan.org/Ticket/Display.html?id=42727) - my @covs = $self->coverage_array($sub->{COVERAGE}); - if (@covs == 0) { - # Nothing's covered, but deleting this whole subtable is - # non-trivial so just zero it out - $sub->{ADJUST} = 0; - } elsif (@covs == 1) { - my $gid_base = $covs[0]; - my $old_gid_base = $self->{glyph_id_new_to_old}{$gid_base}; - my $old_gid = $old_gid_base + $adj; - $sub->{ADJUST} = $self->{glyph_id_old_to_new}{$old_gid} - $gid_base; - } else { - # The glyphs are probably all reordered, so we can't just - # adjust ADJUST. - # So switch this to a format 2 table: - $sub->{FORMAT} = 2; - $sub->{ACTION_TYPE} = 'g'; - delete $sub->{ADJUST}; - my @gids; - for (@covs) { - push @gids, $self->{glyph_id_old_to_new}{$self->{glyph_id_new_to_old}{$_} + $adj}; - } - $sub->{RULES} = [ map [{ACTION => [$_]}], @gids ]; - } - # Stop and keep this table, since done everything that's needed - return 1; - } - die if $sub->{ADJUST}; - - if ($sub->{RULES} and not - # Skip cases where RULES is indexed by CLASS, not COVERAGE, - # and cases where there's no COVERAGE at all - (($lookup->{TYPE} == 5 or $lookup->{TYPE} == 6) - and ($sub->{FORMAT} == 2 or $sub->{FORMAT} == 3)) - ) { - # There's a RULES array per COVERAGE entry, so - # shuffle them around to match the new COVERAGE - die unless @{$sub->{RULES}} == $old_coverage_count; - $sub->{RULES} = [ map $sub->{RULES}[$_], @coverage_map ]; - } - - # TODO: refactor - if ($sub->{MATCH_TYPE}) { - # Fix all the glyph indexes - if ($sub->{MATCH_TYPE} eq 'g') { - # RULES->MATCH/PRE/POST are arrays of glyphs, so translate them all, - # and if they rely on any unwanted glyphs then drop the rule entirely - for my $i (0..$#{$sub->{RULES}}) { - my $ruleset = $sub->{RULES}[$i]; - my @rules; - RULE: for my $rule (@$ruleset) { - for my $c (qw(MATCH PRE POST)) { - next unless $rule->{$c}; - next RULE if grep { not $self->{wanted_glyphs}{$_} } @{$rule->{$c}}; - $rule->{$c} = [ map $self->{glyph_id_old_to_new}{$_}, @{$rule->{$c}} ] - } - push @rules, $rule; - } - if (not @rules) { - # XXX: This is a really horrid hack. - # The proper solution is to delete the ruleset, - # and adjust COVERAGE to match. - push @rules, { ACTION => [0], MATCH => [-1] }; - } - $sub->{RULES}[$i] = \@rules; - } - } elsif ($sub->{MATCH_TYPE} eq 'o') { - # RULES->MATCH/PRE/POST are arrays of coverage tables, so translate them all - die unless @{$sub->{RULES}} == 1; - die unless @{$sub->{RULES}[0]} == 1; - my $r = $sub->{RULES}[0][0]; - for my $c (qw(MATCH PRE POST)) { - $r->{$c} = [ map $self->update_coverage_table($_), @{$r->{$c}} ] if $r->{$c}; - } - } elsif ($sub->{MATCH_TYPE} eq 'c') { - # RULES refers to class values, which haven't changed at all, - # so we don't need to update those values - } else { - die "Invalid MATCH_TYPE"; - } - } - - my %class_maps; - for my $c (qw(CLASS PRE_CLASS POST_CLASS)) { - ($sub->{$c}, $class_maps{$c}) = $self->update_mapped_classdef_table($sub->{$c}) if $sub->{$c}; - } - - - if ($sub->{MATCH_TYPE} and $sub->{MATCH_TYPE} eq 'c') { - # To make things work in Pango, we need to change all the - # class numbers so there aren't gaps: - my %classes = ( - MATCH => 'CLASS', - PRE => 'PRE_CLASS', - POST => 'POST_CLASS', - ); - my @rules; - for my $rule (@{$sub->{RULES}}) { - my @chains; - CHAIN: for my $chain (@$rule) { - for my $c (qw(MATCH PRE POST)) { - next unless $chain->{$c}; - my $map = $class_maps{$classes{$c}} or die "Got a $c but no $classes{$c}"; - # If any of the values are for a class that no longer has - # any entries, we should drop this whole chain because - # there's no chance it's going to match - next CHAIN if grep { not defined $map->[$_] } @{$chain->{$c}}; - # Otherwise just update the class numbers - $chain->{$c} = [ map $map->[$_], @{$chain->{$c}} ]; - } - push @chains, $chain; - } - push @rules, \@chains; - } - $sub->{RULES} = \@rules; - # If all the rules are empty, drop this whole subtable (which maybe is - # needed to avoid https://bugzilla.mozilla.org/show_bug.cgi?id=475242 ?) - return 0 if not grep @$_, @{$sub->{RULES}}; - } - - if ($sub->{ACTION_TYPE}) { - if ($sub->{ACTION_TYPE} eq 'g') { - for (@{$sub->{RULES}}) { - for (@$_) { - $_->{ACTION} = [ map $self->{glyph_id_old_to_new}{$_}, - grep $self->{wanted_glyphs}{$_}, @{$_->{ACTION}} ]; - } - } - } elsif ($sub->{ACTION_TYPE} eq 'l') { - # nothing to change here - } elsif ($sub->{ACTION_TYPE} eq 'a') { - # We don't want to bother with alternate glyphs at all, - # so just delete everything. - # (We need to have empty rules, and can't just delete them - # entirely, else FontTools becomes unhappy.) - # (TODO: Maybe we do want alternate glyphs? - # If so, be sure to update find_wanted_glyphs too) - for (@{$sub->{RULES}}) { - for (@$_) { - $_->{ACTION} = []; - } - } - } elsif ($sub->{ACTION_TYPE} eq 'o') { - die "Should have handled ACTION_TYPE o earlier"; - } else { - die "Invalid ACTION_TYPE"; - } - } - - return 1; - } - ); -} - -# Fold certain GSUB features into the cmap table -sub fold_gsub { - my ($self, $features) = @_; - - my $font = $self->{font}; - my $table = $font->{GSUB}; - - # Find the lookup IDs corresponding to the desired features - - my %wanted = (DEFAULT => 0); - $wanted{$_} = 1 for @$features; - - my %lookups; - for my $feat_tag (@{$table->{FEATURES}{FEAT_TAGS}}) { - next if not $self->want_feature(\%wanted, $feat_tag); - for (@{$table->{FEATURES}{$feat_tag}{LOOKUPS}}) { - $lookups{$_} = $feat_tag; - } - } - - # Find the glyph mapping from those lookups - - my %glyph_map; # (old glyph id => new glyph id) - - for my $lookup_id (0..$#{$table->{LOOKUP}}) { - next unless exists $lookups{$lookup_id}; - my $lookup = $table->{LOOKUP}[$lookup_id]; - if ($lookup->{TYPE} != 1) { - warn "GSUB lookup $lookup_id (from feature '$lookups{$lookup_id}') is not a 'single' type lookup (type=$lookup->{TYPE}), and cannot be applied.\n"; - next; - } - - # For each glyph, only the first substitution per lookup is applied, - # so we build a map of the firsts for this lookup (then fold it into - # the global map later) - my %lookup_glyph_map; - - for my $sub (@{$lookup->{SUB}}) { - my @covs = $self->coverage_array($sub->{COVERAGE}); - if ($sub->{ACTION_TYPE} eq 'o') { - my $adj = $sub->{ADJUST}; - if ($adj >= 32768) { $adj -= 65536 } # fix Font::TTF::Bug (http://rt.cpan.org/Ticket/Display.html?id=42727) - for my $i (0..$#covs) { - my $old = $covs[$i]; - my $new = $old + $adj; - $lookup_glyph_map{$old} = $new if not exists $lookup_glyph_map{$old}; - } - } elsif ($sub->{ACTION_TYPE} eq 'g') { - next if @covs == 0 and not $sub->{RULES}; - die unless @{$sub->{RULES}} == @covs; - for my $i (0..$#covs) { - my $old = $covs[$i]; - die unless @{$sub->{RULES}[$i]} == 1; - die unless @{$sub->{RULES}[$i][0]{ACTION}} == 1; - my $new = $sub->{RULES}[$i][0]{ACTION}[0]; - $lookup_glyph_map{$old} = $new; - } - } else { - die "Invalid ACTION_TYPE $sub->{ACTION_TYPE}"; - } - } - - # Fold the lookup's glyph map into the global glyph map - for my $gid (keys %lookup_glyph_map) { - # Add any new substitutions - $glyph_map{$gid} = $lookup_glyph_map{$gid} if not exists $glyph_map{$gid}; - } - for my $gid (keys %glyph_map) { - # Handle chained substitutions - $glyph_map{$gid} = $lookup_glyph_map{$glyph_map{$gid}} if exists $lookup_glyph_map{$glyph_map{$gid}}; - } - } - - # Apply the glyph mapping to cmap - - for my $table (@{$font->{cmap}{Tables}}) { - for my $cp (keys %{$table->{val}}) { - my $gid = $table->{val}{$cp}; - $table->{val}{$cp} = $glyph_map{$gid} if exists $glyph_map{$gid}; - } - } -} - -sub fix_hdmx { - my ($self) = @_; - my $font = $self->{font}; - - for my $ppem (grep /^\d+$/, keys %{$font->{hdmx}}) { - my @new_widths; - for my $gid (0..$font->{maxp}{numGlyphs}-1) { - push @new_widths, $font->{hdmx}{$ppem}[$self->{glyph_id_new_to_old}{$gid}]; - } - $font->{hdmx}{$ppem} = \@new_widths; - } -} - -sub fix_kern { - my ($self) = @_; - my $font = $self->{font}; - - # We don't handle version 1 kern tables yet, so just drop them entirely. - # http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6kern.html - # https://bugzilla.mozilla.org/show_bug.cgi?id=487549 - if ($font->{kern}{Version} != 0) { - warn "Unhandled kern table version $font->{kern}{Version} - deleting all kerning data\n"; - delete $font->{kern}; - return; - } - - for my $table (@{$font->{kern}{tables}}) { - if ($table->{type} == 0) { - my %kern; - for my $l (keys %{$table->{kern}}) { - next unless $self->{wanted_glyphs}{$l}; - for my $r (keys %{$table->{kern}{$l}}) { - next unless $self->{wanted_glyphs}{$r}; - $kern{$self->{glyph_id_old_to_new}{$l}}{$self->{glyph_id_old_to_new}{$r}} = $table->{kern}{$l}{$r}; - } - } - $table->{kern} = \%kern; - } elsif ($table->{type} == 2) { - die "kern table type 2 not supported yet"; - } else { - die "Invalid kern table type"; - } - } -} - -sub fix_ltsh { - my ($self) = @_; - my $font = $self->{font}; - - my @glyphs; - for my $gid (0..$font->{maxp}{numGlyphs}-1) { - push @glyphs, $font->{LTSH}{glyphs}[$self->{glyph_id_new_to_old}{$gid}]; - } - $font->{LTSH}{glyphs} = \@glyphs; -} - -sub delete_copyright { - my ($self) = @_; - my $font = $self->{font}; - # XXX - shouldn't be deleting copyright text - $font->{name}{strings}[0] = undef; - $font->{name}{strings}[10] = undef; - $font->{name}{strings}[13] = undef; -} - -sub change_name { - my ($self, $uid) = @_; - my $font = $self->{font}; - - for (1,3,4,6) { - my $str = $font->{name}{strings}[$_]; - for my $plat (0..$#$str) { - next unless $str->[$plat]; - for my $enc (0..$#{$str->[$plat]}) { - next unless $str->[$plat][$enc]; - for my $lang (keys %{$str->[$plat][$enc]}) { - next unless exists $str->[$plat][$enc]{$lang}; - $str->[$plat][$enc]{$lang} = "$uid - subset of " . $str->[$plat][$enc]{$lang}; - } - } - } - } -} - -sub license_desc_subst { - my ($self, $new) = @_; - my $font = $self->{font}; - - my $str = $font->{name}{strings}[13]; - for my $plat (0..$#$str) { - next unless $str->[$plat]; - for my $enc (0..$#{$str->[$plat]}) { - next unless $str->[$plat][$enc]; - for my $lang (keys %{$str->[$plat][$enc]}) { - next unless exists $str->[$plat][$enc]{$lang}; - $str->[$plat][$enc]{$lang} =~ s/\$\{LICENSESUBST\}/$new/g; - } - } - } -} - -# IE silently rejects non-CFF fonts if the Font Family Name is not a prefix of -# the Full Font Name. This can occur when automatically converting CFF fonts -# to non-CFF fonts, so it's useful to check and fix it here. -sub fix_full_font_name { - my ($self, $new) = @_; - my $font = $self->{font}; - - my $str1 = $font->{name}{strings}[1]; - for my $plat (0..$#$str1) { - next unless $str1->[$plat]; - for my $enc (0..$#{$str1->[$plat]}) { - next unless $str1->[$plat][$enc]; - for my $lang (keys %{$str1->[$plat][$enc]}) { - next unless exists $str1->[$plat][$enc]{$lang}; - my $name = $str1->[$plat][$enc]{$lang}; - my $fullname = $font->{name}{strings}[4][$plat][$enc]{$lang}; - if (substr($fullname, 0, length $name) ne $name) { - warn "Full Name ('$fullname') does not start with Family Name ('$name') and will break in IE - fixing automatically\n"; - $font->{name}{strings}[4][$plat][$enc]{$lang} = $name; - } - } - } - } -} - -sub new { - my $class = shift; - my $self = {}; - bless $self, $class; - return $self; -} - -sub preload { - my ($self, $filename) = @_; - my $font = Font::TTF::Font->open($filename) or die "Failed to open $filename: $!"; - $self->{font} = $font; - $self->read_tables; -} - -sub subset { - my ($self, $filename, $chars, $options) = @_; - - $self->{features} = $options->{features}; - - my $uid = substr(sha1_hex(encode_utf8("$filename $chars")), 0, 16); - - if (not $self->{font}) { - $self->preload($filename); - } - - my $font = $self->{font}; - - $self->check_tables; - - $self->{num_glyphs_old} = $font->{maxp}{numGlyphs}; - - $self->fold_gsub($options->{fold_features}) - if $options->{fold_features}; - - my $fsType = $font->{'OS/2'}{fsType}; - warn "fsType is $fsType - subsetting and embedding might not be permitted by the license\n" if $fsType != 0; - - $self->strip_cmap; - $self->strip_name; - - $self->find_codepoint_glyph_mappings; - $self->find_wanted_glyphs($chars); - $self->remove_unwanted_glyphs; - - $self->fix_cmap; - $self->fix_head; - $self->fix_hhea; - $self->fix_hmtx; - # name: nothing to fix (though maybe could be optimised?) - $self->fix_post; - - # cvt_: nothing to fix - # fpgm: nothing to fix - # glyf: just a stub, in Font::TTF - $self->fix_loca; - # prep: nothing to fix - - # BASE: TODO - $self->fix_gdef if $font->{GDEF}; - $self->fix_gpos if $font->{GPOS}; - $self->fix_gsub if $font->{GSUB}; - # JSTF: TODO - - $self->fix_hdmx if $font->{hdmx}; - $self->fix_kern if $font->{kern}; - $self->fix_ltsh if $font->{LTSH}; - - $self->fix_maxp; # Must come after loca, prep, fpgm - $self->fix_os_2; # Must come after cmap, hmtx, hhea, GPOS, GSUB - - $self->fix_full_font_name; - - $self->change_name($uid); - - $self->license_desc_subst($options->{license_desc_subst}) - if defined $options->{license_desc_subst}; - - $self->{num_glyphs_new} = $font->{maxp}{numGlyphs}; -} - -sub num_glyphs_old { - my ($self) = @_; - return $self->{num_glyphs_old}; -} - -sub num_glyphs_new { - my ($self) = @_; - return $self->{num_glyphs_new}; -} - -sub glyph_names { - my ($self) = @_; - my $font = $self->{font}; - if (@{$font->{post}{VAL}}) { - return @{$font->{post}{VAL}}; - } - my $n = $#{$font->{loca}{glyphs}}; - return join ' ', map { chr($_) =~ /[a-zA-Z0-9- \|]/ ? "'".chr($_)."'" : sprintf 'U+%04x', $_ } map { keys %{$self->{glyphs}{$_}} } - map $self->{glyph_id_new_to_old}{$_}, 0..$n; -} - -sub feature_status { - my ($self) = @_; - my $font = $self->{font}; - my %feats; - my @feats; - for my $table (grep defined, $font->{GPOS}, $font->{GSUB}) { - for my $feature (@{$table->{FEATURES}{FEAT_TAGS}}) { - $feature =~ /^(\w{4})( _\d+)?$/ or die "Unrecognised feature tag syntax '$feature'"; - my $tag = $1; - next if $feats{$tag}++; - push @feats, $tag; - } - } - return @feats; -} - -sub write { - my ($self, $fh) = @_; - my $font = $self->{font}; - $font->out($fh) or die $!; -} - -sub release { - my ($self) = @_; - my $font = $self->{font}; - $font->release; -} - -1; diff --git a/librarian/font-optimizer/Font/Subsetter/NormalizationData.pm b/librarian/font-optimizer/Font/Subsetter/NormalizationData.pm deleted file mode 100644 index dca81d6..0000000 --- a/librarian/font-optimizer/Font/Subsetter/NormalizationData.pm +++ /dev/null @@ -1,1377 +0,0 @@ -package Font::Subsetter::NormalizationData; -use strict; -use warnings; -our @data = ( -[192,65,768], -[193,65,769], -[194,65,770], -[195,65,771], -[196,65,776], -[197,65,778], -[199,67,807], -[200,69,768], -[201,69,769], -[202,69,770], -[203,69,776], -[204,73,768], -[205,73,769], -[206,73,770], -[207,73,776], -[209,78,771], -[210,79,768], -[211,79,769], -[212,79,770], -[213,79,771], -[214,79,776], -[217,85,768], -[218,85,769], -[219,85,770], -[220,85,776], -[221,89,769], -[224,97,768], -[225,97,769], -[226,97,770], -[227,97,771], -[228,97,776], -[229,97,778], -[231,99,807], -[232,101,768], -[233,101,769], -[234,101,770], -[235,101,776], -[236,105,768], -[237,105,769], -[238,105,770], -[239,105,776], -[241,110,771], -[242,111,768], -[243,111,769], -[244,111,770], -[245,111,771], -[246,111,776], -[249,117,768], -[250,117,769], -[251,117,770], -[252,117,776], -[253,121,769], -[255,121,776], -[256,65,772], -[257,97,772], -[258,65,774], -[259,97,774], -[260,65,808], -[261,97,808], -[262,67,769], -[263,99,769], -[264,67,770], -[265,99,770], -[266,67,775], -[267,99,775], -[268,67,780], -[269,99,780], -[270,68,780], -[271,100,780], -[274,69,772], -[275,101,772], -[276,69,774], -[277,101,774], -[278,69,775], -[279,101,775], -[280,69,808], -[281,101,808], -[282,69,780], -[283,101,780], -[284,71,770], -[285,103,770], -[286,71,774], -[287,103,774], -[288,71,775], -[289,103,775], -[290,71,807], -[291,103,807], -[292,72,770], -[293,104,770], -[296,73,771], -[297,105,771], -[298,73,772], -[299,105,772], -[300,73,774], -[301,105,774], -[302,73,808], -[303,105,808], -[304,73,775], -[308,74,770], -[309,106,770], -[310,75,807], -[311,107,807], -[313,76,769], -[314,108,769], -[315,76,807], -[316,108,807], -[317,76,780], -[318,108,780], -[323,78,769], -[324,110,769], -[325,78,807], -[326,110,807], -[327,78,780], -[328,110,780], -[332,79,772], -[333,111,772], -[334,79,774], -[335,111,774], -[336,79,779], -[337,111,779], -[340,82,769], -[341,114,769], -[342,82,807], -[343,114,807], -[344,82,780], -[345,114,780], -[346,83,769], -[347,115,769], -[348,83,770], -[349,115,770], -[350,83,807], -[351,115,807], -[352,83,780], -[353,115,780], -[354,84,807], -[355,116,807], -[356,84,780], -[357,116,780], -[360,85,771], -[361,117,771], -[362,85,772], -[363,117,772], -[364,85,774], -[365,117,774], -[366,85,778], -[367,117,778], -[368,85,779], -[369,117,779], -[370,85,808], -[371,117,808], -[372,87,770], -[373,119,770], -[374,89,770], -[375,121,770], -[376,89,776], -[377,90,769], -[378,122,769], -[379,90,775], -[380,122,775], -[381,90,780], -[382,122,780], -[416,79,795], -[417,111,795], -[431,85,795], -[432,117,795], -[461,65,780], -[462,97,780], -[463,73,780], -[464,105,780], -[465,79,780], -[466,111,780], -[467,85,780], -[468,117,780], -[469,85,776,772], -[469,220,772], -[470,117,776,772], -[470,252,772], -[471,85,776,769], -[471,220,769], -[472,117,776,769], -[472,252,769], -[473,85,776,780], -[473,220,780], -[474,117,776,780], -[474,252,780], -[475,85,776,768], -[475,220,768], -[476,117,776,768], -[476,252,768], -[478,65,776,772], -[478,196,772], -[479,97,776,772], -[479,228,772], -[480,65,775,772], -[480,550,772], -[481,97,775,772], -[481,551,772], -[482,198,772], -[483,230,772], -[486,71,780], -[487,103,780], -[488,75,780], -[489,107,780], -[490,79,808], -[491,111,808], -[492,79,808,772], -[492,332,808], -[492,490,772], -[493,111,808,772], -[493,333,808], -[493,491,772], -[494,439,780], -[495,658,780], -[496,106,780], -[500,71,769], -[501,103,769], -[504,78,768], -[505,110,768], -[506,65,778,769], -[506,197,769], -[507,97,778,769], -[507,229,769], -[508,198,769], -[509,230,769], -[510,216,769], -[511,248,769], -[512,65,783], -[513,97,783], -[514,65,785], -[515,97,785], -[516,69,783], -[517,101,783], -[518,69,785], -[519,101,785], -[520,73,783], -[521,105,783], -[522,73,785], -[523,105,785], -[524,79,783], -[525,111,783], -[526,79,785], -[527,111,785], -[528,82,783], -[529,114,783], -[530,82,785], -[531,114,785], -[532,85,783], -[533,117,783], -[534,85,785], -[535,117,785], -[536,83,806], -[537,115,806], -[538,84,806], -[539,116,806], -[542,72,780], -[543,104,780], -[550,65,775], -[551,97,775], -[552,69,807], -[553,101,807], -[554,79,776,772], -[554,214,772], -[555,111,776,772], -[555,246,772], -[556,79,771,772], -[556,213,772], -[557,111,771,772], -[557,245,772], -[558,79,775], -[559,111,775], -[560,79,775,772], -[560,558,772], -[561,111,775,772], -[561,559,772], -[562,89,772], -[563,121,772], -[901,168,769], -[902,913,769], -[904,917,769], -[905,919,769], -[906,921,769], -[908,927,769], -[910,933,769], -[911,937,769], -[912,953,776,769], -[912,970,769], -[938,921,776], -[939,933,776], -[940,945,769], -[941,949,769], -[942,951,769], -[943,953,769], -[944,965,776,769], -[944,971,769], -[970,953,776], -[971,965,776], -[972,959,769], -[973,965,769], -[974,969,769], -[979,978,769], -[980,978,776], -[1024,1045,768], -[1025,1045,776], -[1027,1043,769], -[1031,1030,776], -[1036,1050,769], -[1037,1048,768], -[1038,1059,774], -[1049,1048,774], -[1081,1080,774], -[1104,1077,768], -[1105,1077,776], -[1107,1075,769], -[1111,1110,776], -[1116,1082,769], -[1117,1080,768], -[1118,1091,774], -[1142,1140,783], -[1143,1141,783], -[1217,1046,774], -[1218,1078,774], -[1232,1040,774], -[1233,1072,774], -[1234,1040,776], -[1235,1072,776], -[1238,1045,774], -[1239,1077,774], -[1242,1240,776], -[1243,1241,776], -[1244,1046,776], -[1245,1078,776], -[1246,1047,776], -[1247,1079,776], -[1250,1048,772], -[1251,1080,772], -[1252,1048,776], -[1253,1080,776], -[1254,1054,776], -[1255,1086,776], -[1258,1256,776], -[1259,1257,776], -[1260,1069,776], -[1261,1101,776], -[1262,1059,772], -[1263,1091,772], -[1264,1059,776], -[1265,1091,776], -[1266,1059,779], -[1267,1091,779], -[1268,1063,776], -[1269,1095,776], -[1272,1067,776], -[1273,1099,776], -[1570,1575,1619], -[1571,1575,1620], -[1572,1608,1620], -[1573,1575,1621], -[1574,1610,1620], -[1728,1749,1620], -[1730,1729,1620], -[1747,1746,1620], -[2345,2344,2364], -[2353,2352,2364], -[2356,2355,2364], -[2507,2503,2494], -[2508,2503,2519], -[2888,2887,2902], -[2891,2887,2878], -[2892,2887,2903], -[2964,2962,3031], -[3018,3014,3006], -[3019,3015,3006], -[3020,3014,3031], -[3144,3142,3158], -[3264,3263,3285], -[3271,3270,3285], -[3272,3270,3286], -[3274,3270,3266], -[3275,3270,3266,3285], -[3275,3274,3285], -[3402,3398,3390], -[3403,3399,3390], -[3404,3398,3415], -[3546,3545,3530], -[3548,3545,3535], -[3549,3545,3535,3530], -[3549,3548,3530], -[3550,3545,3551], -[4134,4133,4142], -[7680,65,805], -[7681,97,805], -[7682,66,775], -[7683,98,775], -[7684,66,803], -[7685,98,803], -[7686,66,817], -[7687,98,817], -[7688,67,807,769], -[7688,262,807], -[7688,199,769], -[7689,99,807,769], -[7689,263,807], -[7689,231,769], -[7690,68,775], -[7691,100,775], -[7692,68,803], -[7693,100,803], -[7694,68,817], -[7695,100,817], -[7696,68,807], -[7697,100,807], -[7698,68,813], -[7699,100,813], -[7700,69,772,768], -[7700,274,768], -[7701,101,772,768], -[7701,275,768], -[7702,69,772,769], -[7702,274,769], -[7703,101,772,769], -[7703,275,769], -[7704,69,813], -[7705,101,813], -[7706,69,816], -[7707,101,816], -[7708,69,807,774], -[7708,276,807], -[7708,552,774], -[7709,101,807,774], -[7709,277,807], -[7709,553,774], -[7710,70,775], -[7711,102,775], -[7712,71,772], -[7713,103,772], -[7714,72,775], -[7715,104,775], -[7716,72,803], -[7717,104,803], -[7718,72,776], -[7719,104,776], -[7720,72,807], -[7721,104,807], -[7722,72,814], -[7723,104,814], -[7724,73,816], -[7725,105,816], -[7726,73,776,769], -[7726,207,769], -[7727,105,776,769], -[7727,239,769], -[7728,75,769], -[7729,107,769], -[7730,75,803], -[7731,107,803], -[7732,75,817], -[7733,107,817], -[7734,76,803], -[7735,108,803], -[7736,76,803,772], -[7736,7734,772], -[7737,108,803,772], -[7737,7735,772], -[7738,76,817], -[7739,108,817], -[7740,76,813], -[7741,108,813], -[7742,77,769], -[7743,109,769], -[7744,77,775], -[7745,109,775], -[7746,77,803], -[7747,109,803], -[7748,78,775], -[7749,110,775], -[7750,78,803], -[7751,110,803], -[7752,78,817], -[7753,110,817], -[7754,78,813], -[7755,110,813], -[7756,79,771,769], -[7756,213,769], -[7757,111,771,769], -[7757,245,769], -[7758,79,771,776], -[7758,213,776], -[7759,111,771,776], -[7759,245,776], -[7760,79,772,768], -[7760,332,768], -[7761,111,772,768], -[7761,333,768], -[7762,79,772,769], -[7762,332,769], -[7763,111,772,769], -[7763,333,769], -[7764,80,769], -[7765,112,769], -[7766,80,775], -[7767,112,775], -[7768,82,775], -[7769,114,775], -[7770,82,803], -[7771,114,803], -[7772,82,803,772], -[7772,7770,772], -[7773,114,803,772], -[7773,7771,772], -[7774,82,817], -[7775,114,817], -[7776,83,775], -[7777,115,775], -[7778,83,803], -[7779,115,803], -[7780,83,769,775], -[7780,346,775], -[7781,115,769,775], -[7781,347,775], -[7782,83,780,775], -[7782,352,775], -[7783,115,780,775], -[7783,353,775], -[7784,83,803,775], -[7784,7776,803], -[7784,7778,775], -[7785,115,803,775], -[7785,7777,803], -[7785,7779,775], -[7786,84,775], -[7787,116,775], -[7788,84,803], -[7789,116,803], -[7790,84,817], -[7791,116,817], -[7792,84,813], -[7793,116,813], -[7794,85,804], -[7795,117,804], -[7796,85,816], -[7797,117,816], -[7798,85,813], -[7799,117,813], -[7800,85,771,769], -[7800,360,769], -[7801,117,771,769], -[7801,361,769], -[7802,85,772,776], -[7802,362,776], -[7803,117,772,776], -[7803,363,776], -[7804,86,771], -[7805,118,771], -[7806,86,803], -[7807,118,803], -[7808,87,768], -[7809,119,768], -[7810,87,769], -[7811,119,769], -[7812,87,776], -[7813,119,776], -[7814,87,775], -[7815,119,775], -[7816,87,803], -[7817,119,803], -[7818,88,775], -[7819,120,775], -[7820,88,776], -[7821,120,776], -[7822,89,775], -[7823,121,775], -[7824,90,770], -[7825,122,770], -[7826,90,803], -[7827,122,803], -[7828,90,817], -[7829,122,817], -[7830,104,817], -[7831,116,776], -[7832,119,778], -[7833,121,778], -[7835,383,775], -[7840,65,803], -[7841,97,803], -[7842,65,777], -[7843,97,777], -[7844,65,770,769], -[7844,194,769], -[7845,97,770,769], -[7845,226,769], -[7846,65,770,768], -[7846,194,768], -[7847,97,770,768], -[7847,226,768], -[7848,65,770,777], -[7848,194,777], -[7849,97,770,777], -[7849,226,777], -[7850,65,770,771], -[7850,194,771], -[7851,97,770,771], -[7851,226,771], -[7852,65,803,770], -[7852,194,803], -[7852,7840,770], -[7853,97,803,770], -[7853,226,803], -[7853,7841,770], -[7854,65,774,769], -[7854,258,769], -[7855,97,774,769], -[7855,259,769], -[7856,65,774,768], -[7856,258,768], -[7857,97,774,768], -[7857,259,768], -[7858,65,774,777], -[7858,258,777], -[7859,97,774,777], -[7859,259,777], -[7860,65,774,771], -[7860,258,771], -[7861,97,774,771], -[7861,259,771], -[7862,65,803,774], -[7862,258,803], -[7862,7840,774], -[7863,97,803,774], -[7863,259,803], -[7863,7841,774], -[7864,69,803], -[7865,101,803], -[7866,69,777], -[7867,101,777], -[7868,69,771], -[7869,101,771], -[7870,69,770,769], -[7870,202,769], -[7871,101,770,769], -[7871,234,769], -[7872,69,770,768], -[7872,202,768], -[7873,101,770,768], -[7873,234,768], -[7874,69,770,777], -[7874,202,777], -[7875,101,770,777], -[7875,234,777], -[7876,69,770,771], -[7876,202,771], -[7877,101,770,771], -[7877,234,771], -[7878,69,803,770], -[7878,202,803], -[7878,7864,770], -[7879,101,803,770], -[7879,234,803], -[7879,7865,770], -[7880,73,777], -[7881,105,777], -[7882,73,803], -[7883,105,803], -[7884,79,803], -[7885,111,803], -[7886,79,777], -[7887,111,777], -[7888,79,770,769], -[7888,212,769], -[7889,111,770,769], -[7889,244,769], -[7890,79,770,768], -[7890,212,768], -[7891,111,770,768], -[7891,244,768], -[7892,79,770,777], -[7892,212,777], -[7893,111,770,777], -[7893,244,777], -[7894,79,770,771], -[7894,212,771], -[7895,111,770,771], -[7895,244,771], -[7896,79,803,770], -[7896,212,803], -[7896,7884,770], -[7897,111,803,770], -[7897,244,803], -[7897,7885,770], -[7898,79,795,769], -[7898,211,795], -[7898,416,769], -[7899,111,795,769], -[7899,243,795], -[7899,417,769], -[7900,79,795,768], -[7900,210,795], -[7900,416,768], -[7901,111,795,768], -[7901,242,795], -[7901,417,768], -[7902,79,795,777], -[7902,7886,795], -[7902,416,777], -[7903,111,795,777], -[7903,7887,795], -[7903,417,777], -[7904,79,795,771], -[7904,213,795], -[7904,416,771], -[7905,111,795,771], -[7905,245,795], -[7905,417,771], -[7906,79,795,803], -[7906,7884,795], -[7906,416,803], -[7907,111,795,803], -[7907,7885,795], -[7907,417,803], -[7908,85,803], -[7909,117,803], -[7910,85,777], -[7911,117,777], -[7912,85,795,769], -[7912,218,795], -[7912,431,769], -[7913,117,795,769], -[7913,250,795], -[7913,432,769], -[7914,85,795,768], -[7914,217,795], -[7914,431,768], -[7915,117,795,768], -[7915,249,795], -[7915,432,768], -[7916,85,795,777], -[7916,7910,795], -[7916,431,777], -[7917,117,795,777], -[7917,7911,795], -[7917,432,777], -[7918,85,795,771], -[7918,360,795], -[7918,431,771], -[7919,117,795,771], -[7919,361,795], -[7919,432,771], -[7920,85,795,803], -[7920,7908,795], -[7920,431,803], -[7921,117,795,803], -[7921,7909,795], -[7921,432,803], -[7922,89,768], -[7923,121,768], -[7924,89,803], -[7925,121,803], -[7926,89,777], -[7927,121,777], -[7928,89,771], -[7929,121,771], -[7936,945,787], -[7937,945,788], -[7938,945,787,768], -[7938,7936,768], -[7939,945,788,768], -[7939,7937,768], -[7940,945,787,769], -[7940,7936,769], -[7941,945,788,769], -[7941,7937,769], -[7942,945,787,834], -[7942,7936,834], -[7943,945,788,834], -[7943,7937,834], -[7944,913,787], -[7945,913,788], -[7946,913,787,768], -[7946,7944,768], -[7947,913,788,768], -[7947,7945,768], -[7948,913,787,769], -[7948,7944,769], -[7949,913,788,769], -[7949,7945,769], -[7950,913,787,834], -[7950,7944,834], -[7951,913,788,834], -[7951,7945,834], -[7952,949,787], -[7953,949,788], -[7954,949,787,768], -[7954,7952,768], -[7955,949,788,768], -[7955,7953,768], -[7956,949,787,769], -[7956,7952,769], -[7957,949,788,769], -[7957,7953,769], -[7960,917,787], -[7961,917,788], -[7962,917,787,768], -[7962,7960,768], -[7963,917,788,768], -[7963,7961,768], -[7964,917,787,769], -[7964,7960,769], -[7965,917,788,769], -[7965,7961,769], -[7968,951,787], -[7969,951,788], -[7970,951,787,768], -[7970,7968,768], -[7971,951,788,768], -[7971,7969,768], -[7972,951,787,769], -[7972,7968,769], -[7973,951,788,769], -[7973,7969,769], -[7974,951,787,834], -[7974,7968,834], -[7975,951,788,834], -[7975,7969,834], -[7976,919,787], -[7977,919,788], -[7978,919,787,768], -[7978,7976,768], -[7979,919,788,768], -[7979,7977,768], -[7980,919,787,769], -[7980,7976,769], -[7981,919,788,769], -[7981,7977,769], -[7982,919,787,834], -[7982,7976,834], -[7983,919,788,834], -[7983,7977,834], -[7984,953,787], -[7985,953,788], -[7986,953,787,768], -[7986,7984,768], -[7987,953,788,768], -[7987,7985,768], -[7988,953,787,769], -[7988,7984,769], -[7989,953,788,769], -[7989,7985,769], -[7990,953,787,834], -[7990,7984,834], -[7991,953,788,834], -[7991,7985,834], -[7992,921,787], -[7993,921,788], -[7994,921,787,768], -[7994,7992,768], -[7995,921,788,768], -[7995,7993,768], -[7996,921,787,769], -[7996,7992,769], -[7997,921,788,769], -[7997,7993,769], -[7998,921,787,834], -[7998,7992,834], -[7999,921,788,834], -[7999,7993,834], -[8000,959,787], -[8001,959,788], -[8002,959,787,768], -[8002,8000,768], -[8003,959,788,768], -[8003,8001,768], -[8004,959,787,769], -[8004,8000,769], -[8005,959,788,769], -[8005,8001,769], -[8008,927,787], -[8009,927,788], -[8010,927,787,768], -[8010,8008,768], -[8011,927,788,768], -[8011,8009,768], -[8012,927,787,769], -[8012,8008,769], -[8013,927,788,769], -[8013,8009,769], -[8016,965,787], -[8017,965,788], -[8018,965,787,768], -[8018,8016,768], -[8019,965,788,768], -[8019,8017,768], -[8020,965,787,769], -[8020,8016,769], -[8021,965,788,769], -[8021,8017,769], -[8022,965,787,834], -[8022,8016,834], -[8023,965,788,834], -[8023,8017,834], -[8025,933,788], -[8027,933,788,768], -[8027,8025,768], -[8029,933,788,769], -[8029,8025,769], -[8031,933,788,834], -[8031,8025,834], -[8032,969,787], -[8033,969,788], -[8034,969,787,768], -[8034,8032,768], -[8035,969,788,768], -[8035,8033,768], -[8036,969,787,769], -[8036,8032,769], -[8037,969,788,769], -[8037,8033,769], -[8038,969,787,834], -[8038,8032,834], -[8039,969,788,834], -[8039,8033,834], -[8040,937,787], -[8041,937,788], -[8042,937,787,768], -[8042,8040,768], -[8043,937,788,768], -[8043,8041,768], -[8044,937,787,769], -[8044,8040,769], -[8045,937,788,769], -[8045,8041,769], -[8046,937,787,834], -[8046,8040,834], -[8047,937,788,834], -[8047,8041,834], -[8048,945,768], -[8050,949,768], -[8052,951,768], -[8054,953,768], -[8056,959,768], -[8058,965,768], -[8060,969,768], -[8064,945,787,837], -[8064,8115,787], -[8064,7936,837], -[8065,945,788,837], -[8065,8115,788], -[8065,7937,837], -[8066,945,787,768,837], -[8066,8115,787,768], -[8066,8064,768], -[8066,7936,837,768], -[8066,7936,768,837], -[8066,7938,837], -[8067,945,788,768,837], -[8067,8115,788,768], -[8067,8065,768], -[8067,7937,837,768], -[8067,7937,768,837], -[8067,7939,837], -[8068,945,787,769,837], -[8068,8115,787,769], -[8068,8064,769], -[8068,7936,837,769], -[8068,7936,769,837], -[8068,7940,837], -[8069,945,788,769,837], -[8069,8115,788,769], -[8069,8065,769], -[8069,7937,837,769], -[8069,7937,769,837], -[8069,7941,837], -[8070,945,787,834,837], -[8070,8115,787,834], -[8070,8064,834], -[8070,7936,837,834], -[8070,7936,834,837], -[8070,7942,837], -[8071,945,788,834,837], -[8071,8115,788,834], -[8071,8065,834], -[8071,7937,837,834], -[8071,7937,834,837], -[8071,7943,837], -[8072,913,787,837], -[8072,8124,787], -[8072,7944,837], -[8073,913,788,837], -[8073,8124,788], -[8073,7945,837], -[8074,913,787,768,837], -[8074,8124,787,768], -[8074,8072,768], -[8074,7944,837,768], -[8074,7944,768,837], -[8074,7946,837], -[8075,913,788,768,837], -[8075,8124,788,768], -[8075,8073,768], -[8075,7945,837,768], -[8075,7945,768,837], -[8075,7947,837], -[8076,913,787,769,837], -[8076,8124,787,769], -[8076,8072,769], -[8076,7944,837,769], -[8076,7944,769,837], -[8076,7948,837], -[8077,913,788,769,837], -[8077,8124,788,769], -[8077,8073,769], -[8077,7945,837,769], -[8077,7945,769,837], -[8077,7949,837], -[8078,913,787,834,837], -[8078,8124,787,834], -[8078,8072,834], -[8078,7944,837,834], -[8078,7944,834,837], -[8078,7950,837], -[8079,913,788,834,837], -[8079,8124,788,834], -[8079,8073,834], -[8079,7945,837,834], -[8079,7945,834,837], -[8079,7951,837], -[8080,951,787,837], -[8080,8131,787], -[8080,7968,837], -[8081,951,788,837], -[8081,8131,788], -[8081,7969,837], -[8082,951,787,768,837], -[8082,8131,787,768], -[8082,8080,768], -[8082,7968,837,768], -[8082,7968,768,837], -[8082,7970,837], -[8083,951,788,768,837], -[8083,8131,788,768], -[8083,8081,768], -[8083,7969,837,768], -[8083,7969,768,837], -[8083,7971,837], -[8084,951,787,769,837], -[8084,8131,787,769], -[8084,8080,769], -[8084,7968,837,769], -[8084,7968,769,837], -[8084,7972,837], -[8085,951,788,769,837], -[8085,8131,788,769], -[8085,8081,769], -[8085,7969,837,769], -[8085,7969,769,837], -[8085,7973,837], -[8086,951,787,834,837], -[8086,8131,787,834], -[8086,8080,834], -[8086,7968,837,834], -[8086,7968,834,837], -[8086,7974,837], -[8087,951,788,834,837], -[8087,8131,788,834], -[8087,8081,834], -[8087,7969,837,834], -[8087,7969,834,837], -[8087,7975,837], -[8088,919,787,837], -[8088,8140,787], -[8088,7976,837], -[8089,919,788,837], -[8089,8140,788], -[8089,7977,837], -[8090,919,787,768,837], -[8090,8140,787,768], -[8090,8088,768], -[8090,7976,837,768], -[8090,7976,768,837], -[8090,7978,837], -[8091,919,788,768,837], -[8091,8140,788,768], -[8091,8089,768], -[8091,7977,837,768], -[8091,7977,768,837], -[8091,7979,837], -[8092,919,787,769,837], -[8092,8140,787,769], -[8092,8088,769], -[8092,7976,837,769], -[8092,7976,769,837], -[8092,7980,837], -[8093,919,788,769,837], -[8093,8140,788,769], -[8093,8089,769], -[8093,7977,837,769], -[8093,7977,769,837], -[8093,7981,837], -[8094,919,787,834,837], -[8094,8140,787,834], -[8094,8088,834], -[8094,7976,837,834], -[8094,7976,834,837], -[8094,7982,837], -[8095,919,788,834,837], -[8095,8140,788,834], -[8095,8089,834], -[8095,7977,837,834], -[8095,7977,834,837], -[8095,7983,837], -[8096,969,787,837], -[8096,8179,787], -[8096,8032,837], -[8097,969,788,837], -[8097,8179,788], -[8097,8033,837], -[8098,969,787,768,837], -[8098,8179,787,768], -[8098,8096,768], -[8098,8032,837,768], -[8098,8032,768,837], -[8098,8034,837], -[8099,969,788,768,837], -[8099,8179,788,768], -[8099,8097,768], -[8099,8033,837,768], -[8099,8033,768,837], -[8099,8035,837], -[8100,969,787,769,837], -[8100,8179,787,769], -[8100,8096,769], -[8100,8032,837,769], -[8100,8032,769,837], -[8100,8036,837], -[8101,969,788,769,837], -[8101,8179,788,769], -[8101,8097,769], -[8101,8033,837,769], -[8101,8033,769,837], -[8101,8037,837], -[8102,969,787,834,837], -[8102,8179,787,834], -[8102,8096,834], -[8102,8032,837,834], -[8102,8032,834,837], -[8102,8038,837], -[8103,969,788,834,837], -[8103,8179,788,834], -[8103,8097,834], -[8103,8033,837,834], -[8103,8033,834,837], -[8103,8039,837], -[8104,937,787,837], -[8104,8188,787], -[8104,8040,837], -[8105,937,788,837], -[8105,8188,788], -[8105,8041,837], -[8106,937,787,768,837], -[8106,8188,787,768], -[8106,8104,768], -[8106,8040,837,768], -[8106,8040,768,837], -[8106,8042,837], -[8107,937,788,768,837], -[8107,8188,788,768], -[8107,8105,768], -[8107,8041,837,768], -[8107,8041,768,837], -[8107,8043,837], -[8108,937,787,769,837], -[8108,8188,787,769], -[8108,8104,769], -[8108,8040,837,769], -[8108,8040,769,837], -[8108,8044,837], -[8109,937,788,769,837], -[8109,8188,788,769], -[8109,8105,769], -[8109,8041,837,769], -[8109,8041,769,837], -[8109,8045,837], -[8110,937,787,834,837], -[8110,8188,787,834], -[8110,8104,834], -[8110,8040,837,834], -[8110,8040,834,837], -[8110,8046,837], -[8111,937,788,834,837], -[8111,8188,788,834], -[8111,8105,834], -[8111,8041,837,834], -[8111,8041,834,837], -[8111,8047,837], -[8112,945,774], -[8113,945,772], -[8114,945,768,837], -[8114,8115,768], -[8114,8048,837], -[8115,945,837], -[8116,945,769,837], -[8116,8115,769], -[8116,940,837], -[8118,945,834], -[8119,945,834,837], -[8119,8115,834], -[8119,8118,837], -[8120,913,774], -[8121,913,772], -[8122,913,768], -[8124,913,837], -[8129,168,834], -[8130,951,768,837], -[8130,8131,768], -[8130,8052,837], -[8131,951,837], -[8132,951,769,837], -[8132,8131,769], -[8132,942,837], -[8134,951,834], -[8135,951,834,837], -[8135,8131,834], -[8135,8134,837], -[8136,917,768], -[8138,919,768], -[8140,919,837], -[8141,8127,768], -[8142,8127,769], -[8143,8127,834], -[8144,953,774], -[8145,953,772], -[8146,953,776,768], -[8146,970,768], -[8150,953,834], -[8151,953,776,834], -[8151,970,834], -[8152,921,774], -[8153,921,772], -[8154,921,768], -[8157,8190,768], -[8158,8190,769], -[8159,8190,834], -[8160,965,774], -[8161,965,772], -[8162,965,776,768], -[8162,971,768], -[8164,961,787], -[8165,961,788], -[8166,965,834], -[8167,965,776,834], -[8167,971,834], -[8168,933,774], -[8169,933,772], -[8170,933,768], -[8172,929,788], -[8173,168,768], -[8178,969,768,837], -[8178,8179,768], -[8178,8060,837], -[8179,969,837], -[8180,969,769,837], -[8180,8179,769], -[8180,974,837], -[8182,969,834], -[8183,969,834,837], -[8183,8179,834], -[8183,8182,837], -[8184,927,768], -[8186,937,768], -[8188,937,837], -[8602,8592,824], -[8603,8594,824], -[8622,8596,824], -[8653,8656,824], -[8654,8660,824], -[8655,8658,824], -[8708,8707,824], -[8713,8712,824], -[8716,8715,824], -[8740,8739,824], -[8742,8741,824], -[8769,8764,824], -[8772,8771,824], -[8775,8773,824], -[8777,8776,824], -[8800,61,824], -[8802,8801,824], -[8813,8781,824], -[8814,60,824], -[8815,62,824], -[8816,8804,824], -[8817,8805,824], -[8820,8818,824], -[8821,8819,824], -[8824,8822,824], -[8825,8823,824], -[8832,8826,824], -[8833,8827,824], -[8836,8834,824], -[8837,8835,824], -[8840,8838,824], -[8841,8839,824], -[8876,8866,824], -[8877,8872,824], -[8878,8873,824], -[8879,8875,824], -[8928,8828,824], -[8929,8829,824], -[8930,8849,824], -[8931,8850,824], -[8938,8882,824], -[8939,8883,824], -[8940,8884,824], -[8941,8885,824], -[12364,12363,12441], -[12366,12365,12441], -[12368,12367,12441], -[12370,12369,12441], -[12372,12371,12441], -[12374,12373,12441], -[12376,12375,12441], -[12378,12377,12441], -[12380,12379,12441], -[12382,12381,12441], -[12384,12383,12441], -[12386,12385,12441], -[12389,12388,12441], -[12391,12390,12441], -[12393,12392,12441], -[12400,12399,12441], -[12401,12399,12442], -[12403,12402,12441], -[12404,12402,12442], -[12406,12405,12441], -[12407,12405,12442], -[12409,12408,12441], -[12410,12408,12442], -[12412,12411,12441], -[12413,12411,12442], -[12436,12358,12441], -[12446,12445,12441], -[12460,12459,12441], -[12462,12461,12441], -[12464,12463,12441], -[12466,12465,12441], -[12468,12467,12441], -[12470,12469,12441], -[12472,12471,12441], -[12474,12473,12441], -[12476,12475,12441], -[12478,12477,12441], -[12480,12479,12441], -[12482,12481,12441], -[12485,12484,12441], -[12487,12486,12441], -[12489,12488,12441], -[12496,12495,12441], -[12497,12495,12442], -[12499,12498,12441], -[12500,12498,12442], -[12502,12501,12441], -[12503,12501,12442], -[12505,12504,12441], -[12506,12504,12442], -[12508,12507,12441], -[12509,12507,12442], -[12532,12454,12441], -[12535,12527,12441], -[12536,12528,12441], -[12537,12529,12441], -[12538,12530,12441], -[12542,12541,12441], -); - -1; diff --git a/librarian/font-optimizer/Font/Subsetter/create-data.pl b/librarian/font-optimizer/Font/Subsetter/create-data.pl deleted file mode 100644 index e0a38fb..0000000 --- a/librarian/font-optimizer/Font/Subsetter/create-data.pl +++ /dev/null @@ -1,100 +0,0 @@ -use strict; -use warnings; - -use Unicode::Normalize; - -print <) { - my @c = split /;/, $_; - # Find characters which canonically decompose (without any - # compatibility tag "") - next unless $c[5] and $c[5] !~ /^[ord($1)-ord('a')]/eg; $_ } split / /, $cs2; - # If NFC didn't collapse everything into single characters, this string is not interesting - next if grep length != 1, @x; - # If the string doesn't NFC into the desired character, it's not interesting - next unless Unicode::Normalize::NFC(join '', @x) eq chr hex $c[0]; - # This string is good - push @data, [hex $c[0], map ord, @x]; - } - } - } elsif (@norm == 4) { - my ($a, $b, $c, $d) = @norm; - for my $cs (permut([$a, $b, $c, $d], [])) { - for my $cs2 ('ab c d', 'a bc d', 'a b cd', 'ab cd', 'abc d', 'a bcd') { - my @x = map Unicode::Normalize::NFC($_), map { s/(.)/$cs->[ord($1)-ord('a')]/eg; $_ } split / /, $cs2; - next if grep length != 1, @x; - next unless Unicode::Normalize::NFC(join '', @x) eq chr hex $c[0]; - push @data, [hex $c[0], map ord, @x]; - } - } - } elsif (@norm > 4) { - die "\@norm too big"; - } -} - -print uniq(map "[".join(',', @$_)."],\n", @data); - -print < \$verbose, - 'ttf-to-eot' => \$ttf_to_eot, - 'eot-to-ttf' => \$eot_to_ttf, - ) or help(); - - @ARGV == 2 or help(); - - my ($input_file, $output_file) = @ARGV; - - if ($ttf_to_eot and $eot_to_ttf) { - help(); - } - - if (not ($ttf_to_eot or $eot_to_ttf)) { - if ($input_file =~ /\.[ot]tf$/i and $output_file =~ /\.eot$/i) { - $ttf_to_eot = 1; - } elsif ($input_file =~ /\.eot$/i and $output_file =~ /\.[ot]tf$/i) { - $eot_to_ttf = 1; - } else { - help(); - } - } - - if ($ttf_to_eot) { - Font::EOTWrapper::convert($input_file, $output_file); - } elsif ($eot_to_ttf) { - Font::EOTWrapper::extract($input_file, $output_file); - } -} diff --git a/librarian/font-optimizer/ext/Font-TTF/.cvsignore b/librarian/font-optimizer/ext/Font-TTF/.cvsignore deleted file mode 100644 index 459bc9c..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -*.gz -MANIFEST diff --git a/librarian/font-optimizer/ext/Font-TTF/COPYING b/librarian/font-optimizer/ext/Font-TTF/COPYING deleted file mode 100644 index cbda892..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/COPYING +++ /dev/null @@ -1,76 +0,0 @@ - -Artistic License 2.0 - -Copyright (c) 2000-2006, The Perl Foundation. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. -Preamble - -This license establishes the terms under which a given free software Package may be copied, modified, distributed, and/or redistributed. The intent is that the Copyright Holder maintains some artistic control over the development of that Package while still keeping the Package available as open source and free software. - -You are always permitted to make arrangements wholly outside of this license directly with the Copyright Holder of a given Package. If the terms of this license do not permit the full use that you propose to make of the Package, you should contact the Copyright Holder and seek a different licensing arrangement. -Definitions - -"Copyright Holder" means the individual(s) or organization(s) named in the copyright notice for the entire Package. - -"Contributor" means any party that has contributed code or other material to the Package, in accordance with the Copyright Holder's procedures. - -"You" and "your" means any person who would like to copy, distribute, or modify the Package. - -"Package" means the collection of files distributed by the Copyright Holder, and derivatives of that collection and/or of those files. A given Package may consist of either the Standard Version, or a Modified Version. - -"Distribute" means providing a copy of the Package or making it accessible to anyone else, or in the case of a company or organization, to others outside of your company or organization. - -"Distributor Fee" means any fee that you charge for Distributing this Package or providing support for this Package to another party. It does not mean licensing fees. - -"Standard Version" refers to the Package if it has not been modified, or has been modified only in ways explicitly requested by the Copyright Holder. - -"Modified Version" means the Package, if it has been changed, and such changes were not explicitly requested by the Copyright Holder. - -"Original License" means this Artistic License as Distributed with the Standard Version of the Package, in its current version or as it may be modified by The Perl Foundation in the future. - -"Source" form means the source code, documentation source, and configuration files for the Package. - -"Compiled" form means the compiled bytecode, object code, binary, or any other form resulting from mechanical transformation or translation of the Source form. -Permission for Use and Modification Without Distribution - -(1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not Distribute the Modified Version. -Permissions for Redistribution of the Standard Version - -(2) You may Distribute verbatim copies of the Source form of the Standard Version of this Package in any medium without restriction, either gratis or for a Distributor Fee, provided that you duplicate all of the original copyright notices and associated disclaimers. At your discretion, such verbatim copies may or may not include a Compiled form of the Package. - -(3) You may apply any bug fixes, portability changes, and other modifications made available from the Copyright Holder. The resulting Package will still be considered the Standard Version, and as such will be subject to the Original License. -Distribution of Modified Versions of the Package as Source - -(4) You may Distribute your Modified Version as Source (either gratis or for a Distributor Fee, and with or without a Compiled form of the Modified Version) provided that you clearly document how it differs from the Standard Version, including, but not limited to, documenting any non-standard features, executables, or modules, and provided that you do at least ONE of the following: - -(a) make the Modified Version available to the Copyright Holder of the Standard Version, under the Original License, so that the Copyright Holder may include your modifications in the Standard Version. -(b) ensure that installation of your Modified Version does not prevent the user installing or running the Standard Version. In addition, the Modified Version must bear a name that is different from the name of the Standard Version. -(c) allow anyone who receives a copy of the Modified Version to make the Source form of the Modified Version available to others under -(i) the Original License or -(ii) a license that permits the licensee to freely copy, modify and redistribute the Modified Version using the same licensing terms that apply to the copy that the licensee received, and requires that the Source form of the Modified Version, and of any works derived from it, be made freely available in that license fees are prohibited but Distributor Fees are allowed. -Distribution of Compiled Forms of the Standard Version or Modified Versions without the Source - -(5) You may Distribute Compiled forms of the Standard Version without the Source, provided that you include complete instructions on how to get the Source of the Standard Version. Such instructions must be valid at the time of your distribution. If these instructions, at any time while you are carrying out such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If you provide valid instructions or cease distribution within thirty days after you become aware that the instructions are invalid, then you do not forfeit any of your rights under this license. - -(6) You may Distribute a Modified Version in Compiled form without the Source, provided that you comply with Section 4 with respect to the Source of the Modified Version. -Aggregating or Linking the Package - -(7) You may aggregate the Package (either the Standard Version or Modified Version) with other packages and Distribute the resulting aggregation provided that you do not charge a licensing fee for the Package. Distributor Fees are permitted, and licensing fees for other components in the aggregation are permitted. The terms of this license apply to the use and Distribution of the Standard or Modified Versions as included in the aggregation. - -(8) You are permitted to link Modified and Standard Versions with other works, to embed the Package in a larger work of your own, or to build stand-alone binary or bytecode versions of applications that include the Package, and Distribute the result without restriction, provided the result does not expose a direct interface to the Package. -Items That are Not Considered Part of a Modified Version - -(9) Works (including, but not limited to, modules and scripts) that merely extend or make use of the Package, do not, by themselves, cause the Package to be a Modified Version. In addition, such works are not considered parts of the Package itself, and are not subject to the terms of this license. -General Provisions - -(10) Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license. - -(11) If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license. - -(12) This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder. - -(13) This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed. - -(14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/librarian/font-optimizer/ext/Font-TTF/Changes b/librarian/font-optimizer/ext/Font-TTF/Changes deleted file mode 100644 index 1821632..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/Changes +++ /dev/null @@ -1,6 +0,0 @@ -0.45 - -* Introduce changelog -* tidy up 0.44 package, fix README to be more accurate -* tests failing on perl 5.8.2 and before due to no use Exporter qw(import); - Fix OTTags accordingly. diff --git a/librarian/font-optimizer/ext/Font-TTF/MANIFEST.SKIP b/librarian/font-optimizer/ext/Font-TTF/MANIFEST.SKIP deleted file mode 100644 index 464c50e..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/MANIFEST.SKIP +++ /dev/null @@ -1,26 +0,0 @@ -blib/ -\.\$\$\$ -\.tmp -\.bak -CVS/ -\.tar -\.tgz -\.old -misc/ -Build/ -exes/ -\.cvsignore -^# -\.svn/ -Makefile$ -\.par$ --stamp$ -debian/ -pm_to_blib -\~$ -dev/ -build/ -dists/ -^libfont- -description-pak -^doc diff --git a/librarian/font-optimizer/ext/Font-TTF/Makefile.PL b/librarian/font-optimizer/ext/Font-TTF/Makefile.PL deleted file mode 100644 index c0518d5..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/Makefile.PL +++ /dev/null @@ -1,108 +0,0 @@ -use ExtUtils::MakeMaker; -use Getopt::Std; - -getopts('d:rv:'); - -%pbuilderopts = ( - 'gutsy' => '--bindmounts /media/hosk_1' - ); - -$opt_v ||= 1; - -if ($^O eq 'linux' && !defined $opt_d) -{ - $opt_d = `lsb_release -c`; - $opt_d =~ s/^.*?(\w+)\s*$/$1/o; -} - -@theselibs = (grep {-f } glob("lib/Font/TTF/*"), "lib/Font/TTF.pm"); - -# incantation to enable MY::pm_to_blib later on -if ($^O eq 'MSWin32') -{ - push(@ExtUtils::MakeMaker::Overridable, qw(pm_to_blib)); - @extras = ('dist' => { 'TO_UNIX' => 'perl -Mtounix -e "tounix(\"$(DISTVNAME)\")"' }); -} - -%makeinfo = ( - NAME => 'Font::TTF', - VERSION_FROM => 'lib/Font/TTF.pm', -# VERSION => "0.38", -# HTMLLIBPODS => {map {my $t = $_; $t=~s/\..*?$/.html/o; $t='blib/Html/'.$t; $_ => $t;} @theselibs}, -# HTMLSCRIPTPODS => {map {my $t=$_; $t=~s/\..*?$/.html/o; $t='blib/Html/'.$t; $_ => $t;} @scripts}, - AUTHOR => "martin_hosken\@sil.org", - ABSTRACT => "TTF font support for Perl", - @extras - ); - -WriteMakefile(%makeinfo); - -if ($^O eq 'MSWin32') { -# incantation to solve the problem of everyone's $Config{make} being 'nmake' -# when we want 'pmake'. And $Config{} is read only. -# actually, this is just a copy of the code from ExtUtiles::MM_Win32 tidied -# up (to expose tabs) and the dependency on Config removed -sub MY::pm_to_blib -{ - my $self = shift; - my($autodir) = $self->catdir('$(INST_LIB)','auto'); - return <<"EOT"; - -pm_to_blib: \$(TO_INST_PM) -\t$self->{NOECHO}\$(PERL) \"-I\$(INST_ARCHLINE)\" \"-I\$(INST_LIB)\" \\ -\t\"-I\$(PERL_ARCHLIB)\" \"-I\$(PERL_LIB)\" -MExtUtils::Install \\ -\t-e \"pm_to_blib({ qw[\$(PM_TO_BLIB)] }, '$autodir') -\t$self->{NOECHO}\$(TOUCH) \$@ - -EOT -} - -} -elsif ($^O eq 'linux') -{ - -sub MY::postamble -{ - my ($self) = @_; - my ($res); - my ($package) = lc($self->{'NAME'}); - my ($pversion) = $self->{'VERSION'}; - my ($svn) = `svnversion`; - my ($sign) = '--auto-debsign' if ($opt_r); - my ($fpackage); - - $svn =~ s/[0-9]*://og; - $svn =~ s/\s+$//o; - $package =~ s/::/-/; - $package = "lib${package}-perl"; - $pversion .= "+$svn" unless ($opt_r); - $fpackage = "$package-$pversion"; - - $res = <<"EOT"; -deb-base: dist - rm -fr $self->{'DISTVNAME'} - rm -fr $fpackage - tar xvzf $self->{'DISTVNAME'}.tar.gz - mv $self->{'DISTVNAME'} $fpackage - tar cfz "${package}_$pversion.orig.tar.gz" $fpackage - cp -a debian $fpackage - cd $fpackage && find . -name .svn | xargs rm -rf - -# make deb builds an interim deb from svn source for release -deb: deb-base -EOT - - foreach $d (split(' ', $opt_d)) - { - $res .= <<"EOT"; - mkdir -p dists/$d - dch -D $d -v $pversion-$opt_v -m -b -c $fpackage/debian/changelog "Auto build from perl for $d" - cd $fpackage && pdebuild --buildresult ../dists/$d -- --basetgz /var/cache/pbuilder/base-$d.tgz $pbuilderopts{$d} -EOT - } - - return $res; -} - -} - diff --git a/librarian/font-optimizer/ext/Font-TTF/README.TXT b/librarian/font-optimizer/ext/Font-TTF/README.TXT deleted file mode 100644 index ad6a602..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/README.TXT +++ /dev/null @@ -1,99 +0,0 @@ - Perl Module: Font::TTF - -=head1 Introduction - -Perl module for TrueType font hacking. Supports reading, processing and -writing of the following tables: GDEF, GPOS, GSUB, LTSH, OS/2, PCLT, -bsln, cmap, cvt, fdsc, feat, fpgm, glyf, hdmx, head, hhea, hmtx, kern, -loca, maxp, mort, name, post, prep, prop, vhea, vmtx and the reading and -writing of all other table types. - -In short, you can do almost anything with a standard TrueType font with -this module. Be Brave! - -Any suggestions, improvements, additions, subclasses, etc. would be gratefully -received and probably included in a future release. Please send them to me. - -This module has been tested on Win32, Unix and Mac. - -Applications that were associated with this module have been moved to Font::TTF::Scripts where great things can be done. - -=head1 SYNOPSIS - -Here is the regression test (you provide your own font). Run it once and then -again on the output of the first run. There should be no differences between -the outputs of the two runs. - - use Font::TTF::Font; - - $f = Font::TTF::Font->open($ARGV[0]); - - # force a read of all the tables - $f->tables_do(sub { $_[0]->read; }); - - # force read of all glyphs (use read_dat to use lots of memory!) - # $f->{'loca'}->glyphs_do(sub { $_[0]->read; }); - $f->{'loca'}->glyphs_do(sub { $_[0]->read_dat; }); - # NB. no need to $g->update since $_[0]->{'glyf'}->out will do it for us - - $f->out($ARGV[1]); - $f->DESTROY; # forces close of $in and maybe memory reclaim! - -=head1 Installation - -If you have received this package as part of an Activestate PPM style .zip file -then type - - ppm install Font-TTF.ppd - -Otherwise. - -To configure this module, cd to the directory that contains this README file -and type the following. - - perl Makefile.PL - -Alternatively, if you plan to install Font::TTF somewhere other than -your system's perl library directory. You can type something like this: - - perl Makefile.PL PREFIX=/home/me/perl INSTALLDIRS=perl - -Then to build you run make. - - make - -If you have write access to the perl library directories, you may then -install by typing: - - make install - -To tidy up, type: - - make realclean - -Win32 users should use pmake instead of make. Alternatively installation can be -done on Win32 by typing: - - Setup - -Or using the install feature in tools like WinZip. - -=head1 CHANGES - -=head2 Future Changes - -I do not anticipate any more restructuring changes (but reserve the right to do so). - -=head1 AUTHOR - -Martin Hosken L - -Copyright Martin Hosken 1998 and following. - -No warranty or expression of effectiveness for anything, least of all anyone's -safety, is implied in this software or documentation. - -=head2 Licensing - -The Perl TTF module is licensed under the Perl Artistic License. - diff --git a/librarian/font-optimizer/ext/Font-TTF/TODO b/librarian/font-optimizer/ext/Font-TTF/TODO deleted file mode 100644 index a562dc4..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/TODO +++ /dev/null @@ -1,5 +0,0 @@ - -* update() is a mess. What is needed is a mark sweep clean algorithm where the - dirty is used only for tables that have changed. Thus if a table is updated - it could well become dirty! Also need to be able to pass a force parameter - to force a table to update and all the tables in its dependency tree. diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF.pm deleted file mode 100644 index 59237d3..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF.pm +++ /dev/null @@ -1,24 +0,0 @@ -package Font::TTF; - -$VERSION = '0.46'; # MJPH 26-JAN-2009 Various bug fixes, add Sill table -# $VERSION = '0.45'; # MJPH 11-JUN-2008 Packaging tidying -# $VERSION = '0.44'; # MJPH 9-JUN-2008 Various bug fixes -# $VERSION = '0.43'; # MJPH 20-NOV-2007 Add a test! -# $VERSION = '0.42'; # MJPH 11-OCT-2007 Add Volt2ttf support -# $VERSION = '0.41'; # MJPH 27-MAR-2007 Remove warnings from font copy -# Bug fixes in Ttopen, GDEF -# Remove redundant head and maxp ->reads -# $VERSION = '0.40'; # MJPH 31-JUL-2006 Add EBDT, EBLC tables -# $VERSION = 0.39; - -1; - -=head1 NAME - -Font::TTF - Perl module for TrueType Font hacking - -=head1 DESCRIPTION - -This module allows you to do almost anything to a TrueType/OpenType Font -including modify and inspect nearly all tables. - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/AATKern.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/AATKern.pm deleted file mode 100644 index 6aa1e62..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/AATKern.pm +++ /dev/null @@ -1,140 +0,0 @@ -package Font::TTF::AATKern; - -=head1 NAME - -Font::TTF::AATKern - AAT Kern table - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; -use Font::TTF::Kern::Subtable; - -@ISA = qw(Font::TTF::Table); - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self) = @_; - - $self->SUPER::read or return $self; - - my ($dat, $fh, $numSubtables); - $fh = $self->{' INFILE'}; - - $fh->read($dat, 8); - ($self->{'version'}, $numSubtables) = TTF_Unpack("vL", $dat); - - my $subtables = []; - foreach (1 .. $numSubtables) { - my $subtableStart = $fh->tell(); - - $fh->read($dat, 8); - my ($length, $coverage, $tupleIndex) = TTF_Unpack("LSS", $dat); - my $type = $coverage & 0x00ff; - - my $subtable = Font::TTF::Kern::Subtable->create($type, $coverage, $length); - $subtable->read($fh); - - $subtable->{'tupleIndex'} = $tupleIndex if $subtable->{'variation'}; - $subtable->{' PARENT'} = $self; - push @$subtables, $subtable; - } - - $self->{'subtables'} = $subtables; - - $self; -} - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying - -=cut - -sub out -{ - my ($self, $fh) = @_; - - return $self->SUPER::out($fh) unless $self->{' read'}; - - my $subtables = $self->{'subtables'}; - $fh->print(TTF_Pack("vL", $self->{'version'}, scalar @$subtables)); - - foreach (@$subtables) { - $_->out($fh); - } -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - - $self->read unless $self->{' read'}; - - $fh = 'STDOUT' unless defined $fh; - - $fh->printf("version %f\n", $self->{'version'}); - - my $subtables = $self->{'subtables'}; - foreach (@$subtables) { - $_->print($fh); - } -} - -sub dumpXML -{ - my ($self, $fh) = @_; - $self->read unless $self->{' read'}; - - my $post = $self->{' PARENT'}->{'post'}; - $post->read; - - $fh = 'STDOUT' unless defined $fh; - $fh->printf("\n", $self->{'version'}); - - my $subtables = $self->{'subtables'}; - foreach (@$subtables) { - $fh->printf("<%s", $_->type); - $fh->printf(" vertical=\"1\"") if $_->{'vertical'}; - $fh->printf(" crossStream=\"1\"") if $_->{'crossStream'}; - $fh->printf(" variation=\"1\"") if $_->{'variation'}; - $fh->printf(" tupleIndex=\"%s\"", $_->{'tupleIndex'}) if exists $_->{'tupleIndex'}; - $fh->printf(">\n"); - - $_->dumpXML($fh); - - $fh->printf("\n", $_->type); - } - - $fh->printf("\n"); -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/AATutils.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/AATutils.pm deleted file mode 100644 index 96ceb7e..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/AATutils.pm +++ /dev/null @@ -1,689 +0,0 @@ -package Font::TTF::AATutils; - -use strict; -use vars qw(@ISA @EXPORT); -require Exporter; - -use Font::TTF::Utils; -use IO::File; - -@ISA = qw(Exporter); -@EXPORT = qw( - AAT_read_lookup - AAT_pack_lookup - AAT_write_lookup - AAT_pack_classes - AAT_write_classes - AAT_pack_states - AAT_write_states - AAT_read_state_table - AAT_read_subtable - xmldump -); - -sub xmldump -{ - my ($var, $links, $depth, $processedVars, $type) = @_; - - $processedVars = {} unless (defined $processedVars); - print("\n") if $depth == 0; # not necessarily true encoding for all text! - - my $indent = "\t" x $depth; - - my ($objType, $addr) = ($var =~ m/^.+=(.+)\((.+)\)$/); - unless (defined $type) { - if (defined $addr) { - if (defined $processedVars->{$addr}) { - if ($links) { - printf("%s%s\n", $indent, "$objType"); - } - else { - printf("%s%s\n", $indent, "$objType"); - } - return; - } - $processedVars->{$addr} = 1; - } - } - - $type = ref $var unless defined $type; - - if ($type eq 'REF') { - printf("%s\n", $indent, $$var); - } - elsif ($type eq 'SCALAR') { - printf("%s%s\n", $indent, $var); - } - elsif ($type eq 'ARRAY') { - # printf("%s\n", $indent); - foreach (0 .. $#$var) { - if (ref($var->[$_])) { - printf("%s\n", $indent, $_); - xmldump($var->[$_], $links, $depth + 1, $processedVars); - printf("%s\n", $indent); - } - else { - printf("%s%s\n", $indent, $_, $var->[$_]); - } - } - # printf("%s\n", $indent); - } - elsif ($type eq 'HASH') { - # printf("%s\n", $indent); - foreach (sort keys %$var) { - if (ref($var->{$_})) { - printf("%s\n", $indent, $_); - xmldump($var->{$_}, $links, $depth + 1, $processedVars); - printf("%s\n", $indent); - } - else { - printf("%s%s\n", $indent, $_, $var->{$_}); - } - } - # printf("%s\n", $indent); - } - elsif ($type eq 'CODE') { - printf("%s\n", $indent, $var); - } - elsif ($type eq 'GLOB') { - printf("%s\n", $indent, $var); - } - elsif ($type eq '') { - printf("%s%s\n", $indent, $var); - } - else { - if ($links) { - printf("%s\n", $indent, $type, $addr); - } - else { - printf("%s\n", $indent, $type); - } - xmldump($var, $links, $depth + 1, $processedVars, $objType); - printf("%s\n", $indent); - } -} - -=head2 ($classes, $states) = AAT_read_subtable($fh, $baseOffset, $subtableStart, $limits) - -=cut - -sub AAT_read_subtable -{ - my ($fh, $baseOffset, $subtableStart, $limits) = @_; - - my $limit = 0xffffffff; - foreach (@$limits) { - $limit = $_ if ($_ > $subtableStart and $_ < $limit); - } - die if $limit == 0xffffffff; - - my $dat; - $fh->seek($baseOffset + $subtableStart, IO::File::SEEK_SET); - $fh->read($dat, $limit - $subtableStart); - - $dat; -} - -=head2 $length = AAT_write_state_table($fh, $classes, $states, $numExtraTables, $packEntry) - -$packEntry is a subroutine for packing an entry into binary form, called as - -$dat = $packEntry($entry, $entryTable, $numEntries) - -where the entry is a comma-separated list of nextStateOffset, flags, actions - -=cut - -sub AAT_pack_state_table -{ - my ($classes, $states, $numExtraTables, $packEntry) = @_; - - my ($dat) = pack("n*", (0) x (4 + $numExtraTables)); # placeholders for stateSize, classTable, stateArray, entryTable - - my ($firstGlyph, $lastGlyph) = (0xffff, 0, 0); - my (@classTable, $i); - foreach $i (0 .. $#$classes) { - my $class = $classes->[$i]; - foreach (@$class) { - $firstGlyph = $_ if $_ < $firstGlyph; - $lastGlyph = $_ if $_ > $lastGlyph; - $classTable[$_] = $i; - } - } - - my $classTable = length($dat); - $dat .= pack("nnC*", $firstGlyph, $lastGlyph - $firstGlyph + 1, - map { defined $classTable[$_] ? $classTable[$_] : 1 } ($firstGlyph .. $lastGlyph)); - $dat .= pack("C", 0) if (($lastGlyph - $firstGlyph) & 1) == 0; # pad if odd number of glyphs - - my $stateArray = length($dat); - my (@entries, %entries); - my $state = $states->[0]; - my $stateSize = @$state; - die "stateSize below minimum allowed (4)" if $stateSize < 4; - die "stateSize (" . $stateSize . ") too small for max class number (" . $#$classes . ")" if $stateSize < $#$classes + 1; - warn "state array has unreachable columns" if $stateSize > $#$classes + 1; - - foreach (@$states) { - die "inconsistent state size" if @$_ != $stateSize; - foreach (@$_) { - my $actions = $_->{'actions'}; - my $entry = join(",", $stateArray + $_->{'nextState'} * $stateSize, $_->{'flags'}, ref($actions) eq 'ARRAY' ? @$actions : $actions); - if (not defined $entries{$entry}) { - push @entries, $entry; - $entries{$entry} = $#entries; - die "too many different state array entries" if $#entries == 256; - } - $dat .= pack("C", $entries{$entry}); - } - } - $dat .= pack("C", 0) if (@$states & 1) != 0 and ($stateSize & 1) != 0; # pad if state array size is odd - - my $entryTable = length($dat); - $dat .= map { &$packEntry($_, $entryTable, $#entries + 1) } @entries; - - my ($dat1) = pack("nnnn", $stateSize, $classTable, $stateArray, $entryTable); - substr($dat, 0, length($dat1)) = $dat1; - - return $dat; -} - -sub AAT_write_state_table -{ - my ($fh, $classes, $states, $numExtraTables, $packEntry) = @_; - - my $stateTableStart = $fh->tell(); - - $fh->print(pack("n*", (0) x (4 + $numExtraTables))); # placeholders for stateSize, classTable, stateArray, entryTable - - my ($firstGlyph, $lastGlyph) = (0xffff, 0, 0); - my (@classTable, $i); - foreach $i (0 .. $#$classes) { - my $class = $classes->[$i]; - foreach (@$class) { - $firstGlyph = $_ if $_ < $firstGlyph; - $lastGlyph = $_ if $_ > $lastGlyph; - $classTable[$_] = $i; - } - } - - my $classTable = $fh->tell() - $stateTableStart; - $fh->print(pack("nnC*", $firstGlyph, $lastGlyph - $firstGlyph + 1, - map { defined $classTable[$_] ? $classTable[$_] : 1 } ($firstGlyph .. $lastGlyph))); - $fh->print(pack("C", 0)) if (($lastGlyph - $firstGlyph) & 1) == 0; # pad if odd number of glyphs - - my $stateArray = $fh->tell() - $stateTableStart; - my (@entries, %entries); - my $state = $states->[0]; - my $stateSize = @$state; - die "stateSize below minimum allowed (4)" if $stateSize < 4; - die "stateSize (" . $stateSize . ") too small for max class number (" . $#$classes . ")" if $stateSize < $#$classes + 1; - warn "state array has unreachable columns" if $stateSize > $#$classes + 1; - - foreach (@$states) { - die "inconsistent state size" if @$_ != $stateSize; - foreach (@$_) { - my $actions = $_->{'actions'}; - my $entry = join(",", $stateArray + $_->{'nextState'} * $stateSize, $_->{'flags'}, ref($actions) eq 'ARRAY' ? @$actions : $actions); - if (not defined $entries{$entry}) { - push @entries, $entry; - $entries{$entry} = $#entries; - die "too many different state array entries" if $#entries == 256; - } - $fh->print(pack("C", $entries{$entry})); - } - } - $fh->print(pack("C", 0)) if (@$states & 1) != 0 and ($stateSize & 1) != 0; # pad if state array size is odd - - my $entryTable = $fh->tell() - $stateTableStart; - $fh->print(map { &$packEntry($_, $entryTable, $#entries + 1) } @entries); - - my $length = $fh->tell() - $stateTableStart; - $fh->seek($stateTableStart, IO::File::SEEK_SET); - $fh->print(pack("nnnn", $stateSize, $classTable, $stateArray, $entryTable)); - - $fh->seek($stateTableStart + $length, IO::File::SEEK_SET); - $length; -} - -sub AAT_pack_classes -{ - my ($classes) = @_; - - my ($firstGlyph, $lastGlyph) = (0xffff, 0, 0); - my (@classTable, $i); - foreach $i (0 .. $#$classes) { - my $class = $classes->[$i]; - foreach (@$class) { - $firstGlyph = $_ if $_ < $firstGlyph; - $lastGlyph = $_ if $_ > $lastGlyph; - $classTable[$_] = $i; - } - } - - my ($dat) = pack("nnC*", $firstGlyph, $lastGlyph - $firstGlyph + 1, - map { defined $classTable[$_] ? $classTable[$_] : 1 } ($firstGlyph .. $lastGlyph)); - $dat .= pack("C", 0) if (($lastGlyph - $firstGlyph) & 1) == 0; # pad if odd number of glyphs - - return $dat; -} - -sub AAT_write_classes -{ - my ($fh, $classes) = @_; - - $fh->print(AAT_pack_classes($fh, $classes)); -} - -sub AAT_pack_states -{ - my ($classes, $stateArray, $states, $buildEntryProc) = @_; - - my ($entries, %entryHash); - my $state = $states->[0]; - my $stateSize = @$state; - - die "stateSize below minimum allowed (4)" if $stateSize < 4; - die "stateSize (" . $stateSize . ") too small for max class number (" . $#$classes . ")" if $stateSize < $#$classes + 1; - warn "state array has unreachable columns" if $stateSize > $#$classes + 1; - - my ($dat); - foreach (@$states) { - die "inconsistent state size" if @$_ != $stateSize; - foreach (@$_) { - my $entry = join(",", $stateArray + $_->{'nextState'} * $stateSize, &$buildEntryProc($_)); - if (not defined $entryHash{$entry}) { - push @$entries, $entry; - $entryHash{$entry} = $#$entries; - die "too many different state array entries" if $#$entries == 256; - } - $dat .= pack("C", $entryHash{$entry}); - } - } - $dat .= pack("C", 0) if (@$states & 1) != 0 and ($stateSize & 1) != 0; # pad if state array size is odd - - ($dat, $stateSize, $entries); -} - -sub AAT_write_states -{ - my ($fh, $classes, $stateArray, $states, $buildEntryProc) = @_; - - my ($entries, %entryHash); - my $state = $states->[0]; - my $stateSize = @$state; - - die "stateSize below minimum allowed (4)" if $stateSize < 4; - die "stateSize (" . $stateSize . ") too small for max class number (" . $#$classes . ")" if $stateSize < $#$classes + 1; - warn "state array has unreachable columns" if $stateSize > $#$classes + 1; - - foreach (@$states) { - die "inconsistent state size" if @$_ != $stateSize; - foreach (@$_) { - my $entry = join(",", $stateArray + $_->{'nextState'} * $stateSize, &$buildEntryProc($_)); - if (not defined $entryHash{$entry}) { - push @$entries, $entry; - $entryHash{$entry} = $#$entries; - die "too many different state array entries" if $#$entries == 256; - } - $fh->print(pack("C", $entryHash{$entry})); - } - } - $fh->print(pack("C", 0)) if (@$states & 1) != 0 and ($stateSize & 1) != 0; # pad if state array size is odd - - ($stateSize, $entries); -} - -=head2 ($classes, $states, $entries) = AAT_read_state_table($fh, $numActionWords) - -=cut - -sub AAT_read_state_table -{ - my ($fh, $numActionWords) = @_; - - my $stateTableStart = $fh->tell(); - my $dat; - $fh->read($dat, 8); - my ($stateSize, $classTable, $stateArray, $entryTable) = unpack("nnnn", $dat); - - my $classes; # array of lists of glyphs - - $fh->seek($stateTableStart + $classTable, IO::File::SEEK_SET); - $fh->read($dat, 4); - my ($firstGlyph, $nGlyphs) = unpack("nn", $dat); - $fh->read($dat, $nGlyphs); - foreach (unpack("C*", $dat)) { - if ($_ != 1) { - my $class = $classes->[$_]; - push(@$class, $firstGlyph); - $classes->[$_] = $class unless defined $classes->[$_]; - } - $firstGlyph++; - } - - $fh->seek($stateTableStart + $stateArray, IO::File::SEEK_SET); - my $states; # array of arrays of hashes{nextState, flags, actions} - - my $entrySize = 4 + ($numActionWords * 2); - my $lastState = 1; - my $entries; - while ($#$states < $lastState) { - $fh->read($dat, $stateSize); - my @stateEntries = unpack("C*", $dat); - my $state; - foreach (@stateEntries) { - if (not defined $entries->[$_]) { - my $loc = $fh->tell(); - $fh->seek($stateTableStart + $entryTable + ($_ * $entrySize), IO::File::SEEK_SET); - $fh->read($dat, $entrySize); - my ($nextState, $flags, $actions); - ($nextState, $flags, @$actions) = unpack("n*", $dat); - $nextState -= $stateArray; - $nextState /= $stateSize; - $entries->[$_] = { 'nextState' => $nextState, 'flags' => $flags }; - $entries->[$_]->{'actions'} = $actions if $numActionWords > 0; - $lastState = $nextState if ($nextState > $lastState); - $fh->seek($loc, IO::File::SEEK_SET); - } - push(@$state, $entries->[$_]); - } - push(@$states, $state); - } - - ($classes, $states, $entries); -} - -=head2 ($format, $lookup) = AAT_read_lookup($fh, $valueSize, $length, $default) - -=cut - -sub AAT_read_lookup -{ - my ($fh, $valueSize, $length, $default) = @_; - - my $lookupStart = $fh->tell(); - my ($dat, $unpackChar); - if ($valueSize == 1) { - $unpackChar = "C"; - } - elsif ($valueSize == 2) { - $unpackChar = "n"; - } - elsif ($valueSize == 4) { - $unpackChar = "N"; - } - else { - die "unsupported value size"; - } - - $fh->read($dat, 2); - my $format = unpack("n", $dat); - my $lookup; - - if ($format == 0) { - $fh->read($dat, $length - 2); - my $i = -1; - $lookup = { map { $i++; ($_ != $default) ? ($i, $_) : () } unpack($unpackChar . "*", $dat) }; - } - - elsif ($format == 2) { - $fh->read($dat, 10); - my ($unitSize, $nUnits, $searchRange, $entrySelector, $rangeShift) = unpack("nnnnn", $dat); - die if $unitSize != 4 + $valueSize; - foreach (1 .. $nUnits) { - $fh->read($dat, $unitSize); - my ($lastGlyph, $firstGlyph, $value) = unpack("nn" . $unpackChar, $dat); - if ($firstGlyph != 0xffff and $value != $default) { - foreach ($firstGlyph .. $lastGlyph) { - $lookup->{$_} = $value; - } - } - } - } - - elsif ($format == 4) { - $fh->read($dat, 10); - my ($unitSize, $nUnits, $searchRange, $entrySelector, $rangeShift) = unpack("nnnnn", $dat); - die if $unitSize != 6; - foreach (1 .. $nUnits) { - $fh->read($dat, $unitSize); - my ($lastGlyph, $firstGlyph, $offset) = unpack("nnn", $dat); - if ($firstGlyph != 0xffff) { - my $loc = $fh->tell(); - $fh->seek($lookupStart + $offset, IO::File::SEEK_SET); - $fh->read($dat, ($lastGlyph - $firstGlyph + 1) * $valueSize); - my @values = unpack($unpackChar . "*", $dat); - foreach (0 .. $lastGlyph - $firstGlyph) { - $lookup->{$firstGlyph + $_} = $values[$_] if $values[$_] != $default; - } - $fh->seek($loc, IO::File::SEEK_SET); - } - } - } - - elsif ($format == 6) { - $fh->read($dat, 10); - my ($unitSize, $nUnits, $searchRange, $entrySelector, $rangeShift) = unpack("nnnnn", $dat); - die if $unitSize != 2 + $valueSize; - foreach (1 .. $nUnits) { - $fh->read($dat, $unitSize); - my ($glyph, $value) = unpack("n" . $unpackChar, $dat); - $lookup->{$glyph} = $value if $glyph != 0xffff and $value != $default; - } - } - - elsif ($format == 8) { - $fh->read($dat, 4); - my ($firstGlyph, $glyphCount) = unpack("nn", $dat); - $fh->read($dat, $glyphCount * $valueSize); - $firstGlyph--; - $lookup = { map { $firstGlyph++; $_ != $default ? ($firstGlyph, $_) : () } unpack($unpackChar . "*", $dat) }; - } - - else { - die "unknown lookup format"; - } - - $fh->seek($lookupStart + $length, IO::File::SEEK_SET); - - ($format, $lookup); -} - -=head2 AAT_write_lookup($fh, $format, $lookup, $valueSize, $default) - -=cut - -sub AAT_pack_lookup -{ - my ($format, $lookup, $valueSize, $default) = @_; - - my $packChar; - if ($valueSize == 1) { - $packChar = "C"; - } - elsif ($valueSize == 2) { - $packChar = "n"; - } - elsif ($valueSize == 4) { - $packChar = "N"; - } - else { - die "unsupported value size"; - } - - my ($dat) = pack("n", $format); - - my ($firstGlyph, $lastGlyph) = (0xffff, 0); - foreach (keys %$lookup) { - $firstGlyph = $_ if $_ < $firstGlyph; - $lastGlyph = $_ if $_ > $lastGlyph; - } - my $glyphCount = $lastGlyph - $firstGlyph + 1; - - if ($format == 0) { - $dat .= pack($packChar . "*", map { defined $lookup->{$_} ? $lookup->{$_} : defined $default ? $default : $_ } (0 .. $lastGlyph)); - } - - elsif ($format == 2) { - my $prev = $default; - my $segStart = $firstGlyph; - my $dat1; - foreach ($firstGlyph .. $lastGlyph + 1) { - my $val = $lookup->{$_}; - $val = $default unless defined $val; - if ($val != $prev) { - $dat1 .= pack("nn" . $packChar, $_ - 1, $segStart, $prev) if $prev != $default; - $prev = $val; - $segStart = $_; - } - } - $dat1 .= pack("nn" . $packChar, 0xffff, 0xffff, 0); - my $unitSize = 4 + $valueSize; - $dat .= pack("nnnnn", $unitSize, TTF_bininfo(length($dat1) / $unitSize, $unitSize)); - $dat .= $dat1; - } - - elsif ($format == 4) { - my $segArray = new Font::TTF::Segarr($valueSize); - $segArray->add_segment($firstGlyph, 1, map { $lookup->{$_} } ($firstGlyph .. $lastGlyph)); - my ($start, $end, $offset); - $offset = 12 + @$segArray * 6 + 6; # 12 is size of format word + binSearchHeader; 6 bytes per segment; 6 for terminating segment - my $dat1; - foreach (@$segArray) { - $start = $_->{'START'}; - $end = $start + $_->{'LEN'} - 1; - $dat1 .= pack("nnn", $end, $start, $offset); - $offset += $_->{'LEN'} * 2; - } - $dat1 .= pack("nnn", 0xffff, 0xffff, 0); - $dat .= pack("nnnnn", 6, TTF_bininfo(length($dat1) / 6, 6)); - $dat .= $dat1; - foreach (@$segArray) { - $dat1 = $_->{'VAL'}; - $dat .= pack($packChar . "*", @$dat1); - } - } - - elsif ($format == 6) { - die "unsupported" if $valueSize != 2; - my $dat1 = pack("n*", map { $_, $lookup->{$_} } sort { $a <=> $b } grep { $lookup->{$_} ne $default } keys %$lookup); - my $unitSize = 2 + $valueSize; - $dat .= pack("nnnnn", $unitSize, TTF_bininfo(length($dat1) / $unitSize, $unitSize)); - $dat .= $dat1; - } - - elsif ($format == 8) { - $dat .= pack("nn", $firstGlyph, $lastGlyph - $firstGlyph + 1); - $dat .= pack($packChar . "*", map { defined $lookup->{$_} ? $lookup->{$_} : defined $default ? $default : $_ } ($firstGlyph .. $lastGlyph)); - } - - else { - die "unknown lookup format"; - } - - my $padBytes = (4 - (length($dat) & 3)) & 3; - $dat .= pack("C*", (0) x $padBytes); - - return $dat; -} - -sub AAT_write_lookup -{ - my ($fh, $format, $lookup, $valueSize, $default) = @_; - - my $lookupStart = $fh->tell(); - my $packChar; - if ($valueSize == 1) { - $packChar = "C"; - } - elsif ($valueSize == 2) { - $packChar = "n"; - } - elsif ($valueSize == 4) { - $packChar = "N"; - } - else { - die "unsupported value size"; - } - - $fh->print(pack("n", $format)); - - my ($firstGlyph, $lastGlyph) = (0xffff, 0); - foreach (keys %$lookup) { - $firstGlyph = $_ if $_ < $firstGlyph; - $lastGlyph = $_ if $_ > $lastGlyph; - } - my $glyphCount = $lastGlyph - $firstGlyph + 1; - - if ($format == 0) { - $fh->print(pack($packChar . "*", map { defined $lookup->{$_} ? $lookup->{$_} : defined $default ? $default : $_ } (0 .. $lastGlyph))); - } - - elsif ($format == 2) { - my $prev = $default; - my $segStart = $firstGlyph; - my $dat; - foreach ($firstGlyph .. $lastGlyph + 1) { - my $val = $lookup->{$_}; - $val = $default unless defined $val; - if ($val != $prev) { - $dat .= pack("nn" . $packChar, $_ - 1, $segStart, $prev) if $prev != $default; - $prev = $val; - $segStart = $_; - } - } - $dat .= pack("nn" . $packChar, 0xffff, 0xffff, 0); - my $unitSize = 4 + $valueSize; - $fh->print(pack("nnnnn", $unitSize, TTF_bininfo(length($dat) / $unitSize, $unitSize))); - $fh->print($dat); - } - - elsif ($format == 4) { - my $segArray = new Font::TTF::Segarr($valueSize); - $segArray->add_segment($firstGlyph, 1, map { $lookup->{$_} } ($firstGlyph .. $lastGlyph)); - my ($start, $end, $offset); - $offset = 12 + @$segArray * 6 + 6; # 12 is size of format word + binSearchHeader; 6 bytes per segment; 6 for terminating segment - my $dat; - foreach (@$segArray) { - $start = $_->{'START'}; - $end = $start + $_->{'LEN'} - 1; - $dat .= pack("nnn", $end, $start, $offset); - $offset += $_->{'LEN'} * 2; - } - $dat .= pack("nnn", 0xffff, 0xffff, 0); - $fh->print(pack("nnnnn", 6, TTF_bininfo(length($dat) / 6, 6))); - $fh->print($dat); - foreach (@$segArray) { - $dat = $_->{'VAL'}; - $fh->print(pack($packChar . "*", @$dat)); - } - } - - elsif ($format == 6) { - die "unsupported" if $valueSize != 2; - my $dat = pack("n*", map { $_, $lookup->{$_} } sort { $a <=> $b } grep { $lookup->{$_} ne $default } keys %$lookup); - my $unitSize = 2 + $valueSize; - $fh->print(pack("nnnnn", $unitSize, TTF_bininfo(length($dat) / $unitSize, $unitSize))); - $fh->print($dat); - } - - elsif ($format == 8) { - $fh->print(pack("nn", $firstGlyph, $lastGlyph - $firstGlyph + 1)); - $fh->print(pack($packChar . "*", map { defined $lookup->{$_} ? $lookup->{$_} : defined $default ? $default : $_ } ($firstGlyph .. $lastGlyph))); - } - - else { - die "unknown lookup format"; - } - - my $length = $fh->tell() - $lookupStart; - my $padBytes = (4 - ($length & 3)) & 3; - $fh->print(pack("C*", (0) x $padBytes)); - $length += $padBytes; - - $length; -} - -1; - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Anchor.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Anchor.pm deleted file mode 100644 index b901e83..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Anchor.pm +++ /dev/null @@ -1,216 +0,0 @@ -package Font::TTF::Anchor; - -=head1 NAME - -Font::TTF::Anchor - Anchor points for GPOS tables - -=head1 DESCRIPTION - -The Anchor defines an anchor point on a glyph providing various information -depending on how much is available, including such information as the co-ordinates, -a curve point and even device specific modifiers. - -=head1 INSTANCE VARIABLES - -=over 4 - -=item x - -XCoordinate of the anchor point - -=item y - -YCoordinate of the anchor point - -=item p - -Curve point on the glyph to use as the anchor point - -=item xdev - -Device table (delta) for the xcoordinate - -=item ydev - -Device table (delta) for the ycoordinate - -=item xid - -XIdAnchor for multiple master horizontal metric id - -=item yid - -YIdAnchor for multiple master vertical metric id - -=back - -=head1 METHODS - -=cut - -use strict; -use Font::TTF::Utils; - - -=head2 new - -Creates a new Anchor - -=cut - -sub new -{ - my ($class) = shift; - my ($self) = {@_}; - - bless $self, $class; -} - - -=head2 read($fh) - -Reads the anchor from the given file handle at that point. The file handle is left -at an arbitrary read point, usually the end of something! - -=cut - -sub read -{ - my ($self, $fh) = @_; - my ($dat, $loc, $fmt, $p, $xoff, $yoff); - - $fh->read($dat, 6); - $fmt = unpack('n', $dat); - if ($fmt == 4) - { ($self->{'xid'}, $self->{'yid'}) = TTF_Unpack('S2', substr($dat,2)); } - else - { ($self->{'x'}, $self->{'y'}) = TTF_Unpack('s2', substr($dat,2)); } - - if ($fmt == 2) - { - $fh->read($dat, 2); - $self->{'p'} = unpack('n', $dat); - } elsif ($fmt == 3) - { - $fh->read($dat, 4); - ($xoff, $yoff) = unpack('n2', $dat); - $loc = $fh->tell() - 10; - if ($xoff) - { - $fh->seek($loc + $xoff, 0); - $self->{'xdev'} = Font::TTF::Delta->new->read($fh); - } - if ($yoff) - { - $fh->seek($loc + $yoff, 0); - $self->{'ydev'} = Font::TTF::Delta->new->read($fh); - } - } - $self; -} - - -=head2 out($fh, $style) - -Outputs the Anchor to the given file handle at this point also addressing issues -of deltas. If $style is set, then no output is sent to the file handle. The return -value is the output string. - -=cut - -sub out -{ - my ($self, $fh, $style) = @_; - my ($xoff, $yoff, $fmt, $out); - - if (defined $self->{'xid'} || defined $self->{'yid'}) - { $out = TTF_Pack('SSS', 4, $self->{'xid'}, $self->{'yid'}); } - elsif (defined $self->{'p'}) - { $out = TTF_Pack('Ssss', 2, @{$self}{'x', 'y', 'p'}); } - elsif (defined $self->{'xdev'} || defined $self->{'ydev'}) - { - $out = TTF_Pack('Sss', 3, @{$self}{'x', 'y'}); - if (defined $self->{'xdev'}) - { - $out .= pack('n2', 10, 0); - $out .= $self->{'xdev'}->out($fh, 1); - $yoff = length($out) - 10; - } - else - { $out .= pack('n2', 0, 0); } - if (defined $self->{'ydev'}) - { - $yoff = 10 unless $yoff; - substr($out, 8, 2) = pack('n', $yoff); - $out .= $self->{'ydev'}->out($fh, 1); - } - } else - { $out = TTF_Pack('Sss', 1, @{$self}{'x', 'y'}); } - $fh->print($out) unless $style; - $out; -} - - -sub signature -{ - my ($self) = @_; - return join (",", map {"${_}=$self->{$_}"} qw(x y p xdev ydev xid yid)); -} - - -=head2 $a->out_xml($context) - -Outputs the anchor in XML - -=cut - -sub out_xml -{ - my ($self, $context, $depth) = @_; - my ($fh) = $context->{'fh'}; - my ($end); - - $fh->print("$depthprint(" p='$self->{'p'}'") if defined ($self->{'p'}); - $end = (defined $self->{'xdev'} || defined $self->{'ydev'} || defined $self->{'xid'} || defined $self->{'yid'}); - unless ($end) - { - $fh->print("/>\n"); - return $self; - } - - if (defined $self->{'xdev'}) - { - $fh->print("$depth$context->{'indent'}\n"); - $self->{'xdev'}->out_xml($context, $depth . ($context->{'indent'} x 2)); - $fh->print("$depth$context->{'indent'}\n"); - } - - if (defined $self->{'ydev'}) - { - $fh->print("$depth$context->{'indent'}\n"); - $self->{'ydev'}->out_xml($context, $depth . ($context->{'indent'} x 2)); - $fh->print("$depth$context->{'indent'}\n"); - } - - if (defined $self->{'xid'} || defined $self->{'yid'}) - { - $fh->print("$depth$context->{'indent'}print(" xid='$self->{'xid'}'") if defined ($self->{'xid'}); - $fh->print(" yid='$self->{'yid'}'") if defined ($self->{'yid'}); - $fh->print("/>\n"); - } - $fh->print("$depth\n"); - $self; -} - - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - -1; - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Bsln.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Bsln.pm deleted file mode 100644 index 281a512..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Bsln.pm +++ /dev/null @@ -1,163 +0,0 @@ -package Font::TTF::Bsln; - -=head1 NAME - -Font::TTF::Bsln - Baseline table in a font - -=head1 DESCRIPTION - -=head1 INSTANCE VARIABLES - -=item version - -=item xformat - -=item defaultBaseline - -=item deltas - -=item stdGlyph - -=item ctlPoints - -=item lookupFormat - -=item lookup - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); - -use Font::TTF::AATutils; -use Font::TTF::Utils; -require Font::TTF::Table; - -@ISA = qw(Font::TTF::Table); - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self) = @_; - my ($dat, $fh); - - $self->SUPER::read or return $self; - - $fh = $self->{' INFILE'}; - $fh->read($dat, 8); - my ($version, $format, $defaultBaseline) = TTF_Unpack("vSS", $dat); - - if ($format == 0 or $format == 1) { - $fh->read($dat, 64); - $self->{'deltas'} = [TTF_Unpack("s*", $dat)]; - } - elsif ($format == 2 or $format == 3) { - $fh->read($dat, 2); - $self->{'stdGlyph'} = unpack("n", $dat); - $fh->read($dat, 64); - $self->{'ctlPoints'} = unpack("n*", $dat); - } - else { - die "unknown table format"; - } - - if ($format == 1 or $format == 3) { - my $len = $self->{' LENGTH'} - ($fh->tell() - $self->{' OFFSET'}); - my ($lookupFormat, $lookup) = AAT_read_lookup($fh, 2, $len, $defaultBaseline); - $self->{'lookupFormat'} = $lookupFormat; - $self->{'lookup'} = $lookup; - } - - $self->{'version'} = $version; - $self->{'format'} = $format; - $self->{'defaultBaseline'} = $defaultBaseline; - - $self; -} - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying - -=cut - -sub out -{ - my ($self, $fh) = @_; - - return $self->SUPER::out($fh) unless $self->{' read'}; - - my $format = $self->{'format'}; - my $defaultBaseline = $self->{'defaultBaseline'}; - $fh->print(TTF_Pack("vSS", $self->{'version'}, $format, $defaultBaseline)); - - AAT_write_lookup($fh, $self->{'lookupFormat'}, $self->{'lookup'}, 2, $defaultBaseline) if ($format == 1 or $format == 3); -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - - $self->read; - - $fh = 'STDOUT' unless defined $fh; - - my $format = $self->{'format'}; - $fh->printf("version %f\nformat %d\ndefaultBaseline %d\n", $self->{'version'}, $format, $self->{'defaultBaseline'}); - if ($format == 0 or $format == 1) { - $fh->printf("\tdeltas:\n"); - my $deltas = $self->{'deltas'}; - foreach (0 .. 31) { - $fh->printf("\t\t%d: %d%s\n", $_, $deltas->[$_], defined baselineName_($_) ? "\t# " . baselineName_($_) : ""); - } - } - if ($format == 2 or $format == 3) { - $fh->printf("\tstdGlyph = %d\n", $self->{'stdGlyph'}); - my $ctlPoints = $self->{'ctlPoints'}; - foreach (0 .. 31) { - $fh->printf("\t\t%d: %d%s\n", $_, $ctlPoints->[$_], defined baselineName_($_) ? "\t# " . baselineName_($_) : ""); - } - } - if ($format == 1 or $format == 3) { - $fh->printf("lookupFormat %d\n", $self->{'lookupFormat'}); - my $lookup = $self->{'lookup'}; - foreach (sort { $a <=> $b } keys %$lookup) { - $fh->printf("\tglyph %d: %d%s\n", $_, $lookup->{$_}, defined baselineName_($_) ? "\t# " . baselineName_($_) : ""); - } - } -} - -sub baselineName_ -{ - my ($b) = @_; - my @baselines = ( 'Roman', 'Ideographic centered', 'Ideographic low', 'Hanging', 'Math' ); - $baselines[$b]; -} - -1; - - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Changes b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Changes deleted file mode 100644 index 2382b82..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Changes +++ /dev/null @@ -1,108 +0,0 @@ -Note. The version number implies a release point. Thus changes that go into a -version occur above the version number, not after it. - -* 0.05 -** cmap - debug reverse() - provide scripts as .pl instead of .bat to placate Unix world - rename makefile.pl to Makefile.PL to keep Unix happy - Add ttfremap script - -* 0.06 .. 0.08 - Fixes to get this stuff working in Unix - -* 0.09 - Never released - -* 0.10 -** cmap - Make reverse return the lowest codepoint that matches rather than - the highest -** font - Use IO::File everywhere to allow passing in of psuedo-file objects - rather than file names -** Utils - Debug FDot2.14 conversion - -* 0.11 -** cmap - Don't store empty entries in the cmap - -* 0.12 -Various changes to reduce warnings - -** glyph - Add update_bbox - Do full glyph writes if loca read rather than glyf read - Get glyph update working usefully. Clarify glyf->read - -* 0.13 - -** glyph - Debug update_bbox for compound glyphs - Add empty() to clear to unread state (allows apps to save memory) - -** OS/2 - update update() to account for new cmap structure - -** Post - Correct mu to pi in Postscript name list. The list now follows the - MS convention for good or ill. - -** Table - Add empty() to clear a table to its unread state - -** Scripts -*** psfix - Added. Creates Post table based on cmap information - -*** eurofix - Added bullet hacking and generally backwards, forwards, all - ways mapping. - -*** ttfenc - Now supports the difference between MS post name list and TeXs - -* 0.14 - - Sort out mix up over CVS mess - -* 0.15 - -** Table - read_dat no longer marks table as read - -** Cvt_ - Mark table as read when read - -** Fpgm - Mark table as read when read - -** Prep - Mark table as read when read - -** Font - Add support for Mac sfnt version code ('true') - Be stricter on out @fontlist, only output tables that exist - -* 0.16 - -** Install - add pmake support - -** glyph - tidy up pod - -** kern - tidy up pod - -** name - add utf8 support - -* 0.17 - -** Utils - Debug TTF_bininfo >>= seems to have stopped working! - -* 0.18 - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Cmap.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Cmap.pm deleted file mode 100644 index bb3d63c..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Cmap.pm +++ /dev/null @@ -1,612 +0,0 @@ -package Font::TTF::Cmap; - -=head1 NAME - -Font::TTF::Cmap - Character map table - -=head1 DESCRIPTION - -Looks after the character map. For ease of use, the actual cmap is held in -a hash against codepoint. Thus for a given table: - - $gid = $font->{'cmap'}{'Tables'}[0]{'val'}{$code}; - -Note that C<$code> should be a true value (0x1234) rather than a string representation. - -=head1 INSTANCE VARIABLES - -The instance variables listed here are not preceeded by a space due to their -emulating structural information in the font. - -=over 4 - -=item Num - -Number of subtables in this table - -=item Tables - -An array of subtables ([0..Num-1]) - -=back - -Each subtables also has its own instance variables which are, again, not -preceeded by a space. - -=over 4 - -=item Platform - -The platform number for this subtable - -=item Encoding - -The encoding number for this subtable - -=item Format - -Gives the stored format of this subtable - -=item Ver - -Gives the version (or language) information for this subtable - -=item val - -A hash keyed by the codepoint value (not a string) storing the glyph id - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Table; -use Font::TTF::Utils; - -@ISA = qw(Font::TTF::Table); - - -=head2 $t->read - -Reads the cmap into memory. Format 4 subtables read the whole subtable and -fill in the segmented array accordingly. - -=cut - -sub read -{ - my ($self) = @_; - my ($dat, $i, $j, $k, $id, @ids, $s); - my ($start, $end, $range, $delta, $form, $len, $num, $ver, $sg); - my ($fh) = $self->{' INFILE'}; - - $self->SUPER::read or return $self; - $fh->read($dat, 4); - $self->{'Num'} = unpack("x2n", $dat); - $self->{'Tables'} = []; - for ($i = 0; $i < $self->{'Num'}; $i++) - { - $s = {}; - $fh->read($dat, 8); - ($s->{'Platform'}, $s->{'Encoding'}, $s->{'LOC'}) = (unpack("nnN", $dat)); - $s->{'LOC'} += $self->{' OFFSET'}; - push(@{$self->{'Tables'}}, $s); - } - for ($i = 0; $i < $self->{'Num'}; $i++) - { - $s = $self->{'Tables'}[$i]; - $fh->seek($s->{'LOC'}, 0); - $fh->read($dat, 2); - $form = unpack("n", $dat); - - $s->{'Format'} = $form; - if ($form == 0) - { - my $j = 0; - - $fh->read($dat, 4); - ($len, $s->{'Ver'}) = unpack('n2', $dat); - $fh->read($dat, 256); - $s->{'val'} = {map {$j++; ($_ ? ($j - 1, $_) : ())} unpack("C*", $dat)}; - } elsif ($form == 6) - { - my ($start, $ecount); - - $fh->read($dat, 8); - ($len, $s->{'Ver'}, $start, $ecount) = unpack('n4', $dat); - $fh->read($dat, $ecount << 1); - $s->{'val'} = {map {$start++; ($_ ? ($start - 1, $_) : ())} unpack("n*", $dat)}; - } elsif ($form == 2) # Contributed by Huw Rogers - { - $fh->read($dat, 4); - ($len, $s->{'Ver'}) = unpack('n2', $dat); - $fh->read($dat, 512); - my ($j, $k, $l, $m, $n, @subHeaderKeys, @subHeaders, $subHeader); - $n = 1; - for ($j = 0; $j < 256; $j++) { - my $k = unpack('@'.($j<<1).'n', $dat)>>3; - $n = $k + 1 if $k >= $n; - $subHeaders[$subHeaderKeys[$j] = $k] ||= [ ]; - } - $fh->read($dat, $n<<3); # read subHeaders[] - for ($k = 0; $k < $n; $k++) { - $subHeader = $subHeaders[$k]; - $l = $k<<3; - @$subHeader = unpack('@'.$l.'n4', $dat); - $subHeader->[2] = unpack('s', pack('S', $subHeader->[2])) - if $subHeader->[2] & 0x8000; # idDelta - $subHeader->[3] = - ($subHeader->[3] - (($n - $k)<<3) + 6)>>1; # idRangeOffset - } - $fh->read($dat, $len - ($n<<3) - 518); # glyphIndexArray[] - for ($j = 0; $j < 256; $j++) { - $k = $subHeaderKeys[$j]; - $subHeader = $subHeaders[$k]; - unless ($k) { - $l = $j - $subHeader->[0]; - if ($l >= 0 && $l < $subHeader->[1]) { - $m = unpack('@'.(($l + $subHeader->[3])<<1).'n', $dat); - $m += $subHeader->[2] if $m; - $s->{'val'}{$j} = $m; - } - } else { - for ($l = 0; $l < $subHeader->[1]; $l++) { - $m = unpack('@'.(($l + $subHeader->[3])<<1).'n', $dat); - $m += $subHeader->[2] if $m; - $s->{'val'}{($j<<8) + $l + $subHeader->[0]} = $m; - } - } - } - } elsif ($form == 4) - { - $fh->read($dat, 12); - ($len, $s->{'Ver'}, $num) = unpack('n3', $dat); - $num >>= 1; - $fh->read($dat, $len - 14); - for ($j = 0; $j < $num; $j++) - { - $end = unpack("n", substr($dat, $j << 1, 2)); - $start = unpack("n", substr($dat, ($j << 1) + ($num << 1) + 2, 2)); - $delta = unpack("n", substr($dat, ($j << 1) + ($num << 2) + 2, 2)); - $delta -= 65536 if $delta > 32767; - $range = unpack("n", substr($dat, ($j << 1) + $num * 6 + 2, 2)); - for ($k = $start; $k <= $end; $k++) - { - if ($range == 0 || $range == 65535) # support the buggy FOG with its range=65535 for final segment - { $id = $k + $delta; } - else - { $id = unpack("n", substr($dat, ($j << 1) + $num * 6 + - 2 + ($k - $start) * 2 + $range, 2)) + $delta; } - $id -= 65536 if $id >= 65536; - $s->{'val'}{$k} = $id if ($id); - } - } - } elsif ($form == 8 || $form == 12) - { - $fh->read($dat, 10); - ($len, $s->{'Ver'}) = unpack('x2N2', $dat); - if ($form == 8) - { - $fh->read($dat, 8196); - $num = unpack("N", substr($dat, 8192, 4)); # don't need the map - } else - { - $fh->read($dat, 4); - $num = unpack("N", $dat); - } - $fh->read($dat, 12 * $num); - for ($j = 0; $j < $num; $j++) - { - ($start, $end, $sg) = unpack("N3", substr($dat, $j * 12, 12)); - for ($k = $start; $k <= $end; $k++) - { $s->{'val'}{$k} = $sg++; } - } - } elsif ($form == 10) - { - $fh->read($dat, 18); - ($len, $s->{'Ver'}, $start, $num) = unpack('x2N4', $dat); - $fh->read($dat, $num << 1); - for ($j = 0; $j < $num; $j++) - { $s->{'val'}{$start + $j} = unpack("n", substr($dat, $j << 1, 2)); } - } - } - $self; -} - - -=head2 $t->ms_lookup($uni) - -Finds a Unicode table, giving preference to the MS one, and looks up the given -Unicode codepoint in it to find the glyph id. - -=cut - -sub ms_lookup -{ - my ($self, $uni) = @_; - - $self->find_ms || return undef unless (defined $self->{' mstable'}); - return $self->{' mstable'}{'val'}{$uni}; -} - - -=head2 $t->find_ms - -Finds the a Unicode table, giving preference to the Microsoft one, and sets the C instance variable -to it if found. Returns the table it finds. - -=cut -sub find_ms -{ - my ($self) = @_; - my ($i, $s, $alt, $found); - - return $self->{' mstable'} if defined $self->{' mstable'}; - $self->read; - for ($i = 0; $i < $self->{'Num'}; $i++) - { - $s = $self->{'Tables'}[$i]; - if ($s->{'Platform'} == 3) - { - $self->{' mstable'} = $s; - last if ($s->{'Encoding'} == 10); - $found = 1 if ($s->{'Encoding'} == 1); - } elsif ($s->{'Platform'} == 0 || ($s->{'Platform'} == 2 && $s->{'Encoding'} == 1)) - { $alt = $s; } - } - $self->{' mstable'} = $alt if ($alt && !$found); - $self->{' mstable'}; -} - - -=head2 $t->ms_enc - -Returns the encoding of the microsoft table (0 => symbol, etc.). Returns undef if there is -no Microsoft cmap. - -=cut - -sub ms_enc -{ - my ($self) = @_; - my ($s); - - return $self->{' mstable'}{'Encoding'} - if (defined $self->{' mstable'} && $self->{' mstable'}{'Platform'} == 3); - - foreach $s (@{$self->{'Tables'}}) - { - return $s->{'Encoding'} if ($s->{'Platform'} == 3); - } - return undef; -} - - -=head2 $t->out($fh) - -Writes out a cmap table to a filehandle. If it has not been read, then -just copies from input file to output - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($loc, $s, $i, $base_loc, $j, @keys); - - return $self->SUPER::out($fh) unless $self->{' read'}; - - - $self->{'Tables'} = [sort {$a->{'Platform'} <=> $b->{'Platform'} - || $a->{'Encoding'} <=> $b->{'Encoding'} - || $a->{'Ver'} <=> $b->{'Ver'}} @{$self->{'Tables'}}]; - $self->{'Num'} = scalar @{$self->{'Tables'}}; - - $base_loc = $fh->tell(); - $fh->print(pack("n2", 0, $self->{'Num'})); - - for ($i = 0; $i < $self->{'Num'}; $i++) - { $fh->print(pack("nnN", $self->{'Tables'}[$i]{'Platform'}, $self->{'Tables'}[$i]{'Encoding'}, 0)); } - - for ($i = 0; $i < $self->{'Num'}; $i++) - { - $s = $self->{'Tables'}[$i]; - if ($s->{'Format'} < 8) - { @keys = sort {$a <=> $b} grep { $_ <= 0xFFFF} keys %{$s->{'val'}}; } - else - { @keys = sort {$a <=> $b} keys %{$s->{'val'}}; } - $s->{' outloc'} = $fh->tell(); - if ($s->{'Format'} < 8) - { $fh->print(pack("n3", $s->{'Format'}, 0, $s->{'Ver'})); } # come back for length - else - { $fh->print(pack("n2N2", $s->{'Format'}, 0, 0, $s->{'Ver'})); } - - if ($s->{'Format'} == 0) - { - $fh->print(pack("C256", @{$s->{'val'}}{0 .. 255})); - } elsif ($s->{'Format'} == 6) - { - $fh->print(pack("n2", $keys[0], $keys[-1] - $keys[0] + 1)); - $fh->print(pack("n*", @{$s->{'val'}}{$keys[0] .. $keys[-1]})); - } elsif ($s->{'Format'} == 2) # Contributed by Huw Rogers - { - my ($g, $k, $h, $l, $m, $n); - my (@subHeaderKeys, @subHeaders, $subHeader, @glyphIndexArray); - $n = 0; - @subHeaderKeys = (-1) x 256; - for $j (@keys) { - next unless defined($g = $s->{'val'}{$j}); - $h = int($j>>8); - $l = ($j & 0xff); - if (($k = $subHeaderKeys[$h]) < 0) { - $subHeader = [ $l, 1, 0, 0, [ $g ] ]; - $subHeaders[$k = $n++] = $subHeader; - $subHeaderKeys[$h] = $k; - } else { - $subHeader = $subHeaders[$k]; - $m = ($l - $subHeader->[0] + 1) - $subHeader->[1]; - $subHeader->[1] += $m; - push @{$subHeader->[4]}, (0) x ($m - 1), $g - $subHeader->[2]; - } - } - @subHeaderKeys = map { $_ < 0 ? 0 : $_ } @subHeaderKeys; - $subHeader = $subHeaders[0]; - $subHeader->[3] = 0; - push @glyphIndexArray, @{$subHeader->[4]}; - splice(@$subHeader, 4); - { - my @subHeaders_ = sort {@{$a->[4]} <=> @{$b->[4]}} @subHeaders[1..$#subHeaders]; - my ($f, $d, $r, $subHeader_); - for ($k = 0; $k < @subHeaders_; $k++) { - $subHeader = $subHeaders_[$k]; - $f = $r = shift @{$subHeader->[4]}; - $subHeader->[5] = join(':', - map { - $d = $_ - $r; - $r = $_; - $d < 0 ? - sprintf('-%04x', -$d) : - sprintf('+%04x', $d) - } @{$subHeader->[4]}); - unshift @{$subHeader->[4]}, $f; - } - for ($k = 0; $k < @subHeaders_; $k++) { - $subHeader = $subHeaders_[$k]; - next unless $subHeader->[4]; - $subHeader->[3] = @glyphIndexArray; - push @glyphIndexArray, @{$subHeader->[4]}; - for ($l = $k + 1; $l < @subHeaders_; $l++) { - $subHeader_ = $subHeaders_[$l]; - next unless $subHeader_->[4]; - $d = $subHeader_->[5]; - if ($subHeader->[5] =~ /\Q$d\E/) { - my $o = length($`)/6; #` - $subHeader_->[2] += - $subHeader_->[4]->[$o] - $subHeader->[4]->[0]; - $subHeader_->[3] = $subHeader->[3] + $o; - splice(@$subHeader_, 4); - } - } - splice(@$subHeader, 4); - } - } - $fh->print(pack('n*', map { $_<<3 } @subHeaderKeys)); - for ($j = 0; $j < 256; $j++) { - $k = $subHeaderKeys[$j]; - $subHeader = $subHeaders[$k]; - } - for ($k = 0; $k < $n; $k++) { - $subHeader = $subHeaders[$k]; - $fh->print(pack('n4', - $subHeader->[0], - $subHeader->[1], - $subHeader->[2] < 0 ? - unpack('S', pack('s', $subHeader->[2])) : - $subHeader->[2], - ($subHeader->[3]<<1) + (($n - $k)<<3) - 6 - )); - } - $fh->print(pack('n*', @glyphIndexArray)); - } elsif ($s->{'Format'} == 4) - { - my ($num, $sRange, $eSel, $eShift, @starts, @ends, $doff); - my (@deltas, $delta, @range, $flat, $k, $segs, $count, $newseg, $v); - - push(@keys, 0xFFFF) unless ($keys[-1] == 0xFFFF); - $newseg = 1; $num = 0; - for ($j = 0; $j <= $#keys && $keys[$j] <= 0xFFFF; $j++) - { - $v = $s->{'val'}{$keys[$j]} || 0; - if ($newseg) - { - $delta = $v; - $doff = $j; - $flat = 1; - push(@starts, $keys[$j]); - $newseg = 0; - } - $delta = 0 if ($delta + $j - $doff != $v); - $flat = 0 if ($v == 0); - if ($j == $#keys || $keys[$j] + 1 != $keys[$j+1]) - { - push (@ends, $keys[$j]); - push (@deltas, $delta ? $delta - $keys[$doff] : 0); - push (@range, $flat); - $num++; - $newseg = 1; - } - } - - ($num, $sRange, $eSel, $eShift) = Font::TTF::Utils::TTF_bininfo($num, 2); - $fh->print(pack("n4", $num * 2, $sRange, $eSel, $eShift)); - $fh->print(pack("n*", @ends)); - $fh->print(pack("n", 0)); - $fh->print(pack("n*", @starts)); - $fh->print(pack("n*", @deltas)); - - $count = 0; - for ($j = 0; $j < $num; $j++) - { - $delta = $deltas[$j]; - if ($delta != 0 && $range[$j] == 1) - { $range[$j] = 0; } - else - { - $range[$j] = ($count + $num - $j) << 1; - $count += $ends[$j] - $starts[$j] + 1; - } - } - - $fh->print(pack("n*", @range)); - - for ($j = 0; $j < $num; $j++) - { - next if ($range[$j] == 0); - $fh->print(pack("n*", map {$_ || 0} @{$s->{'val'}}{$starts[$j] .. $ends[$j]})); - } - } elsif ($s->{'Format'} == 8 || $s->{'Format'} == 12) - { - my (@jobs, $start, $current, $curr_glyf, $map); - - $current = 0; $curr_glyf = 0; - $map = "\000" x 8192; - foreach $j (@keys) - { - if ($j > 0xFFFF) - { - if (defined $s->{'val'}{$j >> 16}) - { $s->{'Format'} = 12; } - vec($map, $j >> 16, 1) = 1; - } - if ($j != $current + 1 || $s->{'val'}{$j} != $curr_glyf + 1) - { - push (@jobs, [$start, $current, $curr_glyf - ($current - $start)]) if (defined $start); - $start = $j; $current = $j; $curr_glyf = $s->{'val'}{$j}; - } - $current = $j; - $curr_glyf = $s->{'val'}{$j}; - } - push (@jobs, [$start, $current, $curr_glyf - ($current - $start)]) if (defined $start); - $fh->print($map) if ($s->{'Format'} == 8); - $fh->print(pack('N', $#jobs + 1)); - foreach $j (@jobs) - { $fh->print(pack('N3', @{$j})); } - } elsif ($s->{'Format'} == 10) - { - $fh->print(pack('N2', $keys[0], $keys[-1] - $keys[0] + 1)); - $fh->print(pack('n*', $s->{'val'}{$keys[0] .. $keys[-1]})); - } - - $loc = $fh->tell(); - if ($s->{'Format'} < 8) - { - $fh->seek($s->{' outloc'} + 2, 0); - $fh->print(pack("n", $loc - $s->{' outloc'})); - } else - { - $fh->seek($s->{' outloc'} + 4, 0); - $fh->print(pack("N", $loc - $s->{' outloc'})); - } - $fh->seek($base_loc + 8 + ($i << 3), 0); - $fh->print(pack("N", $s->{' outloc'} - $base_loc)); - $fh->seek($loc, 0); - } - $self; -} - - -=head2 $t->XML_element($context, $depth, $name, $val) - -Outputs the elements of the cmap in XML. We only need to process val here - -=cut - -sub XML_element -{ - my ($self, $context, $depth, $k, $val) = @_; - my ($fh) = $context->{'fh'}; - my ($i); - - return $self if ($k eq 'LOC'); - return $self->SUPER::XML_element($context, $depth, $k, $val) unless ($k eq 'val'); - - $fh->print("$depth\n"); - foreach $i (sort {$a <=> $b} keys %{$val}) - { $fh->printf("%s\n", $depth . $context->{'indent'}, $i, $val->{$i}); } - $fh->print("$depth\n"); - $self; -} - -=head2 @map = $t->reverse(%opt) - -Returns a reverse map of the Unicode cmap. I.e. given a glyph gives the Unicode value for it. Options are: - -=over 4 - -=item tnum - -Table number to use rather than the default Unicode table - -=item array - -Returns each element of reverse as an array since a glyph may be mapped by more -than one Unicode value. The arrays are unsorted. Otherwise store any one unicode value for a glyph. - -=back - -=cut - -sub reverse -{ - my ($self, %opt) = @_; - my ($table) = defined $opt{'tnum'} ? $self->{'Tables'}[$opt{'tnum'}] : $self->find_ms; - my (@res, $code, $gid); - - while (($code, $gid) = each(%{$table->{'val'}})) - { - if ($opt{'array'}) - { push (@{$res[$gid]}, $code); } - else - { $res[$gid] = $code unless (defined $res[$gid] && $res[$gid] > 0 && $res[$gid] < $code); } - } - @res; -} - - -=head2 is_unicode($index) - -Returns whether the table of a given index is known to be a unicode table -(as specified in the specifications) - -=cut - -sub is_unicode -{ - my ($self, $index) = @_; - my ($pid, $eid) = ($self->{'Tables'}[$index]{'Platform'}, $self->{'Tables'}[$index]{'Encoding'}); - - return ($pid == 3 || $pid == 0 || ($pid == 2 && $eid == 1)); -} - -1; - -=head1 BUGS - -=over 4 - -=item * - -No support for format 2 tables (MBCS) - -=back - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Coverage.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Coverage.pm deleted file mode 100644 index 909f910..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Coverage.pm +++ /dev/null @@ -1,323 +0,0 @@ -package Font::TTF::Coverage; - -=head1 NAME - -Font::TTF::Coverage - Opentype coverage and class definition objects - -=head1 DESCRIPTION - -Coverage tables and class definition objects are virtually identical concepts -in OpenType. Their difference comes purely in their storage. Therefore we can -say that a coverage table is a class definition in which the class definition -for each glyph is the corresponding index in the coverage table. The resulting -data structure is that a Coverage table has the following fields: - -=item cover - -A boolean to indicate whether this table is a coverage table (TRUE) or a -class definition (FALSE) - -=item val - -A hash of glyph ids against values (either coverage index or class value) - -=item fmt - -The storage format used is given here, but is recalculated when the table -is written out. - -=item count - -A count of the elements in a coverage table for use with add. Each subsequent -addition is added with the current count and increments the count. - -=head1 METHODS - -=cut - -=head2 new($isCover [, vals]) - -Creates a new coverage table or class definition table, depending upon the -value of $isCover. if $isCover then vals may be a list of glyphs to include in order. -If no $isCover, then vals is a hash of glyphs against class values. - -=cut - -sub new -{ - my ($class) = shift; - my ($isCover) = shift; - my ($self) = {}; - - $self->{'cover'} = $isCover; - $self->{'count'} = 0; - if ($isCover) - { - my ($v); - foreach $v (@_) - { $self->{'val'}{$v} = $self->{'count'}++; } - } - else - { - $self->{'val'} = {@_}; - foreach (values %{$self->{'val'}}) {$self->{'max'} = $_ if $_ > $self->{'max'}} - } - bless $self, $class; -} - - -=head2 read($fh) - -Reads the coverage/class table from the given file handle - -=cut - -sub read -{ - my ($self, $fh) = @_; - my ($dat, $fmt, $num, $i, $c); - - $fh->read($dat, 4); - ($fmt, $num) = unpack("n2", $dat); - $self->{'fmt'} = $fmt; - - if ($self->{'cover'}) - { - if ($fmt == 1) - { - $fh->read($dat, $num << 1); - map {$self->{'val'}{$_} = $i++} unpack("n*", $dat); - } elsif ($fmt == 2) - { - $fh->read($dat, $num * 6); - for ($i = 0; $i < $num; $i++) - { - ($first, $last, $c) = unpack("n3", substr($dat, $i * 6, 6)); - map {$self->{'val'}{$_} = $c++} ($first .. $last); - } - } - $self->{'count'} = $num; - } elsif ($fmt == 1) - { - $fh->read($dat, 2); - $first = $num; - ($num) = unpack("n", $dat); - $fh->read($dat, $num << 1); - map {$self->{'val'}{$first++} = $_; $self->{'max'} = $_ if ($_ > $self->{'max'})} unpack("n*", $dat); - } elsif ($fmt == 2) - { - $fh->read($dat, $num * 6); - for ($i = 0; $i < $num; $i++) - { - ($first, $last, $c) = unpack("n3", substr($dat, $i * 6, 6)); - map {$self->{'val'}{$_} = $c} ($first .. $last); - $self->{'max'} = $c if ($c > $self->{'max'}); - } - } - $self; -} - - -=head2 out($fh, $state) - -Writes the coverage/class table to the given file handle. If $state is 1 then -the output string is returned rather than being output to a filehandle. - -=cut - -sub out -{ - my ($self, $fh, $state) = @_; - my ($g, $eff, $grp, $out); - my ($shipout) = ($state ? sub {$out .= $_[0];} : sub {$fh->print($_[0]);}); - my (@gids) = sort {$a <=> $b} keys %{$self->{'val'}}; - - $fmt = 1; $grp = 1; $eff = 0; - for ($i = 1; $i <= $#gids; $i++) - { - if ($self->{'val'}{$gids[$i]} < $self->{'val'}{$gids[$i-1]} && $self->{'cover'}) - { - $fmt = 2; - last; - } elsif ($gids[$i] == $gids[$i-1] + 1 && ($self->{'cover'} || $self->{'val'}{$gids[$i]} == $self->{'val'}{$gids[$i-1]})) - { $eff++; } - else - { - $grp++; - $eff += $gids[$i] - $gids[$i-1] if (!$self->{'cover'}); - } - } -# if ($self->{'cover'}) - { $fmt = 2 if ($eff / $grp > 3); } -# else -# { $fmt = 2 if ($grp > 1); } - - if ($fmt == 1 && $self->{'cover'}) - { - my ($last) = 0; - &$shipout(pack('n2', 1, scalar @gids)); - &$shipout(pack('n*', @gids)); - } elsif ($fmt == 1) - { - my ($last) = $gids[0]; - &$shipout(pack("n3", 1, $last, $gids[-1] - $last + 1)); - foreach $g (@gids) - { - if ($g > $last + 1) - { &$shipout(pack('n*', (0) x ($g - $last - 1))); } - &$shipout(pack('n', $self->{'val'}{$g})); - $last = $g; - } - } else - { - my ($start, $end, $ind, $numloc, $endloc, $num); - &$shipout(pack("n2", 2, 0)); - $numloc = $fh->tell() - 2 unless $state; - - $start = 0; $end = 0; $num = 0; - while ($end < $#gids) - { - if ($gids[$end + 1] == $gids[$end] + 1 - && $self->{'val'}{$gids[$end + 1]} - == $self->{'val'}{$gids[$end]} - + ($self->{'cover'} ? 1 : 0)) - { - $end++; - next; - } - - &$shipout(pack("n3", $gids[$start], $gids[$end], - $self->{'val'}{$gids[$start]})); - $start = $end + 1; - $end++; - $num++; - } - &$shipout(pack("n3", $gids[$start], $gids[$end], - $self->{'val'}{$gids[$start]})); - $num++; - if ($state) - { substr($out, 2, 2) = pack('n', $num); } - else - { - $endloc = $fh->tell(); - $fh->seek($numloc, 0); - $fh->print(pack("n", $num)); - $fh->seek($endloc, 0); - } - } - return ($state ? $out : $self); -} - - -=head2 $c->add($glyphid[, $class]) - -Adds a glyph id to the coverage table incrementing the count so that each subsequent addition -has the next sequential number. Returns the index number of the glyphid added - -=cut - -sub add -{ - my ($self, $gid, $class) = @_; - - return $self->{'val'}{$gid} if (defined $self->{'val'}{$gid}); - if ($self->{'cover'}) - { - $self->{'val'}{$gid} = $self->{'count'}; - return $self->{'count'}++; - } - else - { - $self->{'val'}{$gid} = $class || '0'; - $self->{'max'} = $class if ($class > $self->{'max'}); - return $class; - } -} - - -=head2 $c->signature - -Returns a vector of all the glyph ids covered by this coverage table or class - -=cut - -sub signature -{ - my ($self) = @_; - my ($vec, $range, $size); - -if (0) -{ - if ($self->{'cover'}) - { $range = 1; $size = 1; } - else - { - $range = $self->{'max'}; - $size = 1; - while ($range > 1) - { - $size = $size << 1; - $range = $range >> 1; - } - $range = $self->{'max'} + 1; - } - foreach (keys %{$self->{'val'}}) - { vec($vec, $_, $size) = $self->{'val'}{$_} > $range ? $range : $self->{'val'}{$_}; } - length($vec) . ":" . $vec; -} - $vec = join(";", map{"$_,$self->{'val'}{$_}"} keys %{$self->{'val'}}); -} - -=head2 @map=$c->sort - -Sorts the coverage table so that indexes are in ascending order of glyphid. -Returns a map such that $map[$new_index]=$old_index. - -=cut - -sub sort -{ - my ($self) = @_; - my (@res, $i); - - foreach (sort {$a <=> $b} keys %{$self->{'val'}}) - { - push(@res, $self->{'val'}{$_}); - $self->{'val'}{$_} = $i++; - } - @res; -} - -=head2 $c->out_xml($context) - -Outputs this coverage/class in XML - -=cut - -sub out_xml -{ - my ($self, $context, $depth) = @_; - my ($fh) = $context->{'fh'}; - - $fh->print("$depth<" . ($self->{'cover'} ? 'coverage' : 'class') . ">\n"); - foreach $gid (sort {$a <=> $b} keys %{$self->{'val'}}) - { - $fh->printf("$depth$context->{'indent'}\n", $gid, $self->{'val'}{$gid}); - } - $fh->print("$depth{'cover'} ? 'coverage' : 'class') . ">\n"); - $self; -} - -sub release -{ } - - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - -1; - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Cvt_.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Cvt_.pm deleted file mode 100644 index 2a79f5b..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Cvt_.pm +++ /dev/null @@ -1,81 +0,0 @@ -package Font::TTF::Cvt_; - -=head1 NAME - -Font::TTF::Cvt_ - Control Value Table in a TrueType font - -=head1 DESCRIPTION - -This is a minimal class adding nothing beyond a table, but is a repository -for cvt type information for those processes brave enough to address hinting. - -=head1 INSTANCE VARIABLES - -=over 4 - -=item val - -This is an array of CVT values. Thus access to the CVT is via: - - $f->{'cvt_'}{'val'}[$num]; - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA $VERSION); -use Font::TTF::Utils; - -@ISA = qw(Font::TTF::Table); - -$VERSION = 0.0001; - -=head2 $t->read - -Reads the CVT table into both the tables C<' dat'> variable and the C -array. - -=cut - -sub read -{ - my ($self) = @_; - - $self->read_dat || return undef; - $self->{' read'} = 1; - $self->{'val'} = [TTF_Unpack("s*", $self->{' dat'})]; - $self; -} - - -=head2 $t->update - -Updates the RAM file copy C<' dat'> to be the same as the array. - -=cut - -sub update -{ - my ($self) = @_; - - return undef unless ($self->{' read'} && $#{$self->{'val'}} >= 0); - $self->{' dat'} = TTF_Pack("s*", @{$self->{'val'}}); - $self; -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Delta.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Delta.pm deleted file mode 100644 index 7d63757..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Delta.pm +++ /dev/null @@ -1,173 +0,0 @@ -package Font::TTF::Delta; - -=head1 NAME - -Font::TTF::Delta - Opentype Device tables - -=head1 DESCRIPTION - -Each device table corresponds to a set of deltas for a particular point over -a range of ppem values. - -=item first - -The first ppem value in the range - -=item last - -The last ppem value in the range - -=item val - -This is an array of deltas corresponding to each ppem in the range between -first and last inclusive. - -=item fmt - -This is the fmt used (log2 of number bits per value) when the device table was -read. It is recalculated on output. - -=head1 METHODS - -=cut - -use strict; -use Font::TTF::Utils; - -=head2 new - -Creates a new device table - -=cut - -sub new -{ - my ($class) = @_; - my ($self) = {}; - - bless $self, $class; -} - - -=head2 read - -Reads a device table from the given IO object at the current location - -=cut - -sub read -{ - my ($self, $fh) = @_; - my ($dat, $fmt, $num, $i, $j, $mask); - - $fh->read($dat, 6); - ($self->{'first'}, $self->{'last'}, $fmt) = TTF_Unpack("S3", $dat); - $self->{'fmt'} = $fmt; - - $fmt = 1 << $fmt; - $num = ((($self->{'last'} - $self->{'first'} + 1) * $fmt) + 15) >> 8; - $fh->read($dat, $num); - - $mask = (0xffff << (16 - $fmt)) & 0xffff; - $j = 0; - for ($i = $self->{'first'}; $i <= $self->{'last'}; $i++) - { - if ($j == 0) - { - $num = TTF_Unpack("S", substr($dat, 0, 2)); - substr($dat, 0, 2) = ''; - } - push (@{$self->{'val'}}, ($num & $mask) >> (16 - $fmt)); - $num <<= $fmt; - $j += $fmt; - $j = 0 if ($j >= 16); - } - $self; -} - - -=head2 out($fh, $style) - -Outputs a device table to the given IO object at the current location, or just -returns the data to be output if $style != 0 - -=cut - -sub out -{ - my ($self, $fh, $style) = @_; - my ($dat, $fmt, $num, $mask, $j, $f, $out); - - foreach $f (@{$self->{'val'}}) - { - my ($tfmt) = $f > 0 ? $f + 1 : -$f; - $fmt = $tfmt if $tfmt > $fmt; - } - - if ($fmt > 8) - { $fmt = 3; } - elsif ($fmt > 2) - { $fmt = 2; } - else - { $fmt = 1; } - - $out = TTF_Pack("S3", $self->{'first'}, $self->{'last'}, $fmt); - - $fmt = 1 << $fmt; - $mask = 0xffff >> (16 - $fmt); - $j = 0; $dat = 0; - foreach $f (@{$self->{'val'}}) - { - $dat |= ($f & $mask) << (16 - $fmt - $j); - $j += $fmt; - if ($j >= 16) - { - $j = 0; - $out .= TTF_Pack("S", $dat); - $dat = 0; - } - } - $out .= pack('n', $dat) if ($j > 0); - $fh->print($out) unless $style; - $out; -} - -=head2 $d->signature() - -Returns a content based identifying string for this delta for -compression purposes - -=cut - -sub signature -{ - my ($self) = @_; - return join (",", $self->{'first'}, $self->{'last'}, @{$self->{'val'}}); -} - - -=head2 $d->out_xml($context) - -Outputs a delta in XML - -=cut - -sub out_xml -{ - my ($self, $context, $depth) = @_; - my ($fh) = $context->{'fh'}; - - $fh->printf("%s\n", $depth, $self->{'first'}, $self->{'last'}); - $fh->print("$depth$context->{'indent'}" . join (' ', @{$self->{'val'}}) . "\n") if defined ($self->{'val'}); - $fh->print("$depth\n"); -} - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - -1; - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Dumper.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Dumper.pm deleted file mode 100644 index 7cc8699..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Dumper.pm +++ /dev/null @@ -1,79 +0,0 @@ -package Font::TTF::Dumper; - -=head1 NAME - -Font::TTF::Dumper - Debug dump of a font datastructure, avoiding recursion on ' PARENT' - -=head1 SYNOPSIS - - Font::TTF::Dumper; - - # Print a table from the font structure: - print ttfdump($font->{$tag}); - - # Print font table with name - print ttfdump($font->{'head'}, 'head'); - - # Print one glyph's data: - print ttfdump($font->{'loca'}->read->{'glyphs'}[$gid], "glyph_$gid"); - -=head1 DESCRIPTION - -Font::TTF data structures are trees created from hashes and arrays. When trying to figure -out how the structures work, sometimes it is helpful to use Data::Dumper on them. However, -many of the object structures have ' PARENT' links that refer back to the object's parent, -which means that Data::Dumper ends up dumping the whole font no matter what. - -The purpose of this module is to do just one thing: invoke Data::Dumper with a -filter that skips over the ' PARENT' element of any hash. - -To reduce output further, this module also skips over ' CACHE' elements and any -hash element whose value is a Font::TTF::Glyph or Font::TTF::Font object. -(Really should make this configurable.) - -=cut - -use strict; -use Data::Dumper; - -use vars qw(@EXPORT @ISA); -require Exporter; -@ISA = qw( Exporter ); -@EXPORT = qw( ttfdump ); - -my %skip = ( Font => 1, Glyph => 1 ); - -sub ttfdump -{ - my ($var, $name) = @_; - my $res; - - my $d = Data::Dumper->new([$var]); - $d->Names([$name]) if defined $name; - $d->Sortkeys(\&myfilter); # This is the trick to keep from dumping the whole font - $d->Indent(3); # I want array indicies - $d->Useqq(1); # Perlquote -- slower but there might be binary data. - $res = $d->Dump; - $d->DESTROY; - $res; -} - -sub myfilter -{ - my ($hash) = @_; - my @a = grep { - ($_ eq ' PARENT' || $_ eq ' CACHE') ? 0 : - ref($hash->{$_}) =~ m/^Font::TTF::(.*)$/ ? !$skip{$1} : - 1 - } (keys %{$hash}) ; - # Sort numerically if that is reasonable: - return [ sort {$a =~ /\D/ || $b =~ /\D/ ? $a cmp $b : $a <=> $b} @a ]; -} - -1; - -=head1 See also - -L - -=cut diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/EBDT.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/EBDT.pm deleted file mode 100644 index 257e8d7..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/EBDT.pm +++ /dev/null @@ -1,285 +0,0 @@ -package Font::TTF::EBDT; - -=head1 NAME - -Font::TTF::EBDT - Embeeded Bitmap Data Table - -=head1 DESCRIPTION - -Contains the metrics and bitmap image data. - -=head1 INSTANCE VARIABLES - -Only has 'bitmap' instance variable. It is an array of assosiative -array keyed by glyph-id. The element is an object which consists -of metric information and image data. - -=over 4 - -=item bitmap object - -=over 8 -=item format -Only 7 is supported. -=item height -=item width -=item horiBearingX -=item horiBearingY -=item horiAdvance -=item vertBearingX -=item vertBearingY -=item vertAdvance -=item imageData - -=back - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -require Font::TTF::Table; - -@ISA = qw(Font::TTF::Table); - - -=head2 $t->read - -Reads the embedded bitmap data from the TTF file into memory. -This routine should be called _after_ {'EBLC'}->read. - -=cut - -sub read -{ - my ($self) = shift; - my ($fh) = $self->{' INFILE'}; - my ($i, $dat); - my ($eblc) = $self->{' PARENT'}->{'EBLC'}; - my ($bst_array); - - $eblc->read; - $self->SUPER::read || return $self; - - # ebdtHeader - $fh->read($dat, 4); # version - - $bst_array = $eblc->{'bitmapSizeTable'}; - - for ($i = 0; $i < $eblc->{'Num'}; $i++) - { - my ($bst) = $bst_array->[$i]; - my ($format) = $bst->{'imageFormat'}; - my ($offset) = $bst->{'imageDataOffset'}; - my ($j); - my ($ist_array) = $eblc->{'indexSubTableArray'}[$i]; - my ($bitmap) = {}; - - die "Only EBDT format 7 is implemented." unless ($format == 7); - - $self->{'bitmap'}[$i] = $bitmap; - - for ($j = 0; $j < $bst->{'numberOfIndexSubTables'}; $j++) { - my ($ista) = $ist_array->[$j]; - my ($offsetArray) = $eblc->{'indexSubTable'}[$i][$j]; - my ($p, $o0, $c); - -# if ($fh->tell != $self->{' OFFSET'} + $offset) { -# $fh->seek($self->{' OFFSET'} + $offset, 0); -# } - - $p = 0; - $o0 = $offsetArray->[$p++]; - for ($c = $ista->{'firstGlyphIndex'}; $c <= $ista->{'lastGlyphIndex'}; $c++) - { - my ($b) = {}; - my ($o1) = $offsetArray->[$p++]; - my ($len) = $o1 - $o0 - 8; - -# if ($fh->tell != $self->{' OFFSET'} + $offset + $o0) { -# $fh->seek($self->{' OFFSET'} + $offset + $o0, 0); -# } - - $fh->read($dat, 8); - ($b->{'height'}, - $b->{'width'}, - $b->{'horiBearingX'}, - $b->{'horiBearingY'}, - $b->{'horiAdvance'}, - $b->{'vertBearingX'}, - $b->{'vertBearingY'}, - $b->{'vertAdvance'}) - = unpack("cccccccc", $dat); - - $fh->read($dat, $len); - $b->{'imageData'} = $dat; - $b->{'format'} = 7; # bitmap and bigMetrics - - $bitmap->{$c} = $b; - $o0 = $o1; - } - - $offset += $o0; - } - } - - $self; -} - - -=head2 $t->update - -Update EBLC information using EBDT data. - -=cut - -sub get_regions -{ - my (@l) = @_; - my (@r) = (); - my ($e); - my ($first); - my ($last); - - $first = $l[0]; - $last = $first - 1; - foreach $e (@l) { - if ($last + 1 != $e) { # not contiguous - $r[++$#r] = [$first, $last]; - $first = $e; - } - - $last = $e; - } - - $r[++$#r] = [$first, $last]; - @r; -} - -sub update -{ - my ($self) = @_; - my ($eblc) = $self->{' PARENT'}->{'EBLC'}; - my ($bst_array) = []; - my ($offset) = 4; - my ($i); - my ($bitmap_array) = $self->{'bitmap'}; - my ($istao) = 8 + 48 * $eblc->{'Num'}; - - $eblc->{'bitmapSizeTable'} = $bst_array; - - for ($i = 0; $i < $eblc->{'Num'}; $i++) { - my ($bst) = {}; - my ($ist_array) = []; - my ($j); - my ($bitmap) = $bitmap_array->[$i]; - my (@regions) = get_regions(sort {$a <=> $b} keys (%$bitmap)); - my ($aotis) = 8 * (1+$#regions); - - $bst->{'indexFormat'} = 1; - $bst->{'imageFormat'} = 7; - $bst->{'imageDataOffset'} = $offset; - $bst->{'numberOfIndexSubTables'} = 1+$#regions; - $bst->{'indexSubTableArrayOffset'} = $istao; - $bst->{'colorRef'} = 0; - - $bst->{'startGlyphIndex'} = $regions[0][0]; - $bst->{'endGlyphIndex'} = $regions[-1][1]; - $bst->{'bitDepth'} = 1; - $bst->{'flags'} = 1; # Horizontal - $bst_array->[$i] = $bst; - - $eblc->{'indexSubTableArray'}[$i] = $ist_array; - for ($j = 0; $j <= $#regions; $j++) { - my ($ista) = {}; - my ($offsetArray) = []; - my ($p, $o0, $c); - $ist_array->[$j] = $ista; - - $ista->{'firstGlyphIndex'} = $regions[$j][0]; - $ista->{'lastGlyphIndex'} = $regions[$j][1]; - $ista->{'additionalOffsetToIndexSubtable'} = $aotis; - $eblc->{'indexSubTable'}[$i][$j] = $offsetArray; - $p = 0; - $o0 = 0; - for ($c = $regions[$j][0]; $c <= $regions[$j][1]; $c++) { - my ($b) = $bitmap->{$c}; - - $offsetArray->[$p++] = $o0; - $o0 += 8 + length($b->{'imageData'}); - } - - $offsetArray->[$p++] = $o0; - - $aotis += ($regions[$j][1] - $regions[$j][0] + 1 + 1)*4; - $offset += $o0; - - # Do we need the element of 0x10007 and absolute offset here, - # at the end of offsetArray? -# if ($j + 1 <= $#regions) { -# $offsetArray->[$p++] = 0x10007; -# $offsetArray->[$p++] = $offset; -# $aotis += 8; -# } - } - - $istao += $aotis + 8; - $bst->{'indexTablesSize'} = $aotis + 8; - } -} - -=head2 $t->out($fh) - -Outputs the bitmap data of embedded bitmap for this font. - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($eblc) = $self->{' PARENT'}->{'EBLC'}; - my ($i); - my ($bitmap_array) = $self->{'bitmap'}; - - $fh->print(pack("N", 0x00020000)); - - for ($i = 0; $i < $eblc->{'Num'}; $i++) { - my ($j); - my ($bitmap) = $bitmap_array->[$i]; - my (@regions) = get_regions(sort {$a <=> $b} keys (%$bitmap)); - - for ($j = 0; $j <= $#regions; $j++) { - my ($c); - - for ($c = $regions[$j][0]; $c <= $regions[$j][1]; $c++) { - my ($b) = $bitmap->{$c}; - - $fh->print(pack("cccccccc", - $b->{'height'}, $b->{'width'}, - $b->{'horiBearingX'}, $b->{'horiBearingY'}, - $b->{'horiAdvance'}, $b->{'vertBearingX'}, - $b->{'vertBearingY'}, $b->{'vertAdvance'})); - $fh->print($b->{'imageData'}); - } - } - } -} - -1; - -=head1 BUGS - -Only Format 7 is implemented. XML output is not supported (yet). - -=head1 AUTHOR - -NIIBE Yutaka L. See L for copyright and -licensing. - -This was written at the CodeFest Akihabara 2006 hosted by FSIJ. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/EBLC.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/EBLC.pm deleted file mode 100644 index 7ba6e68..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/EBLC.pm +++ /dev/null @@ -1,228 +0,0 @@ -package Font::TTF::EBLC; - -=head1 NAME - -Font::TTF::EBLC - Embeeded Bitmap Location Table - -=head1 DESCRIPTION - -Contains the sizes and glyph ranges of bitmaps, and the offsets to -glyph bitmap data in indexSubTables for EBDT. - -Possibly contains glyph metrics information. - -=head1 INSTANCE VARIABLES -The information specified 'B<(R)>ead only' is read only, those -are calculated from EBDT, when it is 'update'-ed. - -=over 4 - -=item bitmapSizeTable -An array of tables of following information - -=over 8 -=item indexSubTableArrayOffset (R) -=item indexTablesSize (R) -=item numberOfIndexSubTables (R) -=item colorRef -=item hori -=item vert -=item startGlyphIndex (R) -=item endGlyphIndex (R) -=item ppemX -=item ppemY -=item bitDepth -=item flags -=back - -=item indexSubTableArray (R) -An array which contains range information. - -=item indexSubTable (R) -An array which contains offsets of EBDT table. - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -require Font::TTF::Table; - -@ISA = qw(Font::TTF::Table); - - -=head2 $t->read - -Reads the location information of embedded bitmap from the TTF file into memory - -=cut - -sub read -{ - my ($self) = @_; - my ($fh) = $self->{' INFILE'}; - my ($i, $dat); - my ($indexSubTableArrayOffset, - $indexTablesSize, - $numberOfIndexSubTables, - $colorRef); - my ($startGlyphIndex, - $endGlyphIndex, - $ppemX, $ppemY, - $bitDepth, $flags); - my (@hori, @vert); - my ($bst, $ista, $ist); - my ($j); - - $self->SUPER::read or return $self; - - # eblcHeader - $fh->read($dat, 4); - $self->{'version'} = unpack("N",$dat); - - $fh->read($dat, 4); - $self->{'Num'} = unpack("N",$dat); - - # bitmapSizeTable - for ($i = 0; $i < $self->{'Num'}; $i++) { - $fh->read($dat, 16); - ($indexSubTableArrayOffset, $indexTablesSize, - $numberOfIndexSubTables, $colorRef) = unpack("NNNN", $dat); - $fh->read($dat, 12); @hori = unpack("cccccccccccc", $dat); - $fh->read($dat, 12); @vert = unpack("cccccccccccc", $dat); - - $fh->read($dat, 8); - ($startGlyphIndex, $endGlyphIndex, - $ppemX, $ppemY, $bitDepth, $flags) = unpack("nnCCCC", $dat); - - $self->{'bitmapSizeTable'}[$i] = { - 'indexSubTableArrayOffset' => $indexSubTableArrayOffset, - 'indexTablesSize' => $indexTablesSize, - 'numberOfIndexSubTables' => $numberOfIndexSubTables, - 'colorRef' => $colorRef, - 'hori' => [@hori], - 'vert' => [@vert], - 'startGlyphIndex' => $startGlyphIndex, - 'endGlyphIndex' => $endGlyphIndex, - 'ppemX' => $ppemX, - 'ppemY' => $ppemY, - 'bitDepth' => $bitDepth, - 'flags' => $flags - }; - } - - for ($i = 0; $i < $self->{'Num'}; $i++) { - my ($count, $x); - - $bst = $self->{'bitmapSizeTable'}[$i]; - - for ($j = 0; $j < $bst->{'numberOfIndexSubTables'}; $j++) { - $ista = {}; - - # indexSubTableArray - $self->{'indexSubTableArray'}[$i][$j] = $ista; - $fh->read($dat, 8); - ($ista->{'firstGlyphIndex'}, - $ista->{'lastGlyphIndex'}, - $ista->{'additionalOffsetToIndexSubtable'}) - = unpack("nnN", $dat); - } - - # indexSubTable - # indexSubHeader - $fh->read($dat, 8); - ($bst->{'indexFormat'}, - $bst->{'imageFormat'}, - $bst->{'imageDataOffset'}) = unpack("nnN", $dat); - - die "Only indexFormat == 1 is supported" unless ($bst->{'indexFormat'} == 1); - - for ($j = 0; $j < $bst->{'numberOfIndexSubTables'}; $j++) { - $ista = $self->{'indexSubTableArray'}[$i][$j]; - $count = $ista->{'lastGlyphIndex'} - $ista->{'firstGlyphIndex'} + 1 + 1; - $fh->seek($self->{' OFFSET'} + $bst->{'indexSubTableArrayOffset'} - + $ista->{'additionalOffsetToIndexSubtable'} + 8, 0); - -# $count += 2 if $j < $bst->{'numberOfIndexSubTables'} - 1; - - $fh->read($dat, 4*$count); - - $self->{'indexSubTable'}[$i][$j] = [unpack("N*", $dat)]; - } - } - - $self; -} - -=head2 $t->out($fh) - -Outputs the location information of embedded bitmap for this font. - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($i); - my ($bst_array) = $self->{'bitmapSizeTable'}; - - $fh->print(pack("N", 0x00020000)); - $fh->print(pack("N", $self->{'Num'})); - - for ($i = 0; $i < $self->{'Num'}; $i++) { - my ($bst) = $bst_array->[$i]; - - $fh->print(pack("NNNN", - $bst->{'indexSubTableArrayOffset'}, - $bst->{'indexTablesSize'}, - $bst->{'numberOfIndexSubTables'}, - $bst->{'colorRef'})); - $fh->print(pack("cccccccccccc", @{$bst->{'hori'}})); - $fh->print(pack("cccccccccccc", @{$bst->{'vert'}})); - $fh->print(pack("nnCCCC", $bst->{'startGlyphIndex'}, - $bst->{'endGlyphIndex'}, $bst->{'ppemX'}, - $bst->{'ppemY'}, $bst->{'bitDepth'}, $bst->{'flags'})); - } - - for ($i = 0; $i < $self->{'Num'}; $i++) { - my ($bst) = $bst_array->[$i]; - my ($j); - - for ($j = 0; $j < $bst->{'numberOfIndexSubTables'}; $j++) { - my ($ista) = $self->{'indexSubTableArray'}[$i][$j]; - - $fh->print("nnN", - $ista->{'firstGlyphIndex'}, - $ista->{'lastGlyphIndex'}, - $ista->{'additionalOffsetToIndexSubtable'}); - } - - $fh->print(pack("nnN", $bst->{'indexFormat'}, $bst->{'imageFormat'}, - $bst->{'imageDataOffset'})); - - die "Only indexFormat == 1 is supported" unless ($bst->{'indexFormat'} == 1); - - for ($j = 0; $j < $bst->{'numberOfIndexSubTables'}; $j++) { - $fh->print(pack("N*", $self->{'indexSubTable'}[$i][$j])); - } - } -} - -1; - -=head1 BUGS - -Only indexFormat ==1 is implemented. XML output is not supported (yet). - -=head1 AUTHOR - -NIIBE Yutaka L. See L for copyright and -licensing. - -This was written at the CodeFest Akihabara 2006 hosted by FSIJ. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fdsc.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fdsc.pm deleted file mode 100644 index 3a81a11..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fdsc.pm +++ /dev/null @@ -1,125 +0,0 @@ -package Font::TTF::Fdsc; - -=head1 NAME - -Font::TTF::Fdsc - Font Descriptors table in a font - -=head1 DESCRIPTION - -=head1 INSTANCE VARIABLES - -=item version - -=item descriptors - -Hash keyed by descriptor tags - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA %fields); -use Font::TTF::Utils; - -@ISA = qw(Font::TTF::Table); - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self) = @_; - my ($dat, $fh, $numDescs, $tag, $descs); - - $self->SUPER::read or return $self; - - $fh = $self->{' INFILE'}; - $fh->read($dat, 4); - $self->{'version'} = TTF_Unpack("v", $dat); - - $fh->read($dat, 4); - - foreach (1 .. unpack("N", $dat)) { - $fh->read($tag, 4); - $fh->read($dat, 4); - $descs->{$tag} = ($tag eq 'nalf') ? unpack("N", $dat) : TTF_Unpack("f", $dat); - } - - $self->{'descriptors'} = $descs; - - $self; -} - - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($descs); - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $fh->print(TTF_Pack("v", $self->{'version'})); - - $descs = $self->{'descriptors'} or {}; - - $fh->print(pack("N", scalar keys %$descs)); - foreach (sort keys %$descs) { - $fh->print($_); - $fh->print(($_ eq 'nalf') ? pack("N", $descs->{$_}) : TTF_Pack("f", $descs->{$_})); - } - - $self; -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - my ($descs, $k); - - $self->read; - - $fh = 'STDOUT' unless defined $fh; - - $descs = $self->{'descriptors'}; - foreach $k (sort keys %$descs) { - if ($k eq 'nalf') { - $fh->printf("Descriptor '%s' = %d\n", $k, $descs->{$k}); - } - else { - $fh->printf("Descriptor '%s' = %f\n", $k, $descs->{$k}); - } - } - - $self; -} - -1; - - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Feat.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Feat.pm deleted file mode 100644 index c837f41..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Feat.pm +++ /dev/null @@ -1,191 +0,0 @@ -package Font::TTF::Feat; - -=head1 NAME - -Font::TTF::Feat - Font Features - -=head1 DESCRIPTION - -=head1 INSTANCE VARIABLES - -=over 4 - -=item version - -=item features - -An array of hashes of the following form - -=over 8 - -=item feature - -feature id number - -=item name - -name index in name table - -=item exclusive - -exclusive flag - -=item settings - -hash of setting number against name string index - -=back - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); - -use Font::TTF::Utils; - -require Font::TTF::Table; - -@ISA = qw(Font::TTF::Table); - -=head2 $t->read - -Reads the features from the TTF file into memory - -=cut - -sub read -{ - my ($self) = @_; - my ($featureCount, $features); - - $self->SUPER::read_dat or return $self; - - ($self->{'version'}, $featureCount) = TTF_Unpack("vS", $self->{' dat'}); - - $features = []; - foreach (1 .. $featureCount) { - my ($feature, $nSettings, $settingTable, $featureFlags, $nameIndex) - = TTF_Unpack("SSLSS", substr($self->{' dat'}, $_ * 12, 12)); - push @$features, - { - 'feature' => $feature, - 'name' => $nameIndex, - 'exclusive' => (($featureFlags & 0x8000) != 0), - 'settings' => { TTF_Unpack("S*", substr($self->{' dat'}, $settingTable, $nSettings * 4)) } - }; - } - $self->{'features'} = $features; - - delete $self->{' dat'}; # no longer needed, and may become obsolete - - $self; -} - -=head2 $t->out($fh) - -Writes the features to a TTF file - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($features, $numFeatures, $settings, $featuresData, $settingsData); - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $features = $self->{'features'}; - $numFeatures = @$features; - - foreach (@$features) { - $settings = $_->{'settings'}; - $featuresData .= TTF_Pack("SSLSS", - $_->{'feature'}, - scalar keys %$settings, - 12 + 12 * $numFeatures + length $settingsData, - ($_->{'exclusive'} ? 0x8000 : 0x0000), - $_->{'name'}); - foreach (sort {$a <=> $b} keys %$settings) { - $settingsData .= TTF_Pack("SS", $_, $settings->{$_}); - } - } - - $fh->print(TTF_Pack("vSSL", $self->{'version'}, $numFeatures, 0, 0)); - $fh->print($featuresData); - $fh->print($settingsData); - - $self; -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - my ($names, $features, $settings); - - $self->read; - - $names = $self->{' PARENT'}->{'name'}; - $names->read; - - $fh = 'STDOUT' unless defined $fh; - - $features = $self->{'features'}; - foreach (@$features) { - $fh->printf("Feature %d, %s, name %d # '%s'\n", - $_->{'feature'}, - ($_->{'exclusive'} ? "exclusive" : "additive"), - $_->{'name'}, - $names->{'strings'}[$_->{'name'}][1][0]{0}); - $settings = $_->{'settings'}; - foreach (sort { $a <=> $b } keys %$settings) { - $fh->printf("\tSetting %d, name %d # '%s'\n", - $_, $settings->{$_}, $names->{'strings'}[$settings->{$_}][1][0]{0}); - } - } - - $self; -} - -sub settingName -{ - my ($self, $feature, $setting) = @_; - - $self->read; - - my $names = $self->{' PARENT'}->{'name'}; - $names->read; - - my $features = $self->{'features'}; - my ($featureEntry) = grep { $_->{'feature'} == $feature } @$features; - my $featureName = $names->{'strings'}[$featureEntry->{'name'}][1][0]{0}; - my $settingName = $featureEntry->{'exclusive'} - ? $names->{'strings'}[$featureEntry->{'settings'}->{$setting}][1][0]{0} - : $names->{'strings'}[$featureEntry->{'settings'}->{$setting & ~1}][1][0]{0} - . (($setting & 1) == 0 ? " On" : " Off"); - - ($featureName, $settingName); -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fmtx.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fmtx.pm deleted file mode 100644 index a9311df..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fmtx.pm +++ /dev/null @@ -1,108 +0,0 @@ -package Font::TTF::Fmtx; - -=head1 NAME - -Font::TTF::Fmtx - Font Metrics table - -=head1 DESCRIPTION - -This is a simple table with just standards specified instance variables - -=head1 INSTANCE VARIABLES - - version - glyphIndex - horizontalBefore - horizontalAfter - horizontalCaretHead - horizontalCaretBase - verticalBefore - verticalAfter - verticalCaretHead - verticalCaretBase - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA %fields @field_info); - -require Font::TTF::Table; -use Font::TTF::Utils; - -@ISA = qw(Font::TTF::Table); -@field_info = ( - 'version' => 'v', - 'glyphIndex' => 'L', - 'horizontalBefore' => 'c', - 'horizontalAfter' => 'c', - 'horizontalCaretHead' => 'c', - 'horizontalCaretBase' => 'c', - 'verticalBefore' => 'c', - 'verticalAfter' => 'c', - 'verticalCaretHead' => 'c', - 'verticalCaretBase' => 'c'); - -sub init -{ - my ($k, $v, $c, $i); - for ($i = 0; $i < $#field_info; $i += 2) - { - ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); - next unless defined $k && $k ne ""; - $fields{$k} = $v; - } -} - - -=head2 $t->read - -Reads the table into memory as instance variables - -=cut - -sub read -{ - my ($self) = @_; - my ($dat); - - $self->SUPER::read or return $self; - init unless defined $fields{'glyphIndex'}; - $self->{' INFILE'}->read($dat, 16); - - TTF_Read_Fields($self, $dat, \%fields); - $self; -} - - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying. - -=cut - -sub out -{ - my ($self, $fh) = @_; - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $fh->print(TTF_Out_Fields($self, \%fields, 16)); - $self; -} - - -1; - - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Font.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Font.pm deleted file mode 100644 index 8f5cc50..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Font.pm +++ /dev/null @@ -1,767 +0,0 @@ -package Font::TTF::Font; - -=head1 NAME - -Font::TTF::Font - Memory representation of a font - -=head1 SYNOPSIS - -Here is the regression test (you provide your own font). Run it once and then -again on the output of the first run. There should be no differences between -the outputs of the two runs. - - $f = Font::TTF::Font->open($ARGV[0]); - - # force a read of all the tables - $f->tables_do(sub { $_[0]->read; }); - - # force read of all glyphs (use read_dat to use lots of memory!) - # $f->{'loca'}->glyphs_do(sub { $_[0]->read; }); - $f->{'loca'}->glyphs_do(sub { $_[0]->read_dat; }); - # NB. no need to $g->update since $f->{'glyf'}->out will do it for us - - $f->out($ARGV[1]); - $f->release; # clear up memory forcefully! - -=head1 DESCRIPTION - -A Truetype font consists of a header containing a directory of tables which -constitute the rest of the file. This class holds that header and directory and -also creates objects of the appropriate type for each table within the font. -Note that it does not read each table into memory, but creates a short reference -which can be read using the form: - - $f->{$tablename}->read; - -Classes are included that support many of the different TrueType tables. For -those for which no special code exists, the table type C is used, which -defaults to L. The current tables which are supported are: - - table Font::TTF::Table - for unknown tables - EBDT Font::TTF::EBDT - EBLC Font::TTF::EBLC - Feat Font::TTF::GrFeat - GDEF Font::TTF::GDEF - GPOS Font::TTF::GPOS - GSUB Font::TTF::GSUB - LTSH Font::TTF::LTSH - OS/2 Font::TTF::OS_2 - PCLT Font::TTF::PCLT - Sill Font::TTF::Sill - bsln Font::TTF::Bsln - cmap Font::TTF::Cmap - see also Font::TTF::OldCmap - cvt Font::TTF::Cvt_ - fdsc Font::TTF::Fdsc - feat Font::TTF::Feat - fmtx Font::TTF::Fmtx - fpgm Font::TTF::Fpgm - glyf Font::TTF::Glyf - see also Font::TTF::Glyph - hdmx Font::TTF::Hdmx - head Font::TTF::Head - hhea Font::TTF::Hhea - hmtx Font::TTF::Hmtx - kern Font::TTF::Kern - see alternative Font::TTF::AATKern - loca Font::TTF::Loca - maxp Font::TTF::Maxp - mort Font::TTF::Mort - see also Font::TTF::OldMort - name Font::TTF::Name - post Font::TTF::Post - prep Font::TTF::Prep - prop Font::TTF::Prop - vhea Font::TTF::Vhea - vmtx Font::TTF::Vmtx - -Links are: - -L -L L L -L L L L -L L L L L L -L L L L L -L L L L L -L L L L L -L L L L L -L L L - - -=head1 INSTANCE VARIABLES - -Instance variables begin with a space (and have lengths greater than the 4 -characters which make up table names). - -=over - -=item nocsum - -This is used during output to disable the creation of the file checksum in the -head table. For example, during DSIG table creation, this flag will be set to -ensure that the file checksum is left at zero. - -=item noharmony - -If set, do not harmonize the script and lang trees of GPOS and GSUB tables. See L for more info. - -=item fname (R) - -Contains the filename of the font which this object was read from. - -=item INFILE (P) - -The file handle which reflects the source file for this font. - -=item OFFSET (P) - -Contains the offset from the beginning of the read file of this particular -font directory, thus providing support for TrueType Collections. - -=back - -=head1 METHODS - -=cut - -use IO::File; - -use strict; -use vars qw(%tables $VERSION $dumper); -use Symbol(); - -require 5.004; - -$VERSION = 0.38; # MJPH 2-FEB-2008 Add Sill table -# $VERSION = 0.37; # MJPH 7-OCT-2005 Force hhea update if dirty, give more OS/2 stuff in update -# $VERSION = 0.36; # MJPH 19-AUG-2005 Change cmap::reverse api to be opts based -# $VERSION = 0.35; # MJPH 4-MAY-2004 Various fixes to OpenType stuff, separate off scripts -# $VERSION = 0.34; # MJPH 22-MAY-2003 Update PSNames to latest AGL -# $VERSION = 0.33; # MJPH 9-OCT-2002 Support CFF OpenType (just by version=='OTTO'?!) -# $VERSION = 0.32; # MJPH 2-OCT-2002 Bug fixes to TTFBuilder, new methods and some -# extension table support in Ttopen and Coverage -# $VERSION = 0.31; # MJPH 1-JUL-2002 fix read format 12 cmap (bart@cs.pdx.edu) -# improve surrogate support in ttfremap -# fix return warn to return warn,undef -# ensure correct indexToLocFormat -# $VERSION = 0.30; # MJPH 28-MAY-2002 add updated release -# $VERSION = 0.29; # MJPH 9-APR-2002 update ttfbuilder, sort out surrogates -# $VERSION = 0.28; # MJPH 13-MAR-2002 update ttfbuilder, add Font::TTF::Cmap::ms_enc() -# $VERSION = 0.27; # MJPH 6-FEB-2002 update ttfbuilder, support no fpgm, no more __DATA__ -# $VERSION = 0.26; # MJPH 19-SEP-2001 Update ttfbuilder -# $VERSION = 0.25; # MJPH 18-SEP-2001 problems in update of head -# $VERSION = 0.24; # MJPH 1-AUG-2001 Sort out update -# $VERSION = 0.23; # GST 30-MAY-2001 Memory leak fixed -# $VERSION = 0.22; # MJPH 09-APR-2001 Ensure all of AAT stuff included -# $VERSION = 0.21; # MJPH 23-MAR-2001 Improve Opentype support -# $VERSION = 0.20; # MJPH 13-JAN-2001 Add XML output and some of XML input, AAT & OT tables -# $VERSION = 0.19; # MJPH 29-SEP-2000 Add cmap::is_unicode, debug makefile.pl -# $VERSION = 0.18; # MJPH 21-JUL-2000 Debug Utils::TTF_bininfo -# $VERSION = 0.17; # MJPH 16-JUN-2000 Add utf8 support to names -# $VERSION = 0.16; # MJPH 26-APR-2000 Mark read tables as read, tidy up POD -# $VERSION = 0.15; # MJPH 5-FEB-2000 Ensure right versions released -# $VERSION = 0.14; # MJPH 11-SEP-1999 Sort out Unixisms, agian! -# $VERSION = 0.13; # MJPH 9-SEP-1999 Add empty, debug update_bbox -# $VERSION = 0.12; # MJPH 22-JUL-1999 Add update_bbox -# $VERSION = 0.11; # MJPH 7-JUL-1999 Don't store empties in cmaps -# $VERSION = 0.10; # MJPH 21-JUN-1999 Use IO::File -# $VERSION = 0.09; # MJPH 9-JUN-1999 Add 5.004 require, minor tweeks in cmap -# $VERSION = 0.08; # MJPH 19-MAY-1999 Sort out line endings for Unix -# $VERSION = 0.07; # MJPH 28-APR-1999 Get the regression tests to work -# $VERSION = 0.06; # MJPH 26-APR-1999 Start to add to CVS, correct MANIFEST.SKIP -# $VERSION = 0.05; # MJPH 13-APR-1999 See changes for 0.05 -# $VERSION = 0.04; # MJPH 13-MAR-1999 Tidy up Tarball -# $VERSION = 0.03; # MJPH 9-MAR-1999 Move to Font::TTF for CPAN -# $VERSION = 0.02; # MJPH 12-FEB-1999 Add support for ' nocsum' for DSIGS -# $VERSION = 0.0001; - -%tables = ( - 'table' => 'Font::TTF::Table', - 'EBDT' => 'Font::TTF::EBDT', - 'EBLC' => 'Font::TTF::EBLC', - 'Feat' => 'Font::TTF::GrFeat', - 'GDEF' => 'Font::TTF::GDEF', - 'GPOS' => 'Font::TTF::GPOS', - 'GSUB' => 'Font::TTF::GSUB', - 'LTSH' => 'Font::TTF::LTSH', - 'OS/2' => 'Font::TTF::OS_2', - 'PCLT' => 'Font::TTF::PCLT', - 'Sill' => 'Font::TTF::Sill', - 'bsln' => 'Font::TTF::Bsln', - 'cmap' => 'Font::TTF::Cmap', - 'cvt ' => 'Font::TTF::Cvt_', - 'fdsc' => 'Font::TTF::Fdsc', - 'feat' => 'Font::TTF::Feat', - 'fmtx' => 'Font::TTF::Fmtx', - 'fpgm' => 'Font::TTF::Fpgm', - 'glyf' => 'Font::TTF::Glyf', - 'hdmx' => 'Font::TTF::Hdmx', - 'head' => 'Font::TTF::Head', - 'hhea' => 'Font::TTF::Hhea', - 'hmtx' => 'Font::TTF::Hmtx', - 'kern' => 'Font::TTF::Kern', - 'loca' => 'Font::TTF::Loca', - 'maxp' => 'Font::TTF::Maxp', - 'mort' => 'Font::TTF::Mort', - 'name' => 'Font::TTF::Name', - 'post' => 'Font::TTF::Post', - 'prep' => 'Font::TTF::Prep', - 'prop' => 'Font::TTF::Prop', - 'vhea' => 'Font::TTF::Vhea', - 'vmtx' => 'Font::TTF::Vmtx', - ); - -# This is special code because I am fed up of every time I x a table in the debugger -# I get the whole font printed. Thus substitutes my 3 line change to dumpvar into -# the debugger. Clunky, but nice. You are welcome to a copy if you want one. - -BEGIN { - my ($p); - - foreach $p (@INC) - { - if (-f "$p/mydumpvar.pl") - { - $dumper = 'mydumpvar.pl'; - last; - } - } - $dumper ||= 'dumpvar.pl'; -} - -sub main::dumpValue -{ do $dumper; &main::dumpValue; } - - -=head2 Font::TTF::Font->AddTable($tablename, $class) - -Adds the given class to be used when representing the given table name. It also -'requires' the class for you. - -=cut - -sub AddTable -{ - my ($class, $table, $useclass) = @_; - - $tables{$table} = $useclass; -# $useclass =~ s|::|/|oig; -# require "$useclass.pm"; -} - - -=head2 Font::TTF::Font->Init - -For those people who like making fonts without reading them. This subroutine -will require all the table code for the various table types for you. Not -needed if using Font::TTF::Font::read before using a table. - -=cut - -sub Init -{ - my ($class) = @_; - my ($t); - - foreach $t (values %tables) - { - $t =~ s|::|/|oig; - require "$t.pm"; - } -} - -=head2 Font::TTF::Font->new(%props) - -Creates a new font object and initialises with the given properties. This is -primarily for use when a TTF is embedded somewhere. Notice that the properties -are automatically preceded by a space when inserted into the object. This is in -order that fields do not clash with tables. - -=cut - -sub new -{ - my ($class, %props) = @_; - my ($self) = {}; - - bless $self, $class; - - foreach (keys %props) - { $self->{" $_"} = $props{$_}; } - $self; -} - - -=head2 Font::TTF::Font->open($fname) - -Reads the header and directory for the given font file and creates appropriate -objects for each table in the font. - -=cut - -sub open -{ - my ($class, $fname) = @_; - my ($fh); - my ($self) = {}; - - unless (ref($fname)) - { - $fh = IO::File->new($fname) or return undef; - binmode $fh; - } else - { $fh = $fname; } - - $self->{' INFILE'} = $fh; - $self->{' fname'} = $fname; - $self->{' OFFSET'} = 0; - bless $self, $class; - - $self->read; -} - -=head2 $f->read - -Reads a Truetype font directory starting from the current location in the file. -This has been separated from the C function to allow support for embedded -TTFs for example in TTCs. Also reads the C and C tables immediately. - -=cut - -sub read -{ - my ($self) = @_; - my ($fh) = $self->{' INFILE'}; - my ($dat, $i, $ver, $dir_num, $type, $name, $check, $off, $len, $t); - - $fh->seek($self->{' OFFSET'}, 0); - $fh->read($dat, 12); - ($ver, $dir_num) = unpack("Nn", $dat); - $ver == 1 << 16 || $ver == unpack('N', 'OTTO') || $ver == 0x74727565 or return undef; # support Mac sfnts - - for ($i = 0; $i < $dir_num; $i++) - { - $fh->read($dat, 16) || die "Reading table entry"; - ($name, $check, $off, $len) = unpack("a4NNN", $dat); - $self->{$name} = $self->{' PARENT'}->find($self, $name, $check, $off, $len) && next - if (defined $self->{' PARENT'}); - $type = $tables{$name} || 'Font::TTF::Table'; - $t = $type; - if ($^O eq "MacOS") - { $t =~ s/^|::/:/oig; } - else - { $t =~ s|::|/|oig; } - require "$t.pm"; - $self->{$name} = $type->new(PARENT => $self, - NAME => $name, - INFILE => $fh, - OFFSET => $off, - LENGTH => $len, - CSUM => $check); - } - - foreach $t ('head', 'maxp') - { $self->{$t}->read if defined $self->{$t}; } - - $self; -} - - -=head2 $f->out($fname [, @tablelist]) - -Writes a TTF file consisting of the tables in tablelist. The list is checked to -ensure that only tables that exist are output. (This means that you can't have -non table information stored in the font object with key length of exactly 4) - -In many cases the user simply wants to output all the tables in alphabetical order. -This can be done by not including a @tablelist, in which case the subroutine will -output all the defined tables in the font in alphabetical order. - -Returns $f on success and undef on failure, including warnings. - -All output files must include the C table. - -=cut - -sub out -{ - my ($self, $fname, @tlist) = @_; - my ($fh); - my ($dat, $numTables, $sRange, $eSel); - my (%dir, $k, $mloc, $count); - my ($csum, $lsum, $msum, $loc, $oldloc, $len, $shift); - - unless (ref($fname)) - { - $fh = IO::File->new("+>$fname") || return warn("Unable to open $fname for writing"), undef; - binmode $fh; - } else - { $fh = $fname; } - - $self->{' oname'} = $fname; - $self->{' outfile'} = $fh; - - if ($self->{' wantsig'}) - { - $self->{' nocsum'} = 1; -# $self->{'head'}{'checkSumAdjustment'} = 0; - $self->{' tempDSIG'} = $self->{'DSIG'}; - $self->{' tempcsum'} = $self->{'head'}{' CSUM'}; - delete $self->{'DSIG'}; - @tlist = sort {$self->{$a}{' OFFSET'} <=> $self->{$b}{' OFFSET'}} - grep (length($_) == 4 && defined $self->{$_}, keys %$self) if ($#tlist < 0); - } - elsif ($#tlist < 0) - { @tlist = sort keys %$self; } - - @tlist = grep(length($_) == 4 && defined $self->{$_}, @tlist); - $numTables = $#tlist + 1; - $numTables++ if ($self->{' wantsig'}); - - ($numTables, $sRange, $eSel, $shift) = Font::TTF::Utils::TTF_bininfo($numTables, 16); - $dat = pack("Nnnnn", 1 << 16, $numTables, $sRange, $eSel, $shift); - $fh->print($dat); - $msum = unpack("%32N*", $dat); - -# reserve place holders for each directory entry - foreach $k (@tlist) - { - $dir{$k} = pack("A4NNN", $k, 0, 0, 0); - $fh->print($dir{$k}); - } - - $fh->print(pack('A4NNN', '', 0, 0, 0)) if ($self->{' wantsig'}); - - $loc = $fh->tell(); - if ($loc & 3) - { - $fh->print(substr("\000" x 4, $loc & 3)); - $loc += 4 - ($loc & 3); - } - - foreach $k (@tlist) - { - $oldloc = $loc; - $self->{$k}->out($fh); - $loc = $fh->tell(); - $len = $loc - $oldloc; - if ($loc & 3) - { - $fh->print(substr("\000" x 4, $loc & 3)); - $loc += 4 - ($loc & 3); - } - $fh->seek($oldloc, 0); - $csum = 0; $mloc = $loc; - while ($mloc > $oldloc) - { - $count = ($mloc - $oldloc > 4096) ? 4096 : $mloc - $oldloc; - $fh->read($dat, $count); - $csum += unpack("%32N*", $dat); -# this line ensures $csum stays within 32 bit bounds, clipping as necessary - if ($csum > 0xffffffff) { $csum -= 0xffffffff; $csum--; } - $mloc -= $count; - } - $dir{$k} = pack("A4NNN", $k, $csum, $oldloc, $len); - $msum += $csum + unpack("%32N*", $dir{$k}); - while ($msum > 0xffffffff) { $msum -= 0xffffffff; $msum--; } - $fh->seek($loc, 0); - } - - unless ($self->{' nocsum'}) # assuming we want a file checksum - { -# Now we need to sort out the head table's checksum - if (!defined $dir{'head'}) - { # you have to have a head table - $fh->close(); - return warn("No 'head' table to output in $fname"), undef; - } - ($csum, $loc, $len) = unpack("x4NNN", $dir{'head'}); - $fh->seek($loc + 8, 0); - $fh->read($dat, 4); - $lsum = unpack("N", $dat); - if ($lsum != 0) - { - $csum -= $lsum; - if ($csum < 0) { $csum += 0xffffffff; $csum++; } - $msum -= $lsum * 2; # twice (in head and in csum) - while ($msum < 0) { $msum += 0xffffffff; $msum++; } - } - $lsum = 0xB1B0AFBA - $msum; - $fh->seek($loc + 8, 0); - $fh->print(pack("N", $lsum)); - $dir{'head'} = pack("A4NNN", 'head', $csum, $loc, $len); - } elsif ($self->{' wantsig'}) - { - if (!defined $dir{'head'}) - { # you have to have a head table - $fh->close(); - return warn("No 'head' table to output in $fname"), undef; - } - ($csum, $loc, $len) = unpack("x4NNN", $dir{'head'}); - $fh->seek($loc + 8, 0); - $fh->print(pack("N", 0)); -# $dir{'head'} = pack("A4NNN", 'head', $self->{' tempcsum'}, $loc, $len); - } - -# Now we can output the directory again - if ($self->{' wantsig'}) - { @tlist = sort @tlist; } - $fh->seek(12, 0); - foreach $k (@tlist) - { $fh->print($dir{$k}); } - $fh->print(pack('A4NNN', '', 0, 0, 0)) if ($self->{' wantsig'}); - $fh->close(); - $self; -} - - -=head2 $f->out_xml($filename [, @tables]) - -Outputs the font in XML format - -=cut - -sub out_xml -{ - my ($self, $fname, @tlist) = @_; - my ($fh, $context, $numTables, $k); - - $context->{'indent'} = ' ' x 4; - - unless (ref($fname)) - { - $fh = IO::File->new("+>$fname") || return warn("Unable to open $fname"), undef; - binmode $fh; - } else - { $fh = $fname; } - - unless (scalar @tlist > 0) - { - @tlist = sort keys %$self; - @tlist = grep(length($_) == 4 && defined $self->{$_}, @tlist); - } - $numTables = $#tlist + 1; - - $context->{'fh'} = $fh; - $fh->print("\n"); - $fh->print("\n\n"); - - foreach $k (@tlist) - { - $fh->print("
    \n"); - $self->{$k}->out_xml($context, $context->{'indent'}); - $fh->print("
    \n"); - } - - $fh->print("\n"); - $fh->close; - $self; -} - - -=head2 $f->XML_start($context, $tag, %attrs) - -Handles start messages from the XML parser. Of particular interest to us are and -. - -=cut - -sub XML_start -{ - my ($self, $context, $tag, %attrs) = @_; - my ($name, $type, $t); - - if ($tag eq 'font') - { $context->{'tree'}[-1] = $self; } - elsif ($tag eq 'table') - { - $name = $attrs{'name'}; - unless (defined $self->{$name}) - { - $type = $tables{$name} || 'Font::TTF::Table'; - $t = $type; - if ($^O eq "MacOS") - { $t =~ s/^|::/:/oig; } - else - { $t =~ s|::|/|oig; } - require "$t.pm"; - $self->{$name} = $type->new('PARENT' => $self, 'NAME' => $name, 'read' => 1); - } - $context->{'receiver'} = ($context->{'tree'}[-1] = $self->{$name}); - } - $context; -} - - -sub XML_end -{ - my ($self) = @_; - my ($context, $tag, %attrs) = @_; - my ($i); - - return undef unless ($tag eq 'table' && $attrs{'name'} eq 'loca'); - if (defined $context->{'glyphs'} && $context->{'glyphs'} ne $self->{'loca'}{'glyphs'}) - { - for ($i = 0; $i <= $#{$context->{'glyphs'}}; $i++) - { $self->{'loca'}{'glyphs'}[$i] = $context->{'glyphs'}[$i] if defined $context->{'glyphs'}[$i]; } - $context->{'glyphs'} = $self->{'loca'}{'glyphs'}; - } - return undef; -} - -=head2 $f->update - -Sends update to all the tables in the font and then resets all the isDirty -flags on each table. The data structure in now consistent as a font (we hope). - -=cut - -sub update -{ - my ($self) = @_; - - $self->tables_do(sub { $_[0]->update; }); - - $self; -} - -=head2 $f->dirty - -Dirties all the tables in the font - -=cut - -sub dirty -{ $_[0]->tables_do(sub { $_[0]->dirty; }); $_[0]; } - -=head2 $f->tables_do(&func [, tables]) - -Calls &func for each table in the font. Calls the table in alphabetical sort -order as per the order in the directory: - - &func($table, $name); - -May optionally take a list of table names in which case func is called -for each of them in the given order. -=cut - -sub tables_do -{ - my ($self, $func, @tables) = @_; - my ($t); - - foreach $t (@tables ? @tables : sort grep {length($_) == 4} keys %$self) - { &$func($self->{$t}, $t); } - $self; -} - - -=head2 $f->release - -Releases ALL of the memory used by the TTF font and all of its component -objects. After calling this method, do B expect to have anything left in -the C object. - -B, that it is important that you call this method on any -C object when you wish to destruct it and free up its memory. -Internally, we track things in a structure that can result in circular -references, and without calling 'C' these will not properly get -cleaned up by Perl. Once you've called this method, though, don't expect to be -able to do anything else with the C object; it'll have B -internal state whatsoever. - -B As part of the brute-force cleanup done here, this method -will throw a warning message whenever unexpected key values are found within -the C object. This is done to help ensure that any unexpected -and unfreed values are brought to your attention so that you can bug us to keep -the module updated properly; otherwise the potential for memory leaks due to -dangling circular references will exist. - -=cut - -sub release -{ - my ($self) = @_; - -# delete stuff that we know we can, here - - my @tofree = map { delete $self->{$_} } keys %{$self}; - - while (my $item = shift @tofree) - { - my $ref = ref($item); - if (UNIVERSAL::can($item, 'release')) - { $item->release(); } - elsif ($ref eq 'ARRAY') - { push( @tofree, @{$item} ); } - elsif (UNIVERSAL::isa($ref, 'HASH')) - { release($item); } - } - -# check that everything has gone - it better had! - foreach my $key (keys %{$self}) - { warn ref($self) . " still has '$key' key left after release.\n"; } -} - -1; - -=head1 BUGS - -Bugs abound aplenty I am sure. There is a lot of code here and plenty of scope. -The parts of the code which haven't been implemented yet are: - -=over 4 - -=item Post - -Version 4 format types are not supported yet. - -=item Cmap - -Format type 2 (MBCS) has not been implemented yet and therefore may cause -somewhat spurious results for this table type. - -=item Kern - -Only type 0 & type 2 tables are supported (type 1 & type 3 yet to come). - -=item TTC - -The current Font::TTF::Font::out method does not support the writing of TrueType -Collections. - -=back - -In addition there are weaknesses or features of this module library - -=over 4 - -=item * - -There is very little (or no) error reporting. This means that if you have -garbled data or garbled data structures, then you are liable to generate duff -fonts. - -=item * - -The exposing of the internal data structures everywhere means that doing -radical re-structuring is almost impossible. But it stop the code from becoming -ridiculously large. - -=back - -Apart from these, I try to keep the code in a state of "no known bugs", which -given the amount of testing this code has had, is not a guarantee of high -quality, yet. - -For more details see the appropriate class files. - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org - -Copyright Martin Hosken 1998. - -No warranty or expression of effectiveness, least of all regarding anyone's -safety, is implied in this software or documentation. - -=head2 Licensing - -The Perl TTF module is licensed under the Perl Artistic License. - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fpgm.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fpgm.pm deleted file mode 100644 index 4cc7709..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fpgm.pm +++ /dev/null @@ -1,87 +0,0 @@ -package Font::TTF::Fpgm; - -=head1 NAME - -Font::TTF::Fpgm - Font program in a TrueType font. Called when a font is loaded - -=head1 DESCRIPTION - -This is a minimal class adding nothing beyond a table, but is a repository -for fpgm type information for those processes brave enough to address hinting. - -=cut - -use strict; -use vars qw(@ISA $VERSION); - -@ISA = qw(Font::TTF::Table); - -$VERSION = 0.0001; - -=head2 $t->read - -Reading this table is simply a process of reading all the data into the RAM -copy. Nothing more is done with it. - -=cut - -sub read -{ - $_[0]->read_dat; - $_[0]->{' read'} = 1; -} - -=head2 $t->out_xml($context, $depth) - -Outputs Fpgm program as XML - -=cut - -sub out_xml -{ - my ($self, $context, $depth) = @_; - my ($fh) = $context->{'fh'}; - my ($dat); - - $self->read; - $dat = Font::TTF::Utils::XML_binhint($self->{' dat'}); - $dat =~ s/\n(?!$)/\n$depth$context->{'indent'}/omg; - $fh->print("$depth\n"); - $fh->print("$depth$context->{'indent'}$dat"); - $fh->print("$depth\n"); - $self; -} - - -=head2 $t->XML_end($context, $tag, %attrs) - -Parse all that hinting code - -=cut - -sub XML_end -{ - my ($self) = shift; - my ($context, $tag, %attrs) = @_; - - if ($tag eq 'code') - { - $self->{' dat'} = Font::TTF::Utils::XML_hintbin($context->{'text'}); - return $context; - } else - { return $self->SUPER::XML_end(@_); } -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GDEF.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GDEF.pm deleted file mode 100644 index 9519ee8..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GDEF.pm +++ /dev/null @@ -1,313 +0,0 @@ -package Font::TTF::GDEF; - -=head1 NAME - -Font::TTF::GDEF - Opentype GDEF table support - -=head1 DESCRIPTION - -The GDEF table contains various global lists of information which are apparantly -used in other places in an OpenType renderer. But precisely where is open to -speculation... - -=head1 INSTANCE VARIABLES - -There are 4 tables in the GDEF table, each with their own structure: - -=over 4 - -=item GLYPH - -This is an L Class Definition table containing information -as to what type each glyph is. - -=item ATTACH - -The attach table consists of a coverage table and then attachment points for -each glyph in the coverage table: - -=over 8 - -=item COVERAGE - -This is a coverage table - -=item POINTS - -This is an array of point elements. Each element is an array of curve points -corresponding to the attachment points on that glyph. The order of the curve points -in the array corresponds to the attachment point number specified in the MARKS -coverage table (see below). - -=back - -=item LIG - -This contains the ligature caret positioning information for ligature glyphs - -=over 8 - -=item COVERAGE - -A coverage table to say which glyphs are ligatures - -=item LIGS - -An array of elements for each ligature. Each element is an array of information -for each caret position in the ligature (there being number of components - 1 of -these, generally) - -=over 12 - -=item FMT - -This is the format of the information and is important to provide the semantics -for the value. This value must be set correctly before output - -=item VAL - -The value which has meaning according to FMT - -=item DEVICE - -For FMT = 3, a device table is also referenced which is stored here - -=back - -=back - -=item MARKS - -Due to confusion in the GDEF specification, this field is currently withdrawn until -the confusion is resolved. That way, perhaps this stuff will work! - -This class definition table stores the mark attachment point numbers for each -attachment mark, to indicate which attachment point the mark attaches to on its -base glyph. - -=back - - -=head1 METHODS - -=cut - -use strict; -use Font::TTF::Table; -use Font::TTF::Utils; -use Font::TTF::Ttopen; -use vars qw(@ISA $new_gdef); - -@ISA = qw(Font::TTF::Table); -$new_gdef = 1; - -=head2 $t->read - -Reads the table into the data structure - -=cut - -sub read -{ - my ($self) = @_; - my ($fh) = $self->{' INFILE'}; - my ($boff) = $self->{' OFFSET'}; - my ($dat, $goff, $loff, $aoff, $moff, $r, $s, $bloc); - - $self->SUPER::read or return $self; - $bloc = $fh->tell(); - if ($new_gdef) - { - $fh->read($dat, 12); - ($self->{'Version'}, $goff, $aoff, $loff, $moff) = TTF_Unpack('fS4', $dat); - } - else - { - $fh->read($dat, 10); - ($self->{'Version'}, $goff, $aoff, $loff) = TTF_Unpack('fS3', $dat); - } - - if ($goff > 0) - { - $fh->seek($goff + $boff, 0); - $self->{'GLYPH'} = Font::TTF::Coverage->new(0)->read($fh); - } - - if ($new_gdef && $moff > 0 && $moff < $self->{' LENGTH'}) - { - $fh->seek($moff + $boff, 0); - $self->{'MARKS'} = Font::TTF::Coverage->new(0)->read($fh); - } - - if ($aoff > 0) - { - my ($off, $gcount, $pcount); - - $fh->seek($aoff + $boff, 0); - $fh->read($dat, 4); - ($off, $gcount) = TTF_Unpack('SS', $dat); - $fh->read($dat, $gcount << 1); - - $fh->seek($aoff + $boff + $off, 0); - $self->{'ATTACH'}{'COVERAGE'} = Font::TTF::Coverage->new(1)->read($fh); - - foreach $r (TTF_Unpack('S*', $dat)) - { - unless ($r) - { - push (@{$self->{'ATTACH'}{'POINTS'}}, []); - next; - } - $fh->seek($aoff + $boff + $r, 0); - $fh->read($dat, 2); - $pcount = TTF_Unpack('S', $dat); - $fh->read($dat, $pcount << 1); - push (@{$self->{'ATTACH'}{'POINTS'}}, [TTF_Unpack('S*', $dat)]); - } - } - - if ($loff > 0) - { - my ($lcount, $off, $ccount, $srec, $comp); - - $fh->seek($loff + $boff, 0); - $fh->read($dat, 4); - ($off, $lcount) = TTF_Unpack('SS', $dat); - $fh->read($dat, $lcount << 1); - - $fh->seek($off + $loff + $boff, 0); - $self->{'LIG'}{'COVERAGE'} = Font::TTF::Coverage->new(1)->read($fh); - - foreach $r (TTF_Unpack('S*', $dat)) - { - $fh->seek($r + $loff + $boff, 0); - $fh->read($dat, 2); - $ccount = TTF_Unpack('S', $dat); - $fh->read($dat, $ccount << 1); - - $srec = []; - foreach $s (TTF_Unpack('S*', $dat)) - { - $comp = {}; - $fh->seek($s + $r + $loff + $boff, 0); - $fh->read($dat, 4); - ($comp->{'FMT'}, $comp->{'VAL'}) = TTF_Unpack('S*', $dat); - if ($comp->{'FMT'} == 3) - { - $fh->read($dat, 2); - $off = TTF_Unpack('S', $dat); - if (defined $self->{' CACHE'}{$off + $s + $r}) - { $comp->{'DEVICE'} = $self->{' CACHE'}{$off + $s + $r}; } - else - { - $fh->seek($off + $s + $r + $loff + $boff, 0); - $comp->{'DEVICE'} = Font::TTF::Delta->new->read($fh); - $self->{' CACHE'}{$off + $s + $r} = $comp->{'DEVICE'}; - } - } - push (@$srec, $comp); - } - push (@{$self->{'LIG'}{'LIGS'}}, $srec); - } - } - - $self; -} - - -=head2 $t->out($fh) - -Writes out this table. - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($goff, $aoff, $loff, $moff, @offs, $loc1, $coff, $loc); - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $loc = $fh->tell(); - if ($new_gdef) - { $fh->print(TTF_Pack('fSSSS', $self->{'Version'}, 0, 0, 0, 0)); } - else - { $fh->print(TTF_Pack('fSSS', $self->{'Version'}, 0, 0, 0)); } - - if (defined $self->{'GLYPH'}) - { - $goff = $fh->tell() - $loc; - $self->{'GLYPH'}->out($fh); - } - - if (defined $self->{'ATTACH'}) - { - my ($r); - - $aoff = $fh->tell() - $loc; - $fh->print(pack('n*', (0) x ($#{$self->{'ATTACH'}{'POINTS'}} + 3))); - foreach $r (@{$self->{'ATTACH'}{'POINTS'}}) - { - push (@offs, $fh->tell() - $loc - $aoff); - $fh->print(pack('n*', $#{$r} + 1, @$r)); - } - $coff = $fh->tell() - $loc - $aoff; - $self->{'ATTACH'}{'COVERAGE'}->out($fh); - $loc1 = $fh->tell(); - $fh->seek($aoff + $loc, 0); - $fh->print(pack('n*', $coff, $#offs + 1, @offs)); - $fh->seek($loc1, 0); - } - - if (defined $self->{'LIG'}) - { - my (@reftables, $ltables, $i, $j, $out, $r, $s); - - $ltables = {}; - $loff = $fh->tell() - $loc; - $out = pack('n*', - Font::TTF::Ttopen::ref_cache($self->{'LIG'}{'COVERAGE'}, $ltables, 0), - $#{$self->{'LIG'}{'LIGS'}} + 1, - (0) x ($#{$self->{'LIG'}{'LIGS'}} + 1)); - push (@reftables, [$ltables, 0]); - $i = 0; - foreach $r (@{$self->{'LIG'}{'LIGS'}}) - { - $ltables = {}; - $loc1 = length($out); - substr($out, ($i << 1) + 4, 2) = TTF_Pack('S', $loc1); - $out .= pack('n*', $#{$r} + 1, (0) x ($#{$r} + 1)); - @offs = (); $j = 0; - foreach $s (@$r) - { - substr($out, ($j << 1) + 2 + $loc1, 2) = - TTF_Pack('S', length($out) - $loc1); - $out .= TTF_Pack('SS', $s->{'FMT'}, $s->{'VAL'}); - $out .= pack('n', Font::TTF::Ttopen::ref_cache($s->{'DEVICE'}, - $ltables, length($out))) if ($s->{'FMT'} == 3); - $j++; - } - push (@reftables, [$ltables, $loc1]); - $i++; - } - Font::TTF::Ttopen::out_final($fh, $out, \@reftables); - } - - if ($new_gdef && defined $self->{'MARKS'}) - { - $moff = $fh->tell() - $loc; - $self->{'MARKS'}->out($fh); - } - - $loc1 = $fh->tell(); - $fh->seek($loc + 4, 0); - if ($new_gdef) - { $fh->print(TTF_Pack('S4', $goff, $aoff, $loff, $moff)); } - else - { $fh->print(TTF_Pack('S3', $goff, $aoff, $loff)); } - $fh->seek($loc1, 0); - $self; -} - -1; - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GPOS.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GPOS.pm deleted file mode 100644 index 8e8b7ce..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GPOS.pm +++ /dev/null @@ -1,701 +0,0 @@ -package Font::TTF::GPOS; - -=head1 NAME - -Font::TTF::GPOS - Support for Opentype GPOS tables in conjunction with TTOpen - -=head1 DESCRIPTION - -The GPOS table is one of the most complicated tables in the TTF spec and the -corresponding data structure abstraction is also not trivial. While much of the -structure of a GPOS is shared with a GSUB table via the L - -=head1 INSTANCE VARIABLES - -Here we describe the additions and lookup specific information for GPOS tables. -Unfortunately there is no one abstraction which seems to work comfortable for -all GPOS tables, so we will also examine how the variables are used for different -lookup types. - -The following are the values allowed in the ACTION_TYPE and MATCH_TYPE variables: - -=over 4 - -=item ACTION_TYPE - -This can take any of the following values - -=over 8 - -=item a - -The ACTION is an array of anchor tables - -=item o - -Offset. There is no RULE array. The ADJUST variable contains a value record (see -later in this description) - -=item v - -The ACTION is a value record. - -=item p - -Pair adjustment. The ACTION contains an array of two value records for the matched -two glyphs. - -=item e - -Exit and Entry records. The ACTION contains an array of two anchors corresponding -to the exit and entry anchors for the glyph. - -=item l - -Indicates a lookup based contextual rule as per the GSUB table. - -=back - -=item MATCH_TYPE - -This can take any of the following values - -=over 8 - -=item g - -A glyph array - -=item c - -An array of class values - -=item o - -An array of coverage tables - -=back - -=back - -The following variables are added for Attachment Positioning Subtables: - -=over 4 - -=item MATCH - -This contains an array of glyphs to match against for all RULES. It is much like -having the same MATCH string in all RULES. In the cases it is used so far, it only -ever contains one element. - -=item MARKS - -This contains a Mark array consisting of each element being a subarray of two -elements: - -=over 8 - -=item CLASS - -The class that this mark uses on its base - -=item ANCHOR - -The anchor with which to attach this mark glyph - -=back - -The base table for mark to base, ligature or mark attachment positioning is -structured with the ACTION containing an array of anchors corresponding to each -attachment class. For ligatures, there is more than one RULE in the RULE array -corresponding to each glyph in the coverage table. - -=back - -Other variables which are provided for informational purposes are: - -=over 4 - -=item VFMT - -Value format for the adjustment of the glyph matched by the coverage table. - -=item VFMT2 - -Value format used in pair adjustment for the second glyph in the pair - -=back - -=head2 Value Records - -There is a subtype used in GPOS tables called a value record. It is used to adjust -the position of a glyph from its default position. The value record is variable -length with a bitfield at the beginning to indicate which of the following -entries are included. The bitfield is not stored since it is recalculated at -write time. - -=over 4 - -=item XPlacement - -Horizontal adjustment for placement (not affecting other unattached glyphs) - -=item YPlacement - -Vertical adjustment for placement (not affecting other unattached glyphs) - -=item XAdvance - -Adjust the advance width glyph (used only in horizontal writing systems) - -=item YAdvance - -Adjust the vertical advance (used only in vertical writing systems) - -=item XPlaDevice - -Device table for device specific adjustment of horizontal placement - -=item YPlaDevice - -Device table for device specific adjustment of vertical placement - -=item XAdvDevice - -Device table for device specific adjustment of horizontal advance - -=item YAdDevice - -Device table for device specific adjustment of vertical advance - -=item XIdPlacement - -Horizontal placement metric id (for Multiple Master fonts - but that's all I know!) - -=item YIdPlacement - -Vertical placement metric id - -=item XIdAdvance - -Horizontal advance metric id - -=item YIdAdvance - -Vertical advance metric id - -=back - -=head1 CORRESPONDANCE TO LAYOUT TYPES - -Here is what is stored in the ACTION_TYPE and MATCH_TYPE for each of the known -GPOS subtable types: - - 1.1 1.2 2.1 2.2 3 4 5 6 7.1 7.2 7.3 8.1 8.2 8.3 - ACTION_TYPE o v p p e a a a l l l l l l - MATCH_TYPE g c g c o g c o - - -=head1 METHODS - -=cut - -use strict; -use Font::TTF::Ttopen; -use Font::TTF::Delta; -use Font::TTF::Anchor; -use Font::TTF::Utils; -use vars qw(@ISA); - -@ISA = qw(Font::TTF::Ttopen); - - -=head2 read_sub - -Reads the subtable into the data structures - -=cut - -sub read_sub -{ - my ($self, $fh, $main_lookup, $sindex) = @_; - my ($type) = $main_lookup->{'TYPE'}; - my ($loc) = $fh->tell(); - my ($lookup) = $main_lookup->{'SUB'}[$sindex]; - my ($dat, $mcount, $scount, $i, $j, $count, $fmt, $fmt2, $cover, $srec, $subst); - my ($c1, $c2, $s, $moff, $boff); - - - if ($type == 8) - { - $fh->read($dat, 4); - ($fmt, $cover) = TTF_Unpack('S2', $dat); - if ($fmt < 3) - { - $fh->read($dat, 2); - $count = TTF_Unpack('S', $dat); - } - } else - { - $fh->read($dat, 6); - ($fmt, $cover, $count) = TTF_Unpack("S3", $dat); - } - unless ($fmt == 3 && ($type == 7 || $type == 8)) - { $lookup->{'COVERAGE'} = $self->read_cover($cover, $loc, $lookup, $fh, 1); } - - $lookup->{'FORMAT'} = $fmt; - if ($type == 1 && $fmt == 1) - { - $lookup->{'VFMT'} = $count; - $lookup->{'ADJUST'} = $self->read_value($count, $loc, $lookup, $fh); - $lookup->{'ACTION_TYPE'} = 'o'; - } elsif ($type == 1 && $fmt == 2) - { - $lookup->{'VFMT'} = $count; - $fh->read($dat, 2); - $mcount = unpack('n', $dat); - for ($i = 0; $i < $mcount; $i++) - { push (@{$lookup->{'RULES'}}, [{'ACTION' => - [$self->read_value($count, $loc, $lookup, $fh)]}]); } - $lookup->{'ACTION_TYPE'} = 'v'; - } elsif ($type == 2 && $fmt == 1) - { - $lookup->{'VFMT'} = $count; - $fh->read($dat, 4); - ($fmt2, $mcount) = unpack('n2', $dat); - $lookup->{'VFMT2'} = $fmt2; - $fh->read($dat, $mcount << 1); - foreach $s (unpack('n*', $dat)) - { - $fh->seek($loc + $s, 0); - $fh->read($dat, 2); - $scount = TTF_Unpack('S', $dat); - $subst = []; - for ($i = 0; $i < $scount; $i++) - { - $srec = {}; - $fh->read($dat, 2); - $srec->{'MATCH'} = [TTF_Unpack('S', $dat)]; - $srec->{'ACTION'} = [$self->read_value($count, $loc, $lookup, $fh), - $self->read_value($fmt2, $loc, $lookup, $fh)]; - push (@$subst, $srec); - } - push (@{$lookup->{'RULES'}}, $subst); - } - $lookup->{'ACTION_TYPE'} = 'p'; - $lookup->{'MATCH_TYPE'} = 'g'; - } elsif ($type == 2 && $fmt == 2) - { - $fh->read($dat, 10); - ($lookup->{'VFMT2'}, $c1, $c2, $mcount, $scount) = TTF_Unpack('S*', $dat); - $lookup->{'CLASS'} = $self->read_cover($c1, $loc, $lookup, $fh, 0); - $lookup->{'MATCH'} = [$self->read_cover($c2, $loc, $lookup, $fh, 0)]; - $lookup->{'VFMT'} = $count; - for ($i = 0; $i < $mcount; $i++) - { - $subst = []; - for ($j = 0; $j < $scount; $j++) - { - $srec = {}; - $srec->{'ACTION'} = [$self->read_value($lookup->{'VFMT'}, $loc, $lookup, $fh), - $self->read_value($lookup->{'VFMT2'}, $loc, $lookup, $fh)]; - push (@$subst, $srec); - } - push (@{$lookup->{'RULES'}}, $subst); - } - $lookup->{'ACTION_TYPE'} = 'p'; - $lookup->{'MATCH_TYPE'} = 'c'; - } elsif ($type == 3 && $fmt == 1) - { - $fh->read($dat, $count << 2); - for ($i = 0; $i < $count; $i++) - { push (@{$lookup->{'RULES'}}, [{'ACTION' => - [$self->read_anchor(TTF_Unpack('S', substr($dat, $i << 2, 2)), - $loc, $lookup, $fh), - $self->read_anchor(TTF_Unpack('S', substr($dat, ($i << 2) + 2, 2)), - $loc, $lookup, $fh)]}]); } - $lookup->{'ACTION_TYPE'} = 'e'; - } elsif ($type == 4 || $type == 5 || $type == 6) - { - my (@offs, $mloc, $thisloc, $ncomp, $k); - - $lookup->{'MATCH'} = [$lookup->{'COVERAGE'}]; - $lookup->{'COVERAGE'} = $self->read_cover($count, $loc, $lookup, $fh, 1); - $fh->read($dat, 6); - ($mcount, $moff, $boff) = TTF_Unpack('S*', $dat); - $fh->seek($loc + $moff, 0); - $fh->read($dat, 2); - $count = TTF_Unpack('S', $dat); - for ($i = 0; $i < $count; $i++) - { - $fh->read($dat, 4); - push (@{$lookup->{'MARKS'}}, [TTF_Unpack('S', $dat), - $self->read_anchor(TTF_Unpack('S', substr($dat, 2, 2)) + $moff, - $loc, $lookup, $fh)]); - } - $fh->seek($loc + $boff, 0); - $fh->read($dat, 2); - $count = TTF_Unpack('S', $dat); - $mloc = $fh->tell() - 2; - $thisloc = $mloc; - if ($type == 5) - { - $fh->read($dat, $count << 1); - @offs = TTF_Unpack('S*', $dat); - } - for ($i = 0; $i < $count; $i++) - { - if ($type == 5) - { - $thisloc = $mloc + $offs[$i]; - $fh->seek($thisloc, 0); - $fh->read($dat, 2); - $ncomp = TTF_Unpack('S', $dat); - } else - { $ncomp = 1; } - for ($j = 0; $j < $ncomp; $j++) - { - $subst = []; - $fh->read($dat, $mcount << 1); - for ($k = 0; $k < $mcount; $k++) - { push (@$subst, $self->read_anchor(TTF_Unpack('S', substr($dat, $k << 1, 2)) + $thisloc - $loc, - $loc, $lookup, $fh)); } - - push (@{$lookup->{'RULES'}[$i]}, {'ACTION' => $subst}); - } - } - $lookup->{'ACTION_TYPE'} = 'a'; - } elsif ($type == 7 || $type == 8) - { $self->read_context($lookup, $fh, $type - 2, $fmt, $cover, $count, $loc); } - $lookup; -} - - -=head2 $t->extension - -Returns the table type number for the extension table - -=cut - -sub extension -{ return 9; } - - -=head2 $t->out_sub - -Outputs the subtable to the given filehandle - -=cut - -sub out_sub -{ - my ($self, $fh, $main_lookup, $index, $ctables, $base) = @_; - my ($type) = $main_lookup->{'TYPE'}; - my ($lookup) = $main_lookup->{'SUB'}[$index]; - my ($fmt) = $lookup->{'FORMAT'}; - my ($out, $r, $s, $t, $i, $j, $vfmt, $vfmt2, $loc1); - my ($num) = $#{$lookup->{'RULES'}} + 1; - my ($mtables) = {}; - my (@reftables); - - if ($type == 1 && $fmt == 1) - { - $out = pack('n2', $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base)); - $vfmt = $self->fmt_value($lookup->{'ADJUST'}); - $out .= pack('n', $vfmt) . $self->out_value($lookup->{'ADJUST'}, $vfmt, $ctables, 6 + $base); - } elsif ($type == 1 && $fmt == 2) - { - $vfmt = 0; - foreach $r (@{$lookup->{'RULES'}}) - { $vfmt |= $self->fmt_value($r->[0]{'ACTION'}[0]); } - $out = pack('n4', $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), - $vfmt, $#{$lookup->{'RULES'}} + 1); - foreach $r (@{$lookup->{'RULES'}}) - { $out .= $self->out_value($r->[0]{'ACTION'}[0], $vfmt, $ctables, length($out) + $base); } - } elsif ($type == 2 && $fmt < 3) - { - $vfmt = 0; - $vfmt2 = 0; - foreach $r (@{$lookup->{'RULES'}}) - { - foreach $t (@$r) - { - $vfmt |= $self->fmt_value($t->{'ACTION'}[0]); - $vfmt2 |= $self->fmt_value($t->{'ACTION'}[1]); - } - } - if ($fmt == 1) - { - # start PairPosFormat1 subtable - $out = pack('n5', - $fmt, - Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), - $vfmt, - $vfmt2, - $#{$lookup->{'RULES'}} + 1); # PairSetCount - my $off = 0; - $off += length($out); - $off += 2 * ($#{$lookup->{'RULES'}} + 1); # there will be PairSetCount offsets here - my $pairsets = ''; - my (%cache); - foreach $r (@{$lookup->{'RULES'}}) # foreach PairSet table - { - # write offset to this PairSet at end of PairPosFormat1 table - if (defined $cache{"$r"}) - { $out .= pack('n', $cache{"$r"}); } - else - { - $out .= pack('n', $off); - $cache{"$r"} = $off; - - # generate PairSet itself (using $off as eventual offset within PairPos subtable) - my $pairset = pack('n', $#{$r} + 1); # PairValueCount - foreach $t (@$r) # foreach PairValueRecord - { - $pairset .= pack('n', $t->{'MATCH'}[0]); # SecondGlyph - MATCH has only one entry - $pairset .= - $self->out_value($t->{'ACTION'}[0], $vfmt, $ctables, $off + length($pairset) + $base); - $pairset .= - $self->out_value($t->{'ACTION'}[1], $vfmt2, $ctables, $off + length($pairset) + $base); - } - $off += length($pairset); - $pairsets .= $pairset; - } - } - $out .= $pairsets; - die "internal error: PairPos size not as calculated" if (length($out) != $off); - } else - { - $out = pack('n8', $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), - $vfmt, $vfmt2, - Font::TTF::Ttopen::ref_cache($lookup->{'CLASS'}, $ctables, 8 + $base), - Font::TTF::Ttopen::ref_cache($lookup->{'MATCH'}[0], $ctables, 10 + $base), - $lookup->{'CLASS'}{'max'} + 1, $lookup->{'MATCH'}[0]{'max'} + 1); - - for ($i = 0; $i <= $lookup->{'CLASS'}{'max'}; $i++) - { - for ($j = 0; $j <= $lookup->{'MATCH'}[0]{'max'}; $j++) - { - $out .= $self->out_value($lookup->{'RULES'}[$i][$j]{'ACTION'}[0], $vfmt, $ctables, length($out) + $base); - $out .= $self->out_value($lookup->{'RULES'}[$i][$j]{'ACTION'}[1], $vfmt2, $ctables, length($out) + $base); - } - } - } - } elsif ($type == 3 && $fmt == 1) - { - $out = pack('n3', $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), - $#{$lookup->{'RULES'}} + 1); - foreach $r (@{$lookup->{'RULES'}}) - { - $out .= pack('n2', Font::TTF::Ttopen::ref_cache($r->[0]{'ACTION'}[0], $ctables, length($out) + $base), - Font::TTF::Ttopen::ref_cache($r->[0]{'ACTION'}[1], $ctables, length($out) + 2 + $base)); - } - } elsif ($type == 4 || $type == 5 || $type == 6) - { - my ($loc_off, $loc_t, $ltables); - - $out = pack('n7', $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'MATCH'}[0], $ctables, 2 + $base), - Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 4 + $base), - $#{$lookup->{'RULES'}[0][0]{'ACTION'}} + 1, 12, ($#{$lookup->{'MARKS'}} + 4) << 2, - $#{$lookup->{'MARKS'}} + 1); - foreach $r (@{$lookup->{'MARKS'}}) - { $out .= pack('n2', $r->[0], Font::TTF::Ttopen::ref_cache($r->[1], $mtables, length($out) + 2)); } - push (@reftables, [$mtables, 12]); - - $loc_t = length($out); - substr($out, 10, 2) = pack('n', $loc_t); - $out .= pack('n', $#{$lookup->{'RULES'}} + 1); - if ($type == 5) - { - $loc1 = length($out); - $out .= pack('n*', (0) x ($#{$lookup->{'RULES'}} + 1)); - } - $ltables = {}; - for ($i = 0; $i <= $#{$lookup->{'RULES'}}; $i++) - { - if ($type == 5) - { - $ltables = {}; - $loc_t = length($out); - substr($out, $loc1 + ($i << 1), 2) = TTF_Pack('S', $loc_t - $loc1 + 2); - } - - $r = $lookup->{'RULES'}[$i]; - $out .= pack('n', $#{$r} + 1) if ($type == 5); - foreach $t (@$r) - { - foreach $s (@{$t->{'ACTION'}}) - { $out .= pack('n', Font::TTF::Ttopen::ref_cache($s, $ltables, length($out))); } - } - push (@reftables, [$ltables, $loc_t]) if ($type == 5); - } - push (@reftables, [$ltables, $loc_t]) unless ($type == 5); - $out = Font::TTF::Ttopen::out_final($fh, $out, \@reftables, 1); - } elsif ($type == 7 || $type == 8) - { $out = $self->out_context($lookup, $fh, $type - 2, $fmt, $ctables, $out, $num, $base); } -# push (@reftables, [$ctables, 0]); - $out; -} - - -=head2 $t->read_value($format, $base, $lookup, $fh) - -Reads a value record from the current location in the file, according to the -format given. - -=cut - -sub read_value -{ - my ($self, $fmt, $base, $lookup, $fh) = @_; - my ($flag) = 1; - my ($res) = {}; - my ($s, $i, $dat); - - $s = 0; - for ($i = 0; $i < 12; $i++) - { - $s++ if ($flag & $fmt); - $flag <<= 1; - } - - $fh->read($dat, $s << 1); - $flag = 1; $i = 0; - foreach $s (qw(XPlacement YPlacement XAdvance YAdvance)) - { - $res->{$s} = TTF_Unpack('s', substr($dat, $i++ << 1, 2)) if ($fmt & $flag); - $flag <<= 1; - } - - foreach $s (qw(XPlaDevice YPlaDevice XAdvDevice YAdvDevice)) - { - if ($fmt & $flag) - { $res->{$s} = $self->read_delta(TTF_Unpack('S', substr($i++ << 1, 2)), - $base, $lookup, $fh); } - $flag <<= 1; - } - - foreach $s (qw(XIdPlacement YIdPlacement XIdAdvance YIdAdvance)) - { - $res->{$s} = TTF_Unpack('S', substr($dat, $i++ << 1, 2)) if ($fmt & $flag); - $flag <<= 1; - } - $res; -} - - -=head2 $t->read_delta($offset, $base, $lookup, $fh) - -Reads a delta (device table) at the given offset if it hasn't already been read. -Store the offset and item in the lookup cache ($lookup->{' CACHE'}) - -=cut - -sub read_delta -{ - my ($self, $offset, $base, $lookup, $fh) = @_; - my ($loc) = $fh->tell(); - my ($res, $str); - - return undef unless $offset; - $str = sprintf("%X", $base + $offset); - return $lookup->{' CACHE'}{$str} if defined $lookup->{' CACHE'}{$str}; - $fh->seek($base + $offset, 0); - $res = Font::TTF::Delta->new->read($fh); - $fh->seek($loc, 0); - $lookup->{' CACHE'}{$str} = $res; - return $res; -} - - -=head2 $t->read_anchor($offset, $base, $lookup, $fh) - -Reads an Anchor table at the given offset if it hasn't already been read. - -=cut - -sub read_anchor -{ - my ($self, $offset, $base, $lookup, $fh) = @_; - my ($loc) = $fh->tell(); - my ($res, $str); - - return undef unless $offset; - $str = sprintf("%X", $base + $offset); - return $lookup->{' CACHE'}{$str} if defined $lookup->{' CACHE'}{$str}; - $fh->seek($base + $offset, 0); - $res = Font::TTF::Anchor->new->read($fh); - $fh->seek($loc, 0); - $lookup->{' CACHE'}{$str} = $res; - return $res; -} - - -=head2 $t->fmt_value - -Returns the value format for a given value record - -=cut - -sub fmt_value -{ - my ($self, $value) = @_; - my ($fmt) = 0; - my ($n); - - foreach $n (reverse qw(XPlacement YPlacement XAdvance YAdvance XPlaDevice YPlaDevice - XAdvDevice YAdvDevice XIdPlacement YIdPlacement XIdAdvance - YIdAdvance)) - { - $fmt <<= 1; - $fmt |= 1 if (defined $value->{$n} && (ref $value->{$n} || $value->{$n})); - } - $fmt; -} - - -=head2 $t->out_value - -Returns the output string for the outputting of the value for a given format. Also -updates the offset cache for any device tables referenced. - -=cut - -sub out_value -{ - my ($self, $value, $fmt, $tables, $offset) = @_; - my ($n, $flag, $out); - - $flag = 1; - foreach $n (qw(XPlacement YPlacement XAdvance YAdvance)) - { - $out .= pack('n', $value->{$n}) if ($flag & $fmt); - $flag <<= 1; - } - foreach $n (qw(XPlaDevice YPlaDevice XAdvDevice YAdvDevice)) - { - if ($flag & $fmt) - { - $out .= pack('n', Font::TTF::Ttopen::ref_cache( - $value->{$n}, $tables, $offset + length($out))); - } - $flag <<= 1; - } - foreach $n (qw(XIdPlacement YIdPlacement XIdAdvance YIdAdvance)) - { - $out .= pack('n', $value->{$n}) if ($flag & $fmt); - $flag <<= 1; - } - $out; -} - - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - -1; - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GSUB.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GSUB.pm deleted file mode 100644 index abf0f13..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GSUB.pm +++ /dev/null @@ -1,246 +0,0 @@ -package Font::TTF::GSUB; - -=head1 NAME - -Font::TTF::GSUB - Module support for the GSUB table in conjunction with TTOpen - -=head1 DESCRIPTION - -Handles the GSUB subtables in relation to Ttopen tables. Due to the variety of -different lookup types, the data structures are not all that straightforward, -although I have tried to make life easy for myself when using this! - -=head1 INSTANCE VARIABLES - -The structure of a GSUB table is the same as that given in L. -Here we give some of the semantics specific to GSUB lookups. - -=over 4 - -=item ACTION_TYPE - -This is a string taking one of 4 values indicating the nature of the information -in the ACTION array of the rule: - -=over 8 - -=item g - -The action contains a string of glyphs to replace the match string by - -=item l - -The action array contains a list of lookups and offsets to run, in order, on -the matched string - -=item a - -The action array is an unordered set of optional replacements for the matched -glyph. The application should make the selection somehow. - -=item o - -The action array is empty (in fact there is no rule array for this type of -rule) and the ADJUST value should be added to the glyph id to find the replacement -glyph id value - -=back - -=item MATCH_TYPE - -This indicates which type of information the various MATCH arrays (MATCH, PRE, -POST) hold in the rule: - -=over 8 - -=item g - -The array holds a string of glyph ids which should match exactly - -=item c - -The array holds a sequence of class definitions which each glyph should -correspondingly match to - -=item o - -The array holds offsets to coverage tables - -=back - -=back - -=head1 CORRESPONDANCE TO LAYOUT TYPES - -The following table gives the values for ACTION_TYPE and MATCH_TYPE for each -of the 11 different lookup types found in the GSUB table definition I have: - - 1.1 1.2 2 3 4 5.1 5.2 5.3 6.1 6.2 6.3 - ACTION_TYPE o g g a g l l l l l l - MATCH_TYPE g g c o g c o - -Hopefully, the rest of the uses of the variables should make sense from this -table. - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::Ttopen; - -@ISA = qw(Font::TTF::Ttopen); - -=head2 $t->read_sub($fh, $lookup, $index) - -Asked by the superclass to read in from the given file the indexth subtable from -lookup number lookup. The file is positioned ready for the read. - -=cut - -sub read_sub -{ - my ($self, $fh, $main_lookup, $sindex) = @_; - my ($type) = $main_lookup->{'TYPE'}; - my ($loc) = $fh->tell(); - my ($lookup) = $main_lookup->{'SUB'}[$sindex]; - my ($dat, $s, @subst, $t, $fmt, $cover, $count, $mcount, $scount, $i, $gid); - my (@srec); - - if ($type == 6) - { - $fh->read($dat, 4); - ($fmt, $cover) = TTF_Unpack('S2', $dat); - if ($fmt < 3) - { - $fh->read($dat, 2); - $count = TTF_Unpack('S', $dat); - } - } else - { - $fh->read($dat, 6); - ($fmt, $cover, $count) = TTF_Unpack("S3", $dat); - } - unless ($fmt == 3 && ($type == 5 || $type == 6)) - { $lookup->{'COVERAGE'} = $self->read_cover($cover, $loc, $lookup, $fh, 1); } - - $lookup->{'FORMAT'} = $fmt; - if ($type == 1 && $fmt == 1) - { - $count -= 65536 if ($count > 32767); - $lookup->{'ADJUST'} = $count; - $lookup->{'ACTION_TYPE'} = 'o'; - } elsif ($type == 1 && $fmt == 2) - { - $fh->read($dat, $count << 1); - @subst = TTF_Unpack('S*', $dat); - foreach $s (@subst) - { push(@{$lookup->{'RULES'}}, [{'ACTION' => [$s]}]); } - $lookup->{'ACTION_TYPE'} = 'g'; - } elsif ($type == 2 || $type == 3) - { - $fh->read($dat, $count << 1); # number of offsets - foreach $s (TTF_Unpack('S*', $dat)) - { - $fh->seek($loc + $s, 0); - $fh->read($dat, 2); - $t = TTF_Unpack('S', $dat); - $fh->read($dat, $t << 1); - push(@{$lookup->{'RULES'}}, [{'ACTION' => [TTF_Unpack('S*', $dat)]}]); - } - $lookup->{'ACTION_TYPE'} = ($type == 2 ? 'g' : 'a'); - } elsif ($type == 4) - { - $fh->read($dat, $count << 1); - foreach $s (TTF_Unpack('S*', $dat)) - { - @subst = (); - $fh->seek($loc + $s, 0); - $fh->read($dat, 2); - $t = TTF_Unpack('S', $dat); - $fh->read($dat, $t << 1); - foreach $t (TTF_Unpack('S*', $dat)) - { - $fh->seek($loc + $s + $t, 0); - $fh->read($dat, 4); - ($gid, $mcount) = TTF_Unpack('S2', $dat); - $fh->read($dat, ($mcount - 1) << 1); - push(@subst, {'ACTION' => [$gid], 'MATCH' => [TTF_Unpack('S*', $dat)]}); - } - push(@{$lookup->{'RULES'}}, [@subst]); - } - $lookup->{'ACTION_TYPE'} = 'g'; - $lookup->{'MATCH_TYPE'} = 'g'; - } elsif ($type == 5 || $type == 6) - { $self->read_context($lookup, $fh, $type, $fmt, $cover, $count, $loc); } - $lookup; -} - - -=head2 $t->extension - -Returns the table type number for the extension table - -=cut - -sub extension -{ return 7; } - - -=head2 $t->out_sub($fh, $lookup, $index) - -Passed the filehandle to output to, suitably positioned, the lookup and subtable -index, this function outputs the subtable to $fh at that point. - -=cut - -sub out_sub -{ - my ($self, $fh, $main_lookup, $index, $ctables, $base) = @_; - my ($type) = $main_lookup->{'TYPE'}; - my ($lookup) = $main_lookup->{'SUB'}[$index]; - my ($fmt) = $lookup->{'FORMAT'}; - my ($out, $r, $t, $i, $j, $offc, $offd, $numd); - my ($num) = $#{$lookup->{'RULES'}} + 1; - - if ($type == 1) - { - $out = pack("nn", $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base)); - if ($fmt == 1) - { $out .= pack("n", $lookup->{'ADJUST'}); } - else - { - $out .= pack("n", $num); - foreach $r (@{$lookup->{'RULES'}}) - { $out .= pack("n", $r->[0]{'ACTION'}[0]); } - } - } elsif ($type == 2 || $type == 3) - { - $out = pack("nnn", $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), - $num); - $out .= pack('n*', (0) x $num); - $offc = length($out); - for ($i = 0; $i < $num; $i++) - { - $out .= pack("n*", $#{$lookup->{'RULES'}[$i][0]{'ACTION'}} + 1, - @{$lookup->{'RULES'}[$i][0]{'ACTION'}}); - substr($out, ($i << 1) + 6, 2) = pack('n', $offc); - $offc = length($out); - } - } elsif ($type == 4 || $type == 5 || $type == 6) - { $out = $self->out_context($lookup, $fh, $type, $fmt, $ctables, $out, $num, $base); } -# Font::TTF::Ttopen::out_final($fh, $out, [[$ctables, 0]]); - $out; -} - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - -1; - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Glyf.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Glyf.pm deleted file mode 100644 index e0268f3..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Glyf.pm +++ /dev/null @@ -1,158 +0,0 @@ -package Font::TTF::Glyf; - -=head1 NAME - -Font::TTF::Glyf - The Glyf data table - -=head1 DESCRIPTION - -This is a stub table. The real data is held in the loca table. If you want to get a glyf -look it up in the loca table as C<$f->{'loca'}{'glyphs'}[$num]>. It won't be here! - -The difference between reading this table as opposed to the loca table is that -reading this table will cause updated glyphs to be written out rather than just -copying the glyph information from the input file. This causes font writing to be -slower. So read the glyf as opposed to the loca table if you want to change glyf -data. Read the loca table only if you are just wanting to read the glyf information. - -This class is used when writing the glyphs though. - -=head1 METHODS - -=cut - - -use strict; -use vars qw(@ISA); -@ISA = qw(Font::TTF::Table); - -=head2 $t->read - -Reads the C table instead! - -=cut - -sub read -{ - my ($self) = @_; - - $self->{' PARENT'}{'loca'}->read; - $self->{' read'} = 1; - $self; -} - - -=head2 $t->out($fh) - -Writes out all the glyphs in the parent's location table, calculating a new -output location for each one. - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($i, $loca, $offset, $numGlyphs); - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $loca = $self->{' PARENT'}{'loca'}{'glyphs'}; - $numGlyphs = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - - $offset = 0; - for ($i = 0; $i < $numGlyphs; $i++) - { - next unless defined $loca->[$i]; - $loca->[$i]->update; - $loca->[$i]{' OUTLOC'} = $offset; - $loca->[$i]->out($fh); - $offset += $loca->[$i]{' OUTLEN'}; - } - $self->{' PARENT'}{'head'}{'indexToLocFormat'} = ($offset >= 0x20000); - $self; -} - - -=head2 $t->out_xml($context, $depth) - -Outputs all the glyphs in the glyph table just where they are supposed to be output! - -=cut - -sub out_xml -{ - my ($self, $context, $depth) = @_; - my ($fh) = $context->{'fh'}; - my ($loca, $i, $numGlyphs); - - $loca = $self->{' PARENT'}{'loca'}{'glyphs'}; - $numGlyphs = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - - for ($i = 0; $i < $numGlyphs; $i++) - { - $context->{'gid'} = $i; - $loca->[$i]->out_xml($context, $depth) if (defined $loca->[$i]); - } - - $self; -} - - -=head2 $t->XML_start($context, $tag, %attrs) - -Pass control to glyphs as they occur - -=cut - -sub XML_start -{ - my ($self) = shift; - my ($context, $tag, %attrs) = @_; - - if ($tag eq 'glyph') - { - $context->{'tree'}[-1] = Font::TTF::Glyph->new(read => 2, PARENT => $self->{' PARENT'}); - $context->{'receiver'} = $context->{'tree'}[-1]; - } -} - - -=head2 $t->XML_end($context, $tag, %attrs) - -Collect up glyphs and put them into the loca table - -=cut - -sub XML_end -{ - my ($self) = shift; - my ($context, $tag, %attrs) = @_; - - if ($tag eq 'glyph') - { - unless (defined $context->{'glyphs'}) - { - if (defined $self->{' PARENT'}{'loca'}) - { $context->{'glyphs'} = $self->{' PARENT'}{'loca'}{'glyphs'}; } - else - { $context->{'glyphs'} = []; } - } - $context->{'glyphs'}[$attrs{'gid'}] = $context->{'tree'}[-1]; - return $context; - } else - { return $self->SUPER::XML_end(@_); } -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Glyph.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Glyph.pm deleted file mode 100644 index 28233cf..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Glyph.pm +++ /dev/null @@ -1,847 +0,0 @@ -package Font::TTF::Glyph; - -=head1 NAME - -Font::TTF::Glyph - Holds a single glyph's information - -=head1 DESCRIPTION - -This is a single glyph description as held in a TT font. On creation only its -header is read. Thus you can get the bounding box of each glyph without having -to read all the other information. - -=head1 INSTANCE VARIABLES - -In addition to the named variables in a glyph header (C etc.), there are -also all capital instance variables for holding working information, mostly -from the location table. - -The standard attributes each glyph has are: - - numberOfContours - xMin - yMin - xMax - yMax - -There are also other, derived, instance variables for each glyph which are read -when the whole glyph is read (via C): - -=over 4 - -=item instLen - -Number of bytes in the hinting instructions (Warning this variable is deprecated, -use C{'hints'})> instead). - -=item hints - -The string containing the hinting code for the glyph - -=back - -In addition there are other attribute like instance variables for simple glyphs: - -=over 4 - -For each contour there is: - -=over 4 - -=item endPoints - -An array of endpoints for each contour in the glyph. There are -C contours in a glyph. The number of points in a glyph is -equal to the highest endpoint of a contour. - -=back - -There are also a number of arrays indexed by point number - -=over 4 - -=item flags - -The flags associated with reading this point. The flags for a point are -recalculated for a point when it is Cd. Thus the flags are not very -useful. The only important bit is bit 0 which indicates whether the point is -an 'on' curve point, or an 'off' curve point. - -=item x - -The absolute x co-ordinate of the point. - -=item y - -The absolute y co-ordinate of the point - -=back - -=back - -For composite glyphs there are other variables - -=over 4 - -=item metric - -This holds the component number (not its glyph number) of the component from -which the metrics for this glyph should be taken. - -=item comps - -This is an array of hashes for each component. Each hash has a number of -elements: - -=over 4 - -=item glyph - -The glyph number of the glyph which comprises this component of the composite. -NOTE: In some badly generated fonts, C may contain a numerical value -but that glyph might not actually exist in the font file. This could -occur in any glyph, but is particularly likely for glyphs that have -no strokes, such as SPACE, U+00A0 NO-BREAK SPACE, or -U+200B ZERO WIDTH SPACE. - -=item args - -An array of two arguments which may be an x, y co-ordinate or two attachment -points (one on the base glyph the other on the component). See flags for details. - -=item flag - -The flag for this component - -=item scale - -A 4 number array for component scaling. This allows stretching, rotating, etc. -Note that scaling applies to placement co-ordinates (rather than attachment points) -before locating rather than after. - -=back - -=item numPoints - -This is a generated value which contains the number of components read in for this -compound glyph. - -=back - -The private instance variables are: - -=over 4 - -=item INFILE (P) - -The input file form which to read any information - -=item LOC (P) - -Location relative to the start of the glyf table in the read file - -=item BASE (P) - -The location of the glyf table in the read file - -=item LEN (P) - -This is the number of bytes required by the glyph. It should be kept up to date -by calling the C method whenever any of the glyph content changes. - -=item OUTLOC (P) - -Location relative to the start of the glyf table. This variable is only active -whilst the output process is going on. It is used to inform the location table -where the glyph's location is, since the glyf table is output before the loca -table due to alphabetical ordering. - -=item OUTLEN (P) - -This indicates the length of the glyph data when it is output. This more -accurately reflects the internal memory form than the C variable which -only reflects the read file length. The C variable is only set after -calling C or C. - -=back - -=head2 Editing - -If you want to edit a glyph in some way, then you should read_dat the glyph, then -make your changes and then update the glyph or set the $g->{' isdirty'} variable. -It is the application's duty to ensure that the following instance variables are -correct, from which update will calculate the rest, including the bounding box -information. - - numPoints - numberOfContours - endPoints - x, y, flags (only flags bit 0) - instLen - hints - -For components, the numPoints, x, y, endPoints & flags are not required but -the following information is required for each component. - - flag (bits 2, 10, 11, 12) - glyph - args - scale - metric (glyph instance variable) - - -=head1 METHODS - -=cut - -use strict; -use vars qw(%fields @field_info); -use Font::TTF::Utils; -use Font::TTF::Table; - -@field_info = ( - 'numberOfContours' => 's', - 'xMin' => 's', - 'yMin' => 's', - 'xMax' => 's', - 'yMax' => 's'); - -sub init -{ - my ($k, $v, $c, $i); - for ($i = 0; $i < $#field_info; $i += 2) - { - ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); - next unless defined $k && $k ne ""; - $fields{$k} = $v; - } -} - - -=head1 Font::TTF::Glyph->new(%parms) - -Creates a new glyph setting various instance variables - -=cut - -sub new -{ - my ($class, %parms) = @_; - my ($self) = {}; - my ($p); - - bless $self, $class; - foreach $p (keys %parms) - { $self->{" $p"} = $parms{$p}; } - init unless defined $fields{'xMin'}; - $self; -} - - -=head2 $g->read - -Reads the header component of the glyph (bounding box, etc.) and also the -glyph content, but into a data field rather than breaking it down into -its constituent structures. Use read_dat for this. - -=cut - -sub read -{ - my ($self) = @_; - my ($fh) = $self->{' INFILE'}; - my ($dat); - - return $self if $self->{' read'}; - $self->{' read'} = 1; - $fh->seek($self->{' LOC'} + $self->{' BASE'}, 0); - $fh->read($self->{' DAT'}, $self->{' LEN'}); - TTF_Read_Fields($self, $self->{' DAT'}, \%fields); - $self; -} - - -=head2 $g->read_dat - -Reads the contents of the glyph (components and curves, etc.) from the memory -store C into structures within the object. Then, to indicate where the -master form of the data is, it deletes the C instance variable. - -=cut - -sub read_dat -{ - my ($self) = @_; - my ($dat, $num, $max, $i, $flag, $len, $val, $val1, $fp); - - return $self if (defined $self->{' read'} && $self->{' read'} > 1); - $self->read unless $self->{' read'}; - $dat = $self->{' DAT'}; - $fp = 10; - $num = $self->{'numberOfContours'}; - if ($num > 0) - { - $self->{'endPoints'} = [unpack("n*", substr($dat, $fp, $num << 1))]; - $fp += $num << 1; - $max = 0; - foreach (@{$self->{'endPoints'}}) - { $max = $_ if $_ > $max; } -# print STDERR join(",", unpack('C*', $self->{" DAT"})); -# printf STDERR ("(%d,%d in %d=%d @ %d)", scalar @{$self->{'endPoints'}}, $max, length($dat), $self->{' LEN'}, $fp); - $max++ if (@{$self->{'endPoints'}}); - $self->{'numPoints'} = $max; - $self->{'instLen'} = unpack("n", substr($dat, $fp)); - $self->{'hints'} = substr($dat, $fp + 2, $self->{'instLen'}); - $fp += 2 + $self->{'instLen'}; -# read the flags array - for ($i = 0; $i < $max; $i++) - { - $flag = unpack("C", substr($dat, $fp++)); - $self->{'flags'}[$i] = $flag; - if ($flag & 8) - { - $len = unpack("C", substr($dat, $fp++)); - while ($len-- > 0) - { - $i++; - $self->{'flags'}[$i] = $flag; - } - } - } -#read the x array - for ($i = 0; $i < $max; $i++) - { - $flag = $self->{'flags'}[$i]; - if ($flag & 2) - { - $val = unpack("C", substr($dat, $fp++)); - $val = -$val unless ($flag & 16); - } elsif ($flag & 16) - { $val = 0; } - else - { - $val = TTF_Unpack("s", substr($dat, $fp)); - $fp += 2; - } - $self->{'x'}[$i] = $i == 0 ? $val : $self->{'x'}[$i - 1] + $val; - } -#read the y array - for ($i = 0; $i < $max; $i++) - { - $flag = $self->{'flags'}[$i]; - if ($flag & 4) - { - $val = unpack("C", substr($dat, $fp++)); - $val = -$val unless ($flag & 32); - } elsif ($flag & 32) - { $val = 0; } - else - { - $val = TTF_Unpack("s", substr($dat, $fp)); - $fp += 2; - } - $self->{'y'}[$i] = $i == 0 ? $val : $self->{'y'}[$i - 1] + $val; - } - } - -# compound glyph - elsif ($num < 0) - { - $flag = 1 << 5; # cheat to get the loop going - for ($i = 0; $flag & 32; $i++) - { - ($flag, $self->{'comps'}[$i]{'glyph'}) = unpack("n2", substr($dat, $fp)); - $fp += 4; - $self->{'comps'}[$i]{'flag'} = $flag; - if ($flag & 1) # ARGS1_AND_2_ARE_WORDS - { - $self->{'comps'}[$i]{'args'} = [TTF_Unpack("s2", substr($dat, $fp))]; - $fp += 4; - } else - { - $self->{'comps'}[$i]{'args'} = [unpack("c2", substr($dat, $fp))]; - $fp += 2; - } - - if ($flag & 8) - { - $val = TTF_Unpack("F", substr($dat, $fp)); - $fp += 2; - $self->{'comps'}[$i]{'scale'} = [$val, 0, 0, $val]; - } elsif ($flag & 64) - { - ($val, $val1) = TTF_Unpack("F2", substr($dat, $fp)); - $fp += 4; - $self->{'comps'}[$i]{'scale'} = [$val, 0, 0, $val1]; - } elsif ($flag & 128) - { - $self->{'comps'}[$i]{'scale'} = [TTF_Unpack("F4", substr($dat, $fp))]; - $fp += 8; - } - $self->{'metric'} = $i if ($flag & 512); - } - $self->{'numPoints'} = $i; - if ($flag & 256) # HAVE_INSTRUCTIONS - { - $self->{'instLen'} = unpack("n", substr($dat, $fp)); - $self->{'hints'} = substr($dat, $fp + 2, $self->{'instLen'}); - $fp += 2 + $self->{'instLen'}; - } - } - return undef if ($fp > length($dat)); - $self->{' read'} = 2; - $self; -} - - -=head2 $g->out($fh) - -Writes the glyph data to outfile - -=cut - -sub out -{ - my ($self, $fh) = @_; - - $self->read unless $self->{' read'}; - $self->update if $self->{' isDirty'}; - $fh->print($self->{' DAT'}); - $self->{' OUTLEN'} = length($self->{' DAT'}); - $self; -} - - -=head2 $g->out_xml($context, $depth) - -Outputs an XML description of the glyph - -=cut - -sub out_xml -{ - my ($self, $context, $depth) = @_; - my ($addr) = ($self =~ m/\((.+)\)$/o); - my ($k, $ndepth); - - if ($context->{'addresses'}{$addr}) - { - $context->{'fh'}->printf("%s\n", $depth, $context->{'gid'}, $addr); - return $self; - } - else - { - $context->{'fh'}->printf("%s\n", $depth, $context->{'gid'}, $addr); - } - - $ndepth = $depth . $context->{'indent'}; - $self->read_dat; - foreach $k (sort grep {$_ !~ m/^\s/o} keys %{$self}) - { - $self->XML_element($context, $ndepth, $k, $self->{$k}); - } - $context->{'fh'}->print("$depth\n"); - delete $context->{'done_points'}; - $self; -} - - -sub XML_element -{ - my ($self, $context, $depth, $key, $val) = @_; - my ($fh) = $context->{'fh'}; - my ($dind) = $depth . $context->{'indent'}; - my ($i); - - if ($self->{'numberOfContours'} >= 0 && ($key eq 'x' || $key eq 'y' || $key eq 'flags')) - { - return $self if ($context->{'done_points'}); - $context->{'done_points'} = 1; - - $fh->print("$depth\n"); - for ($i = 0; $i <= $#{$self->{'flags'}}; $i++) - { $fh->printf("%s\n", $dind, - $self->{'x'}[$i], $self->{'y'}[$i], $self->{'flags'}[$i]); } - $fh->print("$depth\n"); - } - elsif ($key eq 'hints') - { - my ($dat); - $fh->print("$depth\n"); -# Font::TTF::Utils::XML_hexdump($context, $depth . $context->{'indent'}, $self->{'hints'}); - $dat = Font::TTF::Utils::XML_binhint($self->{'hints'}) || ""; - $dat =~ s/\n(?!$)/\n$depth$context->{'indent'}/mg; - $fh->print("$depth$context->{'indent'}$dat"); - $fh->print("$depth\n"); - } - else - { return Font::TTF::Table::XML_element(@_); } - - $self; -} - - -=head2 $g->update - -Generates a C<$self->{'DAT'}> from the internal structures, if the data has -been read into structures in the first place. If you are building a glyph -from scratch you will need to set the instance variable C<' read'> to 2 (or -something > 1) for the update to work. - -=cut - -sub update -{ - my ($self) = @_; - my ($dat, $loc, $len, $flag, $x, $y, $i, $comp, $num); - - return $self unless (defined $self->{' read'} && $self->{' read'} > 1); - $self->update_bbox; - $self->{' DAT'} = TTF_Out_Fields($self, \%fields, 10); - $num = $self->{'numberOfContours'}; - if ($num > 0) - { - $self->{' DAT'} .= pack("n*", @{$self->{'endPoints'}}); - $len = $self->{'instLen'}; - $self->{' DAT'} .= pack("n", $len); - $self->{' DAT'} .= pack("a" . $len, substr($self->{'hints'}, 0, $len)) if ($len > 0); - for ($i = 0; $i < $self->{'numPoints'}; $i++) - { - $flag = $self->{'flags'}[$i] & 1; - if ($i == 0) - { - $x = $self->{'x'}[$i]; - $y = $self->{'y'}[$i]; - } else - { - $x = $self->{'x'}[$i] - $self->{'x'}[$i - 1]; - $y = $self->{'y'}[$i] - $self->{'y'}[$i - 1]; - } - $flag |= 16 if ($x == 0); - $flag |= 32 if ($y == 0); - if (($flag & 16) == 0 && $x < 256 && $x > -256) - { - $flag |= 2; - $flag |= 16 if ($x >= 0); - } - if (($flag & 32) == 0 && $y < 256 && $y > -256) - { - $flag |= 4; - $flag |= 32 if ($y >= 0); - } - $self->{' DAT'} .= pack("C", $flag); # sorry no repeats - $self->{'flags'}[$i] = $flag; - } - for ($i = 0; $i < $self->{'numPoints'}; $i++) - { - $flag = $self->{'flags'}[$i]; - $x = $self->{'x'}[$i] - (($i == 0) ? 0 : $self->{'x'}[$i - 1]); - if (($flag & 18) == 0) - { $self->{' DAT'} .= TTF_Pack("s", $x); } - elsif (($flag & 18) == 18) - { $self->{' DAT'} .= pack("C", $x); } - elsif (($flag & 18) == 2) - { $self->{' DAT'} .= pack("C", -$x); } - } - for ($i = 0; $i < $self->{'numPoints'}; $i++) - { - $flag = $self->{'flags'}[$i]; - $y = $self->{'y'}[$i] - (($i == 0) ? 0 : $self->{'y'}[$i - 1]); - if (($flag & 36) == 0) - { $self->{' DAT'} .= TTF_Pack("s", $y); } - elsif (($flag & 36) == 36) - { $self->{' DAT'} .= pack("C", $y); } - elsif (($flag & 36) == 4) - { $self->{' DAT'} .= pack("C", -$y); } - } - } - - elsif ($num < 0) - { - for ($i = 0; $i <= $#{$self->{'comps'}}; $i++) - { - $comp = $self->{'comps'}[$i]; - $flag = $comp->{'flag'} & 7158; # bits 2,10,11,12 - $flag |= 1 unless ($comp->{'args'}[0] > -129 && $comp->{'args'}[0] < 128 - && $comp->{'args'}[1] > -129 && $comp->{'args'}[1] < 128); - if (defined $comp->{'scale'}) - { - if ($comp->{'scale'}[1] == 0 && $comp->{'scale'}[2] == 0) - { - if ($comp->{'scale'}[0] == $comp->{'scale'}[3]) - { $flag |= 8 unless ($comp->{'scale'}[0] == 0 - || $comp->{'scale'}[0] == 1); } - else - { $flag |= 64; } - } else - { $flag |= 128; } - } - - $flag |= 512 if (defined $self->{'metric'} && $self->{'metric'} == $i); - if ($i == $#{$self->{'comps'}}) - { $flag |= 256 if (defined $self->{'instLen'} && $self->{'instLen'} > 0); } - else - { $flag |= 32; } - - $self->{' DAT'} .= pack("n", $flag); - $self->{' DAT'} .= pack("n", $comp->{'glyph'}); - $comp->{'flag'} = $flag; - - if ($flag & 1) - { $self->{' DAT'} .= TTF_Pack("s2", @{$comp->{'args'}}); } - else - { $self->{' DAT'} .= pack("CC", @{$comp->{'args'}}); } - - if ($flag & 8) - { $self->{' DAT'} .= TTF_Pack("F", $comp->{'scale'}[0]); } - elsif ($flag & 64) - { $self->{' DAT'} .= TTF_Pack("F2", $comp->{'scale'}[0], $comp->{'scale'}[3]); } - elsif ($flag & 128) - { $self->{' DAT'} .= TTF_Pack("F4", @{$comp->{'scale'}}); } - } - if (defined $self->{'instLen'} && $self->{'instLen'} > 0) - { - $len = $self->{'instLen'}; - $self->{' DAT'} .= pack("n", $len); - $self->{' DAT'} .= pack("a" . $len, substr($self->{'hints'}, 0, $len)); - } - } - my ($olen) = length($self->{' DAT'}); - $self->{' DAT'} .= ("\000") x (4 - ($olen & 3)) if ($olen & 3); - $self->{' OUTLEN'} = length($self->{' DAT'}); - $self->{' read'} = 2; # changed from 1 to 2 so we don't read_dat() again -# we leave numPoints and instLen since maxp stats use this - $self; -} - - -=head2 $g->update_bbox - -Updates the bounding box for this glyph according to the points in the glyph - -=cut - -sub update_bbox -{ - my ($self) = @_; - my ($num, $maxx, $minx, $maxy, $miny, $i, $comp, $x, $y, $compg); - - return $self unless $self->{' read'} > 1; # only if read_dat done - $miny = $minx = 65537; $maxx = $maxy = -65537; - $num = $self->{'numberOfContours'}; - if ($num > 0) - { - for ($i = 0; $i < $self->{'numPoints'}; $i++) - { - ($x, $y) = ($self->{'x'}[$i], $self->{'y'}[$i]); - - $maxx = $x if ($x > $maxx); - $minx = $x if ($x < $minx); - $maxy = $y if ($y > $maxy); - $miny = $y if ($y < $miny); - } - } - - elsif ($num < 0) - { - foreach $comp (@{$self->{'comps'}}) - { - my ($gnx, $gny, $gxx, $gxy); - my ($sxx, $sxy, $syx, $syy); - - my $otherg = $self->{' PARENT'}{'loca'}{'glyphs'}[$comp->{'glyph'}]; - # work around bad fonts: see documentation for 'comps' above - next unless (defined $otherg); - $compg = $otherg->read->update_bbox; - ($gnx, $gny, $gxx, $gxy) = @{$compg}{'xMin', 'yMin', 'xMax', 'yMax'}; - if (defined $comp->{'scale'}) - { - ($sxx, $sxy, $syx, $syy) = @{$comp->{'scale'}}; - ($gnx, $gny, $gxx, $gxy) = ($gnx*$sxx+$gny*$syx + $comp->{'args'}[0], - $gnx*$sxy+$gny*$syy + $comp->{'args'}[1], - $gxx*$sxx+$gxy*$syx + $comp->{'args'}[0], - $gxx*$sxy+$gxy*$syy + $comp->{'args'}[1]); - } elsif ($comp->{'args'}[0] || $comp->{'args'}[1]) - { - $gnx += $comp->{'args'}[0]; - $gny += $comp->{'args'}[1]; - $gxx += $comp->{'args'}[0]; - $gxy += $comp->{'args'}[1]; - } - ($gnx, $gxx) = ($gxx, $gnx) if $gnx > $gxx; - ($gny, $gxy) = ($gxy, $gny) if $gny > $gxy; - $maxx = $gxx if $gxx > $maxx; - $minx = $gnx if $gnx < $minx; - $maxy = $gxy if $gxy > $maxy; - $miny = $gny if $gny < $miny; - } - } - $self->{'xMax'} = $maxx; - $self->{'xMin'} = $minx; - $self->{'yMax'} = $maxy; - $self->{'yMin'} = $miny; - $self; -} - - -=head2 $g->maxInfo - -Returns lots of information about a glyph so that the C table can update -itself. Returns array containing contributions of this glyph to maxPoints, maxContours, -maxCompositePoints, maxCompositeContours, maxSizeOfInstructions, maxComponentElements, -and maxComponentDepth. - -=cut - -sub maxInfo -{ - my ($self) = @_; - my (@res, $i, @n); - - $self->read_dat; # make sure we've read some data - $res[4] = length($self->{'hints'}) if defined $self->{'hints'}; - $res[6] = 1; - if ($self->{'numberOfContours'} > 0) - { - $res[0] = $self->{'numPoints'}; - $res[1] = $self->{'numberOfContours'}; - } elsif ($self->{'numberOfContours'} < 0) - { - for ($i = 0; $i <= $#{$self->{'comps'}}; $i++) - { - my $otherg = - $self->{' PARENT'}{'loca'}{'glyphs'} - [$self->{'comps'}[$i]{'glyph'}]; - - # work around bad fonts: see documentation for 'comps' above - next unless (defined $otherg ); - - @n = $otherg->maxInfo; - - $res[2] += $n[2] == 0 ? $n[0] : $n[2]; - $res[3] += $n[3] == 0 ? $n[1] : $n[3]; - $res[5]++; - $res[6] = $n[6] + 1 if ($n[6] >= $res[6]); - } - } - @res; -} - -=head2 $g->empty - -Empties the glyph of all information to the level of not having been read. -Useful for saving memory in apps with many glyphs being read - -=cut - -sub empty -{ - my ($self) = @_; - my (%keep) = map {(" $_" => 1)} ('LOC', 'OUTLOC', 'PARENT', 'INFILE', 'BASE', - 'OUTLEN', 'LEN'); - map {delete $self->{$_} unless $keep{$_}} keys %$self; - - $self; -} - - -=head2 $g->get_points - -This method creates point information for a compound glyph. The information is -stored in the same place as if the glyph was not a compound, but since -numberOfContours is negative, the glyph is still marked as being a compound - -=cut - -sub get_points -{ - my ($self) = @_; - my ($comp, $compg, $nump, $e, $i); - - $self->read_dat; - return undef unless ($self->{'numberOfContours'} < 0); - - foreach $comp (@{$self->{'comps'}}) - { - $compg = $self->{' PARENT'}{'loca'}{'glyphs'}[$comp->{'glyph'}]; - # work around bad fonts: see documentation for 'comps' above - next unless (defined $compg ); - $compg->get_points; - - for ($i = 0; $i < $compg->{'numPoints'}; $i++) - { - my ($x, $y) = ($compg->{'x'}[$i], $compg->{'y'}[$i]); - if (defined $comp->{'scale'}) - { - ($x, $y) = ($x * $comp->{'scale'}[0] + $y * $comp->{'scale'}[2], - $x * $comp->{'scale'}[1] + $y * $comp->{'scale'}[3]); - } - if (defined $comp->{'args'}) - { ($x, $y) = ($x + $comp->{'args'}[0], $y + $comp->{'args'}[1]); } - push (@{$self->{'x'}}, $x); - push (@{$self->{'y'}}, $y); - push (@{$self->{'flags'}}, $compg->{'flags'}[$i]); - } - foreach $e (@{$compg->{'endPoints'}}) - { push (@{$self->{'endPoints'}}, $e + $nump); } - $nump += $compg->{'numPoints'}; - } - $self->{'numPoints'} = $nump; - $self; -} - - -=head2 $g->get_refs - -Returns an array of all the glyph ids that are used to make up this glyph. That -is all the compounds and their references and so on. If this glyph is not a -compound, then returns an empty array. - -Please note the warning about bad fonts that reference nonexistant glyphs -under INSTANCE VARIABLES above. This function will not attempt to -filter out nonexistant glyph numbers. - -=cut - -sub get_refs -{ - my ($self) = @_; - my (@res, $g); - - $self->read_dat; - return unless ($self->{'numberOfContours'} < 0); - foreach $g (@{$self->{'comps'}}) - { - push (@res, $g->{'glyph'}); - my $otherg = $self->{' PARENT'}{'loca'}{'glyphs'}[$g->{'glyph'}]; - # work around bad fonts: see documentation for 'comps' above - next unless (defined $otherg); - my @list = $otherg->get_refs; - push(@res, @list); - } - return @res; -} - -1; - -=head1 BUGS - -=over 4 - -=item * - -The instance variables used here are somewhat clunky and inconsistent with -the other tables. - -=item * - -C doesn't re-calculate the bounding box or C. - -=back - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GrFeat.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GrFeat.pm deleted file mode 100644 index 2732a69..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GrFeat.pm +++ /dev/null @@ -1,249 +0,0 @@ -package Font::TTF::GrFeat; - -=head1 NAME - -Font::TTF::GrFeat - Graphite Font Features - -=head1 DESCRIPTION - -=head1 INSTANCE VARIABLES - -=over 4 - -=item version - -=item features - -An array of hashes of the following form - -=over 8 - -=item feature - -feature id number - -=item name - -name index in name table - -=item exclusive - -exclusive flag - -=item default - -the default setting number - -=item settings - -hash of setting number against name string index - -=back - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); - -use Font::TTF::Utils; - -require Font::TTF::Table; - -@ISA = qw(Font::TTF::Table); - -=head2 $t->read - -Reads the features from the TTF file into memory - -=cut - -sub read -{ - my ($self) = @_; - my ($featureCount, $features); - - return $self if $self->{' read'}; - $self->SUPER::read_dat or return $self; - - ($self->{'version'}, $featureCount) = TTF_Unpack("vS", $self->{' dat'}); - - $features = []; - foreach (1 .. $featureCount) { - my ($feature, $nSettings, $settingTable, $featureFlags, $nameIndex, $reserved); - if ($self->{'version'} == 1) - { - ($feature, $nSettings, $settingTable, $featureFlags, $nameIndex) - = TTF_Unpack("SSLSS", substr($self->{' dat'}, $_ * 12, 12)); - #The version 1 Feat table ends with a feature (id 1) named NoName - #with zero settings but with an offset to the last entry in the setting - #array. This last setting has id 0 and an invalid name id. This last - #feature is changed to have one setting. - if ($_ == $featureCount && $nSettings == 0) {$nSettings = 1;} - } - else #version == 2 - {($feature, $nSettings, $reserved, $settingTable, $featureFlags, $nameIndex) - = TTF_Unpack("LSSLSS", substr($self->{' dat'}, 12 + ($_ - 1) * 16, 16))}; - my $feature = - { - 'feature' => $feature, - 'name' => $nameIndex, - }; - - #interpret the featureFlags & store settings - $feature->{'exclusive'} = (($featureFlags & 0x8000) != 0); - - my @settings = TTF_Unpack("S*", substr($self->{' dat'}, $settingTable, $nSettings * 4)); - if ($featureFlags & 0x4000) - {$feature->{'default'} = $featureFlags & 0x00FF;} - else - {$feature->{'default'} = @settings[0];} - $feature->{'settings'} = {@settings}; - - push(@$features, $feature); - } - - $self->{'features'} = $features; - - delete $self->{' dat'}; # no longer needed, and may become obsolete - $self->{' read'} = 1; - $self; -} - -=head2 $t->out($fh) - -Writes the features to a TTF file - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($features, $numFeatures, $settings, $featureFlags, $featuresData, $settingsData); - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $features = $self->{'features'}; - $numFeatures = @$features; - $featuresData, $settingsData = ('', ''); - - foreach (@$features) { - $settings = $_->{'settings'}; - $featureFlags = ($_->{'exclusive'} ? 0x8000 : 0x0000); - -# output default setting first instead of using the featureFlags (as done below) -# $featureFlags = ($_->{'exclusive'} ? 0x8000 : 0x0000) | -# ($_->{'default'} != 0 ? 0x4000 | ($_->{'default'} & 0x00FF) -# : 0x0000); - if ($self->{'version'} == 1) - { - $featuresData .= TTF_Pack("SSLSS", - $_->{'feature'}, - scalar keys %$settings, - 12 + 12 * $numFeatures + length $settingsData, - $featureFlags, - $_->{'name'}); - } - else #version == 2 - { - $featuresData .= TTF_Pack("LSSLSS", - $_->{'feature'}, - scalar keys %$settings, - 0, - 12 + 16 * $numFeatures + length $settingsData, - $featureFlags, - $_->{'name'}); - } - - #output default setting first - #the settings may not be in their original order - my $defaultSetting = $_->{'default'}; - $settingsData .= TTF_Pack("SS", $defaultSetting, $settings->{$defaultSetting}); - foreach (sort {$a <=> $b} keys %$settings) { - if ($_ == $defaultSetting) {next;} #skip default setting - $settingsData .= TTF_Pack("SS", $_, $settings->{$_}); - } - } - - $fh->print(TTF_Pack("vSSL", $self->{'version'}, $numFeatures, 0, 0)); - $fh->print($featuresData); - $fh->print($settingsData); - - $self; -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - my ($names, $features, $settings); - - $self->read; - - $names = $self->{' PARENT'}->{'name'}; - $names->read; - - $fh = 'STDOUT' unless defined $fh; - - $features = $self->{'features'}; - foreach (@$features) { - $fh->printf("Feature %d, %s, default: %d name %d # '%s'\n", - $_->{'feature'}, - ($_->{'exclusive'} ? "exclusive" : "additive"), - $_->{'default'}, - $_->{'name'}, - $names->{'strings'}[$_->{'name'}][3][1]{1033}); - $settings = $_->{'settings'}; - foreach (sort { $a <=> $b } keys %$settings) { - $fh->printf("\tSetting %d, name %d # '%s'\n", - $_, $settings->{$_}, $names->{'strings'}[$settings->{$_}][3][1]{1033}); - } - } - - $self; -} - -sub settingName -{ - my ($self, $feature, $setting) = @_; - - $self->read; - - my $names = $self->{' PARENT'}->{'name'}; - $names->read; - - my $features = $self->{'features'}; - my ($featureEntry) = grep { $_->{'feature'} == $feature } @$features; - my $featureName = $names->{'strings'}[$featureEntry->{'name'}][3][1]{1033}; - my $settingName = $featureEntry->{'exclusive'} - ? $names->{'strings'}[$featureEntry->{'settings'}->{$setting}][3][1]{1033} - : $names->{'strings'}[$featureEntry->{'settings'}->{$setting & ~1}][3][1]{1033} - . (($setting & 1) == 0 ? " On" : " Off"); - - ($featureName, $settingName); -} - -1; - -=head1 BUGS - -The version 1 Feat table ends with a feature (id 1) named NoName -with zero settings but with an offset to the last entry in the setting -array. This last setting has id 0 and an invalid name id. This last -feature is changed to have one setting. - -=head1 AUTHOR - -Alan Ward (derived from Jonathan Kew's Feat.pm). -See L for copyright and licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hdmx.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hdmx.pm deleted file mode 100644 index d1e47cb..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hdmx.pm +++ /dev/null @@ -1,149 +0,0 @@ -package Font::TTF::Hdmx; - -=head1 NAME - -Font::TTF::Hdmx - Horizontal device metrics - -=head1 DESCRIPTION - -The table consists of an hash of device metric tables indexed by the ppem for -that subtable. Each subtable consists of an array of advance widths in pixels -for each glyph at that ppem (horizontally). - -=head1 INSTANCE VARIABLES - -Individual metrics are accessed using the following referencing: - - $f->{'hdmx'}{$ppem}[$glyph_num] - -In addition there is one instance variable: - -=over 4 - -=item Num - -Number of device tables. - -=back - -=head2 METHODS - -=cut - -use strict; -use vars qw(@ISA); - -@ISA = qw(Font::TTF::Table); - - -=head2 $t->read - -Reads the table into data structures - -=cut - -sub read -{ - my ($self) = @_; - my ($fh) = $self->{' INFILE'}; - my ($numg, $ppem, $i, $numt, $dat, $len); - - $numg = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - $self->SUPER::read or return $self; - - $fh->read($dat, 8); - ($self->{'Version'}, $numt, $len) = unpack("nnN", $dat); - $self->{'Num'} = $numt; - - for ($i = 0; $i < $numt; $i++) - { - $fh->read($dat, $len); - $ppem = unpack("C", $dat); - $self->{$ppem} = [unpack("C$numg", substr($dat, 2))]; - } - $self; -} - - -=head2 $t->out($fh) - -Outputs the device metrics for this font - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($numg, $i, $pad, $len, $numt, @ppem, $max); - - return $self->SUPER::out($fh) unless ($self->{' read'}); - - $numg = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - @ppem = grep(/^\d+$/, sort {$a <=> $b} keys %$self); - $pad = "\000" x (3 - ($numg + 1) % 4); - $len = $numg + 2 + length($pad); - $fh->print(pack("nnN", 0, $#ppem + 1, $len)); - for $i (@ppem) - { - $max = 0; - foreach (@{$self->{$i}}[0..($numg - 1)]) - { $max = $_ if $_ > $max; } - $fh->print(pack("C*", $i, $max, @{$self->{$i}}[0..($numg - 1)]) . $pad); - } - $self; -} - - -=head2 $t->tables_do(&func) - -For each subtable it calls &sub($ref, $ppem) - -=cut - -sub tables_do -{ - my ($self, $func) = @_; - my ($i); - - foreach $i (grep(/^\d+$/, %$self)) - { &$func($self->{$i}, $i); } - $self; -} - - -=head2 $t->XML_element($context, $depth, $key, $value) - -Outputs device metrics a little more tidily - -=cut - -sub XML_element -{ - my ($self) = shift; - my ($context, $depth, $key, $value) = @_; - my ($fh) = $context->{'fh'}; - my ($i); - - return $self->SUPER::XML_element(@_) if (ref($value) ne 'ARRAY'); - $fh->print("$depth\n"); - for ($i = 0; $i <= $#{$value}; $i += 25) - { - $fh->print("$depth$context->{'indent'}". join(' ', @{$value}[$i .. $i + 24]) . "\n"); - } - $fh->print("$depth\n"); - $self; -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Head.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Head.pm deleted file mode 100644 index 362e8e4..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Head.pm +++ /dev/null @@ -1,250 +0,0 @@ -package Font::TTF::Head; - -=head1 NAME - -Font::TTF::Head - The head table for a TTF Font - -=head1 DESCRIPTION - -This is a very basic table with just instance variables as described in the -TTF documentation, using the same names. One of the most commonly used is -C. - -=head1 INSTANCE VARIABLES - -The C table has no internal instance variables beyond those common to all -tables and those specified in the standard: - - version - fontRevision - checkSumAdjustment - magicNumber - flags - unitsPerEm - created - modified - xMin - yMin - xMax - yMax - macStyle - lowestRecPPEM - fontDirectionHint - indexToLocFormat - glyphDataFormat - -The two dates are held as an array of two unsigned longs (32-bits) - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA %fields @field_info); - -require Font::TTF::Table; -use Font::TTF::Utils; - -@ISA = qw(Font::TTF::Table); -@field_info = ( - 'version' => 'v', - 'fontRevision' => 'f', - 'checkSumAdjustment' => 'L', - 'magicNumber' => 'L', - 'flags' => 'S', - 'unitsPerEm' => 'S', - 'created' => 'L2', - 'modified' => 'L2', - 'xMin' => 's', - 'yMin' => 's', - 'xMax' => 's', - 'yMax' => 's', - 'macStyle' => 'S', - 'lowestRecPPEM' => 'S', - 'fontDirectionHint' => 's', - 'indexToLocFormat' => 's', - 'glyphDataFormat' => 's'); - -sub init -{ - my ($k, $v, $c, $i); - for ($i = 0; $i < $#field_info; $i += 2) - { - ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); - next unless defined $k && $k ne ""; - $fields{$k} = $v; - } -} - - -=head2 $t->read - -Reads the table into memory thanks to some utility functions - -=cut - -sub read -{ - my ($self) = @_; - my ($dat); - - $self->SUPER::read || return $self; - - init unless defined $fields{'Ascender'}; - $self->{' INFILE'}->read($dat, 54); - - TTF_Read_Fields($self, $dat, \%fields); - $self; -} - - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying. If in memory -(which is usually) the checkSumAdjustment field is set to 0 as per the default -if the file checksum is not to be considered. - -=cut - -sub out -{ - my ($self, $fh) = @_; - - return $self->SUPER::out($fh) unless $self->{' read'}; # this is never true -# $self->{'checkSumAdjustment'} = 0 unless $self->{' PARENT'}{' wantsig'}; - $fh->print(TTF_Out_Fields($self, \%fields, 54)); - $self; -} - - -=head2 $t->XML_element($context, $depth, $key, $value) - -Handles date process for the XML exporter - -=cut - -sub XML_element -{ - my ($self) = shift; - my ($context, $depth, $key, $value) = @_; - my ($fh) = $context->{'fh'}; - my ($output, @time); - my (@month) = qw(JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC); - - return $self->SUPER::XML_element(@_) unless ($key eq 'created' || $key eq 'modified'); - - @time = gmtime($self->getdate($key eq 'created')); - $output = sprintf("%d/%s/%d %d:%d:%d", $time[3], $month[$time[4]], $time[5] + 1900, - $time[2], $time[1], $time[0]); - $fh->print("$depth<$key>$output\n"); - $self; -} - - -=head2 $t->update - -Updates the head table based on the glyph data and the hmtx table - -=cut - -sub update -{ - my ($self) = @_; - my ($num, $i, $loc, $hmtx); - my ($xMin, $yMin, $xMax, $yMax, $lsbx); - - return undef unless ($self->SUPER::update); - - $num = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - return undef unless (defined $self->{' PARENT'}{'hmtx'} && defined $self->{' PARENT'}{'loca'}); - $hmtx = $self->{' PARENT'}{'hmtx'}->read; - - $self->{' PARENT'}{'loca'}->update; - $hmtx->update; # if we updated, then the flags will be set anyway. - $lsbx = 1; - for ($i = 0; $i < $num; $i++) - { - $loc = $self->{' PARENT'}{'loca'}{'glyphs'}[$i]; - next unless defined $loc; - $loc->read->update_bbox; - $xMin = $loc->{'xMin'} if ($loc->{'xMin'} < $xMin || $i == 0); - $yMin = $loc->{'yMin'} if ($loc->{'yMin'} < $yMin || $i == 0); - $xMax = $loc->{'xMax'} if ($loc->{'xMax'} > $xMax); - $yMax = $loc->{'yMax'} if ($loc->{'yMax'} > $yMax); - $lsbx &= ($loc->{'xMin'} == $hmtx->{'lsb'}[$i]); - } - $self->{'xMin'} = $xMin; - $self->{'yMin'} = $yMin; - $self->{'xMax'} = $xMax; - $self->{'yMax'} = $yMax; - if ($lsbx) - { $self->{'flags'} |= 2; } - else - { $self->{'flags'} &= ~2; } - $self; -} - - -=head2 $t->getdate($is_create) - -Converts font modification time (or creation time if $is_create is set) to a 32-bit integer as returned -from time(). Returns undef if the value is out of range, either before the epoch or after the maximum -storable time. - -=cut - -sub getdate -{ - my ($self, $is_create) = @_; - my ($arr) = $self->{$is_create ? 'created' : 'modified'}; - - $arr->[1] -= 2082844800; # seconds between 1/Jan/1904 and 1/Jan/1970 (midnight) - if ($arr->[1] < 0) - { - $arr->[1] += 0xFFFFFFF; $arr->[1]++; - $arr->[0]--; - } - return undef if $arr->[0] != 0; - return $arr->[1]; -} - - -=head2 $t->setdate($time, $is_create) - -Sets the time information for modification (or creation time if $is_create is set) according to the 32-bit -time information. - -=cut - -sub setdate -{ - my ($self, $time, $is_create) = @_; - my (@arr); - - $arr[1] = $time; - if ($arr[1] >= 0x83DA4F80) - { - $arr[1] -= 0xFFFFFFFF; - $arr[1]--; - $arr[0]++; - } - $arr[1] += 2082844800; - $self->{$is_create ? 'created' : 'modified'} = \@arr; - $self; -} - - -1; - - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hhea.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hhea.pm deleted file mode 100644 index cb923b1..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hhea.pm +++ /dev/null @@ -1,159 +0,0 @@ -package Font::TTF::Hhea; - -=head1 NAME - -Font::TTF::Hhea - Horizontal Header table - -=head1 DESCRIPTION - -This is a simplte table with just standards specified instance variables - -=head1 INSTANCE VARIABLES - - version - Ascender - Descender - LineGap - advanceWidthMax - minLeftSideBearing - minRightSideBearing - xMaxExtent - caretSlopeRise - caretSlopeRun - metricDataFormat - numberOfHMetrics - - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA %fields @field_info); - -require Font::TTF::Table; -use Font::TTF::Utils; - -@ISA = qw(Font::TTF::Table); -@field_info = ( - 'version' => 'v', - 'Ascender' => 's', - 'Descender' => 's', - 'LineGap' => 's', - 'advanceWidthMax' => 'S', - 'minLeftSideBearing' => 's', - 'minRightSideBearing' => 's', - 'xMaxExtent' => 's', - 'caretSlopeRise' => 's', - 'caretSlopeRun' => 's', - 'metricDataFormat' => '+10s', - 'numberOfHMetrics' => 'S'); - -sub init -{ - my ($k, $v, $c, $i); - for ($i = 0; $i < $#field_info; $i += 2) - { - ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); - next unless defined $k && $k ne ""; - $fields{$k} = $v; - } -} - - -=head2 $t->read - -Reads the table into memory as instance variables - -=cut - -sub read -{ - my ($self) = @_; - my ($dat); - - $self->SUPER::read or return $self; - init unless defined $fields{'Ascender'}; - $self->{' INFILE'}->read($dat, 36); - - TTF_Read_Fields($self, $dat, \%fields); - $self; -} - - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying. - -=cut - -sub out -{ - my ($self, $fh) = @_; - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $self->{'numberOfHMetrics'} = $self->{' PARENT'}{'hmtx'}->numMetrics || $self->{'numberOfHMetrics'}; - $fh->print(TTF_Out_Fields($self, \%fields, 36)); - $self; -} - - -=head2 $t->update - -Updates various parameters in the hhea table from the hmtx table. - -=cut - -sub update -{ - my ($self) = @_; - my ($hmtx) = $self->{' PARENT'}{'hmtx'}; - my ($glyphs); - my ($num, $res); - my ($i, $maw, $mlsb, $mrsb, $mext, $aw, $lsb, $ext); - - return undef unless ($self->SUPER::update); - return undef unless (defined $hmtx && defined $self->{' PARENT'}{'loca'}); - - $hmtx->read->update; - $self->{' PARENT'}{'loca'}->read->update; - $glyphs = $self->{' PARENT'}{'loca'}{'glyphs'}; - $num = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - - for ($i = 0; $i < $num; $i++) - { - $aw = $hmtx->{'advance'}[$i]; - $lsb = $hmtx->{'lsb'}[$i]; - if (defined $glyphs->[$i]) - { $ext = $lsb + $glyphs->[$i]->read->{'xMax'} - $glyphs->[$i]{'xMin'}; } - else - { $ext = $aw; } - $maw = $aw if ($aw > $maw); - $mlsb = $lsb if ($lsb < $mlsb or $i == 0); - $mrsb = $aw - $ext if ($aw - $ext < $mrsb or $i == 0); - $mext = $ext if ($ext > $mext); - } - $self->{'advanceWidthMax'} = $maw; - $self->{'minLeftSideBearing'} = $mlsb; - $self->{'minRightSideBearing'} = $mrsb; - $self->{'xMaxExtent'} = $mext; - $self->{'numberOfHMetrics'} = $hmtx->numMetrics; - $self; -} - - -1; - - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hmtx.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hmtx.pm deleted file mode 100644 index 537df94..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hmtx.pm +++ /dev/null @@ -1,214 +0,0 @@ -package Font::TTF::Hmtx; - -=head1 NAME - -Font::TTF::Hmtx - Horizontal Metrics - -=head1 DESCRIPTION - -Contains the advance width and left side bearing for each glyph. Given the -compressability of the data onto disk, this table uses information from -other tables, and thus must do part of its output during the output of -other tables - -=head1 INSTANCE VARIABLES - -The horizontal metrics are kept in two arrays by glyph id. The variable names -do not start with a space - -=over 4 - -=item advance - -An array containing the advance width for each glyph - -=item lsb - -An array containing the left side bearing for each glyph - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -require Font::TTF::Table; - -@ISA = qw(Font::TTF::Table); - - -=head2 $t->read - -Reads the horizontal metrics from the TTF file into memory - -=cut - -sub read -{ - my ($self) = @_; - my ($numh, $numg); - - $numh = $self->{' PARENT'}{'hhea'}->read->{'numberOfHMetrics'}; - $numg = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - $self->_read($numg, $numh, "advance", "lsb"); -} - -sub _read -{ - my ($self, $numg, $numh, $tAdv, $tLsb) = @_; - my ($fh) = $self->{' INFILE'}; - my ($i, $dat); - - $self->SUPER::read or return $self; - - for ($i = 0; $i < $numh; $i++) - { - $fh->read($dat, 4); - ($self->{$tAdv}[$i], $self->{$tLsb}[$i]) = unpack("nn", $dat); - $self->{$tLsb}[$i] -= 65536 if ($self->{$tLsb}[$i] >= 32768); - } - - $i--; - while (++$i < $numg) - { - $fh->read($dat, 2); - $self->{$tAdv}[$i] = $self->{$tAdv}[$numh - 1]; - $self->{$tLsb}[$i] = unpack("n", $dat); - $self->{$tLsb}[$i] -= 65536 if ($self->{$tLsb}[$i] >= 32768); - } - $self; -} - -=head2 $t->numMetrics - -Calculates again the number of long metrics required to store the information -here. Returns undef if the table has not been read. - -=cut - -sub numMetrics -{ - my ($self) = @_; - my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - my ($i); - - return undef unless $self->{' read'}; - - for ($i = $numg - 2; $i >= 0; $i--) - { last if ($self->{'advance'}[$i] != $self->{'advance'}[$i + 1]); } - - return $i + 2; -} - - -=head2 $t->out($fh) - -Writes the metrics to a TTF file. Assumes that the C has updated the -numHMetrics from here - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - my ($numh) = $self->{' PARENT'}{'hhea'}->read->{'numberOfHMetrics'}; - $self->_out($fh, $numg, $numh, "advance", "lsb"); -} - -sub _out -{ - my ($self, $fh, $numg, $numh, $tAdv, $tLsb) = @_; - my ($i, $lsb); - - return $self->SUPER::out($fh) unless ($self->{' read'}); - - for ($i = 0; $i < $numg; $i++) - { - $lsb = $self->{$tLsb}[$i]; - $lsb += 65536 if $lsb < 0; - if ($i >= $numh) - { $fh->print(pack("n", $lsb)); } - else - { $fh->print(pack("n2", $self->{$tAdv}[$i], $lsb)); } - } - $self; -} - - -=head2 $t->update - -Updates the lsb values from the xMin from the each glyph - -=cut - -sub update -{ - my ($self) = @_; - my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - my ($i); - - return undef unless ($self->SUPER::update); -# lsb & xMin must always be the same, regardless of any flags! -# return $self unless ($self->{' PARENT'}{'head'}{'flags'} & 2); # lsb & xMin the same - - $self->{' PARENT'}{'loca'}->update; - for ($i = 0; $i < $numg; $i++) - { - my ($g) = $self->{' PARENT'}{'loca'}{'glyphs'}[$i]; - if ($g) - { $self->{'lsb'}[$i] = $g->read->update_bbox->{'xMin'}; } - else - { $self->{'lsb'}[$i] = 0; } - } - $self->{' PARENT'}{'head'}{'flags'} |= 2; - $self; -} - - -=head2 $t->out_xml($context, $depth) - -Outputs the table in XML - -=cut - -sub out_xml -{ - my ($self, $context, $depth) = @_; - my ($fh) = $context->{'fh'}; - my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - my ($addr) = ($self =~ m/\((.+)\)$/o); - my ($i); - - if ($context->{'addresses'}{$addr}) - { - $fh->printf("%s<%s id_ref='%s'/>\n", $depth, $context->{'name'}, $addr); - return $self; - } - else - { $fh->printf("%s<%s id='%s'>\n", $depth, $context->{'name'}, $addr); } - - $self->read; - - for ($i = 0; $i < $numg; $i++) - { $fh->print("$depth$context->{'indent'}\n"); } - - $fh->print("$depth{'name'}>\n"); - $self; -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern.pm deleted file mode 100644 index 80f66d9..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern.pm +++ /dev/null @@ -1,296 +0,0 @@ -package Font::TTF::Kern; - -=head1 NAME - -Font::TTF::Kern - Kerning tables - -=head1 DESCRIPTION - -Kerning tables are held as an ordered collection of subtables each giving -incremental information regarding the kerning of various pairs of glyphs. - -The basic structure of the kerning data structure is: - - $kern = $f->{'kern'}{'tables'}[$tnum]{'kerns'}{$leftnum}{$rightnum}; - -Due to the possible complexity of some kerning tables the above information -is insufficient. Reference also needs to be made to the type of the table and -the coverage field. - -=head1 INSTANCE VARIABLES - -The instance variables for a kerning table are relatively straightforward. - -=over 4 - -=item Version - -Version number of the kerning table - -=item Num - -Number of subtables in the kerning table - -=item tables - -Array of subtables in the kerning table - -=over 4 - -Each subtable has a number of instance variables. - -=item kern - -A two level hash array containing kerning values. The indexing is left -value and then right value. In the case of type 2 tables, the indexing -is via left class and right class. It may seem using hashes is strange, -but most tables are not type 2 and this method saves empty array values. - -=item type - -Stores the table type. Only type 0 and type 2 tables are specified for -TrueType so far. - -=item coverage - -A bit field of coverage information regarding the kerning value. See the -TrueType specification for details. - -=item Version - -Contains the version number of the table. - -=item Num - -Number of kerning pairs in this type 0 table. - -=item left - -An array indexed by glyph - left_first which returns a class number for -the glyph in type 2 tables. - -=item right - -An array indexed by glyph - right_first which returns a class number for -the glyph in type 2 tables. - -=item left_first - -the glyph number of the first element in the left array for type 2 tables. - -=item right_first - -the glyph number of the first element in the right array for type 2 tables. - -=item num_left - -Number of left classes - -=item num_right - -Number of right classes - -=back - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::Table; - -@ISA = qw(Font::TTF::Table); - -=head2 $t->read - -Reads the whole kerning table into structures - -=cut - -sub read -{ - my ($self) = @_; - my ($fh) = $self->{' INFILE'}; - my ($dat, $i, $numt, $len, $cov, $t); - - $self->SUPER::read or return $self; - - $fh->read($dat, 4); - ($self->{'Version'}, $numt) = unpack("n2", $dat); - $self->{'Num'} = $numt; - - for ($i = 0; $i < $numt; $i++) - { - $t = {}; - $fh->read($dat, 6); - ($t->{'Version'}, $len, $cov) = unpack("n3", $dat); - $t->{'coverage'} = $cov & 255; - $t->{'type'} = $cov >> 8; - $fh->read($dat, $len - 6); - if ($t->{'Version'} == 0) - { - $t->{'Num'} = unpack("n", $dat); - my (@vals) = unpack("n*", substr($dat, 8, $t->{'Num'} * 6)); - for (0 .. ($t->{'Num'} - 1)) - { - my ($f, $l, $v); - $f = shift @vals; - $l = shift @vals; - $v = shift @vals; - $v -= 65536 if ($v > 32767); - $t->{'kern'}{$f}{$l} = $v; - } - } elsif ($t->{'Version'} == 2) - { - my ($wid, $off, $numg, $maxl, $maxr, $j); - - $wid = unpack("n", $dat); - $off = unpack("n", substr($dat, 2)); - ($t->{'left_first'}, $numg) = unpack("n2", substr($dat, $off)); - $t->{'left'} = [unpack("C$numg", substr($dat, $off + 4))]; - foreach (@{$t->{'left'}}) - { - $_ /= $wid; - $maxl = $_ if ($_ > $maxl); - } - $t->{'left_max'} = $maxl; - - $off = unpack("n", substr($dat, 4)); - ($t->{'right_first'}, $numg) = unpack("n2", substr($dat, $off)); - $t->{'right'} = [unpack("C$numg", substr($dat, $off + 4))]; - foreach (@{$t->{'right'}}) - { - $_ >>= 1; - $maxr = $_ if ($_ > $maxr); - } - $t->{'right_max'} = $maxr; - - $off = unpack("n", substr($dat, 6)); - for ($j = 0; $j <= $maxl; $j++) - { - my ($k) = 0; - - map { $t->{'kern'}{$j}{$k} = $_ if $_; $k++; } - unpack("n$maxr", substr($dat, $off + $wid * $j)); - } - } - push (@{$self->{'tables'}}, $t); - } - $self; -} - - -=head2 $t->out($fh) - -Outputs the kerning tables to the given file - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($i, $l, $r, $loc, $loc1, $t); - - return $self->SUPER::out($fh) unless ($self->{' read'}); - - $fh->print(pack("n2", $self->{'Version'}, $self->{'Num'})); - for ($i = 0; $i < $self->{'Num'}; $i++) - { - $t = $self->{'tables'}[$i]; - $loc = $fh->tell(); - - $fh->print(pack("nnn", $t->{'Version'}, 0, $t->{'coverage'})); - if ($t->{'Version'} == 0) - { - my ($dat); - foreach $l (sort {$a <=> $b} keys %{$t->{'kern'}}) - { - foreach $r (sort {$a <=> $b} keys %{$t->{'kern'}{$l}}) - { $dat .= TTF_Pack("SSs", $l, $r, $t->{'kern'}{$l}{$r}); } - } - $fh->print(TTF_Pack("SSSS", Font::TTF::Utils::TTF_bininfo(length($dat) / 6, 6))); - $fh->print($dat); - } elsif ($t->{'Version'} == 2) - { - my ($arr); - - $fh->print(pack("nnnn", $t->{'right_max'} << 1, 8, ($#{$t->{'left'}} + 7) << 1, - ($#{$t->{'left'}} + $#{$t->{'right'}} + 10) << 1)); - - $fh->print(pack("nn", $t->{'left_first'}, $#{$t->{'left'}} + 1)); - foreach (@{$t->{'left'}}) - { $fh->print(pack("C", $_ * (($t->{'left_max'} + 1) << 1))); } - - $fh->print(pack("nn", $t->{'right_first'}, $#{$t->{'right'}} + 1)); - foreach (@{$t->{'right'}}) - { $fh->print(pack("C", $_ << 1)); } - - $arr = "\000\000" x (($t->{'left_max'} + 1) * ($t->{'right_max'} + 1)); - foreach $l (keys %{$t->{'kern'}}) - { - foreach $r (keys %{$t->{'kern'}{$l}}) - { substr($arr, ($l * ($t->{'left_max'} + 1) + $r) << 1, 2) - = pack("n", $t->{'kern'}{$l}{$r}); } - } - $fh->print($arr); - } - $loc1 = $fh->tell(); - $fh->seek($loc + 2, 0); - $fh->print(pack("n", $loc1 - $loc)); - $fh->seek($loc1, 0); - } - $self; -} - - -=head2 $t->XML_element($context, $depth, $key, $value) - -Handles outputting the kern hash into XML a little more tidily - -=cut - -sub XML_element -{ - my ($self) = shift; - my ($context, $depth, $key, $value) = @_; - my ($fh) = $context->{'fh'}; - my ($f, $l); - - return $self->SUPER::XML_element(@_) unless ($key eq 'kern'); - $fh->print("$depth\n"); - foreach $f (sort {$a <=> $b} keys %{$value}) - { - foreach $l (sort {$a <=> $b} keys %{$value->{$f}}) - { $fh->print("$depth$context->{'indent'}\n"); } - } - $fh->print("$depth\n"); - $self; -} - -1; - -=head1 BUGS - -=over 4 - -=item * - -Only supports kerning table types 0 & 2. - -=item * - -No real support functions to I anything with the kerning tables yet. - -=back - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/ClassArray.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/ClassArray.pm deleted file mode 100644 index ddc630e..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/ClassArray.pm +++ /dev/null @@ -1,153 +0,0 @@ -package Font::TTF::Kern::ClassArray; - -=head1 NAME - -Font::TTF::Kern::ClassArray - ClassArray Kern Subtable for AAT - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; -use IO::File; - -@ISA = qw(Font::TTF::Kern::Subtable); - -sub new -{ - my ($class) = @_; - my ($self) = {}; - - $class = ref($class) || $class; - bless $self, $class; -} - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self, $fh) = @_; - - my $subtableStart = $fh->tell() - 8; - my $dat; - $fh->read($dat, 8); - my ($rowWidth, $leftClassTable, $rightClassTable, $array) = unpack("nnnn", $dat); - - $fh->seek($subtableStart + $leftClassTable, IO::File::SEEK_SET); - $fh->read($dat, 4); - my ($firstGlyph, $nGlyphs) = unpack("nn", $dat); - $fh->read($dat, $nGlyphs * 2); - my $leftClasses = []; - foreach (TTF_Unpack("S*", $dat)) { - push @{$leftClasses->[($_ - $array) / $rowWidth]}, $firstGlyph++; - } - - $fh->seek($subtableStart + $rightClassTable, IO::File::SEEK_SET); - $fh->read($dat, 4); - ($firstGlyph, $nGlyphs) = unpack("nn", $dat); - $fh->read($dat, $nGlyphs * 2); - my $rightClasses = []; - foreach (TTF_Unpack("S*", $dat)) { - push @{$rightClasses->[$_ / 2]}, $firstGlyph++; - } - - $fh->seek($subtableStart + $array, IO::File::SEEK_SET); - $fh->read($dat, $self->{'length'} - $array); - - my $offset = 0; - my $kernArray = []; - while ($offset < length($dat)) { - push @$kernArray, [ TTF_Unpack("s*", substr($dat, $offset, $rowWidth)) ]; - $offset += $rowWidth; - } - - $self->{'leftClasses'} = $leftClasses; - $self->{'rightClasses'} = $rightClasses; - $self->{'kernArray'} = $kernArray; - - $fh->seek($subtableStart + $self->{'length'}, IO::File::SEEK_SET); - - $self; -} - -=head2 $t->out_sub($fh) - -Writes the table to a file - -=cut - -sub out_sub -{ -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - - my $post = $self->post(); - - $fh = 'STDOUT' unless defined $fh; - - -} - -sub dumpXML -{ - my ($self, $fh) = @_; - my $post = $self->post(); - - $fh = 'STDOUT' unless defined $fh; - $fh->printf("\n"); - $self->dumpClasses($self->{'leftClasses'}, $fh); - $fh->printf("\n"); - - $fh->printf("\n"); - $self->dumpClasses($self->{'rightClasses'}, $fh); - $fh->printf("\n"); - - $fh->printf("\n"); - my $kernArray = $self->{'kernArray'}; - foreach (0 .. $#$kernArray) { - $fh->printf("\n", $_); - my $row = $kernArray->[$_]; - foreach (0 .. $#$row) { - $fh->printf("\n", $_, $row->[$_]); - } - $fh->printf("\n"); - } - $fh->printf("\n"); -} - -sub type -{ - return 'kernClassArray'; -} - - - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/CompactClassArray.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/CompactClassArray.pm deleted file mode 100644 index ab0304a..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/CompactClassArray.pm +++ /dev/null @@ -1,93 +0,0 @@ -package Font::TTF::Kern::CompactClassArray; - -=head1 NAME - -Font::TTF::Kern::CompactClassArray - Compact Class Array kern subtable for AAT - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; - -@ISA = qw(Font::TTF::Kern::Subtable); - -sub new -{ - my ($class) = @_; - my ($self) = {}; - - $class = ref($class) || $class; - bless $self, $class; -} - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self, $fh) = @_; - - die "incomplete"; - - $self; -} - -=head2 $t->out($fh) - -Writes the table to a file - -=cut - -sub out_sub -{ - my ($self, $fh) = @_; - - die "incomplete"; - - $self; -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - - my $post = $self->post(); - - $fh = 'STDOUT' unless defined $fh; - - die "incomplete"; -} - - -sub type -{ - return 'kernCompactClassArray'; -} - - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/OrderedList.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/OrderedList.pm deleted file mode 100644 index 41cc8c1..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/OrderedList.pm +++ /dev/null @@ -1,108 +0,0 @@ -package Font::TTF::Kern::OrderedList; - -=head1 NAME - -Font::TTF::Kern::OrderedList - Ordered List Kern subtable for AAT - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; - -@ISA = qw(Font::TTF::Kern::Subtable); - -sub new -{ - my ($class, @options) = @_; - my ($self) = {}; - - $class = ref($class) || $class; - bless $self, $class; -} - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self, $fh) = @_; - - my $dat; - $fh->read($dat, 8); - my ($nPairs, $searchRange, $entrySelector, $rangeShift) = unpack("nnnn", $dat); - - my $pairs = []; - foreach (1 .. $nPairs) { - $fh->read($dat, 6); - my ($left, $right, $kern) = TTF_Unpack("SSs", $dat); - push @$pairs, { 'left' => $left, 'right' => $right, 'kern' => $kern } if $kern != 0; - } - - $self->{'kernPairs'} = $pairs; - - $self; -} - -=head2 $t->out_sub($fh) - -Writes the table to a file - -=cut - -sub out_sub -{ - my ($self, $fh) = @_; - - my $pairs = $self->{'kernPairs'}; - $fh->print(pack("nnnn", TTF_bininfo(scalar @$pairs, 6))); - - foreach (sort { $a->{'left'} <=> $b->{'left'} or $a->{'right'} <=> $b->{'right'} } @$pairs) { - $fh->print(TTF_Pack("SSs", $_->{'left'}, $_->{'right'}, $_->{'kern'})); - } -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub dumpXML -{ - my ($self, $fh) = @_; - - my $postVal = $self->post()->{'VAL'}; - - $fh = 'STDOUT' unless defined $fh; - foreach (@{$self->{'kernPairs'}}) { - $fh->printf("\n", $postVal->[$_->{'left'}], $postVal->[$_->{'right'}], $_->{'kern'}); - } -} - - -sub type -{ - return 'kernOrderedList'; -} - - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/StateTable.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/StateTable.pm deleted file mode 100644 index 51d650a..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/StateTable.pm +++ /dev/null @@ -1,143 +0,0 @@ -package Font::TTF::Kern::StateTable; - -=head1 NAME - -Font::TTF::Kern::StateTable - State Table Kern subtable for AAT - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; -use Font::TTF::Kern::Subtable; -use IO::File; - -@ISA = qw(Font::TTF::Kern::Subtable); - -sub new -{ - my ($class) = @_; - my ($self) = {}; - - $class = ref($class) || $class; - bless $self, $class; -} - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self, $fh) = @_; - my ($dat); - - my $stTableStart = $fh->tell(); - - my ($classes, $states, $entries) = AAT_read_state_table($fh, 0); - - foreach (@$entries) { - my $flags = $_->{'flags'}; - delete $_->{'flags'}; - $_->{'push'} = 1 if $flags & 0x8000; - $_->{'noAdvance'} = 1 if $flags & 0x4000; - $flags &= ~0xC000; - if ($flags != 0) { - my $kernList = []; - $fh->seek($stTableStart + $flags, IO::File::SEEK_SET); - while (1) { - $fh->read($dat, 2); - my $k = TTF_Unpack("s", $dat); - push @$kernList, ($k & ~1); - last if ($k & 1) != 0; - } - $_->{'kernList'} = $kernList; - } - } - - $self->{'classes'} = $classes; - $self->{'states'} = $states; - $self->{'entries'} = $entries; - - $fh->seek($stTableStart - 8 + $self->{'length'}, IO::File::SEEK_SET); - - $self; -} - -=head2 $t->out_sub($fh) - -Writes the table to a file - -=cut - -sub out_sub -{ -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ -} - -sub dumpXML -{ - my ($self, $fh) = @_; - - $fh->printf("\n"); - $self->dumpClasses($self->{'classes'}, $fh); - $fh->printf("\n"); - - $fh->printf("\n"); - my $states = $self->{'states'}; - foreach (0 .. $#$states) { - $fh->printf("\n", $_); - my $members = $states->[$_]; - foreach (0 .. $#$members) { - my $m = $members->[$_]; - $fh->printf("{'nextState'}); - $fh->printf(" push=\"1\"") if $m->{'push'}; - $fh->printf(" noAdvance=\"1\"") if $m->{'noAdvance'}; - if (exists $m->{'kernList'}) { - $fh->printf(">"); - foreach (@{$m->{'kernList'}}) { - $fh->printf("", $_); - } - $fh->printf("\n"); - } - else { - $fh->printf("/>\n"); - } - } - $fh->printf("\n"); - } - $fh->printf("\n"); -} - -sub type -{ - return 'kernStateTable'; -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/Subtable.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/Subtable.pm deleted file mode 100644 index b1db410..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/Subtable.pm +++ /dev/null @@ -1,175 +0,0 @@ -package Font::TTF::Kern::Subtable; - -=head1 NAME - -Font::TTF::Kern::Subtable - Kern Subtable superclass for AAT - -=head1 METHODS - -=cut - -use strict; -use Font::TTF::Utils; -use Font::TTF::AATutils; -use IO::File; - -require Font::TTF::Kern::OrderedList; -require Font::TTF::Kern::StateTable; -require Font::TTF::Kern::ClassArray; -require Font::TTF::Kern::CompactClassArray; - -sub new -{ - my ($class) = @_; - my ($self) = {}; - - $class = ref($class) || $class; - - bless $self, $class; -} - -sub create -{ - my ($class, $type, $coverage, $length) = @_; - - $class = ref($class) || $class; - - my $subclass; - if ($type == 0) { - $subclass = 'Font::TTF::Kern::OrderedList'; - } - elsif ($type == 1) { - $subclass = 'Font::TTF::Kern::StateTable'; - } - elsif ($type == 2) { - $subclass = 'Font::TTF::Kern::ClassArray'; - } - elsif ($type == 3) { - $subclass = 'Font::TTF::Kern::CompactClassArray'; - } - - my @options; - push @options,'vertical' if ($coverage & 0x8000) != 0; - push @options,'crossStream' if ($coverage & 0x4000) != 0; - push @options,'variation' if ($coverage & 0x2000) != 0; - - my ($subTable) = $subclass->new(@options); - - map { $subTable->{$_} = 1 } @options; - - $subTable->{'type'} = $type; - $subTable->{'length'} = $length; - - $subTable; -} - -=head2 $t->out($fh) - -Writes the table to a file - -=cut - -sub out -{ - my ($self, $fh) = @_; - - my $subtableStart = $fh->tell(); - my $type = $self->{'type'}; - my $coverage = $type; - $coverage += 0x8000 if $self->{'vertical'}; - $coverage += 0x4000 if $self->{'crossStream'}; - $coverage += 0x2000 if $self->{'variation'}; - - $fh->print(TTF_Pack("LSS", 0, $coverage, $self->{'tupleIndex'})); # placeholder for length - - $self->out_sub($fh); - - my $length = $fh->tell() - $subtableStart; - my $padBytes = (4 - ($length & 3)) & 3; - $fh->print(pack("C*", (0) x $padBytes)); - $length += $padBytes; - $fh->seek($subtableStart, IO::File::SEEK_SET); - $fh->print(pack("N", $length)); - $fh->seek($subtableStart + $length, IO::File::SEEK_SET); -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub post -{ - my ($self) = @_; - - my $post = $self->{' PARENT'}{' PARENT'}{'post'}; - if (defined $post) { - $post->read; - } - else { - $post = {}; - } - - return $post; -} - -sub print -{ - my ($self, $fh) = @_; - - my $post = $self->post(); - $fh = 'STDOUT' unless defined $fh; -} - -=head2 $t->print_classes($fh) - -Prints a human-readable representation of the table - -=cut - -sub print_classes -{ - my ($self, $fh) = @_; - - my $post = $self->post(); - - my $classes = $self->{'classes'}; - foreach (0 .. $#$classes) { - my $class = $classes->[$_]; - if (defined $class) { - $fh->printf("\t\tClass %d:\t%s\n", $_, join(", ", map { $_ . " [" . $post->{'VAL'}[$_] . "]" } @$class)); - } - } -} - -sub dumpClasses -{ - my ($self, $classes, $fh) = @_; - my $post = $self->post(); - - foreach (0 .. $#$classes) { - my $c = $classes->[$_]; - if ($#$c > -1) { - $fh->printf("\n", $_); - foreach (@$c) { - $fh->printf("\n", $_, $post->{'VAL'}[$_]); - } - $fh->printf("\n"); - } - } -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/LTSH.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/LTSH.pm deleted file mode 100644 index 2b2dea6..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/LTSH.pm +++ /dev/null @@ -1,88 +0,0 @@ -package Font::TTF::LTSH; - -=head1 NAME - -Font::TTF::LTSH - Linear Threshold table - -=head1 DESCRIPTION - -Holds the linear threshold for each glyph. This is the ppem value at which a -glyph's metrics become linear. The value is set to 1 if a glyph's metrics are -always linear. - -=head1 INSTANCE VARIABLES - -=over 4 - -=item glyphs - -An array of ppem values. One value per glyph - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Table; - -@ISA = qw(Font::TTF::Table); - -=head2 $t->read - -Reads the table - -=cut - -sub read -{ - my ($self) = @_; - my ($fh) = $self->{' INFILE'}; - my ($numg, $dat); - - $self->SUPER::read or return $self; - - $fh->read($dat, 4); - ($self->{'Version'}, $numg) = unpack("nn", $dat); - $self->{'Num'} = $numg; - - $fh->read($dat, $numg); - $self->{'glyphs'} = [unpack("C$numg", $dat)]; - $self; -} - - -=head2 $t->out($fh) - -Outputs the LTSH to the given fh. - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - - return $self->SUPER::out($fh) unless ($self->{' read'}); - - $fh->print(pack("nn", 0, $numg)); - $fh->print(pack("C$numg", @{$self->{'glyphs'}})); - $self; -} - - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Loca.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Loca.pm deleted file mode 100644 index ca641bb..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Loca.pm +++ /dev/null @@ -1,183 +0,0 @@ -package Font::TTF::Loca; - -=head1 NAME - -Font::TTF::Loca - the Locations table, which is intimately tied to the glyf table - -=head1 DESCRIPTION - -The location table holds the directory of locations of each glyph within the -glyf table. Due to this relationship and the unimportance of the actual locations -when it comes to holding glyphs in memory, reading the location table results -in the creation of glyph objects for each glyph and stores them here. -So if you are looking for glyphs, don't look in the C table, look here -instead. - -Things get complicated if you try to change the glyph list within the one table. -The recommendation is to create another clean location object to replace this -table in the font, ensuring that the old table is read first and to transfer -or copy glyphs across from the read table to the new table. - -=head1 INSTANCE VARIABLES - -The instance variables do not start with a space - -=over 4 - -=item glyphs - -An array of glyph objects for each glyph. - -=item glyphtype - -A string containing the class name to create for each new glyph. If empty, -defaults to L. - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -@ISA = qw(Font::TTF::Table); - -require Font::TTF::Glyph; - - -=head2 $t->new - -Creates a new location table making sure it has a glyphs array - -=cut - -sub new -{ - my ($class) = shift; - my ($res) = $class->SUPER::new(@_); - $res->{'glyphs'} = []; - $res; -} - -=head2 $t->read - -Reads the location table creating glyph objects (L) for each glyph -allowing their later reading. - -=cut - -sub read -{ - my ($self) = @_; - my ($fh) = $self->{' INFILE'}; - my ($locFmt) = $self->{' PARENT'}{'head'}{'indexToLocFormat'}; - my ($numGlyphs) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - my ($glyfLoc) = $self->{' PARENT'}{'glyf'}{' OFFSET'}; - my ($dat, $last, $i, $loc); - - $self->SUPER::read or return $self; - $fh->read($dat, $locFmt ? 4 : 2); - $last = unpack($locFmt ? "N" : "n", $dat); - for ($i = 0; $i < $numGlyphs; $i++) - { - $fh->read($dat, $locFmt ? 4 : 2); - $loc = unpack($locFmt ? "N" : "n", $dat); - $self->{'glyphs'}[$i] = ($self->{'glyphtype'} || "Font::TTF::Glyph")->new( - LOC => $last << ($locFmt ? 0 : 1), - OUTLOC => $last << ($locFmt ? 0 : 1), - PARENT => $self->{' PARENT'}, - INFILE => $fh, - BASE => $glyfLoc, - OUTLEN => ($loc - $last) << ($locFmt ? 0 : 1), - LEN => ($loc - $last) << ($locFmt ? 0 : 1)) if ($loc != $last); - $last = $loc; - } - $self; -} - - -=head2 $t->out($fh) - -Writes the location table out to $fh. Notice that not having read the location -table implies that the glyf table has not been read either, so the numbers in -the location table are still valid. Let's hope that C and -C haven't changed otherwise we are in big trouble. - -The function uses the OUTLOC location in the glyph calculated when the glyf -table was attempted to be output. - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($locFmt) = $self->{' PARENT'}{'head'}{'indexToLocFormat'}; - my ($numGlyphs) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - my ($count, $i, $offset, $g); - - return $self->SUPER::out($fh) unless ($self->{' read'}); - - $count = 0; - for ($i = 0; $i < $numGlyphs; $i++) - { - $g = ($self->{'glyphs'}[$i]) || ""; - unless ($g) - { - $count++; - next; - } else - { - if ($locFmt) - { $fh->print(pack("N", $g->{' OUTLOC'}) x ($count + 1)); } - else - { $fh->print(pack("n", $g->{' OUTLOC'} >> 1) x ($count + 1)); } - $count = 0; - $offset = $g->{' OUTLOC'} + $g->{' OUTLEN'}; - } - } - $fh->print(pack($locFmt ? "N" : "n", ($locFmt ? $offset: $offset >> 1)) x ($count + 1)); -} - - -=head2 $t->out_xml($context, $depth) - -No need to output a loca table, this is dynamically generated - -=cut - -sub out_xml -{ return $_[0]; } - - -=head2 $t->glyphs_do(&func) - -Calls func for each glyph in this location table in numerical order: - - &func($glyph, $glyph_num) - -=cut - -sub glyphs_do -{ - my ($self, $func) = @_; - my ($i); - - for ($i = 0; $i <= $#{$self->{'glyphs'}}; $i++) - { &$func($self->{'glyphs'}[$i], $i) if defined $self->{'glyphs'}[$i]; } - $self; -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Manual.pod b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Manual.pod deleted file mode 100644 index c6d2938..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Manual.pod +++ /dev/null @@ -1,214 +0,0 @@ - -=head1 NAME - -Font::TTF::Manual - Information regarding the whole module set - -=head1 INTRODUCTION - -This document looks at the whole issue of how the various modules in the -TrueType Font work together. As such it is partly information on this font -system and partly information on TrueType fonts in general. - -Due to the inter-relation between so many tables in a TrueType font, different -tables will make expectations as to which other tables exist. At the very least -a font should consist of a C table and a C table. The system has -been designed around the expectation that the necessary tables for font -rendering in the Windows environment exist. But inter table dependencies have -been kept to what are considered necessary. - -This module set is not meant as a simple to use, mindless, font editing suite, -but as a low-level, get your hands dirty, know what you are doing, set of -classes for those who understand the intricacies (and there are many) of -TrueType fonts. To this end, if you get something wrong in the data structures, -etc. then this module set won't tell you and will happily create fonts which -don't work. - -At the time of writing, not every TrueType table in existence has been -implemented! Only the core basic tables of TrueType 1.0 (i.e. no embedded bitmap -tables, no postscript type tables, no OpenType tables and no GX tables) have -been implemented. If you want to help by implementing another table or two, then -please go ahead and send me your code. For a full list of tables, see -L. - - -=head2 Design Principles - -PERL is not C++. C++ encourages methods to be written for changing and reading -each instance variable in a class. If we did this in this PERL program the -results would be rather large and slow. Instead, since most access will be read -access, we expose as much of the inner storage of an object to user access -directly via hash lookup. The advantage this gives are great. For example, by -following an instance variable chain, looking up the C parameter for a -particular glyph becomes: - - $f->{'loca'}{'glyphs'}[$glyph]{'yMax'} - -Or, if we are feeling very lazy and don't mind waiting: - - $f->{'loca'}{'glyphs'}[$f->{'cmap'}->ms_lookup(0x41)]{'yMax'} - -The disadvantage of this method is that it behoves module users to behave -themselves. Thus it does not hold your hand and ensure that if you make a change -to a table, that the table is marked as I, or that other tables are -updated accordingly. - -It is up to the application developer to understand the implications of the -changes they make to a font, and to take the necessary action to ensure that the -data they get out is what they want. Thus, you could go and change the C -value on a glyph and output a new font with this change, but it is up to you to -ensure that the font's bounding box details in the C table are correct, -and even that your changing C is well motivated. - -To help with using the system, each module (or table) will not only describe the -methods it supports, which are relatively few, but also the instance variables -it supports, which are many. Most of the variables directly reflect table -attributes as specified in the OpenType specification, available from Microsoft -(L), Adobe and Apple. A list of the names -used is also given in each module, but not necessarily with any further -description. After all, this code is not a TrueType manual as well! - - -=head2 Conventions - -There are various conventions used in this system. - -Firstly we consider the documentation conventions regarding instance variables. -Each instance variable is marked indicating whether it is a B<(P)>rivate -variable which users of the module are not expected to read and certainly not -write to or a B<(R)>ead only variable which users may well want to read but not -write to. - - -=head1 METHODS - -This section examines various methods and how the various modules work with -these methods. - - -=head2 read and read_dat - -Before the data structures for a table can be accessed, they need to be filled -in from somewhere. The usual way to do this is to read an existing TrueType -font. This may be achieved by: - - $f = Font::TTF::Font->open($filename) || die "Unable to read $filename"; - -This will open an existing font and read its directory header. Notice that at -this point, none of the tables in the font have been read. (Actually, the -C and C tables are read at this point too since they contain the -commonly required parameters of): - - $f->{'head'}{'unitsPerEm'} - $f->{'maxp'}{'numGlyphs'} - -In order to be able to access information from a table, it is first necessary to -C it. Consider trying to find the advance width of a space character -(U+0020). The following code should do it: - - $f = Font::TTF::Font->open($ARGV[0]); - $snum = $f->{'cmap'}->ms_lookup(0x0020); - $sadv = $f->{'hmtx'}{'advance'}[$snum]; - print $sadv; - -This would result in the value zero being printed, which is far from correct. -But why? The first line would correctly read the font directory. The second line -would, incidently, correctly locate the space character in the Windows cmap -(assuming a non symbol encoded font). The third line would not succeed in its -task since the C table has not been filled in from the font file. To -achieve what we want we would first need to cause it to be read: - - $f->{'hmtx'}->read; - $sadv = $f->{'hmtx'}{'advance'}[$snum]; - -Or for those who are too lazy to write multiple lines, C returns the -object it reads. Thus we could write: - - $sadv = $f->{'hmtx'}->read->{'advance'}[$snum]; - -Why, if we always have to read tables before accessing information from them, -did we not have to do this for the C table? The answer lies in the method -call. It senses that the table hasn't been read and reads it for us. This will -generally happen with all method calls, it is only when we do direct data access -that we have to take the responsibility to read the table first. - -Reading a table does not necessarily result in all the data being placed into -internal data structures. In the case of a simple table C is sufficient. -In fact, the normal case is that C reads the data from the file into -an instance variable called C<' dat'> (including the space) and not into the -data structures. - -This is true except for the C class which represents a single glyph. Here -the process is reversed. Reading a C reads the data for the glyph into -the C<' dat'> instance variable and sets various header attributes for the glyph -(C, C, etc.). The data is converted out of the variable into -data structures via the C method. - -The aim, therefore, is that C should do the natural thing (read into data -structures for those tables and elements for which it is helpful -- all except -C at present) and C should do the unnatural thing: read just -the binary data for normal tables and convert binary data to data structures for -Cs. - -In summary, therefore, use C unless you want to hack around with the -internals of glyphs in which case see L for more details. - - -=head2 update - -The aim of this method is to allow the various data elements in a C font -to update themselves. All tables know how to update themselves. All tables also -contain information which cannot be I but is new knowledge in the font. -As a result, certain tables do nothing when they are updated. We can, therefore, -build an update hierarchy of tables, with the independent tables at the bottom -and C at the top: - - +--loca - | - glyf--+--maxp - | - +---+--head - | - hmtx------+--hhea - - cmap-----OS/2 - - name-- - - post-- - -There is an important universal dependency which it is up to the user to -keep up to date. This is C which is used to iterate over all -the glyphs. Note that the glyphs themselves are not held in the C table -but in the C table, so adding glyphs, etc. automatically involves keeping -the C table up to date. - -=head2 Creating fonts - -Suppose we were creating a font from scratch. How much information do we need -to supply and how much will C do for us? - -The following information is required: - - $f->{'loca'}{'glyphs'} - $f->{'head'}{'upem'} - $f->{'maxp'}{'numGlyphs'} (doesn't come from $f->{'loca'}{'glyphs'}) - $f->{'hmtx'}{'advance'} - $f->{'post'}['format'} - $f->{'post'}{'VAL'} - $f->{'cmap'} - $f->{'name'} - -Pretty much everything else is calculated for you. Details of what is needed -for a glyph may be found in L. Once we have all the -information we need (and there is lots more that you could add) then we simply - - $f->dirty; # mark all tables dirty - $f->update; # update the font - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Maxp.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Maxp.pm deleted file mode 100644 index e2d81b9..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Maxp.pm +++ /dev/null @@ -1,177 +0,0 @@ -package Font::TTF::Maxp; - -=head1 NAME - -Font::TTF::Maxp - Maximum Profile table in a font - -=head1 DESCRIPTION - -A collection of useful instance variables following the TTF standard. Probably -the most used being C. Note that this particular value is -foundational and should be kept up to date by the application, it is not updated -by C. - -Handles table versions 0.5, 1.0 - -=head1 INSTANCE VARIABLES - -No others beyond those specified in the standard: - - numGlyphs - maxPoints - maxContours - maxCompositePoints - maxCompositeContours - maxZones - maxTwilightPoints - maxStorage - maxFunctionDefs - maxInstructionDefs - maxStackElements - maxSizeOfInstructions - maxComponentElements - maxComponentDepth - - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA %fields @field_info); -use Font::TTF::Utils; - -@ISA = qw(Font::TTF::Table); -@field_info = ( - 'numGlyphs' => 'S', - 'maxPoints' => 'S', - 'maxContours' => 'S', - 'maxCompositePoints' => 'S', - 'maxCompositeContours' => 'S', - 'maxZones' => 'S', - 'maxTwilightPoints' => 'S', - 'maxStorage' => 'S', - 'maxFunctionDefs' => 'S', - 'maxInstructionDefs' => 'S', - 'maxStackElements' => 'S', - 'maxSizeOfInstructions' => 'S', - 'maxComponentElements' => 'S', - 'maxComponentDepth' => 'S'); - -sub init -{ - my ($k, $v, $c, $i); - for ($i = 0; $i < $#field_info; $i += 2) - { - ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); - next unless defined $k && $k ne ""; - $fields{$k} = $v; - } -} - - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self) = @_; - my ($dat); - - $self->SUPER::read or return $self; - - init unless defined $fields{'numGlyphs'}; # any key would do - $self->{' INFILE'}->read($dat, 4); - $self->{'version'} = TTF_Unpack("v", $dat); - - if ($self->{'version'} == 0.5) - { - $self->{' INFILE'}->read($dat, 2); - $self->{'numGlyphs'} = unpack("n", $dat); - } else - { - $self->{' INFILE'}->read($dat, 28); - TTF_Read_Fields($self, $dat, \%fields); - } - $self; -} - - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying. - -=cut - -sub out -{ - my ($self, $fh) = @_; - - return $self->SUPER::out($fh) unless $self->{' read'}; - $fh->print(TTF_Pack("v", $self->{'version'})); - - if ($self->{'version'} == 0.5) - { $fh->print(pack("n", $self->{'numGlyphs'})); } - else - { $fh->print(TTF_Out_Fields($self, \%fields, 28)); } - $self; -} - - -=head2 $t->update - -Calculates all the maximum values for a font based on the glyphs in the font. -Only those fields which require hinting code interpretation are ignored and -left as they were read. - -=cut - -sub update -{ - my ($self) = @_; - my ($i, $num, @n, @m, $j); - my (@name) = qw(maxPoints maxContours maxCompositePoints maxCompositeContours - maxSizeOfInstructions maxComponentElements maxComponentDepth); - - return undef unless ($self->SUPER::update); - return undef if ($self->{'version'} == 0.5); # only got numGlyphs - return undef unless (defined $self->{' PARENT'}{'loca'}); - $self->{' PARENT'}{'loca'}->update; - $num = $self->{'numGlyphs'}; - - for ($i = 0; $i < $num; $i++) - { - my ($g) = $self->{' PARENT'}{'loca'}{'glyphs'}[$i] || next; - - @n = $g->maxInfo; - - for ($j = 0; $j <= $#n; $j++) - { $m[$j] = $n[$j] if $n[$j] > $m[$j]; } - } - - foreach ('prep', 'fpgm') - { $m[4] = length($self->{' PARENT'}{$_}{' dat'}) - if (defined $self->{' PARENT'}{$_} - && length($self->{' PARENT'}{$_}{' dat'}) > $m[4]); - } - - for ($j = 0; $j <= $#name; $j++) - { $self->{$name[$j]} = $m[$j]; } - $self; -} -1; - - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort.pm deleted file mode 100644 index 6e954cb..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort.pm +++ /dev/null @@ -1,108 +0,0 @@ -package Font::TTF::Mort; - -=head1 NAME - -Font::TTF::Mort - Glyph Metamorphosis table in a font - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; -use Font::TTF::Mort::Chain; - -@ISA = qw(Font::TTF::Table); - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self) = @_; - my ($dat, $fh, $numChains); - - $self->SUPER::read or return $self; - - $fh = $self->{' INFILE'}; - - $fh->read($dat, 8); - ($self->{'version'}, $numChains) = TTF_Unpack("vL", $dat); - - my $chains = []; - foreach (1 .. $numChains) { - my $chain = new Font::TTF::Mort::Chain->new; - $chain->read($fh); - $chain->{' PARENT'} = $self; - push @$chains, $chain; - } - - $self->{'chains'} = $chains; - - $self; -} - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying - -=cut - -sub out -{ - my ($self, $fh) = @_; - - return $self->SUPER::out($fh) unless $self->{' read'}; - - my $chains = $self->{'chains'}; - $fh->print(TTF_Pack("vL", $self->{'version'}, scalar @$chains)); - - foreach (@$chains) { - $_->out($fh); - } -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - - $self->read unless $self->{' read'}; - my $feat = $self->{' PARENT'}->{'feat'}; - $feat->read; - my $post = $self->{' PARENT'}->{'post'}; - $post->read; - - $fh = 'STDOUT' unless defined $fh; - - $fh->printf("version %f\n", $self->{'version'}); - - my $chains = $self->{'chains'}; - foreach (@$chains) { - $_->print($fh); - } -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Chain.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Chain.pm deleted file mode 100644 index b8e7b93..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Chain.pm +++ /dev/null @@ -1,196 +0,0 @@ -package Font::TTF::Mort::Chain; - -=head1 NAME - -Font::TTF::Mort::Chain - Chain Mort subtable for AAT - -=cut - -use strict; -use Font::TTF::Utils; -use Font::TTF::AATutils; -use Font::TTF::Mort::Subtable; -use IO::File; - -=head2 $t->new - -=cut - -sub new -{ - my ($class, %parms) = @_; - my ($self) = {}; - my ($p); - - $class = ref($class) || $class; - foreach $p (keys %parms) - { $self->{" $p"} = $parms{$p}; } - bless $self, $class; -} - -=head2 $t->read($fh) - -Reads the chain into memory - -=cut - -sub read -{ - my ($self, $fh) = @_; - my ($dat); - - my $chainStart = $fh->tell(); - $fh->read($dat, 12); - my ($defaultFlags, $chainLength, $nFeatureEntries, $nSubtables) = TTF_Unpack("LLSS", $dat); - - my $featureEntries = []; - foreach (1 .. $nFeatureEntries) { - $fh->read($dat, 12); - my ($featureType, $featureSetting, $enableFlags, $disableFlags) = TTF_Unpack("SSLL", $dat); - push @$featureEntries, { - 'type' => $featureType, - 'setting' => $featureSetting, - 'enable' => $enableFlags, - 'disable' => $disableFlags - }; - } - - my $subtables = []; - foreach (1 .. $nSubtables) { - my $subtableStart = $fh->tell(); - - $fh->read($dat, 8); - my ($length, $coverage, $subFeatureFlags) = TTF_Unpack("SSL", $dat); - my $type = $coverage & 0x0007; - - my $subtable = Font::TTF::Mort::Subtable->create($type, $coverage, $subFeatureFlags, $length); - $subtable->read($fh); - $subtable->{' PARENT'} = $self; - - push @$subtables, $subtable; - $fh->seek($subtableStart + $length, IO::File::SEEK_SET); - } - - $self->{'defaultFlags'} = $defaultFlags; - $self->{'featureEntries'} = $featureEntries; - $self->{'subtables'} = $subtables; - - $fh->seek($chainStart + $chainLength, IO::File::SEEK_SET); - - $self; -} - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying - -=cut - -sub out -{ - my ($self, $fh) = @_; - - my $chainStart = $fh->tell(); - my ($featureEntries, $subtables) = ($_->{'featureEntries'}, $_->{'subtables'}); - $fh->print(TTF_Pack("LLSS", $_->{'defaultFlags'}, 0, scalar @$featureEntries, scalar @$subtables)); # placeholder for length - - foreach (@$featureEntries) { - $fh->print(TTF_Pack("SSLL", $_->{'type'}, $_->{'setting'}, $_->{'enable'}, $_->{'disable'})); - } - - foreach (@$subtables) { - $_->out($fh); - } - - my $chainLength = $fh->tell() - $chainStart; - $fh->seek($chainStart + 4, IO::File::SEEK_SET); - $fh->print(pack("N", $chainLength)); - $fh->seek($chainStart + $chainLength, IO::File::SEEK_SET); -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the chain - -=cut - -sub feat -{ - my ($self) = @_; - - my $feat = $self->{' PARENT'}{' PARENT'}{'feat'}; - if (defined $feat) { - $feat->read; - } - else { - $feat = {}; - } - - return $feat; -} - -sub print -{ - my ($self, $fh) = @_; - - $fh->printf("version %f\n", $self->{'version'}); - - my $defaultFlags = $self->{'defaultFlags'}; - $fh->printf("chain: defaultFlags = %08x\n", $defaultFlags); - - my $feat = $self->feat(); - my $featureEntries = $self->{'featureEntries'}; - foreach (@$featureEntries) { - $fh->printf("\tfeature %d, setting %d : enableFlags = %08x, disableFlags = %08x # '%s: %s'\n", - $_->{'type'}, $_->{'setting'}, $_->{'enable'}, $_->{'disable'}, - $feat->settingName($_->{'type'}, $_->{'setting'})); - } - - my $subtables = $self->{'subtables'}; - foreach (@$subtables) { - my $type = $_->{'type'}; - my $subFeatureFlags = $_->{'subFeatureFlags'}; - $fh->printf("\n\t%s table, %s, %s, subFeatureFlags = %08x # %s (%s)\n", - subtable_type_($type), $_->{'direction'}, $_->{'orientation'}, $subFeatureFlags, - "Default " . ((($subFeatureFlags & $defaultFlags) != 0) ? "On" : "Off"), - join(", ", - map { - join(": ", $feat->settingName($_->{'type'}, $_->{'setting'}) ) - } grep { ($_->{'enable'} & $subFeatureFlags) != 0 } @$featureEntries - ) ); - - $_->print($fh); - } -} - -sub subtable_type_ -{ - my ($val) = @_; - my ($res); - - my @types = ( - 'Rearrangement', - 'Contextual', - 'Ligature', - undef, - 'Non-contextual', - 'Insertion', - ); - $res = $types[$val] or ('Undefined (' . $val . ')'); - - $res; -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Contextual.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Contextual.pm deleted file mode 100644 index fecc519..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Contextual.pm +++ /dev/null @@ -1,157 +0,0 @@ -package Font::TTF::Mort::Contextual; - -=head1 NAME - -Font::TTF::Mort::Contextual - Contextual Mort subtable for AAT - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; -use Font::TTF::Mort::Subtable; -use IO::File; - -@ISA = qw(Font::TTF::AAT::Mort::Subtable); - -sub new -{ - my ($class, $direction, $orientation, $subFeatureFlags) = @_; - my ($self) = { - 'direction' => $direction, - 'orientation' => $orientation, - 'subFeatureFlags' => $subFeatureFlags - }; - - $class = ref($class) || $class; - bless $self, $class; -} - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self, $fh) = @_; - my ($dat); - - my $stateTableStart = $fh->tell(); - my ($classes, $states, $entries) = AAT_read_state_table($fh, 2); - - $fh->seek($stateTableStart, IO::File::SEEK_SET); - $fh->read($dat, 10); - my ($stateSize, $classTable, $stateArray, $entryTable, $mappingTables) = unpack("nnnnn", $dat); - my $limits = [$classTable, $stateArray, $entryTable, $mappingTables, $self->{'length'} - 8]; - - foreach (@$entries) { - my $actions = $_->{'actions'}; - foreach (@$actions) { - $_ = $_ ? $_ - ($mappingTables / 2) : undef; - } - } - - $self->{'classes'} = $classes; - $self->{'states'} = $states; - $self->{'mappings'} = [unpack("n*", AAT_read_subtable($fh, $stateTableStart, $mappingTables, $limits))]; - - $self; -} - -=head2 $t->pack_sub() - -=cut - -sub pack_sub -{ - my ($self) = @_; - - my ($dat) = pack("nnnnn", (0) x 5); # placeholders for stateSize, classTable, stateArray, entryTable, mappingTables - - my $classTable = length($dat); - my $classes = $self->{'classes'}; - $dat .= AAT_pack_classes($classes); - - my $stateArray = length($dat); - my $states = $self->{'states'}; - my ($dat1, $stateSize, $entries) = AAT_pack_states($classes, $stateArray, $states, - sub { - my $actions = $_->{'actions'}; - ( $_->{'flags'}, @$actions ) - } - ); - $dat .= $dat1; - - my $entryTable = length($dat); - my $offset = ($entryTable + 8 * @$entries) / 2; - foreach (@$entries) { - my ($nextState, $flags, @parts) = split /,/; - $dat .= pack("nnnn", $nextState, $flags, map { $_ eq "" ? 0 : $_ + $offset } @parts); - } - - my $mappingTables = length($dat); - my $mappings = $self->{'mappings'}; - $dat .= pack("n*", @$mappings); - - $dat1 = pack("nnnnn", $stateSize, $classTable, $stateArray, $entryTable, $mappingTables); - substr($dat, 0, length($dat1)) = $dat1; - - return $dat; -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - - my $post = $self->post(); - - $fh = 'STDOUT' unless defined $fh; - - $self->print_classes($fh); - - $fh->print("\n"); - my $states = $self->{'states'}; - foreach (0 .. $#$states) { - $fh->printf("\t\tState %d:", $_); - my $state = $states->[$_]; - foreach (@$state) { - my $flags; - $flags .= "!" if ($_->{'flags'} & 0x4000); - $flags .= "*" if ($_->{'flags'} & 0x8000); - my $actions = $_->{'actions'}; - $fh->printf("\t(%s%d,%s,%s)", $flags, $_->{'nextState'}, map { defined $_ ? $_ : "=" } @$actions); - } - $fh->print("\n"); - } - - $fh->print("\n"); - my $mappings = $self->{'mappings'}; - foreach (0 .. $#$mappings) { - $fh->printf("\t\tMapping %d: %d [%s]\n", $_, $mappings->[$_], $post->{'VAL'}[$mappings->[$_]]); - } -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Insertion.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Insertion.pm deleted file mode 100644 index d10018b..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Insertion.pm +++ /dev/null @@ -1,179 +0,0 @@ -package Font::TTF::Mort::Insertion; - -=head1 NAME - -Font::TTF::Mort::Insertion - Insertion Mort subtable for AAT - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; -use IO::File; - -@ISA = qw(Font::TTF::Mort::Subtable); - -sub new -{ - my ($class, $direction, $orientation, $subFeatureFlags) = @_; - my ($self) = { - 'direction' => $direction, - 'orientation' => $orientation, - 'subFeatureFlags' => $subFeatureFlags - }; - - $class = ref($class) || $class; - bless $self, $class; -} - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self, $fh) = @_; - my ($dat); - - my $subtableStart = $fh->tell(); - - my $stateTableStart = $fh->tell(); - my ($classes, $states, $entries) = AAT_read_state_table($fh, 2); - - my %insertListHash; - my $insertLists; - foreach (@$entries) { - my $flags = $_->{'flags'}; - my @insertCount = (($flags & 0x03e0) >> 5, ($flags & 0x001f)); - my $actions = $_->{'actions'}; - foreach (0 .. 1) { - if ($insertCount[$_] > 0) { - $fh->seek($stateTableStart + $actions->[$_], IO::File::SEEK_SET); - $fh->read($dat, $insertCount[$_] * 2); - if (not defined $insertListHash{$dat}) { - push @$insertLists, [unpack("n*", $dat)]; - $insertListHash{$dat} = $#$insertLists; - } - $actions->[$_] = $insertListHash{$dat}; - } - else { - $actions->[$_] = undef; - } - } - } - - $self->{'classes'} = $classes; - $self->{'states'} = $states; - $self->{'insertLists'} = $insertLists; - - $self; -} - -=head2 $t->pack_sub() - -=cut - -sub pack_sub -{ - my ($self) = @_; - - my ($dat) = pack("nnnn", (0) x 4); - - my $classTable = length($dat); - my $classes = $self->{'classes'}; - $dat .= AAT_pack_classes($classes); - - my $stateArray = length($dat); - my $states = $self->{'states'}; - my ($dat1, $stateSize, $entries) = AAT_pack_states($classes, $stateArray, $states, - sub { - my $actions = $_->{'actions'}; - ( $_->{'flags'}, @$actions ) - } - ); - $dat .= $dat1; - - my $entryTable = length($dat); - my $offset = ($entryTable + 8 * @$entries); - my @insListOffsets; - my $insertLists = $self->{'insertLists'}; - foreach (@$insertLists) { - push @insListOffsets, $offset; - $offset += 2 * scalar @$_; - } - foreach (@$entries) { - my ($nextState, $flags, @lists) = split /,/; - $flags &= ~0x03ff; - $flags |= (scalar @{$insertLists->[$lists[0]]}) << 5 if $lists[0] ne ''; - $flags |= (scalar @{$insertLists->[$lists[1]]}) if $lists[1] ne ''; - $dat .= pack("nnnn", $nextState, $flags, - map { $_ eq '' ? 0 : $insListOffsets[$_] } @lists); - } - - foreach (@$insertLists) { - $dat .= pack("n*", @$_); - } - - $dat1 = pack("nnnn", $stateSize, $classTable, $stateArray, $entryTable); - substr($dat, 0, length($dat1)) = $dat1; - - return $dat; -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - - my $post = $self->post(); - - $fh = 'STDOUT' unless defined $fh; - - $self->print_classes($fh); - - $fh->print("\n"); - my $states = $self->{'states'}; - foreach (0 .. $#$states) { - $fh->printf("\t\tState %d:", $_); - my $state = $states->[$_]; - foreach (@$state) { - my $flags; - $flags .= "!" if ($_->{'flags'} & 0x4000); - $flags .= "*" if ($_->{'flags'} & 0x8000); - my $actions = $_->{'actions'}; - $fh->printf("\t(%s%d,%s,%s)", $flags, $_->{'nextState'}, map { defined $_ ? $_ : "=" } @$actions); - } - $fh->print("\n"); - } - - $fh->print("\n"); - my $insertLists = $self->{'insertLists'}; - foreach (0 .. $#$insertLists) { - my $insertList = $insertLists->[$_]; - $fh->printf("\t\tList %d: %s\n", $_, join(", ", map { $_ . " [" . $post->{'VAL'}[$_] . "]" } @$insertList)); - } -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Ligature.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Ligature.pm deleted file mode 100644 index c5cc912..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Ligature.pm +++ /dev/null @@ -1,246 +0,0 @@ -package Font::TTF::Mort::Ligature; - -=head1 NAME - -Font::TTF::Mort::Ligature - Ligature Mort subtable for AAT - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; -use IO::File; - -@ISA = qw(Font::TTF::Mort::Subtable); - -sub new -{ - my ($class, $direction, $orientation, $subFeatureFlags) = @_; - my ($self) = { - 'direction' => $direction, - 'orientation' => $orientation, - 'subFeatureFlags' => $subFeatureFlags - }; - - $class = ref($class) || $class; - bless $self, $class; -} - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self, $fh) = @_; - my ($dat); - - my $stateTableStart = $fh->tell(); - my ($classes, $states, $entries) = AAT_read_state_table($fh, 0); - - $fh->seek($stateTableStart, IO::File::SEEK_SET); - $fh->read($dat, 14); - my ($stateSize, $classTable, $stateArray, $entryTable, - $ligActionTable, $componentTable, $ligatureTable) = unpack("nnnnnnn", $dat); - my $limits = [$classTable, $stateArray, $entryTable, $ligActionTable, $componentTable, $ligatureTable, $self->{'length'} - 8]; - - my %actions; - my $actionLists; - foreach (@$entries) { - my $offset = $_->{'flags'} & 0x3fff; - $_->{'flags'} &= ~0x3fff; - if ($offset != 0) { - if (not defined $actions{$offset}) { - $fh->seek($stateTableStart + $offset, IO::File::SEEK_SET); - my $actionList; - while (1) { - $fh->read($dat, 4); - my $action = unpack("N", $dat); - my ($last, $store, $component) = (($action & 0x80000000) != 0, ($action & 0xC0000000) != 0, ($action & 0x3fffffff)); - $component -= 0x40000000 if $component > 0x1fffffff; - $component -= $componentTable / 2; - push @$actionList, { 'store' => $store, 'component' => $component }; - last if $last; - } - push @$actionLists, $actionList; - $actions{$offset} = $#$actionLists; - } - $_->{'actions'} = $actions{$offset}; - } - } - - $self->{'componentTable'} = $componentTable; - my $components = [unpack("n*", AAT_read_subtable($fh, $stateTableStart, $componentTable, $limits))]; - foreach (@$components) { - $_ = ($_ - $ligatureTable) . " +" if $_ >= $ligatureTable; - } - $self->{'components'} = $components; - - $self->{'ligatureTable'} = $ligatureTable; - $self->{'ligatures'} = [unpack("n*", AAT_read_subtable($fh, $stateTableStart, $ligatureTable, $limits))]; - - $self->{'classes'} = $classes; - $self->{'states'} = $states; - $self->{'actionLists'} = $actionLists; - - $self; -} - -=head2 $t->pack_sub($fh) - -=cut - -sub pack_sub -{ - my ($self) = @_; - my ($dat); - - $dat .= pack("nnnnnnn", (0) x 7); # placeholders for stateSize, classTable, stateArray, entryTable, actionLists, components, ligatures - - my $classTable = length($dat); - my $classes = $self->{'classes'}; - $dat .= AAT_pack_classes($classes); - - my $stateArray = length($dat); - my $states = $self->{'states'}; - - my ($dat1, $stateSize, $entries) = AAT_pack_states($classes, $stateArray, $states, - sub { - ( $_->{'flags'} & 0xc000, $_->{'actions'} ) - } - ); - $dat .= $dat1; - - my $actionLists = $self->{'actionLists'}; - my %actionListOffset; - my $actionListDataLength = 0; - my @actionListEntries; - foreach (0 .. $#$entries) { - my ($nextState, $flags, $offset) = split(/,/, $entries->[$_]); - if ($offset eq "") { - $offset = undef; - } - else { - if (defined $actionListOffset{$offset}) { - $offset = $actionListOffset{$offset}; - } - else { - $actionListOffset{$offset} = $actionListDataLength; - my $list = $actionLists->[$offset]; - $actionListDataLength += 4 * @$list; - push @actionListEntries, $list; - $offset = $actionListOffset{$offset}; - } - } - $entries->[$_] = [ $nextState, $flags, $offset ]; - } - my $entryTable = length($dat); - my $ligActionLists = ($entryTable + @$entries * 4 + 3) & ~3; - foreach (@$entries) { - $_->[2] += $ligActionLists if defined $_->[2]; - $dat .= pack("nn", $_->[0], $_->[1] + $_->[2]); - } - $dat .= pack("C*", (0) x ($ligActionLists - $entryTable - @$entries * 4)); - - die "internal error" unless length($dat) == $ligActionLists; - - my $componentTable = length($dat) + $actionListDataLength; - my $actionList; - foreach $actionList (@actionListEntries) { - foreach (0 .. $#$actionList) { - my $action = $actionList->[$_]; - my $val = $action->{'component'} + $componentTable / 2; - $val += 0x40000000 if $val < 0; - $val &= 0x3fffffff; - $val |= 0x40000000 if $action->{'store'}; - $val |= 0x80000000 if $_ == $#$actionList; - $dat .= pack("N", $val); - } - } - - die "internal error" unless length($dat) == $componentTable; - - my $components = $self->{'components'}; - my $ligatureTable = $componentTable + @$components * 2; - $dat .= pack("n*", map { (index($_, '+') >= 0 ? $ligatureTable : 0) + $_ } @$components); - - my $ligatures = $self->{'ligatures'}; - $dat .= pack("n*", @$ligatures); - - $dat1 = pack("nnnnnnn", $stateSize, $classTable, $stateArray, $entryTable, $ligActionLists, $componentTable, $ligatureTable); - substr($dat, 0, length($dat1)) = $dat1; - - return $dat; -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - - my $post = $self->post(); - - $fh = 'STDOUT' unless defined $fh; - - $self->print_classes($fh); - - $fh->print("\n"); - my $states = $self->{'states'}; - foreach (0 .. $#$states) { - $fh->printf("\t\tState %d:", $_); - my $state = $states->[$_]; - foreach (@$state) { - my $flags; - $flags .= "!" if ($_->{'flags'} & 0x4000); - $flags .= "*" if ($_->{'flags'} & 0x8000); - $fh->printf("\t(%s%d,%s)", $flags, $_->{'nextState'}, defined $_->{'actions'} ? $_->{'actions'} : "="); - } - $fh->print("\n"); - } - - $fh->print("\n"); - my $actionLists = $self->{'actionLists'}; - foreach (0 .. $#$actionLists) { - $fh->printf("\t\tList %d:\t", $_); - my $actionList = $actionLists->[$_]; - $fh->printf("%s\n", join(", ", map { ($_->{'component'} . ($_->{'store'} ? "*" : "") ) } @$actionList)); - } - - my $ligatureTable = $self->{'ligatureTable'}; - - $fh->print("\n"); - my $components = $self->{'components'}; - foreach (0 .. $#$components) { - $fh->printf("\t\tComponent %d: %s\n", $_, $components->[$_]); - } - - $fh->print("\n"); - my $ligatures = $self->{'ligatures'}; - foreach (0 .. $#$ligatures) { - $fh->printf("\t\tLigature %d: %d [%s]\n", $_, $ligatures->[$_], $post->{'VAL'}[$ligatures->[$_]]); - } -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Noncontextual.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Noncontextual.pm deleted file mode 100644 index 730982a..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Noncontextual.pm +++ /dev/null @@ -1,95 +0,0 @@ -package Font::TTF::Mort::Noncontextual; - -=head1 NAME - -Font::TTF::Mort::Noncontextual - Noncontextual Mort subtable for AAT - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; - -@ISA = qw(Font::TTF::Mort::Subtable); - -sub new -{ - my ($class, $direction, $orientation, $subFeatureFlags) = @_; - my ($self) = { - 'direction' => $direction, - 'orientation' => $orientation, - 'subFeatureFlags' => $subFeatureFlags - }; - - $class = ref($class) || $class; - bless $self, $class; -} - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self, $fh) = @_; - my ($dat); - - my ($format, $lookup) = AAT_read_lookup($fh, 2, $self->{'length'} - 8, undef); - $self->{'format'} = $format; - $self->{'lookup'} = $lookup; - - $self; -} - -=head2 $t->pack_sub($fh) - -=cut - -sub pack_sub -{ - my ($self) = @_; - - return AAT_pack_lookup($self->{'format'}, $self->{'lookup'}, 2, undef); -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - - my $post = $self->post(); - - $fh = 'STDOUT' unless defined $fh; - - my $lookup = $self->{'lookup'}; - $fh->printf("\t\tLookup format %d\n", $self->{'format'}); - if (defined $lookup) { - foreach (sort { $a <=> $b } keys %$lookup) { - $fh->printf("\t\t\t%d [%s] -> %d [%s])\n", $_, $post->{'VAL'}[$_], $lookup->{$_}, $post->{'VAL'}[$lookup->{$_}]); - } - } -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Rearrangement.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Rearrangement.pm deleted file mode 100644 index 126144f..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Rearrangement.pm +++ /dev/null @@ -1,107 +0,0 @@ -package Font::TTF::Mort::Rearrangement; - -=head1 NAME - -Font::TTF::Mort::Rearrangement - Rearrangement Mort subtable for AAT - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; - -@ISA = qw(Font::TTF::Mort::Subtable); - -sub new -{ - my ($class, $direction, $orientation, $subFeatureFlags) = @_; - my ($self) = { - 'direction' => $direction, - 'orientation' => $orientation, - 'subFeatureFlags' => $subFeatureFlags - }; - - $class = ref($class) || $class; - bless $self, $class; -} - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self, $fh) = @_; - - my ($classes, $states) = AAT_read_state_table($fh, 0); - $self->{'classes'} = $classes; - $self->{'states'} = $states; - - $self; -} - -=head2 $t->pack_sub() - -=cut - -sub pack_sub -{ - my ($self) = @_; - - return AAT_pack_state_table($self->{'classes'}, $self->{'states'}, 0); -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - - my $post = $self->post(); - - $fh = 'STDOUT' unless defined $fh; - - $self->print_classes($fh); - - $fh->print("\n"); - my $states = $self->{'states'}; - my @verbs = ( "0", "Ax->xA", "xD->Dx", "AxD->DxA", - "ABx->xAB", "ABx->xBA", "xCD->CDx", "xCD->DCx", - "AxCD->CDxA", "AxCD->DCxA", "ABxD->DxAB", "ABxD->DxBA", - "ABxCD->CDxAB", "ABxCD->CDxBA", "ABxCD->DCxAB", "ABxCD->DCxBA"); - foreach (0 .. $#$states) { - $fh->printf("\t\tState %d:", $_); - my $state = $states->[$_]; - foreach (@$state) { - my $flags; - $flags .= "!" if ($_->{'flags'} & 0x4000); - $flags .= "<" if ($_->{'flags'} & 0x8000); - $flags .= ">" if ($_->{'flags'} & 0x2000); - $fh->printf("\t(%s%d,%s)", $flags, $_->{'nextState'}, $verbs[($_->{'flags'} & 0x000f)]); - } - $fh->print("\n"); - } -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Subtable.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Subtable.pm deleted file mode 100644 index 4dd26e0..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Subtable.pm +++ /dev/null @@ -1,200 +0,0 @@ -package Font::TTF::Mort::Subtable; - -=head1 NAME - -Font::TTF::Mort::Subtable - Mort subtable superclass for AAT - -=head1 METHODS - -=cut - -use strict; -use Font::TTF::Utils; -use Font::TTF::AATutils; -use IO::File; - -require Font::TTF::Mort::Rearrangement; -require Font::TTF::Mort::Contextual; -require Font::TTF::Mort::Ligature; -require Font::TTF::Mort::Noncontextual; -require Font::TTF::Mort::Insertion; - -sub new -{ - my ($class) = @_; - my ($self) = {}; - - $class = ref($class) || $class; - - bless $self, $class; -} - -sub create -{ - my ($class, $type, $coverage, $subFeatureFlags, $length) = @_; - - $class = ref($class) || $class; - - my $subclass; - if ($type == 0) { - $subclass = 'Font::TTF::Mort::Rearrangement'; - } - elsif ($type == 1) { - $subclass = 'Font::TTF::Mort::Contextual'; - } - elsif ($type == 2) { - $subclass = 'Font::TTF::Mort::Ligature'; - } - elsif ($type == 4) { - $subclass = 'Font::TTF::Mort::Noncontextual'; - } - elsif ($type == 5) { - $subclass = 'Font::TTF::Mort::Insertion'; - } - - my ($self) = $subclass->new( - (($coverage & 0x4000) ? 'RL' : 'LR'), - (($coverage & 0x2000) ? 'VH' : ($coverage & 0x8000) ? 'V' : 'H'), - $subFeatureFlags - ); - - $self->{'type'} = $type; - $self->{'length'} = $length; - - $self; -} - -=head2 $t->out($fh) - -Writes the table to a file - -=cut - -sub out -{ - my ($self, $fh) = @_; - - my ($subtableStart) = $fh->tell(); - my ($type) = $self->{'type'}; - my ($coverage) = $type; - $coverage += 0x4000 if $self->{'direction'} eq 'RL'; - $coverage += 0x2000 if $self->{'orientation'} eq 'VH'; - $coverage += 0x8000 if $self->{'orientation'} eq 'V'; - - $fh->print(TTF_Pack("SSL", 0, $coverage, $self->{'subFeatureFlags'})); # placeholder for length - - my ($dat) = $self->pack_sub(); - $fh->print($dat); - - my ($length) = $fh->tell() - $subtableStart; - my ($padBytes) = (4 - ($length & 3)) & 3; - $fh->print(pack("C*", (0) x $padBytes)); - $length += $padBytes; - $fh->seek($subtableStart, IO::File::SEEK_SET); - $fh->print(pack("n", $length)); - $fh->seek($subtableStart + $length, IO::File::SEEK_SET); -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub post -{ - my ($self) = @_; - - my ($post) = $self->{' PARENT'}{' PARENT'}{' PARENT'}{'post'}; - if (defined $post) { - $post->read; - } - else { - $post = {}; - } - - return $post; -} - -sub feat -{ - my ($self) = @_; - - return $self->{' PARENT'}->feat(); -} - -sub print -{ - my ($self, $fh) = @_; - - my ($feat) = $self->feat(); - my ($post) = $self->post(); - - $fh = 'STDOUT' unless defined $fh; - - my ($type) = $self->{'type'}; - my ($subFeatureFlags) = $self->{'subFeatureFlags'}; - my ($defaultFlags) = $self->{' PARENT'}{'defaultFlags'}; - my ($featureEntries) = $self->{' PARENT'}{'featureEntries'}; - $fh->printf("\n\t%s table, %s, %s, subFeatureFlags = %08x # %s (%s)\n", - subtable_type_($type), $_->{'direction'}, $_->{'orientation'}, $subFeatureFlags, - "Default " . ((($subFeatureFlags & $defaultFlags) != 0) ? "On" : "Off"), - join(", ", - map { - join(": ", $feat->settingName($_->{'type'}, $_->{'setting'}) ) - } grep { ($_->{'enable'} & $subFeatureFlags) != 0 } @$featureEntries - ) ); -} - -sub subtable_type_ -{ - my ($val) = @_; - my ($res); - - my (@types) = ( - 'Rearrangement', - 'Contextual', - 'Ligature', - undef, - 'Non-contextual', - 'Insertion', - ); - $res = $types[$val] or ('Undefined (' . $val . ')'); - - $res; -} - -=head2 $t->print_classes($fh) - -Prints a human-readable representation of the table - -=cut - -sub print_classes -{ - my ($self, $fh) = @_; - - my ($post) = $self->post(); - - my ($classes) = $self->{'classes'}; - foreach (0 .. $#$classes) { - my $class = $classes->[$_]; - if (defined $class) { - $fh->printf("\t\tClass %d:\t%s\n", $_, join(", ", map { $_ . " [" . $post->{'VAL'}[$_] . "]" } @$class)); - } - } -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Name.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Name.pm deleted file mode 100644 index 144e926..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Name.pm +++ /dev/null @@ -1,782 +0,0 @@ -package Font::TTF::Name; - -=head1 NAME - -Font::TTF::Name - String table for a TTF font - -=head1 DESCRIPTION - -Strings are held by number, platform, encoding and language. Strings are -accessed as: - - $f->{'name'}{'strings'}[$number][$platform_id][$encoding_id]{$language_id} - -Notice that the language is held in an associative array due to its sparse -nature on some platforms such as Microsoft ($pid = 3). Notice also that the -array order is different from the stored array order (platform, encoding, -language, number) to allow for easy manipulation of strings by number (which is -what I guess most people will want to do). - -By default, C<$Font::TTF::Name::utf8> is set to 1, and strings will be stored as UTF8 wherever -possible. The method C can be used to find out if a string in a particular -platform and encoding will be returned as UTF8. Unicode strings are always -converted if utf8 is requested. Otherwise, strings are stored according to platform: - -You now have to set <$Font::TTF::Name::utf8> to 0 to get the old behaviour. - -=over 4 - -=item Apple Unicode (platform id = 0) - -Data is stored as network ordered UCS2. There is no encoding id for this platform -but there are language ids as per Mac language ids. - -=item Mac (platform id = 1) - -Data is stored as 8-bit binary data, leaving the interpretation to the user -according to encoding id. - -=item Unicode (platform id = 2) - -Currently stored as 16-bit network ordered UCS2. Upon release of Perl 5.005 this -will change to utf8 assuming current UCS2 semantics for all encoding ids. - -=item Windows (platform id = 3) - -As per Unicode, the data is currently stored as 16-bit network ordered UCS2. Upon -release of Perl 5.005 this will change to utf8 assuming current UCS2 semantics for -all encoding ids. - -=back - -=head1 INSTANCE VARIABLES - -=over 4 - -=item strings - -An array of arrays, etc. - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA $VERSION @apple_encs @apple_encodings $utf8 $cp_1252 @cp_1252 %win_langs %langs_win %langs_mac @ms_langids @mac_langs); -use Font::TTF::Table; -use Font::TTF::Utils; -@ISA = qw(Font::TTF::Table); - -$utf8 = 1; - -{ - my ($count, $i); - eval {require Compress::Zlib;}; - unless ($@) - { - for ($i = 0; $i <= $#apple_encs; $i++) - { - $apple_encodings[0][$i] = [unpack("n*", Compress::Zlib::uncompress(unpack("u", $apple_encs[$i])))] - if (defined $apple_encs[$i]); - foreach (0 .. 127) - { $apple_encodings[0][$i][$_] = $_; } - $count = 0; - $apple_encodings[1][$i] = {map {$_ => $count++} @{$apple_encodings[0][$i]}}; - } - $cp_1252[0] = [unpack("n*", Compress::Zlib::uncompress(unpack("u", $cp_1252)))]; - $count = 0; - $cp_1252[1] = {map({$_ => $count++} @{$cp_1252[0]})}; - } - for ($i = 0; $i < $#ms_langids; $i++) - { - if (defined $ms_langids[$i][1]) - { - my ($j); - for ($j = 0; $j < $#{$ms_langids[$i][1]}; $j++) - { - my ($v) = $ms_langids[$i][1][$j]; - if ($v =~ m/^-/o) - { $win_langs{(($j + 1) << 10) + $i} = $ms_langids[$i][0] . $v; } - else - { $win_langs{(($j + 1) << 10) + $i} = $v; } - } - } - else - { $win_langs{$i + 0x400} = $ms_langids[$i][0]; } - } - %langs_win = map {my ($t) = $win_langs{$_}; my (@res) = ($t => $_); push (@res, $t => $_) if ($t =~ s/-.*$//o && ($_ & 0xFC00) == 0x400); @res} keys %win_langs; - $i = 0; - %langs_mac = map {$_ => $i++} @mac_langs; -} - - -$VERSION = 1.1; # MJPH 17-JUN-2000 Add utf8 support -# $VERSION = 1.001; # MJPH 10-AUG-1998 Put $number first in list - -=head2 $t->read - -Reads all the names into memory - -=cut - -sub read -{ - my ($self) = @_; - my ($fh) = $self->{' INFILE'}; - my ($dat, $num, $stroff, $i, $pid, $eid, $lid, $nid, $len, $off, $here); - - $self->SUPER::read or return $self; - $fh->read($dat, 6); - ($num, $stroff) = unpack("x2nn", $dat); - for ($i = 0; $i < $num; $i++) - { - use bytes; # hack to fix bugs in 5.8.7 - read($fh, $dat, 12); - ($pid, $eid, $lid, $nid, $len, $off) = unpack("n6", $dat); - $here = $fh->tell(); - $fh->seek($self->{' OFFSET'} + $stroff + $off, 0); - $fh->read($dat, $len); - if ($utf8) - { - if ($pid == 1 && defined $apple_encodings[0][$eid]) - { $dat = TTF_word_utf8(pack("n*", map({$apple_encodings[0][$eid][$_]} unpack("C*", $dat)))); } - elsif ($pid == 2 && $eid == 2 && @cp_1252) - { $dat = TTF_word_utf8(pack("n*", map({$cp_1252[0][$_]} unpack("C*", $dat)))); } - elsif ($pid == 0 || $pid == 3 || ($pid == 2 && $eid == 1)) - { $dat = TTF_word_utf8($dat); } - } - $self->{'strings'}[$nid][$pid][$eid]{$lid} = $dat; - $fh->seek($here, 0); - } - $self; -} - - -=head2 $t->out($fh) - -Writes out all the strings - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($pid, $eid, $lid, $nid, $todo, @todo); - my ($len, $offset, $loc, $stroff, $endloc, $str_trans); - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $loc = $fh->tell(); - $fh->print(pack("n3", 0, 0, 0)); - foreach $nid (0 .. $#{$self->{'strings'}}) - { - foreach $pid (0 .. $#{$self->{'strings'}[$nid]}) - { - foreach $eid (0 .. $#{$self->{'strings'}[$nid][$pid]}) - { - foreach $lid (sort keys %{$self->{'strings'}[$nid][$pid][$eid]}) - { - $str_trans = $self->{'strings'}[$nid][$pid][$eid]{$lid}; - if ($utf8) - { - if ($pid == 1 && defined $apple_encodings[1][$eid]) - { $str_trans = pack("C*", - map({$apple_encodings[1][$eid]{$_} || 0x3F} unpack("n*", - TTF_utf8_word($str_trans)))); } - elsif ($pid == 2 && $eid == 2 && @cp_1252) - { $str_trans = pack("C*", - map({$cp_1252[1][$eid]{$_} || 0x3F} unpack("n*", - TTF_utf8_word($str_trans)))); } - elsif ($pid == 2 && $eid == 0) - { $str_trans =~ s/[\xc0-\xff][\x80-\xbf]+/?/og; } - elsif ($pid == 0 || $pid == 3 || ($pid == 2 && $eid == 1)) - { $str_trans = TTF_utf8_word($str_trans); } - } - push (@todo, [$pid, $eid, $lid, $nid, $str_trans]); - } - } - } - } - - $offset = 0; - @todo = (sort {$a->[0] <=> $b->[0] || $a->[1] <=> $b->[1] || $a->[2] <=> $b->[2] - || $a->[3] <=> $b->[3]} @todo); - foreach $todo (@todo) - { - $len = length($todo->[4]); - $fh->print(pack("n6", @{$todo}[0..3], $len, $offset)); - $offset += $len; - } - - $stroff = $fh->tell() - $loc; - foreach $todo (@todo) - { $fh->print($todo->[4]); } - - $endloc = $fh->tell(); - $fh->seek($loc, 0); - $fh->print(pack("n3", 0, $#todo + 1, $stroff)); - $fh->seek($endloc, 0); - $self; -} - - -=head2 $t->XML_element($context, $depth, $key, $value) - -Outputs the string element in nice XML (which is all the table really!) - -=cut - -sub XML_element -{ - my ($self) = shift; - my ($context, $depth, $key, $value) = @_; - my ($fh) = $context->{'fh'}; - my ($nid, $pid, $eid, $lid); - - return $self->SUPER::XML_element(@_) unless ($key eq 'strings'); - - foreach $nid (0 .. $#{$self->{'strings'}}) - { - next unless ref($self->{'strings'}[$nid]); -# $fh->print("$depth\n"); - foreach $pid (0 .. $#{$self->{'strings'}[$nid]}) - { - foreach $eid (0 .. $#{$self->{'strings'}[$nid][$pid]}) - { - foreach $lid (sort {$a <=> $b} keys %{$self->{'strings'}[$nid][$pid][$eid]}) - { - my ($lang) = $self->get_lang($pid, $lid) || $lid; - $fh->printf("%s\n%s%s%s\n%s\n", - $depth, $nid, $pid, $eid, $lang, $depth, - $context->{'indent'}, $self->{'strings'}[$nid][$pid][$eid]{$lid}, $depth); - } - } - } -# $fh->print("$depth\n"); - } - $self; -} - - -=head2 $t->XML_end($context, $tag, %attrs) - -Store strings in the right place - -=cut - -sub XML_end -{ - my ($self) = shift; - my ($context, $tag, %attrs) = @_; - - if ($tag eq 'string') - { - my ($lid) = $self->find_name($attrs{'platform'}, $attrs{'language'}) || $attrs{'language'}; - $self->{'strings'}[$attrs{'id'}][$attrs{'platform'}][$attrs{'encoding'}]{$lid} - = $context->{'text'}; - return $context; - } - else - { return $self->SUPER::XML_end(@_); } -} - -=head2 is_utf8($pid, $eid) - -Returns whether a string of a given platform and encoding is going to be in UTF8 - -=cut - -sub is_utf8 -{ - my ($self, $pid, $eid) = @_; - - return ($utf8 && ($pid == 0 || $pid == 3 || ($pid == 2 && ($eid != 2 || @cp_1252)) - || ($pid == 1 && defined $apple_encodings[$eid]))); -} - - -=head2 find_name($nid) - -Hunts down a name in all the standard places and returns the string and for an -array context the pid, eid & lid as well - -=cut - -sub find_name -{ - my ($self, $nid) = @_; - my ($res, $pid, $eid, $lid, $look, $k); - - my (@lookup) = ([3, 1, 1033], [3, 1, -1], [3, 0, 1033], [3, 0, -1], [2, 1, -1], [2, 2, -1], [2, 0, -1], - [0, 0, 0], [1, 0, 0]); - foreach $look (@lookup) - { - ($pid, $eid, $lid) = @$look; - if ($lid == -1) - { - foreach $k (keys %{$self->{'strings'}[$nid][$pid][$eid]}) - { - if (($res = $self->{strings}[$nid][$pid][$eid]{$k}) ne '') - { - $lid = $k; - last; - } - } - } else - { $res = $self->{strings}[$nid][$pid][$eid]{$lid} } - if ($res ne '') - { return wantarray ? ($res, $pid, $eid, $lid) : $res; } - } - return ''; -} - - -=head2 set_name($nid, $str[, $lang[, @cover]]) - -Sets the given name id string to $str for all platforms and encodings that -this module can handle. If $lang is set, it is interpretted as a language -tag and if the particular language of a string is found to match, then -that string is changed, otherwise no change occurs. - -If supplied, @cover should be a list of references to two-element arrays -containing pid,eid pairs that should added to the name table if not already present. - -This function does not add any names to the table unless @cover is supplied. - -=cut - -sub set_name -{ - my ($self, $nid, $str, $lang, @cover) = @_; - my ($pid, $eid, $lid, $c); - - foreach $pid (0 .. $#{$self->{'strings'}[$nid]}) - { - my $strNL = $str; - $strNL =~ s/\n/\r\n/og if $pid == 3; - $strNL =~ s/\n/\r/og if $pid == 1; - foreach $eid (0 .. $#{$self->{'strings'}[$nid][$pid]}) - { - foreach $lid (keys %{$self->{'strings'}[$nid][$pid][$eid]}) - { - next unless (!defined $lang || $self->match_lang($pid, $lid, $lang)); - $self->{'strings'}[$nid][$pid][$eid]{$lid} = $strNL; - foreach $c (0 .. scalar @cover) - { - next unless ($cover[$c][0] == $pid && $cover[$c][1] == $eid); - delete $cover[$c]; - last; - } - } - } - } - foreach $c (@cover) - { - my ($pid, $eid) = @{$c}; - my ($lid) = $self->find_lang($pid, $lang); - my $strNL = $str; - $strNL =~ s/\n/\r\n/og if $pid == 3; - $strNL =~ s/\n/\r/og if $pid == 1; - $self->{'strings'}[$nid][$pid][$eid]{$lid} = $strNL; - } - return $self; -} - -=head2 Font::TTF::Name->match_lang($pid, $lid, $lang) - -Compares the language associated to the string of given platform and language -with the given language tag. If the language matches the tag (i.e. is equal -or more defined than the given language tag) returns true. This is calculated -by finding whether the associated language tag starts with the given language -tag. - -=cut - -sub match_lang -{ - my ($self, $pid, $lid, $lang) = @_; - my ($langid) = $self->get_lang($pid, $lid); - - return ($lid == $lang) if ($lang != 0 || $lang eq '0'); - return !index(lc($langid), lc($lang)); -} - -=head2 Font::TTF::Name->get_lang($pid, $lid) - -Returns the language tag associated with a particular platform and language id - -=cut - -sub get_lang -{ - my ($self, $pid, $lid) = @_; - - if ($pid == 3) - { return $win_langs{$lid}; } - elsif ($pid == 1) - { return $mac_langs[$lid]; } - return ''; -} - - -=head2 Font::TTF::Name->find_lang($pid, $lang) - -Looks up the language name and returns a lang id if one exists - -=cut - -sub find_lang -{ - my ($self, $pid, $lang) = @_; - - if ($pid == 3) - { return $langs_win{$lang}; } - elsif ($pid == 1) - { return $langs_mac{$lang}; } - return undef; -} - - -BEGIN { -@apple_encs = ( -<<'EOT', -M>)RES==NCW$`@.'G_S5Q*L(!#?+K1VO4:.W6IJA-:\^BM?>L>1&NP(A0Q$BL -M<*!62ZV8Z1)[K]BE$MR#O,=/7OW]7T&*6"NMI4K31EOMM)>N@XXZZ2Q#IBZZ -MZJ:['GKJ)4NVWOKHJ]\_/\!`@PR68XBAALDUW`@CC3+:&&.-,UZ>?!-,-,ED -M4TPUS70SS#3+;`7FF&N>0D7F6V"A119;8JEEEEMAI5566V.M==;;H-A&FVRV -MQ5;;_OTONJ3<%;?<5^NQ1YYXYJGG7GKME3?>>N^=#S[ZY(O/OOKNFU]^JO<[ -M!$?LLMO>$#OAH4-*4F+'[(L+E*F,6SH:%\9%]C@>1W&CN&%2:9QNO]-))5ZH -M<]9.!^/DQ/8X-V[@@#,AS0ZE+KB7R$ODA\:A26@>6H2FH9D?J17^)(I#3C@8 -MLD)V?:(^"BE.AN30,F0XK\(Y5UUVW0TW77/'W;H_;JM6HRJ1&95%M0Y'E5%5 -.5.U4]""JB`?E$` -EOT - -undef, -undef, -undef, -<<'EOT', -M>)RES[=/%```1O$WO8G_@$'J';W70Z2WHS>5WJN%8D6%D;BZ,3*P,;#C2D(8 -M,9&)08V)+4*(1((X2'(#[.:;7[[\*./_%D,L<<230"(!@B213`JII)%.!IED -MD4T.N>213P&%%%%,B!)N4LJMR[Z<"BJIHIH::JFCG@;"--)$,RVTTD8['732 -M13>WN<-=>NBECWX&&&2(848898QQ)IADBFEFF.4>]WG`0^:89X%%'O&8)SSE -M&<]9X@4O><4R*Y?_.ZRSRQ[[''#(1S[PB<]NL\D7OO&5[_S@9TR`(XXYX1=O -M.>4W9_SAG`O^7OF=O>XW*N)WV!%''7/<"2>=S?<\K5O(G[7?/Y>'``` -EOT - -<<'EOT', -M>)RED$LSEW$`A9_-^00L,H-^(=>4Y%^2J'1Q*Y+[I2(BHA`B?!%J6EM1*28S -M;9II[/PI*7*_%TUN\_*VZ%W:FN9LSYEGGD,\_Q?#$?SP)X"C!!)$,"&$$L8Q -MPCG."2(X222GB,+%:XR"42N,P5KG*-1))()H54KG.# -M--*Y20:WR"2+;'+()8]\"BBDB-O$PM -M==3SA`8::>(IS;3PC%;::'?X'^W#?&(0-Z-,,,,TL\PSQP)+K+#,*C]9XQ?K -M_.8/FVRPQ0[;[+&+S=_]_J;KX/Y6I?&U.JQ.Z[GU0@-VBNTR@;Q4G]ZI5V_U -MQG@83^-M?,PAXV6'VF'ZH&Z]4H_>J]]IO=:0W!K6B#[KBT;U56/ZIN\:UX1^ -?:%)3FM:,9C6G>2UH44M:UHI6'?)RES5=OSG$`0.$CYR.(A(3DUS]J4WOO59O6;&F+UMY[7R&(V'N^4ETZ=*"J -M:M:H=>E*0D1B)7HC1KC0[R#G^LEA,/]7((Z(EK2B-?&TH2WM:$\'.M*)SG0A -M@:YTHSL]Z$DO>M.'OO2C/P,8R*`&/X2A#&,X(QC)*$:3R!C&,H[Q3&`BDYC, -M%))(9BK3F,X,9C*+%%*9S1S22">#NN(MWO.>#.\GG(Y_YQ!>^DAT7 -M\8WZ$%$3$OC.#W(IYC=_^!N"1SWF*<]ZP1AO*:'`;*^0%V502J6'*8LRHRQR -M/.)Q3WC2TY[QG+D6FF^!19ZGR(M>BA*]3"'5(9Z8.>:YVSV-DD/CT"0T#RU" -MT]",G^YUG_L]8+$E7O6%!WUIF>4^]9K7?6R%E59YQUM6>]L:[WK/5][WH;7> -4M,X'/O&1-WSF_\` -EOT - -<<'EOT', -M>)RERT=.%5``0-&+7K'&!B(@X/L/^/3>ZZ?SZ=*K@`KVWOL:U!68.#!&8G2@ -M$Q?F5/=@SOB0XO\$$D2**:&4)&644T$E55130RUUU--`(TTTTT(K;;3302== -M=--#[[_?1S\###+$,".,DF:,<2:89(II9KC`+'/,L\`B2RRSPBIKK+/!13;9 -M8IM+7.8*.^QRE6M]SG`0]YQ&.>\)1G/.<%+WG%:][PEI0G -M/>5IL\SVC#F>-=<\\SUG@846>=Y@PFBQ)9::M,QR*ZRTRFIKK+4N!+[[CD]\ -M#I%?9O*-+XGH/N?BMON=CT7\B#MQUR5^^MY#ZH('7?:PJQYQS14/L!?S,S[$ -M=,SD*[]#DH\>==UC;K@8LD)V*`B%(3?D\2<4>=Q-3[B5R#'#66>LM\%&FVRV -GQ5;;;+?#3KOLML=>4_;9[X"##CGLB*.F'7/<"2>=)RED-DVUG$`1;=:U*Y%0C)5O^^/SSS/F>>9#"$JE7D>"D6\3S=>Q^MPU^JF -M&^M"2JJHIH9:ZJBG@4:::*:%M[32 -M1CL==_TNNNFAES[Z&6"0(889890QQIE@DG=,,% -MF;XTRVQSS#7/5[[VC<&8D?D66&C<(HLML=0RRZVPTBJ7K;;&6NNLM\%&FVRV -L):388:===MMCKP,..F2_(XXZYK#CMKGZS[YU-]QTRVUWW'7/?0]N`4(?0WT` -EOT - -<<'EOT', -M>)RED,5.0U$415=(D.X!$"ANMX^VN+M#D>+N[H4"Q5W^APF_PZ\PY.9-"`-& -MY.3LG>-"#_\3@P^'8OP$"%)"*6644T$E55130RUUU--`(TTTTT(K;;3302== -M=-OZ7OH(T<\`@PP19I@11AECG`DFF6*:&6:98YX%%EEBF15666.=#3;98IL= -M=MECGP,.B7#$,5%...6,&.=<<,D5U]QPRQWW//#($\^\\,J;G?_II)ETXS79 -M)L<$C<,['S[GYSY=?FWK6E>Z^?L'BK,:KP0E*DD>R?6E*-7E='DM9BA36A49XKI_!M<9D8J -EOT - -<<'EOT', -M>)RED,E3SW$8QU_77@<''+A]^Y5(2-F7+"%92\B^ES5ES]H,)L(8&21E*UNH -M&"8T8ZS3I(FS_T"$_`L^-^/D8)YY/^]Y/\L\"Y/Y/XN()T8"B0P@B8$,(IG! -MI#"$H0PCE>&DDG,((N99#.+VM8SP8**&0CF]C,%K:RC2*V -M4TP).]C)+G:SA[WLHY3]'.`@ASC,$-(*3WG:,R%ZSDK/!K[@1<][R2HO6^T5:ZSUJM>\[@UO -M6F>]M[SM'>]ZSX90_\"'-MIDLX^">ASPQ*?!M_C,Y[ZP->KE*U_[QK>^\WW( -CM/O!ML"=?K3#3[Z,*_AKOR]V^=5O=OO='_ZTQU^_`2-%:*`` -EOT - -undef, -undef, -undef, -undef, -undef, -undef, -undef, -undef, -undef, -<<'EOT', -M>)REC]=.E&$`1(\%&W@4004%_7:!I?>.Z-+[TJL*=K"`BH`*J,_"+2'A!7PW -MX;\2[LG<3#*9G!F2G$V!&'$***2(!,644$H9Y5102175U%!+'?4TT$@3S;30 -M2AN/:.\HSG -M+++$"U[RBM>\X2WO6&:%]WS@(Y]898W/?.$KZWQC@TVV^,X/?K+-#KO\XC=_ -M(OX!?T/"`0<=-$T+WG9 -M*U[UFNEF>%V]X4TSO666V=[VCG?-,==[WC?/?!_XT&#,N`466F3"8DLLMLD&W2#COMLML>>^V+=IX\2<7BCCGNA)-. -0.>V,L\XY[P*'[!\#D^='L@`` -EOT - -undef, -undef, -undef, -undef, -undef, -undef, -undef, -undef, -undef, -); - -$cp_1252 = ( -<<'EOT', -M>)P-SD-B'5```,#YJ6VE>DEM&[\VD]JVF?H./4'-U+93V[9M:SV;$141(Y74 -MTD@KG?0RR"B3S++(*IOL:%9-$0&YD?BH22(82XF)10.3(@U(DDB$;F_/]% -M0_Y0(!0*A4-\R!5RQ]R*BX\,#'4CB?]];B3)`@LMLM@22RVSW`HKK;):LC76 -M6F>]#3;:9+,MMMIFNQUVVF6W/?;:9[\##CKDL"-2''7,<2><=,II9YQUSGD7 -M7'3)95=<=0@` -EOT -); -#' - -@ms_langids = ( [""], - ['ar', ["-SA", "-IQ", "-EG", "-LY", "-DZ", "-MA", "-TN", - "-OM", "-YE", "-SY", "-JO", "-LB", "-KW", "-AE", - "-BH", "-QA"]], - ['bg-BG'], - ['ca-ES'], - ['zh', ['-TW', 'CN', '-HK', '-SG', '-MO']], - ["cs-CZ"], - ["da-DK"], - ["de", ["-DE", "-CH", "-AT", "-LU", "-LI"]], - ["el-GR"], - ["en", ["-US", "-UK", "-AU", "-CA", "-NZ", "-IE", "-ZA", - "-JM", "029", "-BZ", "-TT", "-ZW", "-PH", "-ID", - "-HK", "-IN", "-MY", "-SG"]], - ["es", ["-ES", "-MX", "-ES", "-GT", "-CR", "-PA", "-DO", - "-VE", "-CO", "-PE", "-AR", "-EC", "-CL", "-UY", - "-PY", "-BO", "-SV", "-HN", "-NI", "-PR", "-US"]], - ["fi-FI"], - ["fr", ["-FR", "-BE", "-CA", "-CH", "-LU", "-MC", "", - "-RE", "-CG", "-SN", "-CM", "-CI", "-ML", "-MA", - "-HT"]], - ["he-IL"], - ["hu-HU"], - ["is-IS"], -# 0010 - ["it", ["-IT", "-CH"]], - ["ja-JP"], - ["ko-KR"], - ["nl", ["-NL", "-BE"]], - ["no", ["-bok-NO", "-nyn-NO"]], - ["pl-PL"], - ["pt", ["-BR", "-PT"]], - ["rm-CH"], - ["ro", ["-RO", "_MD"]], - ["ru-RU"], - ["hr", ["-HR", "-Latn-CS", "Cyrl-CS", "-BA", "", "-Latn-BA", "-Cyrl-BA"]], - ["sk-SK"], - ["sq-AL"], - ["sv", ["-SE", "-FI"]], - ["th-TH"], - ["tr-TR"], -# 0020 - ["ur", ["-PK", "tr-IN"]], - ["id-ID"], - ["uk-UA"], - ["be-BY"], - ["sl-SL"], - ["et-EE"], - ["lv-LV"], - ["lt-LT"], - ["tg-Cyrl-TJ"], - ["fa-IR"], - ["vi-VN"], - ["hy-AM"], - ["az", ["-Latn-AZ", "-Cyrl-AZ"]], - ["eu-ES"], - ["wen". ["wen-DE", "dsb-DE"]], - ["mk-MK"], -# 0030 - ["st"], - ["ts"], - ["tn-ZA"], - ["ven"], - ["xh-ZA"], - ["zu-ZA"], - ["af-ZA"], - ["ka-GE"], - ["fo-FO"], - ["hi-IN"], - ["mt"], - ["se", ["-NO", "-SE", "-FI", "smj-NO", "smj-SE", "sma-NO", "sma-SE", - "", "smn-FI"]], - ["ga-IE"], - ["yi"], - ["ms", ["-MY", "-BN"]], - ["kk-KZ"], -# 0040 - ["ky-KG"], - ["sw-KE"], - ["tk-TM"], - ["uz", ["-Latn-UZ", "-Cyrl-UZ"]], - ["tt-RU"], - ["bn", ["-IN", "-BD"]], - ["pa", ["-IN", "-Arab-PK"]], - ["gu-IN"], - ["or-IN"], - ["ta-IN"], - ["te-IN"], - ["kn-IN"], - ["ml-IN"], - ["as-IN"], - ["mr-IN"], - ["sa-IN"], -# 0050 - ["mn", ["-Cyrl-MN", "-Mong-CN"]], - ["bo", ["-CN", "-BT"]], - ["cy-GB"], - ["km-KH"], - ["lo-LA"], - ["my"], - ["gl-ES"], - ["kok-IN"], - ["mni"], - ["sd", ["-IN", "-PK"]], - ["syr-SY"], - ["si-LK"], - ["chr"], - ["iu", ["-Cans-CA", "-Latn-CA"]], - ["am-ET"], - ["tmz", ["-Arab", "tmz-Latn-DZ"]], -# 0060 - ["ks"], - ["ne", ["-NP", "-IN"]], - ["fy-NL"], - ["ps-AF"], - ["fil-PH"], - ["dv-MV"], - ["bin-NG"], - ["fuv-NG"], - ["ha-Latn-NG"], - ["ibb-NG"], - ["yo-NG"], - ["quz", ["-BO", "-EC", "-PE"]], - ["ns-ZA"], - ["ba-RU"], - ["lb-LU"], - ["kl-GL"], -# 0070 - ["ig-NG"], - ["kau"], - ["om"], - ["ti", ["-ET". "-ER"]], - ["gn"], - ["haw"], - ["la"], - ["so"], - ["ii-CN"], - ["pap"], - ["arn-CL"], - [""], # (unassigned) - ["moh-CA"], - [""], # (unassigned) - ["br-FR"], - [""], # (unassigned) -# 0080 - ["ug-CN"], - [""], # (unassigned) - ["oc-FR"], - ["gsw-FR"], - [""], # (unassigned) - ["sah-RU"], - ["qut-GT"], - ["rw-RW"], - ["wo-SN"], - [""], # (unassigned) - [""], # (unassigned) - [""], # (unassigned) - ["gbz-AF"], -); - -@mac_langs = ( - 'en', 'fr', 'de', 'it', 'nl', 'sv', 'es', 'da', 'pt', 'no', - 'he', 'ja', 'ar', 'fi', 'el', 'is', 'mt', 'tr', 'hr', 'zh-Hant', - 'ur', 'hi', 'th', 'ko', 'lt', 'pl', 'hu', 'et', 'lv', 'se', - 'fo', 'ru' ,'zh-Hans', 'nl', 'ga', 'sq', 'ro', 'cs', 'sk', - 'sl', 'yi', 'sr', 'mk', 'bg', 'uk', 'be', 'uz', 'kk', 'az-Cyrl', - 'az-Latn', 'hy', 'ka', 'mo', 'ky', 'abh', 'tuk', 'mn-Mong', 'mn-Cyrl', 'pst', - 'ku', 'ks', 'sd', 'bo', 'ne', 'sa', 'mr', 'bn', 'as', 'gu', - 'pa', 'or', 'ml', 'kn', 'ta', 'te', 'si', 'my', 'km', 'lo', - 'vi', 'id', 'tl', 'ms-Latn', 'ms-Arab', 'am', 'ti', 'tga', 'so', 'sw', - 'rw', 'rn', 'ny', 'mg', 'eo', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', 'cy', 'eu', - 'la', 'qu', 'gn', 'ay', 'tt', 'ug', 'dz', 'jv-Latn', 'su-Latn', - 'gl', 'af', 'br', 'iu', 'gd', 'gv', 'gd-IR-x-dotabove', 'to', 'el-polyton', 'kl', - 'az-Latn' -); - -} - -1; - -=head1 BUGS - -=over 4 - -=item * - -Unicode type strings will be stored in utf8 for all known platforms, -once Perl 5.6 has been released and I can find all the mapping tables, etc. - -=back - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OS_2.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OS_2.pm deleted file mode 100644 index 0092732..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OS_2.pm +++ /dev/null @@ -1,354 +0,0 @@ -package Font::TTF::OS_2; - -=head1 NAME - -Font::TTF::OS_2 - the OS/2 table in a TTF font - -=head1 DESCRIPTION - -The OS/2 table has two versions and forms, one an extension of the other. This -module supports both forms and the switching between them. - -=head1 INSTANCE VARIABLES - -No other variables than those in table and those in the standard: - - Version - xAvgCharWidth - usWeightClass - usWidthClass - fsType - ySubscriptXSize - ySubScriptYSize - ySubscriptXOffset - ySubscriptYOffset - ySuperscriptXSize - ySuperscriptYSize - ySuperscriptXOffset - ySuperscriptYOffset - yStrikeoutSize - yStrikeoutPosition - sFamilyClass - bFamilyType - bSerifStyle - bWeight - bProportion - bContrast - bStrokeVariation - bArmStyle - bLetterform - bMidline - bXheight - ulUnicodeRange1 - ulUnicodeRange2 - ulUnicodeRange3 - ulUnicodeRange4 - achVendID - fsSelection - usFirstCharIndex - usLastCharIndex - sTypoAscender - sTypoDescender - sTypoLineGap - usWinAscent - usWinDescent - ulCodePageRange1 - ulCodePageRange2 - xHeight - CapHeight - defaultChar - breakChar - maxLookups - -Notice that versions 0, 1, 2 & 3 of the table are supported. Notice also that the -Panose variable has been broken down into its elements. - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA @fields @lens @field_info @weights); -use Font::TTF::Table; - -@ISA = qw(Font::TTF::Table); -@field_info = ( - 'xAvgCharWidth' => 's', - 'usWeightClass' => 'S', - 'usWidthClass' => 'S', - 'fsType' => 's', - 'ySubscriptXSize' => 's', - 'ySubScriptYSize' => 's', - 'ySubscriptXOffset' => 's', - 'ySubscriptYOffset' => 's', - 'ySuperscriptXSize' => 's', - 'ySuperscriptYSize' => 's', - 'ySuperscriptXOffset' => 's', - 'ySuperscriptYOffset' => 's', - 'yStrikeoutSize' => 's', - 'yStrikeoutPosition' => 's', - 'sFamilyClass' => 's', - 'bFamilyType' => 'C', - 'bSerifStyle' => 'C', - 'bWeight' => 'C', - 'bProportion' => 'C', - 'bContrast' => 'C', - 'bStrokeVariation' => 'C', - 'bArmStyle' => 'C', - 'bLetterform' => 'C', - 'bMidline' => 'C', - 'bXheight' => 'C', - 'ulUnicodeRange1' => 'L', - 'ulUnicodeRange2' => 'L', - 'ulUnicodeRange3' => 'L', - 'ulUnicodeRange4' => 'L', - 'achVendID' => 'L', - 'fsSelection' => 'S', - 'usFirstCharIndex' => 'S', - 'usLastCharIndex' => 'S', - 'sTypoAscender' => 'S', - 'sTypoDescender' => 's', - 'sTypoLineGap' => 'S', - 'usWinAscent' => 'S', - 'usWinDescent' => 'S', - '' => '', - 'ulCodePageRange1' => 'L', - 'ulCodePageRange2' => 'L', - '' => '', - 'xHeight' => 's', - 'CapHeight' => 's', - 'defaultChar' => 'S', - 'breakChar' => 'S', - 'maxLookups' => 's', - '' => '', # i.e. v3 is basically same as v2 - ); - -@weights = qw(64 14 27 35 100 20 14 42 63 3 6 35 20 56 56 17 4 49 56 71 31 10 18 3 18 2 166); - -use Font::TTF::Utils; - -sub init -{ - my ($k, $v, $c, $n, $i, $t, $j); - - $n = 0; - @lens = (76, 84, 94, 94); - for ($j = 0; $j < $#field_info; $j += 2) - { - if ($field_info[$j] eq '') - { - $n++; - next; - } - ($k, $v, $c) = TTF_Init_Fields($field_info[$j], $c, $field_info[$j+1]); - next unless defined $k && $k ne ""; - for ($i = $n; $i < 4; $i++) - { $fields[$i]{$k} = $v; } - } -} - - -=head2 $t->read - -Reads in the various values from disk (see details of OS/2 table) - -=cut - -sub read -{ - my ($self) = @_; - my ($dat, $ver); - - $self->SUPER::read or return $self; - - init unless defined $fields[2]{'xAvgCharWidth'}; - $self->{' INFILE'}->read($dat, 2); - $ver = unpack("n", $dat); - $self->{'Version'} = $ver; - if ($ver < 4) - { - $self->{' INFILE'}->read($dat, $lens[$ver]); - TTF_Read_Fields($self, $dat, $fields[$ver]); - } - $self; -} - - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying. - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($ver); - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $ver = $self->{'Version'}; - $fh->print(pack("n", $ver)); - $fh->print(TTF_Out_Fields($self, $fields[$ver], $lens[$ver])); - $self; -} - - -=head2 $t->XML_element($context, $depth, $key, $value) - -Tidies up the hex values to output them in hex - -=cut - -sub XML_element -{ - my ($self) = shift; - my ($context, $depth, $key, $value) = @_; - my ($fh) = $context->{'fh'}; - - if ($key =~ m/^ul(?:Unicode|CodePage)Range\d$/o) - { $fh->printf("%s<%s>%08X\n", $depth, $key, $value, $key); } - elsif ($key eq 'achVendID') - { $fh->printf("%s<%s name='%s'/>\n", $depth, $key, pack('N', $value)); } - else - { return $self->SUPER::XML_element(@_); } - $self; -} - - -=head2 $t->XML_end($context, $tag, %attrs) - -Now handle them on the way back in - -=cut - -sub XML_end -{ - my ($self) = shift; - my ($context, $tag, %attrs) = @_; - - if ($tag =~ m/^ul(?:Unicode|CodePage)Range\d$/o) - { return hex($context->{'text'}); } - elsif ($tag eq 'achVendID') - { return unpack('N', $attrs{'name'}); } - else - { return $self->SUPER::XML_end(@_); } -} - -=head2 $t->update - -Updates the OS/2 table by getting information from other sources: - -Updates the C and C values based on the MS table in the -cmap. - -Updates the sTypoAscender, sTypoDescender & sTypoLineGap to be the same values -as Ascender, Descender and Linegap from the hhea table (assuming it is dirty) -and also sets usWinAscent to be the sum of Ascender+Linegap and usWinDescent to -be the negative of Descender. - -=cut - -sub update -{ - my ($self) = @_; - my ($map, @keys, $table, $i, $avg, $hmtx); - - return undef unless ($self->SUPER::update); - - $self->{' PARENT'}{'cmap'}->update; - $map = $self->{' PARENT'}{'cmap'}->find_ms || return undef; - $hmtx = $self->{' PARENT'}{'hmtx'}->read; - - @keys = sort {$a <=> $b} grep {$_ < 0x10000} keys %{$map->{'val'}}; - - $self->{'usFirstCharIndex'} = $keys[0]; - $self->{'usLastCharIndex'} = $keys[-1]; - - $table = $self->{' PARENT'}{'hhea'}->read; - - # try any way we can to get some real numbers passed around! - if (($self->{'fsSelection'} & 128) != 0) - { - # assume the user knows what they are doing and has sensible values already - } - elsif ($table->{'Ascender'} != 0 || $table->{'Descender'} != 0) - { - $self->{'sTypoAscender'} = $table->{'Ascender'}; - $self->{'sTypoDescender'} = $table->{'Descender'}; - $self->{'sTypoLineGap'} = $table->{'LineGap'}; - $self->{'usWinAscent'} = $self->{'sTypoAscender'} + $self->{'sTypoLineGap'}; - $self->{'usWinDescent'} = -$self->{'sTypoDescender'}; - } - elsif ($self->{'sTypoAscender'} != 0 || $self->{'sTypoDescender'} != 0) - { - $table->{'Ascender'} = $self->{'sTypoAscender'}; - $table->{'Descender'} = $self->{'sTypoDescender'}; - $table->{'LineGap'} = $self->{'sTypoLineGap'}; - $self->{'usWinAscent'} = $self->{'sTypoAscender'} + $self->{'sTypoLineGap'}; - $self->{'usWinDescent'} = -$self->{'sTypoDescender'}; - } - elsif ($self->{'usWinAscent'} != 0 || $self->{'usWinDescent'} != 0) - { - $self->{'sTypoAscender'} = $table->{'Ascender'} = $self->{'usWinAscent'}; - $self->{'sTypoDescender'} = $table->{'Descender'} = -$self->{'usWinDescent'}; - $self->{'sTypoLineGap'} = $table->{'LineGap'} = 0; - } - - if ($self->{'Version'} < 3) - { - for ($i = 0; $i < 26; $i++) - { $avg += $hmtx->{'advance'}[$map->{'val'}{$i + 0x0061}] * $weights[$i]; } - $avg += $hmtx->{'advance'}[$map->{'val'}{0x0020}] * $weights[-1]; - $self->{'xAvgCharWidth'} = $avg / 1000; - } - elsif ($self->{'Version'} > 2) - { - $i = 0; $avg = 0; - foreach (@{$hmtx->{'advance'}}) - { - next unless ($_); - $i++; - $avg += $_; - } - $avg /= $i if ($i); - $self->{'xAvgCharWidth'} = $avg; - } - - foreach $i (keys %{$map->{'val'}}) - { - if ($i >= 0x10000) - { - $self->{'ulUnicodeRange2'} |= 0x2000000; - last; - } - } - - $self->{'Version'} = 1 if (defined $self->{'ulCodePageRange1'} && $self->{'Version'} < 1); - $self->{'Version'} = 2 if (defined $self->{'maxLookups'} && $self->{'Version'} < 2); - - if ((exists $self->{' PARENT'}{'GPOS'} && $self->{' PARENT'}{'GPOS'}{' read'}) || - (exists $self->{' PARENT'}{'GSUB'} && $self->{' PARENT'}{'GSUB'}{' read'})) - { - # one or both of GPOS & GSUB exist and have been read or modified; so update usMaxContexts - my ($lp, $ls); - $lp = $self->{' PARENT'}{'GPOS'}->maxContext if exists $self->{' PARENT'}{'GPOS'}; - $ls = $self->{' PARENT'}{'GSUB'}->maxContext if exists $self->{' PARENT'}{'GSUB'}; - $self->{'maxLookups'} = $lp > $ls ? $lp : $ls; - } - - $self; -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OTTags.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OTTags.pm deleted file mode 100644 index 71338e2..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OTTags.pm +++ /dev/null @@ -1,706 +0,0 @@ -package Font::TTF::OTTags; - -=head1 NAME - -Font::TTF::OTTags - Utilities for TrueType/OpenType tags - -=head1 SYNOPSIS - - use Font::TTF::OTTags qw( %tttags %ttnames readtagsfile ); - - # Look at built-in stuff: - $script_tag = $tttags{'SCRIPT'}{'Cypriot Syllabary'}; - $lang_name = $ttnames{'LANGUAGE'}{'AFK '} - - # Read latest tags file to add to built-in definitions - readtagsfile ("C:\\Program Files\\Microsoft VOLT\\TAGS.txt"); - -First-level keys to %tttags and %ttnames are: - -=over - -'SCRIPT' -- retrieve script tag or name - -'LANGUAGE' -- retrieve language tag or name - -'FEATURE' -- retrieve feature tag or name - -=back - -Built-in data has been derived from Microsoft's tag registry at -L, -updated to draft v1.5 of the OpenType Spec. - -=head1 METHODS - -=cut - -use strict; -use vars qw( %tttags %ttnames @EXPORT_OK @ISA ); -require Exporter; -@ISA = qw( Exporter ); -@EXPORT_OK = qw( %tttags %ttnames readtagsfile); - - -%tttags = ( - -# All data below derived from VOLT 1.3 TAGS.txt file. -# For conveninence of human checking, these are now sorted alphabetically. - -'SCRIPT' => { - "Arabic" => "arab", - "Armenian" => "armn", - "Balinese" => "bali", - "Bengali v.2" => "bng2", - "Bengali" => "beng", - "Bopomofo" => "bopo", - "Braille" => "brai", - "Buginese" => "bugi", - "Buhid" => "buhd", - "Byzantine Music" => "byzm", - "CJK Ideographic" => "hani", - "Canadian Syllabics" => "cans", - "Carian" => "cari", - "Cham" => "cham", - "Cherokee" => "cher", - "Coptic" => "copt", - "Cypriot Syllabary" => "cprt", - "Cyrillic" => "cyrl", - "Default" => "DFLT", - "Deseret" => "dsrt", - "Devanagari v.2" => "dev2", - "Devanagari" => "deva", - "Ethiopic" => "ethi", - "Georgian" => "geor", - "Glagolitic" => "glag", - "Gothic" => "goth", - "Greek" => "grek", - "Gujarati v.2" => "gjr2", - "Gujarati" => "gujr", - "Gurmukhi v.2" => "gur2", - "Gurmukhi" => "guru", - "Hangul Jamo" => "jamo", - "Hangul" => "hang", - "Hanunoo" => "hano", - "Hebrew" => "hebr", - "Hiragana" => "kana", - "Javanese" => "java", - "Kannada v.2" => "knd2", - "Kannada" => "knda", - "Katakana" => "kana", - "Kayah Li" => "kali", - "Kharosthi" => "khar", - "Khmer" => "khmr", - "Lao" => "lao ", - "Latin" => "latn", - "Lepcha" => "lepc", - "Limbu" => "limb", - "Linear B" => "linb", - "Lycian" => "lyci", - "Lydian" => "lydi", - "Malayalam v.2" => "mlm2", - "Malayalam" => "mlym", - "Mathematical Alphanumeric Symbols" => "math", - "Mongolian" => "mong", - "Musical Symbols" => "musc", - "Myanmar" => "mymr", - "N'Ko" => "nko ", - "New Tai Lue" => "talu", - "Ogham" => "ogam", - "Ol Chiki" => "olck", - "Old Italic" => "ital", - "Old Persian Cuneiform" => "xpeo", - "Oriya v.2" => "ory2", - "Oriya" => "orya", - "Osmanya" => "osma", - "Phags-pa" => "phag", - "Phoenician" => "phnx", - "Rejang" => "rjng", - "Runic" => "runr", - "Saurashtra" => "saur", - "Shavian" => "shaw", - "Sinhala" => "sinh", - "Sumero-Akkadian Cuneiform" => "xsux", - "Sundanese" => "sund", - "Syloti Nagri" => "sylo", - "Syriac" => "syrc", - "Tagalog" => "tglg", - "Tagbanwa" => "tagb", - "Tai Le" => "tale", - "Tamil v.2" => "tml2", - "Tamil" => "taml", - "Telugu v.2" => "tel2", - "Telugu" => "telu", - "Thaana" => "thaa", - "Thai" => "thai", - "Tibetan" => "tibt", - "Tifinagh" => "tfng", - "Ugaritic Cuneiform" => "ugar", - "Vai" => "vai ", - "Yi" => "yi ", - }, - -'LANGUAGE' => { - "Aari" => "ARI ", - "Abaza" => "ABA ", - "Abkhazian" => "ABK ", - "Adyghe" => "ADY ", - "Afar" => "AFR ", - "Afrikaans" => "AFK ", - "Agaw" => "AGW ", - "Albanian" => "SQI ", - "Alsatian" => "ALS ", - "Altai" => "ALT ", - "Amharic" => "AMH ", - "Arabic" => "ARA ", - "Arakanese" => "ARK ", - "Armenian" => "HYE ", - "Assamese" => "ASM ", - "Athapaskan" => "ATH ", - "Avar" => "AVR ", - "Awadhi" => "AWA ", - "Aymara" => "AYM ", - "Azeri" => "AZE ", - "Badaga" => "BAD ", - "Baghelkhandi" => "BAG ", - "Balante" => "BLN ", - "Balkar" => "BAL ", - "Balochi" => "BLI ", - "Balti" => "BLT ", - "Bambara" => "BMB ", - "Bamileke" => "BML ", - "Bashkir" => "BSH ", - "Basque" => "EUQ ", - "Baule" => "BAU ", - "Belarussian" => "BEL ", - "Bemba" => "BEM ", - "Bench" => "BCH ", - "Bengali" => "BEN ", - "Berber" => "BBR ", - "Beti" => "BTI ", - "Bhili" => "BHI ", - "Bhojpuri" => "BHO ", - "Bible Cree" => "BCR ", - "Bikol" => "BIK ", - "Bilen" => "BIL ", - "Blackfoot" => "BKF ", - "Bosnian" => "BOS ", - "Brahui" => "BRH ", - "Braj Bhasha" => "BRI ", - "Breton" => "BRE ", - "Bulgarian" => "BGR ", - "Burmese" => "BRM ", - "Carrier" => "CRR ", - "Catalan" => "CAT ", - "Cebuano" => "CEB ", - "Chaha Gurage" => "CHG ", - "Chattisgarhi" => "CHH ", - "Chechen" => "CHE ", - "Cherokee" => "CHR ", - "Chichewa" => "CHI ", - "Chin" => "QIN ", - "Chinese Hong Kong" => "ZHH ", - "Chinese Phonetic" => "ZHP ", - "Chinese Simplified" => "ZHS ", - "Chinese Traditional" => "ZHT ", - "Chipewyan" => "CHP ", - "Chukchi" => "CHK ", - "Church Slavonic" => "CSL ", - "Chuvash" => "CHU ", - "Comorian" => "CMR ", - "Coptic" => "COP ", - "Corsican" => "COS ", - "Cree" => "CRE ", - "Crimean Tatar" => "CRT ", - "Croatian" => "HRV ", - "Czech" => "CSY ", - "Dangme" => "DNG ", - "Danish" => "DAN ", - "Dargwa" => "DAR ", - "Dari" => "DRI ", - "Default" => "dflt", - "Dhivehi (OBSOLETE)" => "DHV ", - "Dhivehi" => "DIV ", - "Dinka" => "DNK ", - "Djerma" => "DJR ", - "Dogri" => "DGR ", - "Dungan" => "DUN ", - "Dutch" => "NLD ", - "Dzongkha" => "DZN ", - "Eastern Cree" => "ECR ", - "Ebira" => "EBI ", - "Edo" => "EDO ", - "Efik" => "EFI ", - "English" => "ENG ", - "Erzya" => "ERZ ", - "Esperanto" => "NTO ", - "Estonian" => "ETI ", - "Even" => "EVN ", - "Evenki" => "EVK ", - "Ewe" => "EWE ", - "Faroese" => "FOS ", - "Farsi" => "FAR ", - "Fijian" => "FJI ", - "Filipino" => "PIL ", - "Finnish" => "FIN ", - "Flemish" => "FLE ", - "Fon" => "FON ", - "Forest Nenets" => "FNE ", - "French Antillean" => "FAN ", - "French" => "FRA ", - "Frisian" => "FRI ", - "Friulian" => "FRL ", - "Fulani" => "FUL ", - "Futa" => "FTA ", - "Ga" => "GAD ", - "Gaelic" => "GAE ", - "Gagauz" => "GAG ", - "Galician" => "GAL ", - "Garhwali" => "GAW ", - "Garo" => "GRO ", - "Garshuni" => "GAR ", - "Ge'ez" => "GEZ ", - "Georgian" => "KAT ", - "German" => "DEU ", - "Gilyak" => "GIL ", - "Gondi" => "GON ", - "Greek" => "ELL ", - "Greenlandic" => "GRN ", - "Guarani" => "GUA ", - "Gujarati" => "GUJ ", - "Gumuz" => "GMZ ", - "Haitian" => "HAI ", - "Halam" => "HAL ", - "Hammer-Banna" => "HBN ", - "Harari" => "HRI ", - "Harauti" => "HAR ", - "Hausa" => "HAU ", - "Hawaiin" => "HAW ", - "Hebrew" => "IWR ", - "High Mari" => "HMA ", - "Hiligaynon" => "HIL ", - "Hindi" => "HIN ", - "Hindko" => "HND ", - "Ho" => "HO ", - "Hungarian" => "HUN ", - "Icelandic" => "ISL ", - "Igbo" => "IBO ", - "Ijo" => "IJO ", - "Ilokano" => "ILO ", - "Inari Sami" => "ISM ", - "Indonesian" => "IND ", - "Ingush" => "ING ", - "Inuktitut" => "INU ", - "Irish Traditional" => "IRT ", - "Irish" => "IRI ", - "Italian" => "ITA ", - "Japanese" => "JAN ", - "Javanese" => "JAV ", - "Judezmo" => "JUD ", - "Jula" => "JUL ", - "Kabardian" => "KAB ", - "Kachchi" => "KAC ", - "Kalenjin" => "KAL ", - "Kalmyk" => "KLM ", - "Kamba" => "KMB ", - "Kannada" => "KAN ", - "Kanuri" => "KNR ", - "Karachay" => "KAR ", - "Karaim" => "KRM ", - "Karakalpak" => "KRK ", - "Karelian" => "KRL ", - "Karen" => "KRN ", - "Kashmiri" => "KSH ", - "Kazakh" => "KAZ ", - "Kebena" => "KEB ", - "Khakass" => "KHA ", - "Khanty-Kazim" => "KHK ", - "Khanty-Shurishkar" => "KHS ", - "Khanty-Vakhi" => "KHV ", - "Khasi" => "KSI ", - "Khmer" => "KHM ", - "Khowar" => "KHW ", - "Khutsuri Georgian" => "KGE ", - "Kikongo" => "KON ", - "Kikuyu" => "KIK ", - "Kildin Sami" => "KSM ", - "Kirghiz" => "KIR ", - "Kisii" => "KIS ", - "Kodagu" => "KOD ", - "Kokni" => "KKN ", - "Komi-Permyak" => "KOP ", - "Komi-Zyrian" => "KOZ ", - "Komo" => "KMO ", - "Komso" => "KMS ", - "Konkani" => "KOK ", - "Koorete" => "KRT ", - "Korean Old Hangul" => "KOH ", - "Korean" => "KOR ", - "Koryak" => "KYK ", - "Kpelle" => "KPL ", - "Krio" => "KRI ", - "Kui" => "KUI ", - "Kulvi" => "KUL ", - "Kumaoni" => "KMN ", - "Kumyk" => "KUM ", - "Kurdish" => "KUR ", - "Kurukh" => "KUU ", - "Kuy" => "KUY ", - "L-Cree" => "LCR ", - "Ladakhi" => "LDK ", - "Ladin" => "LAD ", - "Lahuli" => "LAH ", - "Lak" => "LAK ", - "Lambani" => "LAM ", - "Lao" => "LAO ", - "Latin" => "LAT ", - "Latvian" => "LVI ", - "Laz" => "LAZ ", - "Lezgi" => "LEZ ", - "Limbu" => "LMB ", - "Lingala" => "LIN ", - "Lithuanian" => "LTH ", - "Lomwe" => "LMW ", - "Low Mari" => "LMA ", - "Lower Sorbian" => "LSB ", - "Luba" => "LUB ", - "Luganda" => "LUG ", - "Luhya" => "LUH ", - "Lule Sami" => "LSM ", - "Luo" => "LUO ", - "Luxembourgish" => "LTZ ", - "Macedonian" => "MKD ", - "Maithili" => "MTH ", - "Majang" => "MAJ ", - "Makua" => "MAK ", - "Malagasy" => "MLG ", - "Malay" => "MLY ", - "Malayalam Reformed" => "MLR ", - "Malayalam Traditional" => "MAL ", - "Male" => "MLE ", - "Malinke" => "MLN ", - "Maltese" => "MTS ", - "Manchu" => "MCH ", - "Mandinka" => "MND ", - "Maninka" => "MNK ", - "Manipuri" => "MNI ", - "Mansi" => "MAN ", - "Manx Gaelic" => "MNX ", - "Maori" => "MRI ", - "Mapudungun" => "MAP ", - "Marathi" => "MAR ", - "Marwari" => "MAW ", - "Mbundu" => "MBN ", - "Me'en" => "MEN ", - "Mende" => "MDE ", - "Mizo" => "MIZ ", - "Mohawk" => "MOH ", - "Moksha" => "MOK ", - "Moldavian" => "MOL ", - "Mon" => "MON ", - "Mongolian" => "MNG ", - "Moose Cree" => "MCR ", - "Moroccan" => "MOR ", - "Mundari" => "MUN ", - "N'Ko" => "NKO ", - "N-Cree" => "NCR ", - "Naga-Assamese" => "NAG ", - "Nagari" => "NGR ", - "Nanai" => "NAN ", - "Naskapi" => "NAS ", - "Ndebele" => "NDB ", - "Ndonga" => "NDG ", - "Nepali" => "NEP ", - "Newari" => "NEW ", - "Nisi" => "NIS ", - "Niuean" => "NIU ", - "Nkole" => "NKL ", - "Nogai" => "NOG ", - "Northern Sami" => "NSM ", - "Northern Tai" => "NTA ", - "Norway House Cree" => "NHC ", - "Norwegian" => "NOR ", - "Nynorsk" => "NYN ", - "Occitan" => "OCI ", - "Oji-Cree" => "OCR ", - "Ojibway" => "OJB ", - "Oriya" => "ORI ", - "Oromo" => "ORO ", - "Ossetian" => "OSS ", - "Palaung" => "PLG ", - "Palestinian Aramaic" => "PAA ", - "Pali" => "PAL ", - "Palpa" => "PAP ", - "Pashto" => "PAS ", - "Polish" => "PLK ", - "Polytonic Greek" => "PGR ", - "Portuguese" => "PTG ", - "Provencal" => "PRO ", - "Punjabi" => "PAN ", - "R-Cree" => "RCR ", - "Rajasthani" => "RAJ ", - "Rhaeto-Romanic" => "RMS ", - "Riang" => "RIA ", - "Romanian" => "ROM ", - "Romany" => "ROY ", - "Ruanda" => "RUA ", - "Russian Buriat" => "RBU ", - "Russian" => "RUS ", - "Rusyn" => "RSY ", - "Sadri" => "SAD ", - "Samoan" => "SMO ", - "Sango" => "SGO ", - "Sanskrit" => "SAN ", - "Santali" => "SAT ", - "Saraiki" => "SRK ", - "Sayisi" => "SAY ", - "Sekota" => "SEK ", - "Selkup" => "SEL ", - "Sena" => "SNA ", - "Serbian" => "SRB ", - "Serer" => "SRR ", - "Shan" => "SHN ", - "Sibe" => "SIB ", - "Sidamo" => "SID ", - "Silte Gurage" => "SIG ", - "Sindhi" => "SND ", - "Sinhalese" => "SNH ", - "Skolt Sami" => "SKS ", - "Slavey" => "SLA ", - "Slovak" => "SKY ", - "Slovenian" => "SLV ", - "Sodo Gurage" => "SOG ", - "Somali" => "SML ", - "Soninke" => "SNK ", - "Sotho" => "SOT ", - "South Slavey" => "SSL ", - "Southern Sami" => "SSM ", - "Spanish" => "ESP ", - "Suri" => "SUR ", - "Sutu" => "SXT ", - "Svan" => "SVA ", - "Swadaya Aramaic" => "SWA ", - "Swahili" => "SWK ", - "Swazi" => "SWZ ", - "Swedish" => "SVE ", - "Syriac" => "SYR ", - "TH-Cree" => "TCR ", - "Tabasaran" => "TAB ", - "Tahitian" => "THT ", - "Tai Lue" => "XBD ", - "Tajiki" => "TAJ ", - "Tamil" => "TAM ", - "Tatar" => "TAT ", - "Telugu" => "TEL ", - "Temne" => "TMN ", - "Thai" => "THA ", - "Tibetan" => "TIB ", - "Tigre" => "TGR ", - "Tigrinya" => "TGY ", - "Todo" => "TOD ", - "Tonga" => "TNG ", - "Tongan" => "TGN ", - "Tsonga" => "TSG ", - "Tswana" => "TNA ", - "Tulu" => "TUL ", - "Tundra Nenets" => "TNE ", - "Turkish" => "TRK ", - "Turkmen" => "TKM ", - "Turoyo Aramaic" => "TUA ", - "Tuvin" => "TUV ", - "Twi" => "TWI ", - "Udmurt" => "UDM ", - "Ukrainian" => "UKR ", - "Upper Sorbian" => "USB ", - "Urdu" => "URD ", - "Uyghur" => "UYG ", - "Uzbek" => "UZB ", - "Venda" => "VEN ", - "Vietnamese" => "VIT ", - "Wa" => "WA ", - "Wagdi" => "WAG ", - "Welsh" => "WEL ", - "West-Cree" => "WCR ", - "Wolof" => "WLF ", - "Woods Cree" => "DCR ", - "Xhosa" => "XHS ", - "Y-Cree" => "YCR ", - "Yakut" => "YAK ", - "Yi Classic" => "YIC ", - "Yi Modern" => "YIM ", - "Yiddish" => "JII ", - "Yoruba" => "YBA ", - "Zande" => "ZND ", - "Zulu" => "ZUL ", - }, - -'FEATURE' => { - "Above-Base Forms" => "abvf", - "Above-Base Mark Positioning" => "abvm", - "Above-Base Substitutions" => "abvs", - "Access All Alternates" => "aalt", - "Akhands" => "akhn", - "Alternate Annotation Forms" => "nalt", - "Alternate Half Widths" => "halt", - "Alternate Vertical Half Metrics" => "vhal", - "Alternate Vertical Metrics" => "valt", - "Alternative Fractions" => "afrc", - "Below-Base Forms" => "blwf", - "Below-Base Mark Positioning" => "blwm", - "Below-Base Substitutions" => "blws", - "Capital Spacing" => "cpsp", - "Case-Sensitive Forms" => "case", - "Centered CJK Punctuation" => "cpct", - "Conjunct Forms After Ro" => "cfar", - "Conjunct Forms" => "cjct", - "Contextual Alternates" => "calt", - "Contextual Ligatures" => "clig", - "Contextual Swash" => "cswh", - "Cursive Positioning" => "curs", - "Default Processing" => "dflt", - "Denominators" => "dnom", - "Diphthongs (OBSOLETE)" => "dpng", - "Discretionary Ligatures" => "dlig", - "Distances" => "dist", - "Expert Forms" => "expt", - "Final Glyph On Line Alternates" => "falt", - "Fractions" => "frac", - "Full Widths" => "fwid", - "Glyph Composition/Decomposition" => "ccmp", - "Halant Forms" => "haln", - "Half Forms" => "half", - "Half Widths" => "hwid", - "Hangul" => "hngl", - "Historical Forms" => "hist", - "Historical Ligatures" => "hlig", - "Hojo (JIS X 0212-1990) Kanji Forms" => "hojo", - "Horizontal Kana Alternates" => "hkna", - "Initial Forms" => "init", - "Isolated Forms" => "isol", - "Italics" => "ital", - "JIS2004 Forms" => "jp04", - "JIS78 Forms" => "jp78", - "JIS83 Forms" => "jp83", - "JIS90 Forms" => "jp90", - "Justification Alternates" => "jalt", - "Kerning" => "kern", - "Leading Jamo Forms" => "ljmo", - "Left Bounds" => "lfbd", - "Lining Figures" => "lnum", - "Localized Forms" => "locl", - "Mark Positioning via Substitution" => "mset", - "Mark Positioning" => "mark", - "Mark to Mark Positioning" => "mkmk", - "Mathematical Greek" => "mgrk", - "Medial Forms #2" => "med2", - "Medial Forms" => "medi", - "NLC Kanji Forms" => "nlck", - "Nukta Forms" => "nukt", - "Numerators" => "numr", - "Oldstyle Figures" => "onum", - "Optical Bounds" => "opbd", - "Optical Size" => "size", - "Ordinals" => "ordn", - "Ornaments" => "ornm", - "Petite Capitals From Capitals" => "c2pc", - "Petite Capitals" => "pcap", - "Post-base Forms" => "pstf", - "Post-base Substitutions" => "psts", - "Pre-base Forms" => "pref", - "Pre-base Substitutions" => "pres", - "Proportional Alternate Vertical Metrics" => "vpal", - "Proportional Alternate Widths" => "palt", - "Proportional Figures" => "pnum", - "Proportional Kana" => "pkna", - "Proportional Widths" => "pwid", - "Quarter Widths" => "qwid", - "Rakar Forms" => "rkrf", - "Randomize" => "rand", - "Reph Forms" => "rphf", - "Required Ligatures" => "rlig", - "Right Bounds" => "rtbd", - "Right-To-Left Alternates" => "rtla", - "Ruby Notation Forms" => "ruby", - "Scientific Inferiors" => "sinf", - "Simplified Forms" => "smpl", - "Slashed Zero" => "zero", - "Small Capitals From Capitals" => "c2sc", - "Small Capitals" => "smcp", - "Standard Ligatures" => "liga", - "Stylistic Alternates" => "salt", - "Stylistic Set 1" => "ss01", - "Stylistic Set 10" => "ss10", - "Stylistic Set 11" => "ss11", - "Stylistic Set 12" => "ss12", - "Stylistic Set 13" => "ss13", - "Stylistic Set 14" => "ss14", - "Stylistic Set 15" => "ss15", - "Stylistic Set 16" => "ss16", - "Stylistic Set 17" => "ss17", - "Stylistic Set 18" => "ss18", - "Stylistic Set 19" => "ss19", - "Stylistic Set 2" => "ss02", - "Stylistic Set 20" => "ss20", - "Stylistic Set 3" => "ss03", - "Stylistic Set 4" => "ss04", - "Stylistic Set 5" => "ss05", - "Stylistic Set 6" => "ss06", - "Stylistic Set 7" => "ss07", - "Stylistic Set 8" => "ss08", - "Stylistic Set 9" => "ss09", - "Subscript" => "subs", - "Superscript" => "sups", - "Swash" => "swsh", - "Tabular Figures" => "tnum", - "Terminal Forms #2" => "fin2", - "Terminal Forms #3" => "fin3", - "Terminal Forms" => "fina", - "Third Widths" => "twid", - "Titling" => "titl", - "Traditional Forms" => "trad", - "Traditional Name Forms" => "tnam", - "Trailing Jamo Forms" => "tjmo", - "Unicase" => "unic", - "Vattu Variants" => "vatu", - "Vertical Alternates and Rotation" => "vrt2", - "Vertical Kana Alternates" => "vkna", - "Vertical Kerning" => "vkrn", - "Vertical Writing" => "vert", - "Vowel Jamo Forms" => "vjmo", - } -); - -{ - foreach my $s (qw ( SCRIPT LANGUAGE FEATURE ) ) - { - map { $ttnames{$s}{$tttags{$s}{$_}} = $_ } keys %{$tttags{$s}}; - } -} - - -=head2 readtagsfile ( filename ) - -Read a file in the syntax of Tags.txt (included with Microsoft VOLT) to obtain additional/replacement tag definitions. - -Returns 0 if can't open the file; else 1. - -=cut - -sub readtagsfile -{ - my $fname = shift; - open (TAGS, $fname) or return 0; - my ($what, $name, $tag); - while () - { - ($what, $name, $tag) = (m/"([^"]*)", "([^"]*)", "([^"]*)"/); #" - $ttnames{$what}{$tag} = $name; - $tttags{$what}{$name} = $tag; - } - close TAGS; - return 1; -} - - - -1; diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OldCmap.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OldCmap.pm deleted file mode 100644 index 96545e2..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OldCmap.pm +++ /dev/null @@ -1,358 +0,0 @@ -package Font::TTF::OldCmap; - -=head1 NAME - -Font::TTF::OldCmap - Character map table - -This module is deprecated - -=head1 DESCRIPTION - -Looks after the character map. The primary structure used for handling a cmap -is the L which handles the segmented arrays of format 4 tables, -and in a simpler form for format 0 tables. - -Due to the complexity of working with segmented arrays, most of the handling of -such arrays is via methods rather than via instance variables. - -One important feature of a format 4 table is that it always contains a segment -with a final address of 0xFFFF. If you are creating a table from scratch this is -important (although L can work quite happily without it). - - -=head1 INSTANCE VARIABLES - -The instance variables listed here are not preceeded by a space due to their -emulating structural information in the font. - -=over 4 - -=item Num - -Number of subtables in this table - -=item Tables - -An array of subtables ([0..Num-1]) - -=back - -Each subtables also has its own instance variables which are, again, not -preceeded by a space. - -=over 4 - -=item Platform - -The platform number for this subtable - -=item Encoding - -The encoding number for this subtable - -=item Format - -Gives the stored format of this subtable - -=item Ver - -Gives the version (or language) information for this subtable - -=item val - -This points to a L which contains the content of the particular -subtable. - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -require Font::TTF::Table; -require Font::TTF::Segarr; - -@ISA = qw(Font::TTF::Table); - - -=head2 $t->read - -Reads the cmap into memory. Format 4 subtables read the whole subtable and -fill in the segmented array accordingly. - -Format 2 subtables are not read at all. - -=cut - -sub read -{ - my ($self) = @_; - my ($dat, $i, $j, $k, $id, @ids, $s); - my ($start, $end, $range, $delta, $form, $len, $num, $ver); - my ($fh) = $self->{' INFILE'}; - - $self->SUPER::read or return $self; - $fh->read($dat, 4); - $self->{'Num'} = unpack("x2n", $dat); - $self->{'Tables'} = []; - for ($i = 0; $i < $self->{'Num'}; $i++) - { - $s = {}; - $fh->read($dat, 8); - ($s->{'Platform'}, $s->{'Encoding'}, $s->{'LOC'}) = (unpack("nnN", $dat)); - $s->{'LOC'} += $self->{' OFFSET'}; - push(@{$self->{'Tables'}}, $s); - } - for ($i = 0; $i < $self->{'Num'}; $i++) - { - $s = $self->{'Tables'}[$i]; - $fh->seek($s->{'LOC'}, 0); - $fh->read($dat, 6); - ($form, $len, $ver) = (unpack("n3", $dat)); - - $s->{'Format'} = $form; - $s->{'Ver'} = $ver; - if ($form == 0) - { - $s->{'val'} = Font::TTF::Segarr->new; - $fh->read($dat, 256); - $s->{'val'}->fastadd_segment(0, 2, unpack("C*", $dat)); - $s->{'Start'} = 0; - $s->{'Num'} = 256; - } elsif ($form == 6) - { - my ($start, $ecount); - - $fh->read($dat, 4); - ($start, $ecount) = unpack("n2", $dat); - $fh->read($dat, $ecount << 1); - $s->{'val'} = Font::TTF::Segarr->new; - $s->{'val'}->fastadd_segment($start, 2, unpack("n*", $dat)); - $s->{'Start'} = $start; - $s->{'Num'} = $ecount; - } elsif ($form == 2) - { -# no idea what to do here yet - } elsif ($form == 4) - { - $fh->read($dat, 8); - $num = unpack("n", $dat); - $num >>= 1; - $fh->read($dat, $len - 14); - $s->{'val'} = Font::TTF::Segarr->new; - for ($j = 0; $j < $num; $j++) - { - $end = unpack("n", substr($dat, $j << 1, 2)); - $start = unpack("n", substr($dat, ($j << 1) + ($num << 1) + 2, 2)); - $delta = unpack("n", substr($dat, ($j << 1) + ($num << 2) + 2, 2)); - $delta -= 65536 if $delta > 32767; - $range = unpack("n", substr($dat, ($j << 1) + $num * 6 + 2, 2)); - @ids = (); - for ($k = $start; $k <= $end; $k++) - { - if ($range == 0) - { $id = $k + $delta; } - else - { $id = unpack("n", substr($dat, ($j << 1) + $num * 6 + - 2 + ($k - $start) * 2 + $range, 2)) + $delta; } - $id -= 65536 if $id > 65536; - push (@ids, $id); - } - $s->{'val'}->fastadd_segment($start, 0, @ids); - } - $s->{'val'}->tidy; - $s->{'Num'} = 0x10000; # always ends here - $s->{'Start'} = $s->{'val'}[0]{'START'}; - } - } - $self; -} - - -=head2 $t->ms_lookup($uni) - -Given a Unicode value in the MS table (Platform 3, Encoding 1) locates that -table and looks up the appropriate glyph number from it. - -=cut - -sub ms_lookup -{ - my ($self, $uni) = @_; - - $self->find_ms || return undef unless (defined $self->{' mstable'}); - return $self->{' mstable'}{'val'}->at($uni); -} - - -=head2 $t->find_ms - -Finds the Microsoft Unicode table and sets the C instance variable -to it if found. Returns the table it finds. - -=cut -sub find_ms -{ - my ($self) = @_; - my ($i, $s, $alt); - - return $self->{' mstable'} if defined $self->{' mstable'}; - $self->read; - for ($i = 0; $i < $self->{'Num'}; $i++) - { - $s = $self->{'Tables'}[$i]; - if ($s->{'Platform'} == 3) - { - $self->{' mstable'} = $s; - last if ($s->{'Encoding'} == 1); - } elsif ($s->{'Platform'} == 0 || ($s->{'Platform'} == 2 && $s->{'Encoding'} == 1)) - { $self->{' mstable'} = $s; } - } - $self->{' mstable'}; -} - - -=head2 $t->out($fh) - -Writes out a cmap table to a filehandle. If it has not been read, then -just copies from input file to output - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($loc, $s, $i, $base_loc, $j); - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $base_loc = $fh->tell(); - $fh->print(pack("n2", 0, $self->{'Num'})); - - for ($i = 0; $i < $self->{'Num'}; $i++) - { $fh->print(pack("nnN", $self->{'Tables'}[$i]{'Platform'}, $self->{'Tables'}[$i]{'Encoding'}, 0)); } - - for ($i = 0; $i < $self->{'Num'}; $i++) - { - $s = $self->{'Tables'}[$i]; - $s->{'val'}->tidy; - $s->{' outloc'} = $fh->tell(); - $fh->print(pack("n3", $s->{'Format'}, 0, $s->{'Ver'})); # come back for length - if ($s->{'Format'} == 0) - { - $fh->print(pack("C256", $s->{'val'}->at(0, 256))); - } elsif ($s->{'Format'} == 6) - { - $fh->print(pack("n2", $s->{'Start'}, $s->{'Num'})); - $fh->print(pack("n*", $s->{'val'}->at($s->{'Start'}, $s->{'Num'}))); - } elsif ($s->{'Format'} == 2) - { - } elsif ($s->{'Format'} == 4) - { - my ($num, $sRange, $eSel); - my (@deltas, $delta, @range, $flat, $k, $segs, $count); - - $num = $#{$s->{'val'}} + 1; - $segs = $s->{'val'}; - for ($sRange = 1, $eSel = 0; $sRange <= $num; $eSel++) - { $sRange <<= 1;} - $eSel--; - $fh->print(pack("n4", $num * 2, $sRange, $eSel, ($num * 2) - $sRange)); - $fh->print(pack("n*", map {$_->{'START'} + $_->{'LEN'} - 1} @$segs)); - $fh->print(pack("n", 0)); - $fh->print(pack("n*", map {$_->{'START'}} @$segs)); - - for ($j = 0; $j < $num; $j++) - { - $delta = $segs->[$j]{'VAL'}[0]; $flat = 1; - for ($k = 1; $k < $segs->[$j]{'LEN'}; $k++) - { - if ($segs->[$j]{'VAL'}[$k] == 0) - { $flat = 0; } - if ($delta + $k != $segs->[$j]{'VAL'}[$k]) - { - $delta = 0; - last; - } - } - push (@range, $flat); - push (@deltas, ($delta ? $delta - $segs->[$j]{'START'} : 0)); - } - $fh->print(pack("n*", @deltas)); - - $count = 0; - for ($j = 0; $j < $num; $j++) - { - $delta = $deltas[$j]; - if ($delta != 0 && $range[$j] == 1) - { $range[$j] = 0; } - else - { - $range[$j] = ($count + $num - $j) << 1; - $count += $segs->[$j]{'LEN'}; - } - } - - $fh->print(pack("n*", @range)); - - for ($j = 0; $j < $num; $j++) - { - next if ($range[$j] == 0); - for ($k = 0; $k < $segs->[$j]{'LEN'}; $k++) - { $fh->print(pack("n", $segs->[$j]{'VAL'}[$k])); } - } - } - - $loc = $fh->tell(); - $fh->seek($s->{' outloc'} + 2, 0); - $fh->print(pack("n", $loc - $s->{' outloc'})); - $fh->seek($base_loc + 8 + ($i << 3), 0); - $fh->print(pack("N", $s->{' outloc'} - $base_loc)); - $fh->seek($loc, 0); - } - $self; -} - - -=head2 @map = $t->reverse([$num]) - -Returns a reverse map of the table of given number or the Microsoft -cmap. I.e. given a glyph gives the Unicode value for it. - -=cut - -sub reverse -{ - my ($self, $tnum) = @_; - my ($table) = defined $tnum ? $self->{'Tables'}[$tnum] : $self->find_ms; - my (@res, $i, $s, $first); - - foreach $s (@{$table->{'val'}}) - { - $first = $s->{'START'}; - map {$res[$_] = $first unless $res[$_]; $first++;} @{$s->{'VAL'}}; - } - @res; -} - -1; - -=head1 BUGS - -=over 4 - -=item * - -No support for format 2 tables (MBCS) - -=back - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OldMort.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OldMort.pm deleted file mode 100644 index 4e30f42..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OldMort.pm +++ /dev/null @@ -1,706 +0,0 @@ -package Font::TTF::OldMort; - -=head1 NAME - -Font::TTF::OldMort - Glyph Metamorphosis table in a font - -=head1 DESCRIPTION - -=head1 INSTANCE VARIABLES - -=item version - -table version number (Fixed: currently 1.0) - -=item chains - -list of metamorphosis chains, each of which has its own fields: - -=over - -=item defaultFlags - -chain's default subfeature flags (UInt32) - -=item featureEntries - -list of feature entries, each of which has fields: - -=over - -=item type - -=item setting - -=item enable - -=item disable - -=back - -=item subtables - -list of metamorphosis subtables, each of which has fields: - -=over - -=item type - -subtable type (0: rearrangement; 1: contextual substitution; 2: ligature; -4: non-contextual substitution; 5: insertion) - -=item direction - -processing direction ('LR' or 'RL') - -=item orientation - -applies to text in which orientation ('VH', 'V', or 'H') - -=item subFeatureFlags - -the subfeature flags controlling whether the table is used (UInt32) - -=back - -Further fields depend on the type of subtable: - -=over - -Rearrangement table: - -=over - -=item classes - -array of lists of glyphs - -=item states - -array of arrays of hashes{'nextState', 'flags'} - -=back - -Contextual substitution table: - -=over - -=item classes - -array of lists of glyphs - -=item states - -array of array of hashes{'nextState', 'flags', 'actions'}, where C -is an array of two elements which are offsets to be added to [marked, current] -glyph to get index into C (or C if no mapping to be applied) - -=item mappings - -list of glyph codes mapped to through the state table mappings - -=back - -Ligature table: - -Non-contextual substitution table: - -Insertion table: - -=back - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; -use IO::File; - -@ISA = qw(Font::TTF::Table); - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self) = @_; - my ($dat, $fh, $numChains); - - $self->SUPER::read or return $self; - - $fh = $self->{' INFILE'}; - - $fh->read($dat, 8); - ($self->{'version'}, $numChains) = TTF_Unpack("fL", $dat); - - my $chains = []; - foreach (1 .. $numChains) { - my $chainStart = $fh->tell(); - $fh->read($dat, 12); - my ($defaultFlags, $chainLength, $nFeatureEntries, $nSubtables) = TTF_Unpack("LLSS", $dat); - my $featureEntries = []; - foreach (1 .. $nFeatureEntries) { - $fh->read($dat, 12); - my ($featureType, $featureSetting, $enableFlags, $disableFlags) = TTF_Unpack("SSLL", $dat); - push @$featureEntries, { - 'type' => $featureType, - 'setting' => $featureSetting, - 'enable' => $enableFlags, - 'disable' => $disableFlags - }; - } - my $subtables = []; - foreach (1 .. $nSubtables) { - my $subtableStart = $fh->tell(); - $fh->read($dat, 8); - my ($length, $coverage, $subFeatureFlags) = TTF_Unpack("SSL", $dat); - my $type = $coverage & 0x0007; - - my $subtable = { - 'type' => $type, - 'direction' => (($coverage & 0x4000) ? 'RL' : 'LR'), - 'orientation' => (($coverage & 0x2000) ? 'VH' : ($coverage & 0x8000) ? 'V' : 'H'), - 'subFeatureFlags' => $subFeatureFlags - }; - - if ($type == 0) { # rearrangement - my ($classes, $states) = AAT_read_state_table($fh, 0); - $subtable->{'classes'} = $classes; - $subtable->{'states'} = $states; - } - - elsif ($type == 1) { # contextual - my $stateTableStart = $fh->tell(); - my ($classes, $states, $entries) = AAT_read_state_table($fh, 2); - - $fh->seek($stateTableStart, IO::File::SEEK_SET); - $fh->read($dat, 10); - my ($stateSize, $classTable, $stateArray, $entryTable, $mappingTables) = unpack("nnnnn", $dat); - my $limits = [$classTable, $stateArray, $entryTable, $mappingTables, $length - 8]; - - foreach (@$entries) { - my $actions = $_->{'actions'}; - foreach (@$actions) { - $_ = $_ ? $_ - ($mappingTables / 2) : undef; - } - } - - $subtable->{'classes'} = $classes; - $subtable->{'states'} = $states; - $subtable->{'mappings'} = [unpack("n*", AAT_read_subtable($fh, $stateTableStart, $mappingTables, $limits))]; - } - - elsif ($type == 2) { # ligature - my $stateTableStart = $fh->tell(); - my ($classes, $states, $entries) = AAT_read_state_table($fh, 0); - - $fh->seek($stateTableStart, IO::File::SEEK_SET); - $fh->read($dat, 14); - my ($stateSize, $classTable, $stateArray, $entryTable, - $ligActionTable, $componentTable, $ligatureTable) = unpack("nnnnnnn", $dat); - my $limits = [$classTable, $stateArray, $entryTable, $ligActionTable, $componentTable, $ligatureTable, $length - 8]; - - my %actions; - my $actionLists; - foreach (@$entries) { - my $offset = $_->{'flags'} & 0x3fff; - $_->{'flags'} &= ~0x3fff; - if ($offset != 0) { - if (not defined $actions{$offset}) { - $fh->seek($stateTableStart + $offset, IO::File::SEEK_SET); - my $actionList; - while (1) { - $fh->read($dat, 4); - my $action = unpack("N", $dat); - my ($last, $store, $component) = (($action & 0x80000000) != 0, ($action & 0xC0000000) != 0, ($action & 0x3fffffff)); - $component -= 0x40000000 if $component > 0x1fffffff; - $component -= $componentTable / 2; - push @$actionList, { 'store' => $store, 'component' => $component }; - last if $last; - } - push @$actionLists, $actionList; - $actions{$offset} = $#$actionLists; - } - $_->{'actions'} = $actions{$offset}; - } - } - - $subtable->{'componentTable'} = $componentTable; - my $components = [unpack("n*", AAT_read_subtable($fh, $stateTableStart, $componentTable, $limits))]; - foreach (@$components) { - $_ = ($_ - $ligatureTable) . " +" if $_ >= $ligatureTable; - } - $subtable->{'components'} = $components; - - $subtable->{'ligatureTable'} = $ligatureTable; - $subtable->{'ligatures'} = [unpack("n*", AAT_read_subtable($fh, $stateTableStart, $ligatureTable, $limits))]; - - $subtable->{'classes'} = $classes; - $subtable->{'states'} = $states; - $subtable->{'actionLists'} = $actionLists; - } - - elsif ($type == 4) { # non-contextual - my ($format, $lookup) = AAT_read_lookup($fh, 2, $length - 8, undef); - $subtable->{'format'} = $format; - $subtable->{'lookup'} = $lookup; - } - - elsif ($type == 5) { # insertion - my $stateTableStart = $fh->tell(); - my ($classes, $states, $entries) = AAT_read_state_table($fh, 2); - - my %insertListHash; - my $insertLists; - foreach (@$entries) { - my $flags = $_->{'flags'}; - my @insertCount = (($flags & 0x03e0) >> 5, ($flags & 0x001f)); - my $actions = $_->{'actions'}; - foreach (0 .. 1) { - if ($insertCount[$_] > 0) { - $fh->seek($stateTableStart + $actions->[$_], IO::File::SEEK_SET); - $fh->read($dat, $insertCount[$_] * 2); - if (not defined $insertListHash{$dat}) { - push @$insertLists, [unpack("n*", $dat)]; - $insertListHash{$dat} = $#$insertLists; - } - $actions->[$_] = $insertListHash{$dat}; - } - else { - $actions->[$_] = undef; - } - } - } - - $subtable->{'classes'} = $classes; - $subtable->{'states'} = $states; - $subtable->{'insertLists'} = $insertLists; - } - - else { - die "unknown subtable type"; - } - - push @$subtables, $subtable; - $fh->seek($subtableStart + $length, IO::File::SEEK_SET); - } - - push @$chains, { - 'defaultFlags' => $defaultFlags, - 'featureEntries' => $featureEntries, - 'subtables' => $subtables - }; - $fh->seek($chainStart + $chainLength, IO::File::SEEK_SET); - } - - $self->{'chains'} = $chains; - - $self; -} - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying - -=cut - -sub out -{ - my ($self, $fh) = @_; - - return $self->SUPER::out($fh) unless $self->{' read'}; - - my $chains = $self->{'chains'}; - $fh->print(TTF_Pack("fL", $self->{'version'}, scalar @$chains)); - - foreach (@$chains) { - my $chainStart = $fh->tell(); - my ($featureEntries, $subtables) = ($_->{'featureEntries'}, $_->{'subtables'}); - $fh->print(TTF_Pack("LLSS", $_->{'defaultFlags'}, 0, scalar @$featureEntries, scalar @$subtables)); # placeholder for length - - foreach (@$featureEntries) { - $fh->print(TTF_Pack("SSLL", $_->{'type'}, $_->{'setting'}, $_->{'enable'}, $_->{'disable'})); - } - - foreach (@$subtables) { - my $subtableStart = $fh->tell(); - my $type = $_->{'type'}; - my $coverage = $type; - $coverage += 0x4000 if $_->{'direction'} eq 'RL'; - $coverage += 0x2000 if $_->{'orientation'} eq 'VH'; - $coverage += 0x8000 if $_->{'orientation'} eq 'V'; - - $fh->print(TTF_Pack("SSL", 0, $coverage, $_->{'subFeatureFlags'})); # placeholder for length - - if ($type == 0) { # rearrangement - AAT_write_state_table($fh, $_->{'classes'}, $_->{'states'}, 0); - } - - elsif ($type == 1) { # contextual - my $stHeader = $fh->tell(); - $fh->print(pack("nnnnn", (0) x 5)); # placeholders for stateSize, classTable, stateArray, entryTable, mappingTables - - my $classTable = $fh->tell() - $stHeader; - my $classes = $_->{'classes'}; - AAT_write_classes($fh, $classes); - - my $stateArray = $fh->tell() - $stHeader; - my $states = $_->{'states'}; - my ($stateSize, $entries) = AAT_write_states($fh, $classes, $stateArray, $states, - sub { - my $actions = $_->{'actions'}; - ( $_->{'flags'}, @$actions ) - } - ); - - my $entryTable = $fh->tell() - $stHeader; - my $offset = ($entryTable + 8 * @$entries) / 2; - foreach (@$entries) { - my ($nextState, $flags, @parts) = split /,/; - $fh->print(pack("nnnn", $nextState, $flags, map { $_ eq "" ? 0 : $_ + $offset } @parts)); - } - - my $mappingTables = $fh->tell() - $stHeader; - my $mappings = $_->{'mappings'}; - $fh->print(pack("n*", @$mappings)); - - my $loc = $fh->tell(); - $fh->seek($stHeader, IO::File::SEEK_SET); - $fh->print(pack("nnnnn", $stateSize, $classTable, $stateArray, $entryTable, $mappingTables)); - $fh->seek($loc, IO::File::SEEK_SET); - } - - elsif ($type == 2) { # ligature - my $stHeader = $fh->tell(); - $fh->print(pack("nnnnnnn", (0) x 7)); # placeholders for stateSize, classTable, stateArray, entryTable, actionLists, components, ligatures - - my $classTable = $fh->tell() - $stHeader; - my $classes = $_->{'classes'}; - AAT_write_classes($fh, $classes); - - my $stateArray = $fh->tell() - $stHeader; - my $states = $_->{'states'}; - - my ($stateSize, $entries) = AAT_write_states($fh, $classes, $stateArray, $states, - sub { - ( $_->{'flags'} & 0xc000, $_->{'actions'} ) - } - ); - - my $actionLists = $_->{'actionLists'}; - my %actionListOffset; - my $actionListDataLength = 0; - my @actionListEntries; - foreach (0 .. $#$entries) { - my ($nextState, $flags, $offset) = split(/,/, $entries->[$_]); - if ($offset eq "") { - $offset = undef; - } - else { - if (defined $actionListOffset{$offset}) { - $offset = $actionListOffset{$offset}; - } - else { - $actionListOffset{$offset} = $actionListDataLength; - my $list = $actionLists->[$offset]; - $actionListDataLength += 4 * @$list; - push @actionListEntries, $list; - $offset = $actionListOffset{$offset}; - } - } - $entries->[$_] = [ $nextState, $flags, $offset ]; - } - my $entryTable = $fh->tell() - $stHeader; - my $ligActionLists = ($entryTable + @$entries * 4 + 3) & ~3; - foreach (@$entries) { - $_->[2] += $ligActionLists if defined $_->[2]; - $fh->print(pack("nn", $_->[0], $_->[1] + $_->[2])); - } - $fh->print(pack("C*", (0) x ($ligActionLists - $entryTable - @$entries * 4))); - - die "internal error" if $fh->tell() != $ligActionLists + $stHeader; - - my $componentTable = $fh->tell() - $stHeader + $actionListDataLength; - my $actionList; - foreach $actionList (@actionListEntries) { - foreach (0 .. $#$actionList) { - my $action = $actionList->[$_]; - my $val = $action->{'component'} + $componentTable / 2; - $val += 0x40000000 if $val < 0; - $val &= 0x3fffffff; - $val |= 0x40000000 if $action->{'store'}; - $val |= 0x80000000 if $_ == $#$actionList; - $fh->print(pack("N", $val)); - } - } - - die "internal error" if $fh->tell() != $componentTable + $stHeader; - - my $components = $_->{'components'}; - my $ligatureTable = $componentTable + @$components * 2; - $fh->print(pack("n*", map { (index($_, '+') >= 0 ? $ligatureTable : 0) + $_ } @$components)); - - my $ligatures = $_->{'ligatures'}; - $fh->print(pack("n*", @$ligatures)); - - my $loc = $fh->tell(); - $fh->seek($stHeader, IO::File::SEEK_SET); - $fh->print(pack("nnnnnnn", $stateSize, $classTable, $stateArray, $entryTable, $ligActionLists, $componentTable, $ligatureTable)); - $fh->seek($loc, IO::File::SEEK_SET); - } - - elsif ($type == 4) { # non-contextual - AAT_write_lookup($fh, $_->{'format'}, $_->{'lookup'}, 2, undef); - } - - elsif ($type == 5) { # insertion - } - - else { - die "unknown subtable type"; - } - - my $length = $fh->tell() - $subtableStart; - my $padBytes = (4 - ($length & 3)) & 3; - $fh->print(pack("C*", (0) x $padBytes)); - $length += $padBytes; - $fh->seek($subtableStart, IO::File::SEEK_SET); - $fh->print(pack("n", $length)); - $fh->seek($subtableStart + $length, IO::File::SEEK_SET); - } - - my $chainLength = $fh->tell() - $chainStart; - $fh->seek($chainStart + 4, IO::File::SEEK_SET); - $fh->print(pack("N", $chainLength)); - $fh->seek($chainStart + $chainLength, IO::File::SEEK_SET); - } -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - - $self->read; - my $feat = $self->{' PARENT'}->{'feat'}; - $feat->read; - my $post = $self->{' PARENT'}->{'post'}; - $post->read; - - $fh = 'STDOUT' unless defined $fh; - - $fh->printf("version %f\n", $self->{'version'}); - - my $chains = $self->{'chains'}; - foreach (@$chains) { - my $defaultFlags = $_->{'defaultFlags'}; - $fh->printf("chain: defaultFlags = %08x\n", $defaultFlags); - - my $featureEntries = $_->{'featureEntries'}; - foreach (@$featureEntries) { - $fh->printf("\tfeature %d, setting %d : enableFlags = %08x, disableFlags = %08x # '%s: %s'\n", - $_->{'type'}, $_->{'setting'}, $_->{'enable'}, $_->{'disable'}, - $feat->settingName($_->{'type'}, $_->{'setting'})); - } - - my $subtables = $_->{'subtables'}; - foreach (@$subtables) { - my $type = $_->{'type'}; - my $subFeatureFlags = $_->{'subFeatureFlags'}; - $fh->printf("\n\t%s table, %s, %s, subFeatureFlags = %08x # %s (%s)\n", - subtable_type_($type), $_->{'direction'}, $_->{'orientation'}, $subFeatureFlags, - "Default " . ((($subFeatureFlags & $defaultFlags) != 0) ? "On" : "Off"), - join(", ", - map { - join(": ", $feat->settingName($_->{'type'}, $_->{'setting'}) ) - } grep { ($_->{'enable'} & $subFeatureFlags) != 0 } @$featureEntries - ) ); - - if ($type == 0) { # rearrangement - print_classes_($fh, $_, $post); - - $fh->print("\n"); - my $states = $_->{'states'}; - my @verbs = ( "0", "Ax->xA", "xD->Dx", "AxD->DxA", - "ABx->xAB", "ABx->xBA", "xCD->CDx", "xCD->DCx", - "AxCD->CDxA", "AxCD->DCxA", "ABxD->DxAB", "ABxD->DxBA", - "ABxCD->CDxAB", "ABxCD->CDxBA", "ABxCD->DCxAB", "ABxCD->DCxBA"); - foreach (0 .. $#$states) { - $fh->printf("\t\tState %d:", $_); - my $state = $states->[$_]; - foreach (@$state) { - my $flags; - $flags .= "!" if ($_->{'flags'} & 0x4000); - $flags .= "<" if ($_->{'flags'} & 0x8000); - $flags .= ">" if ($_->{'flags'} & 0x2000); - $fh->printf("\t(%s%d,%s)", $flags, $_->{'nextState'}, $verbs[($_->{'flags'} & 0x000f)]); - } - $fh->print("\n"); - } - } - - elsif ($type == 1) { # contextual - print_classes_($fh, $_, $post); - - $fh->print("\n"); - my $states = $_->{'states'}; - foreach (0 .. $#$states) { - $fh->printf("\t\tState %d:", $_); - my $state = $states->[$_]; - foreach (@$state) { - my $flags; - $flags .= "!" if ($_->{'flags'} & 0x4000); - $flags .= "*" if ($_->{'flags'} & 0x8000); - my $actions = $_->{'actions'}; - $fh->printf("\t(%s%d,%s,%s)", $flags, $_->{'nextState'}, map { defined $_ ? $_ : "=" } @$actions); - } - $fh->print("\n"); - } - - $fh->print("\n"); - my $mappings = $_->{'mappings'}; - foreach (0 .. $#$mappings) { - $fh->printf("\t\tMapping %d: %d [%s]\n", $_, $mappings->[$_], $post->{'VAL'}[$mappings->[$_]]); - } - } - - elsif ($type == 2) { # ligature - print_classes_($fh, $_, $post); - - $fh->print("\n"); - my $states = $_->{'states'}; - foreach (0 .. $#$states) { - $fh->printf("\t\tState %d:", $_); - my $state = $states->[$_]; - foreach (@$state) { - my $flags; - $flags .= "!" if ($_->{'flags'} & 0x4000); - $flags .= "*" if ($_->{'flags'} & 0x8000); - $fh->printf("\t(%s%d,%s)", $flags, $_->{'nextState'}, defined $_->{'actions'} ? $_->{'actions'} : "="); - } - $fh->print("\n"); - } - - $fh->print("\n"); - my $actionLists = $_->{'actionLists'}; - foreach (0 .. $#$actionLists) { - $fh->printf("\t\tList %d:\t", $_); - my $actionList = $actionLists->[$_]; - $fh->printf("%s\n", join(", ", map { ($_->{'component'} . ($_->{'store'} ? "*" : "") ) } @$actionList)); - } - - my $ligatureTable = $_->{'ligatureTable'}; - - $fh->print("\n"); - my $components = $_->{'components'}; - foreach (0 .. $#$components) { - $fh->printf("\t\tComponent %d: %s\n", $_, $components->[$_]); - } - - $fh->print("\n"); - my $ligatures = $_->{'ligatures'}; - foreach (0 .. $#$ligatures) { - $fh->printf("\t\tLigature %d: %d [%s]\n", $_, $ligatures->[$_], $post->{'VAL'}[$ligatures->[$_]]); - } - } - - elsif ($type == 4) { # non-contextual - my $lookup = $_->{'lookup'}; - $fh->printf("\t\tLookup format %d\n", $_->{'format'}); - if (defined $lookup) { - foreach (sort { $a <=> $b } keys %$lookup) { - $fh->printf("\t\t\t%d [%s] -> %d [%s])\n", $_, $post->{'VAL'}[$_], $lookup->{$_}, $post->{'VAL'}[$lookup->{$_}]); - } - } - } - - elsif ($type == 5) { # insertion - print_classes_($fh, $_, $post); - - $fh->print("\n"); - my $states = $_->{'states'}; - foreach (0 .. $#$states) { - $fh->printf("\t\tState %d:", $_); - my $state = $states->[$_]; - foreach (@$state) { - my $flags; - $flags .= "!" if ($_->{'flags'} & 0x4000); - $flags .= "*" if ($_->{'flags'} & 0x8000); - my $actions = $_->{'actions'}; - $fh->printf("\t(%s%d,%s,%s)", $flags, $_->{'nextState'}, map { defined $_ ? $_ : "=" } @$actions); - } - $fh->print("\n"); - } - - $fh->print("\n"); - my $insertLists = $_->{'insertLists'}; - foreach (0 .. $#$insertLists) { - my $insertList = $insertLists->[$_]; - $fh->printf("\t\tList %d: %s\n", $_, join(", ", map { $_ . " [" . $post->{'VAL'}[$_] . "]" } @$insertList)); - } - } - - else { - # unknown - } - } - } -} - -sub print_classes_ -{ - my ($fh, $subtable, $post) = @_; - - my $classes = $subtable->{'classes'}; - foreach (0 .. $#$classes) { - my $class = $classes->[$_]; - if (defined $class) { - $fh->printf("\t\tClass %d:\t%s\n", $_, join(", ", map { $_ . " [" . $post->{'VAL'}[$_] . "]" } @$class)); - } - } -} - -sub subtable_type_ -{ - my ($val) = @_; - my ($res); - - my @types = ( - 'Rearrangement', - 'Contextual', - 'Ligature', - undef, - 'Non-contextual', - 'Insertion', - ); - $res = $types[$val] or ('Undefined (' . $val . ')'); - - $res; -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/PCLT.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/PCLT.pm deleted file mode 100644 index 2856c16..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/PCLT.pm +++ /dev/null @@ -1,121 +0,0 @@ -package Font::TTF::PCLT; - -=head1 NAME - -Font::TTF::PCLT - PCLT TrueType font table - -=head1 DESCRIPTION - -The PCLT table holds various pieces HP-PCL specific information. Information -here is generally not used by other software, except for the xHeight and -CapHeight which are stored here (if the table exists in a font). - -=head1 INSTANCE VARIABLES - -Only from table and the standard: - - version - FontNumber - Pitch - xHeight - Style - TypeFamily - CapHeight - SymbolSet - Typeface - CharacterComplement - FileName - StrokeWeight - WidthType - SerifStyle - -Notice that C, C and C return arrays -of unsigned characters of the appropriate length - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA %fields @field_info); - -require Font::TTF::Table; -use Font::TTF::Utils; - -@ISA = qw(Font::TTF::Table); -@field_info = ( - 'version' => 'v', - 'FontNumber' => 'L', - 'Pitch' => 'S', - 'xHeight' => 'S', - 'Style' => 'S', - 'TypeFamily' => 'S', - 'CapHeight' => 'S', - 'SymbolSet' => 'S', - 'Typeface' => 'C16', - 'CharacterComplement' => 'C8', - 'FileName' => 'C6', - 'StrokeWeight' => 'C', - 'WidthType' => 'C', - 'SerifStyle' => 'c'); - -sub init -{ - my ($k, $v, $c, $i); - for ($i = 0; $i < $#field_info; $i += 2) - { - ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); - next unless defined $k && $k ne ""; - $fields{$k} = $v; - } -} - - -=head2 $t->read - -Reads the table into memory thanks to some utility functions - -=cut - -sub read -{ - my ($self) = @_; - my ($dat); - - $self->SUPER::read || return $self; - - init unless defined $fields{'xHeight'}; - $self->{' INFILE'}->read($dat, 54); - - TTF_Read_Fields($self, $dat, \%fields); - $self; -} - - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying. - -=cut - -sub out -{ - my ($self, $fh) = @_; - - return $self->SUPER::out($fh) unless $self->{' read'}; - $fh->print(TTF_Out_Fields($self, \%fields, 54)); -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/PSNames.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/PSNames.pm deleted file mode 100644 index cb4c73b..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/PSNames.pm +++ /dev/null @@ -1,4447 +0,0 @@ -package Font::TTF::PSNames; - -=head1 NAME - -Font::TTF::PSNames - Utilities for Postscript glyph name processing - -=head1 SYNOPSIS - - use Font::TTF::PSNames qw(parse lookup); - $name = lookup($uni); - $uni = parse($name); - -=head1 METHODS - -=cut - -use strict; -use vars qw(%names %agl @EXPORT_OK @ISA); -require Exporter; -@ISA = qw( Exporter ); -@EXPORT_OK = qw( parse lookup); - -# Adobe Glyph List for New Fonts -# from http://partners.adobe.com/asn/tech/type/aglfn13.txt - -%names = ( - '0020' => 'space', - '0021' => 'exclam', - '0022' => 'quotedbl', - '0023' => 'numbersign', - '0024' => 'dollar', - '0025' => 'percent', - '0026' => 'ampersand', - '0027' => 'quotesingle', - '0028' => 'parenleft', - '0029' => 'parenright', - '002A' => 'asterisk', - '002B' => 'plus', - '002C' => 'comma', - '002D' => 'hyphen', - '002E' => 'period', - '002F' => 'slash', - '0030' => 'zero', - '0031' => 'one', - '0032' => 'two', - '0033' => 'three', - '0034' => 'four', - '0035' => 'five', - '0036' => 'six', - '0037' => 'seven', - '0038' => 'eight', - '0039' => 'nine', - '003A' => 'colon', - '003B' => 'semicolon', - '003C' => 'less', - '003D' => 'equal', - '003E' => 'greater', - '003F' => 'question', - '0040' => 'at', - '0041' => 'A', - '0042' => 'B', - '0043' => 'C', - '0044' => 'D', - '0045' => 'E', - '0046' => 'F', - '0047' => 'G', - '0048' => 'H', - '0049' => 'I', - '004A' => 'J', - '004B' => 'K', - '004C' => 'L', - '004D' => 'M', - '004E' => 'N', - '004F' => 'O', - '0050' => 'P', - '0051' => 'Q', - '0052' => 'R', - '0053' => 'S', - '0054' => 'T', - '0055' => 'U', - '0056' => 'V', - '0057' => 'W', - '0058' => 'X', - '0059' => 'Y', - '005A' => 'Z', - '005B' => 'bracketleft', - '005C' => 'backslash', - '005D' => 'bracketright', - '005E' => 'asciicircum', - '005F' => 'underscore', - '0060' => 'grave', - '0061' => 'a', - '0062' => 'b', - '0063' => 'c', - '0064' => 'd', - '0065' => 'e', - '0066' => 'f', - '0067' => 'g', - '0068' => 'h', - '0069' => 'i', - '006A' => 'j', - '006B' => 'k', - '006C' => 'l', - '006D' => 'm', - '006E' => 'n', - '006F' => 'o', - '0070' => 'p', - '0071' => 'q', - '0072' => 'r', - '0073' => 's', - '0074' => 't', - '0075' => 'u', - '0076' => 'v', - '0077' => 'w', - '0078' => 'x', - '0079' => 'y', - '007A' => 'z', - '007B' => 'braceleft', - '007C' => 'bar', - '007D' => 'braceright', - '007E' => 'asciitilde', -# '00A0' => 'space', - '00A1' => 'exclamdown', - '00A2' => 'cent', - '00A3' => 'sterling', - '00A4' => 'currency', - '00A5' => 'yen', - '00A6' => 'brokenbar', - '00A7' => 'section', - '00A8' => 'dieresis', - '00A9' => 'copyright', - '00AA' => 'ordfeminine', - '00AB' => 'guillemotleft', - '00AC' => 'logicalnot', -# '00AD' => 'hyphen', - '00AE' => 'registered', - '00AF' => 'macron', - '00B0' => 'degree', - '00B1' => 'plusminus', - '00B2' => 'twosuperior', - '00B3' => 'threesuperior', - '00B4' => 'acute', - '00B5' => 'mu', - '00B6' => 'paragraph', - '00B7' => 'periodcentered', - '00B8' => 'cedilla', - '00B9' => 'onesuperior', - '00BA' => 'ordmasculine', - '00BB' => 'guillemotright', - '00BC' => 'onequarter', - '00BD' => 'onehalf', - '00BE' => 'threequarters', - '00BF' => 'questiondown', - '00C0' => 'Agrave', - '00C1' => 'Aacute', - '00C2' => 'Acircumflex', - '00C3' => 'Atilde', - '00C4' => 'Adieresis', - '00C5' => 'Aring', - '00C6' => 'AE', - '00C7' => 'Ccedilla', - '00C8' => 'Egrave', - '00C9' => 'Eacute', - '00CA' => 'Ecircumflex', - '00CB' => 'Edieresis', - '00CC' => 'Igrave', - '00CD' => 'Iacute', - '00CE' => 'Icircumflex', - '00CF' => 'Idieresis', - '00D0' => 'Eth', - '00D1' => 'Ntilde', - '00D2' => 'Ograve', - '00D3' => 'Oacute', - '00D4' => 'Ocircumflex', - '00D5' => 'Otilde', - '00D6' => 'Odieresis', - '00D7' => 'multiply', - '00D8' => 'Oslash', - '00D9' => 'Ugrave', - '00DA' => 'Uacute', - '00DB' => 'Ucircumflex', - '00DC' => 'Udieresis', - '00DD' => 'Yacute', - '00DE' => 'Thorn', - '00DF' => 'germandbls', - '00E0' => 'agrave', - '00E1' => 'aacute', - '00E2' => 'acircumflex', - '00E3' => 'atilde', - '00E4' => 'adieresis', - '00E5' => 'aring', - '00E6' => 'ae', - '00E7' => 'ccedilla', - '00E8' => 'egrave', - '00E9' => 'eacute', - '00EA' => 'ecircumflex', - '00EB' => 'edieresis', - '00EC' => 'igrave', - '00ED' => 'iacute', - '00EE' => 'icircumflex', - '00EF' => 'idieresis', - '00F0' => 'eth', - '00F1' => 'ntilde', - '00F2' => 'ograve', - '00F3' => 'oacute', - '00F4' => 'ocircumflex', - '00F5' => 'otilde', - '00F6' => 'odieresis', - '00F7' => 'divide', - '00F8' => 'oslash', - '00F9' => 'ugrave', - '00FA' => 'uacute', - '00FB' => 'ucircumflex', - '00FC' => 'udieresis', - '00FD' => 'yacute', - '00FE' => 'thorn', - '00FF' => 'ydieresis', - '0100' => 'Amacron', - '0101' => 'amacron', - '0102' => 'Abreve', - '0103' => 'abreve', - '0104' => 'Aogonek', - '0105' => 'aogonek', - '0106' => 'Cacute', - '0107' => 'cacute', - '0108' => 'Ccircumflex', - '0109' => 'ccircumflex', - '010A' => 'Cdotaccent', - '010B' => 'cdotaccent', - '010C' => 'Ccaron', - '010D' => 'ccaron', - '010E' => 'Dcaron', - '010F' => 'dcaron', - '0110' => 'Dcroat', - '0111' => 'dcroat', - '0112' => 'Emacron', - '0113' => 'emacron', - '0114' => 'Ebreve', - '0115' => 'ebreve', - '0116' => 'Edotaccent', - '0117' => 'edotaccent', - '0118' => 'Eogonek', - '0119' => 'eogonek', - '011A' => 'Ecaron', - '011B' => 'ecaron', - '011C' => 'Gcircumflex', - '011D' => 'gcircumflex', - '011E' => 'Gbreve', - '011F' => 'gbreve', - '0120' => 'Gdotaccent', - '0121' => 'gdotaccent', - '0122' => 'Gcommaaccent', - '0123' => 'gcommaaccent', - '0124' => 'Hcircumflex', - '0125' => 'hcircumflex', - '0126' => 'Hbar', - '0127' => 'hbar', - '0128' => 'Itilde', - '0129' => 'itilde', - '012A' => 'Imacron', - '012B' => 'imacron', - '012C' => 'Ibreve', - '012D' => 'ibreve', - '012E' => 'Iogonek', - '012F' => 'iogonek', - '0130' => 'Idotaccent', - '0131' => 'dotlessi', - '0132' => 'IJ', - '0133' => 'ij', - '0134' => 'Jcircumflex', - '0135' => 'jcircumflex', - '0136' => 'Kcommaaccent', - '0137' => 'kcommaaccent', - '0138' => 'kgreenlandic', - '0139' => 'Lacute', - '013A' => 'lacute', - '013B' => 'Lcommaaccent', - '013C' => 'lcommaaccent', - '013D' => 'Lcaron', - '013E' => 'lcaron', - '013F' => 'Ldot', - '0140' => 'ldot', - '0141' => 'Lslash', - '0142' => 'lslash', - '0143' => 'Nacute', - '0144' => 'nacute', - '0145' => 'Ncommaaccent', - '0146' => 'ncommaaccent', - '0147' => 'Ncaron', - '0148' => 'ncaron', - '0149' => 'napostrophe', - '014A' => 'Eng', - '014B' => 'eng', - '014C' => 'Omacron', - '014D' => 'omacron', - '014E' => 'Obreve', - '014F' => 'obreve', - '0150' => 'Ohungarumlaut', - '0151' => 'ohungarumlaut', - '0152' => 'OE', - '0153' => 'oe', - '0154' => 'Racute', - '0155' => 'racute', - '0156' => 'Rcommaaccent', - '0157' => 'rcommaaccent', - '0158' => 'Rcaron', - '0159' => 'rcaron', - '015A' => 'Sacute', - '015B' => 'sacute', - '015C' => 'Scircumflex', - '015D' => 'scircumflex', - '015E' => 'Scedilla', - '015F' => 'scedilla', - '0160' => 'Scaron', - '0161' => 'scaron', - '0162' => 'Tcommaaccent', - '0163' => 'tcommaaccent', - '0164' => 'Tcaron', - '0165' => 'tcaron', - '0166' => 'Tbar', - '0167' => 'tbar', - '0168' => 'Utilde', - '0169' => 'utilde', - '016A' => 'Umacron', - '016B' => 'umacron', - '016C' => 'Ubreve', - '016D' => 'ubreve', - '016E' => 'Uring', - '016F' => 'uring', - '0170' => 'Uhungarumlaut', - '0171' => 'uhungarumlaut', - '0172' => 'Uogonek', - '0173' => 'uogonek', - '0174' => 'Wcircumflex', - '0175' => 'wcircumflex', - '0176' => 'Ycircumflex', - '0177' => 'ycircumflex', - '0178' => 'Ydieresis', - '0179' => 'Zacute', - '017A' => 'zacute', - '017B' => 'Zdotaccent', - '017C' => 'zdotaccent', - '017D' => 'Zcaron', - '017E' => 'zcaron', - '017F' => 'longs', - '0192' => 'florin', - '01A0' => 'Ohorn', - '01A1' => 'ohorn', - '01AF' => 'Uhorn', - '01B0' => 'uhorn', - '01E6' => 'Gcaron', - '01E7' => 'gcaron', - '01FA' => 'Aringacute', - '01FB' => 'aringacute', - '01FC' => 'AEacute', - '01FD' => 'aeacute', - '01FE' => 'Oslashacute', - '01FF' => 'oslashacute', - '0218' => 'Scommaaccent', - '0219' => 'scommaaccent', -# '021A' => 'Tcommaaccent', -# '021B' => 'tcommaaccent', - '02BC' => 'afii57929', - '02BD' => 'afii64937', - '02C6' => 'circumflex', - '02C7' => 'caron', -# '02C9' => 'macron', - '02D8' => 'breve', - '02D9' => 'dotaccent', - '02DA' => 'ring', - '02DB' => 'ogonek', - '02DC' => 'tilde', - '02DD' => 'hungarumlaut', - '0300' => 'gravecomb', - '0301' => 'acutecomb', - '0303' => 'tildecomb', - '0309' => 'hookabovecomb', - '0323' => 'dotbelowcomb', - '0384' => 'tonos', - '0385' => 'dieresistonos', - '0386' => 'Alphatonos', - '0387' => 'anoteleia', - '0388' => 'Epsilontonos', - '0389' => 'Etatonos', - '038A' => 'Iotatonos', - '038C' => 'Omicrontonos', - '038E' => 'Upsilontonos', - '038F' => 'Omegatonos', - '0390' => 'iotadieresistonos', - '0391' => 'Alpha', - '0392' => 'Beta', - '0393' => 'Gamma', -# '0394' => 'Delta', - '0395' => 'Epsilon', - '0396' => 'Zeta', - '0397' => 'Eta', - '0398' => 'Theta', - '0399' => 'Iota', - '039A' => 'Kappa', - '039B' => 'Lambda', - '039C' => 'Mu', - '039D' => 'Nu', - '039E' => 'Xi', - '039F' => 'Omicron', - '03A0' => 'Pi', - '03A1' => 'Rho', - '03A3' => 'Sigma', - '03A4' => 'Tau', - '03A5' => 'Upsilon', - '03A6' => 'Phi', - '03A7' => 'Chi', - '03A8' => 'Psi', -# '03A9' => 'Omega', - '03AA' => 'Iotadieresis', - '03AB' => 'Upsilondieresis', - '03AC' => 'alphatonos', - '03AD' => 'epsilontonos', - '03AE' => 'etatonos', - '03AF' => 'iotatonos', - '03B0' => 'upsilondieresistonos', - '03B1' => 'alpha', - '03B2' => 'beta', - '03B3' => 'gamma', - '03B4' => 'delta', - '03B5' => 'epsilon', - '03B6' => 'zeta', - '03B7' => 'eta', - '03B8' => 'theta', - '03B9' => 'iota', - '03BA' => 'kappa', - '03BB' => 'lambda', -# '03BC' => 'mu', - '03BD' => 'nu', - '03BE' => 'xi', - '03BF' => 'omicron', - '03C0' => 'pi', - '03C1' => 'rho', - '03C2' => 'sigma1', - '03C3' => 'sigma', - '03C4' => 'tau', - '03C5' => 'upsilon', - '03C6' => 'phi', - '03C7' => 'chi', - '03C8' => 'psi', - '03C9' => 'omega', - '03CA' => 'iotadieresis', - '03CB' => 'upsilondieresis', - '03CC' => 'omicrontonos', - '03CD' => 'upsilontonos', - '03CE' => 'omegatonos', - '03D1' => 'theta1', - '03D2' => 'Upsilon1', - '03D5' => 'phi1', - '03D6' => 'omega1', - '0401' => 'afii10023', - '0402' => 'afii10051', - '0403' => 'afii10052', - '0404' => 'afii10053', - '0405' => 'afii10054', - '0406' => 'afii10055', - '0407' => 'afii10056', - '0408' => 'afii10057', - '0409' => 'afii10058', - '040A' => 'afii10059', - '040B' => 'afii10060', - '040C' => 'afii10061', - '040E' => 'afii10062', - '040F' => 'afii10145', - '0410' => 'afii10017', - '0411' => 'afii10018', - '0412' => 'afii10019', - '0413' => 'afii10020', - '0414' => 'afii10021', - '0415' => 'afii10022', - '0416' => 'afii10024', - '0417' => 'afii10025', - '0418' => 'afii10026', - '0419' => 'afii10027', - '041A' => 'afii10028', - '041B' => 'afii10029', - '041C' => 'afii10030', - '041D' => 'afii10031', - '041E' => 'afii10032', - '041F' => 'afii10033', - '0420' => 'afii10034', - '0421' => 'afii10035', - '0422' => 'afii10036', - '0423' => 'afii10037', - '0424' => 'afii10038', - '0425' => 'afii10039', - '0426' => 'afii10040', - '0427' => 'afii10041', - '0428' => 'afii10042', - '0429' => 'afii10043', - '042A' => 'afii10044', - '042B' => 'afii10045', - '042C' => 'afii10046', - '042D' => 'afii10047', - '042E' => 'afii10048', - '042F' => 'afii10049', - '0430' => 'afii10065', - '0431' => 'afii10066', - '0432' => 'afii10067', - '0433' => 'afii10068', - '0434' => 'afii10069', - '0435' => 'afii10070', - '0436' => 'afii10072', - '0437' => 'afii10073', - '0438' => 'afii10074', - '0439' => 'afii10075', - '043A' => 'afii10076', - '043B' => 'afii10077', - '043C' => 'afii10078', - '043D' => 'afii10079', - '043E' => 'afii10080', - '043F' => 'afii10081', - '0440' => 'afii10082', - '0441' => 'afii10083', - '0442' => 'afii10084', - '0443' => 'afii10085', - '0444' => 'afii10086', - '0445' => 'afii10087', - '0446' => 'afii10088', - '0447' => 'afii10089', - '0448' => 'afii10090', - '0449' => 'afii10091', - '044A' => 'afii10092', - '044B' => 'afii10093', - '044C' => 'afii10094', - '044D' => 'afii10095', - '044E' => 'afii10096', - '044F' => 'afii10097', - '0451' => 'afii10071', - '0452' => 'afii10099', - '0453' => 'afii10100', - '0454' => 'afii10101', - '0455' => 'afii10102', - '0456' => 'afii10103', - '0457' => 'afii10104', - '0458' => 'afii10105', - '0459' => 'afii10106', - '045A' => 'afii10107', - '045B' => 'afii10108', - '045C' => 'afii10109', - '045E' => 'afii10110', - '045F' => 'afii10193', - '0462' => 'afii10146', - '0463' => 'afii10194', - '0472' => 'afii10147', - '0473' => 'afii10195', - '0474' => 'afii10148', - '0475' => 'afii10196', - '0490' => 'afii10050', - '0491' => 'afii10098', - '04D9' => 'afii10846', - '05B0' => 'afii57799', - '05B1' => 'afii57801', - '05B2' => 'afii57800', - '05B3' => 'afii57802', - '05B4' => 'afii57793', - '05B5' => 'afii57794', - '05B6' => 'afii57795', - '05B7' => 'afii57798', - '05B8' => 'afii57797', - '05B9' => 'afii57806', - '05BB' => 'afii57796', - '05BC' => 'afii57807', - '05BD' => 'afii57839', - '05BE' => 'afii57645', - '05BF' => 'afii57841', - '05C0' => 'afii57842', - '05C1' => 'afii57804', - '05C2' => 'afii57803', - '05C3' => 'afii57658', - '05D0' => 'afii57664', - '05D1' => 'afii57665', - '05D2' => 'afii57666', - '05D3' => 'afii57667', - '05D4' => 'afii57668', - '05D5' => 'afii57669', - '05D6' => 'afii57670', - '05D7' => 'afii57671', - '05D8' => 'afii57672', - '05D9' => 'afii57673', - '05DA' => 'afii57674', - '05DB' => 'afii57675', - '05DC' => 'afii57676', - '05DD' => 'afii57677', - '05DE' => 'afii57678', - '05DF' => 'afii57679', - '05E0' => 'afii57680', - '05E1' => 'afii57681', - '05E2' => 'afii57682', - '05E3' => 'afii57683', - '05E4' => 'afii57684', - '05E5' => 'afii57685', - '05E6' => 'afii57686', - '05E7' => 'afii57687', - '05E8' => 'afii57688', - '05E9' => 'afii57689', - '05EA' => 'afii57690', - '05F0' => 'afii57716', - '05F1' => 'afii57717', - '05F2' => 'afii57718', - '060C' => 'afii57388', - '061B' => 'afii57403', - '061F' => 'afii57407', - '0621' => 'afii57409', - '0622' => 'afii57410', - '0623' => 'afii57411', - '0624' => 'afii57412', - '0625' => 'afii57413', - '0626' => 'afii57414', - '0627' => 'afii57415', - '0628' => 'afii57416', - '0629' => 'afii57417', - '062A' => 'afii57418', - '062B' => 'afii57419', - '062C' => 'afii57420', - '062D' => 'afii57421', - '062E' => 'afii57422', - '062F' => 'afii57423', - '0630' => 'afii57424', - '0631' => 'afii57425', - '0632' => 'afii57426', - '0633' => 'afii57427', - '0634' => 'afii57428', - '0635' => 'afii57429', - '0636' => 'afii57430', - '0637' => 'afii57431', - '0638' => 'afii57432', - '0639' => 'afii57433', - '063A' => 'afii57434', - '0640' => 'afii57440', - '0641' => 'afii57441', - '0642' => 'afii57442', - '0643' => 'afii57443', - '0644' => 'afii57444', - '0645' => 'afii57445', - '0646' => 'afii57446', - '0647' => 'afii57470', - '0648' => 'afii57448', - '0649' => 'afii57449', - '064A' => 'afii57450', - '064B' => 'afii57451', - '064C' => 'afii57452', - '064D' => 'afii57453', - '064E' => 'afii57454', - '064F' => 'afii57455', - '0650' => 'afii57456', - '0651' => 'afii57457', - '0652' => 'afii57458', - '0660' => 'afii57392', - '0661' => 'afii57393', - '0662' => 'afii57394', - '0663' => 'afii57395', - '0664' => 'afii57396', - '0665' => 'afii57397', - '0666' => 'afii57398', - '0667' => 'afii57399', - '0668' => 'afii57400', - '0669' => 'afii57401', - '066A' => 'afii57381', - '066D' => 'afii63167', - '0679' => 'afii57511', - '067E' => 'afii57506', - '0686' => 'afii57507', - '0688' => 'afii57512', - '0691' => 'afii57513', - '0698' => 'afii57508', - '06A4' => 'afii57505', - '06AF' => 'afii57509', - '06BA' => 'afii57514', - '06D2' => 'afii57519', - '06D5' => 'afii57534', - '1E80' => 'Wgrave', - '1E81' => 'wgrave', - '1E82' => 'Wacute', - '1E83' => 'wacute', - '1E84' => 'Wdieresis', - '1E85' => 'wdieresis', - '1EF2' => 'Ygrave', - '1EF3' => 'ygrave', - '200C' => 'afii61664', - '200D' => 'afii301', - '200E' => 'afii299', - '200F' => 'afii300', - '2012' => 'figuredash', - '2013' => 'endash', - '2014' => 'emdash', - '2015' => 'afii00208', - '2017' => 'underscoredbl', - '2018' => 'quoteleft', - '2019' => 'quoteright', - '201A' => 'quotesinglbase', - '201B' => 'quotereversed', - '201C' => 'quotedblleft', - '201D' => 'quotedblright', - '201E' => 'quotedblbase', - '2020' => 'dagger', - '2021' => 'daggerdbl', - '2022' => 'bullet', - '2024' => 'onedotenleader', - '2025' => 'twodotenleader', - '2026' => 'ellipsis', - '202C' => 'afii61573', - '202D' => 'afii61574', - '202E' => 'afii61575', - '2030' => 'perthousand', - '2032' => 'minute', - '2033' => 'second', - '2039' => 'guilsinglleft', - '203A' => 'guilsinglright', - '203C' => 'exclamdbl', - '2044' => 'fraction', -# '2070' => 'zerosuperior', -# '2074' => 'foursuperior', -# '2075' => 'fivesuperior', -# '2076' => 'sixsuperior', -# '2077' => 'sevensuperior', -# '2078' => 'eightsuperior', -# '2079' => 'ninesuperior', -# '207D' => 'parenleftsuperior', -# '207E' => 'parenrightsuperior', -# '207F' => 'nsuperior', -# '2080' => 'zeroinferior', -# '2081' => 'oneinferior', -# '2082' => 'twoinferior', -# '2083' => 'threeinferior', -# '2084' => 'fourinferior', -# '2085' => 'fiveinferior', -# '2086' => 'sixinferior', -# '2087' => 'seveninferior', -# '2088' => 'eightinferior', -# '2089' => 'nineinferior', -# '208D' => 'parenleftinferior', -# '208E' => 'parenrightinferior', - '20A1' => 'colonmonetary', - '20A3' => 'franc', - '20A4' => 'lira', - '20A7' => 'peseta', - '20AA' => 'afii57636', - '20AB' => 'dong', - '20AC' => 'Euro', - '2105' => 'afii61248', - '2111' => 'Ifraktur', - '2113' => 'afii61289', - '2116' => 'afii61352', - '2118' => 'weierstrass', - '211C' => 'Rfraktur', - '211E' => 'prescription', - '2122' => 'trademark', - '2126' => 'Omega', - '212E' => 'estimated', - '2135' => 'aleph', - '2153' => 'onethird', - '2154' => 'twothirds', - '215B' => 'oneeighth', - '215C' => 'threeeighths', - '215D' => 'fiveeighths', - '215E' => 'seveneighths', - '2190' => 'arrowleft', - '2191' => 'arrowup', - '2192' => 'arrowright', - '2193' => 'arrowdown', - '2194' => 'arrowboth', - '2195' => 'arrowupdn', - '21A8' => 'arrowupdnbse', - '21B5' => 'carriagereturn', - '21D0' => 'arrowdblleft', - '21D1' => 'arrowdblup', - '21D2' => 'arrowdblright', - '21D3' => 'arrowdbldown', - '21D4' => 'arrowdblboth', - '2200' => 'universal', - '2202' => 'partialdiff', - '2203' => 'existential', - '2205' => 'emptyset', - '2206' => 'Delta', - '2207' => 'gradient', - '2208' => 'element', - '2209' => 'notelement', - '220B' => 'suchthat', - '220F' => 'product', - '2211' => 'summation', - '2212' => 'minus', -# '2215' => 'fraction', - '2217' => 'asteriskmath', -# '2219' => 'periodcentered', - '221A' => 'radical', - '221D' => 'proportional', - '221E' => 'infinity', - '221F' => 'orthogonal', - '2220' => 'angle', - '2227' => 'logicaland', - '2228' => 'logicalor', - '2229' => 'intersection', - '222A' => 'union', - '222B' => 'integral', - '2234' => 'therefore', - '223C' => 'similar', - '2245' => 'congruent', - '2248' => 'approxequal', - '2260' => 'notequal', - '2261' => 'equivalence', - '2264' => 'lessequal', - '2265' => 'greaterequal', - '2282' => 'propersubset', - '2283' => 'propersuperset', - '2284' => 'notsubset', - '2286' => 'reflexsubset', - '2287' => 'reflexsuperset', - '2295' => 'circleplus', - '2297' => 'circlemultiply', - '22A5' => 'perpendicular', - '22C5' => 'dotmath', - '2302' => 'house', - '2310' => 'revlogicalnot', - '2320' => 'integraltp', - '2321' => 'integralbt', - '2329' => 'angleleft', - '232A' => 'angleright', - '2500' => 'SF100000', - '2502' => 'SF110000', - '250C' => 'SF010000', - '2510' => 'SF030000', - '2514' => 'SF020000', - '2518' => 'SF040000', - '251C' => 'SF080000', - '2524' => 'SF090000', - '252C' => 'SF060000', - '2534' => 'SF070000', - '253C' => 'SF050000', - '2550' => 'SF430000', - '2551' => 'SF240000', - '2552' => 'SF510000', - '2553' => 'SF520000', - '2554' => 'SF390000', - '2555' => 'SF220000', - '2556' => 'SF210000', - '2557' => 'SF250000', - '2558' => 'SF500000', - '2559' => 'SF490000', - '255A' => 'SF380000', - '255B' => 'SF280000', - '255C' => 'SF270000', - '255D' => 'SF260000', - '255E' => 'SF360000', - '255F' => 'SF370000', - '2560' => 'SF420000', - '2561' => 'SF190000', - '2562' => 'SF200000', - '2563' => 'SF230000', - '2564' => 'SF470000', - '2565' => 'SF480000', - '2566' => 'SF410000', - '2567' => 'SF450000', - '2568' => 'SF460000', - '2569' => 'SF400000', - '256A' => 'SF540000', - '256B' => 'SF530000', - '256C' => 'SF440000', - '2580' => 'upblock', - '2584' => 'dnblock', - '2588' => 'block', - '258C' => 'lfblock', - '2590' => 'rtblock', - '2591' => 'ltshade', - '2592' => 'shade', - '2593' => 'dkshade', - '25A0' => 'filledbox', - '25A1' => 'H22073', - '25AA' => 'H18543', - '25AB' => 'H18551', - '25AC' => 'filledrect', - '25B2' => 'triagup', - '25BA' => 'triagrt', - '25BC' => 'triagdn', - '25C4' => 'triaglf', - '25CA' => 'lozenge', - '25CB' => 'circle', - '25CF' => 'H18533', - '25D8' => 'invbullet', - '25D9' => 'invcircle', - '25E6' => 'openbullet', - '263A' => 'smileface', - '263B' => 'invsmileface', - '263C' => 'sun', - '2640' => 'female', - '2642' => 'male', - '2660' => 'spade', - '2663' => 'club', - '2665' => 'heart', - '2666' => 'diamond', - '266A' => 'musicalnote', - '266B' => 'musicalnotedbl', - 'FB00' => 'ff', - 'FB01' => 'fi', - 'FB02' => 'fl', - 'FB03' => 'ffi', - 'FB04' => 'ffl', - 'FB1F' => 'afii57705', - 'FB2A' => 'afii57694', - 'FB2B' => 'afii57695', - 'FB35' => 'afii57723', - 'FB4B' => 'afii57700', -); - -# Adobe Glyph List 2.0 (sans those in glyph list for *new* fonts) -- thus -# these are all historic names that could occur in fonts -# from http://partners.adobe.com/asn/tech/type/glyphlist.txt - -%agl = ( - 'AEmacron' => "\x{01E2}", - 'AEsmall' => "\x{F7E6}", - 'Aacutesmall' => "\x{F7E1}", - 'Abreveacute' => "\x{1EAE}", - 'Abrevecyrillic' => "\x{04D0}", - 'Abrevedotbelow' => "\x{1EB6}", - 'Abrevegrave' => "\x{1EB0}", - 'Abrevehookabove' => "\x{1EB2}", - 'Abrevetilde' => "\x{1EB4}", - 'Acaron' => "\x{01CD}", - 'Acircle' => "\x{24B6}", - 'Acircumflexacute' => "\x{1EA4}", - 'Acircumflexdotbelow' => "\x{1EAC}", - 'Acircumflexgrave' => "\x{1EA6}", - 'Acircumflexhookabove' => "\x{1EA8}", - 'Acircumflexsmall' => "\x{F7E2}", - 'Acircumflextilde' => "\x{1EAA}", - 'Acute' => "\x{F6C9}", - 'Acutesmall' => "\x{F7B4}", - 'Acyrillic' => "\x{0410}", - 'Adblgrave' => "\x{0200}", - 'Adieresiscyrillic' => "\x{04D2}", - 'Adieresismacron' => "\x{01DE}", - 'Adieresissmall' => "\x{F7E4}", - 'Adotbelow' => "\x{1EA0}", - 'Adotmacron' => "\x{01E0}", - 'Agravesmall' => "\x{F7E0}", - 'Ahookabove' => "\x{1EA2}", - 'Aiecyrillic' => "\x{04D4}", - 'Ainvertedbreve' => "\x{0202}", - 'Amonospace' => "\x{FF21}", - 'Aringbelow' => "\x{1E00}", - 'Aringsmall' => "\x{F7E5}", - 'Asmall' => "\x{F761}", - 'Atildesmall' => "\x{F7E3}", - 'Aybarmenian' => "\x{0531}", - 'Bcircle' => "\x{24B7}", - 'Bdotaccent' => "\x{1E02}", - 'Bdotbelow' => "\x{1E04}", - 'Becyrillic' => "\x{0411}", - 'Benarmenian' => "\x{0532}", - 'Bhook' => "\x{0181}", - 'Blinebelow' => "\x{1E06}", - 'Bmonospace' => "\x{FF22}", - 'Brevesmall' => "\x{F6F4}", - 'Bsmall' => "\x{F762}", - 'Btopbar' => "\x{0182}", - 'Caarmenian' => "\x{053E}", - 'Caron' => "\x{F6CA}", - 'Caronsmall' => "\x{F6F5}", - 'Ccedillaacute' => "\x{1E08}", - 'Ccedillasmall' => "\x{F7E7}", - 'Ccircle' => "\x{24B8}", - 'Cdot' => "\x{010A}", - 'Cedillasmall' => "\x{F7B8}", - 'Chaarmenian' => "\x{0549}", - 'Cheabkhasiancyrillic' => "\x{04BC}", - 'Checyrillic' => "\x{0427}", - 'Chedescenderabkhasiancyrillic' => "\x{04BE}", - 'Chedescendercyrillic' => "\x{04B6}", - 'Chedieresiscyrillic' => "\x{04F4}", - 'Cheharmenian' => "\x{0543}", - 'Chekhakassiancyrillic' => "\x{04CB}", - 'Cheverticalstrokecyrillic' => "\x{04B8}", - 'Chook' => "\x{0187}", - 'Circumflexsmall' => "\x{F6F6}", - 'Cmonospace' => "\x{FF23}", - 'Coarmenian' => "\x{0551}", - 'Csmall' => "\x{F763}", - 'DZ' => "\x{01F1}", - 'DZcaron' => "\x{01C4}", - 'Daarmenian' => "\x{0534}", - 'Dafrican' => "\x{0189}", - 'Dcedilla' => "\x{1E10}", - 'Dcircle' => "\x{24B9}", - 'Dcircumflexbelow' => "\x{1E12}", - 'Ddotaccent' => "\x{1E0A}", - 'Ddotbelow' => "\x{1E0C}", - 'Decyrillic' => "\x{0414}", - 'Deicoptic' => "\x{03EE}", - 'Deltagreek' => "\x{0394}", - 'Dhook' => "\x{018A}", - 'Dieresis' => "\x{F6CB}", - 'DieresisAcute' => "\x{F6CC}", - 'DieresisGrave' => "\x{F6CD}", - 'Dieresissmall' => "\x{F7A8}", - 'Digammagreek' => "\x{03DC}", - 'Djecyrillic' => "\x{0402}", - 'Dlinebelow' => "\x{1E0E}", - 'Dmonospace' => "\x{FF24}", - 'Dotaccentsmall' => "\x{F6F7}", - 'Dslash' => "\x{0110}", - 'Dsmall' => "\x{F764}", - 'Dtopbar' => "\x{018B}", - 'Dz' => "\x{01F2}", - 'Dzcaron' => "\x{01C5}", - 'Dzeabkhasiancyrillic' => "\x{04E0}", - 'Dzecyrillic' => "\x{0405}", - 'Dzhecyrillic' => "\x{040F}", - 'Eacutesmall' => "\x{F7E9}", - 'Ecedillabreve' => "\x{1E1C}", - 'Echarmenian' => "\x{0535}", - 'Ecircle' => "\x{24BA}", - 'Ecircumflexacute' => "\x{1EBE}", - 'Ecircumflexbelow' => "\x{1E18}", - 'Ecircumflexdotbelow' => "\x{1EC6}", - 'Ecircumflexgrave' => "\x{1EC0}", - 'Ecircumflexhookabove' => "\x{1EC2}", - 'Ecircumflexsmall' => "\x{F7EA}", - 'Ecircumflextilde' => "\x{1EC4}", - 'Ecyrillic' => "\x{0404}", - 'Edblgrave' => "\x{0204}", - 'Edieresissmall' => "\x{F7EB}", - 'Edot' => "\x{0116}", - 'Edotbelow' => "\x{1EB8}", - 'Efcyrillic' => "\x{0424}", - 'Egravesmall' => "\x{F7E8}", - 'Eharmenian' => "\x{0537}", - 'Ehookabove' => "\x{1EBA}", - 'Eightroman' => "\x{2167}", - 'Einvertedbreve' => "\x{0206}", - 'Eiotifiedcyrillic' => "\x{0464}", - 'Elcyrillic' => "\x{041B}", - 'Elevenroman' => "\x{216A}", - 'Emacronacute' => "\x{1E16}", - 'Emacrongrave' => "\x{1E14}", - 'Emcyrillic' => "\x{041C}", - 'Emonospace' => "\x{FF25}", - 'Encyrillic' => "\x{041D}", - 'Endescendercyrillic' => "\x{04A2}", - 'Enghecyrillic' => "\x{04A4}", - 'Enhookcyrillic' => "\x{04C7}", - 'Eopen' => "\x{0190}", - 'Ercyrillic' => "\x{0420}", - 'Ereversed' => "\x{018E}", - 'Ereversedcyrillic' => "\x{042D}", - 'Escyrillic' => "\x{0421}", - 'Esdescendercyrillic' => "\x{04AA}", - 'Esh' => "\x{01A9}", - 'Esmall' => "\x{F765}", - 'Etarmenian' => "\x{0538}", - 'Ethsmall' => "\x{F7F0}", - 'Etilde' => "\x{1EBC}", - 'Etildebelow' => "\x{1E1A}", - 'Ezh' => "\x{01B7}", - 'Ezhcaron' => "\x{01EE}", - 'Ezhreversed' => "\x{01B8}", - 'Fcircle' => "\x{24BB}", - 'Fdotaccent' => "\x{1E1E}", - 'Feharmenian' => "\x{0556}", - 'Feicoptic' => "\x{03E4}", - 'Fhook' => "\x{0191}", - 'Fitacyrillic' => "\x{0472}", - 'Fiveroman' => "\x{2164}", - 'Fmonospace' => "\x{FF26}", - 'Fourroman' => "\x{2163}", - 'Fsmall' => "\x{F766}", - 'GBsquare' => "\x{3387}", - 'Gacute' => "\x{01F4}", - 'Gammaafrican' => "\x{0194}", - 'Gangiacoptic' => "\x{03EA}", - 'Gcedilla' => "\x{0122}", - 'Gcircle' => "\x{24BC}", - 'Gdot' => "\x{0120}", - 'Gecyrillic' => "\x{0413}", - 'Ghadarmenian' => "\x{0542}", - 'Ghemiddlehookcyrillic' => "\x{0494}", - 'Ghestrokecyrillic' => "\x{0492}", - 'Gheupturncyrillic' => "\x{0490}", - 'Ghook' => "\x{0193}", - 'Gimarmenian' => "\x{0533}", - 'Gjecyrillic' => "\x{0403}", - 'Gmacron' => "\x{1E20}", - 'Gmonospace' => "\x{FF27}", - 'Grave' => "\x{F6CE}", - 'Gravesmall' => "\x{F760}", - 'Gsmall' => "\x{F767}", - 'Gsmallhook' => "\x{029B}", - 'Gstroke' => "\x{01E4}", - 'HPsquare' => "\x{33CB}", - 'Haabkhasiancyrillic' => "\x{04A8}", - 'Hadescendercyrillic' => "\x{04B2}", - 'Hardsigncyrillic' => "\x{042A}", - 'Hbrevebelow' => "\x{1E2A}", - 'Hcedilla' => "\x{1E28}", - 'Hcircle' => "\x{24BD}", - 'Hdieresis' => "\x{1E26}", - 'Hdotaccent' => "\x{1E22}", - 'Hdotbelow' => "\x{1E24}", - 'Hmonospace' => "\x{FF28}", - 'Hoarmenian' => "\x{0540}", - 'Horicoptic' => "\x{03E8}", - 'Hsmall' => "\x{F768}", - 'Hungarumlaut' => "\x{F6CF}", - 'Hungarumlautsmall' => "\x{F6F8}", - 'Hzsquare' => "\x{3390}", - 'IAcyrillic' => "\x{042F}", - 'IUcyrillic' => "\x{042E}", - 'Iacutesmall' => "\x{F7ED}", - 'Icaron' => "\x{01CF}", - 'Icircle' => "\x{24BE}", - 'Icircumflexsmall' => "\x{F7EE}", - 'Icyrillic' => "\x{0406}", - 'Idblgrave' => "\x{0208}", - 'Idieresisacute' => "\x{1E2E}", - 'Idieresiscyrillic' => "\x{04E4}", - 'Idieresissmall' => "\x{F7EF}", - 'Idot' => "\x{0130}", - 'Idotbelow' => "\x{1ECA}", - 'Iebrevecyrillic' => "\x{04D6}", - 'Iecyrillic' => "\x{0415}", - 'Igravesmall' => "\x{F7EC}", - 'Ihookabove' => "\x{1EC8}", - 'Iicyrillic' => "\x{0418}", - 'Iinvertedbreve' => "\x{020A}", - 'Iishortcyrillic' => "\x{0419}", - 'Imacroncyrillic' => "\x{04E2}", - 'Imonospace' => "\x{FF29}", - 'Iniarmenian' => "\x{053B}", - 'Iocyrillic' => "\x{0401}", - 'Iotaafrican' => "\x{0196}", - 'Ismall' => "\x{F769}", - 'Istroke' => "\x{0197}", - 'Itildebelow' => "\x{1E2C}", - 'Izhitsacyrillic' => "\x{0474}", - 'Izhitsadblgravecyrillic' => "\x{0476}", - 'Jaarmenian' => "\x{0541}", - 'Jcircle' => "\x{24BF}", - 'Jecyrillic' => "\x{0408}", - 'Jheharmenian' => "\x{054B}", - 'Jmonospace' => "\x{FF2A}", - 'Jsmall' => "\x{F76A}", - 'KBsquare' => "\x{3385}", - 'KKsquare' => "\x{33CD}", - 'Kabashkircyrillic' => "\x{04A0}", - 'Kacute' => "\x{1E30}", - 'Kacyrillic' => "\x{041A}", - 'Kadescendercyrillic' => "\x{049A}", - 'Kahookcyrillic' => "\x{04C3}", - 'Kastrokecyrillic' => "\x{049E}", - 'Kaverticalstrokecyrillic' => "\x{049C}", - 'Kcaron' => "\x{01E8}", - 'Kcedilla' => "\x{0136}", - 'Kcircle' => "\x{24C0}", - 'Kdotbelow' => "\x{1E32}", - 'Keharmenian' => "\x{0554}", - 'Kenarmenian' => "\x{053F}", - 'Khacyrillic' => "\x{0425}", - 'Kheicoptic' => "\x{03E6}", - 'Khook' => "\x{0198}", - 'Kjecyrillic' => "\x{040C}", - 'Klinebelow' => "\x{1E34}", - 'Kmonospace' => "\x{FF2B}", - 'Koppacyrillic' => "\x{0480}", - 'Koppagreek' => "\x{03DE}", - 'Ksicyrillic' => "\x{046E}", - 'Ksmall' => "\x{F76B}", - 'LJ' => "\x{01C7}", - 'LL' => "\x{F6BF}", - 'Lcedilla' => "\x{013B}", - 'Lcircle' => "\x{24C1}", - 'Lcircumflexbelow' => "\x{1E3C}", - 'Ldotaccent' => "\x{013F}", - 'Ldotbelow' => "\x{1E36}", - 'Ldotbelowmacron' => "\x{1E38}", - 'Liwnarmenian' => "\x{053C}", - 'Lj' => "\x{01C8}", - 'Ljecyrillic' => "\x{0409}", - 'Llinebelow' => "\x{1E3A}", - 'Lmonospace' => "\x{FF2C}", - 'Lslashsmall' => "\x{F6F9}", - 'Lsmall' => "\x{F76C}", - 'MBsquare' => "\x{3386}", - 'Macron' => "\x{F6D0}", - 'Macronsmall' => "\x{F7AF}", - 'Macute' => "\x{1E3E}", - 'Mcircle' => "\x{24C2}", - 'Mdotaccent' => "\x{1E40}", - 'Mdotbelow' => "\x{1E42}", - 'Menarmenian' => "\x{0544}", - 'Mmonospace' => "\x{FF2D}", - 'Msmall' => "\x{F76D}", - 'Mturned' => "\x{019C}", - 'NJ' => "\x{01CA}", - 'Ncedilla' => "\x{0145}", - 'Ncircle' => "\x{24C3}", - 'Ncircumflexbelow' => "\x{1E4A}", - 'Ndotaccent' => "\x{1E44}", - 'Ndotbelow' => "\x{1E46}", - 'Nhookleft' => "\x{019D}", - 'Nineroman' => "\x{2168}", - 'Nj' => "\x{01CB}", - 'Njecyrillic' => "\x{040A}", - 'Nlinebelow' => "\x{1E48}", - 'Nmonospace' => "\x{FF2E}", - 'Nowarmenian' => "\x{0546}", - 'Nsmall' => "\x{F76E}", - 'Ntildesmall' => "\x{F7F1}", - 'OEsmall' => "\x{F6FA}", - 'Oacutesmall' => "\x{F7F3}", - 'Obarredcyrillic' => "\x{04E8}", - 'Obarreddieresiscyrillic' => "\x{04EA}", - 'Ocaron' => "\x{01D1}", - 'Ocenteredtilde' => "\x{019F}", - 'Ocircle' => "\x{24C4}", - 'Ocircumflexacute' => "\x{1ED0}", - 'Ocircumflexdotbelow' => "\x{1ED8}", - 'Ocircumflexgrave' => "\x{1ED2}", - 'Ocircumflexhookabove' => "\x{1ED4}", - 'Ocircumflexsmall' => "\x{F7F4}", - 'Ocircumflextilde' => "\x{1ED6}", - 'Ocyrillic' => "\x{041E}", - 'Odblacute' => "\x{0150}", - 'Odblgrave' => "\x{020C}", - 'Odieresiscyrillic' => "\x{04E6}", - 'Odieresissmall' => "\x{F7F6}", - 'Odotbelow' => "\x{1ECC}", - 'Ogoneksmall' => "\x{F6FB}", - 'Ogravesmall' => "\x{F7F2}", - 'Oharmenian' => "\x{0555}", - 'Ohm' => "\x{2126}", - 'Ohookabove' => "\x{1ECE}", - 'Ohornacute' => "\x{1EDA}", - 'Ohorndotbelow' => "\x{1EE2}", - 'Ohorngrave' => "\x{1EDC}", - 'Ohornhookabove' => "\x{1EDE}", - 'Ohorntilde' => "\x{1EE0}", - 'Oi' => "\x{01A2}", - 'Oinvertedbreve' => "\x{020E}", - 'Omacronacute' => "\x{1E52}", - 'Omacrongrave' => "\x{1E50}", - 'Omegacyrillic' => "\x{0460}", - 'Omegagreek' => "\x{03A9}", - 'Omegaroundcyrillic' => "\x{047A}", - 'Omegatitlocyrillic' => "\x{047C}", - 'Omonospace' => "\x{FF2F}", - 'Oneroman' => "\x{2160}", - 'Oogonek' => "\x{01EA}", - 'Oogonekmacron' => "\x{01EC}", - 'Oopen' => "\x{0186}", - 'Oslashsmall' => "\x{F7F8}", - 'Osmall' => "\x{F76F}", - 'Ostrokeacute' => "\x{01FE}", - 'Otcyrillic' => "\x{047E}", - 'Otildeacute' => "\x{1E4C}", - 'Otildedieresis' => "\x{1E4E}", - 'Otildesmall' => "\x{F7F5}", - 'Pacute' => "\x{1E54}", - 'Pcircle' => "\x{24C5}", - 'Pdotaccent' => "\x{1E56}", - 'Pecyrillic' => "\x{041F}", - 'Peharmenian' => "\x{054A}", - 'Pemiddlehookcyrillic' => "\x{04A6}", - 'Phook' => "\x{01A4}", - 'Piwrarmenian' => "\x{0553}", - 'Pmonospace' => "\x{FF30}", - 'Psicyrillic' => "\x{0470}", - 'Psmall' => "\x{F770}", - 'Qcircle' => "\x{24C6}", - 'Qmonospace' => "\x{FF31}", - 'Qsmall' => "\x{F771}", - 'Raarmenian' => "\x{054C}", - 'Rcedilla' => "\x{0156}", - 'Rcircle' => "\x{24C7}", - 'Rdblgrave' => "\x{0210}", - 'Rdotaccent' => "\x{1E58}", - 'Rdotbelow' => "\x{1E5A}", - 'Rdotbelowmacron' => "\x{1E5C}", - 'Reharmenian' => "\x{0550}", - 'Ringsmall' => "\x{F6FC}", - 'Rinvertedbreve' => "\x{0212}", - 'Rlinebelow' => "\x{1E5E}", - 'Rmonospace' => "\x{FF32}", - 'Rsmall' => "\x{F772}", - 'Rsmallinverted' => "\x{0281}", - 'Rsmallinvertedsuperior' => "\x{02B6}", - 'Sacutedotaccent' => "\x{1E64}", - 'Sampigreek' => "\x{03E0}", - 'Scarondotaccent' => "\x{1E66}", - 'Scaronsmall' => "\x{F6FD}", - 'Schwa' => "\x{018F}", - 'Schwacyrillic' => "\x{04D8}", - 'Schwadieresiscyrillic' => "\x{04DA}", - 'Scircle' => "\x{24C8}", - 'Sdotaccent' => "\x{1E60}", - 'Sdotbelow' => "\x{1E62}", - 'Sdotbelowdotaccent' => "\x{1E68}", - 'Seharmenian' => "\x{054D}", - 'Sevenroman' => "\x{2166}", - 'Shaarmenian' => "\x{0547}", - 'Shacyrillic' => "\x{0428}", - 'Shchacyrillic' => "\x{0429}", - 'Sheicoptic' => "\x{03E2}", - 'Shhacyrillic' => "\x{04BA}", - 'Shimacoptic' => "\x{03EC}", - 'Sixroman' => "\x{2165}", - 'Smonospace' => "\x{FF33}", - 'Softsigncyrillic' => "\x{042C}", - 'Ssmall' => "\x{F773}", - 'Stigmagreek' => "\x{03DA}", - 'Tcedilla' => "\x{0162}", - 'Tcircle' => "\x{24C9}", - 'Tcircumflexbelow' => "\x{1E70}", - 'Tdotaccent' => "\x{1E6A}", - 'Tdotbelow' => "\x{1E6C}", - 'Tecyrillic' => "\x{0422}", - 'Tedescendercyrillic' => "\x{04AC}", - 'Tenroman' => "\x{2169}", - 'Tetsecyrillic' => "\x{04B4}", - 'Thook' => "\x{01AC}", - 'Thornsmall' => "\x{F7FE}", - 'Threeroman' => "\x{2162}", - 'Tildesmall' => "\x{F6FE}", - 'Tiwnarmenian' => "\x{054F}", - 'Tlinebelow' => "\x{1E6E}", - 'Tmonospace' => "\x{FF34}", - 'Toarmenian' => "\x{0539}", - 'Tonefive' => "\x{01BC}", - 'Tonesix' => "\x{0184}", - 'Tonetwo' => "\x{01A7}", - 'Tretroflexhook' => "\x{01AE}", - 'Tsecyrillic' => "\x{0426}", - 'Tshecyrillic' => "\x{040B}", - 'Tsmall' => "\x{F774}", - 'Twelveroman' => "\x{216B}", - 'Tworoman' => "\x{2161}", - 'Uacutesmall' => "\x{F7FA}", - 'Ucaron' => "\x{01D3}", - 'Ucircle' => "\x{24CA}", - 'Ucircumflexbelow' => "\x{1E76}", - 'Ucircumflexsmall' => "\x{F7FB}", - 'Ucyrillic' => "\x{0423}", - 'Udblacute' => "\x{0170}", - 'Udblgrave' => "\x{0214}", - 'Udieresisacute' => "\x{01D7}", - 'Udieresisbelow' => "\x{1E72}", - 'Udieresiscaron' => "\x{01D9}", - 'Udieresiscyrillic' => "\x{04F0}", - 'Udieresisgrave' => "\x{01DB}", - 'Udieresismacron' => "\x{01D5}", - 'Udieresissmall' => "\x{F7FC}", - 'Udotbelow' => "\x{1EE4}", - 'Ugravesmall' => "\x{F7F9}", - 'Uhookabove' => "\x{1EE6}", - 'Uhornacute' => "\x{1EE8}", - 'Uhorndotbelow' => "\x{1EF0}", - 'Uhorngrave' => "\x{1EEA}", - 'Uhornhookabove' => "\x{1EEC}", - 'Uhorntilde' => "\x{1EEE}", - 'Uhungarumlautcyrillic' => "\x{04F2}", - 'Uinvertedbreve' => "\x{0216}", - 'Ukcyrillic' => "\x{0478}", - 'Umacroncyrillic' => "\x{04EE}", - 'Umacrondieresis' => "\x{1E7A}", - 'Umonospace' => "\x{FF35}", - 'Upsilonacutehooksymbolgreek' => "\x{03D3}", - 'Upsilonafrican' => "\x{01B1}", - 'Upsilondieresishooksymbolgreek' => "\x{03D4}", - 'Upsilonhooksymbol' => "\x{03D2}", - 'Ushortcyrillic' => "\x{040E}", - 'Usmall' => "\x{F775}", - 'Ustraightcyrillic' => "\x{04AE}", - 'Ustraightstrokecyrillic' => "\x{04B0}", - 'Utildeacute' => "\x{1E78}", - 'Utildebelow' => "\x{1E74}", - 'Vcircle' => "\x{24CB}", - 'Vdotbelow' => "\x{1E7E}", - 'Vecyrillic' => "\x{0412}", - 'Vewarmenian' => "\x{054E}", - 'Vhook' => "\x{01B2}", - 'Vmonospace' => "\x{FF36}", - 'Voarmenian' => "\x{0548}", - 'Vsmall' => "\x{F776}", - 'Vtilde' => "\x{1E7C}", - 'Wcircle' => "\x{24CC}", - 'Wdotaccent' => "\x{1E86}", - 'Wdotbelow' => "\x{1E88}", - 'Wmonospace' => "\x{FF37}", - 'Wsmall' => "\x{F777}", - 'Xcircle' => "\x{24CD}", - 'Xdieresis' => "\x{1E8C}", - 'Xdotaccent' => "\x{1E8A}", - 'Xeharmenian' => "\x{053D}", - 'Xmonospace' => "\x{FF38}", - 'Xsmall' => "\x{F778}", - 'Yacutesmall' => "\x{F7FD}", - 'Yatcyrillic' => "\x{0462}", - 'Ycircle' => "\x{24CE}", - 'Ydieresissmall' => "\x{F7FF}", - 'Ydotaccent' => "\x{1E8E}", - 'Ydotbelow' => "\x{1EF4}", - 'Yericyrillic' => "\x{042B}", - 'Yerudieresiscyrillic' => "\x{04F8}", - 'Yhook' => "\x{01B3}", - 'Yhookabove' => "\x{1EF6}", - 'Yiarmenian' => "\x{0545}", - 'Yicyrillic' => "\x{0407}", - 'Yiwnarmenian' => "\x{0552}", - 'Ymonospace' => "\x{FF39}", - 'Ysmall' => "\x{F779}", - 'Ytilde' => "\x{1EF8}", - 'Yusbigcyrillic' => "\x{046A}", - 'Yusbigiotifiedcyrillic' => "\x{046C}", - 'Yuslittlecyrillic' => "\x{0466}", - 'Yuslittleiotifiedcyrillic' => "\x{0468}", - 'Zaarmenian' => "\x{0536}", - 'Zcaronsmall' => "\x{F6FF}", - 'Zcircle' => "\x{24CF}", - 'Zcircumflex' => "\x{1E90}", - 'Zdot' => "\x{017B}", - 'Zdotbelow' => "\x{1E92}", - 'Zecyrillic' => "\x{0417}", - 'Zedescendercyrillic' => "\x{0498}", - 'Zedieresiscyrillic' => "\x{04DE}", - 'Zhearmenian' => "\x{053A}", - 'Zhebrevecyrillic' => "\x{04C1}", - 'Zhecyrillic' => "\x{0416}", - 'Zhedescendercyrillic' => "\x{0496}", - 'Zhedieresiscyrillic' => "\x{04DC}", - 'Zlinebelow' => "\x{1E94}", - 'Zmonospace' => "\x{FF3A}", - 'Zsmall' => "\x{F77A}", - 'Zstroke' => "\x{01B5}", - 'aabengali' => "\x{0986}", - 'aadeva' => "\x{0906}", - 'aagujarati' => "\x{0A86}", - 'aagurmukhi' => "\x{0A06}", - 'aamatragurmukhi' => "\x{0A3E}", - 'aarusquare' => "\x{3303}", - 'aavowelsignbengali' => "\x{09BE}", - 'aavowelsigndeva' => "\x{093E}", - 'aavowelsigngujarati' => "\x{0ABE}", - 'abbreviationmarkarmenian' => "\x{055F}", - 'abbreviationsigndeva' => "\x{0970}", - 'abengali' => "\x{0985}", - 'abopomofo' => "\x{311A}", - 'abreveacute' => "\x{1EAF}", - 'abrevecyrillic' => "\x{04D1}", - 'abrevedotbelow' => "\x{1EB7}", - 'abrevegrave' => "\x{1EB1}", - 'abrevehookabove' => "\x{1EB3}", - 'abrevetilde' => "\x{1EB5}", - 'acaron' => "\x{01CE}", - 'acircle' => "\x{24D0}", - 'acircumflexacute' => "\x{1EA5}", - 'acircumflexdotbelow' => "\x{1EAD}", - 'acircumflexgrave' => "\x{1EA7}", - 'acircumflexhookabove' => "\x{1EA9}", - 'acircumflextilde' => "\x{1EAB}", - 'acutebelowcmb' => "\x{0317}", - 'acutecmb' => "\x{0301}", - 'acutedeva' => "\x{0954}", - 'acutelowmod' => "\x{02CF}", - 'acutetonecmb' => "\x{0341}", - 'acyrillic' => "\x{0430}", - 'adblgrave' => "\x{0201}", - 'addakgurmukhi' => "\x{0A71}", - 'adeva' => "\x{0905}", - 'adieresiscyrillic' => "\x{04D3}", - 'adieresismacron' => "\x{01DF}", - 'adotbelow' => "\x{1EA1}", - 'adotmacron' => "\x{01E1}", - 'aekorean' => "\x{3150}", - 'aemacron' => "\x{01E3}", - 'afii08941' => "\x{20A4}", - 'afii10063' => "\x{F6C4}", - 'afii10064' => "\x{F6C5}", - 'afii10192' => "\x{F6C6}", - 'afii10831' => "\x{F6C7}", - 'afii10832' => "\x{F6C8}", - 'agujarati' => "\x{0A85}", - 'agurmukhi' => "\x{0A05}", - 'ahiragana' => "\x{3042}", - 'ahookabove' => "\x{1EA3}", - 'aibengali' => "\x{0990}", - 'aibopomofo' => "\x{311E}", - 'aideva' => "\x{0910}", - 'aiecyrillic' => "\x{04D5}", - 'aigujarati' => "\x{0A90}", - 'aigurmukhi' => "\x{0A10}", - 'aimatragurmukhi' => "\x{0A48}", - 'ainarabic' => "\x{0639}", - 'ainfinalarabic' => "\x{FECA}", - 'aininitialarabic' => "\x{FECB}", - 'ainmedialarabic' => "\x{FECC}", - 'ainvertedbreve' => "\x{0203}", - 'aivowelsignbengali' => "\x{09C8}", - 'aivowelsigndeva' => "\x{0948}", - 'aivowelsigngujarati' => "\x{0AC8}", - 'akatakana' => "\x{30A2}", - 'akatakanahalfwidth' => "\x{FF71}", - 'akorean' => "\x{314F}", - 'alef' => "\x{05D0}", - 'alefarabic' => "\x{0627}", - 'alefdageshhebrew' => "\x{FB30}", - 'aleffinalarabic' => "\x{FE8E}", - 'alefhamzaabovearabic' => "\x{0623}", - 'alefhamzaabovefinalarabic' => "\x{FE84}", - 'alefhamzabelowarabic' => "\x{0625}", - 'alefhamzabelowfinalarabic' => "\x{FE88}", - 'alefhebrew' => "\x{05D0}", - 'aleflamedhebrew' => "\x{FB4F}", - 'alefmaddaabovearabic' => "\x{0622}", - 'alefmaddaabovefinalarabic' => "\x{FE82}", - 'alefmaksuraarabic' => "\x{0649}", - 'alefmaksurafinalarabic' => "\x{FEF0}", - 'alefmaksurainitialarabic' => "\x{FEF3}", - 'alefmaksuramedialarabic' => "\x{FEF4}", - 'alefpatahhebrew' => "\x{FB2E}", - 'alefqamatshebrew' => "\x{FB2F}", - 'allequal' => "\x{224C}", - 'amonospace' => "\x{FF41}", - 'ampersandmonospace' => "\x{FF06}", - 'ampersandsmall' => "\x{F726}", - 'amsquare' => "\x{33C2}", - 'anbopomofo' => "\x{3122}", - 'angbopomofo' => "\x{3124}", - 'angkhankhuthai' => "\x{0E5A}", - 'anglebracketleft' => "\x{3008}", - 'anglebracketleftvertical' => "\x{FE3F}", - 'anglebracketright' => "\x{3009}", - 'anglebracketrightvertical' => "\x{FE40}", - 'angstrom' => "\x{212B}", - 'anudattadeva' => "\x{0952}", - 'anusvarabengali' => "\x{0982}", - 'anusvaradeva' => "\x{0902}", - 'anusvaragujarati' => "\x{0A82}", - 'apaatosquare' => "\x{3300}", - 'aparen' => "\x{249C}", - 'apostrophearmenian' => "\x{055A}", - 'apostrophemod' => "\x{02BC}", - 'apple' => "\x{F8FF}", - 'approaches' => "\x{2250}", - 'approxequalorimage' => "\x{2252}", - 'approximatelyequal' => "\x{2245}", - 'araeaekorean' => "\x{318E}", - 'araeakorean' => "\x{318D}", - 'arc' => "\x{2312}", - 'arighthalfring' => "\x{1E9A}", - 'aringbelow' => "\x{1E01}", - 'arrowdashdown' => "\x{21E3}", - 'arrowdashleft' => "\x{21E0}", - 'arrowdashright' => "\x{21E2}", - 'arrowdashup' => "\x{21E1}", - 'arrowdownleft' => "\x{2199}", - 'arrowdownright' => "\x{2198}", - 'arrowdownwhite' => "\x{21E9}", - 'arrowheaddownmod' => "\x{02C5}", - 'arrowheadleftmod' => "\x{02C2}", - 'arrowheadrightmod' => "\x{02C3}", - 'arrowheadupmod' => "\x{02C4}", - 'arrowhorizex' => "\x{F8E7}", - 'arrowleftdbl' => "\x{21D0}", - 'arrowleftdblstroke' => "\x{21CD}", - 'arrowleftoverright' => "\x{21C6}", - 'arrowleftwhite' => "\x{21E6}", - 'arrowrightdblstroke' => "\x{21CF}", - 'arrowrightheavy' => "\x{279E}", - 'arrowrightoverleft' => "\x{21C4}", - 'arrowrightwhite' => "\x{21E8}", - 'arrowtableft' => "\x{21E4}", - 'arrowtabright' => "\x{21E5}", - 'arrowupdownbase' => "\x{21A8}", - 'arrowupleft' => "\x{2196}", - 'arrowupleftofdown' => "\x{21C5}", - 'arrowupright' => "\x{2197}", - 'arrowupwhite' => "\x{21E7}", - 'arrowvertex' => "\x{F8E6}", - 'asciicircummonospace' => "\x{FF3E}", - 'asciitildemonospace' => "\x{FF5E}", - 'ascript' => "\x{0251}", - 'ascriptturned' => "\x{0252}", - 'asmallhiragana' => "\x{3041}", - 'asmallkatakana' => "\x{30A1}", - 'asmallkatakanahalfwidth' => "\x{FF67}", - 'asteriskaltonearabic' => "\x{066D}", - 'asteriskarabic' => "\x{066D}", - 'asteriskmonospace' => "\x{FF0A}", - 'asterisksmall' => "\x{FE61}", - 'asterism' => "\x{2042}", - 'asuperior' => "\x{F6E9}", - 'asymptoticallyequal' => "\x{2243}", - 'atmonospace' => "\x{FF20}", - 'atsmall' => "\x{FE6B}", - 'aturned' => "\x{0250}", - 'aubengali' => "\x{0994}", - 'aubopomofo' => "\x{3120}", - 'audeva' => "\x{0914}", - 'augujarati' => "\x{0A94}", - 'augurmukhi' => "\x{0A14}", - 'aulengthmarkbengali' => "\x{09D7}", - 'aumatragurmukhi' => "\x{0A4C}", - 'auvowelsignbengali' => "\x{09CC}", - 'auvowelsigndeva' => "\x{094C}", - 'auvowelsigngujarati' => "\x{0ACC}", - 'avagrahadeva' => "\x{093D}", - 'aybarmenian' => "\x{0561}", - 'ayin' => "\x{05E2}", - 'ayinaltonehebrew' => "\x{FB20}", - 'ayinhebrew' => "\x{05E2}", - 'babengali' => "\x{09AC}", - 'backslashmonospace' => "\x{FF3C}", - 'badeva' => "\x{092C}", - 'bagujarati' => "\x{0AAC}", - 'bagurmukhi' => "\x{0A2C}", - 'bahiragana' => "\x{3070}", - 'bahtthai' => "\x{0E3F}", - 'bakatakana' => "\x{30D0}", - 'barmonospace' => "\x{FF5C}", - 'bbopomofo' => "\x{3105}", - 'bcircle' => "\x{24D1}", - 'bdotaccent' => "\x{1E03}", - 'bdotbelow' => "\x{1E05}", - 'beamedsixteenthnotes' => "\x{266C}", - 'because' => "\x{2235}", - 'becyrillic' => "\x{0431}", - 'beharabic' => "\x{0628}", - 'behfinalarabic' => "\x{FE90}", - 'behinitialarabic' => "\x{FE91}", - 'behiragana' => "\x{3079}", - 'behmedialarabic' => "\x{FE92}", - 'behmeeminitialarabic' => "\x{FC9F}", - 'behmeemisolatedarabic' => "\x{FC08}", - 'behnoonfinalarabic' => "\x{FC6D}", - 'bekatakana' => "\x{30D9}", - 'benarmenian' => "\x{0562}", - 'bet' => "\x{05D1}", - 'betasymbolgreek' => "\x{03D0}", - 'betdagesh' => "\x{FB31}", - 'betdageshhebrew' => "\x{FB31}", - 'bethebrew' => "\x{05D1}", - 'betrafehebrew' => "\x{FB4C}", - 'bhabengali' => "\x{09AD}", - 'bhadeva' => "\x{092D}", - 'bhagujarati' => "\x{0AAD}", - 'bhagurmukhi' => "\x{0A2D}", - 'bhook' => "\x{0253}", - 'bihiragana' => "\x{3073}", - 'bikatakana' => "\x{30D3}", - 'bilabialclick' => "\x{0298}", - 'bindigurmukhi' => "\x{0A02}", - 'birusquare' => "\x{3331}", - 'blackcircle' => "\x{25CF}", - 'blackdiamond' => "\x{25C6}", - 'blackdownpointingtriangle' => "\x{25BC}", - 'blackleftpointingpointer' => "\x{25C4}", - 'blackleftpointingtriangle' => "\x{25C0}", - 'blacklenticularbracketleft' => "\x{3010}", - 'blacklenticularbracketleftvertical' => "\x{FE3B}", - 'blacklenticularbracketright' => "\x{3011}", - 'blacklenticularbracketrightvertical' => "\x{FE3C}", - 'blacklowerlefttriangle' => "\x{25E3}", - 'blacklowerrighttriangle' => "\x{25E2}", - 'blackrectangle' => "\x{25AC}", - 'blackrightpointingpointer' => "\x{25BA}", - 'blackrightpointingtriangle' => "\x{25B6}", - 'blacksmallsquare' => "\x{25AA}", - 'blacksmilingface' => "\x{263B}", - 'blacksquare' => "\x{25A0}", - 'blackstar' => "\x{2605}", - 'blackupperlefttriangle' => "\x{25E4}", - 'blackupperrighttriangle' => "\x{25E5}", - 'blackuppointingsmalltriangle' => "\x{25B4}", - 'blackuppointingtriangle' => "\x{25B2}", - 'blank' => "\x{2423}", - 'blinebelow' => "\x{1E07}", - 'bmonospace' => "\x{FF42}", - 'bobaimaithai' => "\x{0E1A}", - 'bohiragana' => "\x{307C}", - 'bokatakana' => "\x{30DC}", - 'bparen' => "\x{249D}", - 'bqsquare' => "\x{33C3}", - 'braceex' => "\x{F8F4}", - 'braceleftbt' => "\x{F8F3}", - 'braceleftmid' => "\x{F8F2}", - 'braceleftmonospace' => "\x{FF5B}", - 'braceleftsmall' => "\x{FE5B}", - 'bracelefttp' => "\x{F8F1}", - 'braceleftvertical' => "\x{FE37}", - 'bracerightbt' => "\x{F8FE}", - 'bracerightmid' => "\x{F8FD}", - 'bracerightmonospace' => "\x{FF5D}", - 'bracerightsmall' => "\x{FE5C}", - 'bracerighttp' => "\x{F8FC}", - 'bracerightvertical' => "\x{FE38}", - 'bracketleftbt' => "\x{F8F0}", - 'bracketleftex' => "\x{F8EF}", - 'bracketleftmonospace' => "\x{FF3B}", - 'bracketlefttp' => "\x{F8EE}", - 'bracketrightbt' => "\x{F8FB}", - 'bracketrightex' => "\x{F8FA}", - 'bracketrightmonospace' => "\x{FF3D}", - 'bracketrighttp' => "\x{F8F9}", - 'brevebelowcmb' => "\x{032E}", - 'brevecmb' => "\x{0306}", - 'breveinvertedbelowcmb' => "\x{032F}", - 'breveinvertedcmb' => "\x{0311}", - 'breveinverteddoublecmb' => "\x{0361}", - 'bridgebelowcmb' => "\x{032A}", - 'bridgeinvertedbelowcmb' => "\x{033A}", - 'bstroke' => "\x{0180}", - 'bsuperior' => "\x{F6EA}", - 'btopbar' => "\x{0183}", - 'buhiragana' => "\x{3076}", - 'bukatakana' => "\x{30D6}", - 'bulletinverse' => "\x{25D8}", - 'bulletoperator' => "\x{2219}", - 'bullseye' => "\x{25CE}", - 'caarmenian' => "\x{056E}", - 'cabengali' => "\x{099A}", - 'cadeva' => "\x{091A}", - 'cagujarati' => "\x{0A9A}", - 'cagurmukhi' => "\x{0A1A}", - 'calsquare' => "\x{3388}", - 'candrabindubengali' => "\x{0981}", - 'candrabinducmb' => "\x{0310}", - 'candrabindudeva' => "\x{0901}", - 'candrabindugujarati' => "\x{0A81}", - 'capslock' => "\x{21EA}", - 'careof' => "\x{2105}", - 'caronbelowcmb' => "\x{032C}", - 'caroncmb' => "\x{030C}", - 'cbopomofo' => "\x{3118}", - 'ccedillaacute' => "\x{1E09}", - 'ccircle' => "\x{24D2}", - 'ccurl' => "\x{0255}", - 'cdot' => "\x{010B}", - 'cdsquare' => "\x{33C5}", - 'cedillacmb' => "\x{0327}", - 'centigrade' => "\x{2103}", - 'centinferior' => "\x{F6DF}", - 'centmonospace' => "\x{FFE0}", - 'centoldstyle' => "\x{F7A2}", - 'centsuperior' => "\x{F6E0}", - 'chaarmenian' => "\x{0579}", - 'chabengali' => "\x{099B}", - 'chadeva' => "\x{091B}", - 'chagujarati' => "\x{0A9B}", - 'chagurmukhi' => "\x{0A1B}", - 'chbopomofo' => "\x{3114}", - 'cheabkhasiancyrillic' => "\x{04BD}", - 'checkmark' => "\x{2713}", - 'checyrillic' => "\x{0447}", - 'chedescenderabkhasiancyrillic' => "\x{04BF}", - 'chedescendercyrillic' => "\x{04B7}", - 'chedieresiscyrillic' => "\x{04F5}", - 'cheharmenian' => "\x{0573}", - 'chekhakassiancyrillic' => "\x{04CC}", - 'cheverticalstrokecyrillic' => "\x{04B9}", - 'chieuchacirclekorean' => "\x{3277}", - 'chieuchaparenkorean' => "\x{3217}", - 'chieuchcirclekorean' => "\x{3269}", - 'chieuchkorean' => "\x{314A}", - 'chieuchparenkorean' => "\x{3209}", - 'chochangthai' => "\x{0E0A}", - 'chochanthai' => "\x{0E08}", - 'chochingthai' => "\x{0E09}", - 'chochoethai' => "\x{0E0C}", - 'chook' => "\x{0188}", - 'cieucacirclekorean' => "\x{3276}", - 'cieucaparenkorean' => "\x{3216}", - 'cieuccirclekorean' => "\x{3268}", - 'cieuckorean' => "\x{3148}", - 'cieucparenkorean' => "\x{3208}", - 'cieucuparenkorean' => "\x{321C}", - 'circleot' => "\x{2299}", # Actual Adobe glyph list entry -- identified as typo, May 2008 - 'circledot' => "\x{2299}", # What it should have been - 'circlepostalmark' => "\x{3036}", - 'circlewithlefthalfblack' => "\x{25D0}", - 'circlewithrighthalfblack' => "\x{25D1}", - 'circumflexbelowcmb' => "\x{032D}", - 'circumflexcmb' => "\x{0302}", - 'clear' => "\x{2327}", - 'clickalveolar' => "\x{01C2}", - 'clickdental' => "\x{01C0}", - 'clicklateral' => "\x{01C1}", - 'clickretroflex' => "\x{01C3}", - 'clubsuitblack' => "\x{2663}", - 'clubsuitwhite' => "\x{2667}", - 'cmcubedsquare' => "\x{33A4}", - 'cmonospace' => "\x{FF43}", - 'cmsquaredsquare' => "\x{33A0}", - 'coarmenian' => "\x{0581}", - 'colonmonospace' => "\x{FF1A}", - 'colonsign' => "\x{20A1}", - 'colonsmall' => "\x{FE55}", - 'colontriangularhalfmod' => "\x{02D1}", - 'colontriangularmod' => "\x{02D0}", - 'commaabovecmb' => "\x{0313}", - 'commaaboverightcmb' => "\x{0315}", - 'commaaccent' => "\x{F6C3}", - 'commaarabic' => "\x{060C}", - 'commaarmenian' => "\x{055D}", - 'commainferior' => "\x{F6E1}", - 'commamonospace' => "\x{FF0C}", - 'commareversedabovecmb' => "\x{0314}", - 'commareversedmod' => "\x{02BD}", - 'commasmall' => "\x{FE50}", - 'commasuperior' => "\x{F6E2}", - 'commaturnedabovecmb' => "\x{0312}", - 'commaturnedmod' => "\x{02BB}", - 'compass' => "\x{263C}", - 'contourintegral' => "\x{222E}", - 'control' => "\x{2303}", - 'controlACK' => "\x{0006}", - 'controlBEL' => "\x{0007}", - 'controlBS' => "\x{0008}", - 'controlCAN' => "\x{0018}", - 'controlCR' => "\x{000D}", - 'controlDC1' => "\x{0011}", - 'controlDC2' => "\x{0012}", - 'controlDC3' => "\x{0013}", - 'controlDC4' => "\x{0014}", - 'controlDEL' => "\x{007F}", - 'controlDLE' => "\x{0010}", - 'controlEM' => "\x{0019}", - 'controlENQ' => "\x{0005}", - 'controlEOT' => "\x{0004}", - 'controlESC' => "\x{001B}", - 'controlETB' => "\x{0017}", - 'controlETX' => "\x{0003}", - 'controlFF' => "\x{000C}", - 'controlFS' => "\x{001C}", - 'controlGS' => "\x{001D}", - 'controlHT' => "\x{0009}", - 'controlLF' => "\x{000A}", - 'controlNAK' => "\x{0015}", - 'controlRS' => "\x{001E}", - 'controlSI' => "\x{000F}", - 'controlSO' => "\x{000E}", - 'controlSOT' => "\x{0002}", - 'controlSTX' => "\x{0001}", - 'controlSUB' => "\x{001A}", - 'controlSYN' => "\x{0016}", - 'controlUS' => "\x{001F}", - 'controlVT' => "\x{000B}", - 'copyrightsans' => "\x{F8E9}", - 'copyrightserif' => "\x{F6D9}", - 'cornerbracketleft' => "\x{300C}", - 'cornerbracketlefthalfwidth' => "\x{FF62}", - 'cornerbracketleftvertical' => "\x{FE41}", - 'cornerbracketright' => "\x{300D}", - 'cornerbracketrighthalfwidth' => "\x{FF63}", - 'cornerbracketrightvertical' => "\x{FE42}", - 'corporationsquare' => "\x{337F}", - 'cosquare' => "\x{33C7}", - 'coverkgsquare' => "\x{33C6}", - 'cparen' => "\x{249E}", - 'cruzeiro' => "\x{20A2}", - 'cstretched' => "\x{0297}", - 'curlyand' => "\x{22CF}", - 'curlyor' => "\x{22CE}", - 'cyrBreve' => "\x{F6D1}", - 'cyrFlex' => "\x{F6D2}", - 'cyrbreve' => "\x{F6D4}", - 'cyrflex' => "\x{F6D5}", - 'daarmenian' => "\x{0564}", - 'dabengali' => "\x{09A6}", - 'dadarabic' => "\x{0636}", - 'dadeva' => "\x{0926}", - 'dadfinalarabic' => "\x{FEBE}", - 'dadinitialarabic' => "\x{FEBF}", - 'dadmedialarabic' => "\x{FEC0}", - 'dagesh' => "\x{05BC}", - 'dageshhebrew' => "\x{05BC}", - 'dagujarati' => "\x{0AA6}", - 'dagurmukhi' => "\x{0A26}", - 'dahiragana' => "\x{3060}", - 'dakatakana' => "\x{30C0}", - 'dalarabic' => "\x{062F}", - 'dalet' => "\x{05D3}", - 'daletdagesh' => "\x{FB33}", - 'daletdageshhebrew' => "\x{FB33}", - 'dalethatafpatah' => "\x{05D3}\x{05B2}", - 'dalethatafpatahhebrew' => "\x{05D3}\x{05B2}", - 'dalethatafsegol' => "\x{05D3}\x{05B1}", - 'dalethatafsegolhebrew' => "\x{05D3}\x{05B1}", - 'dalethebrew' => "\x{05D3}", - 'dalethiriq' => "\x{05D3}\x{05B4}", - 'dalethiriqhebrew' => "\x{05D3}\x{05B4}", - 'daletholam' => "\x{05D3}\x{05B9}", - 'daletholamhebrew' => "\x{05D3}\x{05B9}", - 'daletpatah' => "\x{05D3}\x{05B7}", - 'daletpatahhebrew' => "\x{05D3}\x{05B7}", - 'daletqamats' => "\x{05D3}\x{05B8}", - 'daletqamatshebrew' => "\x{05D3}\x{05B8}", - 'daletqubuts' => "\x{05D3}\x{05BB}", - 'daletqubutshebrew' => "\x{05D3}\x{05BB}", - 'daletsegol' => "\x{05D3}\x{05B6}", - 'daletsegolhebrew' => "\x{05D3}\x{05B6}", - 'daletsheva' => "\x{05D3}\x{05B0}", - 'daletshevahebrew' => "\x{05D3}\x{05B0}", - 'dalettsere' => "\x{05D3}\x{05B5}", - 'dalettserehebrew' => "\x{05D3}\x{05B5}", - 'dalfinalarabic' => "\x{FEAA}", - 'dammaarabic' => "\x{064F}", - 'dammalowarabic' => "\x{064F}", - 'dammatanaltonearabic' => "\x{064C}", - 'dammatanarabic' => "\x{064C}", - 'danda' => "\x{0964}", - 'dargahebrew' => "\x{05A7}", - 'dargalefthebrew' => "\x{05A7}", - 'dasiapneumatacyrilliccmb' => "\x{0485}", - 'dblGrave' => "\x{F6D3}", - 'dblanglebracketleft' => "\x{300A}", - 'dblanglebracketleftvertical' => "\x{FE3D}", - 'dblanglebracketright' => "\x{300B}", - 'dblanglebracketrightvertical' => "\x{FE3E}", - 'dblarchinvertedbelowcmb' => "\x{032B}", - 'dblarrowleft' => "\x{21D4}", - 'dblarrowright' => "\x{21D2}", - 'dbldanda' => "\x{0965}", - 'dblgrave' => "\x{F6D6}", - 'dblgravecmb' => "\x{030F}", - 'dblintegral' => "\x{222C}", - 'dbllowline' => "\x{2017}", - 'dbllowlinecmb' => "\x{0333}", - 'dbloverlinecmb' => "\x{033F}", - 'dblprimemod' => "\x{02BA}", - 'dblverticalbar' => "\x{2016}", - 'dblverticallineabovecmb' => "\x{030E}", - 'dbopomofo' => "\x{3109}", - 'dbsquare' => "\x{33C8}", - 'dcedilla' => "\x{1E11}", - 'dcircle' => "\x{24D3}", - 'dcircumflexbelow' => "\x{1E13}", - 'ddabengali' => "\x{09A1}", - 'ddadeva' => "\x{0921}", - 'ddagujarati' => "\x{0AA1}", - 'ddagurmukhi' => "\x{0A21}", - 'ddalarabic' => "\x{0688}", - 'ddalfinalarabic' => "\x{FB89}", - 'dddhadeva' => "\x{095C}", - 'ddhabengali' => "\x{09A2}", - 'ddhadeva' => "\x{0922}", - 'ddhagujarati' => "\x{0AA2}", - 'ddhagurmukhi' => "\x{0A22}", - 'ddotaccent' => "\x{1E0B}", - 'ddotbelow' => "\x{1E0D}", - 'decimalseparatorarabic' => "\x{066B}", - 'decimalseparatorpersian' => "\x{066B}", - 'decyrillic' => "\x{0434}", - 'dehihebrew' => "\x{05AD}", - 'dehiragana' => "\x{3067}", - 'deicoptic' => "\x{03EF}", - 'dekatakana' => "\x{30C7}", - 'deleteleft' => "\x{232B}", - 'deleteright' => "\x{2326}", - 'deltaturned' => "\x{018D}", - 'denominatorminusonenumeratorbengali' => "\x{09F8}", - 'dezh' => "\x{02A4}", - 'dhabengali' => "\x{09A7}", - 'dhadeva' => "\x{0927}", - 'dhagujarati' => "\x{0AA7}", - 'dhagurmukhi' => "\x{0A27}", - 'dhook' => "\x{0257}", - 'dialytikatonos' => "\x{0385}", - 'dialytikatonoscmb' => "\x{0344}", - 'diamondsuitwhite' => "\x{2662}", - 'dieresisacute' => "\x{F6D7}", - 'dieresisbelowcmb' => "\x{0324}", - 'dieresiscmb' => "\x{0308}", - 'dieresisgrave' => "\x{F6D8}", - 'dihiragana' => "\x{3062}", - 'dikatakana' => "\x{30C2}", - 'dittomark' => "\x{3003}", - 'divides' => "\x{2223}", - 'divisionslash' => "\x{2215}", - 'djecyrillic' => "\x{0452}", - 'dlinebelow' => "\x{1E0F}", - 'dlsquare' => "\x{3397}", - 'dmacron' => "\x{0111}", - 'dmonospace' => "\x{FF44}", - 'dochadathai' => "\x{0E0E}", - 'dodekthai' => "\x{0E14}", - 'dohiragana' => "\x{3069}", - 'dokatakana' => "\x{30C9}", - 'dollarinferior' => "\x{F6E3}", - 'dollarmonospace' => "\x{FF04}", - 'dollaroldstyle' => "\x{F724}", - 'dollarsmall' => "\x{FE69}", - 'dollarsuperior' => "\x{F6E4}", - 'dorusquare' => "\x{3326}", - 'dotaccentcmb' => "\x{0307}", - 'dotbelowcmb' => "\x{0323}", - 'dotkatakana' => "\x{30FB}", - 'dotlessj' => "\x{F6BE}", - 'dotlessjstrokehook' => "\x{0284}", - 'dottedcircle' => "\x{25CC}", - 'doubleyodpatah' => "\x{FB1F}", - 'doubleyodpatahhebrew' => "\x{FB1F}", - 'downtackbelowcmb' => "\x{031E}", - 'downtackmod' => "\x{02D5}", - 'dparen' => "\x{249F}", - 'dsuperior' => "\x{F6EB}", - 'dtail' => "\x{0256}", - 'dtopbar' => "\x{018C}", - 'duhiragana' => "\x{3065}", - 'dukatakana' => "\x{30C5}", - 'dz' => "\x{01F3}", - 'dzaltone' => "\x{02A3}", - 'dzcaron' => "\x{01C6}", - 'dzcurl' => "\x{02A5}", - 'dzeabkhasiancyrillic' => "\x{04E1}", - 'dzecyrillic' => "\x{0455}", - 'dzhecyrillic' => "\x{045F}", - 'earth' => "\x{2641}", - 'ebengali' => "\x{098F}", - 'ebopomofo' => "\x{311C}", - 'ecandradeva' => "\x{090D}", - 'ecandragujarati' => "\x{0A8D}", - 'ecandravowelsigndeva' => "\x{0945}", - 'ecandravowelsigngujarati' => "\x{0AC5}", - 'ecedillabreve' => "\x{1E1D}", - 'echarmenian' => "\x{0565}", - 'echyiwnarmenian' => "\x{0587}", - 'ecircle' => "\x{24D4}", - 'ecircumflexacute' => "\x{1EBF}", - 'ecircumflexbelow' => "\x{1E19}", - 'ecircumflexdotbelow' => "\x{1EC7}", - 'ecircumflexgrave' => "\x{1EC1}", - 'ecircumflexhookabove' => "\x{1EC3}", - 'ecircumflextilde' => "\x{1EC5}", - 'ecyrillic' => "\x{0454}", - 'edblgrave' => "\x{0205}", - 'edeva' => "\x{090F}", - 'edot' => "\x{0117}", - 'edotbelow' => "\x{1EB9}", - 'eegurmukhi' => "\x{0A0F}", - 'eematragurmukhi' => "\x{0A47}", - 'efcyrillic' => "\x{0444}", - 'egujarati' => "\x{0A8F}", - 'eharmenian' => "\x{0567}", - 'ehbopomofo' => "\x{311D}", - 'ehiragana' => "\x{3048}", - 'ehookabove' => "\x{1EBB}", - 'eibopomofo' => "\x{311F}", - 'eightarabic' => "\x{0668}", - 'eightbengali' => "\x{09EE}", - 'eightcircle' => "\x{2467}", - 'eightcircleinversesansserif' => "\x{2791}", - 'eightdeva' => "\x{096E}", - 'eighteencircle' => "\x{2471}", - 'eighteenparen' => "\x{2485}", - 'eighteenperiod' => "\x{2499}", - 'eightgujarati' => "\x{0AEE}", - 'eightgurmukhi' => "\x{0A6E}", - 'eighthackarabic' => "\x{0668}", - 'eighthangzhou' => "\x{3028}", - 'eighthnotebeamed' => "\x{266B}", - 'eightideographicparen' => "\x{3227}", - 'eightinferior' => "\x{2088}", - 'eightmonospace' => "\x{FF18}", - 'eightoldstyle' => "\x{F738}", - 'eightparen' => "\x{247B}", - 'eightperiod' => "\x{248F}", - 'eightpersian' => "\x{06F8}", - 'eightroman' => "\x{2177}", - 'eightsuperior' => "\x{2078}", - 'eightthai' => "\x{0E58}", - 'einvertedbreve' => "\x{0207}", - 'eiotifiedcyrillic' => "\x{0465}", - 'ekatakana' => "\x{30A8}", - 'ekatakanahalfwidth' => "\x{FF74}", - 'ekonkargurmukhi' => "\x{0A74}", - 'ekorean' => "\x{3154}", - 'elcyrillic' => "\x{043B}", - 'elevencircle' => "\x{246A}", - 'elevenparen' => "\x{247E}", - 'elevenperiod' => "\x{2492}", - 'elevenroman' => "\x{217A}", - 'ellipsisvertical' => "\x{22EE}", - 'emacronacute' => "\x{1E17}", - 'emacrongrave' => "\x{1E15}", - 'emcyrillic' => "\x{043C}", - 'emdashvertical' => "\x{FE31}", - 'emonospace' => "\x{FF45}", - 'emphasismarkarmenian' => "\x{055B}", - 'enbopomofo' => "\x{3123}", - 'encyrillic' => "\x{043D}", - 'endashvertical' => "\x{FE32}", - 'endescendercyrillic' => "\x{04A3}", - 'engbopomofo' => "\x{3125}", - 'enghecyrillic' => "\x{04A5}", - 'enhookcyrillic' => "\x{04C8}", - 'enspace' => "\x{2002}", - 'eokorean' => "\x{3153}", - 'eopen' => "\x{025B}", - 'eopenclosed' => "\x{029A}", - 'eopenreversed' => "\x{025C}", - 'eopenreversedclosed' => "\x{025E}", - 'eopenreversedhook' => "\x{025D}", - 'eparen' => "\x{24A0}", - 'equalmonospace' => "\x{FF1D}", - 'equalsmall' => "\x{FE66}", - 'equalsuperior' => "\x{207C}", - 'erbopomofo' => "\x{3126}", - 'ercyrillic' => "\x{0440}", - 'ereversed' => "\x{0258}", - 'ereversedcyrillic' => "\x{044D}", - 'escyrillic' => "\x{0441}", - 'esdescendercyrillic' => "\x{04AB}", - 'esh' => "\x{0283}", - 'eshcurl' => "\x{0286}", - 'eshortdeva' => "\x{090E}", - 'eshortvowelsigndeva' => "\x{0946}", - 'eshreversedloop' => "\x{01AA}", - 'eshsquatreversed' => "\x{0285}", - 'esmallhiragana' => "\x{3047}", - 'esmallkatakana' => "\x{30A7}", - 'esmallkatakanahalfwidth' => "\x{FF6A}", - 'esuperior' => "\x{F6EC}", - 'etarmenian' => "\x{0568}", - 'etilde' => "\x{1EBD}", - 'etildebelow' => "\x{1E1B}", - 'etnahtafoukhhebrew' => "\x{0591}", - 'etnahtafoukhlefthebrew' => "\x{0591}", - 'etnahtahebrew' => "\x{0591}", - 'etnahtalefthebrew' => "\x{0591}", - 'eturned' => "\x{01DD}", - 'eukorean' => "\x{3161}", - 'euro' => "\x{20AC}", - 'evowelsignbengali' => "\x{09C7}", - 'evowelsigndeva' => "\x{0947}", - 'evowelsigngujarati' => "\x{0AC7}", - 'exclamarmenian' => "\x{055C}", - 'exclamdownsmall' => "\x{F7A1}", - 'exclammonospace' => "\x{FF01}", - 'exclamsmall' => "\x{F721}", - 'ezh' => "\x{0292}", - 'ezhcaron' => "\x{01EF}", - 'ezhcurl' => "\x{0293}", - 'ezhreversed' => "\x{01B9}", - 'ezhtail' => "\x{01BA}", - 'fadeva' => "\x{095E}", - 'fagurmukhi' => "\x{0A5E}", - 'fahrenheit' => "\x{2109}", - 'fathaarabic' => "\x{064E}", - 'fathalowarabic' => "\x{064E}", - 'fathatanarabic' => "\x{064B}", - 'fbopomofo' => "\x{3108}", - 'fcircle' => "\x{24D5}", - 'fdotaccent' => "\x{1E1F}", - 'feharabic' => "\x{0641}", - 'feharmenian' => "\x{0586}", - 'fehfinalarabic' => "\x{FED2}", - 'fehinitialarabic' => "\x{FED3}", - 'fehmedialarabic' => "\x{FED4}", - 'feicoptic' => "\x{03E5}", - 'fifteencircle' => "\x{246E}", - 'fifteenparen' => "\x{2482}", - 'fifteenperiod' => "\x{2496}", - 'finalkaf' => "\x{05DA}", - 'finalkafdagesh' => "\x{FB3A}", - 'finalkafdageshhebrew' => "\x{FB3A}", - 'finalkafhebrew' => "\x{05DA}", - 'finalkafqamats' => "\x{05DA}\x{05B8}", - 'finalkafqamatshebrew' => "\x{05DA}\x{05B8}", - 'finalkafsheva' => "\x{05DA}\x{05B0}", - 'finalkafshevahebrew' => "\x{05DA}\x{05B0}", - 'finalmem' => "\x{05DD}", - 'finalmemhebrew' => "\x{05DD}", - 'finalnun' => "\x{05DF}", - 'finalnunhebrew' => "\x{05DF}", - 'finalpe' => "\x{05E3}", - 'finalpehebrew' => "\x{05E3}", - 'finaltsadi' => "\x{05E5}", - 'finaltsadihebrew' => "\x{05E5}", - 'firsttonechinese' => "\x{02C9}", - 'fisheye' => "\x{25C9}", - 'fitacyrillic' => "\x{0473}", - 'fivearabic' => "\x{0665}", - 'fivebengali' => "\x{09EB}", - 'fivecircle' => "\x{2464}", - 'fivecircleinversesansserif' => "\x{278E}", - 'fivedeva' => "\x{096B}", - 'fivegujarati' => "\x{0AEB}", - 'fivegurmukhi' => "\x{0A6B}", - 'fivehackarabic' => "\x{0665}", - 'fivehangzhou' => "\x{3025}", - 'fiveideographicparen' => "\x{3224}", - 'fiveinferior' => "\x{2085}", - 'fivemonospace' => "\x{FF15}", - 'fiveoldstyle' => "\x{F735}", - 'fiveparen' => "\x{2478}", - 'fiveperiod' => "\x{248C}", - 'fivepersian' => "\x{06F5}", - 'fiveroman' => "\x{2174}", - 'fivesuperior' => "\x{2075}", - 'fivethai' => "\x{0E55}", - 'fmonospace' => "\x{FF46}", - 'fmsquare' => "\x{3399}", - 'fofanthai' => "\x{0E1F}", - 'fofathai' => "\x{0E1D}", - 'fongmanthai' => "\x{0E4F}", - 'forall' => "\x{2200}", - 'fourarabic' => "\x{0664}", - 'fourbengali' => "\x{09EA}", - 'fourcircle' => "\x{2463}", - 'fourcircleinversesansserif' => "\x{278D}", - 'fourdeva' => "\x{096A}", - 'fourgujarati' => "\x{0AEA}", - 'fourgurmukhi' => "\x{0A6A}", - 'fourhackarabic' => "\x{0664}", - 'fourhangzhou' => "\x{3024}", - 'fourideographicparen' => "\x{3223}", - 'fourinferior' => "\x{2084}", - 'fourmonospace' => "\x{FF14}", - 'fournumeratorbengali' => "\x{09F7}", - 'fouroldstyle' => "\x{F734}", - 'fourparen' => "\x{2477}", - 'fourperiod' => "\x{248B}", - 'fourpersian' => "\x{06F4}", - 'fourroman' => "\x{2173}", - 'foursuperior' => "\x{2074}", - 'fourteencircle' => "\x{246D}", - 'fourteenparen' => "\x{2481}", - 'fourteenperiod' => "\x{2495}", - 'fourthai' => "\x{0E54}", - 'fourthtonechinese' => "\x{02CB}", - 'fparen' => "\x{24A1}", - 'gabengali' => "\x{0997}", - 'gacute' => "\x{01F5}", - 'gadeva' => "\x{0917}", - 'gafarabic' => "\x{06AF}", - 'gaffinalarabic' => "\x{FB93}", - 'gafinitialarabic' => "\x{FB94}", - 'gafmedialarabic' => "\x{FB95}", - 'gagujarati' => "\x{0A97}", - 'gagurmukhi' => "\x{0A17}", - 'gahiragana' => "\x{304C}", - 'gakatakana' => "\x{30AC}", - 'gammalatinsmall' => "\x{0263}", - 'gammasuperior' => "\x{02E0}", - 'gangiacoptic' => "\x{03EB}", - 'gbopomofo' => "\x{310D}", - 'gcedilla' => "\x{0123}", - 'gcircle' => "\x{24D6}", - 'gdot' => "\x{0121}", - 'gecyrillic' => "\x{0433}", - 'gehiragana' => "\x{3052}", - 'gekatakana' => "\x{30B2}", - 'geometricallyequal' => "\x{2251}", - 'gereshaccenthebrew' => "\x{059C}", - 'gereshhebrew' => "\x{05F3}", - 'gereshmuqdamhebrew' => "\x{059D}", - 'gershayimaccenthebrew' => "\x{059E}", - 'gershayimhebrew' => "\x{05F4}", - 'getamark' => "\x{3013}", - 'ghabengali' => "\x{0998}", - 'ghadarmenian' => "\x{0572}", - 'ghadeva' => "\x{0918}", - 'ghagujarati' => "\x{0A98}", - 'ghagurmukhi' => "\x{0A18}", - 'ghainarabic' => "\x{063A}", - 'ghainfinalarabic' => "\x{FECE}", - 'ghaininitialarabic' => "\x{FECF}", - 'ghainmedialarabic' => "\x{FED0}", - 'ghemiddlehookcyrillic' => "\x{0495}", - 'ghestrokecyrillic' => "\x{0493}", - 'gheupturncyrillic' => "\x{0491}", - 'ghhadeva' => "\x{095A}", - 'ghhagurmukhi' => "\x{0A5A}", - 'ghook' => "\x{0260}", - 'ghzsquare' => "\x{3393}", - 'gihiragana' => "\x{304E}", - 'gikatakana' => "\x{30AE}", - 'gimarmenian' => "\x{0563}", - 'gimel' => "\x{05D2}", - 'gimeldagesh' => "\x{FB32}", - 'gimeldageshhebrew' => "\x{FB32}", - 'gimelhebrew' => "\x{05D2}", - 'gjecyrillic' => "\x{0453}", - 'glottalinvertedstroke' => "\x{01BE}", - 'glottalstop' => "\x{0294}", - 'glottalstopinverted' => "\x{0296}", - 'glottalstopmod' => "\x{02C0}", - 'glottalstopreversed' => "\x{0295}", - 'glottalstopreversedmod' => "\x{02C1}", - 'glottalstopreversedsuperior' => "\x{02E4}", - 'glottalstopstroke' => "\x{02A1}", - 'glottalstopstrokereversed' => "\x{02A2}", - 'gmacron' => "\x{1E21}", - 'gmonospace' => "\x{FF47}", - 'gohiragana' => "\x{3054}", - 'gokatakana' => "\x{30B4}", - 'gparen' => "\x{24A2}", - 'gpasquare' => "\x{33AC}", - 'gravebelowcmb' => "\x{0316}", - 'gravecmb' => "\x{0300}", - 'gravedeva' => "\x{0953}", - 'gravelowmod' => "\x{02CE}", - 'gravemonospace' => "\x{FF40}", - 'gravetonecmb' => "\x{0340}", - 'greaterequalorless' => "\x{22DB}", - 'greatermonospace' => "\x{FF1E}", - 'greaterorequivalent' => "\x{2273}", - 'greaterorless' => "\x{2277}", - 'greateroverequal' => "\x{2267}", - 'greatersmall' => "\x{FE65}", - 'gscript' => "\x{0261}", - 'gstroke' => "\x{01E5}", - 'guhiragana' => "\x{3050}", - 'gukatakana' => "\x{30B0}", - 'guramusquare' => "\x{3318}", - 'gysquare' => "\x{33C9}", - 'haabkhasiancyrillic' => "\x{04A9}", - 'haaltonearabic' => "\x{06C1}", - 'habengali' => "\x{09B9}", - 'hadescendercyrillic' => "\x{04B3}", - 'hadeva' => "\x{0939}", - 'hagujarati' => "\x{0AB9}", - 'hagurmukhi' => "\x{0A39}", - 'haharabic' => "\x{062D}", - 'hahfinalarabic' => "\x{FEA2}", - 'hahinitialarabic' => "\x{FEA3}", - 'hahiragana' => "\x{306F}", - 'hahmedialarabic' => "\x{FEA4}", - 'haitusquare' => "\x{332A}", - 'hakatakana' => "\x{30CF}", - 'hakatakanahalfwidth' => "\x{FF8A}", - 'halantgurmukhi' => "\x{0A4D}", - 'hamzaarabic' => "\x{0621}", - 'hamzadammaarabic' => "\x{0621}\x{064F}", - 'hamzadammatanarabic' => "\x{0621}\x{064C}", - 'hamzafathaarabic' => "\x{0621}\x{064E}", - 'hamzafathatanarabic' => "\x{0621}\x{064B}", - 'hamzalowarabic' => "\x{0621}", - 'hamzalowkasraarabic' => "\x{0621}\x{0650}", - 'hamzalowkasratanarabic' => "\x{0621}\x{064D}", - 'hamzasukunarabic' => "\x{0621}\x{0652}", - 'hangulfiller' => "\x{3164}", - 'hardsigncyrillic' => "\x{044A}", - 'harpoonleftbarbup' => "\x{21BC}", - 'harpoonrightbarbup' => "\x{21C0}", - 'hasquare' => "\x{33CA}", - 'hatafpatah' => "\x{05B2}", - 'hatafpatah16' => "\x{05B2}", - 'hatafpatah23' => "\x{05B2}", - 'hatafpatah2f' => "\x{05B2}", - 'hatafpatahhebrew' => "\x{05B2}", - 'hatafpatahnarrowhebrew' => "\x{05B2}", - 'hatafpatahquarterhebrew' => "\x{05B2}", - 'hatafpatahwidehebrew' => "\x{05B2}", - 'hatafqamats' => "\x{05B3}", - 'hatafqamats1b' => "\x{05B3}", - 'hatafqamats28' => "\x{05B3}", - 'hatafqamats34' => "\x{05B3}", - 'hatafqamatshebrew' => "\x{05B3}", - 'hatafqamatsnarrowhebrew' => "\x{05B3}", - 'hatafqamatsquarterhebrew' => "\x{05B3}", - 'hatafqamatswidehebrew' => "\x{05B3}", - 'hatafsegol' => "\x{05B1}", - 'hatafsegol17' => "\x{05B1}", - 'hatafsegol24' => "\x{05B1}", - 'hatafsegol30' => "\x{05B1}", - 'hatafsegolhebrew' => "\x{05B1}", - 'hatafsegolnarrowhebrew' => "\x{05B1}", - 'hatafsegolquarterhebrew' => "\x{05B1}", - 'hatafsegolwidehebrew' => "\x{05B1}", - 'hbopomofo' => "\x{310F}", - 'hbrevebelow' => "\x{1E2B}", - 'hcedilla' => "\x{1E29}", - 'hcircle' => "\x{24D7}", - 'hdieresis' => "\x{1E27}", - 'hdotaccent' => "\x{1E23}", - 'hdotbelow' => "\x{1E25}", - 'he' => "\x{05D4}", - 'heartsuitblack' => "\x{2665}", - 'heartsuitwhite' => "\x{2661}", - 'hedagesh' => "\x{FB34}", - 'hedageshhebrew' => "\x{FB34}", - 'hehaltonearabic' => "\x{06C1}", - 'heharabic' => "\x{0647}", - 'hehebrew' => "\x{05D4}", - 'hehfinalaltonearabic' => "\x{FBA7}", - 'hehfinalalttwoarabic' => "\x{FEEA}", - 'hehfinalarabic' => "\x{FEEA}", - 'hehhamzaabovefinalarabic' => "\x{FBA5}", - 'hehhamzaaboveisolatedarabic' => "\x{FBA4}", - 'hehinitialaltonearabic' => "\x{FBA8}", - 'hehinitialarabic' => "\x{FEEB}", - 'hehiragana' => "\x{3078}", - 'hehmedialaltonearabic' => "\x{FBA9}", - 'hehmedialarabic' => "\x{FEEC}", - 'heiseierasquare' => "\x{337B}", - 'hekatakana' => "\x{30D8}", - 'hekatakanahalfwidth' => "\x{FF8D}", - 'hekutaarusquare' => "\x{3336}", - 'henghook' => "\x{0267}", - 'herutusquare' => "\x{3339}", - 'het' => "\x{05D7}", - 'hethebrew' => "\x{05D7}", - 'hhook' => "\x{0266}", - 'hhooksuperior' => "\x{02B1}", - 'hieuhacirclekorean' => "\x{327B}", - 'hieuhaparenkorean' => "\x{321B}", - 'hieuhcirclekorean' => "\x{326D}", - 'hieuhkorean' => "\x{314E}", - 'hieuhparenkorean' => "\x{320D}", - 'hihiragana' => "\x{3072}", - 'hikatakana' => "\x{30D2}", - 'hikatakanahalfwidth' => "\x{FF8B}", - 'hiriq' => "\x{05B4}", - 'hiriq14' => "\x{05B4}", - 'hiriq21' => "\x{05B4}", - 'hiriq2d' => "\x{05B4}", - 'hiriqhebrew' => "\x{05B4}", - 'hiriqnarrowhebrew' => "\x{05B4}", - 'hiriqquarterhebrew' => "\x{05B4}", - 'hiriqwidehebrew' => "\x{05B4}", - 'hlinebelow' => "\x{1E96}", - 'hmonospace' => "\x{FF48}", - 'hoarmenian' => "\x{0570}", - 'hohipthai' => "\x{0E2B}", - 'hohiragana' => "\x{307B}", - 'hokatakana' => "\x{30DB}", - 'hokatakanahalfwidth' => "\x{FF8E}", - 'holam' => "\x{05B9}", - 'holam19' => "\x{05B9}", - 'holam26' => "\x{05B9}", - 'holam32' => "\x{05B9}", - 'holamhebrew' => "\x{05B9}", - 'holamnarrowhebrew' => "\x{05B9}", - 'holamquarterhebrew' => "\x{05B9}", - 'holamwidehebrew' => "\x{05B9}", - 'honokhukthai' => "\x{0E2E}", - 'hookcmb' => "\x{0309}", - 'hookpalatalizedbelowcmb' => "\x{0321}", - 'hookretroflexbelowcmb' => "\x{0322}", - 'hoonsquare' => "\x{3342}", - 'horicoptic' => "\x{03E9}", - 'horizontalbar' => "\x{2015}", - 'horncmb' => "\x{031B}", - 'hotsprings' => "\x{2668}", - 'hparen' => "\x{24A3}", - 'hsuperior' => "\x{02B0}", - 'hturned' => "\x{0265}", - 'huhiragana' => "\x{3075}", - 'huiitosquare' => "\x{3333}", - 'hukatakana' => "\x{30D5}", - 'hukatakanahalfwidth' => "\x{FF8C}", - 'hungarumlautcmb' => "\x{030B}", - 'hv' => "\x{0195}", - 'hypheninferior' => "\x{F6E5}", - 'hyphenmonospace' => "\x{FF0D}", - 'hyphensmall' => "\x{FE63}", - 'hyphensuperior' => "\x{F6E6}", - 'hyphentwo' => "\x{2010}", - 'iacyrillic' => "\x{044F}", - 'ibengali' => "\x{0987}", - 'ibopomofo' => "\x{3127}", - 'icaron' => "\x{01D0}", - 'icircle' => "\x{24D8}", - 'icyrillic' => "\x{0456}", - 'idblgrave' => "\x{0209}", - 'ideographearthcircle' => "\x{328F}", - 'ideographfirecircle' => "\x{328B}", - 'ideographicallianceparen' => "\x{323F}", - 'ideographiccallparen' => "\x{323A}", - 'ideographiccentrecircle' => "\x{32A5}", - 'ideographicclose' => "\x{3006}", - 'ideographiccomma' => "\x{3001}", - 'ideographiccommaleft' => "\x{FF64}", - 'ideographiccongratulationparen' => "\x{3237}", - 'ideographiccorrectcircle' => "\x{32A3}", - 'ideographicearthparen' => "\x{322F}", - 'ideographicenterpriseparen' => "\x{323D}", - 'ideographicexcellentcircle' => "\x{329D}", - 'ideographicfestivalparen' => "\x{3240}", - 'ideographicfinancialcircle' => "\x{3296}", - 'ideographicfinancialparen' => "\x{3236}", - 'ideographicfireparen' => "\x{322B}", - 'ideographichaveparen' => "\x{3232}", - 'ideographichighcircle' => "\x{32A4}", - 'ideographiciterationmark' => "\x{3005}", - 'ideographiclaborcircle' => "\x{3298}", - 'ideographiclaborparen' => "\x{3238}", - 'ideographicleftcircle' => "\x{32A7}", - 'ideographiclowcircle' => "\x{32A6}", - 'ideographicmedicinecircle' => "\x{32A9}", - 'ideographicmetalparen' => "\x{322E}", - 'ideographicmoonparen' => "\x{322A}", - 'ideographicnameparen' => "\x{3234}", - 'ideographicperiod' => "\x{3002}", - 'ideographicprintcircle' => "\x{329E}", - 'ideographicreachparen' => "\x{3243}", - 'ideographicrepresentparen' => "\x{3239}", - 'ideographicresourceparen' => "\x{323E}", - 'ideographicrightcircle' => "\x{32A8}", - 'ideographicsecretcircle' => "\x{3299}", - 'ideographicselfparen' => "\x{3242}", - 'ideographicsocietyparen' => "\x{3233}", - 'ideographicspace' => "\x{3000}", - 'ideographicspecialparen' => "\x{3235}", - 'ideographicstockparen' => "\x{3231}", - 'ideographicstudyparen' => "\x{323B}", - 'ideographicsunparen' => "\x{3230}", - 'ideographicsuperviseparen' => "\x{323C}", - 'ideographicwaterparen' => "\x{322C}", - 'ideographicwoodparen' => "\x{322D}", - 'ideographiczero' => "\x{3007}", - 'ideographmetalcircle' => "\x{328E}", - 'ideographmooncircle' => "\x{328A}", - 'ideographnamecircle' => "\x{3294}", - 'ideographsuncircle' => "\x{3290}", - 'ideographwatercircle' => "\x{328C}", - 'ideographwoodcircle' => "\x{328D}", - 'ideva' => "\x{0907}", - 'idieresisacute' => "\x{1E2F}", - 'idieresiscyrillic' => "\x{04E5}", - 'idotbelow' => "\x{1ECB}", - 'iebrevecyrillic' => "\x{04D7}", - 'iecyrillic' => "\x{0435}", - 'ieungacirclekorean' => "\x{3275}", - 'ieungaparenkorean' => "\x{3215}", - 'ieungcirclekorean' => "\x{3267}", - 'ieungkorean' => "\x{3147}", - 'ieungparenkorean' => "\x{3207}", - 'igujarati' => "\x{0A87}", - 'igurmukhi' => "\x{0A07}", - 'ihiragana' => "\x{3044}", - 'ihookabove' => "\x{1EC9}", - 'iibengali' => "\x{0988}", - 'iicyrillic' => "\x{0438}", - 'iideva' => "\x{0908}", - 'iigujarati' => "\x{0A88}", - 'iigurmukhi' => "\x{0A08}", - 'iimatragurmukhi' => "\x{0A40}", - 'iinvertedbreve' => "\x{020B}", - 'iishortcyrillic' => "\x{0439}", - 'iivowelsignbengali' => "\x{09C0}", - 'iivowelsigndeva' => "\x{0940}", - 'iivowelsigngujarati' => "\x{0AC0}", - 'ikatakana' => "\x{30A4}", - 'ikatakanahalfwidth' => "\x{FF72}", - 'ikorean' => "\x{3163}", - 'ilde' => "\x{02DC}", - 'iluyhebrew' => "\x{05AC}", - 'imacroncyrillic' => "\x{04E3}", - 'imageorapproximatelyequal' => "\x{2253}", - 'imatragurmukhi' => "\x{0A3F}", - 'imonospace' => "\x{FF49}", - 'increment' => "\x{2206}", - 'iniarmenian' => "\x{056B}", - 'integralbottom' => "\x{2321}", - 'integralex' => "\x{F8F5}", - 'integraltop' => "\x{2320}", - 'intisquare' => "\x{3305}", - 'iocyrillic' => "\x{0451}", - 'iotalatin' => "\x{0269}", - 'iparen' => "\x{24A4}", - 'irigurmukhi' => "\x{0A72}", - 'ismallhiragana' => "\x{3043}", - 'ismallkatakana' => "\x{30A3}", - 'ismallkatakanahalfwidth' => "\x{FF68}", - 'issharbengali' => "\x{09FA}", - 'istroke' => "\x{0268}", - 'isuperior' => "\x{F6ED}", - 'iterationhiragana' => "\x{309D}", - 'iterationkatakana' => "\x{30FD}", - 'itildebelow' => "\x{1E2D}", - 'iubopomofo' => "\x{3129}", - 'iucyrillic' => "\x{044E}", - 'ivowelsignbengali' => "\x{09BF}", - 'ivowelsigndeva' => "\x{093F}", - 'ivowelsigngujarati' => "\x{0ABF}", - 'izhitsacyrillic' => "\x{0475}", - 'izhitsadblgravecyrillic' => "\x{0477}", - 'jaarmenian' => "\x{0571}", - 'jabengali' => "\x{099C}", - 'jadeva' => "\x{091C}", - 'jagujarati' => "\x{0A9C}", - 'jagurmukhi' => "\x{0A1C}", - 'jbopomofo' => "\x{3110}", - 'jcaron' => "\x{01F0}", - 'jcircle' => "\x{24D9}", - 'jcrossedtail' => "\x{029D}", - 'jdotlessstroke' => "\x{025F}", - 'jecyrillic' => "\x{0458}", - 'jeemarabic' => "\x{062C}", - 'jeemfinalarabic' => "\x{FE9E}", - 'jeeminitialarabic' => "\x{FE9F}", - 'jeemmedialarabic' => "\x{FEA0}", - 'jeharabic' => "\x{0698}", - 'jehfinalarabic' => "\x{FB8B}", - 'jhabengali' => "\x{099D}", - 'jhadeva' => "\x{091D}", - 'jhagujarati' => "\x{0A9D}", - 'jhagurmukhi' => "\x{0A1D}", - 'jheharmenian' => "\x{057B}", - 'jis' => "\x{3004}", - 'jmonospace' => "\x{FF4A}", - 'jparen' => "\x{24A5}", - 'jsuperior' => "\x{02B2}", - 'kabashkircyrillic' => "\x{04A1}", - 'kabengali' => "\x{0995}", - 'kacute' => "\x{1E31}", - 'kacyrillic' => "\x{043A}", - 'kadescendercyrillic' => "\x{049B}", - 'kadeva' => "\x{0915}", - 'kaf' => "\x{05DB}", - 'kafarabic' => "\x{0643}", - 'kafdagesh' => "\x{FB3B}", - 'kafdageshhebrew' => "\x{FB3B}", - 'kaffinalarabic' => "\x{FEDA}", - 'kafhebrew' => "\x{05DB}", - 'kafinitialarabic' => "\x{FEDB}", - 'kafmedialarabic' => "\x{FEDC}", - 'kafrafehebrew' => "\x{FB4D}", - 'kagujarati' => "\x{0A95}", - 'kagurmukhi' => "\x{0A15}", - 'kahiragana' => "\x{304B}", - 'kahookcyrillic' => "\x{04C4}", - 'kakatakana' => "\x{30AB}", - 'kakatakanahalfwidth' => "\x{FF76}", - 'kappasymbolgreek' => "\x{03F0}", - 'kapyeounmieumkorean' => "\x{3171}", - 'kapyeounphieuphkorean' => "\x{3184}", - 'kapyeounpieupkorean' => "\x{3178}", - 'kapyeounssangpieupkorean' => "\x{3179}", - 'karoriisquare' => "\x{330D}", - 'kashidaautoarabic' => "\x{0640}", - 'kashidaautonosidebearingarabic' => "\x{0640}", - 'kasmallkatakana' => "\x{30F5}", - 'kasquare' => "\x{3384}", - 'kasraarabic' => "\x{0650}", - 'kasratanarabic' => "\x{064D}", - 'kastrokecyrillic' => "\x{049F}", - 'katahiraprolongmarkhalfwidth' => "\x{FF70}", - 'kaverticalstrokecyrillic' => "\x{049D}", - 'kbopomofo' => "\x{310E}", - 'kcalsquare' => "\x{3389}", - 'kcaron' => "\x{01E9}", - 'kcedilla' => "\x{0137}", - 'kcircle' => "\x{24DA}", - 'kdotbelow' => "\x{1E33}", - 'keharmenian' => "\x{0584}", - 'kehiragana' => "\x{3051}", - 'kekatakana' => "\x{30B1}", - 'kekatakanahalfwidth' => "\x{FF79}", - 'kenarmenian' => "\x{056F}", - 'kesmallkatakana' => "\x{30F6}", - 'khabengali' => "\x{0996}", - 'khacyrillic' => "\x{0445}", - 'khadeva' => "\x{0916}", - 'khagujarati' => "\x{0A96}", - 'khagurmukhi' => "\x{0A16}", - 'khaharabic' => "\x{062E}", - 'khahfinalarabic' => "\x{FEA6}", - 'khahinitialarabic' => "\x{FEA7}", - 'khahmedialarabic' => "\x{FEA8}", - 'kheicoptic' => "\x{03E7}", - 'khhadeva' => "\x{0959}", - 'khhagurmukhi' => "\x{0A59}", - 'khieukhacirclekorean' => "\x{3278}", - 'khieukhaparenkorean' => "\x{3218}", - 'khieukhcirclekorean' => "\x{326A}", - 'khieukhkorean' => "\x{314B}", - 'khieukhparenkorean' => "\x{320A}", - 'khokhaithai' => "\x{0E02}", - 'khokhonthai' => "\x{0E05}", - 'khokhuatthai' => "\x{0E03}", - 'khokhwaithai' => "\x{0E04}", - 'khomutthai' => "\x{0E5B}", - 'khook' => "\x{0199}", - 'khorakhangthai' => "\x{0E06}", - 'khzsquare' => "\x{3391}", - 'kihiragana' => "\x{304D}", - 'kikatakana' => "\x{30AD}", - 'kikatakanahalfwidth' => "\x{FF77}", - 'kiroguramusquare' => "\x{3315}", - 'kiromeetorusquare' => "\x{3316}", - 'kirosquare' => "\x{3314}", - 'kiyeokacirclekorean' => "\x{326E}", - 'kiyeokaparenkorean' => "\x{320E}", - 'kiyeokcirclekorean' => "\x{3260}", - 'kiyeokkorean' => "\x{3131}", - 'kiyeokparenkorean' => "\x{3200}", - 'kiyeoksioskorean' => "\x{3133}", - 'kjecyrillic' => "\x{045C}", - 'klinebelow' => "\x{1E35}", - 'klsquare' => "\x{3398}", - 'kmcubedsquare' => "\x{33A6}", - 'kmonospace' => "\x{FF4B}", - 'kmsquaredsquare' => "\x{33A2}", - 'kohiragana' => "\x{3053}", - 'kohmsquare' => "\x{33C0}", - 'kokaithai' => "\x{0E01}", - 'kokatakana' => "\x{30B3}", - 'kokatakanahalfwidth' => "\x{FF7A}", - 'kooposquare' => "\x{331E}", - 'koppacyrillic' => "\x{0481}", - 'koreanstandardsymbol' => "\x{327F}", - 'koroniscmb' => "\x{0343}", - 'kparen' => "\x{24A6}", - 'kpasquare' => "\x{33AA}", - 'ksicyrillic' => "\x{046F}", - 'ktsquare' => "\x{33CF}", - 'kturned' => "\x{029E}", - 'kuhiragana' => "\x{304F}", - 'kukatakana' => "\x{30AF}", - 'kukatakanahalfwidth' => "\x{FF78}", - 'kvsquare' => "\x{33B8}", - 'kwsquare' => "\x{33BE}", - 'labengali' => "\x{09B2}", - 'ladeva' => "\x{0932}", - 'lagujarati' => "\x{0AB2}", - 'lagurmukhi' => "\x{0A32}", - 'lakkhangyaothai' => "\x{0E45}", - 'lamaleffinalarabic' => "\x{FEFC}", - 'lamalefhamzaabovefinalarabic' => "\x{FEF8}", - 'lamalefhamzaaboveisolatedarabic' => "\x{FEF7}", - 'lamalefhamzabelowfinalarabic' => "\x{FEFA}", - 'lamalefhamzabelowisolatedarabic' => "\x{FEF9}", - 'lamalefisolatedarabic' => "\x{FEFB}", - 'lamalefmaddaabovefinalarabic' => "\x{FEF6}", - 'lamalefmaddaaboveisolatedarabic' => "\x{FEF5}", - 'lamarabic' => "\x{0644}", - 'lambdastroke' => "\x{019B}", - 'lamed' => "\x{05DC}", - 'lameddagesh' => "\x{FB3C}", - 'lameddageshhebrew' => "\x{FB3C}", - 'lamedhebrew' => "\x{05DC}", - 'lamedholam' => "\x{05DC}\x{05B9}", - 'lamedholamdagesh' => "\x{05DC}\x{05B9}\x{05BC}", - 'lamedholamdageshhebrew' => "\x{05DC}\x{05B9}\x{05BC}", - 'lamedholamhebrew' => "\x{05DC}\x{05B9}", - 'lamfinalarabic' => "\x{FEDE}", - 'lamhahinitialarabic' => "\x{FCCA}", - 'laminitialarabic' => "\x{FEDF}", - 'lamjeeminitialarabic' => "\x{FCC9}", - 'lamkhahinitialarabic' => "\x{FCCB}", - 'lamlamhehisolatedarabic' => "\x{FDF2}", - 'lammedialarabic' => "\x{FEE0}", - 'lammeemhahinitialarabic' => "\x{FD88}", - 'lammeeminitialarabic' => "\x{FCCC}", - 'lammeemjeeminitialarabic' => "\x{FEDF}\x{FEE4}\x{FEA0}", - 'lammeemkhahinitialarabic' => "\x{FEDF}\x{FEE4}\x{FEA8}", - 'largecircle' => "\x{25EF}", - 'lbar' => "\x{019A}", - 'lbelt' => "\x{026C}", - 'lbopomofo' => "\x{310C}", - 'lcedilla' => "\x{013C}", - 'lcircle' => "\x{24DB}", - 'lcircumflexbelow' => "\x{1E3D}", - 'ldotaccent' => "\x{0140}", - 'ldotbelow' => "\x{1E37}", - 'ldotbelowmacron' => "\x{1E39}", - 'leftangleabovecmb' => "\x{031A}", - 'lefttackbelowcmb' => "\x{0318}", - 'lessequalorgreater' => "\x{22DA}", - 'lessmonospace' => "\x{FF1C}", - 'lessorequivalent' => "\x{2272}", - 'lessorgreater' => "\x{2276}", - 'lessoverequal' => "\x{2266}", - 'lesssmall' => "\x{FE64}", - 'lezh' => "\x{026E}", - 'lhookretroflex' => "\x{026D}", - 'liwnarmenian' => "\x{056C}", - 'lj' => "\x{01C9}", - 'ljecyrillic' => "\x{0459}", - 'll' => "\x{F6C0}", - 'lladeva' => "\x{0933}", - 'llagujarati' => "\x{0AB3}", - 'llinebelow' => "\x{1E3B}", - 'llladeva' => "\x{0934}", - 'llvocalicbengali' => "\x{09E1}", - 'llvocalicdeva' => "\x{0961}", - 'llvocalicvowelsignbengali' => "\x{09E3}", - 'llvocalicvowelsigndeva' => "\x{0963}", - 'lmiddletilde' => "\x{026B}", - 'lmonospace' => "\x{FF4C}", - 'lmsquare' => "\x{33D0}", - 'lochulathai' => "\x{0E2C}", - 'logicalnotreversed' => "\x{2310}", - 'lolingthai' => "\x{0E25}", - 'lowlinecenterline' => "\x{FE4E}", - 'lowlinecmb' => "\x{0332}", - 'lowlinedashed' => "\x{FE4D}", - 'lparen' => "\x{24A7}", - 'lsquare' => "\x{2113}", - 'lsuperior' => "\x{F6EE}", - 'luthai' => "\x{0E26}", - 'lvocalicbengali' => "\x{098C}", - 'lvocalicdeva' => "\x{090C}", - 'lvocalicvowelsignbengali' => "\x{09E2}", - 'lvocalicvowelsigndeva' => "\x{0962}", - 'lxsquare' => "\x{33D3}", - 'mabengali' => "\x{09AE}", - 'macronbelowcmb' => "\x{0331}", - 'macroncmb' => "\x{0304}", - 'macronlowmod' => "\x{02CD}", - 'macronmonospace' => "\x{FFE3}", - 'macute' => "\x{1E3F}", - 'madeva' => "\x{092E}", - 'magujarati' => "\x{0AAE}", - 'magurmukhi' => "\x{0A2E}", - 'mahapakhhebrew' => "\x{05A4}", - 'mahapakhlefthebrew' => "\x{05A4}", - 'mahiragana' => "\x{307E}", - 'maichattawalowleftthai' => "\x{F895}", - 'maichattawalowrightthai' => "\x{F894}", - 'maichattawathai' => "\x{0E4B}", - 'maichattawaupperleftthai' => "\x{F893}", - 'maieklowleftthai' => "\x{F88C}", - 'maieklowrightthai' => "\x{F88B}", - 'maiekthai' => "\x{0E48}", - 'maiekupperleftthai' => "\x{F88A}", - 'maihanakatleftthai' => "\x{F884}", - 'maihanakatthai' => "\x{0E31}", - 'maitaikhuleftthai' => "\x{F889}", - 'maitaikhuthai' => "\x{0E47}", - 'maitholowleftthai' => "\x{F88F}", - 'maitholowrightthai' => "\x{F88E}", - 'maithothai' => "\x{0E49}", - 'maithoupperleftthai' => "\x{F88D}", - 'maitrilowleftthai' => "\x{F892}", - 'maitrilowrightthai' => "\x{F891}", - 'maitrithai' => "\x{0E4A}", - 'maitriupperleftthai' => "\x{F890}", - 'maiyamokthai' => "\x{0E46}", - 'makatakana' => "\x{30DE}", - 'makatakanahalfwidth' => "\x{FF8F}", - 'mansyonsquare' => "\x{3347}", - 'maqafhebrew' => "\x{05BE}", - 'mars' => "\x{2642}", - 'masoracirclehebrew' => "\x{05AF}", - 'masquare' => "\x{3383}", - 'mbopomofo' => "\x{3107}", - 'mbsquare' => "\x{33D4}", - 'mcircle' => "\x{24DC}", - 'mcubedsquare' => "\x{33A5}", - 'mdotaccent' => "\x{1E41}", - 'mdotbelow' => "\x{1E43}", - 'meemarabic' => "\x{0645}", - 'meemfinalarabic' => "\x{FEE2}", - 'meeminitialarabic' => "\x{FEE3}", - 'meemmedialarabic' => "\x{FEE4}", - 'meemmeeminitialarabic' => "\x{FCD1}", - 'meemmeemisolatedarabic' => "\x{FC48}", - 'meetorusquare' => "\x{334D}", - 'mehiragana' => "\x{3081}", - 'meizierasquare' => "\x{337E}", - 'mekatakana' => "\x{30E1}", - 'mekatakanahalfwidth' => "\x{FF92}", - 'mem' => "\x{05DE}", - 'memdagesh' => "\x{FB3E}", - 'memdageshhebrew' => "\x{FB3E}", - 'memhebrew' => "\x{05DE}", - 'menarmenian' => "\x{0574}", - 'merkhahebrew' => "\x{05A5}", - 'merkhakefulahebrew' => "\x{05A6}", - 'merkhakefulalefthebrew' => "\x{05A6}", - 'merkhalefthebrew' => "\x{05A5}", - 'mhook' => "\x{0271}", - 'mhzsquare' => "\x{3392}", - 'middledotkatakanahalfwidth' => "\x{FF65}", - 'middot' => "\x{00B7}", - 'mieumacirclekorean' => "\x{3272}", - 'mieumaparenkorean' => "\x{3212}", - 'mieumcirclekorean' => "\x{3264}", - 'mieumkorean' => "\x{3141}", - 'mieumpansioskorean' => "\x{3170}", - 'mieumparenkorean' => "\x{3204}", - 'mieumpieupkorean' => "\x{316E}", - 'mieumsioskorean' => "\x{316F}", - 'mihiragana' => "\x{307F}", - 'mikatakana' => "\x{30DF}", - 'mikatakanahalfwidth' => "\x{FF90}", - 'minusbelowcmb' => "\x{0320}", - 'minuscircle' => "\x{2296}", - 'minusmod' => "\x{02D7}", - 'minusplus' => "\x{2213}", - 'miribaarusquare' => "\x{334A}", - 'mirisquare' => "\x{3349}", - 'mlonglegturned' => "\x{0270}", - 'mlsquare' => "\x{3396}", - 'mmcubedsquare' => "\x{33A3}", - 'mmonospace' => "\x{FF4D}", - 'mmsquaredsquare' => "\x{339F}", - 'mohiragana' => "\x{3082}", - 'mohmsquare' => "\x{33C1}", - 'mokatakana' => "\x{30E2}", - 'mokatakanahalfwidth' => "\x{FF93}", - 'molsquare' => "\x{33D6}", - 'momathai' => "\x{0E21}", - 'moverssquare' => "\x{33A7}", - 'moverssquaredsquare' => "\x{33A8}", - 'mparen' => "\x{24A8}", - 'mpasquare' => "\x{33AB}", - 'mssquare' => "\x{33B3}", - 'msuperior' => "\x{F6EF}", - 'mturned' => "\x{026F}", - 'mu1' => "\x{00B5}", - 'muasquare' => "\x{3382}", - 'muchgreater' => "\x{226B}", - 'muchless' => "\x{226A}", - 'mufsquare' => "\x{338C}", - 'mugreek' => "\x{03BC}", - 'mugsquare' => "\x{338D}", - 'muhiragana' => "\x{3080}", - 'mukatakana' => "\x{30E0}", - 'mukatakanahalfwidth' => "\x{FF91}", - 'mulsquare' => "\x{3395}", - 'mumsquare' => "\x{339B}", - 'munahhebrew' => "\x{05A3}", - 'munahlefthebrew' => "\x{05A3}", - 'musicflatsign' => "\x{266D}", - 'musicsharpsign' => "\x{266F}", - 'mussquare' => "\x{33B2}", - 'muvsquare' => "\x{33B6}", - 'muwsquare' => "\x{33BC}", - 'mvmegasquare' => "\x{33B9}", - 'mvsquare' => "\x{33B7}", - 'mwmegasquare' => "\x{33BF}", - 'mwsquare' => "\x{33BD}", - 'nabengali' => "\x{09A8}", - 'nabla' => "\x{2207}", - 'nadeva' => "\x{0928}", - 'nagujarati' => "\x{0AA8}", - 'nagurmukhi' => "\x{0A28}", - 'nahiragana' => "\x{306A}", - 'nakatakana' => "\x{30CA}", - 'nakatakanahalfwidth' => "\x{FF85}", - 'nasquare' => "\x{3381}", - 'nbopomofo' => "\x{310B}", - 'nbspace' => "\x{00A0}", - 'ncedilla' => "\x{0146}", - 'ncircle' => "\x{24DD}", - 'ncircumflexbelow' => "\x{1E4B}", - 'ndotaccent' => "\x{1E45}", - 'ndotbelow' => "\x{1E47}", - 'nehiragana' => "\x{306D}", - 'nekatakana' => "\x{30CD}", - 'nekatakanahalfwidth' => "\x{FF88}", - 'newsheqelsign' => "\x{20AA}", - 'nfsquare' => "\x{338B}", - 'ngabengali' => "\x{0999}", - 'ngadeva' => "\x{0919}", - 'ngagujarati' => "\x{0A99}", - 'ngagurmukhi' => "\x{0A19}", - 'ngonguthai' => "\x{0E07}", - 'nhiragana' => "\x{3093}", - 'nhookleft' => "\x{0272}", - 'nhookretroflex' => "\x{0273}", - 'nieunacirclekorean' => "\x{326F}", - 'nieunaparenkorean' => "\x{320F}", - 'nieuncieuckorean' => "\x{3135}", - 'nieuncirclekorean' => "\x{3261}", - 'nieunhieuhkorean' => "\x{3136}", - 'nieunkorean' => "\x{3134}", - 'nieunpansioskorean' => "\x{3168}", - 'nieunparenkorean' => "\x{3201}", - 'nieunsioskorean' => "\x{3167}", - 'nieuntikeutkorean' => "\x{3166}", - 'nihiragana' => "\x{306B}", - 'nikatakana' => "\x{30CB}", - 'nikatakanahalfwidth' => "\x{FF86}", - 'nikhahitleftthai' => "\x{F899}", - 'nikhahitthai' => "\x{0E4D}", - 'ninearabic' => "\x{0669}", - 'ninebengali' => "\x{09EF}", - 'ninecircle' => "\x{2468}", - 'ninecircleinversesansserif' => "\x{2792}", - 'ninedeva' => "\x{096F}", - 'ninegujarati' => "\x{0AEF}", - 'ninegurmukhi' => "\x{0A6F}", - 'ninehackarabic' => "\x{0669}", - 'ninehangzhou' => "\x{3029}", - 'nineideographicparen' => "\x{3228}", - 'nineinferior' => "\x{2089}", - 'ninemonospace' => "\x{FF19}", - 'nineoldstyle' => "\x{F739}", - 'nineparen' => "\x{247C}", - 'nineperiod' => "\x{2490}", - 'ninepersian' => "\x{06F9}", - 'nineroman' => "\x{2178}", - 'ninesuperior' => "\x{2079}", - 'nineteencircle' => "\x{2472}", - 'nineteenparen' => "\x{2486}", - 'nineteenperiod' => "\x{249A}", - 'ninethai' => "\x{0E59}", - 'nj' => "\x{01CC}", - 'njecyrillic' => "\x{045A}", - 'nkatakana' => "\x{30F3}", - 'nkatakanahalfwidth' => "\x{FF9D}", - 'nlegrightlong' => "\x{019E}", - 'nlinebelow' => "\x{1E49}", - 'nmonospace' => "\x{FF4E}", - 'nmsquare' => "\x{339A}", - 'nnabengali' => "\x{09A3}", - 'nnadeva' => "\x{0923}", - 'nnagujarati' => "\x{0AA3}", - 'nnagurmukhi' => "\x{0A23}", - 'nnnadeva' => "\x{0929}", - 'nohiragana' => "\x{306E}", - 'nokatakana' => "\x{30CE}", - 'nokatakanahalfwidth' => "\x{FF89}", - 'nonbreakingspace' => "\x{00A0}", - 'nonenthai' => "\x{0E13}", - 'nonuthai' => "\x{0E19}", - 'noonarabic' => "\x{0646}", - 'noonfinalarabic' => "\x{FEE6}", - 'noonghunnaarabic' => "\x{06BA}", - 'noonghunnafinalarabic' => "\x{FB9F}", - 'noonhehinitialarabic' => "\x{FEE7}\x{FEEC}", - 'nooninitialarabic' => "\x{FEE7}", - 'noonjeeminitialarabic' => "\x{FCD2}", - 'noonjeemisolatedarabic' => "\x{FC4B}", - 'noonmedialarabic' => "\x{FEE8}", - 'noonmeeminitialarabic' => "\x{FCD5}", - 'noonmeemisolatedarabic' => "\x{FC4E}", - 'noonnoonfinalarabic' => "\x{FC8D}", - 'notcontains' => "\x{220C}", - 'notelementof' => "\x{2209}", - 'notgreater' => "\x{226F}", - 'notgreaternorequal' => "\x{2271}", - 'notgreaternorless' => "\x{2279}", - 'notidentical' => "\x{2262}", - 'notless' => "\x{226E}", - 'notlessnorequal' => "\x{2270}", - 'notparallel' => "\x{2226}", - 'notprecedes' => "\x{2280}", - 'notsucceeds' => "\x{2281}", - 'notsuperset' => "\x{2285}", - 'nowarmenian' => "\x{0576}", - 'nparen' => "\x{24A9}", - 'nssquare' => "\x{33B1}", - 'nsuperior' => "\x{207F}", - 'nuhiragana' => "\x{306C}", - 'nukatakana' => "\x{30CC}", - 'nukatakanahalfwidth' => "\x{FF87}", - 'nuktabengali' => "\x{09BC}", - 'nuktadeva' => "\x{093C}", - 'nuktagujarati' => "\x{0ABC}", - 'nuktagurmukhi' => "\x{0A3C}", - 'numbersignmonospace' => "\x{FF03}", - 'numbersignsmall' => "\x{FE5F}", - 'numeralsigngreek' => "\x{0374}", - 'numeralsignlowergreek' => "\x{0375}", - 'numero' => "\x{2116}", - 'nun' => "\x{05E0}", - 'nundagesh' => "\x{FB40}", - 'nundageshhebrew' => "\x{FB40}", - 'nunhebrew' => "\x{05E0}", - 'nvsquare' => "\x{33B5}", - 'nwsquare' => "\x{33BB}", - 'nyabengali' => "\x{099E}", - 'nyadeva' => "\x{091E}", - 'nyagujarati' => "\x{0A9E}", - 'nyagurmukhi' => "\x{0A1E}", - 'oangthai' => "\x{0E2D}", - 'obarred' => "\x{0275}", - 'obarredcyrillic' => "\x{04E9}", - 'obarreddieresiscyrillic' => "\x{04EB}", - 'obengali' => "\x{0993}", - 'obopomofo' => "\x{311B}", - 'ocandradeva' => "\x{0911}", - 'ocandragujarati' => "\x{0A91}", - 'ocandravowelsigndeva' => "\x{0949}", - 'ocandravowelsigngujarati' => "\x{0AC9}", - 'ocaron' => "\x{01D2}", - 'ocircle' => "\x{24DE}", - 'ocircumflexacute' => "\x{1ED1}", - 'ocircumflexdotbelow' => "\x{1ED9}", - 'ocircumflexgrave' => "\x{1ED3}", - 'ocircumflexhookabove' => "\x{1ED5}", - 'ocircumflextilde' => "\x{1ED7}", - 'ocyrillic' => "\x{043E}", - 'odblacute' => "\x{0151}", - 'odblgrave' => "\x{020D}", - 'odeva' => "\x{0913}", - 'odieresiscyrillic' => "\x{04E7}", - 'odotbelow' => "\x{1ECD}", - 'oekorean' => "\x{315A}", - 'ogonekcmb' => "\x{0328}", - 'ogujarati' => "\x{0A93}", - 'oharmenian' => "\x{0585}", - 'ohiragana' => "\x{304A}", - 'ohookabove' => "\x{1ECF}", - 'ohornacute' => "\x{1EDB}", - 'ohorndotbelow' => "\x{1EE3}", - 'ohorngrave' => "\x{1EDD}", - 'ohornhookabove' => "\x{1EDF}", - 'ohorntilde' => "\x{1EE1}", - 'oi' => "\x{01A3}", - 'oinvertedbreve' => "\x{020F}", - 'okatakana' => "\x{30AA}", - 'okatakanahalfwidth' => "\x{FF75}", - 'okorean' => "\x{3157}", - 'olehebrew' => "\x{05AB}", - 'omacronacute' => "\x{1E53}", - 'omacrongrave' => "\x{1E51}", - 'omdeva' => "\x{0950}", - 'omegacyrillic' => "\x{0461}", - 'omegalatinclosed' => "\x{0277}", - 'omegaroundcyrillic' => "\x{047B}", - 'omegatitlocyrillic' => "\x{047D}", - 'omgujarati' => "\x{0AD0}", - 'omonospace' => "\x{FF4F}", - 'onearabic' => "\x{0661}", - 'onebengali' => "\x{09E7}", - 'onecircle' => "\x{2460}", - 'onecircleinversesansserif' => "\x{278A}", - 'onedeva' => "\x{0967}", - 'onefitted' => "\x{F6DC}", - 'onegujarati' => "\x{0AE7}", - 'onegurmukhi' => "\x{0A67}", - 'onehackarabic' => "\x{0661}", - 'onehangzhou' => "\x{3021}", - 'oneideographicparen' => "\x{3220}", - 'oneinferior' => "\x{2081}", - 'onemonospace' => "\x{FF11}", - 'onenumeratorbengali' => "\x{09F4}", - 'oneoldstyle' => "\x{F731}", - 'oneparen' => "\x{2474}", - 'oneperiod' => "\x{2488}", - 'onepersian' => "\x{06F1}", - 'oneroman' => "\x{2170}", - 'onethai' => "\x{0E51}", - 'oogonek' => "\x{01EB}", - 'oogonekmacron' => "\x{01ED}", - 'oogurmukhi' => "\x{0A13}", - 'oomatragurmukhi' => "\x{0A4B}", - 'oopen' => "\x{0254}", - 'oparen' => "\x{24AA}", - 'option' => "\x{2325}", - 'oshortdeva' => "\x{0912}", - 'oshortvowelsigndeva' => "\x{094A}", - 'osmallhiragana' => "\x{3049}", - 'osmallkatakana' => "\x{30A9}", - 'osmallkatakanahalfwidth' => "\x{FF6B}", - 'ostrokeacute' => "\x{01FF}", - 'osuperior' => "\x{F6F0}", - 'otcyrillic' => "\x{047F}", - 'otildeacute' => "\x{1E4D}", - 'otildedieresis' => "\x{1E4F}", - 'oubopomofo' => "\x{3121}", - 'overline' => "\x{203E}", - 'overlinecenterline' => "\x{FE4A}", - 'overlinecmb' => "\x{0305}", - 'overlinedashed' => "\x{FE49}", - 'overlinedblwavy' => "\x{FE4C}", - 'overlinewavy' => "\x{FE4B}", - 'overscore' => "\x{00AF}", - 'ovowelsignbengali' => "\x{09CB}", - 'ovowelsigndeva' => "\x{094B}", - 'ovowelsigngujarati' => "\x{0ACB}", - 'paampssquare' => "\x{3380}", - 'paasentosquare' => "\x{332B}", - 'pabengali' => "\x{09AA}", - 'pacute' => "\x{1E55}", - 'padeva' => "\x{092A}", - 'pagedown' => "\x{21DF}", - 'pageup' => "\x{21DE}", - 'pagujarati' => "\x{0AAA}", - 'pagurmukhi' => "\x{0A2A}", - 'pahiragana' => "\x{3071}", - 'paiyannoithai' => "\x{0E2F}", - 'pakatakana' => "\x{30D1}", - 'palatalizationcyrilliccmb' => "\x{0484}", - 'palochkacyrillic' => "\x{04C0}", - 'pansioskorean' => "\x{317F}", - 'parallel' => "\x{2225}", - 'parenleftaltonearabic' => "\x{FD3E}", - 'parenleftbt' => "\x{F8ED}", - 'parenleftex' => "\x{F8EC}", - 'parenleftinferior' => "\x{208D}", - 'parenleftmonospace' => "\x{FF08}", - 'parenleftsmall' => "\x{FE59}", - 'parenleftsuperior' => "\x{207D}", - 'parenlefttp' => "\x{F8EB}", - 'parenleftvertical' => "\x{FE35}", - 'parenrightaltonearabic' => "\x{FD3F}", - 'parenrightbt' => "\x{F8F8}", - 'parenrightex' => "\x{F8F7}", - 'parenrightinferior' => "\x{208E}", - 'parenrightmonospace' => "\x{FF09}", - 'parenrightsmall' => "\x{FE5A}", - 'parenrightsuperior' => "\x{207E}", - 'parenrighttp' => "\x{F8F6}", - 'parenrightvertical' => "\x{FE36}", - 'paseqhebrew' => "\x{05C0}", - 'pashtahebrew' => "\x{0599}", - 'pasquare' => "\x{33A9}", - 'patah' => "\x{05B7}", - 'patah11' => "\x{05B7}", - 'patah1d' => "\x{05B7}", - 'patah2a' => "\x{05B7}", - 'patahhebrew' => "\x{05B7}", - 'patahnarrowhebrew' => "\x{05B7}", - 'patahquarterhebrew' => "\x{05B7}", - 'patahwidehebrew' => "\x{05B7}", - 'pazerhebrew' => "\x{05A1}", - 'pbopomofo' => "\x{3106}", - 'pcircle' => "\x{24DF}", - 'pdotaccent' => "\x{1E57}", - 'pe' => "\x{05E4}", - 'pecyrillic' => "\x{043F}", - 'pedagesh' => "\x{FB44}", - 'pedageshhebrew' => "\x{FB44}", - 'peezisquare' => "\x{333B}", - 'pefinaldageshhebrew' => "\x{FB43}", - 'peharabic' => "\x{067E}", - 'peharmenian' => "\x{057A}", - 'pehebrew' => "\x{05E4}", - 'pehfinalarabic' => "\x{FB57}", - 'pehinitialarabic' => "\x{FB58}", - 'pehiragana' => "\x{307A}", - 'pehmedialarabic' => "\x{FB59}", - 'pekatakana' => "\x{30DA}", - 'pemiddlehookcyrillic' => "\x{04A7}", - 'perafehebrew' => "\x{FB4E}", - 'percentarabic' => "\x{066A}", - 'percentmonospace' => "\x{FF05}", - 'percentsmall' => "\x{FE6A}", - 'periodarmenian' => "\x{0589}", - 'periodhalfwidth' => "\x{FF61}", - 'periodinferior' => "\x{F6E7}", - 'periodmonospace' => "\x{FF0E}", - 'periodsmall' => "\x{FE52}", - 'periodsuperior' => "\x{F6E8}", - 'perispomenigreekcmb' => "\x{0342}", - 'pfsquare' => "\x{338A}", - 'phabengali' => "\x{09AB}", - 'phadeva' => "\x{092B}", - 'phagujarati' => "\x{0AAB}", - 'phagurmukhi' => "\x{0A2B}", - 'phieuphacirclekorean' => "\x{327A}", - 'phieuphaparenkorean' => "\x{321A}", - 'phieuphcirclekorean' => "\x{326C}", - 'phieuphkorean' => "\x{314D}", - 'phieuphparenkorean' => "\x{320C}", - 'philatin' => "\x{0278}", - 'phinthuthai' => "\x{0E3A}", - 'phisymbolgreek' => "\x{03D5}", - 'phook' => "\x{01A5}", - 'phophanthai' => "\x{0E1E}", - 'phophungthai' => "\x{0E1C}", - 'phosamphaothai' => "\x{0E20}", - 'pieupacirclekorean' => "\x{3273}", - 'pieupaparenkorean' => "\x{3213}", - 'pieupcieuckorean' => "\x{3176}", - 'pieupcirclekorean' => "\x{3265}", - 'pieupkiyeokkorean' => "\x{3172}", - 'pieupkorean' => "\x{3142}", - 'pieupparenkorean' => "\x{3205}", - 'pieupsioskiyeokkorean' => "\x{3174}", - 'pieupsioskorean' => "\x{3144}", - 'pieupsiostikeutkorean' => "\x{3175}", - 'pieupthieuthkorean' => "\x{3177}", - 'pieuptikeutkorean' => "\x{3173}", - 'pihiragana' => "\x{3074}", - 'pikatakana' => "\x{30D4}", - 'pisymbolgreek' => "\x{03D6}", - 'piwrarmenian' => "\x{0583}", - 'plusbelowcmb' => "\x{031F}", - 'pluscircle' => "\x{2295}", - 'plusmod' => "\x{02D6}", - 'plusmonospace' => "\x{FF0B}", - 'plussmall' => "\x{FE62}", - 'plussuperior' => "\x{207A}", - 'pmonospace' => "\x{FF50}", - 'pmsquare' => "\x{33D8}", - 'pohiragana' => "\x{307D}", - 'pointingindexdownwhite' => "\x{261F}", - 'pointingindexleftwhite' => "\x{261C}", - 'pointingindexrightwhite' => "\x{261E}", - 'pointingindexupwhite' => "\x{261D}", - 'pokatakana' => "\x{30DD}", - 'poplathai' => "\x{0E1B}", - 'postalmark' => "\x{3012}", - 'postalmarkface' => "\x{3020}", - 'pparen' => "\x{24AB}", - 'precedes' => "\x{227A}", - 'primemod' => "\x{02B9}", - 'primereversed' => "\x{2035}", - 'projective' => "\x{2305}", - 'prolongedkana' => "\x{30FC}", - 'propellor' => "\x{2318}", - 'proportion' => "\x{2237}", - 'psicyrillic' => "\x{0471}", - 'psilipneumatacyrilliccmb' => "\x{0486}", - 'pssquare' => "\x{33B0}", - 'puhiragana' => "\x{3077}", - 'pukatakana' => "\x{30D7}", - 'pvsquare' => "\x{33B4}", - 'pwsquare' => "\x{33BA}", - 'qadeva' => "\x{0958}", - 'qadmahebrew' => "\x{05A8}", - 'qafarabic' => "\x{0642}", - 'qaffinalarabic' => "\x{FED6}", - 'qafinitialarabic' => "\x{FED7}", - 'qafmedialarabic' => "\x{FED8}", - 'qamats' => "\x{05B8}", - 'qamats10' => "\x{05B8}", - 'qamats1a' => "\x{05B8}", - 'qamats1c' => "\x{05B8}", - 'qamats27' => "\x{05B8}", - 'qamats29' => "\x{05B8}", - 'qamats33' => "\x{05B8}", - 'qamatsde' => "\x{05B8}", - 'qamatshebrew' => "\x{05B8}", - 'qamatsnarrowhebrew' => "\x{05B8}", - 'qamatsqatanhebrew' => "\x{05B8}", - 'qamatsqatannarrowhebrew' => "\x{05B8}", - 'qamatsqatanquarterhebrew' => "\x{05B8}", - 'qamatsqatanwidehebrew' => "\x{05B8}", - 'qamatsquarterhebrew' => "\x{05B8}", - 'qamatswidehebrew' => "\x{05B8}", - 'qarneyparahebrew' => "\x{059F}", - 'qbopomofo' => "\x{3111}", - 'qcircle' => "\x{24E0}", - 'qhook' => "\x{02A0}", - 'qmonospace' => "\x{FF51}", - 'qof' => "\x{05E7}", - 'qofdagesh' => "\x{FB47}", - 'qofdageshhebrew' => "\x{FB47}", - 'qofhatafpatah' => "\x{05E7}\x{05B2}", - 'qofhatafpatahhebrew' => "\x{05E7}\x{05B2}", - 'qofhatafsegol' => "\x{05E7}\x{05B1}", - 'qofhatafsegolhebrew' => "\x{05E7}\x{05B1}", - 'qofhebrew' => "\x{05E7}", - 'qofhiriq' => "\x{05E7}\x{05B4}", - 'qofhiriqhebrew' => "\x{05E7}\x{05B4}", - 'qofholam' => "\x{05E7}\x{05B9}", - 'qofholamhebrew' => "\x{05E7}\x{05B9}", - 'qofpatah' => "\x{05E7}\x{05B7}", - 'qofpatahhebrew' => "\x{05E7}\x{05B7}", - 'qofqamats' => "\x{05E7}\x{05B8}", - 'qofqamatshebrew' => "\x{05E7}\x{05B8}", - 'qofqubuts' => "\x{05E7}\x{05BB}", - 'qofqubutshebrew' => "\x{05E7}\x{05BB}", - 'qofsegol' => "\x{05E7}\x{05B6}", - 'qofsegolhebrew' => "\x{05E7}\x{05B6}", - 'qofsheva' => "\x{05E7}\x{05B0}", - 'qofshevahebrew' => "\x{05E7}\x{05B0}", - 'qoftsere' => "\x{05E7}\x{05B5}", - 'qoftserehebrew' => "\x{05E7}\x{05B5}", - 'qparen' => "\x{24AC}", - 'quarternote' => "\x{2669}", - 'qubuts' => "\x{05BB}", - 'qubuts18' => "\x{05BB}", - 'qubuts25' => "\x{05BB}", - 'qubuts31' => "\x{05BB}", - 'qubutshebrew' => "\x{05BB}", - 'qubutsnarrowhebrew' => "\x{05BB}", - 'qubutsquarterhebrew' => "\x{05BB}", - 'qubutswidehebrew' => "\x{05BB}", - 'questionarabic' => "\x{061F}", - 'questionarmenian' => "\x{055E}", - 'questiondownsmall' => "\x{F7BF}", - 'questiongreek' => "\x{037E}", - 'questionmonospace' => "\x{FF1F}", - 'questionsmall' => "\x{F73F}", - 'quotedblmonospace' => "\x{FF02}", - 'quotedblprime' => "\x{301E}", - 'quotedblprimereversed' => "\x{301D}", - 'quoteleftreversed' => "\x{201B}", - 'quoterightn' => "\x{0149}", - 'quotesinglemonospace' => "\x{FF07}", - 'raarmenian' => "\x{057C}", - 'rabengali' => "\x{09B0}", - 'radeva' => "\x{0930}", - 'radicalex' => "\x{F8E5}", - 'radoverssquare' => "\x{33AE}", - 'radoverssquaredsquare' => "\x{33AF}", - 'radsquare' => "\x{33AD}", - 'rafe' => "\x{05BF}", - 'rafehebrew' => "\x{05BF}", - 'ragujarati' => "\x{0AB0}", - 'ragurmukhi' => "\x{0A30}", - 'rahiragana' => "\x{3089}", - 'rakatakana' => "\x{30E9}", - 'rakatakanahalfwidth' => "\x{FF97}", - 'ralowerdiagonalbengali' => "\x{09F1}", - 'ramiddlediagonalbengali' => "\x{09F0}", - 'ramshorn' => "\x{0264}", - 'ratio' => "\x{2236}", - 'rbopomofo' => "\x{3116}", - 'rcedilla' => "\x{0157}", - 'rcircle' => "\x{24E1}", - 'rdblgrave' => "\x{0211}", - 'rdotaccent' => "\x{1E59}", - 'rdotbelow' => "\x{1E5B}", - 'rdotbelowmacron' => "\x{1E5D}", - 'referencemark' => "\x{203B}", - 'registersans' => "\x{F8E8}", - 'registerserif' => "\x{F6DA}", - 'reharabic' => "\x{0631}", - 'reharmenian' => "\x{0580}", - 'rehfinalarabic' => "\x{FEAE}", - 'rehiragana' => "\x{308C}", - 'rehyehaleflamarabic' => "\x{0631}\x{FEF3}\x{FE8E}\x{0644}", - 'rekatakana' => "\x{30EC}", - 'rekatakanahalfwidth' => "\x{FF9A}", - 'resh' => "\x{05E8}", - 'reshdageshhebrew' => "\x{FB48}", - 'reshhatafpatah' => "\x{05E8}\x{05B2}", - 'reshhatafpatahhebrew' => "\x{05E8}\x{05B2}", - 'reshhatafsegol' => "\x{05E8}\x{05B1}", - 'reshhatafsegolhebrew' => "\x{05E8}\x{05B1}", - 'reshhebrew' => "\x{05E8}", - 'reshhiriq' => "\x{05E8}\x{05B4}", - 'reshhiriqhebrew' => "\x{05E8}\x{05B4}", - 'reshholam' => "\x{05E8}\x{05B9}", - 'reshholamhebrew' => "\x{05E8}\x{05B9}", - 'reshpatah' => "\x{05E8}\x{05B7}", - 'reshpatahhebrew' => "\x{05E8}\x{05B7}", - 'reshqamats' => "\x{05E8}\x{05B8}", - 'reshqamatshebrew' => "\x{05E8}\x{05B8}", - 'reshqubuts' => "\x{05E8}\x{05BB}", - 'reshqubutshebrew' => "\x{05E8}\x{05BB}", - 'reshsegol' => "\x{05E8}\x{05B6}", - 'reshsegolhebrew' => "\x{05E8}\x{05B6}", - 'reshsheva' => "\x{05E8}\x{05B0}", - 'reshshevahebrew' => "\x{05E8}\x{05B0}", - 'reshtsere' => "\x{05E8}\x{05B5}", - 'reshtserehebrew' => "\x{05E8}\x{05B5}", - 'reversedtilde' => "\x{223D}", - 'reviahebrew' => "\x{0597}", - 'reviamugrashhebrew' => "\x{0597}", - 'rfishhook' => "\x{027E}", - 'rfishhookreversed' => "\x{027F}", - 'rhabengali' => "\x{09DD}", - 'rhadeva' => "\x{095D}", - 'rhook' => "\x{027D}", - 'rhookturned' => "\x{027B}", - 'rhookturnedsuperior' => "\x{02B5}", - 'rhosymbolgreek' => "\x{03F1}", - 'rhotichookmod' => "\x{02DE}", - 'rieulacirclekorean' => "\x{3271}", - 'rieulaparenkorean' => "\x{3211}", - 'rieulcirclekorean' => "\x{3263}", - 'rieulhieuhkorean' => "\x{3140}", - 'rieulkiyeokkorean' => "\x{313A}", - 'rieulkiyeoksioskorean' => "\x{3169}", - 'rieulkorean' => "\x{3139}", - 'rieulmieumkorean' => "\x{313B}", - 'rieulpansioskorean' => "\x{316C}", - 'rieulparenkorean' => "\x{3203}", - 'rieulphieuphkorean' => "\x{313F}", - 'rieulpieupkorean' => "\x{313C}", - 'rieulpieupsioskorean' => "\x{316B}", - 'rieulsioskorean' => "\x{313D}", - 'rieulthieuthkorean' => "\x{313E}", - 'rieultikeutkorean' => "\x{316A}", - 'rieulyeorinhieuhkorean' => "\x{316D}", - 'rightangle' => "\x{221F}", - 'righttackbelowcmb' => "\x{0319}", - 'righttriangle' => "\x{22BF}", - 'rihiragana' => "\x{308A}", - 'rikatakana' => "\x{30EA}", - 'rikatakanahalfwidth' => "\x{FF98}", - 'ringbelowcmb' => "\x{0325}", - 'ringcmb' => "\x{030A}", - 'ringhalfleft' => "\x{02BF}", - 'ringhalfleftarmenian' => "\x{0559}", - 'ringhalfleftbelowcmb' => "\x{031C}", - 'ringhalfleftcentered' => "\x{02D3}", - 'ringhalfright' => "\x{02BE}", - 'ringhalfrightbelowcmb' => "\x{0339}", - 'ringhalfrightcentered' => "\x{02D2}", - 'rinvertedbreve' => "\x{0213}", - 'rittorusquare' => "\x{3351}", - 'rlinebelow' => "\x{1E5F}", - 'rlongleg' => "\x{027C}", - 'rlonglegturned' => "\x{027A}", - 'rmonospace' => "\x{FF52}", - 'rohiragana' => "\x{308D}", - 'rokatakana' => "\x{30ED}", - 'rokatakanahalfwidth' => "\x{FF9B}", - 'roruathai' => "\x{0E23}", - 'rparen' => "\x{24AD}", - 'rrabengali' => "\x{09DC}", - 'rradeva' => "\x{0931}", - 'rragurmukhi' => "\x{0A5C}", - 'rreharabic' => "\x{0691}", - 'rrehfinalarabic' => "\x{FB8D}", - 'rrvocalicbengali' => "\x{09E0}", - 'rrvocalicdeva' => "\x{0960}", - 'rrvocalicgujarati' => "\x{0AE0}", - 'rrvocalicvowelsignbengali' => "\x{09C4}", - 'rrvocalicvowelsigndeva' => "\x{0944}", - 'rrvocalicvowelsigngujarati' => "\x{0AC4}", - 'rsuperior' => "\x{F6F1}", - 'rturned' => "\x{0279}", - 'rturnedsuperior' => "\x{02B4}", - 'ruhiragana' => "\x{308B}", - 'rukatakana' => "\x{30EB}", - 'rukatakanahalfwidth' => "\x{FF99}", - 'rupeemarkbengali' => "\x{09F2}", - 'rupeesignbengali' => "\x{09F3}", - 'rupiah' => "\x{F6DD}", - 'ruthai' => "\x{0E24}", - 'rvocalicbengali' => "\x{098B}", - 'rvocalicdeva' => "\x{090B}", - 'rvocalicgujarati' => "\x{0A8B}", - 'rvocalicvowelsignbengali' => "\x{09C3}", - 'rvocalicvowelsigndeva' => "\x{0943}", - 'rvocalicvowelsigngujarati' => "\x{0AC3}", - 'sabengali' => "\x{09B8}", - 'sacutedotaccent' => "\x{1E65}", - 'sadarabic' => "\x{0635}", - 'sadeva' => "\x{0938}", - 'sadfinalarabic' => "\x{FEBA}", - 'sadinitialarabic' => "\x{FEBB}", - 'sadmedialarabic' => "\x{FEBC}", - 'sagujarati' => "\x{0AB8}", - 'sagurmukhi' => "\x{0A38}", - 'sahiragana' => "\x{3055}", - 'sakatakana' => "\x{30B5}", - 'sakatakanahalfwidth' => "\x{FF7B}", - 'sallallahoualayhewasallamarabic' => "\x{FDFA}", - 'samekh' => "\x{05E1}", - 'samekhdagesh' => "\x{FB41}", - 'samekhdageshhebrew' => "\x{FB41}", - 'samekhhebrew' => "\x{05E1}", - 'saraaathai' => "\x{0E32}", - 'saraaethai' => "\x{0E41}", - 'saraaimaimalaithai' => "\x{0E44}", - 'saraaimaimuanthai' => "\x{0E43}", - 'saraamthai' => "\x{0E33}", - 'saraathai' => "\x{0E30}", - 'saraethai' => "\x{0E40}", - 'saraiileftthai' => "\x{F886}", - 'saraiithai' => "\x{0E35}", - 'saraileftthai' => "\x{F885}", - 'saraithai' => "\x{0E34}", - 'saraothai' => "\x{0E42}", - 'saraueeleftthai' => "\x{F888}", - 'saraueethai' => "\x{0E37}", - 'saraueleftthai' => "\x{F887}", - 'sarauethai' => "\x{0E36}", - 'sarauthai' => "\x{0E38}", - 'sarauuthai' => "\x{0E39}", - 'sbopomofo' => "\x{3119}", - 'scarondotaccent' => "\x{1E67}", - 'schwa' => "\x{0259}", - 'schwacyrillic' => "\x{04D9}", - 'schwadieresiscyrillic' => "\x{04DB}", - 'schwahook' => "\x{025A}", - 'scircle' => "\x{24E2}", - 'sdotaccent' => "\x{1E61}", - 'sdotbelow' => "\x{1E63}", - 'sdotbelowdotaccent' => "\x{1E69}", - 'seagullbelowcmb' => "\x{033C}", - 'secondtonechinese' => "\x{02CA}", - 'seenarabic' => "\x{0633}", - 'seenfinalarabic' => "\x{FEB2}", - 'seeninitialarabic' => "\x{FEB3}", - 'seenmedialarabic' => "\x{FEB4}", - 'segol' => "\x{05B6}", - 'segol13' => "\x{05B6}", - 'segol1f' => "\x{05B6}", - 'segol2c' => "\x{05B6}", - 'segolhebrew' => "\x{05B6}", - 'segolnarrowhebrew' => "\x{05B6}", - 'segolquarterhebrew' => "\x{05B6}", - 'segoltahebrew' => "\x{0592}", - 'segolwidehebrew' => "\x{05B6}", - 'seharmenian' => "\x{057D}", - 'sehiragana' => "\x{305B}", - 'sekatakana' => "\x{30BB}", - 'sekatakanahalfwidth' => "\x{FF7E}", - 'semicolonarabic' => "\x{061B}", - 'semicolonmonospace' => "\x{FF1B}", - 'semicolonsmall' => "\x{FE54}", - 'semivoicedmarkkana' => "\x{309C}", - 'semivoicedmarkkanahalfwidth' => "\x{FF9F}", - 'sentisquare' => "\x{3322}", - 'sentosquare' => "\x{3323}", - 'sevenarabic' => "\x{0667}", - 'sevenbengali' => "\x{09ED}", - 'sevencircle' => "\x{2466}", - 'sevencircleinversesansserif' => "\x{2790}", - 'sevendeva' => "\x{096D}", - 'sevengujarati' => "\x{0AED}", - 'sevengurmukhi' => "\x{0A6D}", - 'sevenhackarabic' => "\x{0667}", - 'sevenhangzhou' => "\x{3027}", - 'sevenideographicparen' => "\x{3226}", - 'seveninferior' => "\x{2087}", - 'sevenmonospace' => "\x{FF17}", - 'sevenoldstyle' => "\x{F737}", - 'sevenparen' => "\x{247A}", - 'sevenperiod' => "\x{248E}", - 'sevenpersian' => "\x{06F7}", - 'sevenroman' => "\x{2176}", - 'sevensuperior' => "\x{2077}", - 'seventeencircle' => "\x{2470}", - 'seventeenparen' => "\x{2484}", - 'seventeenperiod' => "\x{2498}", - 'seventhai' => "\x{0E57}", - 'sfthyphen' => "\x{00AD}", - 'shaarmenian' => "\x{0577}", - 'shabengali' => "\x{09B6}", - 'shacyrillic' => "\x{0448}", - 'shaddaarabic' => "\x{0651}", - 'shaddadammaarabic' => "\x{FC61}", - 'shaddadammatanarabic' => "\x{FC5E}", - 'shaddafathaarabic' => "\x{FC60}", - 'shaddafathatanarabic' => "\x{0651}\x{064B}", - 'shaddakasraarabic' => "\x{FC62}", - 'shaddakasratanarabic' => "\x{FC5F}", - 'shadedark' => "\x{2593}", - 'shadelight' => "\x{2591}", - 'shademedium' => "\x{2592}", - 'shadeva' => "\x{0936}", - 'shagujarati' => "\x{0AB6}", - 'shagurmukhi' => "\x{0A36}", - 'shalshelethebrew' => "\x{0593}", - 'shbopomofo' => "\x{3115}", - 'shchacyrillic' => "\x{0449}", - 'sheenarabic' => "\x{0634}", - 'sheenfinalarabic' => "\x{FEB6}", - 'sheeninitialarabic' => "\x{FEB7}", - 'sheenmedialarabic' => "\x{FEB8}", - 'sheicoptic' => "\x{03E3}", - 'sheqel' => "\x{20AA}", - 'sheqelhebrew' => "\x{20AA}", - 'sheva' => "\x{05B0}", - 'sheva115' => "\x{05B0}", - 'sheva15' => "\x{05B0}", - 'sheva22' => "\x{05B0}", - 'sheva2e' => "\x{05B0}", - 'shevahebrew' => "\x{05B0}", - 'shevanarrowhebrew' => "\x{05B0}", - 'shevaquarterhebrew' => "\x{05B0}", - 'shevawidehebrew' => "\x{05B0}", - 'shhacyrillic' => "\x{04BB}", - 'shimacoptic' => "\x{03ED}", - 'shin' => "\x{05E9}", - 'shindagesh' => "\x{FB49}", - 'shindageshhebrew' => "\x{FB49}", - 'shindageshshindot' => "\x{FB2C}", - 'shindageshshindothebrew' => "\x{FB2C}", - 'shindageshsindot' => "\x{FB2D}", - 'shindageshsindothebrew' => "\x{FB2D}", - 'shindothebrew' => "\x{05C1}", - 'shinhebrew' => "\x{05E9}", - 'shinshindot' => "\x{FB2A}", - 'shinshindothebrew' => "\x{FB2A}", - 'shinsindot' => "\x{FB2B}", - 'shinsindothebrew' => "\x{FB2B}", - 'shook' => "\x{0282}", - 'sigmafinal' => "\x{03C2}", - 'sigmalunatesymbolgreek' => "\x{03F2}", - 'sihiragana' => "\x{3057}", - 'sikatakana' => "\x{30B7}", - 'sikatakanahalfwidth' => "\x{FF7C}", - 'siluqhebrew' => "\x{05BD}", - 'siluqlefthebrew' => "\x{05BD}", - 'sindothebrew' => "\x{05C2}", - 'siosacirclekorean' => "\x{3274}", - 'siosaparenkorean' => "\x{3214}", - 'sioscieuckorean' => "\x{317E}", - 'sioscirclekorean' => "\x{3266}", - 'sioskiyeokkorean' => "\x{317A}", - 'sioskorean' => "\x{3145}", - 'siosnieunkorean' => "\x{317B}", - 'siosparenkorean' => "\x{3206}", - 'siospieupkorean' => "\x{317D}", - 'siostikeutkorean' => "\x{317C}", - 'sixarabic' => "\x{0666}", - 'sixbengali' => "\x{09EC}", - 'sixcircle' => "\x{2465}", - 'sixcircleinversesansserif' => "\x{278F}", - 'sixdeva' => "\x{096C}", - 'sixgujarati' => "\x{0AEC}", - 'sixgurmukhi' => "\x{0A6C}", - 'sixhackarabic' => "\x{0666}", - 'sixhangzhou' => "\x{3026}", - 'sixideographicparen' => "\x{3225}", - 'sixinferior' => "\x{2086}", - 'sixmonospace' => "\x{FF16}", - 'sixoldstyle' => "\x{F736}", - 'sixparen' => "\x{2479}", - 'sixperiod' => "\x{248D}", - 'sixpersian' => "\x{06F6}", - 'sixroman' => "\x{2175}", - 'sixsuperior' => "\x{2076}", - 'sixteencircle' => "\x{246F}", - 'sixteencurrencydenominatorbengali' => "\x{09F9}", - 'sixteenparen' => "\x{2483}", - 'sixteenperiod' => "\x{2497}", - 'sixthai' => "\x{0E56}", - 'slashmonospace' => "\x{FF0F}", - 'slong' => "\x{017F}", - 'slongdotaccent' => "\x{1E9B}", - 'smonospace' => "\x{FF53}", - 'sofpasuqhebrew' => "\x{05C3}", - 'softhyphen' => "\x{00AD}", - 'softsigncyrillic' => "\x{044C}", - 'sohiragana' => "\x{305D}", - 'sokatakana' => "\x{30BD}", - 'sokatakanahalfwidth' => "\x{FF7F}", - 'soliduslongoverlaycmb' => "\x{0338}", - 'solidusshortoverlaycmb' => "\x{0337}", - 'sorusithai' => "\x{0E29}", - 'sosalathai' => "\x{0E28}", - 'sosothai' => "\x{0E0B}", - 'sosuathai' => "\x{0E2A}", - 'spacehackarabic' => "\x{0020}", - 'spadesuitblack' => "\x{2660}", - 'spadesuitwhite' => "\x{2664}", - 'sparen' => "\x{24AE}", - 'squarebelowcmb' => "\x{033B}", - 'squarecc' => "\x{33C4}", - 'squarecm' => "\x{339D}", - 'squarediagonalcrosshatchfill' => "\x{25A9}", - 'squarehorizontalfill' => "\x{25A4}", - 'squarekg' => "\x{338F}", - 'squarekm' => "\x{339E}", - 'squarekmcapital' => "\x{33CE}", - 'squareln' => "\x{33D1}", - 'squarelog' => "\x{33D2}", - 'squaremg' => "\x{338E}", - 'squaremil' => "\x{33D5}", - 'squaremm' => "\x{339C}", - 'squaremsquared' => "\x{33A1}", - 'squareorthogonalcrosshatchfill' => "\x{25A6}", - 'squareupperlefttolowerrightfill' => "\x{25A7}", - 'squareupperrighttolowerleftfill' => "\x{25A8}", - 'squareverticalfill' => "\x{25A5}", - 'squarewhitewithsmallblack' => "\x{25A3}", - 'srsquare' => "\x{33DB}", - 'ssabengali' => "\x{09B7}", - 'ssadeva' => "\x{0937}", - 'ssagujarati' => "\x{0AB7}", - 'ssangcieuckorean' => "\x{3149}", - 'ssanghieuhkorean' => "\x{3185}", - 'ssangieungkorean' => "\x{3180}", - 'ssangkiyeokkorean' => "\x{3132}", - 'ssangnieunkorean' => "\x{3165}", - 'ssangpieupkorean' => "\x{3143}", - 'ssangsioskorean' => "\x{3146}", - 'ssangtikeutkorean' => "\x{3138}", - 'ssuperior' => "\x{F6F2}", - 'sterlingmonospace' => "\x{FFE1}", - 'strokelongoverlaycmb' => "\x{0336}", - 'strokeshortoverlaycmb' => "\x{0335}", - 'subset' => "\x{2282}", - 'subsetnotequal' => "\x{228A}", - 'subsetorequal' => "\x{2286}", - 'succeeds' => "\x{227B}", - 'suhiragana' => "\x{3059}", - 'sukatakana' => "\x{30B9}", - 'sukatakanahalfwidth' => "\x{FF7D}", - 'sukunarabic' => "\x{0652}", - 'superset' => "\x{2283}", - 'supersetnotequal' => "\x{228B}", - 'supersetorequal' => "\x{2287}", - 'svsquare' => "\x{33DC}", - 'syouwaerasquare' => "\x{337C}", - 'tabengali' => "\x{09A4}", - 'tackdown' => "\x{22A4}", - 'tackleft' => "\x{22A3}", - 'tadeva' => "\x{0924}", - 'tagujarati' => "\x{0AA4}", - 'tagurmukhi' => "\x{0A24}", - 'taharabic' => "\x{0637}", - 'tahfinalarabic' => "\x{FEC2}", - 'tahinitialarabic' => "\x{FEC3}", - 'tahiragana' => "\x{305F}", - 'tahmedialarabic' => "\x{FEC4}", - 'taisyouerasquare' => "\x{337D}", - 'takatakana' => "\x{30BF}", - 'takatakanahalfwidth' => "\x{FF80}", - 'tatweelarabic' => "\x{0640}", - 'tav' => "\x{05EA}", - 'tavdages' => "\x{FB4A}", - 'tavdagesh' => "\x{FB4A}", - 'tavdageshhebrew' => "\x{FB4A}", - 'tavhebrew' => "\x{05EA}", - 'tbopomofo' => "\x{310A}", - 'tccurl' => "\x{02A8}", - 'tcedilla' => "\x{0163}", - 'tcheharabic' => "\x{0686}", - 'tchehfinalarabic' => "\x{FB7B}", - 'tchehinitialarabic' => "\x{FB7C}", - 'tchehmedialarabic' => "\x{FB7D}", - 'tchehmeeminitialarabic' => "\x{FB7C}\x{FEE4}", - 'tcircle' => "\x{24E3}", - 'tcircumflexbelow' => "\x{1E71}", - 'tdieresis' => "\x{1E97}", - 'tdotaccent' => "\x{1E6B}", - 'tdotbelow' => "\x{1E6D}", - 'tecyrillic' => "\x{0442}", - 'tedescendercyrillic' => "\x{04AD}", - 'teharabic' => "\x{062A}", - 'tehfinalarabic' => "\x{FE96}", - 'tehhahinitialarabic' => "\x{FCA2}", - 'tehhahisolatedarabic' => "\x{FC0C}", - 'tehinitialarabic' => "\x{FE97}", - 'tehiragana' => "\x{3066}", - 'tehjeeminitialarabic' => "\x{FCA1}", - 'tehjeemisolatedarabic' => "\x{FC0B}", - 'tehmarbutaarabic' => "\x{0629}", - 'tehmarbutafinalarabic' => "\x{FE94}", - 'tehmedialarabic' => "\x{FE98}", - 'tehmeeminitialarabic' => "\x{FCA4}", - 'tehmeemisolatedarabic' => "\x{FC0E}", - 'tehnoonfinalarabic' => "\x{FC73}", - 'tekatakana' => "\x{30C6}", - 'tekatakanahalfwidth' => "\x{FF83}", - 'telephone' => "\x{2121}", - 'telephoneblack' => "\x{260E}", - 'telishagedolahebrew' => "\x{05A0}", - 'telishaqetanahebrew' => "\x{05A9}", - 'tencircle' => "\x{2469}", - 'tenideographicparen' => "\x{3229}", - 'tenparen' => "\x{247D}", - 'tenperiod' => "\x{2491}", - 'tenroman' => "\x{2179}", - 'tesh' => "\x{02A7}", - 'tet' => "\x{05D8}", - 'tetdagesh' => "\x{FB38}", - 'tetdageshhebrew' => "\x{FB38}", - 'tethebrew' => "\x{05D8}", - 'tetsecyrillic' => "\x{04B5}", - 'tevirhebrew' => "\x{059B}", - 'tevirlefthebrew' => "\x{059B}", - 'thabengali' => "\x{09A5}", - 'thadeva' => "\x{0925}", - 'thagujarati' => "\x{0AA5}", - 'thagurmukhi' => "\x{0A25}", - 'thalarabic' => "\x{0630}", - 'thalfinalarabic' => "\x{FEAC}", - 'thanthakhatlowleftthai' => "\x{F898}", - 'thanthakhatlowrightthai' => "\x{F897}", - 'thanthakhatthai' => "\x{0E4C}", - 'thanthakhatupperleftthai' => "\x{F896}", - 'theharabic' => "\x{062B}", - 'thehfinalarabic' => "\x{FE9A}", - 'thehinitialarabic' => "\x{FE9B}", - 'thehmedialarabic' => "\x{FE9C}", - 'thereexists' => "\x{2203}", - 'thetasymbolgreek' => "\x{03D1}", - 'thieuthacirclekorean' => "\x{3279}", - 'thieuthaparenkorean' => "\x{3219}", - 'thieuthcirclekorean' => "\x{326B}", - 'thieuthkorean' => "\x{314C}", - 'thieuthparenkorean' => "\x{320B}", - 'thirteencircle' => "\x{246C}", - 'thirteenparen' => "\x{2480}", - 'thirteenperiod' => "\x{2494}", - 'thonangmonthothai' => "\x{0E11}", - 'thook' => "\x{01AD}", - 'thophuthaothai' => "\x{0E12}", - 'thothahanthai' => "\x{0E17}", - 'thothanthai' => "\x{0E10}", - 'thothongthai' => "\x{0E18}", - 'thothungthai' => "\x{0E16}", - 'thousandcyrillic' => "\x{0482}", - 'thousandsseparatorarabic' => "\x{066C}", - 'thousandsseparatorpersian' => "\x{066C}", - 'threearabic' => "\x{0663}", - 'threebengali' => "\x{09E9}", - 'threecircle' => "\x{2462}", - 'threecircleinversesansserif' => "\x{278C}", - 'threedeva' => "\x{0969}", - 'threegujarati' => "\x{0AE9}", - 'threegurmukhi' => "\x{0A69}", - 'threehackarabic' => "\x{0663}", - 'threehangzhou' => "\x{3023}", - 'threeideographicparen' => "\x{3222}", - 'threeinferior' => "\x{2083}", - 'threemonospace' => "\x{FF13}", - 'threenumeratorbengali' => "\x{09F6}", - 'threeoldstyle' => "\x{F733}", - 'threeparen' => "\x{2476}", - 'threeperiod' => "\x{248A}", - 'threepersian' => "\x{06F3}", - 'threequartersemdash' => "\x{F6DE}", - 'threeroman' => "\x{2172}", - 'threethai' => "\x{0E53}", - 'thzsquare' => "\x{3394}", - 'tihiragana' => "\x{3061}", - 'tikatakana' => "\x{30C1}", - 'tikatakanahalfwidth' => "\x{FF81}", - 'tikeutacirclekorean' => "\x{3270}", - 'tikeutaparenkorean' => "\x{3210}", - 'tikeutcirclekorean' => "\x{3262}", - 'tikeutkorean' => "\x{3137}", - 'tikeutparenkorean' => "\x{3202}", - 'tildebelowcmb' => "\x{0330}", - 'tildecmb' => "\x{0303}", - 'tildedoublecmb' => "\x{0360}", - 'tildeoperator' => "\x{223C}", - 'tildeoverlaycmb' => "\x{0334}", - 'tildeverticalcmb' => "\x{033E}", - 'timescircle' => "\x{2297}", - 'tipehahebrew' => "\x{0596}", - 'tipehalefthebrew' => "\x{0596}", - 'tippigurmukhi' => "\x{0A70}", - 'titlocyrilliccmb' => "\x{0483}", - 'tiwnarmenian' => "\x{057F}", - 'tlinebelow' => "\x{1E6F}", - 'tmonospace' => "\x{FF54}", - 'toarmenian' => "\x{0569}", - 'tohiragana' => "\x{3068}", - 'tokatakana' => "\x{30C8}", - 'tokatakanahalfwidth' => "\x{FF84}", - 'tonebarextrahighmod' => "\x{02E5}", - 'tonebarextralowmod' => "\x{02E9}", - 'tonebarhighmod' => "\x{02E6}", - 'tonebarlowmod' => "\x{02E8}", - 'tonebarmidmod' => "\x{02E7}", - 'tonefive' => "\x{01BD}", - 'tonesix' => "\x{0185}", - 'tonetwo' => "\x{01A8}", - 'tonsquare' => "\x{3327}", - 'topatakthai' => "\x{0E0F}", - 'tortoiseshellbracketleft' => "\x{3014}", - 'tortoiseshellbracketleftsmall' => "\x{FE5D}", - 'tortoiseshellbracketleftvertical' => "\x{FE39}", - 'tortoiseshellbracketright' => "\x{3015}", - 'tortoiseshellbracketrightsmall' => "\x{FE5E}", - 'tortoiseshellbracketrightvertical' => "\x{FE3A}", - 'totaothai' => "\x{0E15}", - 'tpalatalhook' => "\x{01AB}", - 'tparen' => "\x{24AF}", - 'trademarksans' => "\x{F8EA}", - 'trademarkserif' => "\x{F6DB}", - 'tretroflexhook' => "\x{0288}", - 'ts' => "\x{02A6}", - 'tsadi' => "\x{05E6}", - 'tsadidagesh' => "\x{FB46}", - 'tsadidageshhebrew' => "\x{FB46}", - 'tsadihebrew' => "\x{05E6}", - 'tsecyrillic' => "\x{0446}", - 'tsere' => "\x{05B5}", - 'tsere12' => "\x{05B5}", - 'tsere1e' => "\x{05B5}", - 'tsere2b' => "\x{05B5}", - 'tserehebrew' => "\x{05B5}", - 'tserenarrowhebrew' => "\x{05B5}", - 'tserequarterhebrew' => "\x{05B5}", - 'tserewidehebrew' => "\x{05B5}", - 'tshecyrillic' => "\x{045B}", - 'tsuperior' => "\x{F6F3}", - 'ttabengali' => "\x{099F}", - 'ttadeva' => "\x{091F}", - 'ttagujarati' => "\x{0A9F}", - 'ttagurmukhi' => "\x{0A1F}", - 'tteharabic' => "\x{0679}", - 'ttehfinalarabic' => "\x{FB67}", - 'ttehinitialarabic' => "\x{FB68}", - 'ttehmedialarabic' => "\x{FB69}", - 'tthabengali' => "\x{09A0}", - 'tthadeva' => "\x{0920}", - 'tthagujarati' => "\x{0AA0}", - 'tthagurmukhi' => "\x{0A20}", - 'tturned' => "\x{0287}", - 'tuhiragana' => "\x{3064}", - 'tukatakana' => "\x{30C4}", - 'tukatakanahalfwidth' => "\x{FF82}", - 'tusmallhiragana' => "\x{3063}", - 'tusmallkatakana' => "\x{30C3}", - 'tusmallkatakanahalfwidth' => "\x{FF6F}", - 'twelvecircle' => "\x{246B}", - 'twelveparen' => "\x{247F}", - 'twelveperiod' => "\x{2493}", - 'twelveroman' => "\x{217B}", - 'twentycircle' => "\x{2473}", - 'twentyhangzhou' => "\x{5344}", - 'twentyparen' => "\x{2487}", - 'twentyperiod' => "\x{249B}", - 'twoarabic' => "\x{0662}", - 'twobengali' => "\x{09E8}", - 'twocircle' => "\x{2461}", - 'twocircleinversesansserif' => "\x{278B}", - 'twodeva' => "\x{0968}", - 'twodotleader' => "\x{2025}", - 'twodotleadervertical' => "\x{FE30}", - 'twogujarati' => "\x{0AE8}", - 'twogurmukhi' => "\x{0A68}", - 'twohackarabic' => "\x{0662}", - 'twohangzhou' => "\x{3022}", - 'twoideographicparen' => "\x{3221}", - 'twoinferior' => "\x{2082}", - 'twomonospace' => "\x{FF12}", - 'twonumeratorbengali' => "\x{09F5}", - 'twooldstyle' => "\x{F732}", - 'twoparen' => "\x{2475}", - 'twoperiod' => "\x{2489}", - 'twopersian' => "\x{06F2}", - 'tworoman' => "\x{2171}", - 'twostroke' => "\x{01BB}", - 'twothai' => "\x{0E52}", - 'ubar' => "\x{0289}", - 'ubengali' => "\x{0989}", - 'ubopomofo' => "\x{3128}", - 'ucaron' => "\x{01D4}", - 'ucircle' => "\x{24E4}", - 'ucircumflexbelow' => "\x{1E77}", - 'ucyrillic' => "\x{0443}", - 'udattadeva' => "\x{0951}", - 'udblacute' => "\x{0171}", - 'udblgrave' => "\x{0215}", - 'udeva' => "\x{0909}", - 'udieresisacute' => "\x{01D8}", - 'udieresisbelow' => "\x{1E73}", - 'udieresiscaron' => "\x{01DA}", - 'udieresiscyrillic' => "\x{04F1}", - 'udieresisgrave' => "\x{01DC}", - 'udieresismacron' => "\x{01D6}", - 'udotbelow' => "\x{1EE5}", - 'ugujarati' => "\x{0A89}", - 'ugurmukhi' => "\x{0A09}", - 'uhiragana' => "\x{3046}", - 'uhookabove' => "\x{1EE7}", - 'uhornacute' => "\x{1EE9}", - 'uhorndotbelow' => "\x{1EF1}", - 'uhorngrave' => "\x{1EEB}", - 'uhornhookabove' => "\x{1EED}", - 'uhorntilde' => "\x{1EEF}", - 'uhungarumlautcyrillic' => "\x{04F3}", - 'uinvertedbreve' => "\x{0217}", - 'ukatakana' => "\x{30A6}", - 'ukatakanahalfwidth' => "\x{FF73}", - 'ukcyrillic' => "\x{0479}", - 'ukorean' => "\x{315C}", - 'umacroncyrillic' => "\x{04EF}", - 'umacrondieresis' => "\x{1E7B}", - 'umatragurmukhi' => "\x{0A41}", - 'umonospace' => "\x{FF55}", - 'underscoremonospace' => "\x{FF3F}", - 'underscorevertical' => "\x{FE33}", - 'underscorewavy' => "\x{FE4F}", - 'uparen' => "\x{24B0}", - 'upperdothebrew' => "\x{05C4}", - 'upsilonlatin' => "\x{028A}", - 'uptackbelowcmb' => "\x{031D}", - 'uptackmod' => "\x{02D4}", - 'uragurmukhi' => "\x{0A73}", - 'ushortcyrillic' => "\x{045E}", - 'usmallhiragana' => "\x{3045}", - 'usmallkatakana' => "\x{30A5}", - 'usmallkatakanahalfwidth' => "\x{FF69}", - 'ustraightcyrillic' => "\x{04AF}", - 'ustraightstrokecyrillic' => "\x{04B1}", - 'utildeacute' => "\x{1E79}", - 'utildebelow' => "\x{1E75}", - 'uubengali' => "\x{098A}", - 'uudeva' => "\x{090A}", - 'uugujarati' => "\x{0A8A}", - 'uugurmukhi' => "\x{0A0A}", - 'uumatragurmukhi' => "\x{0A42}", - 'uuvowelsignbengali' => "\x{09C2}", - 'uuvowelsigndeva' => "\x{0942}", - 'uuvowelsigngujarati' => "\x{0AC2}", - 'uvowelsignbengali' => "\x{09C1}", - 'uvowelsigndeva' => "\x{0941}", - 'uvowelsigngujarati' => "\x{0AC1}", - 'vadeva' => "\x{0935}", - 'vagujarati' => "\x{0AB5}", - 'vagurmukhi' => "\x{0A35}", - 'vakatakana' => "\x{30F7}", - 'vav' => "\x{05D5}", - 'vavdagesh' => "\x{FB35}", - 'vavdagesh65' => "\x{FB35}", - 'vavdageshhebrew' => "\x{FB35}", - 'vavhebrew' => "\x{05D5}", - 'vavholam' => "\x{FB4B}", - 'vavholamhebrew' => "\x{FB4B}", - 'vavvavhebrew' => "\x{05F0}", - 'vavyodhebrew' => "\x{05F1}", - 'vcircle' => "\x{24E5}", - 'vdotbelow' => "\x{1E7F}", - 'vecyrillic' => "\x{0432}", - 'veharabic' => "\x{06A4}", - 'vehfinalarabic' => "\x{FB6B}", - 'vehinitialarabic' => "\x{FB6C}", - 'vehmedialarabic' => "\x{FB6D}", - 'vekatakana' => "\x{30F9}", - 'venus' => "\x{2640}", - 'verticalbar' => "\x{007C}", - 'verticallineabovecmb' => "\x{030D}", - 'verticallinebelowcmb' => "\x{0329}", - 'verticallinelowmod' => "\x{02CC}", - 'verticallinemod' => "\x{02C8}", - 'vewarmenian' => "\x{057E}", - 'vhook' => "\x{028B}", - 'vikatakana' => "\x{30F8}", - 'viramabengali' => "\x{09CD}", - 'viramadeva' => "\x{094D}", - 'viramagujarati' => "\x{0ACD}", - 'visargabengali' => "\x{0983}", - 'visargadeva' => "\x{0903}", - 'visargagujarati' => "\x{0A83}", - 'vmonospace' => "\x{FF56}", - 'voarmenian' => "\x{0578}", - 'voicediterationhiragana' => "\x{309E}", - 'voicediterationkatakana' => "\x{30FE}", - 'voicedmarkkana' => "\x{309B}", - 'voicedmarkkanahalfwidth' => "\x{FF9E}", - 'vokatakana' => "\x{30FA}", - 'vparen' => "\x{24B1}", - 'vtilde' => "\x{1E7D}", - 'vturned' => "\x{028C}", - 'vuhiragana' => "\x{3094}", - 'vukatakana' => "\x{30F4}", - 'waekorean' => "\x{3159}", - 'wahiragana' => "\x{308F}", - 'wakatakana' => "\x{30EF}", - 'wakatakanahalfwidth' => "\x{FF9C}", - 'wakorean' => "\x{3158}", - 'wasmallhiragana' => "\x{308E}", - 'wasmallkatakana' => "\x{30EE}", - 'wattosquare' => "\x{3357}", - 'wavedash' => "\x{301C}", - 'wavyunderscorevertical' => "\x{FE34}", - 'wawarabic' => "\x{0648}", - 'wawfinalarabic' => "\x{FEEE}", - 'wawhamzaabovearabic' => "\x{0624}", - 'wawhamzaabovefinalarabic' => "\x{FE86}", - 'wbsquare' => "\x{33DD}", - 'wcircle' => "\x{24E6}", - 'wdotaccent' => "\x{1E87}", - 'wdotbelow' => "\x{1E89}", - 'wehiragana' => "\x{3091}", - 'wekatakana' => "\x{30F1}", - 'wekorean' => "\x{315E}", - 'weokorean' => "\x{315D}", - 'whitebullet' => "\x{25E6}", - 'whitecircle' => "\x{25CB}", - 'whitecircleinverse' => "\x{25D9}", - 'whitecornerbracketleft' => "\x{300E}", - 'whitecornerbracketleftvertical' => "\x{FE43}", - 'whitecornerbracketright' => "\x{300F}", - 'whitecornerbracketrightvertical' => "\x{FE44}", - 'whitediamond' => "\x{25C7}", - 'whitediamondcontainingblacksmalldiamond' => "\x{25C8}", - 'whitedownpointingsmalltriangle' => "\x{25BF}", - 'whitedownpointingtriangle' => "\x{25BD}", - 'whiteleftpointingsmalltriangle' => "\x{25C3}", - 'whiteleftpointingtriangle' => "\x{25C1}", - 'whitelenticularbracketleft' => "\x{3016}", - 'whitelenticularbracketright' => "\x{3017}", - 'whiterightpointingsmalltriangle' => "\x{25B9}", - 'whiterightpointingtriangle' => "\x{25B7}", - 'whitesmallsquare' => "\x{25AB}", - 'whitesmilingface' => "\x{263A}", - 'whitesquare' => "\x{25A1}", - 'whitestar' => "\x{2606}", - 'whitetelephone' => "\x{260F}", - 'whitetortoiseshellbracketleft' => "\x{3018}", - 'whitetortoiseshellbracketright' => "\x{3019}", - 'whiteuppointingsmalltriangle' => "\x{25B5}", - 'whiteuppointingtriangle' => "\x{25B3}", - 'wihiragana' => "\x{3090}", - 'wikatakana' => "\x{30F0}", - 'wikorean' => "\x{315F}", - 'wmonospace' => "\x{FF57}", - 'wohiragana' => "\x{3092}", - 'wokatakana' => "\x{30F2}", - 'wokatakanahalfwidth' => "\x{FF66}", - 'won' => "\x{20A9}", - 'wonmonospace' => "\x{FFE6}", - 'wowaenthai' => "\x{0E27}", - 'wparen' => "\x{24B2}", - 'wring' => "\x{1E98}", - 'wsuperior' => "\x{02B7}", - 'wturned' => "\x{028D}", - 'wynn' => "\x{01BF}", - 'xabovecmb' => "\x{033D}", - 'xbopomofo' => "\x{3112}", - 'xcircle' => "\x{24E7}", - 'xdieresis' => "\x{1E8D}", - 'xdotaccent' => "\x{1E8B}", - 'xeharmenian' => "\x{056D}", - 'xmonospace' => "\x{FF58}", - 'xparen' => "\x{24B3}", - 'xsuperior' => "\x{02E3}", - 'yaadosquare' => "\x{334E}", - 'yabengali' => "\x{09AF}", - 'yadeva' => "\x{092F}", - 'yaekorean' => "\x{3152}", - 'yagujarati' => "\x{0AAF}", - 'yagurmukhi' => "\x{0A2F}", - 'yahiragana' => "\x{3084}", - 'yakatakana' => "\x{30E4}", - 'yakatakanahalfwidth' => "\x{FF94}", - 'yakorean' => "\x{3151}", - 'yamakkanthai' => "\x{0E4E}", - 'yasmallhiragana' => "\x{3083}", - 'yasmallkatakana' => "\x{30E3}", - 'yasmallkatakanahalfwidth' => "\x{FF6C}", - 'yatcyrillic' => "\x{0463}", - 'ycircle' => "\x{24E8}", - 'ydotaccent' => "\x{1E8F}", - 'ydotbelow' => "\x{1EF5}", - 'yeharabic' => "\x{064A}", - 'yehbarreearabic' => "\x{06D2}", - 'yehbarreefinalarabic' => "\x{FBAF}", - 'yehfinalarabic' => "\x{FEF2}", - 'yehhamzaabovearabic' => "\x{0626}", - 'yehhamzaabovefinalarabic' => "\x{FE8A}", - 'yehhamzaaboveinitialarabic' => "\x{FE8B}", - 'yehhamzaabovemedialarabic' => "\x{FE8C}", - 'yehinitialarabic' => "\x{FEF3}", - 'yehmedialarabic' => "\x{FEF4}", - 'yehmeeminitialarabic' => "\x{FCDD}", - 'yehmeemisolatedarabic' => "\x{FC58}", - 'yehnoonfinalarabic' => "\x{FC94}", - 'yehthreedotsbelowarabic' => "\x{06D1}", - 'yekorean' => "\x{3156}", - 'yenmonospace' => "\x{FFE5}", - 'yeokorean' => "\x{3155}", - 'yeorinhieuhkorean' => "\x{3186}", - 'yerahbenyomohebrew' => "\x{05AA}", - 'yerahbenyomolefthebrew' => "\x{05AA}", - 'yericyrillic' => "\x{044B}", - 'yerudieresiscyrillic' => "\x{04F9}", - 'yesieungkorean' => "\x{3181}", - 'yesieungpansioskorean' => "\x{3183}", - 'yesieungsioskorean' => "\x{3182}", - 'yetivhebrew' => "\x{059A}", - 'yhook' => "\x{01B4}", - 'yhookabove' => "\x{1EF7}", - 'yiarmenian' => "\x{0575}", - 'yicyrillic' => "\x{0457}", - 'yikorean' => "\x{3162}", - 'yinyang' => "\x{262F}", - 'yiwnarmenian' => "\x{0582}", - 'ymonospace' => "\x{FF59}", - 'yod' => "\x{05D9}", - 'yoddagesh' => "\x{FB39}", - 'yoddageshhebrew' => "\x{FB39}", - 'yodhebrew' => "\x{05D9}", - 'yodyodhebrew' => "\x{05F2}", - 'yodyodpatahhebrew' => "\x{FB1F}", - 'yohiragana' => "\x{3088}", - 'yoikorean' => "\x{3189}", - 'yokatakana' => "\x{30E8}", - 'yokatakanahalfwidth' => "\x{FF96}", - 'yokorean' => "\x{315B}", - 'yosmallhiragana' => "\x{3087}", - 'yosmallkatakana' => "\x{30E7}", - 'yosmallkatakanahalfwidth' => "\x{FF6E}", - 'yotgreek' => "\x{03F3}", - 'yoyaekorean' => "\x{3188}", - 'yoyakorean' => "\x{3187}", - 'yoyakthai' => "\x{0E22}", - 'yoyingthai' => "\x{0E0D}", - 'yparen' => "\x{24B4}", - 'ypogegrammeni' => "\x{037A}", - 'ypogegrammenigreekcmb' => "\x{0345}", - 'yr' => "\x{01A6}", - 'yring' => "\x{1E99}", - 'ysuperior' => "\x{02B8}", - 'ytilde' => "\x{1EF9}", - 'yturned' => "\x{028E}", - 'yuhiragana' => "\x{3086}", - 'yuikorean' => "\x{318C}", - 'yukatakana' => "\x{30E6}", - 'yukatakanahalfwidth' => "\x{FF95}", - 'yukorean' => "\x{3160}", - 'yusbigcyrillic' => "\x{046B}", - 'yusbigiotifiedcyrillic' => "\x{046D}", - 'yuslittlecyrillic' => "\x{0467}", - 'yuslittleiotifiedcyrillic' => "\x{0469}", - 'yusmallhiragana' => "\x{3085}", - 'yusmallkatakana' => "\x{30E5}", - 'yusmallkatakanahalfwidth' => "\x{FF6D}", - 'yuyekorean' => "\x{318B}", - 'yuyeokorean' => "\x{318A}", - 'yyabengali' => "\x{09DF}", - 'yyadeva' => "\x{095F}", - 'zaarmenian' => "\x{0566}", - 'zadeva' => "\x{095B}", - 'zagurmukhi' => "\x{0A5B}", - 'zaharabic' => "\x{0638}", - 'zahfinalarabic' => "\x{FEC6}", - 'zahinitialarabic' => "\x{FEC7}", - 'zahiragana' => "\x{3056}", - 'zahmedialarabic' => "\x{FEC8}", - 'zainarabic' => "\x{0632}", - 'zainfinalarabic' => "\x{FEB0}", - 'zakatakana' => "\x{30B6}", - 'zaqefgadolhebrew' => "\x{0595}", - 'zaqefqatanhebrew' => "\x{0594}", - 'zarqahebrew' => "\x{0598}", - 'zayin' => "\x{05D6}", - 'zayindagesh' => "\x{FB36}", - 'zayindageshhebrew' => "\x{FB36}", - 'zayinhebrew' => "\x{05D6}", - 'zbopomofo' => "\x{3117}", - 'zcircle' => "\x{24E9}", - 'zcircumflex' => "\x{1E91}", - 'zcurl' => "\x{0291}", - 'zdot' => "\x{017C}", - 'zdotbelow' => "\x{1E93}", - 'zecyrillic' => "\x{0437}", - 'zedescendercyrillic' => "\x{0499}", - 'zedieresiscyrillic' => "\x{04DF}", - 'zehiragana' => "\x{305C}", - 'zekatakana' => "\x{30BC}", - 'zeroarabic' => "\x{0660}", - 'zerobengali' => "\x{09E6}", - 'zerodeva' => "\x{0966}", - 'zerogujarati' => "\x{0AE6}", - 'zerogurmukhi' => "\x{0A66}", - 'zerohackarabic' => "\x{0660}", - 'zeroinferior' => "\x{2080}", - 'zeromonospace' => "\x{FF10}", - 'zerooldstyle' => "\x{F730}", - 'zeropersian' => "\x{06F0}", - 'zerosuperior' => "\x{2070}", - 'zerothai' => "\x{0E50}", - 'zerowidthjoiner' => "\x{FEFF}", - 'zerowidthnonjoiner' => "\x{200C}", - 'zerowidthspace' => "\x{200B}", - 'zhbopomofo' => "\x{3113}", - 'zhearmenian' => "\x{056A}", - 'zhebrevecyrillic' => "\x{04C2}", - 'zhecyrillic' => "\x{0436}", - 'zhedescendercyrillic' => "\x{0497}", - 'zhedieresiscyrillic' => "\x{04DD}", - 'zihiragana' => "\x{3058}", - 'zikatakana' => "\x{30B8}", - 'zinorhebrew' => "\x{05AE}", - 'zlinebelow' => "\x{1E95}", - 'zmonospace' => "\x{FF5A}", - 'zohiragana' => "\x{305E}", - 'zokatakana' => "\x{30BE}", - 'zparen' => "\x{24B5}", - 'zretroflexhook' => "\x{0290}", - 'zstroke' => "\x{01B6}", - 'zuhiragana' => "\x{305A}", - 'zukatakana' => "\x{30BA}", - ); - -# Add to this list the glyphs for new fonts (from aglfn13): - -map { $agl{$names{$_}} = pack('U',hex ($_))} (keys %names); - - -# %doubles = (map{$_ => "uni$_"} qw(0394 03A9 0162 2215 00AD 02C9 03BC 2219 00A0 0163)); - -=head2 lookup ( $usv [, $noAlt [, $noUni] ]) - -return the Adobe-recommended glyph name for a specific Unicode codepoint (integer). By default -returns C names rather than C or C names - -If C<$noAlt> is true, C and C names are returned rather than C. - -if C<$noUni> is true, returns undef if it would have to resort to C or C -style names. Essentially this represents a straight lookup in the Adobe-recommended list. - -=cut - -sub lookup -{ - my ($num, $noalt, $noUni) = @_; - my ($val) = sprintf("%04X", $num); - - if (defined $names{$val}) - { - return $names{$val} if ($noalt || $names{$val} !~ m/^(?:afii|SF)/o); - } - return undef if $noUni; - if ($num > 0xFFFF) - { return "u$val"; } - elsif ($num) - { return "uni$val"; } - else - { return ".notdef"; } -} - -=head2 parse ( $glyphname ) - -Parse an Adobe-conformant glyph name, generating a Unicode codepoint sequence equivalent to the glyph (or -glyph components, should the name represent a ligature). In scalar context, returns a reference to an -array of Unicodes (decimal). Array is empty if the glyph name is non-conformant. -In list context, the first item returned is the same array reference as above. The second item -is a reference to an array containing the extensions (if any) present on the glyph name. -The '.' that precedes each extension is not included. - -=cut - -sub parse -{ - my ($gname, @USVs, @extensions); - ($gname, @extensions) = split('\.', $_[0]); - # if name originally started with . (e.g., .null) then $gname will now be '' ... need to fix that up: - $gname = '.' . shift(@extensions) if $gname eq ''; - if (defined $gname) - { - foreach $gname (split('_', $gname)) - { - if ($gname =~ /^u[0-9a-fA-F]{4,6}$/) - { - push @USVs, hex(substr($gname, 1)); - } - elsif ($gname =~ /^uni([0-9a-fA-F]{4,4})+$/) - { - push @USVs, map {hex($_)} ($gname =~ /([0-9a-fA-F]{4,4})/g) - } - elsif (exists $agl{$gname}) - { - push @USVs, unpack ('U*', $agl{$gname}); - } - } - } - return \@USVs unless wantarray; - my @res = (\@USVs, \@extensions); - return @res; -} - -#Code used to parse Adobe's agl file and generate text for %agl initialization: -#while () { -# chomp; -# next if m/^#/; -# my ($gname, @nums) = split(/[; ]/); -# if ($#nums > 0 or !defined ($Font::TTF::PSNames::names{$nums[0]}) or $Font::TTF::PSNames::names{$nums[0]} ne $gname) -# { -# print "\t'$gname' => \""; -# map {print "\\x{$_}" } @nums; -# print "\",\n"; -# } -# } - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - -1; diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Post.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Post.pm deleted file mode 100644 index 4bf284e..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Post.pm +++ /dev/null @@ -1,306 +0,0 @@ -package Font::TTF::Post; - -=head1 NAME - -Font::TTF::Post - Holds the Postscript names for each glyph - -=head1 DESCRIPTION - -Holds the postscript names for glyphs. Note that they are not held as an -array, but as indexes into two lists. The first list is the standard Postscript -name list defined by the TrueType standard. The second comes from the font -directly. - -Looking up a glyph from a Postscript name or a name from a glyph number is -achieved through methods rather than variable lookup. - -This class handles PostScript table types of 1, 2, 2.5 & 3, but not version 4. -Support for version 2.5 is as per Apple spec rather than MS. - -The way to look up Postscript names or glyphs is: - - $pname = $f->{'post'}{'VAL'}[$gnum]; - $gnum = $f->{'post'}{'STRINGS'}{$pname}; - -=head1 INSTANCE VARIABLES - -Due to different systems having different limitations, there are various class -variables available to control what post table types can be written. - -=over 4 - -=item $Font::TTF::Post::no25 - -If set tells Font::TTF::Post::out to use table type 2 instead of 2.5 in case apps -can't handle version 2.5. - -=item VAL - -Contains an array indexed by glyph number of Postscript names. This is used when -writing out a font. - -=item STRINGS - -An associative array of Postscript names mapping to the highest glyph with that -name. These may not be in sync with VAL. - -=back - -In addition there are the standard introductory variables defined in the -standard: - - FormatType - italicAngle - underlinePosition - underlineThickness - isFixedPitch - minMemType42 - maxMemType42 - minMemType1 - maxMemType1 - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA @base_set %base_set %fields $VERSION $no25 @field_info @base_set); -require Font::TTF::Table; -use Font::TTF::Utils; - -$no25 = 1; # officially deprecated format 2.5 tables in MS spec 1.3 - -@ISA = qw(Font::TTF::Table); -@field_info = ( - 'FormatType' => 'f', - 'italicAngle' => 'f', - 'underlinePosition' => 's', - 'underlineThickness' => 's', - 'isFixedPitch' => 'L', - 'minMemType42' => 'L', - 'maxMemType42' => 'L', - 'minMemType1' => 'L', - 'maxMemType1' => 'L'); -@base_set = qw(.notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle - parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six - seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q - R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h - i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla - Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute - egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex - odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet - paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity - plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine - ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal - Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash - quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency - guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand - Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex - apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent - ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth - Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter - threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat); - -$VERSION = 0.01; # MJPH 5-AUG-1998 Re-organise data structures - -sub init -{ - my ($k, $v, $c, $i); - for ($i = 0; $i < $#field_info; $i += 2) - { - ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); - next unless defined $k && $k ne ""; - $fields{$k} = $v; - } - $i = 0; - %base_set = map {$_ => $i++} @base_set; -} - - -=head2 $t->read - -Reads the Postscript table into memory from disk - -=cut - -sub read -{ - my ($self) = @_; - my ($dat, $dat1, $i, $off, $c, $maxoff, $form, $angle, $numGlyphs); - my ($fh) = $self->{' INFILE'}; - - $numGlyphs = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - $self->SUPER::read or return $self; - init unless ($fields{'FormatType'}); - $fh->read($dat, 32); - TTF_Read_Fields($self, $dat, \%fields); - - if (int($self->{'FormatType'} + .5) == 1) - { - for ($i = 0; $i < 258; $i++) - { - $self->{'VAL'}[$i] = $base_set[$i]; - $self->{'STRINGS'}{$base_set[$i]} = $i unless (defined $self->{'STRINGS'}{$base_set[$i]}); - } - } elsif (int($self->{'FormatType'} * 2 + .1) == 5) - { - $fh->read($dat, 2); - $numGlyphs = unpack("n", $dat); - $fh->read($dat, $numGlyphs); - for ($i = 0; $i < $numGlyphs; $i++) - { - $off = unpack("c", substr($dat, $i, 1)); - $self->{'VAL'}[$i] = $base_set[$i + $off]; - $self->{'STRINGS'}{$base_set[$i + $off]} = $i unless (defined $self->{'STRINGS'}{$base_set[$i + $off]}); - } - } elsif (int($self->{'FormatType'} + .5) == 2) - { - my (@strings); - - $fh->read($dat, ($numGlyphs + 1) << 1); - for ($i = 0; $i < $numGlyphs; $i++) - { - $off = unpack("n", substr($dat, ($i + 1) << 1, 2)); - $maxoff = $off if (!defined $maxoff || $off > $maxoff); - } - for ($i = 0; $i < $maxoff - 257; $i++) - { - $fh->read($dat1, 1); - $off = unpack("C", $dat1); - $fh->read($dat1, $off); - $strings[$i] = $dat1; - } - for ($i = 0; $i < $numGlyphs; $i++) - { - $off = unpack("n", substr($dat, ($i + 1) << 1, 2)); - if ($off > 257) - { - $self->{'VAL'}[$i] = $strings[$off - 258]; - $self->{'STRINGS'}{$strings[$off - 258]} = $i; - } - else - { - $self->{'VAL'}[$i] = $base_set[$off]; - $self->{'STRINGS'}{$base_set[$off]} = $i unless (defined $self->{'STRINGS'}{$base_set[$off]}); - } - } - } - $self; -} - - -=head2 $t->out($fh) - -Writes out a new Postscript name table from memory or copies from disk - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($i, $num); - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $num = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - - init unless ($fields{'FormatType'}); - - for ($i = $#{$self->{'VAL'}}; !defined $self->{'VAL'}[$i] && $i > 0; $i--) - { pop(@{$self->{'VAL'}}); } - if ($#{$self->{'VAL'}} < 0) - { $self->{'FormatType'} = 3; } - else - { - $self->{'FormatType'} = 1; - for ($i = 0; $i < $num; $i++) - { - if (!defined $base_set{$self->{'VAL'}[$i]}) - { - $self->{'FormatType'} = 2; - last; - } - elsif ($base_set{$self->{'VAL'}[$i]} != $i) - { $self->{'FormatType'} = ($no25 ? 2 : 2.5); } - } - } - - $fh->print(TTF_Out_Fields($self, \%fields, 32)); - - return $self if (int($self->{'FormatType'} + .4) == 3); - - if (int($self->{'FormatType'} + .5) == 2) - { - my (@ind); - my ($count) = 0; - - $fh->print(pack("n", $num)); - for ($i = 0; $i < $num; $i++) - { - if (defined $base_set{$self->{'VAL'}[$i]}) - { $fh->print(pack("n", $base_set{$self->{'VAL'}[$i]})); } - else - { - $fh->print(pack("n", $count + 258)); - $ind[$count++] = $i; - } - } - for ($i = 0; $i < $count; $i++) - { - $fh->print(pack("C", length($self->{'VAL'}[$ind[$i]]))); - $fh->print($self->{'VAL'}[$ind[$i]]); - } - } elsif (int($self->{'FormatType'} * 2 + .5) == 5) - { - $fh->print(pack("n", $num)); - for ($i = 0; $i < $num; $i++) - { $fh->print(pack("c", defined $base_set{$self->{'VAL'}[$i]} ? - $base_set{$self->{'VAL'}[$i]} - $i : -$i)); } - } - - $self; -} - - -=head2 $t->XML_element($context, $depth, $key, $val) - -Outputs the names as one block of XML - -=cut - -sub XML_element -{ - my ($self) = shift; - my ($context, $depth, $key, $val) = @_; - my ($fh) = $context->{'fh'}; - my ($i); - - return $self->SUPER::XML_element(@_) unless ($key eq 'STRINGS' || $key eq 'VAL'); - return unless ($key eq 'VAL'); - - $fh->print("$depth\n"); - for ($i = 0; $i <= $#{$self->{'VAL'}}; $i++) - { $fh->print("$depth$context->{'indent'}\n"); } - $fh->print("$depth\n"); - $self; -} - -1; - -=head1 BUGS - -=over 4 - -=item * - -No support for type 4 tables - -=back - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Prep.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Prep.pm deleted file mode 100644 index 453cf5a..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Prep.pm +++ /dev/null @@ -1,89 +0,0 @@ -package Font::TTF::Prep; - -=head1 NAME - -Font::TTF::Prep - Preparation hinting program. Called when ppem changes - -=head1 DESCRIPTION - -This is a minimal class adding nothing beyond a table, but is a repository -for prep type information for those processes brave enough to address hinting. - -=cut - -use strict; -use vars qw(@ISA $VERSION); -use Font::TTF::Utils; - -@ISA = qw(Font::TTF::Table); - -$VERSION = 0.0001; - - -=head2 $t->read - -Reads the data using C. - -=cut - -sub read -{ - $_[0]->read_dat; - $_[0]->{' read'} = 1; -} - - -=head2 $t->out_xml($context, $depth) - -Outputs Prep program as XML - -=cut - -sub out_xml -{ - my ($self, $context, $depth) = @_; - my ($fh) = $context->{'fh'}; - my ($dat); - - $self->read; - $dat = Font::TTF::Utils::XML_binhint($self->{' dat'}); - $dat =~ s/\n(?!$)/\n$depth$context->{'indent'}/omg; - $fh->print("$depth\n"); - $fh->print("$depth$context->{'indent'}$dat"); - $fh->print("$depth\n"); - $self; -} - - -=head2 $t->XML_end($context, $tag, %attrs) - -Parse all that hinting code - -=cut - -sub XML_end -{ - my ($self) = shift; - my ($context, $tag, %attrs) = @_; - - if ($tag eq 'code') - { - $self->{' dat'} = Font::TTF::Utils::XML_hintbin($context->{'text'}); - return $context; - } else - { return $self->SUPER::XML_end(@_); } -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Prop.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Prop.pm deleted file mode 100644 index b74c654..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Prop.pm +++ /dev/null @@ -1,154 +0,0 @@ -package Font::TTF::Prop; - -=head1 NAME - -Font::TTF::Prop - Glyph Properties table in a font - -=head1 DESCRIPTION - -=head1 INSTANCE VARIABLES - -=item version - -=item default - -=item lookup - -Hash of property values keyed by glyph number - -=item lookupFormat - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -use Font::TTF::Utils; -use Font::TTF::AATutils; -use Font::TTF::Segarr; - -@ISA = qw(Font::TTF::Table); - -=head2 $t->read - -Reads the table into memory - -=cut - -sub read -{ - my ($self) = @_; - my ($dat, $fh); - my ($version, $lookupPresent, $default); - - $self->SUPER::read or return $self; - - $fh = $self->{' INFILE'}; - $fh->read($dat, 8); - ($version, $lookupPresent, $default) = TTF_Unpack("vSS", $dat); - - if ($lookupPresent) { - my ($format, $lookup) = AAT_read_lookup($fh, 2, $self->{' LENGTH'} - 8, $default); - $self->{'lookup'} = $lookup; - $self->{'format'} = $format; - } - - $self->{'version'} = $version; - $self->{'default'} = $default; - - $self; -} - - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($default, $lookup); - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $default = $self->{'default'}; - $lookup = $self->{'lookup'}; - $fh->print(TTF_Pack("vSS", $self->{'version'}, (defined $lookup ? 1 : 0), $default)); - - AAT_write_lookup($fh, $self->{'format'}, $lookup, 2, $default) if (defined $lookup); -} - -=head2 $t->print($fh) - -Prints a human-readable representation of the table - -=cut - -sub print -{ - my ($self, $fh) = @_; - my ($lookup); - - $self->read; - - $fh = 'STDOUT' unless defined $fh; - - $fh->printf("version %f\ndefault %04x # %s\n", $self->{'version'}, $self->{'default'}, meaning_($self->{'default'})); - $lookup = $self->{'lookup'}; - if (defined $lookup) { - $fh->printf("format %d\n", $self->{'format'}); - foreach (sort { $a <=> $b } keys %$lookup) { - $fh->printf("\t%d -> %04x # %s\n", $_, $lookup->{$_}, meaning_($lookup->{$_})); - } - } -} - -sub meaning_ -{ - my ($val) = @_; - my ($res); - - my @types = ( - "Strong left-to-right", - "Strong right-to-left", - "Arabic letter", - "European number", - "European number separator", - "European number terminator", - "Arabic number", - "Common number separator", - "Block separator", - "Segment separator", - "Whitespace", - "Other neutral"); - $res = $types[$val & 0x001f] or ("Undefined [" . ($val & 0x001f) . "]"); - - $res .= ", floater" if $val & 0x8000; - $res .= ", hang left" if $val & 0x4000; - $res .= ", hang right" if $val & 0x2000; - $res .= ", attaches on right" if $val & 0x0080; - $res .= ", pair" if $val & 0x1000; - my $pairOffset = ($val & 0x0f00) >> 8; - $pairOffset = $pairOffset - 16 if $pairOffset > 7; - $res .= $pairOffset > 0 ? " +" . $pairOffset : $pairOffset < 0 ? " " . $pairOffset : ""; - - $res; -} - -1; - - -=head1 BUGS - -None known - -=head1 AUTHOR - -Jonathan Kew L. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Segarr.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Segarr.pm deleted file mode 100644 index 980188d..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Segarr.pm +++ /dev/null @@ -1,376 +0,0 @@ -package Font::TTF::Segarr; - -=head1 NAME - -Font::TTF::Segarr - Segmented array - -=head1 DESCRIPTION - -Holds data either directly or indirectly as a series of arrays. This class -looks after the set of arrays and masks the individual sub-arrays, thus saving -a class, we hope. - -=head1 INSTANCE VARIABLES - -All instance variables do not start with a space. - -The segmented array is simply an array of segments - -Each segment is a more complex affair: - -=over 4 - -=item START - -In terms of the array, the address for the 0th element in this segment. - -=item LEN - -Number of elements in this segment - -=item VAL - -The array which contains the elements - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@types $VERSION); -$VERSION = 0.0001; - -@types = ('', 'C', 'n', '', 'N'); - -=head2 Font::TTF::Segarr->new($size) - -Creates a new segmented array with a given data size - -=cut - -sub new -{ - my ($class) = @_; - my ($self) = []; - - bless $self, (ref($class) || $class); -} - - -=head2 $s->fastadd_segment($start, $is_sparse, @dat) - -Creates a new segment and adds it to the array assuming no overlap between -the new segment and any others in the array. $is_sparse indicates whether the -passed in array contains Cs or not. If false no checking is done (which -is faster, but riskier). If equal to 2 then 0 is considered undef as well. - -Returns the number of segments inserted. - -=cut - -sub fastadd_segment -{ - my ($self) = shift; - my ($start) = shift; - my ($sparse) = shift; - my ($p, $i, $seg, @seg); - - - if ($sparse) - { - for ($i = 0; $i <= $#_; $i++) - { - if (!defined $seg && (($sparse != 2 && defined $_[$i]) || $_[$i] != 0)) - { $seg->{'START'} = $start + $i; $seg->{'VAL'} = []; } - - if (defined $seg && (($sparse == 2 && $_[$i] == 0) || !defined $_[$i])) - { - $seg->{'LEN'} = $start + $i - $seg->{'START'}; - push(@seg, $seg); - $seg = undef; - } elsif (defined $seg) - { push (@{$seg->{'VAL'}}, $_[$i]); } - } - if (defined $seg) - { - push(@seg, $seg); - $seg->{'LEN'} = $start + $i - $seg->{'START'}; - } - } else - { - $seg->{'START'} = $start; - $seg->{'LEN'} = $#_ + 1; - $seg->{'VAL'} = [@_]; - @seg = ($seg); - } - - for ($i = 0; $i <= $#$self; $i++) - { - if ($self->[$i]{'START'} > $start) - { - splice(@$self, $i, 0, @seg); - return wantarray ? @seg : scalar(@seg); - } - } - push(@$self, @seg); - return wantarray ? @seg : scalar(@seg); -} - - -=head2 $s->add_segment($start, $overwrite, @dat) - -Creates a new segment and adds it to the array allowing for possible overlaps -between the new segment and the existing ones. In the case of overlaps, elements -from the new segment are deleted unless $overwrite is set in which case the -elements already there are over-written. - -This method also checks the data coming in to see if it is sparse (i.e. contains -undef values). Gaps cause new segments to be created or not to over-write existing -values. - -=cut - -sub add_segment -{ - my ($self) = shift; - my ($start) = shift; - my ($over) = shift; - my ($seg, $i, $s, $offset, $j, $newi); - - return $self->fastadd_segment($start, $over, @_) if ($#$self < 0); - $offset = 0; - for ($i = 0; $i <= $#$self && $offset <= $#_; $i++) - { - $s = $self->[$i]; - if ($s->{'START'} <= $start + $offset) # only < for $offset == 0 - { - if ($s->{'START'} + $s->{'LEN'} > $start + $#_) - { - for ($j = $offset; $j <= $#_; $j++) - { - if ($over) - { $s->{'VAL'}[$start - $s->{'START'} + $j] = $_[$j] if defined $_[$j]; } - else - { $s->{'VAL'}[$start - $s->{'START'} + $j] ||= $_[$j] if defined $_[$j]; } - } - $offset = $#_ + 1; - last; - } elsif ($s->{'START'} + $s->{'LEN'} > $start + $offset) # is $offset needed here? - { - for ($j = $offset; $j < $s->{'START'} + $s->{'LEN'} - $start; $j++) - { - if ($over) - { $s->{'VAL'}[$start - $s->{'START'} + $j] = $_[$j] if defined $_[$j]; } - else - { $s->{'VAL'}[$start - $s->{'START'} + $j] ||= $_[$j] if defined $_[$j]; } - } - $offset = $s->{'START'} + $s->{'LEN'} - $start; - } - } else # new seg please - { - if ($s->{'START'} > $start + $#_ + 1) - { - $i += $self->fastadd_segment($start + $offset, 1, @_[$offset .. $#_]) - 1; - $offset = $#_ + 1; - } - else - { - $i += $self->fastadd_segment($start + $offset, 1, @_[$offset .. $s->{'START'} - $start]) - 1; - $offset = $s->{'START'} - $start + 1; - } - } - } - if ($offset <= $#_) - { - $seg->{'START'} = $start + $offset; - $seg->{'LEN'} = $#_ - $offset + 1; - $seg->{'VAL'} = [@_[$offset .. $#_]]; - push (@$self, $seg); - } - $self->tidy; -} - - -=head2 $s->tidy - -Merges any immediately adjacent segments - -=cut - -sub tidy -{ - my ($self) = @_; - my ($i, $sl, $s); - - for ($i = 1; $i <= $#$self; $i++) - { - $sl = $self->[$i - 1]; - $s = $self->[$i]; - if ($s->{'START'} == $sl->{'START'} + $sl->{'LEN'}) - { - $sl->{'LEN'} += $s->{'LEN'}; - push (@{$sl->{'VAL'}}, @{$s->{'VAL'}}); - splice(@$self, $i, 1); - $i--; - } - } - $self; -} - - -=head2 $s->at($addr, [$len]) - -Looks up the data held at the given address by locating the appropriate segment -etc. If $len > 1 then returns an array of values, spaces being filled with undef. - -=cut - -sub at -{ - my ($self, $addr, $len) = @_; - my ($i, $dat, $s, @res, $offset); - - $len = 1 unless defined $len; - $offset = 0; - for ($i = 0; $i <= $#$self; $i++) - { - $s = $self->[$i]; - next if ($s->{'START'} + $s->{'LEN'} < $addr + $offset); # only fires on $offset == 0 - if ($s->{'START'} > $addr + $offset) - { - push (@res, (undef) x ($s->{'START'} > $addr + $len ? - $len - $offset : $s->{'START'} - $addr - $offset)); - $offset = $s->{'START'} - $addr; - } - last if ($s->{'START'} >= $addr + $len); - - if ($s->{'START'} + $s->{'LEN'} >= $addr + $len) - { - push (@res, @{$s->{'VAL'}}[$addr + $offset - $s->{'START'} .. - $addr + $len - $s->{'START'} - 1]); - $offset = $len; - last; - } else - { - push (@res, @{$s->{'VAL'}}[$addr + $offset - $s->{'START'} .. $s->{'LEN'} - 1]); - $offset = $s->{'START'} + $s->{'LEN'} - $addr; - } - } - push (@res, (undef) x ($len - $offset)) if ($offset < $len); - return wantarray ? @res : $res[0]; -} - - -=head2 $s->remove($addr, [$len]) - -Removes the item or items from addr returning them as an array or the first -value in a scalar context. This is very like C, including padding with -undef, but it deletes stuff as it goes. - -=cut - -sub remove -{ - my ($self, $addr, $len) = @_; - my ($i, $dat, $s, @res, $offset); - - $len = 1 unless defined $len; - $offset = 0; - for ($i = 0; $i <= $#$self; $i++) - { - $s = $self->[$i]; - next if ($s->{'START'} + $s->{'LEN'} < $addr + $offset); - if ($s->{'START'} > $addr + $offset) - { - push (@res, (undef) x ($s->{'START'} > $addr + $len ? - $len - $offset : $s->{'START'} - $addr - $offset)); - $offset = $s->{'START'} - $addr; - } - last if ($s->{'START'} >= $addr + $len); - - unless ($s->{'START'} == $addr + $offset) - { - my ($seg) = {}; - - $seg->{'START'} = $s->{'START'}; - $seg->{'LEN'} = $addr + $offset - $s->{'START'}; - $seg->{'VAL'} = [splice(@{$s->{'VAL'}}, 0, $addr + $offset - $s->{'START'})]; - $s->{'LEN'} -= $addr + $offset - $s->{'START'}; - $s->{'START'} = $addr + $offset; - - splice(@$self, $i, 0, $seg); - $i++; - } - - if ($s->{'START'} + $s->{'LEN'} >= $addr + $len) - { - push (@res, splice(@{$s->{'VAL'}}, 0, $len - $offset)); - $s->{'LEN'} -= $len - $offset; - $s->{'START'} += $len - $offset; - $offset = $len; - last; - } else - { - push (@res, @{$s->{'VAL'}}); - $offset = $s->{'START'} + $s->{'LEN'} - $addr; - splice(@$self, $i, 0); - $i--; - } - } - push (@res, (undef) x ($len - $offset)) if ($offset < $len); - return wantarray ? @res : $res[0]; -} - - -=head2 $s->copy - -Deep copies this array - -=cut - -sub copy -{ - my ($self) = @_; - my ($res, $p); - - $res = []; - foreach $p (@$self) - { push (@$res, $self->copy_seg($p)); } - $res; -} - - -=head2 $s->copy_seg($seg) - -Creates a deep copy of a segment - -=cut - -sub copy_seg -{ - my ($self, $seg) = @_; - my ($p, $res); - - $res = {}; - $res->{'VAL'} = [@{$seg->{'VAL'}}]; - foreach $p (keys %$seg) - { $res->{$p} = $seg->{$p} unless defined $res->{$p}; } - $res; -} - - -1; - -=head1 BUGS - -No known bugs. - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Sill.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Sill.pm deleted file mode 100644 index 6a17af1..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Sill.pm +++ /dev/null @@ -1,114 +0,0 @@ -package Font::TTF::Sill; - -=head1 NAME - -Font::TTF::Sill - Graphite language mapping table - -=head1 DESCRIPTION - -=head1 INSTANCE VARIABLES - -=over 4 - -=item version - -Table version number. - -=item langs - -Contains a hash where the key is the language id and the value is an array of -language records - -=back - -=head2 Language Records - -Each language record is itself an array of two values [fid, val]. fid is the -feature id and is held as a long. - -=cut - -use Font::TTF::Utils; -require Font::TTF::Table; - -@ISA = qw(Font::TTF::Table); - -sub read -{ - my ($self) = @_; - my ($num, $i, $j); - - return $self if ($self->{' read'}); - $self->SUPER::read_dat or return $self; - - ($self->{'version'}, $num) = TTF_Unpack("vS", $self->{' dat'}); - - foreach $i (1 .. $num) # ignore bogus entry at end - { - my ($lid, $numf, $offset) = unpack("A4nn", substr($self->{' dat'}, $i * 8 + 4)); # 12 - 8 = 4 since i starts at 1. A4 strips nulls - my (@settings); - - foreach $j (1 .. $numf) - { - my ($fid, $val) = TTF_Unpack("Ls", substr($self->{' dat'}, $offset + $j * 8 - 8)); - push (@settings, [$fid, $val]); - } - $self->{'langs'}{$lid} = [@settings]; - } - delete $self->{' dat'}; - $self->{' read'} = 1; - $self; -} - -sub out -{ - my ($self, $fh) = @_; - my ($num, $range, $select, $shift) = TTF_bininfo(scalar keys %{$self->{'langs'}}, 1); - my ($offset) = $num * 8 + 20; #header = 12, dummy = 8 - my ($k, $s); - - return $self->SUPER::out($fh) unless ($self->{' read'}); - $fh->print(TTF_Pack("vSSSS", $self->{'version'}, $num, $range, $select, $shift)); - foreach $k (sort (keys %{$self->{'langs'}}), '+1') - { - my ($numf) = scalar @{$self->{'langs'}{$k}} unless ($k eq '+1'); - $fh->print(pack("a4nn", $k, $numf, $offset)); - $offset += $numf * 8; - } - - foreach $k (sort keys %{$self->{'langs'}}) - { - foreach $s (@{$self->{'langs'}{$k}}) - { $fh->print(TTF_Pack("LsS", @{$s}, 0)); } - } - $self; -} - -sub XML_element -{ - my ($self) = shift; - my ($context, $depth, $key, $dat) = @_; - my ($fh) = $context->{'fh'}; - my ($k, $s); - - return $self->SUPER::XML_element(@_) unless ($key eq 'langs'); - foreach $k (sort keys %{$self->{'langs'}}) - { - $fh->printf("%s\n", $depth, $k); - foreach $s (@{$self->{'langs'}{$k}}) - { - my ($fid) = $s->[0]; - if ($fid > 0x00FFFFFF) - { $fid = unpack("A4", pack ("N", $fid)); } - else - { $fid = sprintf("%d", $fid); } - $fh->printf("%s%s\n", - $depth, $context->{'indent'}, $fid, $s->[1]); - } - $fh->printf("%s\n", $depth); - } - $self; -} -1; - - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Table.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Table.pm deleted file mode 100644 index bbdb48d..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Table.pm +++ /dev/null @@ -1,382 +0,0 @@ -package Font::TTF::Table; - -=head1 NAME - -Font::TTF::Table - Superclass for tables and used for tables we don't have a class for - -=head1 DESCRIPTION - -Looks after the purely table aspects of a TTF table, such as whether the table -has been read before, locating the file pointer, etc. Also copies tables from -input to output. - -=head1 INSTANCE VARIABLES - -Instance variables start with a space - -=over 4 - -=item read - -Flag which indicates that the table has already been read from file. - -=item dat - -Allows the creation of unspecific tables. Data is simply output to any font -file being created. - -=item INFILE - -The read file handle - -=item OFFSET - -Location of the file in the input file - -=item LENGTH - -Length in the input directory - -=item CSUM - -Checksum read from the input file's directory - -=item PARENT - -The L that table is part of - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw($VERSION); -use Font::TTF::Utils; - -$VERSION = 0.0001; - -=head2 Font::TTF::Table->new(%parms) - -Creates a new table or subclass. Table instance variables are passed in -at this point as an associative array. - -=cut - -sub new -{ - my ($class, %parms) = @_; - my ($self) = {}; - my ($p); - - $class = ref($class) || $class; - foreach $p (keys %parms) - { $self->{" $p"} = $parms{$p}; } - bless $self, $class; -} - - -=head2 $t->read - -Reads the table from the input file. Acts as a superclass to all true tables. -This method marks the table as read and then just sets the input file pointer -but does not read any data. If the table has already been read, then returns -C else returns C<$self> - -=cut - -sub read -{ - my ($self) = @_; - - return $self->read_dat if (ref($self) eq "Font::TTF::Table"); - return undef if $self->{' read'}; - $self->{' INFILE'}->seek($self->{' OFFSET'}, 0); - $self->{' read'} = 1; - $self; -} - - -=head2 $t->read_dat - -Reads the table into the C instance variable for those tables which don't -know any better - -=cut - -sub read_dat -{ - my ($self) = @_; - -# can't just $self->read here otherwise those tables which start their read sub with -# $self->read_dat are going to permanently loop - return undef if ($self->{' read'}); -# $self->{' read'} = 1; # Let read do this, now out will call us for subclasses - $self->{' INFILE'}->seek($self->{' OFFSET'}, 0); - $self->{' INFILE'}->read($self->{' dat'}, $self->{' LENGTH'}); - $self; -} - -=head2 $t->out($fh) - -Writes out the table to the font file. If there is anything in the -C instance variable then this is output, otherwise the data is copied -from the input file to the output - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($dat, $i, $len, $count); - - if (defined $self->{' dat'}) - { - $fh->print($self->{' dat'}); - return $self; - } - - return undef unless defined $self->{' INFILE'}; - $self->{' INFILE'}->seek($self->{' OFFSET'}, 0); - $len = $self->{' LENGTH'}; - while ($len > 0) - { - $count = ($len > 4096) ? 4096 : $len; - $self->{' INFILE'}->read($dat, $count); - $fh->print($dat); - $len -= $count; - } - $self; -} - - -=head2 $t->out_xml($context) - -Outputs this table in XML format. The table is first read (if not already read) and then if -there is no subclass, then the data is dumped as hex data - -=cut - -sub out_xml -{ - my ($self, $context, $depth) = @_; - my ($k); - - if (ref($self) eq __PACKAGE__) - { - $self->read_dat; - Font::TTF::Utils::XML_hexdump($context, $depth, $self->{' dat'}); - } - else - { - $self->read; - foreach $k (sort grep {$_ !~ m/^\s/o} keys %{$self}) - { - $self->XML_element($context, $depth, $k, $self->{$k}); - } - } - $self; -} - - -=head2 $t->XML_element - -Output a particular element based on its contents. - -=cut - -sub XML_element -{ - my ($self, $context, $depth, $k, $dat) = @_; - my ($fh) = $context->{'fh'}; - my ($ndepth, $d); - - return unless defined $dat; - - if (!ref($dat)) - { - $fh->printf("%s<%s>%s\n", $depth, $k, $dat, $k); - return $self; - } - - $fh->printf("%s<%s>\n", $depth, $k); - $ndepth = $depth . $context->{'indent'}; - - if (ref($dat) eq 'SCALAR') - { $self->XML_element($context, $ndepth, 'scalar', $$dat); } - elsif (ref($dat) eq 'ARRAY') - { - foreach $d (@{$dat}) - { $self->XML_element($context, $ndepth, 'elem', $d); } - } - elsif (ref($dat) eq 'HASH') - { - foreach $d (sort grep {$_ !~ m/^\s/o} keys %{$dat}) - { $self->XML_element($context, $ndepth, $d, $dat->{$d}); } - } - else - { - $context->{'name'} = ref($dat); - $context->{'name'} =~ s/^.*://o; - $dat->out_xml($context, $ndepth); - } - - $fh->printf("%s\n", $depth, $k); - $self; -} - - -=head2 $t->XML_end($context, $tag, %attrs) - -Handles the default type of for those tables which aren't subclassed - -=cut - -sub XML_end -{ - my ($self, $context, $tag, %attrs) = @_; - my ($dat, $addr); - - return undef unless ($tag eq 'data'); - $dat = $context->{'text'}; - $dat =~ s/([0-9a-f]{2})\s*/hex($1)/oig; - if (defined $attrs{'addr'}) - { $addr = hex($attrs{'addr'}); } - else - { $addr = length($self->{' dat'}); } - substr($self->{' dat'}, $addr, length($dat)) = $dat; - return $context; -} - - -=head2 $t->dirty($val) - -This sets the dirty flag to the given value or 1 if no given value. It returns the -value of the flag - -=cut - -sub dirty -{ - my ($self, $val) = @_; - my ($res) = $self->{' isDirty'}; - - $self->{' isDirty'} = defined $val ? $val : 1; - $res; -} - -=head2 $t->update - -Each table knows how to update itself. This consists of doing whatever work -is required to ensure that the memory version of the table is consistent -and that other parameters in other tables have been updated accordingly. -I.e. by the end of sending C to all the tables, the memory version -of the font should be entirely consistent. - -Some tables which do no work indicate to themselves the need to update -themselves by setting isDirty above 1. This method resets that accordingly. - -=cut - -sub update -{ - my ($self) = @_; - - if ($self->{' isDirty'}) - { - $self->read; - $self->{' isDirty'} = 0; - return $self; - } - else - { return undef; } -} - - -=head2 $t->empty - -Clears a table of all data to the level of not having been read - -=cut - -sub empty -{ - my ($self) = @_; - my (%keep); - - foreach (qw(INFILE LENGTH OFFSET CSUM PARENT)) - { $keep{" $_"} = 1; } - - map {delete $self->{$_} unless $keep{$_}} keys %$self; - $self; -} - - -=head2 $t->release - -Releases ALL of the memory used by this table, and all of its component/child -objects. This method is called automatically by -'Font::TTF::Font-Erelease' (so you don't have to call it yourself). - -B, that it is important that this method get called at some point prior -to the actual destruction of the object. Internally, we track things in a -structure that can result in circular references, and without calling -'C' these will not properly get cleaned up by Perl. Once this -method has been called, though, don't expect to be able to do anything with the -C object; it'll have B internal state whatsoever. - -B As part of the brute-force cleanup done here, this method -will throw a warning message whenever unexpected key values are found within -the C object. This is done to help ensure that any -unexpected and unfreed values are brought to your attention so that you can bug -us to keep the module updated properly; otherwise the potential for memory -leaks due to dangling circular references will exist. - -=cut - -sub release -{ - my ($self) = @_; - -# delete stuff that we know we can, here - - my @tofree = map { delete $self->{$_} } keys %{$self}; - - while (my $item = shift @tofree) - { - my $ref = ref($item); - if (UNIVERSAL::can($item, 'release')) - { $item->release(); } - elsif ($ref eq 'ARRAY') - { push( @tofree, @{$item} ); } - elsif (UNIVERSAL::isa($ref, 'HASH')) - { release($item); } - } - -# check that everything has gone - it better had! - foreach my $key (keys %{$self}) - { warn ref($self) . " still has '$key' key left after release.\n"; } -} - - -sub __dumpvar__ -{ - my ($self, $key) = @_; - - return ($key eq ' PARENT' ? '...parent...' : $self->{$key}); -} - -1; - -=head1 BUGS - -No known bugs - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Ttc.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Ttc.pm deleted file mode 100644 index b3eeef0..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Ttc.pm +++ /dev/null @@ -1,164 +0,0 @@ -package Font::TTF::Ttc; - -=head1 NAME - -Font::TTF::Ttc - Truetype Collection class - -=head1 DESCRIPTION - -A TrueType collection is a collection of TrueType fonts in one file in which -tables may be shared between different directories. In order to support this, -the TTC introduces the concept of a table being shared by different TrueType -fonts. This begs the question of what should happen to the ' PARENT' property -of a particular table. It is made to point to the first directory object which -refers to it. It is therefore up to the application to sort out any confusion. -Confusion only occurs if shared tables require access to non-shared tables. -This should not happen since the shared tables are dealing with glyph -information only and the private tables are dealing with encoding and glyph -identification. Thus the general direction is from identification to glyph and -not the other way around (at least not without knowledge of the particular -context). - -=head1 INSTANCE VARIABLES - -The following instance variables are preceded by a space - -=over 4 - -=item fname (P) - -Filename for this TrueType Collection - -=item INFILE (P) - -The filehandle of this collection - -=back - -The following instance variable does not start with a space - -=over 4 - -=item directs - -An array of directories (Font::TTF::Font objects) for each sub-font in the directory - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw($VERSION); - -use IO::File; - -$VERSION = 0.0001; - -=head2 Font::TTF::Ttc->open($fname) - -Opens and reads the given filename as a TrueType Collection. Reading a collection -involves reading each of the directories which go to make up the collection. - -=cut - -sub open -{ - my ($class, $fname) = @_; - my ($self) = {}; - my ($fh); - - unless (ref($fname)) - { - $fh = IO::File->new($fname) or return undef; - binmode $fh; - } else - { $fh = $fname; } - - bless $self, $class; - $self->{' INFILE'} = $fh; - $self->{' fname'} = $fname; - $fh->seek(0, 0); - $self->read; -} - - -=head2 $c->read - -Reads a Collection by reading all the directories in the collection - -=cut - -sub read -{ - my ($self) = @_; - my ($fh) = $self->{' INFILE'}; - my ($dat, $ttc, $ver, $num, $i, $loc); - - $fh->read($dat, 12); - ($ttc, $ver, $num) = unpack("A4N2", $dat); - - return undef unless $ttc eq "ttcf"; - $fh->read($dat, $num << 2); - for ($i = 0; $i < $num; $i++) - { - $loc = unpack("N", substr($dat, $i << 2, 4)); - $self->{'directs'}[$i] = Font::TTF::Font->new('INFILE' => $fh, - 'PARENT' => $self, - 'OFFSET' => $loc) || return undef; - } - for ($i = 0; $i < $num; $i++) - { $self->{'directs'}[$i]->read; } - $self; -} - - -=head2 $c->find($direct, $name, $check, $off, $len) - -Hunts around to see if a table with the given characteristics of name, checksum, -offset and length has been associated with a directory earlier in the list. -Actually on checks the offset since no two tables can share the same offset in -a TrueType font, collection or otherwise. - -=cut - -sub find -{ - my ($self, $direct, $name, $check, $off, $len) = @_; - my ($d); - - foreach $d (@{$self->{'directs'}}) - { - return undef if $d eq $direct; - next unless defined $d->{$name}; - return $d->{$name} if ($d->{$name}{' OFFSET'} == $off); - } - undef; # wierd that the font passed is not in the list! -} - - -=head2 $c->DESTROY - -Closees any opened files by us - -=cut - -sub DESTROY -{ - my ($self) = @_; - close ($self->{' INFILE'}); - undef; -} - -=head1 BUGS - -No known bugs, but then not ever executed! - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Ttopen.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Ttopen.pm deleted file mode 100644 index 610a66e..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Ttopen.pm +++ /dev/null @@ -1,1223 +0,0 @@ -package Font::TTF::Ttopen; - -=head1 NAME - -Font::TTF::Ttopen - Opentype superclass for standard Opentype lookup based tables -(GSUB and GPOS) - -=head1 DESCRIPTION - -Handles all the script, lang, feature, lookup stuff for a -L/L table leaving the class specifics to the -subclass - -=head1 INSTANCE VARIABLES - -The instance variables of an opentype table form a complex sub-module hierarchy. - -=over 4 - -=item Version - -This contains the version of the table as a floating point number - -=item SCRIPTS - -The scripts list is a hash of script tags. Each script tag (of the form -$t->{'SCRIPTS'}{$tag}) has information below it. - -=over 8 - -=item OFFSET - -This variable is preceeded by a space and gives the offset from the start of the -table (not the table section) to the script table for this script - -=item REFTAG - -This variable is preceded by a space and gives a corresponding script tag to this -one such that the offsets in the file are the same. When writing, it is up to the -caller to ensure that the REFTAGs are set correctly, since these will be used to -assume that the scripts are identical. Note that REFTAG must refer to a script which -has no REFTAG of its own. - -=item DEFAULT - -This corresponds to the default language for this script, if there is one, and -contains the same information as an itemised language - -=item LANG_TAGS - -This contains an array of language tag strings (each 4 bytes) corresponding to -the languages listed by this script - -=item $lang - -Each language is a hash containing its information: - -=over 12 - -=item OFFSET - -This variable is preceeded by a a space and gives the offset from the start of -the whole table to the language table for this language - -=item REFTAG - -This variable is preceded by a space and has the same function as for the script -REFTAG, only for the languages within a script. - -=item RE-ORDER - -This indicates re-ordering information, and has not been set. The value should -always be 0. - -=item DEFAULT - -This holds the index of the default feature, if there is one, or -1 otherwise. - -=item FEATURES - -This is an array of feature tags for all the features enabled for this language - -=back - -=back - -=item FEATURES - -The features section of instance variables corresponds to the feature table in -the opentype table. - -=over 8 - -=item FEAT_TAGS - -This array gives the ordered list of feature tags for this table. It is used during -reading and writing for converting between feature index and feature tag. - -=back - -The rest of the FEATURES variable is itself a hash based on the feature tag for -each feature. Each feature has the following structure: - -=over 8 - -=item OFFSET - -This attribute is preceeded by a space and gives the offset relative to the start of the whole -table of this particular feature. - -=item PARMS - -This is an unused offset to the parameters for each feature - -=item LOOKUPS - -This is an array containing indices to lookups in the LOOKUP instance variable of the table - -=item INDEX - -This gives the feature index for this feature and is used during reading and writing for -converting between feature tag and feature index. - -=back - -=item LOOKUP - -This variable is an array of lookups in order and is indexed via the features of a language of a -script. Each lookup contains subtables and other information: - -=over 8 - -=item OFFSET - -This name is preceeded by a space and contains the offset from the start of the table to this -particular lookup - -=item TYPE - -This is a subclass specific type for a lookup. It stipulates the type of lookup and hence subtables -within the lookup - -=item FLAG - -Holds the lookup flag bits - -=item SUB - -This holds an array of subtables which are subclass specific. Each subtable must have -an OFFSET. The other variables described here are an abstraction used in both the -GSUB and GPOS tables which are the target subclasses of this class. - -=over 12 - -=item OFFSET - -This is preceeded by a space and gives the offset relative to the start of the table for this -subtable - -=item FORMAT - -Gives the sub-table sub format for this GSUB subtable. It is assumed that this -value is correct when it comes time to write the subtable. - -=item COVERAGE - -Most lookups consist of a coverage table corresponding to the first -glyph to match. The offset of this coverage table is stored here and the coverage -table looked up against the GSUB table proper. There are two lookups -without this initial coverage table which is used to index into the RULES array. -These lookups have one element in the RULES array which is used for the whole -match. - -=item RULES - -The rules are a complex array. Each element of the array corresponds to an -element in the coverage table (governed by the coverage index). If there is -no coverage table, then there is considered to be only one element in the rules -array. Each element of the array is itself an array corresponding to the -possibly multiple string matches which may follow the initial glyph. Each -element of this array is a hash with fixed keys corresponding to information -needed to match a glyph string or act upon it. Thus the RULES element is an -array of arrays of hashes which contain the following keys: - -=over 16 - -=item MATCH - -This contains a sequence of elements held as an array. The elements may be -glyph ids (gid), class ids (cids), or offsets to coverage tables. Each element -corresponds to one glyph in the glyph string. See MATCH_TYPE for details of -how the different element types are marked. - -=item PRE - -This array holds the sequence of elements preceeding the first match element -and has the same form as the MATCH array. - -=item POST - -This array holds the sequence of elements to be tested for following the match -string and is of the same form as the MATCH array. - -=item ACTION - -This array holds information regarding what should be done if a match is found. -The array may either hold glyph ids (which are used to replace or insert or -whatever glyphs in the glyph string) or 2 element arrays consisting of: - -=over 20 - -=item OFFSET - -Offset from the start of the matched string that the lookup should start at -when processing the substring. - -=item LOOKUP_INDEX - -The index to a lookup to be acted upon on the match string. - -=back - -=back - -=back - -=back - -=item CLASS - -For those lookups which use class categories rather than glyph ids for matching -this is the offset to the class definition used to categories glyphs in the -match string. - -=item PRE_CLASS - -This is the offset to the class definition for the before match glyphs - -=item POST_CLASS - -This is the offset to the class definition for the after match glyphs. - -=item ACTION_TYPE - -This string holds the type of information held in the ACTION variable of a RULE. -It is subclass specific. - -=item MATCH_TYPE - -This holds the type of information in the MATCH array of a RULE. This is subclass -specific. - -=item ADJUST - -This corresponds to a single action for all items in a coverage table. The meaning -is subclass specific. - -=item CACHE - -This key starts with a space - -A hash of other tables (such as coverage tables, classes, anchors, device tables) -based on the offset given in the subtable to that other information. -Note that the documentation is particularly -unhelpful here in that such tables are given as offsets relative to the -beginning of the subtable not the whole GSUB table. This includes those items which -are stored relative to another base within the subtable. - -=back - - -=head1 METHODS - -=cut - -use Font::TTF::Table; -use Font::TTF::Utils; -use Font::TTF::Coverage; -use strict; -use vars qw(@ISA); - -@ISA = qw(Font::TTF::Table); - -=head2 $t->read - -Reads the table passing control to the subclass to handle the subtable specifics - -=cut - -sub read -{ - my ($self) = @_; - my ($dat, $i, $l, $oScript, $oFeat, $oLook, $tag, $nScript, $off, $dLang, $nLang, $lTag); - my ($nFeat, $nLook, $nSub, $j, $temp); - my ($fh) = $self->{' INFILE'}; - my ($moff) = $self->{' OFFSET'}; - - $self->SUPER::read or return $self; - $fh->read($dat, 10); - ($self->{'Version'}, $oScript, $oFeat, $oLook) = TTF_Unpack("vSSS", $dat); - -# read features first so that in the script/lang hierarchy we can use feature tags - - $fh->seek($moff + $oFeat, 0); - $fh->read($dat, 2); - $nFeat = unpack("n", $dat); - $self->{'FEATURES'} = {}; - $l = $self->{'FEATURES'}; - $fh->read($dat, 6 * $nFeat); - for ($i = 0; $i < $nFeat; $i++) - { - ($tag, $off) = unpack("a4n", substr($dat, $i * 6, 6)); - while (defined $l->{$tag}) - { - if ($tag =~ m/(.*?)\s_(\d+)$/o) - { $tag = $1 . " _" . ($2 + 1); } - else - { $tag .= " _0"; } - } - $l->{$tag}{' OFFSET'} = $off + $oFeat; - $l->{$tag}{'INDEX'} = $i; - push (@{$l->{'FEAT_TAGS'}}, $tag); - } - - foreach $tag (grep {m/^.{4}(?:\s_\d+)?$/o} keys %$l) - { - $fh->seek($moff + $l->{$tag}{' OFFSET'}, 0); - $fh->read($dat, 4); - ($l->{$tag}{'PARMS'}, $nLook) = unpack("n2", $dat); - $fh->read($dat, $nLook * 2); - $l->{$tag}{'LOOKUPS'} = [unpack("n*", $dat)]; - } - -# Now the script/lang hierarchy - - $fh->seek($moff + $oScript, 0); - $fh->read($dat, 2); - $nScript = unpack("n", $dat); - $self->{'SCRIPTS'} = {}; - $l = $self->{'SCRIPTS'}; - $fh->read($dat, 6 * $nScript); - for ($i = 0; $i < $nScript; $i++) - { - ($tag, $off) = unpack("a4n", substr($dat, $i * 6, 6)); - $off += $oScript; - foreach (keys %$l) - { $l->{$tag}{' REFTAG'} = $_ if ($l->{$_}{' OFFSET'} == $off - && !defined $l->{$_}{' REFTAG'}); } - $l->{$tag}{' OFFSET'} = $off; - } - - foreach $tag (keys %$l) - { - next if ($l->{$tag}{' REFTAG'}); - $fh->seek($moff + $l->{$tag}{' OFFSET'}, 0); - $fh->read($dat, 4); - ($dLang, $nLang) = unpack("n2", $dat); - $l->{$tag}{'DEFAULT'}{' OFFSET'} = - $dLang + $l->{$tag}{' OFFSET'} if $dLang; - $fh->read($dat, 6 * $nLang); - for ($i = 0; $i < $nLang; $i++) - { - ($lTag, $off) = unpack("a4n", substr($dat, $i * 6, 6)); - $off += $l->{$tag}{' OFFSET'}; - $l->{$tag}{$lTag}{' OFFSET'} = $off; - foreach (@{$l->{$tag}{'LANG_TAGS'}}, 'DEFAULT') - { $l->{$tag}{$lTag}{' REFTAG'} = $_ if ($l->{$tag}{$_}{' OFFSET'} == $off - && !$l->{$tag}{$_}{' REFTAG'}); } - push (@{$l->{$tag}{'LANG_TAGS'}}, $lTag); - } - foreach $lTag (@{$l->{$tag}{'LANG_TAGS'}}, 'DEFAULT') - { - next unless defined $l->{$tag}{$lTag}; - next if ($l->{$tag}{$lTag}{' REFTAG'}); - $fh->seek($moff + $l->{$tag}{$lTag}{' OFFSET'}, 0); - $fh->read($dat, 6); - ($l->{$tag}{$lTag}{'RE-ORDER'}, $l->{$tag}{$lTag}{'DEFAULT'}, $nFeat) - = unpack("n3", $dat); - $fh->read($dat, $nFeat * 2); - $l->{$tag}{$lTag}{'FEATURES'} = [map {$self->{'FEATURES'}{'FEAT_TAGS'}[$_]} unpack("n*", $dat)]; - } - foreach $lTag (@{$l->{$tag}{'LANG_TAGS'}}, 'DEFAULT') - { - next unless $l->{$tag}{$lTag}{' REFTAG'}; - $temp = $l->{$tag}{$lTag}{' REFTAG'}; - $l->{$tag}{$lTag} = ©($l->{$tag}{$temp}); - $l->{$tag}{$lTag}{' REFTAG'} = $temp; - } - } - foreach $tag (keys %$l) - { - next unless $l->{$tag}{' REFTAG'}; - $temp = $l->{$tag}{' REFTAG'}; - $l->{$tag} = ©($l->{$temp}); - $l->{$tag}{' REFTAG'} = $temp; - } - -# And finally the lookups - - $fh->seek($moff + $oLook, 0); - $fh->read($dat, 2); - $nLook = unpack("n", $dat); - $fh->read($dat, $nLook * 2); - $i = 0; - map { $self->{'LOOKUP'}[$i++]{' OFFSET'} = $_; } unpack("n*", $dat); - - for ($i = 0; $i < $nLook; $i++) - { - $l = $self->{'LOOKUP'}[$i]; - $fh->seek($l->{' OFFSET'} + $moff + $oLook, 0); - $fh->read($dat, 6); - ($l->{'TYPE'}, $l->{'FLAG'}, $nSub) = unpack("n3", $dat); - $fh->read($dat, $nSub * 2); - $j = 0; - my @offsets = unpack("n*", $dat); - my $isExtension = ($l->{'TYPE'} == $self->extension()); - for ($j = 0; $j < $nSub; $j++) - { - $l->{'SUB'}[$j]{' OFFSET'} = $offsets[$j]; - $fh->seek($moff + $oLook + $l->{' OFFSET'} + $l->{'SUB'}[$j]{' OFFSET'}, 0); - if ($isExtension) - { - $fh->read($dat, 8); - my $longOff; - (undef, $l->{'TYPE'}, $longOff) = unpack("nnN", $dat); - $l->{'SUB'}[$j]{' OFFSET'} += $longOff; - $fh->seek($moff + $oLook + $l->{' OFFSET'} + $l->{'SUB'}[$j]{' OFFSET'}, 0); - } - $self->read_sub($fh, $l, $j); - } - } - return $self; -} - -=head2 $t->read_sub($fh, $lookup, $index) - -This stub is to allow subclasses to read subtables of lookups in a table specific manner. A -reference to the lookup is passed in along with the subtable index. The file is located at the -start of the subtable to be read - -=cut - -sub read_sub -{ } - - -=head2 $t->extension() - -Returns the lookup number for the extension table that allows access to 32-bit offsets. - -=cut - -sub extension -{ } - - -=head2 $t->out($fh) - -Writes this Opentype table to the output calling $t->out_sub for each sub table -at the appropriate point in the output. The assumption is that on entry the -number of scripts, languages, features, lookups, etc. are all resolved and -the relationships fixed. This includes a script's LANG_TAGS list and that all -scripts and languages in their respective dictionaries either have a REFTAG or contain -real data. - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($i, $j, $base, $off, $tag, $t, $l, $lTag, $oScript, @script, @tags); - my ($end, $nTags, @offs, $oFeat, $oLook, $nSub, $nSubs, $big, $out); - - return $self->SUPER::out($fh) unless $self->{' read'}; - -# First sort the features - $i = 0; - $self->{'FEATURES'}{'FEAT_TAGS'} = [sort grep {m/^.{4}(?:\s_\d+)?$/o} %{$self->{'FEATURES'}}] - if (!defined $self->{'FEATURES'}{'FEAT_TAGS'}); - foreach $t (@{$self->{'FEATURES'}{'FEAT_TAGS'}}) - { $self->{'FEATURES'}{$t}{'INDEX'} = $i++; } - - $base = $fh->tell(); - $fh->print(TTF_Pack("v", $self->{'Version'})); - $fh->print(pack("n3", 10, 0, 0)); - $oScript = $fh->tell() - $base; - @script = sort grep {length($_) == 4} keys %{$self->{'SCRIPTS'}}; - $fh->print(pack("n", $#script + 1)); - foreach $t (@script) - { $fh->print(pack("a4n", $t, 0)); } - - $end = $fh->tell(); - foreach $t (@script) - { - $fh->seek($end, 0); - $tag = $self->{'SCRIPTS'}{$t}; - next if ($tag->{' REFTAG'}); - $tag->{' OFFSET'} = tell($fh) - $base - $oScript; - $fh->print(pack("n2", 0, $#{$tag->{'LANG_TAGS'}} + 1)); - foreach $lTag (sort @{$tag->{'LANG_TAGS'}}) - { $fh->print(pack("a4n", $lTag, 0)); } - foreach $lTag (@{$tag->{'LANG_TAGS'}}, 'DEFAULT') - { - my ($def); - $l = $tag->{$lTag}; - next if (!defined $l || (defined $l->{' REFTAG'} && $l->{' REFTAG'} ne '')); - $l->{' OFFSET'} = $fh->tell() - $base - $oScript - $tag->{' OFFSET'}; - if (defined $l->{'DEFAULT'}) -# { $def = $self->{'FEATURES'}{$l->{'FEATURES'}[$l->{'DEFAULT'}]}{'INDEX'}; } - { $def = $l->{'DEFAULT'}; } - else - { $def = -1; } - $fh->print(pack("n*", $l->{'RE_ORDER'} || 0, $def, $#{$l->{'FEATURES'}} + 1, - map {$self->{'FEATURES'}{$_}{'INDEX'} || 0} @{$l->{'FEATURES'}})); - } - $end = $fh->tell(); - if ($tag->{'DEFAULT'}{' REFTAG'} || defined $tag->{'DEFAULT'}{'FEATURES'}) - { - $fh->seek($base + $oScript + $tag->{' OFFSET'}, 0); - if (defined $tag->{'DEFAULT'}{' REFTAG'}) - { - my ($ttag); - for ($ttag = $tag->{'DEFAULT'}{' REFTAG'}; defined $tag->{$ttag}{' REFTAG'}; $ttag = $tag->{$ttag}{' REFTAG'}) - { } - $off = $tag->{$ttag}{' OFFSET'}; - } - else - { $off = $tag->{'DEFAULT'}{' OFFSET'}; } - $fh->print(pack("n", $off)); - } - $fh->seek($base + $oScript + $tag->{' OFFSET'} + 4, 0); - foreach (sort @{$tag->{'LANG_TAGS'}}) - { - if (defined $tag->{$_}{' REFTAG'}) - { - my ($ttag); - for ($ttag = $tag->{$_}{' REFTAG'}; defined $tag->{$ttag}{' REFTAG'}; $ttag = $tag->{$ttag}{' REFTAG'}) - { } - $off = $tag->{$ttag}{' OFFSET'}; - } - else - { $off = $tag->{$_}{' OFFSET'}; } - $fh->print(pack("a4n", $_, $off)); - } - } - $fh->seek($base + $oScript + 2, 0); - foreach $t (@script) - { - $tag = $self->{'SCRIPTS'}{$t}; - $off = $tag->{' REFTAG'} ? $tag->{$tag->{' REFTAG'}}{' OFFSET'} : $tag->{' OFFSET'}; - $fh->print(pack("a4n", $t, $off)); - } - - $fh->seek($end, 0); - $oFeat = $end - $base; - $nTags = $#{$self->{'FEATURES'}{'FEAT_TAGS'}} + 1; - $fh->print(pack("n", $nTags)); - $fh->print(pack("a4n", " ", 0) x $nTags); - - foreach $t (@{$self->{'FEATURES'}{'FEAT_TAGS'}}) - { - $tag = $self->{'FEATURES'}{$t}; - $tag->{' OFFSET'} = tell($fh) - $base - $oFeat; - $fh->print(pack("n*", 0, $#{$tag->{'LOOKUPS'}} + 1, @{$tag->{'LOOKUPS'}})); - } - $end = $fh->tell(); - $fh->seek($oFeat + $base + 2, 0); - foreach $t (@{$self->{'FEATURES'}{'FEAT_TAGS'}}) - { $fh->print(pack("a4n", $t, $self->{'FEATURES'}{$t}{' OFFSET'})); } - - undef $big; - $fh->seek($end, 0); - $oLook = $end - $base; - - # Start Lookup List Table - $nTags = $#{$self->{'LOOKUP'}} + 1; - $fh->print(pack("n", $nTags)); - $fh->print(pack("n", 0) x $nTags); - $end = $fh->tell(); # end of LookupListTable = start of Lookups - foreach $tag (@{$self->{'LOOKUP'}}) - { $nSubs += $self->num_sub($tag); } - for ($i = 0; $i < $nTags; $i++) - { - $fh->seek($end, 0); - $tag = $self->{'LOOKUP'}[$i]; - $off = $end - $base - $oLook; # BH 2004-03-04 - # Is there room, from the start of this i'th lookup, for this and the remaining - # lookups to be wrapped in extension lookups? - if (!defined $big && $off + ($nTags - $i) * 6 + $nSubs * 10 > 65535) # BH 2004-03-04 - { - # Not enough room -- need to start an extension! - my ($k, $ext); - $ext = $self->extension(); - # Must turn previous lookup into the first extension - $i--; - $tag = $self->{'LOOKUP'}[$i]; - $end = $tag->{' OFFSET'} + $base + $oLook; - $fh->seek($end, 0); - $big = $i; - # For this and the remaining lookups, build extensions lookups - for ($j = $i; $j < $nTags; $j++) - { - $tag = $self->{'LOOKUP'}[$j]; - $nSub = $self->num_sub($tag); - $fh->print(pack("nnn", $ext, $tag->{'FLAG'}, $nSub)); - $fh->print(pack("n*", map {$_ * 8 + 6 + $nSub * 2} (0 .. $nSub-1))); # BH 2004-03-04 - $tag->{' EXT_OFFSET'} = $fh->tell(); # = first extension lookup subtable - $tag->{' OFFSET'} = $tag->{' EXT_OFFSET'} - $nSub * 2 - 6 - $base - $oLook; # offset to this extension lookup - for ($k = 0; $k < $nSub; $k++) - { $fh->print(pack('nnN', 1, $tag->{'TYPE'}, 0)); } - } - - $tag = $self->{'LOOKUP'}[$i]; - # Leave file positioned after all the extension lookups -- where the referenced lookups will start. - } - $tag->{' OFFSET'} = $off unless defined $big; # BH 2004-03-04 - $nSub = $self->num_sub($tag); - if (!defined $big) - { - $fh->print(pack("nnn", $tag->{'TYPE'}, $tag->{'FLAG'}, $nSub)); - $fh->print(pack("n", 0) x $nSub); - } - else - { $end = $tag->{' EXT_OFFSET'}; } - my (@offs, $out, @refs); - for ($j = 0; $j < $nSub; $j++) - { - my ($ctables) = {}; - my ($base) = length($out); - push(@offs, tell($fh) - $end + $base); - $out .= $self->out_sub($fh, $tag, $j, $ctables, $base); - push (@refs, [$ctables, $base]); - } - out_final($fh, $out, \@refs); - $end = $fh->tell(); - if (!defined $big) - { - $fh->seek($tag->{' OFFSET'} + $base + $oLook + 6, 0); - $fh->print(pack("n*", @offs)); - } - else - { - $fh->seek($tag->{' EXT_OFFSET'}, 0); - for ($j = 0; $j < $nSub; $j++) - { $fh->print(pack('nnN', 1, $tag->{'TYPE'}, $offs[$j] - $j * 8)); } - } - } - $fh->seek($oLook + $base + 2, 0); - $fh->print(pack("n*", map {$self->{'LOOKUP'}[$_]{' OFFSET'}} (0 .. $nTags - 1))); - $fh->seek($base + 6, 0); - $fh->print(pack('n2', $oFeat, $oLook)); - $fh->seek($end, 0); - $self; -} - - -=head2 $t->num_sub($lookup) - -Asks the subclass to count the number of subtables for a particular lookup and to -return that value. Used in out(). - -=cut - -sub num_sub -{ - my ($self, $lookup) = @_; - - return $#{$lookup->{'SUB'}} + 1; -} - - -=head2 $t->out_sub($fh, $lookup, $index) - -This stub is to allow subclasses to output subtables of lookups in a table specific manner. A -reference to the lookup is passed in along with the subtable index. The file is located at the -start of the subtable to be output - -=cut - -sub out_sub -{ } - -=head2 $t->dirty - -Setting GPOS or GSUB dirty means that OS/2 may need updating, so set it dirty. - -=cut - -sub dirty -{ - my ($self, $val) = @_; - my $res = $self->SUPER::dirty ($val); - $self->{' PARENT'}{'OS/2'}->read->dirty($val) if exists $self->{' PARENT'}{'OS/2'}; - $res; -} - -=head2 $t->maxContext - -Returns the length of the longest opentype rule in this table. - -=cut - -sub maxContext -{ - my ($self) = @_; - - # Make sure table is read - $self->read; - - # Calculate my contribution to OS/2 usMaxContext - - my ($maxcontext, $l, $s, $r, $m); - - for $l (@{$self->{'LOOKUP'}}) # Examine each lookup - { - for $s (@{$l->{'SUB'}}) # Multiple possible subtables for this lookup - { - for $r (@{$s->{'RULES'}}) # One ruleset for each covered glyph - { - for $m (@{$r}) # Multiple possible matches for this covered glyph - { - my $lgt; - $lgt++ if exists $s->{'COVERAGE'}; # Count 1 for the coverage table if it exists - for (qw(MATCH PRE POST)) - { - $lgt += @{$m->{$_}} if exists $m->{$_}; - } - $maxcontext = $lgt if $lgt > $maxcontext; - } - } - - } - } - - $maxcontext; -} - - -=head2 $t->update - -Unless $t->{' PARENT'}{' noharmony'} is true, update will make sure that GPOS and GSUB include -the same scripts and languages. Any added scripts and languages will have empty feature sets. - -=cut - -# Assumes we are called on both GSUB and GPOS. So simply ADDS scripts and languages to $self that it finds -# in the other table. - -sub update -{ - my ($self) = @_; - - return undef unless ($self->SUPER::update); - - # Enforce script/lang congruence unless asked not to: - return $self if $self->{' PARENT'}{' noharmony'}; - - # Find my sibling (GSUB or GPOS, depending on which I am) - my $sibling = ref($self) eq 'Font::TTF::GSUB' ? 'GPOS' : ref($self) eq 'Font::TTF::GPOS' ? 'GSUB' : undef; - return $self unless $sibling && exists $self->{' PARENT'}{$sibling}; - $sibling = $self->{' PARENT'}{$sibling}; - next unless defined $sibling; - - # Look through scripts defined in sibling: - for my $sTag (grep {length($_) == 4} keys %{$sibling->{'SCRIPTS'}}) - { - my $sibScript = $sibling->{'SCRIPTS'}{$sTag}; - $sibScript = $sibling->{$sibScript->{' REFTAG'}} if exists $sibScript->{' REFTAG'} && $sibScript->{' REFTAG'} ne ''; - - $self->{'SCRIPTS'}{$sTag} = {} unless defined $self->{'SCRIPTS'}{$sTag}; # Create script if not present in $self - - my $myScript = $self->{'SCRIPTS'}{$sTag}; - $myScript = $self->{$myScript->{' REFTAG'}} if exists $myScript->{' REFTAG'} && $myScript->{' REFTAG'} ne ''; - - foreach my $lTag (@{$sibScript->{'LANG_TAGS'}}) - { - # Ok, found a script/lang that is in our sibling. - next if exists $myScript->{$lTag}; # Already in $self - - # Need to create this lang: - push @{$myScript->{'LANG_TAGS'}}, $lTag; - $myScript->{$lTag} = { 'FEATURES' => [] }; - } - unless (defined $myScript->{'DEFAULT'}) - { - # Create default lang for this script. Link to 'dflt' if it exists - $myScript->{'DEFAULT'} = exists $myScript->{'dflt'} ? {' REFTAG' => 'dflt'} : { 'FEATURES' => [] }; - } - } - $self; -} - -=head1 Internal Functions & Methods - -Most of these methods are used by subclasses for handling such things as coverage -tables. - -=head2 copy($ref) - -Internal function to copy the top level of a dictionary to create a new dictionary. -Only the top level is copied. - -=cut - -sub copy -{ - my ($ref) = @_; - my ($res) = {}; - - foreach (keys %$ref) - { $res->{$_} = $ref->{$_}; } - $res; -} - - -=head2 $t->read_cover($cover_offset, $lookup_loc, $lookup, $fh, $is_cover) - -Reads a coverage table and stores the results in $lookup->{' CACHE'}, that is, if -it hasn't been read already. - -=cut - -sub read_cover -{ - my ($self, $offset, $base, $lookup, $fh, $is_cover) = @_; - my ($loc) = $fh->tell(); - my ($cover, $str); - - return undef unless $offset; - $str = sprintf("%X", $base + $offset); - return $lookup->{' CACHE'}{$str} if defined $lookup->{' CACHE'}{$str}; - $fh->seek($base + $offset, 0); - $cover = Font::TTF::Coverage->new($is_cover)->read($fh); - $fh->seek($loc, 0); - $lookup->{' CACHE'}{$str} = $cover; - return $cover; -} - - -=head2 ref_cache($obj, $cache, $offset) - -Internal function to keep track of the local positioning of subobjects such as -coverage and class definition tables, and their offsets. -What happens is that the cache is a hash of -sub objects indexed by the reference (using a string mashing of the -reference name which is valid for the duration of the reference) and holds a -list of locations in the output string which should be filled in with the -offset to the sub object when the final string is output in out_final. - -Uses tricks for Tie::Refhash - -=cut - -sub ref_cache -{ - my ($obj, $cache, $offset) = @_; - - return 0 unless defined $obj; - unless (defined $cache->{"$obj"}) - { push (@{$cache->{''}}, $obj); } - push (@{$cache->{"$obj"}}, $offset); - return 0; -} - - -=head2 out_final($fh, $out, $cache_list, $state) - -Internal function to actually output everything to the file handle given that -now we know the offset to the first sub object to be output and which sub objects -are to be output and what locations need to be updated, we can now -generate everything. $cache_list is an array of two element arrays. The first element -is a cache object, the second is an offset to be subtracted from each reference -to that object made in the cache. - -If $state is 1, then the output is not sent to the filehandle and the return value -is the string to be output. If $state is absent or 0 then output is not limited -by storing in a string first and the return value is ""; - -=cut - -sub out_final -{ - my ($fh, $out, $cache_list, $state) = @_; - my ($len) = length($out || ''); - my ($base_loc) = $state ? 0 : $fh->tell(); - my ($loc, $t, $r, $s, $master_cache, $offs, $str, %vecs); - - $fh->print($out || '') unless $state; # first output the current attempt - foreach $r (@$cache_list) - { - $offs = $r->[1]; - foreach $t (@{$r->[0]{''}}) - { - $str = "$t"; - if (!defined $master_cache->{$str}) - { - my ($vec) = $t->signature(); - if ($vecs{$vec}) - { $master_cache->{$str} = $master_cache->{$vecs{$vec}}; } - else - { - $vecs{$vec} = $str; - $master_cache->{$str} = ($state ? length($out) : $fh->tell()) - - $base_loc; - if ($state) - { $out .= $t->out($fh, 1); } - else - { $t->out($fh, 0); } - } - } - foreach $s (@{$r->[0]{$str}}) - { substr($out, $s, 2) = pack('n', $master_cache->{$str} - $offs); } - } - } - if ($state) - { return $out; } - else - { - $loc = $fh->tell(); - $fh->seek($base_loc, 0); - $fh->print($out || ''); # the corrected version - $fh->seek($loc, 0); - } -} - - -=head2 $self->read_context($lookup, $fh, $type, $fmt, $cover, $count, $loc) - -Internal method to read context (simple and chaining context) lookup subtables for -the GSUB and GPOS table types. The assumed values for $type correspond to those -for GSUB, so GPOS should adjust the values upon calling. - -=cut - -sub read_context -{ - my ($self, $lookup, $fh, $type, $fmt, $cover, $count, $loc) = @_; - my ($dat, $i, $s, $t, @subst, @srec, $mcount, $scount); - - if ($type == 5 && $fmt < 3) - { - if ($fmt == 2) - { - $fh->read($dat, 2); - $lookup->{'CLASS'} = $self->read_cover($count, $loc, $lookup, $fh, 0); - $count = TTF_Unpack('S', $dat); - } - $fh->read($dat, $count << 1); - foreach $s (TTF_Unpack('S*', $dat)) - { - if ($s == 0) - { - push (@{$lookup->{'RULES'}}, []); - next; - } - @subst = (); - $fh->seek($loc + $s, 0); - $fh->read($dat, 2); - $t = TTF_Unpack('S', $dat); - $fh->read($dat, $t << 1); - foreach $t (TTF_Unpack('S*', $dat)) - { - $fh->seek($loc + $s + $t, 0); - @srec = (); - $fh->read($dat, 4); - ($mcount, $scount) = TTF_Unpack('S2', $dat); - $mcount--; - $fh->read($dat, ($mcount << 1) + ($scount << 2)); - for ($i = 0; $i < $scount; $i++) - { push (@srec, [TTF_Unpack('S2', substr($dat, - ($mcount << 1) + ($i << 2), 4))]); } - push (@subst, {'ACTION' => [@srec], - 'MATCH' => [TTF_Unpack('S*', - substr($dat, 0, $mcount << 1))]}); - } - push (@{$lookup->{'RULES'}}, [@subst]); - } - $lookup->{'ACTION_TYPE'} = 'l'; - $lookup->{'MATCH_TYPE'} = ($fmt == 2 ? 'c' : 'g'); - } elsif ($type == 5 && $fmt == 3) - { - $fh->read($dat, ($cover << 1) + ($count << 2)); - @subst = (); @srec = (); - for ($i = 0; $i < $cover; $i++) - { push (@subst, $self->read_cover(TTF_Unpack('S', substr($dat, $i << 1, 2)), - $loc, $lookup, $fh, 1)); } - for ($i = 0; $i < $count; $i++) - { push (@srec, [TTF_Unpack('S2', substr($dat, ($count << 1) + ($i << 2), 4))]); } - $lookup->{'RULES'} = [[{'ACTION' => [@srec], 'MATCH' => [@subst]}]]; - $lookup->{'ACTION_TYPE'} = 'l'; - $lookup->{'MATCH_TYPE'} = 'o'; - } elsif ($type == 6 && $fmt < 3) - { - if ($fmt == 2) - { - $fh->read($dat, 6); - $lookup->{'PRE_CLASS'} = $self->read_cover($count, $loc, $lookup, $fh, 0) if $count; - ($i, $mcount, $count) = TTF_Unpack('S3', $dat); # messy: 2 classes & count - $lookup->{'CLASS'} = $self->read_cover($i, $loc, $lookup, $fh, 0) if $i; - $lookup->{'POST_CLASS'} = $self->read_cover($mcount, $loc, $lookup, $fh, 0) if $mcount; - } - $fh->read($dat, $count << 1); - foreach $s (TTF_Unpack('S*', $dat)) - { - if ($s == 0) - { - push (@{$lookup->{'RULES'}}, []); - next; - } - @subst = (); - $fh->seek($loc + $s, 0); - $fh->read($dat, 2); - $t = TTF_Unpack('S', $dat); - $fh->read($dat, $t << 1); - foreach $i (TTF_Unpack('S*', $dat)) - { - $fh->seek($loc + $s + $i, 0); - @srec = (); - $t = {}; - $fh->read($dat, 2); - $mcount = TTF_Unpack('S', $dat); - if ($mcount > 0) - { - $fh->read($dat, $mcount << 1); - $t->{'PRE'} = [TTF_Unpack('S*', $dat)]; - } - $fh->read($dat, 2); - $mcount = TTF_Unpack('S', $dat); - if ($mcount > 1) - { - $fh->read($dat, ($mcount - 1) << 1); - $t->{'MATCH'} = [TTF_Unpack('S*', $dat)]; - } - $fh->read($dat, 2); - $mcount = TTF_Unpack('S', $dat); - if ($mcount > 0) - { - $fh->read($dat, $mcount << 1); - $t->{'POST'} = [TTF_Unpack('S*', $dat)]; - } - $fh->read($dat, 2); - $scount = TTF_Unpack('S', $dat); - $fh->read($dat, $scount << 2); - for ($i = 0; $i < $scount; $i++) - { push (@srec, [TTF_Unpack('S2', substr($dat, $i << 2))]); } - $t->{'ACTION'} = [@srec]; - push (@subst, $t); - } - push (@{$lookup->{'RULES'}}, [@subst]); - } - $lookup->{'ACTION_TYPE'} = 'l'; - $lookup->{'MATCH_TYPE'} = ($fmt == 2 ? 'c' : 'g'); - } elsif ($type == 6 && $fmt == 3) - { - $t = {}; - unless ($cover == 0) - { - @subst = (); - $fh->read($dat, $cover << 1); - foreach $s (TTF_Unpack('S*', $dat)) - { push(@subst, $self->read_cover($s, $loc, $lookup, $fh, 1)); } - $t->{'PRE'} = [@subst]; - } - $fh->read($dat, 2); - $count = TTF_Unpack('S', $dat); - unless ($count == 0) - { - @subst = (); - $fh->read($dat, $count << 1); - foreach $s (TTF_Unpack('S*', $dat)) - { push(@subst, $self->read_cover($s, $loc, $lookup, $fh, 1)); } - $t->{'MATCH'} = [@subst]; - } - $fh->read($dat, 2); - $count = TTF_Unpack('S', $dat); - unless ($count == 0) - { - @subst = (); - $fh->read($dat, $count << 1); - foreach $s (TTF_Unpack('S*', $dat)) - { push(@subst, $self->read_cover($s, $loc, $lookup, $fh, 1)); } - $t->{'POST'} = [@subst]; - } - $fh->read($dat, 2); - $count = TTF_Unpack('S', $dat); - @subst = (); - $fh->read($dat, $count << 2); - for ($i = 0; $i < $count; $i++) - { push (@subst, [TTF_Unpack('S2', substr($dat, $i << 2, 4))]); } - $t->{'ACTION'} = [@subst]; - $lookup->{'RULES'} = [[$t]]; - $lookup->{'ACTION_TYPE'} = 'l'; - $lookup->{'MATCH_TYPE'} = 'o'; - } - $lookup; -} - - -=head2 $self->out_context($lookup, $fh, $type, $fmt, $ctables, $out, $num) - -Provides shared behaviour between GSUB and GPOS tables during output for context -(chained and simple) rules. In addition, support is provided here for type 4 GSUB -tables, which are not used in GPOS. The value for $type corresponds to the type -in a GSUB table so calling from GPOS should adjust the value accordingly. - -=cut - -sub out_context -{ - my ($self, $lookup, $fh, $type, $fmt, $ctables, $out, $num, $base) = @_; - my ($offc, $offd, $i, $j, $r, $t, $numd); - - $out ||= ''; - if (($type == 4 || $type == 5 || $type == 6) && ($fmt == 1 || $fmt == 2)) - { - my ($base_off); - - if ($fmt == 1) - { - $out = pack("nnn", $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), - $num); - $base_off = 6; - } elsif ($type == 5) - { - $out = pack("nnnn", $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), - Font::TTF::Ttopen::ref_cache($lookup->{'CLASS'}, $ctables, 4 + $base), $num); - $base_off = 8; - } elsif ($type == 6) - { - $out = pack("n6", $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), - Font::TTF::Ttopen::ref_cache($lookup->{'PRE_CLASS'}, $ctables, 4 + $base), - Font::TTF::Ttopen::ref_cache($lookup->{'CLASS'}, $ctables, 6 + $base), - Font::TTF::Ttopen::ref_cache($lookup->{'POST_CLASS'}, $ctables, 8 + $base), - $num); - $base_off = 12; - } - - $out .= pack('n*', (0) x $num); - $offc = length($out); - for ($i = 0; $i < $num; $i++) - { - $r = $lookup->{'RULES'}[$i]; - next unless exists $r->[0]{'ACTION'}; - $numd = $#{$r} + 1; - substr($out, ($i << 1) + $base_off, 2) = pack('n', $offc); - $out .= pack('n*', $numd, (0) x $numd); - $offd = length($out) - $offc; - for ($j = 0; $j < $numd; $j++) - { - substr($out, $offc + 2 + ($j << 1), 2) = pack('n', $offd); - if ($type == 4) - { - $out .= pack('n*', $r->[$j]{'ACTION'}[0], $#{$r->[$j]{'MATCH'}} + 2, - @{$r->[$j]{'MATCH'}}); - } elsif ($type == 5) - { - $out .= pack('n*', $#{$r->[$j]{'MATCH'}} + 2, - $#{$r->[$j]{'ACTION'}} + 1, - @{$r->[$j]{'MATCH'}}); - foreach $t (@{$r->[$j]{'ACTION'}}) - { $out .= pack('n2', @$t); } - } elsif ($type == 6) - { - $out .= pack('n*', $#{$r->[$j]{'PRE'}} + 1, @{$r->[$j]{'PRE'}}, - $#{$r->[$j]{'MATCH'}} + 2, @{$r->[$j]{'MATCH'}}, - $#{$r->[$j]{'POST'}} + 1, @{$r->[$j]{'POST'}}, - $#{$r->[$j]{'ACTION'}} + 1); - foreach $t (@{$r->[$j]{'ACTION'}}) - { $out .= pack('n2', @$t); } - } - $offd = length($out) - $offc; - } - $offc = length($out); - } - } elsif ($type == 5 && $fmt == 3) - { - $out .= pack('n3', $fmt, $#{$lookup->{'RULES'}[0][0]{'MATCH'}} + 1, - $#{$lookup->{'RULES'}[0][0]{'ACTION'}} + 1); - foreach $t (@{$lookup->{'RULES'}[0][0]{'MATCH'}}) - { $out .= pack('n', Font::TTF::Ttopen::ref_cache($t, $ctables, length($out) + $base)); } - foreach $t (@{$lookup->{'RULES'}[0][0]{'ACTION'}}) - { $out .= pack('n2', @$t); } - } elsif ($type == 6 && $fmt == 3) - { - $r = $lookup->{'RULES'}[0][0]; - no strict 'refs'; # temp fix - more code needed (probably "if" statements in the event 'PRE' or 'POST' are empty) - $out .= pack('n2', $fmt, defined $r->{'PRE'} ? scalar @{$r->{'PRE'}} : 0); - foreach $t (@{$r->{'PRE'}}) - { $out .= pack('n', Font::TTF::Ttopen::ref_cache($t, $ctables, length($out) + $base)); } - $out .= pack('n', defined $r->{'MATCH'} ? scalar @{$r->{'MATCH'}} : 0); - foreach $t (@{$r->{'MATCH'}}) - { $out .= pack('n', Font::TTF::Ttopen::ref_cache($t, $ctables, length($out) + $base)); } - $out .= pack('n', defined $r->{'POST'} ? scalar @{$r->{'POST'}} : 0); - foreach $t (@{$r->{'POST'}}) - { $out .= pack('n', Font::TTF::Ttopen::ref_cache($t, $ctables, length($out) + $base)); } - $out .= pack('n', defined $r->{'ACTION'} ? scalar @{$r->{'ACTION'}} : 0); - foreach $t (@{$r->{'ACTION'}}) - { $out .= pack('n2', @$t); } - } - $out; -} - -=head1 BUGS - -=over 4 - -=item * - -No way to share cachable items (coverage tables, classes, anchors, device tables) -across different lookups. The items are always output after the lookup and -repeated if necessary. Within lookup sharing is possible. - -=back - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - -1; - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Useall.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Useall.pm deleted file mode 100644 index 85e69dc..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Useall.pm +++ /dev/null @@ -1,54 +0,0 @@ -use Font::TTF::Sill; -use Font::TTF::Cvt_; -use Font::TTF::Fpgm; -use Font::TTF::Glyf; -use Font::TTF::Hdmx; -use Font::TTF::Kern; -use Font::TTF::Loca; -use Font::TTF::LTSH; -use Font::TTF::Name; -use Font::TTF::OS_2; -use Font::TTF::PCLT; -use Font::TTF::Post; -use Font::TTF::Prep; -use Font::TTF::Vmtx; -use Font::TTF::AATKern; -use Font::TTF::AATutils; -use Font::TTF::Anchor; -use Font::TTF::Bsln; -use Font::TTF::Delta; -use Font::TTF::Fdsc; -use Font::TTF::Feat; -use Font::TTF::GrFeat; -use Font::TTF::Fmtx; -use Font::TTF::GPOS; -use Font::TTF::Mort; -use Font::TTF::Prop; -use Font::TTF::GDEF; -use Font::TTF::Coverage; -use Font::TTF::GSUB; -use Font::TTF::Hhea; -use Font::TTF::Table; -use Font::TTF::Ttopen; -use Font::TTF::Glyph; -use Font::TTF::Head; -use Font::TTF::Hmtx; -use Font::TTF::Vhea; -use Font::TTF::Cmap; -use Font::TTF::Utils; -use Font::TTF::Maxp; -use Font::TTF::Font; -use Font::TTF::Kern::ClassArray; -use Font::TTF::Kern::CompactClassArray; -use Font::TTF::Kern::OrderedList; -use Font::TTF::Kern::StateTable; -use Font::TTF::Kern::Subtable; -use Font::TTF::Mort::Chain; -use Font::TTF::Mort::Contextual; -use Font::TTF::Mort::Insertion; -use Font::TTF::Mort::Ligature; -use Font::TTF::Mort::Noncontextual; -use Font::TTF::Mort::Rearrangement; -use Font::TTF::Mort::Subtable; - -1; diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Utils.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Utils.pm deleted file mode 100644 index a849ee3..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Utils.pm +++ /dev/null @@ -1,630 +0,0 @@ -package Font::TTF::Utils; - -=head1 NAME - -Font::TTF::Utils - Utility functions to save fingers - -=head1 DESCRIPTION - -Lots of useful functions to save my fingers, especially for trivial tables - -=head1 FUNCTIONS - -The following functions are exported - -=cut - -use strict; -use vars qw(@ISA @EXPORT $VERSION @EXPORT_OK); -require Exporter; - -@ISA = qw(Exporter); -@EXPORT = qw(TTF_Init_Fields TTF_Read_Fields TTF_Out_Fields TTF_Pack - TTF_Unpack TTF_word_utf8 TTF_utf8_word TTF_bininfo); -@EXPORT_OK = (@EXPORT, qw(XML_hexdump)); -$VERSION = 0.0001; - -=head2 ($val, $pos) = TTF_Init_Fields ($str, $pos) - -Given a field description from the C section, creates an absolute entry -in the fields associative array for the class - -=cut - -sub TTF_Init_Fields -{ - my ($str, $pos, $inval) = @_; - my ($key, $val, $res, $len, $rel); - - $str =~ s/\r?\n$//o; - if ($inval) - { ($key, $val) = ($str, $inval); } - else - { ($key, $val) = split(',\s*', $str); } - return (undef, undef, 0) unless (defined $key && $key ne ""); - if ($val =~ m/^(\+?)(\d*)(\D+)(\d*)/oi) - { - $rel = $1; - if ($rel eq "+") - { $pos += $2; } - elsif ($2 ne "") - { $pos = $2; } - $val = $3; - $len = $4; - } - $len = "" unless defined $len; - $pos = 0 if !defined $pos || $pos eq ""; - $res = "$pos:$val:$len"; - if ($val eq "f" || $val eq 'v' || $val =~ m/^[l]/oi) - { $pos += 4 * ($len ne "" ? $len : 1); } - elsif ($val eq "F" || $val =~ m/^[s]/oi) - { $pos += 2 * ($len ne "" ? $len : 1); } - else - { $pos += 1 * ($len ne "" ? $len : 1); } - - ($key, $res, $pos); -} - - -=head2 TTF_Read_Fields($obj, $dat, $fields) - -Given a block of data large enough to account for all the fields in a table, -processes the data block to convert to the values in the objects instance -variables by name based on the list in the C block which has been run -through C - -=cut - -sub TTF_Read_Fields -{ - my ($self, $dat, $fields) = @_; - my ($pos, $type, $res, $f, $arrlen, $arr, $frac); - - foreach $f (keys %{$fields}) - { - ($pos, $type, $arrlen) = split(':', $fields->{$f}); - $pos = 0 if $pos eq ""; - if ($arrlen ne "") - { $self->{$f} = [TTF_Unpack("$type$arrlen", substr($dat, $pos))]; } - else - { $self->{$f} = TTF_Unpack("$type", substr($dat, $pos)); } - } - $self; -} - - -=head2 TTF_Unpack($fmt, $dat) - -A TrueType types equivalent of Perls C function. Thus $fmt consists of -type followed by an optional number of elements to read including *. The type -may be one of: - - c BYTE - C CHAR - f FIXED - F F2DOT14 - l LONG - L ULONG - s SHORT - S USHORT - v Version number (FIXED) - -Note that C, C and C are not data types but units. - -Returns array of scalar (first element) depending on context - -=cut - -sub TTF_Unpack -{ - my ($fmt, $dat) = @_; - my ($res, $frac, $i, $arrlen, $type, @res); - - while ($fmt =~ s/^([cflsv])(\d+|\*)?//oi) - { - $type = $1; - $arrlen = $2; - $arrlen = 1 if !defined $arrlen || $arrlen eq ""; - $arrlen = -1 if $arrlen eq "*"; - - for ($i = 0; ($arrlen == -1 && $dat ne "") || $i < $arrlen; $i++) - { - if ($type eq "f") - { - ($res, $frac) = unpack("nn", $dat); - substr($dat, 0, 4) = ""; - $res -= 65536 if $res > 32767; - $res += $frac / 65536.; - } - elsif ($type eq "v") - { - ($res, $frac) = unpack("nn", $dat); - substr($dat, 0, 4) = ""; - $res -= 65536 if $res > 32767; - $res = sprintf("%d.%X", $res, $frac); - } - elsif ($type eq "F") - { - $res = unpack("n", $dat); - substr($dat, 0, 2) = ""; -# $res -= 65536 if $res >= 32768; - $frac = $res & 0x3fff; - $res >>= 14; - $res -= 4 if $res > 1; -# $frac -= 16384 if $frac > 8191; - $res += $frac / 16384.; - } - elsif ($type =~ m/^[l]/oi) - { - $res = unpack("N", $dat); - substr($dat, 0, 4) = ""; - $res -= (1 << 32) if ($type eq "l" && $res >= 1 << 31); - } - elsif ($type =~ m/^[s]/oi) - { - $res = unpack("n", $dat); - substr($dat, 0, 2) = ""; - $res -= 65536 if ($type eq "s" && $res >= 32768); - } - elsif ($type eq "c") - { - $res = unpack("c", $dat); - substr($dat, 0, 1) = ""; - } - else - { - $res = unpack("C", $dat); - substr($dat, 0, 1) = ""; - } - push (@res, $res); - } - } - return wantarray ? @res : $res[0]; -} - - -=head2 $dat = TTF_Out_Fields($obj, $fields, $len) - -Given the fields table from C writes out the instance variables from -the object to the filehandle in TTF binary form. - -=cut - -sub TTF_Out_Fields -{ - my ($obj, $fields, $len) = @_; - my ($dat) = "\000" x $len; - my ($f, $pos, $type, $res, $arr, $arrlen, $frac); - - foreach $f (keys %{$fields}) - { - ($pos, $type, $arrlen) = split(':', $fields->{$f}); - if ($arrlen ne "") - { $res = TTF_Pack("$type$arrlen", @{$obj->{$f}}); } - else - { $res = TTF_Pack("$type", $obj->{$f}); } - substr($dat, $pos, length($res)) = $res; - } - $dat; -} - - -=head2 $dat = TTF_Pack($fmt, @data) - -The TrueType equivalent to Perl's C function. See details of C -for how to work the $fmt string. - -=cut - -sub TTF_Pack -{ - my ($fmt, @obj) = @_; - my ($type, $i, $arrlen, $dat, $res, $frac); - - $dat = ''; - while ($fmt =~ s/^([flscv])(\d+|\*)?//oi) - { - $type = $1; - $arrlen = $2 || ""; - $arrlen = $#obj + 1 if $arrlen eq "*"; - $arrlen = 1 if $arrlen eq ""; - - for ($i = 0; $i < $arrlen; $i++) - { - $res = shift(@obj) || 0; - if ($type eq "f") - { - $frac = int(($res - int($res)) * 65536); - $res = (int($res) << 16) + $frac; - $dat .= pack("N", $res); - } - elsif ($type eq "v") - { - if ($res =~ s/\.(\d+)$//o) - { - $frac = $1; - $frac .= "0" x (4 - length($frac)); - } - else - { $frac = 0; } - $dat .= pack('nn', $res, eval("0x$frac")); - } - elsif ($type eq "F") - { - $frac = int(($res - int($res)) * 16384); - $res = (int($res) << 14) + $frac; - $dat .= pack("n", $res); - } - elsif ($type =~ m/^[l]/oi) - { - $res += 1 << 32 if ($type eq 'L' && $res < 0); - $dat .= pack("N", $res); - } - elsif ($type =~ m/^[s]/oi) - { - $res += 1 << 16 if ($type eq 'S' && $res < 0); - $dat .= pack("n", $res); - } - elsif ($type eq "c") - { $dat .= pack("c", $res); } - else - { $dat .= pack("C", $res); } - } - } - $dat; -} - - -=head2 ($num, $range, $select, $shift) = TTF_bininfo($num) - -Calculates binary search information from a number of elements - -=cut - -sub TTF_bininfo -{ - my ($num, $block) = @_; - my ($range, $select, $shift); - - $range = 1; - for ($select = 0; $range <= $num; $select++) - { $range *= 2; } - $select--; $range /= 2; - $range *= $block; - - $shift = $num * $block - $range; - ($num, $range, $select, $shift); -} - - -=head2 TTF_word_utf8($str) - -Returns the UTF8 form of the 16 bit string, assumed to be in big endian order, -including surrogate handling - -=cut - -sub TTF_word_utf8 -{ - my ($str) = @_; - my ($res, $i); - my (@dat) = unpack("n*", $str); - - return pack("U*", @dat) if ($] >= 5.006); - for ($i = 0; $i <= $#dat; $i++) - { - my ($dat) = $dat[$i]; - if ($dat < 0x80) # Thanks to Gisle Aas for some of his old code - { $res .= chr($dat); } - elsif ($dat < 0x800) - { $res .= chr(0xC0 | ($dat >> 6)) . chr(0x80 | ($dat & 0x3F)); } - elsif ($dat >= 0xD800 && $dat < 0xDC00) - { - my ($dat1) = $dat[++$i]; - my ($top) = (($dat & 0x3C0) >> 6) + 1; - $res .= chr(0xF0 | ($top >> 2)) - . chr(0x80 | (($top & 1) << 4) | (($dat & 0x3C) >> 2)) - . chr(0x80 | (($dat & 0x3) << 4) | (($dat1 & 0x3C0) >> 6)) - . chr(0x80 | ($dat1 & 0x3F)); - } else - { $res .= chr(0xE0 | ($dat >> 12)) . chr(0x80 | (($dat >> 6) & 0x3F)) - . chr(0x80 | ($dat & 0x3F)); } - } - $res; -} - - -=head2 TTF_utf8_word($str) - -Returns the 16-bit form in big endian order of the UTF 8 string, including -surrogate handling to Unicode. - -=cut - -sub TTF_utf8_word -{ - my ($str) = @_; - my ($res); - - return pack("n*", unpack("U*", $str)) if ($^V ge v5.6.0); - $str = "$str"; # copy $str - while (length($str)) # Thanks to Gisle Aas for some of his old code - { - $str =~ s/^[\x80-\xBF]+//o; - if ($str =~ s/^([\x00-\x7F]+)//o) - { $res .= pack("n*", unpack("C*", $1)); } - elsif ($str =~ s/^([\xC0-\xDF])([\x80-\xBF])//o) - { $res .= pack("n", ((ord($1) & 0x1F) << 6) | (ord($2) & 0x3F)); } - elsif ($str =~ s/^([\0xE0-\xEF])([\x80-\xBF])([\x80-\xBF])//o) - { $res .= pack("n", ((ord($1) & 0x0F) << 12) - | ((ord($2) & 0x3F) << 6) - | (ord($3) & 0x3F)); } - elsif ($str =~ s/^([\xF0-\xF7])([\x80-\xBF])([\x80-\xBF])([\x80-\xBF])//o) - { - my ($b1, $b2, $b3, $b4) = (ord($1), ord($2), ord($3), ord($4)); - $res .= pack("n", ((($b1 & 0x07) << 8) | (($b2 & 0x3F) << 2) - | (($b3 & 0x30) >> 4)) + 0xD600); # account for offset - $res .= pack("n", ((($b3 & 0x0F) << 6) | ($b4 & 0x3F)) + 0xDC00); - } - elsif ($str =~ s/^[\xF8-\xFF][\x80-\xBF]*//o) - { } - } - $res; -} - - -=head2 XML_hexdump($context, $dat) - -Dumps out the given data as a sequence of blocks each 16 bytes wide - -=cut - -sub XML_hexdump -{ - my ($context, $depth, $dat) = @_; - my ($fh) = $context->{'fh'}; - my ($i, $len, $out); - - $len = length($dat); - for ($i = 0; $i < $len; $i += 16) - { - $out = join(' ', map {sprintf("%02X", ord($_))} (split('', substr($dat, $i, 16)))); - $fh->printf("%s%s\n", $depth, $i, $out); - } -} - - -=head2 XML_outhints - -Converts a binary string of hinting code into a textual representation - -=cut - -{ - my (@hints) = ( - ['SVTCA[0]'], ['SVTCA[1]'], ['SPVTCA[0]'], ['SPVTCA[1]'], ['SFVTCA[0]'], ['SFVTCA[1]'], ['SPVTL[0]'], ['SPVTL[1]'], - ['SFVTL[0]'], ['SFVTL[1]'], ['SPVFS'], ['SFVFS'], ['GPV'], ['GFV'], ['SVFTPV'], ['ISECT'], -# 10 - ['SRP0'], ['SRP1'], ['SRP2'], ['SZP0'], ['SZP1'], ['SZP2'], ['SZPS'], ['SLOOP'], - ['RTG'], ['RTHG'], ['SMD'], ['ELSE'], ['JMPR'], ['SCVTCI'], ['SSWCI'], ['SSW'], -# 20 - ['DUP'], ['POP'], ['CLEAR'], ['SWAP'], ['DEPTH'], ['CINDEX'], ['MINDEX'], ['ALIGNPTS'], - [], ['UTP'], ['LOOPCALL'], ['CALL'], ['FDEF'], ['ENDF'], ['MDAP[0]'], ['MDAP[1]'], -# 30 - ['IUP[0]'], ['IUP[1]'], ['SHP[0]'], ['SHP[1]'], ['SHC[0]'], ['SHC[1]'], ['SHZ[0]'], ['SHZ[1]'], - ['SHPIX'], ['IP'], ['MSIRP[0]'], ['MSIRP[1]'], ['ALIGNRP'], ['RTDG'], ['MIAP[0]'], ['MIAP[1]'], -# 40 - ['NPUSHB', -1, 1], ['NPUSHW', -1, 2], ['WS', 0, 0], ['RS', 0, 0], ['WCVTP', 0, 0], ['RCVT', 0, 0], ['GC[0]'], ['GC[1]'], - ['SCFS'], ['MD[0]'], ['MD[1]'], ['MPPEM'], ['MPS'], ['FLIPON'], ['FLIPOFF'], ['DEBUG'], -# 50 - ['LT'], ['LTEQ'], ['GT'], ['GTEQ'], ['EQ'], ['NEQ'], ['ODD'], ['EVEN'], - ['IF'], ['EIF'], ['AND'], ['OR'], ['NOT'], ['DELTAP1'], ['SDB'], ['SDS'], -# 60 - ['ADD'], ['SUB'], ['DIV'], ['MULT'], ['ABS'], ['NEG'], ['FLOOR'], ['CEILING'], - ['ROUND[0]'], ['ROUND[1]'], ['ROUND[2]'], ['ROUND[3]'], ['NROUND[0]'], ['NROUND[1]'], ['NROUND[2]'], ['NROUND[3]'], -# 70 - ['WCVTF'], ['DELTAP2'], ['DELTAP3'], ['DELTAC1'], ['DELTAC2'], ['DELTAC3'], ['SROUND'], ['S45ROUND'], - ['JROT'], ['JROF'], ['ROFF'], [], ['RUTG'], ['RDTG'], ['SANGW'], [], -# 80 - ['FLIPPT'], ['FLIPRGON'], ['FLIPRGOFF'], [], [], ['SCANCTRL'], ['SDPVTL[0]'], ['SDPVTL[1]'], - ['GETINFO'], ['IDEF'], ['ROLL'], ['MAX'], ['MIN'], ['SCANTYPE'], ['INSTCTRL'], [], -# 90 - [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], -# A0 - [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], -# B0 - ['PUSHB1', 1, 1], ['PUSHB2', 2, 1], ['PUSHB3', 3, 1], ['PUSHB4', 4, 1], ['PUSHB5', 5, 1], ['PUSHB6', 6, 1], ['PUSHB7', 7, 1], ['PUSHB8', 8, 1], - ['PUSHW1', 1, 2], ['PUSHW2', 2, 2], ['PUSHW3', 3, 2], ['PUSHW4', 4, 2], ['PUSHW5', 5, 2], ['PUSHW6', 6, 2], ['PUSHW7', 7, 2], ['PUSHW8', 8, 2], -# C0 - ['MDRP[0]'], ['MDRP[1]'], ['MDRP[2]'], ['MDRP[3]'], ['MDRP[4]'], ['MDRP[5]'], ['MDRP[6]'], ['MDRP[7]'], - ['MDRP[8]'], ['MDRP[9]'], ['MDRP[A]'], ['MDRP[B]'], ['MDRP[C]'], ['MDRP[D]'], ['MDRP[E]'], ['MDRP[F]'], -# D0 - ['MDRP[10]'], ['MDRP[11]'], ['MDRP[12]'], ['MDRP[13]'], ['MDRP[14]'], ['MDRP[15]'], ['MDRP[16]'], ['MDRP[17]'], - ['MDRP[18]'], ['MDRP[19]'], ['MDRP[1A]'], ['MDRP[1B]'], ['MDRP[1C]'], ['MDRP[1D]'], ['MDRP[1E]'], ['MDRP[1F]'], -# E0 - ['MIRP[0]'], ['MIRP[1]'], ['MIRP[2]'], ['MIRP[3]'], ['MIRP[4]'], ['MIRP[5]'], ['MIRP[6]'], ['MIRP[7]'], - ['MIRP[8]'], ['MIRP[9]'], ['MIRP[A]'], ['MIRP[B]'], ['MIRP[C]'], ['MIRP[D]'], ['MIRP[E]'], ['MIRP[F]'], -# F0 - ['MIRP[10]'], ['MIRP[11]'], ['MIRP[12]'], ['MIRP[13]'], ['MIRP[14]'], ['MIRP[15]'], ['MIRP[16]'], ['MIRP[17]'], - ['MIRP[18]'], ['MIRP[19]'], ['MIRP[1A]'], ['MIRP[1B]'], ['MIRP[1C]'], ['MIRP[1D]'], ['MIRP[1E]'], ['MIRP[1F]']); - - my ($i); - my (%hints) = map { $_->[0] => $i++ if (defined $_->[0]); } @hints; - - sub XML_binhint - { - my ($dat) = @_; - my ($len) = length($dat); - my ($res, $i, $text, $size, $num); - - for ($i = 0; $i < $len; $i++) - { - ($text, $num, $size) = @{$hints[ord(substr($dat, $i, 1))]}; - $num = 0 unless (defined $num); - $text = sprintf("UNK[%02X]", ord(substr($dat, $i, 1))) unless defined $text; - $res .= $text; - if ($num != 0) - { - if ($num < 0) - { - $i++; - my ($nnum) = unpack($num == -1 ? 'C' : 'n', substr($dat, $i, -$num)); - $i += -$num - 1; - $num = $nnum; - } - $res .= "\t" . join(' ', unpack($size == 1 ? 'C*' : 'n*', substr($dat, $i + 1, $num * $size))); - $i += $num * $size; - } - $res .= "\n"; - } - $res; - } - - sub XML_hintbin - { - my ($dat) = @_; - my ($l, $res, @words, $num); - - foreach $l (split(/\s*\n\s*/, $dat)) - { - @words = split(/\s*/, $l); - next unless (defined $hints{$words[0]}); - $num = $hints{$words[0]}; - $res .= pack('C', $num); - if ($hints[$num][1] < 0) - { - $res .= pack($hints[$num][1] == -1 ? 'C' : 'n', $#words); - $res .= pack($hints[$num][2] == 1 ? 'C*' : 'n*', @words[1 .. $#words]); - } - elsif ($hints[$num][1] > 0) - { - $res .= pack($hints[$num][2] == 1 ? 'C*' : 'n*', @words[1 .. $hints[$num][1]]); - } - } - $res; - } -} - - -=head2 make_circle($f, $cmap, [$dia, $sb, $opts]) - -Adds a dotted circle to a font. This function is very configurable. The -parameters passed in are: - -=over 4 - -=item $f - -Font to work with. This is required. - -=item $cmap - -A cmap table (not the 'val' sub-element of a cmap) to add the glyph too. Optional. - -=item $dia - -Optional diameter for the main circle. Defaults to 80% em - -=item $sb - -Side bearing. The left and right side-bearings are always the same. This value -defaults to 10% em. - -=back - -There are various options to control all sorts of interesting aspects of the circle - -=over 4 - -=item numDots - -Number of dots in the circle - -=item numPoints - -Number of curve points to use to create each dot - -=item uid - -Unicode reference to store this glyph under in the cmap. Defaults to 0x25CC - -=item pname - -Postscript name to give the glyph. Defaults to uni25CC. - -=item -dRadius - -Radius of each dot. - -=back - -=cut - -sub make_circle -{ - my ($font, $cmap, $dia, $sb, %opts) = @_; - my ($upem) = $font->{'head'}{'unitsPerEm'}; - my ($glyph) = Font::TTF::Glyph->new('PARENT' => $font, 'read' => 2); - my ($PI) = 3.1415926535; - my ($R, $r, $xorg, $yorg); - my ($i, $j, $numg, $maxp); - my ($numc) = $opts{'-numDots'} || 16; - my ($nump) = ($opts{'-numPoints'} * 2) || 8; - my ($uid) = $opts{'-uid'} || 0x25CC; - my ($pname) = $opts{'-pname'} || 'uni25CC'; - - $dia ||= $upem * .8; # .95 to fit exactly - $sb ||= $upem * .1; - $R = $dia / 2; - $r = $opts{'-dRadius'} || ($R * .1); - ($xorg, $yorg) = ($R + $r, $R); - - $xorg += $sb; - $font->{'post'}->read; - $font->{'glyf'}->read; - for ($i = 0; $i < $numc; $i++) - { - my ($pxorg, $pyorg) = ($xorg + $R * cos(2 * $PI * $i / $numc), - $yorg + $R * sin(2 * $PI * $i / $numc)); - for ($j = 0; $j < $nump; $j++) - { - push (@{$glyph->{'x'}}, int ($pxorg + ($j & 1 ? 1/cos(2*$PI/$nump) : 1) * $r * cos(2 * $PI * $j / $nump))); - push (@{$glyph->{'y'}}, int ($pyorg + ($j & 1 ? 1/cos(2*$PI/$nump) : 1) * $r * sin(2 * $PI * $j / $nump))); - push (@{$glyph->{'flags'}}, $j & 1 ? 0 : 1); - } - push (@{$glyph->{'endPoints'}}, $#{$glyph->{'x'}}); - } - $glyph->{'numberOfContours'} = $#{$glyph->{'endPoints'}} + 1; - $glyph->{'numPoints'} = $#{$glyph->{'x'}} + 1; - $glyph->update; - $numg = $font->{'maxp'}{'numGlyphs'}; - $font->{'maxp'}{'numGlyphs'}++; - - $font->{'hmtx'}{'advance'}[$numg] = int($xorg + $R + $r + $sb + .5); - $font->{'hmtx'}{'lsb'}[$numg] = int($xorg - $R - $r + .5); - $font->{'loca'}{'glyphs'}[$numg] = $glyph; - $cmap->{'val'}{$uid} = $numg if ($cmap); - $font->{'post'}{'VAL'}[$numg] = $pname; - delete $font->{'hdmx'}; - delete $font->{'VDMX'}; - delete $font->{'LTSH'}; - - $font->tables_do(sub {$_[0]->dirty;}); - $font->update; - return ($numg - 1); -} - - -1; - -=head1 BUGS - -No known bugs - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Vhea.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Vhea.pm deleted file mode 100644 index 2e1a49a..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Vhea.pm +++ /dev/null @@ -1,159 +0,0 @@ -package Font::TTF::Vhea; - -=head1 NAME - -Font::TTF::Vhea - Vertical Header table - -=head1 DESCRIPTION - -This is a simple table with just standards specified instance variables - -=head1 INSTANCE VARIABLES - - version - Ascender - Descender - LineGap - advanceHeightMax - minTopSideBearing - minBottomSideBearing - yMaxExtent - caretSlopeRise - caretSlopeRun - metricDataFormat - numberOfVMetrics - - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA %fields @field_info); - -require Font::TTF::Table; -use Font::TTF::Utils; - -@ISA = qw(Font::TTF::Table); -@field_info = ( - 'version' => 'v', - 'Ascender' => 's', - 'Descender' => 's', - 'LineGap' => 's', - 'advanceHeightMax' => 'S', - 'minTopSideBearing' => 's', - 'minBottomSideBearing' => 's', - 'yMaxExtent' => 's', - 'caretSlopeRise' => 's', - 'caretSlopeRun' => 's', - 'metricDataFormat' => '+10s', - 'numberOfVMetrics' => 's'); - -sub init -{ - my ($k, $v, $c, $i); - for ($i = 0; $i < $#field_info; $i += 2) - { - ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); - next unless defined $k && $k ne ""; - $fields{$k} = $v; - } -} - - -=head2 $t->read - -Reads the table into memory as instance variables - -=cut - -sub read -{ - my ($self) = @_; - my ($dat); - - $self->SUPER::read or return $self; - init unless defined $fields{'Ascender'}; - $self->{' INFILE'}->read($dat, 36); - - TTF_Read_Fields($self, $dat, \%fields); - $self; -} - - -=head2 $t->out($fh) - -Writes the table to a file either from memory or by copying. - -=cut - -sub out -{ - my ($self, $fh) = @_; - - return $self->SUPER::out($fh) unless $self->{' read'}; - - $self->{'numberOfVMetrics'} = $self->{' PARENT'}{'vmtx'}->numMetrics || $self->{'numberOfVMetrics'}; - $fh->print(TTF_Out_Fields($self, \%fields, 36)); - $self; -} - - -=head2 $t->update - -Updates various parameters in the hhea table from the hmtx table, assuming -the C table is dirty. - -=cut - -sub update -{ - my ($self) = @_; - my ($vmtx) = $self->{' PARENT'}{'vmtx'}; - my ($glyphs); - my ($num); - my ($i, $maw, $mlsb, $mrsb, $mext, $aw, $lsb, $ext); - - return undef unless ($self->SUPER::update); - return undef unless (defined $vmtx && defined $self->{' PARENT'}{'loca'}); - $vmtx->read->update; - $self->{' PARENT'}{'loca'}->read->update; - $glyphs = $self->{' PARENT'}{'loca'}{'glyphs'}; - $num = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - - for ($i = 0; $i < $num; $i++) - { - $aw = $vmtx->{'advance'}[$i]; - $lsb = $vmtx->{'top'}[$i]; - if (defined $glyphs->[$i]) - { $ext = $lsb + $glyphs->[$i]->read->{'yMax'} - $glyphs->[$i]{'yMin'}; } - else - { $ext = $aw; } - $maw = $aw if ($aw > $maw); - $mlsb = $lsb if ($lsb < $mlsb or $i == 0); - $mrsb = $aw - $ext if ($aw - $ext < $mrsb or $i == 0); - $mext = $ext if ($ext > $mext); - } - $self->{'advanceHeightMax'} = $maw; - $self->{'minTopSideBearing'} = $mlsb; - $self->{'minBottomSideBearing'} = $mrsb; - $self->{'yMaxExtent'} = $mext; - $self->{'numberOfVMetrics'} = $vmtx->numMetrics; - $self; -} - - -1; - - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Vmtx.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Vmtx.pm deleted file mode 100644 index b74d6df..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Vmtx.pm +++ /dev/null @@ -1,86 +0,0 @@ -package Font::TTF::Vmtx; - -=head1 NAME - -Font::TTF::Vmtx - Vertical Metrics - -=head1 DESCRIPTION - -Contains the advance height and top side bearing for each glyph. Given the -compressability of the data onto disk, this table uses information from -other tables, and thus must do part of its output during the output of -other tables - -=head1 INSTANCE VARIABLES - -The vertical metrics are kept in two arrays by glyph id. The variable names -do not start with a space - -=over 4 - -=item advance - -An array containing the advance height for each glyph - -=item top - -An array containing the top side bearing for each glyph - -=back - -=head1 METHODS - -=cut - -use strict; -use vars qw(@ISA); -require Font::TTF::Hmtx; - -@ISA = qw(Font::TTF::Hmtx); - - -=head2 $t->read - -Reads the vertical metrics from the TTF file into memory - -=cut - -sub read -{ - my ($self) = @_; - my ($numh, $numg); - - $numh = $self->{' PARENT'}{'vhea'}->read->{'numberOfVMetrics'}; - $numg = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - $self->_read($numg, $numh, "advance", "top"); -} - - -=head2 $t->out($fh) - -Writes the metrics to a TTF file. Assumes that the C has updated the -numVMetrics from here - -=cut - -sub out -{ - my ($self, $fh) = @_; - my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; - my ($numh) = $self->{' PARENT'}{'vhea'}{'numberOfVMetrics'}; - $self->_out($fh, $numg, $numh, "advance", "top"); -} - -1; - -=head1 BUGS - -None known - -=head1 AUTHOR - -Martin Hosken Martin_Hosken@sil.org. See L for copyright and -licensing. - -=cut - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Win32.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Win32.pm deleted file mode 100644 index bb8886e..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Win32.pm +++ /dev/null @@ -1,33 +0,0 @@ -package Font::TTF::Win32; - -# use strict; -# use vars qw($HKEY_LOCAL_MACHINE); - -use Win32::Registry; -use Win32; -use File::Spec; -use Font::TTF::Font; - - -sub findfonts -{ - my ($sub) = @_; - my ($font_key) = 'SOFTWARE\Microsoft\Windows' . (Win32::IsWinNT() ? ' NT' : '') . '\CurrentVersion\Fonts'; - my ($regFont, $list, $l, $font, $file); - -# get entry from registry for a font of this name - $::HKEY_LOCAL_MACHINE->Open($font_key, $regFont); - $regFont->GetValues($list); - - foreach $l (sort keys %{$list}) - { - my ($fname) = $list->{$l}[0]; - next unless ($fname =~ s/\(TrueType\)$//o); - $file = File::Spec->rel2abs($list->{$l}[2], "$ENV{'windir'}/fonts"); - $font = Font::TTF::Font->open($file) || next; - &{$sub}($font, $fname); - $font->release; - } -} - -1; diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/XMLparse.pm b/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/XMLparse.pm deleted file mode 100644 index 7b2b571..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/XMLparse.pm +++ /dev/null @@ -1,176 +0,0 @@ -package Font::TTF::XMLparse; - -=head1 NAME - -Font::TTF::XMLparse - provides support for XML parsing. Requires Expat module XML::Parser::Expat - -=head1 SYNOPSIS - - use Font::TTF::Font; - use Font::TTF::XMLparse; - - $f = Font::TTF::Font->new; - read_xml($f, $ARGV[0]); - $f->out($ARGV[1]); - -=head1 DESCRIPTION - -This module contains the support routines for parsing XML and generating the -Truetype font structures as a result. The module has been separated from the rest -of the package in order to reduce the dependency that this would bring, of the -whole package on XML::Parser. This way, people without the XML::Parser can still -use the rest of the package. - -The package interacts with another package through the use of a context containing -and element 'receiver' which is an object which can possibly receive one of the -following messages: - -=over 4 - -=item XML_start - -This message is called when an open tag occurs. It is called with the context, -tag name and the attributes. The return value has no meaning. - -=item XML_end - -This messages is called when a close tag occurs. It is called with the context, -tag name and attributes (held over from when the tag was opened). There are 3 -possible return values from such a message: - -=over 8 - -=item undef - -This is the default return value indicating that default processing should -occur in which either the current element on the tree, or the text of this element -should be stored in the parent object. - -=item $context - -This magic value marks that the element should be deleted from the parent. -Nothing is stored in the parent. (This rather than '' is used to allow 0 returns.) - -=item anything - -Anything else is taken as the element content to be stored in the parent. - -=back 4 - -=back 4 - -In addition, the context hash passed to these messages contains the following -keys: - -=over 4 - -=item xml - -This is the expat xml object. The context is also available as -$context->{'xml'}{' mycontext'}. But that is a long winded way of not saying much! - -=item font - -This is the base object that was passed in for XML parsing. - -=item receiver - -This holds the current receiver of parsing events. It may be set in associated -application to adjust which objects should receive messages when. It is also stored -in the parsing stack to ensure that where an object changes it during XML_start, that -that same object that received XML_start will receive the corresponding XML_end - -=item stack - -This is the parsing stack, used internally to hold the current receiver and attributes -for each element open, as a complete hierarchy back to the root element. - -=item tree - -This element contains the storage tree corresponding to the parent of each element -in the stack. The default action is to push undef onto this stack during XML_start -and then to resolve this, either in the associated application (by changing -$context->{'tree'}[-1]) or during XML_end of a child element, by which time we know -whether we are dealing with an array or a hash or what. - -=item text - -Character processing is to insert all the characters into the text element of the -context for available use later. - -=back 4 - -=head1 METHODS - -=cut - -use XML::Parser::Expat; -require Exporter; - -use strict; -use vars qw(@ISA @EXPORT); - -@ISA = qw(Exporter); -@EXPORT = qw(read_xml); - -sub read_xml -{ - my ($font, $fname) = @_; - - my ($xml) = XML::Parser::Expat->new; - my ($context) = {'xml' => $xml, 'font' => $font}; - - $xml->setHandlers('Start' => sub { - my ($x, $tag, %attrs) = @_; - my ($context) = $x->{' mycontext'}; - my ($fn) = $context->{'receiver'}->can('XML_start'); - - push(@{$context->{'tree'}}, undef); - push(@{$context->{'stack'}}, [$context->{'receiver'}, {%attrs}]); - &{$fn}($context->{'receiver'}, $context, $tag, %attrs) if defined $fn; - }, - 'End' => sub { - my ($x, $tag) = @_; - my ($context) = $x->{' mycontext'}; - my ($fn) = $context->{'receiver'}->can('XML_end'); - my ($stackinfo) = pop(@{$context->{'stack'}}); - my ($current, $res); - - $context->{'receiver'} = $stackinfo->[0]; - $context->{'text'} =~ s/^\s*(.*?)\s*$/$1/o; - $res = &{$fn}($context->{'receiver'}, $context, $tag, %{$stackinfo->[1]}) if defined $fn; - $current = pop(@{$context->{'tree'}}); - $current = $context->{'text'} unless (defined $current); - $context->{'text'} = ''; - - if (defined $res) - { - return if ($res eq $context); - $current = $res; - } - return unless $#{$context->{'tree'}} >= 0; - if ($tag eq 'elem') - { - $context->{'tree'}[-1] = [] unless defined $context->{'tree'}[-1]; - push (@{$context->{'tree'}[-1]}, $current); - } else - { - $context->{'tree'}[-1] = {} unless defined $context->{'tree'}[-1]; - $context->{'tree'}[-1]{$tag} = $current; - } - }, - 'Char' => sub { - my ($x, $str) = @_; - $x->{' mycontext'}{'text'} .= $str; - }); - - $xml->{' mycontext'} = $context; - - $context->{'receiver'} = $font; - if (ref $fname) - { return $xml->parse($fname); } - else - { return $xml->parsefile($fname); } -} - - diff --git a/librarian/font-optimizer/ext/Font-TTF/lib/ttfmod.pl b/librarian/font-optimizer/ext/Font-TTF/lib/ttfmod.pl deleted file mode 100644 index dd10f9e..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/lib/ttfmod.pl +++ /dev/null @@ -1,174 +0,0 @@ -# Title: TTFMOD.PL -# Author: M. Hosken -# Description: Read TTF file calling user functions for each table -# and output transformed tables to new TTF file. -# Useage: TTFMOD provides the complete control loop for processing -# the TTF files. All that the caller need supply is an -# associative array of functions to call keyed by the TTF -# table name and the two filenames. -# -# &ttfmod($infile, $outfile, *fns [, @must]); -# -# *fns is an associative array keyed by table name with -# values of the name of the subroutine in package main to -# be called to transfer the table from INFILE to OUTFILE. -# The subroutine is called with the following parameters and -# expected return values: -# -# ($len, $csum) = &sub(*INFILE, *OUTFILE, $len); -# -# INFILE and OUTFILE are the input and output streams, $len -# is the length of the table according to the directory. -# The return values are $len = new length of table to be -# given in the table directory. $csum = new value of table -# checksum. A way to test that this is correct is to -# checksum the whole file (e.g. using CSUM.BAT) and to -# ensure that the value is 0xB1B0AFBA according to a 32 bit -# checksum calculated bigendien. -# -# @must consists of a list of tables which must exist in the -# final output file, either by being there alread or by being -# inserted. -# -# Modifications: -# MJPH 1.00 22-SEP-1994 Original -# MJPH 1.1 18-MAR-1998 Added @must to ttfmod() -# MJPH 1.1.1 25-MAR-1998 Added $csum to copytab (to make reusable) - -package ttfmod; - -sub main'ttfmod { - local($infile, $outfile, *fns, @must) = @_; - - # open files as binary. Notice OUTFILE is opened for update not just write - open(INFILE, "$infile") || die "Unable top open \"$infile\" for reading"; - binmode INFILE; - open(OUTFILE, "+>$outfile") || die "Unable to open \"$outfile\" for writing"; - binmode OUTFILE; - - seek(INFILE, 0, 0); - read(INFILE, $dir_head, 12) || die "Reading table header"; - ($dir_num) = unpack("x4n", $dir_head); - print OUTFILE $dir_head; - # read and unpack table directory - for ($i = 0; $i < $dir_num; $i++) - { - read(INFILE, $dir_val, 16) || die "Reading table entry"; - $dir{unpack("a4", $dir_val)} = join(":", $i, unpack("x4NNN", $dir_val)); - print OUTFILE $dir_val; - printf STDERR "%s %08x\n", unpack("a4", $dir_val), unpack("x8N", $dir_val) - if (defined $main'opt_z); - } - foreach $n (@must) - { - next if defined $dir{$n}; - $dir{$n} = "$i:0:-1:0"; - $i++; $dir_num++; - print OUTFILE pack("a4NNN", $n, 0, -1, 0); - } - substr($dir_head, 4, 2) = pack("n", $dir_num); - $csum = unpack("%32N*", $dir_head); - $off = tell(OUTFILE); - seek(OUTFILE, 0, 0); - print OUTFILE $dir_head; - seek (OUTFILE, $off, 0); - # process tables in order they occur in the file - @dirlist = sort byoffset keys(%dir); - foreach $tab (@dirlist) - { - @tab_split = split(':', $dir{$tab}); - seek(INFILE, $tab_split[2], 0); # offset - $tab_split[2] = tell(OUTFILE); - if (defined $fns{$tab}) - { - $temp = "main'$fns{$tab}"; - ($dir_len, $sum) = &$temp(*INFILE, *OUTFILE, $tab_split[3]); - } - else - { - ($dir_len, $sum) = ©tab(*INFILE, *OUTFILE, $tab_split[3]); - } - $tab_split[3] = $dir_len; # len - $tab_split[1] = $sum; # checksum - $out_dir{$tab} = join(":", @tab_split); - } - # now output directory in same order as original directory - @dirlist = sort byindex keys(%out_dir); - foreach $tab (@dirlist) - { - @tab_split = split(':', $out_dir{$tab}); - seek (OUTFILE, 12 + $tab_split[0] * 16, 0); # directory index - print OUTFILE pack("A4N3", $tab, @tab_split[1..3]); - foreach $i (1..3, 1) # checksum directory values with csum twice - { - $csum += $tab_split[$i]; - # this line ensures $csum stays within 32 bit bounds, clipping as necessary - if ($csum > 0xffffffff) { $csum -= 0xffffffff; $csum--; } - } - # checksum the tag - $csum += unpack("N", $tab); - if ($csum > 0xffffffff) { $csum -= 0xffffffff; $csum--; } - } - # handle main checksum - @tab_split = split(':', $out_dir{"head"}); - seek(OUTFILE, $tab_split[2], 0); - read(OUTFILE, $head_head, 12); # read first bit of "head" table - @head_split = unpack("N3", $head_head); - $tab_split[1] -= $head_split[2]; # subtract old checksum - $csum -= $head_split[2] * 2; # twice because had double effect - # already - if ($csum < 0 ) { $csum += 0xffffffff; $csum++; } - $head_split[2] = 0xB1B0AFBA - $csum; # calculate new checksum - seek (OUTFILE, 12 + $tab_split[0] * 16, 0); - print OUTFILE pack("A4N3", "head", @tab_split[1..3]); - seek (OUTFILE, $tab_split[2], 0); # rewrite first bit of "head" table - print OUTFILE pack("N3", @head_split); - - # finish up - close(OUTFILE); - close(INFILE); - } - -# support function for sorting by table offset -sub byoffset { - @t1 = split(':', $dir{$a}); - @t2 = split(':', $dir{$b}); - return 1 if ($t1[2] == -1); # put inserted tables at the end - return -1 if ($t2[2] == -1); - return $t1[2] <=> $t2[2]; - } - -# support function for sorting by directory entry order -sub byindex { - $t1 = split(':', $dir{$a}, 1); - $t2 = split(':', $dir{$b}, 1); - return $t1 <=> $t2; - } - -# default table action: copies a table from input to output, recalculating -# the checksum (just to be absolutely sure). -sub copytab { - local(*INFILE, *OUTFILE, $len, $csum) = @_; - - while ($len > 0) - { - $count = ($len > 8192) ? 8192 : $len; # 8K buffering - read(INFILE, $buf, $count) == $count || die "Copying"; - $buf .= "\0" x (4 - ($count & 3)) if ($count & 3); # pad to long - print OUTFILE $buf; - $csum += unpack("%32N*", $buf); - if ($csum > 0xffffffff) { $csum -= 0xffffffff; $csum--; } - $len -= $count; - } - ($_[2], $csum); - } - -# test routine to copy file from input to output, no changes -package main; - -if ($test_package) - { - &ttfmod($ARGV[0], $ARGV[1], *dummy); - } -else - { 1; } diff --git a/librarian/font-optimizer/ext/Font-TTF/t/OFL.txt b/librarian/font-optimizer/ext/Font-TTF/t/OFL.txt deleted file mode 100644 index 0b4fe4b..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/t/OFL.txt +++ /dev/null @@ -1,94 +0,0 @@ -Copyright (c) 2005-2007, M. Hosken and SIL International, -with Reserved Font Name FontUtils Test - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/librarian/font-optimizer/ext/Font-TTF/t/tags.t b/librarian/font-optimizer/ext/Font-TTF/t/tags.t deleted file mode 100644 index f50e521..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/t/tags.t +++ /dev/null @@ -1,11 +0,0 @@ -use strict; - -use Test::Simple tests => 3; -use Font::TTF::OTTags qw( %tttags %ttnames readtagsfile); - -ok($tttags{'SCRIPT'}{'Cypriot Syllabary'} eq 'cprt', 'tttags{SCRIPT}'); - -ok($ttnames{'LANGUAGE'}{'AFK '} eq 'Afrikaans', 'ttnames{LANGUAGE}'); - -ok($ttnames{'LANGUAGE'}{'DHV '} eq 'Dhivehi (OBSOLETE)' && $ttnames{'LANGUAGE'}{'DIV '} eq 'Dhivehi', 'ttnames{LANGUAGE} Dhivehi'); - diff --git a/librarian/font-optimizer/ext/Font-TTF/t/testfont.ttf b/librarian/font-optimizer/ext/Font-TTF/t/testfont.ttf deleted file mode 100644 index d1bc3cf..0000000 Binary files a/librarian/font-optimizer/ext/Font-TTF/t/testfont.ttf and /dev/null differ diff --git a/librarian/font-optimizer/ext/Font-TTF/t/ttfcopy.t b/librarian/font-optimizer/ext/Font-TTF/t/ttfcopy.t deleted file mode 100644 index c8969b3..0000000 --- a/librarian/font-optimizer/ext/Font-TTF/t/ttfcopy.t +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/perl - -use Test::Simple tests => 2; -use File::Compare; -use Font::TTF::Font; - -$f = Font::TTF::Font->open("t/testfont.ttf"); -ok($f); -$f->tables_do(sub { $_[0]->read; }); -$f->{'loca'}->glyphs_do(sub {$_[0]->read_dat; }); -$f->out("t/temp.ttf"); -$res = compare("t/temp.ttf", "t/testfont.ttf"); -ok(!$res); -unlink "t/temp.ttf" unless ($res); - diff --git a/librarian/font-optimizer/gen-tests.pl b/librarian/font-optimizer/gen-tests.pl deleted file mode 100644 index 63bb153..0000000 --- a/librarian/font-optimizer/gen-tests.pl +++ /dev/null @@ -1,235 +0,0 @@ -# This script generates various 'interesting' fonts, and outputs an HTML file -# containing the subsetted fonts and the original fonts. -# View the output in browsers (preferably multiple, on multiple platforms) to -# make sure the output looks the same as the original. - -use strict; -use warnings; - -use lib 'ext/Font-TTF/lib'; -use Font::Subsetter; -use Font::EOTWrapper; -use Encode; -use Clone; - -use utf8; - -# The following fonts need to exist in a directory called 'testfonts': -my @all = qw( - GenBasR.ttf - GenR102.TTF - LinLibertine_Re-4.1.8.ttf - DoulosSILR.ttf - DejaVuSans.ttf - DejaVuSerif.ttf - calibri.ttf - FedraSansPro-Demi.ttf -); - -my $index = $ARGV[0]; -die "Run '$0', or '$0 n' where n is the number of the test to rebuild\n" - if defined $index and $index !~ /^\d+$/; - -my @tests = ( - # These aren't proper tests (they drop features that affect the rendering) - # TODO: fix them so they are proper, and test that they're really dropping the - # unneeded glyphs etc -# [ [qw(DejaVuSans.ttf FedraSansPro-Demi.ttf)], ["fluffily لا f"], [20], [qw(aalt ccmp dlig fina hlig init liga locl medi rlig salt kern mark mkmk)] ], -# [ [qw(DejaVuSans.ttf FedraSansPro-Demi.ttf)], ["fluffily لا f"], [20], [qw(liga)] ], -# [ [qw(DejaVuSans.ttf FedraSansPro-Demi.ttf)], ["fluffily لا f"], [20], [qw(fina init rlig)] ], -# [ [qw(DejaVuSans.ttf FedraSansPro-Demi.ttf)], ["fluffily لا f"], [20], [] ], - - # Basic rendering - [ [@all], ["Hello world ABC abc 123"], [20] ], - - # Substitution and NFC issues - [ [qw(GenBasR.ttf DejaVuSans.ttf FedraSansPro-Demi.ttf)], [ - "i", - "\xec", - "i\x{0300}", - "i \x{0300}", - "ixixi", - "i\x{0300}", - ], [20, 8] ], - [ [qw(DejaVuSans.ttf FedraSansPro-Demi.ttf)], [ - "s\x{0323}\x{0307}", # s, combining dot below, combining dot above - "s\x{0307}\x{0323}", # s, combining dot above, combining dot below - "\x{1e61}\x{0323}", # s with dot above, combining dot below - "\x{1e63}\x{0307}", # s with dot below, combining dot above - "\x{212b}", # angstrom - ], [20, 8] ], - - # Ligature rendering - [ [qw(LinLibertine_Re-4.1.8.ttf DejaVuSans.ttf FedraSansPro-Demi.ttf)], [ - "fluffily", - "fluffily", - "fluffily", - ], [20, 8] ], - - # GPOS issues - [ [qw(DejaVuSans.ttf FedraSansPro-Demi.ttf calibri.ttf)], - ["|VAVAV|", "ToToT", "x//x"], [20], ['kern'] ], - - # Lots of stuff - [ [@all], ["VABC(123) fTo fluffiest ffi!\@#,. \x{00e2}\x{00eb}I\x{0303}o\x{0300}u\x{030a}\x{0305}\x{0303} i\x{0331}\x{0301} \x{0d23}\x{0d4d}\x{200d} παρακαλώ хэлло 你好 表示问候 やあ التلفون הלו"], [20, 8] ], - -); - -my $common_css = <preload($fn); - $font_cache{$fn} = $s; - } - return Clone::clone($font_cache{$fn}); -} - -my %std_fonts; -# if (0) { my $j = 0; -for my $j (0..$#all) { - my $fn = $all[$j]; - (my $eot_fn = $fn) =~ s/\.[ot]tf$/.eot/i; - if (not -e "testfonts/$eot_fn") { - Font::EOTWrapper::convert("testfonts/$fn", "testfonts/$eot_fn"); - } - $common_css .= <', 'testoutput/tests.html' or die $!; - binmode $out, ':utf8'; - - print $out < - -Font tests - -EOF -} - -my $i = -1; -for my $test (@tests) { - for my $fn (@{$test->[0]}) { - for my $text (@{$test->[1]}) { - ++$i; - next if defined $index and $index != $i; - - print encode('utf-8', "$fn -- $text\n"); - - (my $text_plain = $text) =~ s/<.*?>//g; - - my $features; - if ($test->[3]) { - $features = { DEFAULT => 0 }; - $features->{$_} = 1 for @{$test->[3]}; - } - - my $s = new_font("testfonts/$fn"); - $s->subset("testfonts/$fn", $text_plain, { features => $features }); - my $path = sprintf '%03d', $i; - $s->write("testoutput/$path.ttf"); - my $old_glyphs = $s->num_glyphs_old; - my $new_glyphs = $s->num_glyphs_new; - my @glyph_names = $s->glyph_names; - $s->release; - - Font::EOTWrapper::convert("testoutput/$path.ttf", "testoutput/$path.eot"); - - my $fragment = < -\@font-face { /* for IE */ - font-family: subsetted-$i; - src: url($path.eot); -} -\@font-face { - font-family: subsetted-$i; - src: url($path.ttf) format("truetype"); -} - -EOF - - for my $size (@{$test->[2]}) { - $fragment .= <$text -
    -$text

    -EOF - } - - print $out qq{\n\n$fragment#} if not defined $index; - - open my $html, '>', "testoutput/$path.html"; - binmode $html, ':utf8'; - print $html < - -Font test $path - -$fragment -EOF - print $html qq{

    }, (join '   ', map "$_", sort @glyph_names), qq{

    }; - print $html qq{
    }, dump_sizes("testoutput/$path.ttf"), qq{
    }; - } - print $out "
    \n" if not defined $index; - } -} - -sub dump_sizes { - my ($fn) = @_; - my $font = Font::TTF::Font->open($fn) or die "Failed to open $fn: $!"; - - my $s = 0; - my $out = ''; - for (sort keys %$font) { - next if /^ /; - my $l = $font->{$_}{' LENGTH'}; - $s += $l; - $out .= "$_: $l\n"; - } - $out .= "Total: $s\n"; - return $out; -} diff --git a/librarian/font-optimizer/list-features.pl b/librarian/font-optimizer/list-features.pl deleted file mode 100755 index 3264a48..0000000 --- a/librarian/font-optimizer/list-features.pl +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -use lib 'ext/Font-TTF/lib'; -use Font::TTF::Font; - -use Getopt::Long; - -main(); - -sub help { - print <open($input_file) or die "Error opening $input_file: $!"; - - my %feats; - my @feats; - for my $table (grep defined, $font->{GPOS}, $font->{GSUB}) { - $table->read; - for my $feature (@{$table->{FEATURES}{FEAT_TAGS}}) { - $feature =~ /^(\w{4})( _\d+)?$/ or die "Unrecognised feature tag syntax '$feature'"; - my $tag = $1; - next if $feats{$tag}++; - push @feats, $tag; - } - } - print map "$_\n", @feats; - - $font->release; -} diff --git a/librarian/font-optimizer/modify-names.pl b/librarian/font-optimizer/modify-names.pl deleted file mode 100755 index 3198bee..0000000 --- a/librarian/font-optimizer/modify-names.pl +++ /dev/null @@ -1,209 +0,0 @@ -#!/usr/bin/perl -CA - # use the -CA flag so @ARGV is interpreted as UTF-8 - -use strict; -use warnings; - -binmode STDOUT, ':utf8'; - -use lib 'ext/Font-TTF/lib'; -use Font::TTF::Font; - -my @name_strings = qw( - copyright - family - subfamily - unique-identifier - full-name - version - postscript - trademark - manufacturer - designer - description - vendor-url - designer-url - license - license-url - RESERVED - preferred-family - preferred-subfamily - compatible-full - sample-text - postscript-cid - wws-family - wws-subfamily -); -my %name_strings; -$name_strings{$name_strings[$_]} = $_ for 0..$#name_strings; - -main(); - -sub help { - print <{name}{strings}[$id]; - my $exists = 0; - for my $plat (0..$#$str) { - next unless $str->[$plat]; - for my $enc (0..$#{$str->[$plat]}) { - next unless $str->[$plat][$enc]; - for my $lang (keys %{$str->[$plat][$enc]}) { - next unless exists $str->[$plat][$enc]{$lang}; - my $val = $sub->($str->[$plat][$enc]{$lang}, $plat, $enc, $lang); - $str->[$plat][$enc]{$lang} = $val; - $exists = 1 - } - } - } - if (not $exists) { - warn "Can't find existing name string '$name_strings[$id]' ($id)\n"; - } -} - - -sub json_string { - my ($str) = @_; - $str =~ s/([\\"])/\\$1/g; - $str =~ s/\r/\\r/g; - $str =~ s/\n/\\n/g; - $str =~ s/\t/\\t/g; - $str =~ s/([\x00-\x1f])/sprintf '\u%04X', ord $1/eg; - return qq{"$str"}; -} - -sub print_names { - my ($font) = @_; - my @lines; - for my $nid (0..$#name_strings) { - my $name = $font->{name}->find_name($nid); - if (length $name) { - push @lines, json_string($name_strings[$nid]).': '.json_string($name); - } - } - - print "{\n"; - print join ",\n\n", @lines; - print "\n}\n"; -} - -sub parse_id { - my ($name) = @_; - if ($name =~ /^\d+$/ and $name < @name_strings) { - return int $name; - } - my $id = $name_strings{lc $name}; - return $id if defined $id; - warn "Invalid name string identifier '$name'\n\n"; - help(); -} - -sub main { - my $verbose = 0; - my $print = 0; - my @commands; - - my @args = @ARGV; - my @rest; - while (@args) { - $_ = shift @args; - if ($_ eq '-v' or $_ eq '--verbose') { - $verbose = 1; - } elsif ($_ eq '-p' or $_ eq '--print') { - $print = 1; - push @commands, [ 'print' ]; - } elsif ($_ eq '--set') { - @args >= 2 or help(); - my $id = parse_id(shift @args); - my $val = shift @args; - push @commands, [ 'set', $id, $val ]; - } elsif ($_ eq '--append') { - @args >= 2 or help(); - my $id = parse_id(shift @args); - my $val = shift @args; - push @commands, [ 'append', $id, $val ]; - } elsif ($_ eq '--subst') { - @args >= 3 or help(); - my $id = parse_id(shift @args); - my $val1 = shift @args; - my $val2 = shift @args; - push @commands, [ 'subst', $id, $val1, $val2 ]; - } else { - push @rest, $_; - } - } - - ($print and (@rest == 1 or @rest == 2)) or @rest == 2 or help(); - - my ($input_file, $output_file) = @rest; - - my $font = Font::TTF::Font->open($input_file) or die "Error opening $input_file: $!"; - - $font->{name}->read; - - for my $cmd (@commands) { - if ($cmd->[0] eq 'print') { - print_names($font); - } elsif ($cmd->[0] eq 'set') { - my $id = $cmd->[1]; - modify_name($font, $id, sub { - my ($val, $plat, $enc, $lang) = @_; - print "Setting string $id (platform=$plat encoding=$enc lang=$lang)\n" if $verbose; - return $cmd->[2]; - }); - } elsif ($cmd->[0] eq 'append') { - my $id = $cmd->[1]; - modify_name($font, $id, sub { - my ($val, $plat, $enc, $lang) = @_; - print "Appending to string $id (platform=$plat encoding=$enc lang=$lang)\n" if $verbose; - return $val . $cmd->[2]; - }); - } elsif ($cmd->[0] eq 'subst') { - my $id = $cmd->[1]; - modify_name($font, $id, sub { - my ($val, $plat, $enc, $lang) = @_; - my $pat = quotemeta($cmd->[2]); - my $n = ($val =~ s/$pat/$cmd->[3]/g) || 0; - print "Substituting string $id (platform=$plat encoding=$enc lang=$lang) - $n match(es)\n" if $verbose; - warn "No match found for substitution on string '$name_strings[$id]'\n" if not $n; - return $val; - }); - } else { - die; - } - } - - $font->out($output_file) if $output_file; - - $font->release; -} diff --git a/librarian/font-optimizer/obfuscate-font.pl b/librarian/font-optimizer/obfuscate-font.pl deleted file mode 100755 index 0850426..0000000 --- a/librarian/font-optimizer/obfuscate-font.pl +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -use lib 'ext/Font-TTF/lib'; -use Font::TTF::Font; - -use Getopt::Long; - -main(); - -sub help { - print <{name}{strings}[$id]; - for my $plat (0..$#$str) { - next unless $str->[$plat]; - for my $enc (0..$#{$str->[$plat]}) { - next unless $str->[$plat][$enc]; - for my $lang (keys %{$str->[$plat][$enc]}) { - next unless exists $str->[$plat][$enc]{$lang}; - if ($verbose) { - print "Setting string $_ (plat $plat, enc $enc) to \"$val\"\n"; - } - $str->[$plat][$enc]{$lang} = $val; - } - } - } -} - -sub strip_names { - my ($font, $verbose) = @_; - - print "Stripping names\n" if $verbose; - - $font->{name}->read; - - for (16, 17, 18) { - if ($verbose and $font->{name}{strings}[$_]) { - print "Deleting string $_\n"; - } - $font->{name}{strings}[$_] = undef; - } - - for (1, 3, 5) { - set_name($font, $_, '', $verbose); - } - - for (4, 6) { - set_name($font, $_, '-', $verbose); - } -} - -sub strip_post { - my ($font, $verbose) = @_; - - print "Stripping post table\n" if $verbose; - - # Replace it with the minimum necessary to work in browsers - # (particularly Opera is a bit fussy) - my $data = pack NNnnNNNNN => 0x10000, 0, 0, 0, 0, 0, 0, 0, 0; - $font->{post} = new Font::TTF::Table(dat => $data); -} - -sub main { - my $verbose = 0; - my $all; - my $names; - my $post; - - my $result = GetOptions( - 'verbose' => \$verbose, - 'all' => \$all, - 'names' => \$names, - 'post' => \$post, - ) or help(); - - @ARGV == 2 or help(); - - if (not ($all or $names or $post)) { help(); } - - my ($input_file, $output_file) = @ARGV; - - my $font = Font::TTF::Font->open($input_file) or die "Error opening $input_file: $!"; - - strip_names($font, $verbose) if $all or $names; - strip_post($font, $verbose) if $all or $post; - - $font->out($output_file); - - $font->release; -} diff --git a/librarian/font-optimizer/subset.pl b/librarian/font-optimizer/subset.pl deleted file mode 100755 index 642fe3d..0000000 --- a/librarian/font-optimizer/subset.pl +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/perl - -# -CA flag is forbidden in #! line -use Encode qw(decode); - @ARGV = map { decode 'utf-8', $_ } @ARGV; - -use strict; -use warnings; - -use lib 'ext/Font-TTF/lib'; -use Font::Subsetter; - -use Getopt::Long; - -main(); - -sub help { - print < \$chars, - 'charsfile=s' => \$charsfile, - 'verbose' => \$verbose, - 'include=s' => \$include, - 'exclude=s' => \$exclude, - 'apply=s' => \$apply, - 'licensesubst=s' => \$license_desc_subst, - ) or help(); - - if (defined $chars and defined $charsfile) { - print "ERROR: Only one of '--chars' and --charsfile' can be specified\n\n"; - help(); - } elsif (defined $chars) { - # just use $chars - } elsif (defined $charsfile) { - open my $f, '<', $charsfile or die "Failed to open $charsfile: $!"; - binmode $f, ':utf8'; - local $/; - $chars = <$f>; - } else { - $chars = 'test'; - } - - @ARGV == 2 or help(); - - my ($input_file, $output_file) = @ARGV; - - - if ($verbose) { - dump_sizes($input_file); - print "Generating subsetted font...\n\n"; - } - - my $features; - if ($include) { - $features = { DEFAULT => 0 }; - $features->{$_} = 1 for split /,/, $include; - } elsif ($exclude) { - $features = { DEFAULT => 1 }; - $features->{$_} = 0 for split /,/, $exclude; - } - - my $fold_features; - if ($apply) { - $fold_features = [ split /,/, $apply ]; - } - - my $subsetter = new Font::Subsetter(); - $subsetter->subset($input_file, $chars, { - features => $features, - fold_features => $fold_features, - license_desc_subst => $license_desc_subst, - }); - $subsetter->write($output_file); - - if ($verbose) { - print "\n"; - print "Features:\n "; - print join ' ', $subsetter->feature_status(); - print "\n\n"; - print "Included glyphs:\n "; - print join ' ', $subsetter->glyph_names(); - print "\n\n"; - dump_sizes($output_file); - } - - $subsetter->release(); -} - -sub dump_sizes { - my ($filename) = @_; - my $font = Font::TTF::Font->open($filename) or die "Failed to open $filename: $!"; - print "TTF table sizes:\n"; - my $s = 0; - for (sort keys %$font) { - next if /^ /; - my $l = $font->{$_}{' LENGTH'}; - $s += $l; - print " $_: $l\n"; - } - print "Total size: $s bytes\n\n"; - $font->release(); -} diff --git a/librarian/font-optimizer/t/subsetter.pl b/librarian/font-optimizer/t/subsetter.pl deleted file mode 100644 index 5cb15df..0000000 --- a/librarian/font-optimizer/t/subsetter.pl +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -use Test::More qw(no_plan); - -use lib 'ext/Font-TTF/lib'; -use Font::Subsetter; -use Unicode::Normalize; - -# Test that we include characters needed for strings converted to NFC -for my $str ( - "i", - "\xec", - "i\x{0300}", - "\x{0300}i", - "\x{03b9}\x{0308}\x{0301}", # iota, combining diaeresis, combining acute - "s\x{0323}\x{0307}", # s, combining dot below, combining dot above - "s\x{0307}\x{0323}", # s, combining dot above, combining dot below - "\x{1e61}\x{0323}", # s with dot above, combining dot below - "\x{1e63}\x{0307}", # s with dot below, combining dot above - "\x{212b}", # angstrom -) { - my $subsetter = new Font::Subsetter; - my %chars = $subsetter->expand_wanted_chars($str); - for (map ord, split //, $str) { - ok($chars{$_}, "char ".(sprintf '%04x', $_)." in string '".(join ' ', map { sprintf '%04x', $_ } unpack 'U*', $str)."'"); - } - for (map ord, split //, Unicode::Normalize::NFC($str)) { - ok($chars{$_}, "NFC char ".(sprintf '%04x', $_)." in string '".(join ' ', map { sprintf '%04x', $_ } unpack 'U*', $str)."'"); - } -} - -# Test that spurious characters aren't included -for my $str ( - "a\xec", -) { - my $subsetter = new Font::Subsetter; - my %chars = $subsetter->expand_wanted_chars($str); - my %exp; - $exp{$_} = 1 for map ord, split //, $str; - $exp{$_} = 1 for map ord, split //, Unicode::Normalize::NFC($str); - for (sort keys %chars) { - ok($exp{$_}, "expected char ".(sprintf '%04x', $_)." from string '".(join ' ', map { sprintf '%04x', $_ } unpack 'U*', $str)."'"); - } -} diff --git a/librarian/fonts/DejaVuSerif-Bold.ttf b/librarian/fonts/DejaVuSerif-Bold.ttf deleted file mode 100644 index 03e1f13..0000000 Binary files a/librarian/fonts/DejaVuSerif-Bold.ttf and /dev/null differ diff --git a/librarian/fonts/DejaVuSerif-BoldItalic.ttf b/librarian/fonts/DejaVuSerif-BoldItalic.ttf deleted file mode 100644 index 1a35350..0000000 Binary files a/librarian/fonts/DejaVuSerif-BoldItalic.ttf and /dev/null differ diff --git a/librarian/fonts/DejaVuSerif-Italic.ttf b/librarian/fonts/DejaVuSerif-Italic.ttf deleted file mode 100644 index e26c4ac..0000000 Binary files a/librarian/fonts/DejaVuSerif-Italic.ttf and /dev/null differ diff --git a/librarian/fonts/DejaVuSerif.ttf b/librarian/fonts/DejaVuSerif.ttf deleted file mode 100644 index 38d9aa0..0000000 Binary files a/librarian/fonts/DejaVuSerif.ttf and /dev/null differ diff --git a/librarian/fonts/JunicodeWL-Italic.ttf b/librarian/fonts/JunicodeWL-Italic.ttf deleted file mode 100644 index f380498..0000000 Binary files a/librarian/fonts/JunicodeWL-Italic.ttf and /dev/null differ diff --git a/librarian/fonts/JunicodeWL-Regular.ttf b/librarian/fonts/JunicodeWL-Regular.ttf deleted file mode 100644 index 24afcdc..0000000 Binary files a/librarian/fonts/JunicodeWL-Regular.ttf and /dev/null differ diff --git a/librarian/functions.py b/librarian/functions.py deleted file mode 100644 index e5a47d6..0000000 --- a/librarian/functions.py +++ /dev/null @@ -1,150 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import unicode_literals - -from lxml import etree -import re - -from librarian.dcparser import Person -from librarian import get_resource - - -def _register_function(f): - """ Register extension function with lxml """ - ns = etree.FunctionNamespace('http://wolnelektury.pl/functions') - ns[f.__name__] = f - - -def reg_substitute_entities(): - entity_substitutions = [ - (u'---', u'—'), - (u'--', u'–'), - (u'...', u'…'), - (u',,', u'„'), - (u'"', u'”'), - ] - - def substitute_entities(context, text): - """XPath extension function converting all entites in passed text.""" - if isinstance(text, list): - text = ''.join(text) - for entity, substitutution in entity_substitutions: - text = text.replace(entity, substitutution) - return text - - _register_function(substitute_entities) - - -def reg_strip(): - def strip(context, text): - """Remove unneeded whitespace from beginning and end""" - if isinstance(text, list): - text = ''.join(text) - return re.sub(r'\s+', ' ', text).strip() - _register_function(strip) - - -def reg_starts_white(): - def starts_white(context, text): - if isinstance(text, list): - text = ''.join(text) - if not text: - return False - return text[0].isspace() - _register_function(starts_white) - - -def reg_ends_white(): - def ends_white(context, text): - if isinstance(text, list): - text = ''.join(text) - if not text: - return False - return text[-1].isspace() - _register_function(ends_white) - - -def reg_wrap_words(): - def wrap_words(context, text, wrapping): - """XPath extension function automatically wrapping words in passed text""" - if isinstance(text, list): - text = ''.join(text) - if not wrapping: - return text - - words = re.split(r'\s', text) - - line_length = 0 - lines = [[]] - for word in words: - line_length += len(word) + 1 - if line_length > wrapping: - # Max line length was exceeded. We create new line - lines.append([]) - line_length = len(word) - lines[-1].append(word) - return '\n'.join(' '.join(line) for line in lines) - _register_function(wrap_words) - - -def reg_person_name(): - def person_name(context, text): - """ Converts "Name, Forename" to "Forename Name" """ - if isinstance(text, list): - text = ''.join(text) - return Person.from_text(text).readable() - _register_function(person_name) - - -def reg_texcommand(): - def texcommand(context, text): - """Remove non-letters""" - if isinstance(text, list): - text = ''.join(text) - return re.sub(r'[^a-zA-Z]', '', text).strip() - _register_function(texcommand) - - -def reg_lang_code_3to2(): - def lang_code_3to2(context, text): - """Convert 3-letter language code to 2-letter code""" - result = '' - text = ''.join(text) - with open(get_resource('res/ISO-639-2_8859-1.txt'), 'rb') as f: - for line in f.read().decode('latin1').split('\n'): - list = line.strip().split('|') - if list[0] == text: - result = list[2] - if result == '': - return text - else: - return result - _register_function(lang_code_3to2) - - -def mathml_latex(context, trees): - from librarian.embeds.mathml import MathML - text = MathML(trees[0]).to_latex().data - # Remove invisible multiplications, they produce unwanted spaces. - text = text.replace(u'\u2062', '') - return text - - -def reg_mathml_latex(): - _register_function(mathml_latex) - - -def reg_mathml_epub(zipf): - from librarian.embeds.mathml import MathML - - def mathml(context, trees): - data = MathML(trees[0]).to_latex().to_png().data - name = "math%d.png" % mathml.count - mathml.count += 1 - zipf.writestr('OPS/' + name, data) - return name - mathml.count = 0 - _register_function(mathml) diff --git a/librarian/html.py b/librarian/html.py deleted file mode 100644 index f8e4a83..0000000 --- a/librarian/html.py +++ /dev/null @@ -1,362 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import print_function, unicode_literals - -import os -import re -import copy - -from lxml import etree -from librarian import XHTMLNS, ParseError, OutputFile -from librarian import functions - -from lxml.etree import XMLSyntaxError, XSLTApplyError -import six - - -functions.reg_substitute_entities() -functions.reg_person_name() - -STYLESHEETS = { - 'legacy': 'xslt/book2html.xslt', - 'full': 'xslt/wl2html_full.xslt', - 'partial': 'xslt/wl2html_partial.xslt' -} - - -def get_stylesheet(name): - return os.path.join(os.path.dirname(__file__), STYLESHEETS[name]) - - -def html_has_content(text): - return etree.ETXPath('//p|//{%(ns)s}p|//h1|//{%(ns)s}h1' % {'ns': str(XHTMLNS)})(text) - - -def transform_abstrakt(abstrakt_element): - style_filename = get_stylesheet('legacy') - style = etree.parse(style_filename) - xml = etree.tostring(abstrakt_element, encoding='unicode') - document = etree.parse(six.StringIO(xml.replace('abstrakt', 'dlugi_cytat'))) # HACK - result = document.xslt(style) - html = re.sub('', '', etree.tostring(result, encoding='unicode')) - return re.sub(']*>', '', html) - - -def transform(wldoc, stylesheet='legacy', options=None, flags=None, css=None): - """Transforms the WL document to XHTML. - - If output_filename is None, returns an XML, - otherwise returns True if file has been written,False if it hasn't. - File won't be written if it has no content. - """ - # Parse XSLT - try: - style_filename = get_stylesheet(stylesheet) - style = etree.parse(style_filename) - - document = copy.deepcopy(wldoc) - del wldoc - document.swap_endlines() - - if flags: - for flag in flags: - document.edoc.getroot().set(flag, 'yes') - - document.clean_ed_note() - document.clean_ed_note('abstrakt') - - if not options: - options = {} - options.setdefault('gallery', "''") - - css = css or 'https://static.wolnelektury.pl/css/compressed/book_text.css' - css = "'%s'" % css - result = document.transform(style, css=css, **options) - del document # no longer needed large object :) - - if html_has_content(result): - add_anchors(result.getroot()) - add_table_of_themes(result.getroot()) - add_table_of_contents(result.getroot()) - - return OutputFile.from_bytes(etree.tostring( - result, method='html', xml_declaration=False, pretty_print=True, encoding='utf-8')) - else: - return None - except KeyError: - raise ValueError("'%s' is not a valid stylesheet.") - except (XMLSyntaxError, XSLTApplyError) as e: - raise ParseError(e) - - -@six.python_2_unicode_compatible -class Fragment(object): - def __init__(self, id, themes): - super(Fragment, self).__init__() - self.id = id - self.themes = themes - self.events = [] - - def append(self, event, element): - self.events.append((event, element)) - - def closed_events(self): - stack = [] - for event, element in self.events: - if event == 'start': - stack.append(('end', element)) - elif event == 'end': - try: - stack.pop() - except IndexError: - print('CLOSED NON-OPEN TAG:', element) - - stack.reverse() - return self.events + stack - - def to_string(self): - result = [] - for event, element in self.closed_events(): - if event == 'start': - result.append(u'<%s %s>' % ( - element.tag, ' '.join('%s="%s"' % (k, v) for k, v in element.attrib.items()))) - if element.text: - result.append(element.text) - elif event == 'end': - result.append(u'' % element.tag) - if element.tail: - result.append(element.tail) - else: - result.append(element) - - return ''.join(result) - - def __str__(self): - return self.to_string() - - -def extract_fragments(input_filename): - """Extracts theme fragments from input_filename.""" - open_fragments = {} - closed_fragments = {} - - # iterparse would die on a HTML document - parser = etree.HTMLParser(encoding='utf-8') - buf = six.BytesIO() - buf.write(etree.tostring(etree.parse(input_filename, parser).getroot()[0][0], encoding='utf-8')) - buf.seek(0) - - for event, element in etree.iterparse(buf, events=('start', 'end')): - # Process begin and end elements - if element.get('class', '') in ('theme-begin', 'theme-end'): - if not event == 'end': - continue # Process elements only once, on end event - - # Open new fragment - if element.get('class', '') == 'theme-begin': - fragment = Fragment(id=element.get('fid'), themes=element.text) - - # Append parents - parent = element.getparent() - parents = [] - while parent.get('id', None) != 'book-text': - cparent = copy.deepcopy(parent) - cparent.text = None - parents.append(cparent) - parent = parent.getparent() - - parents.reverse() - for parent in parents: - fragment.append('start', parent) - - open_fragments[fragment.id] = fragment - - # Close existing fragment - else: - try: - fragment = open_fragments[element.get('fid')] - except KeyError: - print('%s:closed not open fragment #%s' % (input_filename, element.get('fid'))) - else: - closed_fragments[fragment.id] = fragment - del open_fragments[fragment.id] - - # Append element tail to lost_text (we don't want to lose any text) - if element.tail: - for fragment_id in open_fragments: - open_fragments[fragment_id].append('text', element.tail) - - # Process all elements except begin and end - else: - # Omit annotation tags - if (len(element.get('name', '')) or - element.get('class', '') in ('annotation', 'anchor')): - if event == 'end' and element.tail: - for fragment_id in open_fragments: - open_fragments[fragment_id].append('text', element.tail) - else: - for fragment_id in open_fragments: - open_fragments[fragment_id].append(event, copy.copy(element)) - - return closed_fragments, open_fragments - - -def add_anchor(element, prefix, with_link=True, with_target=True, link_text=None): - parent = element.getparent() - index = parent.index(element) - - if with_link: - if link_text is None: - link_text = prefix - anchor = etree.Element('a', href='#%s' % prefix) - anchor.set('class', 'anchor') - anchor.text = six.text_type(link_text) - parent.insert(index, anchor) - - if with_target: - anchor_target = etree.Element('a', name='%s' % prefix) - anchor_target.set('class', 'target') - anchor_target.text = u' ' - parent.insert(index, anchor_target) - - -def any_ancestor(element, test): - for ancestor in element.iterancestors(): - if test(ancestor): - return True - return False - - -def add_anchors(root): - counter = 1 - for element in root.iterdescendants(): - def f(e): - return e.get('class') in ('note', 'motto', 'motto_podpis', 'dedication', 'frame') or \ - e.get('id') == 'nota_red' or e.tag == 'blockquote' - if any_ancestor(element, f): - continue - - if element.tag == 'div' and 'verse' in element.get('class', ''): - if counter == 1 or counter % 5 == 0: - add_anchor(element, "f%d" % counter, link_text=counter) - counter += 1 - elif 'paragraph' in element.get('class', ''): - add_anchor(element, "f%d" % counter, link_text=counter) - counter += 1 - - -def raw_printable_text(element): - working = copy.deepcopy(element) - for e in working.findall('a'): - if e.get('class') in ('annotation', 'theme-begin'): - e.text = '' - return etree.tostring(working, method='text', encoding='unicode').strip() - - -def add_table_of_contents(root): - sections = [] - counter = 1 - for element in root.iterdescendants(): - if element.tag in ('h2', 'h3'): - if any_ancestor(element, - lambda e: e.get('id') in ('footnotes', 'nota_red') or e.get('class') in ('person-list',)): - continue - - element_text = raw_printable_text(element) - if element.tag == 'h3' and len(sections) and sections[-1][1] == 'h2': - sections[-1][3].append((counter, element.tag, element_text, [])) - else: - sections.append((counter, element.tag, element_text, [])) - add_anchor(element, "s%d" % counter, with_link=False) - counter += 1 - - toc = etree.Element('div') - toc.set('id', 'toc') - toc_header = etree.SubElement(toc, 'h2') - toc_header.text = u'Spis treści' - toc_list = etree.SubElement(toc, 'ol') - - for n, section, text, subsections in sections: - section_element = etree.SubElement(toc_list, 'li') - add_anchor(section_element, "s%d" % n, with_target=False, link_text=text) - - if len(subsections): - subsection_list = etree.SubElement(section_element, 'ol') - for n1, subsection, subtext, _ in subsections: - subsection_element = etree.SubElement(subsection_list, 'li') - add_anchor(subsection_element, "s%d" % n1, with_target=False, link_text=subtext) - - root.insert(0, toc) - - -def add_table_of_themes(root): - try: - from sortify import sortify - except ImportError: - def sortify(x): - return x - - book_themes = {} - for fragment in root.findall('.//a[@class="theme-begin"]'): - if not fragment.text: - continue - theme_names = [s.strip() for s in fragment.text.split(',')] - for theme_name in theme_names: - book_themes.setdefault(theme_name, []).append(fragment.get('name')) - book_themes = list(book_themes.items()) - book_themes.sort(key=lambda s: sortify(s[0])) - themes_div = etree.Element('div', id="themes") - themes_ol = etree.SubElement(themes_div, 'ol') - for theme_name, fragments in book_themes: - themes_li = etree.SubElement(themes_ol, 'li') - themes_li.text = "%s: " % theme_name - for i, fragment in enumerate(fragments): - item = etree.SubElement(themes_li, 'a', href="#%s" % fragment) - item.text = str(i + 1) - item.tail = ' ' - root.insert(0, themes_div) - - -def extract_annotations(html_path): - """Extracts annotations from HTML for annotations dictionary. - - For each annotation, yields a tuple of: - anchor, footnote type, valid qualifiers, text, html. - - """ - from .fn_qualifiers import FN_QUALIFIERS - - parser = etree.HTMLParser(encoding='utf-8') - tree = etree.parse(html_path, parser) - footnotes = tree.find('//*[@id="footnotes"]') - re_qualifier = re.compile(r'[^\u2014]+\s+\(([^\)]+)\)\s+\u2014') - if footnotes is not None: - for footnote in footnotes.findall('div'): - fn_type = footnote.get('class').split('-')[1] - anchor = footnote.find('a[@class="annotation"]').get('href')[1:] - del footnote[:2] - footnote.text = None - if len(footnote) and footnote[-1].tail == '\n': - footnote[-1].tail = None - text_str = etree.tostring(footnote, method='text', encoding='unicode').strip() - html_str = etree.tostring(footnote, method='html', encoding='unicode').strip() - - match = re_qualifier.match(text_str) - if match: - qualifier_str = match.group(1) - qualifiers = [] - for candidate in re.split('[;,]', qualifier_str): - candidate = candidate.strip() - if candidate in FN_QUALIFIERS: - qualifiers.append(candidate) - elif candidate.startswith('z '): - subcandidate = candidate.split()[1] - if subcandidate in FN_QUALIFIERS: - qualifiers.append(subcandidate) - else: - qualifiers = [] - - yield anchor, fn_type, qualifiers, text_str, html_str diff --git a/librarian/hyphenator.py b/librarian/hyphenator.py deleted file mode 100644 index aa5b4c3..0000000 --- a/librarian/hyphenator.py +++ /dev/null @@ -1,240 +0,0 @@ -""" - -This is a Pure Python module to hyphenate text. - -It is inspired by Ruby's Text::Hyphen, but currently reads standard *.dic files, -that must be installed separately. - -In the future it's maybe nice if dictionaries could be distributed together with -this module, in a slightly prepared form, like in Ruby's Text::Hyphen. - -Wilbert Berendsen, March 2008 -info@wilbertberendsen.nl - -License: LGPL. - -""" -from __future__ import print_function, unicode_literals - -import sys -import re - -__all__ = ("Hyphenator") - -# cache of per-file Hyph_dict objects -hdcache = {} - -# precompile some stuff -parse_hex = re.compile(r'\^{2}([0-9a-f]{2})').sub -parse = re.compile(r'(\d?)(\D?)').findall - -def hexrepl(matchObj): - return unichr(int(matchObj.group(1), 16)) - - -class parse_alt(object): - """ - Parse nonstandard hyphen pattern alternative. - The instance returns a special int with data about the current position - in the pattern when called with an odd value. - """ - def __init__(self, pat, alt): - alt = alt.split(',') - self.change = alt[0] - if len(alt) > 2: - self.index = int(alt[1]) - self.cut = int(alt[2]) + 1 - else: - self.index = 1 - self.cut = len(re.sub(r'[\d\.]', '', pat)) + 1 - if pat.startswith('.'): - self.index += 1 - - def __call__(self, val): - self.index -= 1 - val = int(val) - if val & 1: - return dint(val, (self.change, self.index, self.cut)) - else: - return val - - -class dint(int): - """ - Just an int some other data can be stuck to in a data attribute. - Call with ref=other to use the data from the other dint. - """ - def __new__(cls, value, data=None, ref=None): - obj = int.__new__(cls, value) - if ref and type(ref) == dint: - obj.data = ref.data - else: - obj.data = data - return obj - - -class Hyph_dict(object): - """ - Reads a hyph_*.dic file and stores the hyphenation patterns. - Parameters: - -filename : filename of hyph_*.dic to read - """ - def __init__(self, filename): - self.patterns = {} - f = open(filename) - charset = f.readline().strip() - if charset.startswith('charset '): - charset = charset[8:].strip() - - for pat in f: - pat = pat.decode(charset).strip() - if not pat or pat[0] == '%': continue - # replace ^^hh with the real character - pat = parse_hex(hexrepl, pat) - # read nonstandard hyphen alternatives - if '/' in pat: - pat, alt = pat.split('/', 1) - factory = parse_alt(pat, alt) - else: - factory = int - tag, value = zip(*[(s, factory(i or "0")) for i, s in parse(pat)]) - # if only zeros, skip this pattern - if max(value) == 0: continue - # chop zeros from beginning and end, and store start offset. - start, end = 0, len(value) - while not value[start]: start += 1 - while not value[end-1]: end -= 1 - self.patterns[''.join(tag)] = start, value[start:end] - f.close() - self.cache = {} - self.maxlen = max(map(len, self.patterns.keys())) - - def positions(self, word): - """ - Returns a list of positions where the word can be hyphenated. - E.g. for the dutch word 'lettergrepen' this method returns - the list [3, 6, 9]. - - Each position is a 'data int' (dint) with a data attribute. - If the data attribute is not None, it contains a tuple with - information about nonstandard hyphenation at that point: - (change, index, cut) - - change: is a string like 'ff=f', that describes how hyphenation - should take place. - index: where to substitute the change, counting from the current - point - cut: how many characters to remove while substituting the nonstandard - hyphenation - """ - word = word.lower() - points = self.cache.get(word) - if points is None: - prepWord = '.%s.' % word - res = [0] * (len(prepWord) + 1) - for i in range(len(prepWord) - 1): - for j in range(i + 1, min(i + self.maxlen, len(prepWord)) + 1): - p = self.patterns.get(prepWord[i:j]) - if p: - offset, value = p - s = slice(i + offset, i + offset + len(value)) - res[s] = map(max, value, res[s]) - - points = [dint(i - 1, ref=r) for i, r in enumerate(res) if r % 2] - self.cache[word] = points - return points - - -class Hyphenator(object): - """ - Reads a hyph_*.dic file and stores the hyphenation patterns. - Provides methods to hyphenate strings in various ways. - Parameters: - -filename : filename of hyph_*.dic to read - -left: make the first syllabe not shorter than this - -right: make the last syllabe not shorter than this - -cache: if true (default), use a cached copy of the dic file, if possible - - left and right may also later be changed: - h = Hyphenator(file) - h.left = 1 - """ - def __init__(self, filename, left=2, right=2, cache=True): - self.left = left - self.right = right - if not cache or filename not in hdcache: - hdcache[filename] = Hyph_dict(filename) - self.hd = hdcache[filename] - - def positions(self, word): - """ - Returns a list of positions where the word can be hyphenated. - See also Hyph_dict.positions. The points that are too far to - the left or right are removed. - """ - right = len(word) - self.right - return [i for i in self.hd.positions(word) if self.left <= i <= right] - - def iterate(self, word): - """ - Iterate over all hyphenation possibilities, the longest first. - """ - if isinstance(word, str): - word = word.decode('latin1') - for p in reversed(self.positions(word)): - if p.data: - # get the nonstandard hyphenation data - change, index, cut = p.data - if word.isupper(): - change = change.upper() - c1, c2 = change.split('=') - yield word[:p+index] + c1, c2 + word[p+index+cut:] - else: - yield word[:p], word[p:] - - def wrap(self, word, width, hyphen='-'): - """ - Return the longest possible first part and the last part of the - hyphenated word. The first part has the hyphen already attached. - Returns None, if there is no hyphenation point before width, or - if the word could not be hyphenated. - """ - width -= len(hyphen) - for w1, w2 in self.iterate(word): - if len(w1) <= width: - return w1 + hyphen, w2 - - def inserted(self, word, hyphen='-'): - """ - Returns the word as a string with all the possible hyphens inserted. - E.g. for the dutch word 'lettergrepen' this method returns - the string 'let-ter-gre-pen'. The hyphen string to use can be - given as the second parameter, that defaults to '-'. - """ - if isinstance(word, str): - word = word.decode('latin1') - l = list(word) - for p in reversed(self.positions(word)): - if p.data: - # get the nonstandard hyphenation data - change, index, cut = p.data - if word.isupper(): - change = change.upper() - l[p + index : p + index + cut] = change.replace('=', hyphen) - else: - l.insert(p, hyphen) - return ''.join(l) - - __call__ = iterate - - -if __name__ == "__main__": - - dict_file = sys.argv[1] - word = sys.argv[2].decode('latin1') - - h = Hyphenator(dict_file, left=1, right=1) - - for i in h(word): - print(i) - diff --git a/librarian/mobi.py b/librarian/mobi.py deleted file mode 100644 index 6f1f5d6..0000000 --- a/librarian/mobi.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import unicode_literals - -from copy import deepcopy -import os -import subprocess -from tempfile import NamedTemporaryFile - -from librarian import OutputFile - - -def transform(wldoc, verbose=False, sample=None, cover=None, - use_kindlegen=False, flags=None, hyphenate=True, ilustr_path='', - converter_path=None): - """ produces a MOBI file - - wldoc: a WLDocument - sample=n: generate sample e-book (with at least n paragraphs) - cover: a cover.Cover factory overriding default - flags: less-advertising, - converter_path: override path to MOBI converter, - either ebook-convert or kindlegen - """ - - document = deepcopy(wldoc) - del wldoc - - epub = document.as_epub(verbose=verbose, sample=sample, - html_toc=True, cover=cover or True, flags=flags, - hyphenate=hyphenate, ilustr_path=ilustr_path, output_type='mobi') - if verbose: - kwargs = {} - else: - devnull = open("/dev/null", 'w') - kwargs = {"stdout": devnull, "stderr": devnull} - - output_file = NamedTemporaryFile(prefix='librarian', suffix='.mobi', - delete=False) - output_file.close() - - if use_kindlegen: - output_file_basename = os.path.basename(output_file.name) - subprocess.check_call([converter_path or 'kindlegen', - '-c2', epub.get_filename(), - '-o', output_file_basename], **kwargs) - else: - subprocess.check_call([converter_path or 'ebook-convert', - epub.get_filename(), - output_file.name, '--no-inline-toc', - '--mobi-file-type=both', - '--mobi-ignore-margins'], **kwargs) - return OutputFile.from_filename(output_file.name) diff --git a/librarian/packagers.py b/librarian/packagers.py deleted file mode 100644 index b3f5548..0000000 --- a/librarian/packagers.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import print_function, unicode_literals - -import os -from librarian import pdf, epub, mobi, DirDocProvider, ParseError -from librarian.parser import WLDocument - -from .util import makedirs - - -class Packager(object): - cover = None - flags = None - - @classmethod - def transform(cls, *args, **kwargs): - return cls.converter.transform(*args, **kwargs) - - @classmethod - def prepare_file(cls, main_input, output_dir, verbose=False, overwrite=False): - path, fname = os.path.realpath(main_input).rsplit('/', 1) - provider = DirDocProvider(path) - slug, ext = os.path.splitext(fname) - - if output_dir != '': - makedirs(output_dir) - outfile = os.path.join(output_dir, slug + '.' + cls.ext) - if os.path.exists(outfile) and not overwrite: - return - - doc = WLDocument.from_file(main_input, provider=provider) - output_file = cls.transform(doc, cover=cls.cover, flags=cls.flags) - doc.save_output_file(output_file, output_path=outfile) - - @classmethod - def prepare(cls, input_filenames, output_dir='', verbose=False, overwrite=False): - try: - for main_input in input_filenames: - if verbose: - print(main_input) - cls.prepare_file(main_input, output_dir, verbose, overwrite) - except ParseError as e: - print('%(file)s:%(name)s:%(message)s' % { - 'file': main_input, - 'name': e.__class__.__name__, - 'message': e.message - }) - - -class EpubPackager(Packager): - converter = epub - ext = 'epub' - - -class MobiPackager(Packager): - converter = mobi - ext = 'mobi' - - -class PdfPackager(Packager): - converter = pdf - ext = 'pdf' - - @classmethod - def transform(cls, *args, **kwargs): - return cls.converter.transform(*args, morefloats='new', **kwargs) diff --git a/librarian/parser.py b/librarian/parser.py deleted file mode 100644 index efe6e95..0000000 --- a/librarian/parser.py +++ /dev/null @@ -1,232 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import unicode_literals - -from librarian import ValidationError, NoDublinCore, ParseError, NoProvider -from librarian import RDFNS -from librarian.cover import make_cover -from librarian import dcparser - -from xml.parsers.expat import ExpatError -from lxml import etree -from lxml.etree import XMLSyntaxError, XSLTApplyError - -import os -import re -import six - - -class WLDocument(object): - LINE_SWAP_EXPR = re.compile(r'/\s', re.MULTILINE | re.UNICODE) - provider = None - - def __init__(self, edoc, parse_dublincore=True, provider=None, - strict=False, meta_fallbacks=None): - self.edoc = edoc - self.provider = provider - - root_elem = edoc.getroot() - - dc_path = './/' + RDFNS('RDF') - - if root_elem.tag != 'utwor': - raise ValidationError("Invalid root element. Found '%s', should be 'utwor'" % root_elem.tag) - - if parse_dublincore: - self.rdf_elem = root_elem.find(dc_path) - - if self.rdf_elem is None: - raise NoDublinCore("Document must have a '%s' element." % RDFNS('RDF')) - - self.book_info = dcparser.BookInfo.from_element( - self.rdf_elem, fallbacks=meta_fallbacks, strict=strict) - else: - self.book_info = None - - @classmethod - def from_bytes(cls, xml, *args, **kwargs): - return cls.from_file(six.BytesIO(xml), *args, **kwargs) - - @classmethod - def from_file(cls, xmlfile, *args, **kwargs): - - # first, prepare for parsing - if isinstance(xmlfile, six.text_type): - file = open(xmlfile, 'rb') - try: - data = file.read() - finally: - file.close() - else: - data = xmlfile.read() - - if not isinstance(data, six.text_type): - data = data.decode('utf-8') - - data = data.replace(u'\ufeff', '') - - try: - parser = etree.XMLParser(remove_blank_text=False) - tree = etree.parse(six.BytesIO(data.encode('utf-8')), parser) - - return cls(tree, *args, **kwargs) - except (ExpatError, XMLSyntaxError, XSLTApplyError) as e: - raise ParseError(e) - - def swap_endlines(self): - """Converts line breaks in stanzas into
    tags.""" - # only swap inside stanzas - for elem in self.edoc.iter('strofa'): - for child in list(elem): - if child.tail: - chunks = self.LINE_SWAP_EXPR.split(child.tail) - ins_index = elem.index(child) + 1 - while len(chunks) > 1: - ins = etree.Element('br') - ins.tail = chunks.pop() - elem.insert(ins_index, ins) - child.tail = chunks.pop(0) - if elem.text: - chunks = self.LINE_SWAP_EXPR.split(elem.text) - while len(chunks) > 1: - ins = etree.Element('br') - ins.tail = chunks.pop() - elem.insert(0, ins) - elem.text = chunks.pop(0) - - def parts(self): - if self.provider is None: - raise NoProvider('No document provider supplied.') - if self.book_info is None: - raise NoDublinCore('No Dublin Core in document.') - for part_uri in self.book_info.parts: - yield self.from_file(self.provider.by_uri(part_uri), provider=self.provider) - - def chunk(self, path): - # convert the path to XPath - expr = self.path_to_xpath(path) - elems = self.edoc.xpath(expr) - - if len(elems) == 0: - return None - else: - return elems[0] - - def path_to_xpath(self, path): - parts = [] - - for part in path.split('/'): - match = re.match(r'([^\[]+)\[(\d+)\]', part) - if not match: - parts.append(part) - else: - tag, n = match.groups() - parts.append("*[%d][name() = '%s']" % (int(n)+1, tag)) - - if parts[0] == '.': - parts[0] = '' - - return '/'.join(parts) - - def transform(self, stylesheet, **options): - return self.edoc.xslt(stylesheet, **options) - - def update_dc(self): - if self.book_info: - parent = self.rdf_elem.getparent() - parent.replace(self.rdf_elem, self.book_info.to_etree(parent)) - - def serialize(self): - self.update_dc() - return etree.tostring(self.edoc, encoding='unicode', pretty_print=True) - - def merge_chunks(self, chunk_dict): - unmerged = [] - - for key, data in chunk_dict.iteritems(): - try: - xpath = self.path_to_xpath(key) - node = self.edoc.xpath(xpath)[0] - repl = etree.fromstring(u"<%s>%s" % (node.tag, data, node.tag)) - node.getparent().replace(node, repl) - except Exception as e: - unmerged.append(repr((key, xpath, e))) - - return unmerged - - def clean_ed_note(self, note_tag='nota_red'): - """ deletes forbidden tags from nota_red """ - - for node in self.edoc.xpath('|'.join('//%s//%s' % (note_tag, tag) for tag in - ('pa', 'pe', 'pr', 'pt', 'begin', 'end', 'motyw'))): - tail = node.tail - node.clear() - node.tag = 'span' - node.tail = tail - - def editors(self): - """Returns a set of all editors for book and its children. - - :returns: set of dcparser.Person objects - """ - if self.book_info is None: - raise NoDublinCore('No Dublin Core in document.') - persons = set(self.book_info.editors + self.book_info.technical_editors) - for child in self.parts(): - persons.update(child.editors()) - if None in persons: - persons.remove(None) - return persons - - # Converters - - def as_html(self, *args, **kwargs): - from librarian import html - return html.transform(self, *args, **kwargs) - - def as_text(self, *args, **kwargs): - from librarian import text - return text.transform(self, *args, **kwargs) - - def as_epub(self, *args, **kwargs): - from librarian import epub - return epub.transform(self, *args, **kwargs) - - def as_pdf(self, *args, **kwargs): - from librarian import pdf - return pdf.transform(self, *args, **kwargs) - - def as_mobi(self, *args, **kwargs): - from librarian import mobi - return mobi.transform(self, *args, **kwargs) - - def as_fb2(self, *args, **kwargs): - from librarian import fb2 - return fb2.transform(self, *args, **kwargs) - - def as_cover(self, cover_class=None, *args, **kwargs): - if cover_class is None: - cover_class = make_cover - return cover_class(self.book_info, *args, **kwargs).output_file() - - # for debugging only - def latex_dir(self, *args, **kwargs): - kwargs['latex_dir'] = True - from librarian import pdf - return pdf.transform(self, *args, **kwargs) - - def save_output_file(self, output_file, output_path=None, output_dir_path=None, make_author_dir=False, ext=None): - if output_dir_path: - save_path = output_dir_path - if make_author_dir: - save_path = os.path.join(save_path, six.text_type(self.book_info.author).encode('utf-8')) - save_path = os.path.join(save_path, self.book_info.url.slug) - if ext: - save_path += '.%s' % ext - else: - save_path = output_path - - output_file.save_as(save_path) diff --git a/librarian/partners.py b/librarian/partners.py deleted file mode 100644 index 671cf4d..0000000 --- a/librarian/partners.py +++ /dev/null @@ -1,123 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# - -""" -Classes for packaging ebooks for some old partners. -These should be removed from librarian to separate package, -along with custom cover images etc. - -New partners shouldn't be added here, but in the partners repository. -""" -from __future__ import print_function, unicode_literals - -from librarian import packagers, cover -from .util import makedirs - - -class GandalfEpub(packagers.EpubPackager): - cover = cover.GandalfCover - - -class GandalfPdf(packagers.PdfPackager): - cover = cover.GandalfCover - - -class BookotekaEpub(packagers.EpubPackager): - cover = cover.BookotekaCover - - -class PrestigioEpub(packagers.EpubPackager): - cover = cover.PrestigioCover - flags = ('less-advertising',) - - -class PrestigioPdf(packagers.PdfPackager): - cover = cover.PrestigioCover - flags = ('less-advertising',) - - -class Virtualo(packagers.Packager): - @staticmethod - def utf_trunc(text, limit): - """ truncates text to at most `limit' bytes in utf-8 """ - if text is None: - return text - if len(text.encode('utf-8')) > limit: - newlimit = limit - 3 - while len(text.encode('utf-8')) > newlimit: - text = text[:(newlimit - len(text.encode('utf-8'))) / 4] - text += '...' - return text - - @classmethod - def prepare(cls, input_filenames, output_dir='', verbose=False): - from lxml import etree - from librarian import DirDocProvider, ParseError - from librarian.parser import WLDocument - from copy import deepcopy - import os.path - - xml = etree.fromstring(""" - """) - product = etree.fromstring(""" - - - - - - - Jan - Kowalski - - - 0.0 - PL - """) - - try: - for main_input in input_filenames: - if verbose: - print(main_input) - path, fname = os.path.realpath(main_input).rsplit('/', 1) - provider = DirDocProvider(path) - slug, ext = os.path.splitext(fname) - - outfile_dir = os.path.join(output_dir, slug) - makedirs(os.path.join(output_dir, slug)) - - doc = WLDocument.from_file(main_input, provider=provider) - info = doc.book_info - - product_elem = deepcopy(product) - product_elem[0].text = cls.utf_trunc(slug, 100) - product_elem[1].text = cls.utf_trunc(info.title, 255) - product_elem[2].text = cls.utf_trunc(info.description, 255) - product_elem[3].text = cls.utf_trunc(info.source_name, 3000) - product_elem[4][0][0].text = cls.utf_trunc(u' '.join(info.author.first_names), 100) - product_elem[4][0][1].text = cls.utf_trunc(info.author.last_name, 100) - xml.append(product_elem) - - cover.VirtualoCover(info).save(os.path.join(outfile_dir, slug+'.jpg')) - outfile = os.path.join(outfile_dir, '1.epub') - outfile_sample = os.path.join(outfile_dir, '1.sample.epub') - doc.save_output_file(doc.as_epub(), output_path=outfile) - doc.save_output_file(doc.as_epub(doc, sample=25), output_path=outfile_sample) - outfile = os.path.join(outfile_dir, '1.mobi') - outfile_sample = os.path.join(outfile_dir, '1.sample.mobi') - doc.save_output_file(doc.as_mobi(cover=cover.VirtualoCover), output_path=outfile) - doc.save_output_file( - doc.as_mobi(doc, cover=cover.VirtualoCover, sample=25), - output_path=outfile_sample) - except ParseError as e: - print('%(file)s:%(name)s:%(message)s' % { - 'file': main_input, - 'name': e.__class__.__name__, - 'message': e.message - }) - - xml_file = open(os.path.join(output_dir, 'import_products.xml'), 'w') - xml_file.write(etree.tostring(xml, pretty_print=True, encoding='unicode').encode('utf-8')) - xml_file.close() diff --git a/librarian/pdf.py b/librarian/pdf.py deleted file mode 100644 index e6d897d..0000000 --- a/librarian/pdf.py +++ /dev/null @@ -1,378 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -"""PDF creation library. - -Creates one big XML from the book and its children, converts it to LaTeX -with TeXML, then runs it by XeLaTeX. - -""" -from __future__ import print_function, unicode_literals - -import os -import os.path -import shutil -from tempfile import mkdtemp, NamedTemporaryFile -import re -from copy import deepcopy -from subprocess import call, PIPE -from itertools import chain - -from Texml.processor import process -from lxml import etree -from lxml.etree import XMLSyntaxError, XSLTApplyError -import six - -from librarian.dcparser import Person -from librarian.parser import WLDocument -from librarian import ParseError, DCNS, get_resource, OutputFile, RDFNS -from librarian import functions -from librarian.cover import make_cover -from .sponsor import sponsor_logo - - -functions.reg_substitute_entities() -functions.reg_strip() -functions.reg_starts_white() -functions.reg_ends_white() -functions.reg_texcommand() - -STYLESHEETS = { - 'wl2tex': 'pdf/wl2tex.xslt', -} - -# CUSTOMIZATIONS = [ -# 'nofootnotes', -# 'nothemes', -# 'defaultleading', -# 'onehalfleading', -# 'doubleleading', -# 'nowlfont', -# ] - - -def insert_tags(doc, split_re, tagname, exclude=None): - """ inserts for every occurence of `split_re' in text nodes in the `doc' tree - - >>> t = etree.fromstring('
    A-B-CX-Y-Z') - >>> insert_tags(t, re.compile('-'), 'd') - >>> print(etree.tostring(t, encoding='unicode')) - ABCXYZ - """ - - for elem in doc.iter(tag=etree.Element): - if exclude and elem.tag in exclude: - continue - if elem.text: - chunks = split_re.split(elem.text) - while len(chunks) > 1: - ins = etree.Element(tagname) - ins.tail = chunks.pop() - elem.insert(0, ins) - elem.text = chunks.pop(0) - if elem.tail: - chunks = split_re.split(elem.tail) - parent = elem.getparent() - ins_index = parent.index(elem) + 1 - while len(chunks) > 1: - ins = etree.Element(tagname) - ins.tail = chunks.pop() - parent.insert(ins_index, ins) - elem.tail = chunks.pop(0) - - -def substitute_hyphens(doc): - insert_tags(doc, - re.compile("(?<=[^-\s])-(?=[^-\s])"), - "dywiz", - exclude=[DCNS("identifier.url"), DCNS("rights.license"), "meta"] - ) - - -def fix_hanging(doc): - insert_tags(doc, - re.compile("(?<=\s\w)\s+"), - "nbsp", - exclude=[DCNS("identifier.url"), DCNS("rights.license")] - ) - - -def fix_tables(doc): - for kol in doc.iter(tag='kol'): - if kol.tail is not None: - if not kol.tail.strip(): - kol.tail = None - for table in chain(doc.iter(tag='tabela'), doc.iter(tag='tabelka')): - if table.get('ramka') == '1' or table.get('ramki') == '1': - table.set('_format', '|' + 'X|' * len(table[0])) - else: - table.set('_format', 'X' * len(table[0])) - - -def mark_subauthors(doc): - root_author = ', '.join(elem.text for elem in doc.findall('./' + RDFNS('RDF') + '//' + DCNS('creator_parsed'))) - last_author = None - # jeśli autor jest inny niż autor całości i niż poprzedni autor - # to wstawiamy jakiś znacznik w rdf? - for subutwor in doc.xpath('/utwor/utwor'): - author = ', '.join(elem.text for elem in subutwor.findall('.//' + DCNS('creator_parsed'))) - if author not in (last_author, root_author): - subutwor.find('.//' + RDFNS('RDF')).append(etree.Element('use_subauthor')) - last_author = author - - -def move_motifs_inside(doc): - """ moves motifs to be into block elements """ - for master in doc.xpath('//powiesc|//opowiadanie|//liryka_l|//liryka_lp|' - '//dramat_wierszowany_l|//dramat_wierszowany_lp|//dramat_wspolczesny'): - for motif in master.xpath('motyw'): - for sib in motif.itersiblings(): - if sib.tag not in ('sekcja_swiatlo', 'sekcja_asterysk', 'separator_linia', - 'begin', 'end', 'motyw', 'extra', 'uwaga'): - # motif shouldn't have a tail - it would be untagged text - motif.tail = None - motif.getparent().remove(motif) - sib.insert(0, motif) - break - - -def hack_motifs(doc): - """ dirty hack for the marginpar-creates-orphans LaTeX problem - see http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/2304 - - moves motifs in stanzas from first verse to second - and from next to last to last, then inserts negative vspace before them - """ - for motif in doc.findall('//strofa//motyw'): - # find relevant verse-level tag - verse, stanza = motif, motif.getparent() - while stanza is not None and stanza.tag != 'strofa': - verse, stanza = stanza, stanza.getparent() - breaks_before = sum(1 for i in verse.itersiblings('br', preceding=True)) - breaks_after = sum(1 for i in verse.itersiblings('br')) - if (breaks_before == 0 and breaks_after > 0) or breaks_after == 1: - move_by = 1 - if breaks_after == 2: - move_by += 1 - moved_motif = deepcopy(motif) - motif.tag = 'span' - motif.text = None - moved_motif.tail = None - moved_motif.set('moved', str(move_by)) - - for br in verse.itersiblings('br'): - if move_by > 1: - move_by -= 1 - continue - br.addnext(moved_motif) - break - - -def parse_creator(doc): - """Generates readable versions of creator and translator tags. - - Finds all dc:creator and dc.contributor.translator tags - and adds *_parsed versions with forenames first. - """ - for person in doc.xpath("|".join('//dc:' + tag for tag in ('creator', 'contributor.translator')), - namespaces={'dc': str(DCNS)})[::-1]: - if not person.text: - continue - p = Person.from_text(person.text) - person_parsed = deepcopy(person) - person_parsed.tag = person.tag + '_parsed' - person_parsed.set('sortkey', person.text) - person_parsed.text = p.readable() - person.getparent().insert(0, person_parsed) - - -def get_stylesheet(name): - return get_resource(STYLESHEETS[name]) - - -def package_available(package, args='', verbose=False): - """ check if a verion of a latex package accepting given args is available """ - tempdir = mkdtemp('-wl2pdf-test') - fpath = os.path.join(tempdir, 'test.tex') - f = open(fpath, 'w') - f.write(""" - \\documentclass{wl} - \\usepackage[%s]{%s} - \\begin{document} - \\end{document} - """ % (args, package)) - f.close() - if verbose: - p = call(['xelatex', '-output-directory', tempdir, fpath]) - else: - p = call(['xelatex', '-interaction=batchmode', '-output-directory', tempdir, fpath], stdout=PIPE, stderr=PIPE) - shutil.rmtree(tempdir) - return p == 0 - - -def transform(wldoc, verbose=False, save_tex=None, morefloats=None, - cover=None, flags=None, customizations=None, ilustr_path='', latex_dir=False): - """ produces a PDF file with XeLaTeX - - wldoc: a WLDocument - verbose: prints all output from LaTeX - save_tex: path to save the intermediary LaTeX file to - morefloats (old/new/none): force specific morefloats - cover: a cover.Cover factory or True for default - flags: less-advertising, - customizations: user requested customizations regarding various formatting parameters (passed to wl LaTeX class) - """ - - # Parse XSLT - try: - book_info = wldoc.book_info - document = load_including_children(wldoc) - root = document.edoc.getroot() - - if cover: - if cover is True: - cover = make_cover - bound_cover = cover(book_info, width=1200) - root.set('data-cover-width', str(bound_cover.width)) - root.set('data-cover-height', str(bound_cover.height)) - if bound_cover.uses_dc_cover: - if book_info.cover_by: - root.set('data-cover-by', book_info.cover_by) - if book_info.cover_source: - root.set('data-cover-source', book_info.cover_source) - if flags: - for flag in flags: - root.set('flag-' + flag, 'yes') - - # check for LaTeX packages - if morefloats: - root.set('morefloats', morefloats.lower()) - elif package_available('morefloats', 'maxfloats=19'): - root.set('morefloats', 'new') - - # add customizations - if customizations is not None: - root.set('customizations', u','.join(customizations)) - - # add editors info - editors = document.editors() - if editors: - root.set('editors', u', '.join(sorted( - editor.readable() for editor in editors))) - if document.book_info.funders: - root.set('funders', u', '.join(document.book_info.funders)) - if document.book_info.thanks: - root.set('thanks', document.book_info.thanks) - - # hack the tree - move_motifs_inside(document.edoc) - hack_motifs(document.edoc) - parse_creator(document.edoc) - substitute_hyphens(document.edoc) - fix_hanging(document.edoc) - fix_tables(document.edoc) - mark_subauthors(document.edoc) - - # wl -> TeXML - style_filename = get_stylesheet("wl2tex") - style = etree.parse(style_filename) - functions.reg_mathml_latex() - - # TeXML -> LaTeX - temp = mkdtemp('-wl2pdf') - - for ilustr in document.edoc.findall("//ilustr"): - shutil.copy(os.path.join(ilustr_path, ilustr.get("src")), temp) - - for sponsor in book_info.sponsors: - ins = etree.Element("data-sponsor", name=sponsor) - logo = sponsor_logo(sponsor) - if logo: - fname = 'sponsor-%s' % os.path.basename(logo) - shutil.copy(logo, os.path.join(temp, fname)) - ins.set('src', fname) - root.insert(0, ins) - - if book_info.sponsor_note: - root.set("sponsor-note", book_info.sponsor_note) - - texml = document.transform(style) - - if cover: - with open(os.path.join(temp, 'cover.png'), 'w') as f: - bound_cover.save(f, quality=80) - - del document # no longer needed large object :) - - tex_path = os.path.join(temp, 'doc.tex') - fout = open(tex_path, 'wb') - process(six.BytesIO(texml), fout, 'utf-8') - fout.close() - del texml - - if save_tex: - shutil.copy(tex_path, save_tex) - - # LaTeX -> PDF - shutil.copy(get_resource('pdf/wl.cls'), temp) - shutil.copy(get_resource('res/wl-logo.png'), temp) - - if latex_dir: - return temp - - try: - cwd = os.getcwd() - except OSError: - cwd = None - os.chdir(temp) - - # some things work better when compiled twice - # (table of contents, [line numbers - disabled]) - for run in range(2): - if verbose: - p = call(['xelatex', tex_path]) - else: - p = call(['xelatex', '-interaction=batchmode', tex_path], stdout=PIPE, stderr=PIPE) - if p: - raise ParseError("Error parsing .tex file") - - if cwd is not None: - os.chdir(cwd) - - output_file = NamedTemporaryFile(prefix='librarian', suffix='.pdf', delete=False) - pdf_path = os.path.join(temp, 'doc.pdf') - shutil.move(pdf_path, output_file.name) - shutil.rmtree(temp) - return OutputFile.from_filename(output_file.name) - - except (XMLSyntaxError, XSLTApplyError) as e: - raise ParseError(e) - - -def load_including_children(wldoc=None, provider=None, uri=None): - """ Makes one big xml file with children inserted at end. - - Either wldoc or provider and URI must be provided. - """ - - if uri and provider: - f = provider.by_uri(uri) - text = f.read().decode('utf-8') - f.close() - elif wldoc is not None: - text = etree.tostring(wldoc.edoc, encoding='unicode') - provider = wldoc.provider - else: - raise ValueError('Neither a WLDocument, nor provider and URI were provided.') - - text = re.sub(r"([\u0400-\u04ff]+)", r"\1", text) - - document = WLDocument.from_bytes(text.encode('utf-8'), parse_dublincore=True, provider=provider) - document.swap_endlines() - - for child_uri in document.book_info.parts: - child = load_including_children(provider=provider, uri=child_uri) - document.edoc.getroot().append(child.edoc.getroot()) - return document diff --git a/librarian/pdf/wl.cls b/librarian/pdf/wl.cls deleted file mode 100644 index f8b7731..0000000 --- a/librarian/pdf/wl.cls +++ /dev/null @@ -1,826 +0,0 @@ -% -*- coding: utf-8 -*- -\NeedsTeXFormat{LaTeX2e} -\ProvidesClass{wl}[2011/11/28 wolnelektury.pl book style] - -% PDF customizations -% -% nofootnotes - disable generation of footnotes -% nothemes - disable generation of themes -% defaultleading - default leading -% onehalfleading - leading of 1.5 (interlinia) -% doubleleading - double leading (interlinia) -% a4paper,... - paper size as required by LaTeX -% nowlfont - don't use customized WL font - -\RequirePackage{fixltx2e} -\RequirePackage{setspace} -\RequirePackage{type1cm} -\DeclareOption{13pt}{% -\AtEndOfClass{% -% font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/ -\renewcommand\normalsize{% - \@setfontsize\normalsize{13pt}{14.5pt}% - \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@ - \abovedisplayshortskip \z@ \@plus3\p@ - \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ - \belowdisplayskip \abovedisplayskip - \let\@listi\@listI}\normalsize% -\renewcommand\footnotesize{% - \@setfontsize\footnotesize\@xpt\@xiipt - \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ - \abovedisplayshortskip \z@ \@plus3\p@ - \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ - \def\@listi{\leftmargin\leftmargini - \topsep 6\p@ \@plus2\p@ \@minus2\p@ - \parsep 3\p@ \@plus2\p@ \@minus\p@ - \itemsep \parsep}% - \belowdisplayskip \abovedisplayskip -}% -}% -} -\DeclareOption{16pt}{% -\AtEndOfClass{% -% font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/ -\renewcommand\normalsize{% - \@setfontsize\normalsize{16pt}{18pt}% - \abovedisplayskip 15\p@ \@plus3\p@ \@minus7\p@ - \abovedisplayshortskip \z@ \@plus3.5\p@ - \belowdisplayshortskip 8\p@ \@plus4\p@ \@minus3\p@ - \belowdisplayskip \abovedisplayskip - \let\@listi\@listI}\normalsize% -\renewcommand\footnotesize{% - \@setfontsize\footnotesize\@xpt\@xiipt - \abovedisplayskip 12\p@ \@plus2\p@ \@minus5\p@ - \abovedisplayshortskip \z@ \@plus3.5\p@ - \belowdisplayshortskip 7\p@ \@plus3.5\p@ \@minus3\p@ - \def\@listi{\leftmargin\leftmargini - \topsep 7\p@ \@plus2.5\p@ \@minus2.5\p@ - \parsep 3.5\p@ \@plus2.5\p@ \@minus\p@ - \itemsep \parsep}% - \belowdisplayskip \abovedisplayskip -}% -}% -} - -\newif\iflargefont -\largefontfalse - -\DeclareOption{26pt}{% -\largefonttrue -\AtEndOfClass{% -% font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/ -\renewcommand\normalsize{% - \@setfontsize\normalsize{26pt}{31pt}% - \abovedisplayskip 14\p@ \@plus6\p@ \@minus14\p@ - \abovedisplayshortskip \z@ \@plus6\p@ - \belowdisplayshortskip 13\p@ \@plus7\p@ \@minus6\p@ - \belowdisplayskip \abovedisplayskip - \let\@listi\@listI}\normalsize% - \setlength{\parindent}{1.5em}% -\renewcommand\footnotesize{% - \@setfontsize\footnotesize{15pt}{20pt} - \abovedisplayskip 20\p@ \@plus4\p@ \@minus10\p@ - \abovedisplayshortskip \z@ \@plus6\p@ - \belowdisplayshortskip 12\p@ \@plus6\p@ \@minus6\p@ - \def\@listi{\leftmargin\leftmargini - \topsep 12\p@ \@plus4\p@ \@minus4\p@ - \parsep 6\p@ \@plus4\p@ \@minus\p@ - \itemsep \parsep}% - \belowdisplayskip \abovedisplayskip -}% -\renewcommand\LARGE{\@setfontsize\LARGE{41pt}{50pt}}% -\renewcommand\huge{\@setfontsize\huge{49pt}{60pt}}% -}% -} - -% not supported on texlive version on jessie, and has weird side effects in some readers -%% \XeTeXgenerateactualtext=1 - -%% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}} - -\DeclareOption{defaultleading}{} -\DeclareOption{doubleleading}{\AtBeginDocument{\doublespacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}} -\DeclareOption{onehalfleading}{\AtBeginDocument{\onehalfspacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}} - -%% This does not really work, since dvipdfm(x) will use it's configuration in /etc/texmf/dvipdfm(x) and force a global paper size setting. -\DeclareOption{a5paper}{% - \setlength{\paperheight}{210mm}% - \setlength{\paperwidth}{148mm}} - - -\newif\ifshowfootnotes \showfootnotestrue -\DeclareOption{nofootnotes}{\showfootnotesfalse} - -\newif\ifshowthemes \showthemestrue -\DeclareOption{nothemes}{\showthemesfalse} - -\newif\ifenablewlfont \enablewlfonttrue -\DeclareOption{nowlfont}{\enablewlfontfalse} - -\newif\ifshowtoc \showtoctrue -\DeclareOption{notoc}{\showtocfalse} - -%\newif\ifsansfont \sansfontfalse -%\DeclareOption{sansfont}{\sansfonttrue} - -\newif\ifmargins \marginstrue -\DeclareOption{nomargins}{\marginsfalse} - -\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} -\ProcessOptions\relax -\LoadClass[a4paper,oneside]{book} - - -\usepackage{trace} - -\usepackage[MeX]{polski} - -\usepackage[xetex]{graphicx} -\usepackage{fontspec} -\usepackage{xunicode} -\usepackage{xltxtra} - -\usepackage{longtable} -\usepackage{tabu} -\usepackage{unicode-math} -\setmathfont{Latin Modern Math} - -\usepackage[overload]{textcase} -\usepackage{scalefnt} -\usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref} - -%\ifsansfont -%\renewcommand{\familydefault}{\sfdefault} -%\fi - -\newfontfamily\alien[ -SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}}, -Numbers=OldStyle, -Scale=0.85, -LetterSpace=-1.0 -] {DejaVu Serif} - -\ifenablewlfont -\setmainfont [ -%ExternalLocation, -UprightFont = JunicodeWL-Regular, -ItalicFont = JunicodeWL-Italic, -BoldFont = JunicodeWL-Regular, -BoldItalicFont = JunicodeWL-Italic, -SmallCapsFont = JunicodeWL-Regular, -SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}}, -Numbers=OldStyle, -Scale=1.04, -LetterSpace=-1.0 -] {JunicodeWL} - -%\setmainfont [ -%UprightFont = NotoSerif-Regular, -%ItalicFont = NotoSerif-Italic, -%BoldFont = NotoSerif-Regular, -%BoldItalicFont = NotoSerif-Italic, -%SmallCapsFont = NotoSerif-Regular, -%SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}}, -%Scale=1.04, -%LetterSpace=-1.0 -%] {NotoSerif} - -%\setsansfont [ -%UprightFont = NotoSansDisplay-Regular, -%ItalicFont = NotoSansDisplay-Italic, -%BoldFont = NotoSansDisplay-Regular, -%BoldItalicFont = NotoSansDisplay-Italic, -%SmallCapsFont = NotoSansDisplay-Regular, -%SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}}, -%Scale=1.04, -%LetterSpace=-1.0 -%] {NotoSansDisplay} - -\defaultfontfeatures{ -SizeFeatures={ - {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 }, - {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 }, - {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 } -} -} - -\renewcommand{\textsc}[1]{% -{\addfontfeature{ -SizeFeatures={ - {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 }, - {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 }, - {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 } -}, -Letters={SmallCaps,UppercaseSmallCaps} -} -#1} -} -\fi% enablewlfont - -%{\Itshape JunicodeWL-Italic.ttf } -%{\bfseries Junicode-Bold.ttf } -%{\bfseries\itshape Junicode-BoldItalic.ttf } - -\pagestyle{plain} -\usepackage{fancyhdr} -\usepackage{marginnote} - - -\makeatletter - -% bottom figure below footnotes -\usepackage{fnpos} -\makeFNabove - -\usepackage{color} -\definecolor{theme}{gray}{.3} - -\ifmargins -\setlength{\marginparsep}{2em} -\setlength{\marginparwidth}{8.5em} -\setlength{\oddsidemargin}{0pt} -\setlength{\voffset}{0pt} -\setlength{\topmargin}{0pt} -\setlength{\headheight}{0pt} -\setlength{\headsep}{0pt} -\setlength{\textheight}{24cm} -\else -\addtolength{\oddsidemargin}{-.875in} -\addtolength{\evensidemargin}{-.875in} -\addtolength{\textwidth}{1.75in} - -\addtolength{\topmargin}{-.875in} -\addtolength{\textheight}{1.5in} -\fi - -\pagestyle{fancy} -\fancyhf{} -\renewcommand{\headrulewidth}{0pt} -\renewcommand{\footrulewidth}{0pt} -\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}} -\cfoot{} -\rfoot{{\footnotesize \thepage}} - -\clubpenalty=100000 -\widowpenalty=100000 - - -% see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html -\newsavebox{\ximagebox}\newlength{\ximageheight} -\newsavebox{\xglyphbox}\newlength{\xglyphheight} -\newcommand{\xbox}[1] -{\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}% -\savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}% -\raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{% -\makebox[0pt][l]{\usebox{\xglyphbox}}}%}% -\usebox{\ximagebox}% -\raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}} - -\newcommand{\makecover}[2]{ - \pdfpagewidth=#1 - \pdfpageheight=#2 - - \thispagestyle{empty} - \newlength{\PictHOffset} - \newlength{\PictVOffset} - \setlength{\PictHOffset}{1in} - \addtolength{\PictHOffset}{\hoffset} - \addtolength{\PictHOffset}{\oddsidemargin} - - \setlength{\PictVOffset}{1in} - \addtolength{\PictVOffset}{\voffset} - \addtolength{\PictVOffset}{\topmargin} - \addtolength{\PictVOffset}{\headheight} - \addtolength{\PictVOffset}{\headsep} - \addtolength{\PictVOffset}{\topskip} - \addtolength{\PictVOffset}{-\pdfpageheight} - - \noindent\hspace*{-\PictHOffset}% - \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{% - \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}} - \clearpage - - \setlength{\pdfpagewidth}{210mm} - \setlength{\pdfpageheight}{297mm} -} - - -\renewcommand{\maketitle}{ - { - \thispagestyle{empty} - \footnotesize - \color{theme} - - \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt} - \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}} - \end{minipage} - \begin{minipage}[t]{.65\textwidth}\vspace{0pt} - - \ifflaglessadvertising - \else - \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie - \href{http://www.wolnelektury.pl/}{wolnelektury.pl}. - \vspace{.5em} - \fi - - \ifdefined\thanknote - \thanknote - \vspace{.5em} - \fi - - Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury} - przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}. - - \end{minipage} - \noindent \rule{\linewidth}{0.4pt} - - \vspace{.6em} - \color{black} - } -} - -\newcommand{\editorialsection}{ - \begin{figure}[b!] - { - \footnotesize - \color{theme} - \noindent \rule{\linewidth}{0.4pt} - - \ifdefined\sponsors - \marginnote{% - \centering% - \sponsors% - } - \fi - - \rightsinfo - \vspace{.6em} - - Źródło: \href{\bookurl}{\bookurl} - - \vspace{.6em} - \sourceinfo - - \publisherinfo - - \description - \vspace{.6em} - - \editors - - \ifdefined\funders - \vspace{.6em} - \funders - \fi - - \ifdefined\coverby - \vspace{.6em} - \coverby - \fi - - \ifdefined\isbn - \vspace{.6em} - \isbn - \fi - - \vspace{.6em} - \emph{Wesprzyj Wolne Lektury!} - - Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji - pożytku publicznego działającej na rzecz wolności korzystania - z dóbr kultury. - - Co roku do domeny publicznej przechodzi twórczość kolejnych autorów. - Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie. - - \vspace{.6em} - \emph{Jak możesz pomóc?} - - Przekaż 1\% podatku na rozwój Wolnych Lektur: - Fundacja Nowoczesna Polska, KRS 0000070056. - - Dołącz do \href{https://wolnelektury.pl/towarzystwo/}{Towarzystwa Przyjaciół Wolnych Lektur} i pomóż nam rozwijać bibliotekę. - - Przekaż darowiznę na konto: - \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}. - - \color{black} - } - \end{figure} -} - - -\newcommand{\typosubsubsection}[1]{% -\iflargefont -{\textsc{\scalefont{2}#1}} -\else -{\textsc{#1}} -\fi -} - -\newcommand{\typosubsection}[1]{% -{\addfontfeature{ -SizeFeatures={ - {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 }, - {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 }, - {Size={12-}, FakeStretch=2.0, LetterSpace=8.0 } -}, -Letters={Uppercase} -} -\iflargefont -\MakeUppercase{\scalefont{2}#1} -\else -\MakeUppercase{#1} -\fi} -} - -\newcommand{\typosection}[1]{% -\iflargefont -{\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{4}#1}} -\else -{\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}} -\fi -%{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}} -} - - -\DeclareRobustCommand\authortoctext[1]{% -{\addvspace{10pt}\nopagebreak\leftskip0em\relax -\rightskip \@tocrmarg\relax -\noindent\itshape#1\par}} - -\newcommand\authortoc[1]{% - \gdef\chapterauthor{#1}% - \addtocontents{toc}{\authortoctext{#1}}} - - -\newcommand{\tytul}[1]{% -#1% -\vspace{1em}% -} - -\newcommand{\nazwapodutworu}[2]{% -\vspace{5ex}% -\section*{\typosection{#1}}% -\addcontentsline{toc}{section}{#2}% -} - -\newcommand{\nazwanadpodutworu}[2]{% -\authortoc{}% -\nazwapodutworu{#1}{#2}% -\authortoc{}% -} - -\newcommand{\autorutworu}[1]{% -\subsection*{\typosubsection{#1}}% -} - -\newcommand{\autorpodutworu}[1]{% -\vspace{5ex}% -\subsection*{\typosubsection{#1}}% -\authortoc{#1}% -} - -\newcommand{\dzielonadrzedne}[1]{% -\subsection*{\typosubsubsection{#1}}% -} - -\newcommand{\nazwautworu}[1]{% -\vspace{5ex}% -\section*{\typosection{#1}}% -} - -\newcommand{\podtytul}[1]{% -\subsection*{\typosubsubsection{#1}}% -} - -\newcommand{\translator}[1]{% -\subsection*{\typosubsubsection{tłum. #1}}% -} - - -\newcommand{\powiesc}[1]{#1} -\newcommand{\opowiadanie}[1]{#1} -\newcommand{\lirykal}[1]{#1} -\newcommand{\lirykalp}[1]{#1} -\newcommand{\dramatwierszowanyl}[1]{#1} -\newcommand{\dramatwierszowanylp}[1]{#1} -\newcommand{\dramatwspolczesny}[1]{#1} - -\newcommand{\nota}[1]{% -\par{\raggedleft \emph{#1}}% -\vspace{5ex}% -} - -\newcommand{\dedykacja}[1]{% -\begin{em}% -\begin{flushright}% -#1% -\end{flushright}% -\end{em}% -} - -\newlength{\fboxhsep} -\newlength{\fboxvsep} - -\newlength{\fboxtoprule} -\newlength{\fboxbottomrule} -\newlength{\fboxleftrule} -\newlength{\fboxrightrule} - -\ifshowthemes -\setlength{\fboxhsep}{5\fboxsep} -\setlength{\fboxvsep}{20\fboxsep} -\fi - -\setlength{\fboxtoprule}{\fboxrule} -\setlength{\fboxleftrule}{\fboxrule} -\setlength{\fboxrightrule}{\fboxrule} -\setlength{\fboxbottomrule}{\fboxrule} - - - -\def\@frameb@xother#1{% - \@tempdima\fboxtoprule - \advance\@tempdima\fboxvsep - \advance\@tempdima\dp\@tempboxa - \hbox{% - \lower\@tempdima\hbox{% - \vbox{% - \hrule\@height\fboxtoprule - \hbox{% - \vrule\@width\fboxleftrule - #1% - \vbox{% - \vskip\fboxvsep - \box\@tempboxa - \vskip\fboxvsep}% - #1% - \vrule\@width\fboxrightrule}% - \hrule\@height\fboxbottomrule}% - }% - }% -} - - -\long\def\fboxother#1{% - \leavevmode - \setbox\@tempboxa\hbox{% - \color@begingroup - \kern\fboxhsep{#1}\kern\fboxhsep - \color@endgroup}% - \@frameb@xother\relax} - -\newcommand{\myfbox}[3]{% - \begingroup - \setlength{\fboxhsep}{#1} - \setlength{\fboxvsep}{#2} - \fboxother{#3} - - \endgroup -} - -\newcommand{\ramka}[1]{% -\par\vspace{1em}% -\edef\myindent{\the\parindent}% -\noindent\myfbox{1em}{1em}{% -\parbox{\dimexpr \textwidth - 2\fboxhsep - 2\fboxrule\relax}{% -\setlength{\parindent}{\myindent}% -#1% -}}% -\vspace{1em}% -} - -\newcommand{\dlugicytat}[1]{% -\begin{quotation}% -#1% -\end{quotation}% -} - -\newcommand{\poezjacyt}[1]{% -\begin{verse}% -#1% -\end{verse}% -} -\newcommand{\motto}[1]{% -\begin{em}% -#1% -\end{em}% -} -\newcommand{\listaosob}[2]{% -\par{#1}% -\begin{itemize}% -#2% -\end{itemize}% -} - -\newcommand{\nagloweklisty}[1]{% -\typosubsubsection{#1}% -} - -\newcommand{\listaosoba}[1]{% -\item[]{#1}% -} - -\newcommand{\kwestia}[1]{% -\par{#1}% -} - -\newcommand{\naglowekakt}[2]{% -\pagebreak -\subsection*{\typosubsection{\huge #1}}% -\addcontentsline{toc}{subsection}{#2}% -\vspace{5ex}% -} - -\newcommand{\podtytulakt}[1]{% -\par{\typosubsubsection{\LARGE #1}}% -\vspace{5ex}% -} - -\newcommand{\naglowekczesc}[2]{% -\pagebreak -\subsection*{\typosubsection{\huge #1}}% -\addcontentsline{toc}{subsection}{#2}% -\vspace{5ex}% -} - -\newcommand{\podtytulczesc}[1]{% -\par{\typosubsubsection{\LARGE #1}}% -\vspace{5ex}% -} - -\newcommand{\srodtytul}[1]{% -\subsection*{\typosubsection{#1}}% -} - -\newcommand{\naglowekscena}[2]{% -\subsubsection*{\typosubsubsection{\LARGE #1}}% -\addcontentsline{toc}{subsubsection}{#2}% -\vspace{5ex}% -} - -\newcommand{\podtytulscena}[1]{% -\par{\large #1}% -\vspace{5ex}% -} - -\newcommand{\naglowekrozdzial}[2]{% -\subsubsection*{\typosubsubsection{\LARGE #1}}% -\addcontentsline{toc}{subsubsection}{#2}% -\vspace{5ex}% -} - -\newcommand{\podtytulrozdzial}[1]{% -\par{\large #1}% -\vspace{5ex}% -} - -\newcommand{\naglowekosoba}[1]{% -\medskip% -\par{\textsc{\MakeLowercase{#1}}}\nopagebreak% -} -\newcommand{\naglowekpodrozdzial}[1]{% -\vspace{5ex}\par{#1}\nopagebreak% -} - -\newcommand{\podtytulpodrozdzial}[1]{% -\par{#1}\nopagebreak% -} - -\newcommand{\miejsceczas}[1]{% -\par{\emph{#1}}% -} -\newcommand{\didaskalia}[1]{% -\par{\emph{#1}}% -} - -\usepackage{intcalc} -\usepackage{color} -\definecolor{gray}{RGB}{200,200,200} -%\newcounter{parnum} -\newlength{\parnumwidth} -\setlength{\parnumwidth}{3em} -\newcommand{\N}{% - \leavevmode\refstepcounter{parnum}\reversemarginpar% - \marginnote{\textcolor{gray}{\small{\theparnum}}}% - \reversemarginpar} -\newcommand{\Nw}{% - \leavevmode\refstepcounter{parnum}\reversemarginpar% - \ifnum\intcalcMod{\value{parnum}}{5}=0% - \marginnote{\textcolor{gray}{\small{\theparnum}}}% - \fi\reversemarginpar} -\renewcommand{\N}{} -\renewcommand{\Nw}{} - -\newcommand{\akap}[1]{% -\par{\N#1}% -} -\newcommand{\akapdialog}[1]{% -\par{\N#1}% -} -\newcommand{\akapcd}[1]{% -\par{\N#1}% -} - -\newcommand{\mottopodpis}[1]{% -\begin{em}% -\begin{flushright}% -#1% -\end{flushright}% -\end{em}% -} - -\newcommand{\strofa}[1]{% -\par{\noindent{\ignorespaces#1\vspace{1em}}}% -} - -\newcommand{\wers}[1]{\Nw#1} - -\newcommand{\wersakap}[1]{% -\Nw\hspace*{1em}#1% -} -\newcommand{\werscd}[1]{% -\Nw\hspace*{8em}#1% -} -\newcommand{\werswciety}[2][1em]{% -\Nw\hspace*{#1}#2% -} -\newcommand{\wersdoprawej}[1]{% -\Nw\hspace*{\fill}#1% -} - -\ifshowfootnotes - \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}} - \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1 [przypis edytorski]}}} - \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1 [przypis redakcyjny]}}} - \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1 [przypis tłumacza]}}} -\else - \newcommand{\pa}[1]{} - \newcommand{\pe}[1]{} - \newcommand{\pr}[1]{} - \newcommand{\pt}[1]{} -\fi - -\newcommand{\mat}[1]{$#1$} - -\newcommand{\didasktekst}[1]{% -\emph{#1}% -} -\newcommand{\slowoobce}[1]{% -\emph{#1}% -} -\newcommand{\tytuldziela}[1]{% -\emph{#1}% -} -\newcommand{\wyroznienie}[1]{% -\emph{#1}% -} -\newcommand{\indeksdolny}[1]{% -\textsubscript{#1}% -} -\newcommand{\wiekszeodstepy}[1]{% -\spaceskip 3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font \relax% -#1% -\spaceskip \fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font \relax% -} - -\newcommand{\osoba}[1]{% -{\scshape \MakeLowercase{#1}}% -} - -\newcommand{\sekcjaswiatlo}{% -\vspace{30pt}% -} - -\newcommand{\sekcjaasterysk}{% -\vspace{10pt}% -\begin{center}% -\par{*}% -\end{center}% -} - -\newcommand{\separatorlinia}{% -\vspace{10pt}% -\hrule{}% -\vspace{10pt}% -} - -\newcommand{\motyw}[2][0]{% -\ifshowthemes -\mbox{}% -\marginpar{% -\vspace{-8pt}% -\vspace{-#1\baselineskip}% -\raggedright{\hspace{0pt}% -\footnotesize{\color{theme}{#2}}}% -\vspace{\baselineskip}% -}% -\fi -} - -\newcommand{\ilustr}[2]{% -\vspace{1em}% -\par{\noindent\includegraphics[width=\linewidth]{#1}}% -\vspace{1em} -} diff --git a/librarian/pdf/wl2tex.xslt b/librarian/pdf/wl2tex.xslt deleted file mode 100644 index 43a3274..0000000 --- a/librarian/pdf/wl2tex.xslt +++ /dev/null @@ -1,643 +0,0 @@ - - - - - - - - - - \documentclass[]{wl} - - - - \newif\ifflaglessadvertising - - - true - - - - - - \def\{} - - - - - - - - \usepackage[maxfloats=53]{morefloats} - - - - - \usepackage{morefloats} - - - - - - \IfFileExists{morefloats.sty}{ - \usepackage{morefloats} - }{} - - - - - - - - - - - 210mm - mm - - - - - \def\thanknote{} - - - - - - - - - - - - - - - - - - - - - - - - - - tocdepth - 3 - - - - - - - - - - - \def\coverby{Okładka na podstawie: - - - \href{\datacoversource}{\datacoverby} - - - \datacoverby{} - - - } - - \def\editors{} - - \def\funders{Publikację wsparli i wsparły: - .} - - - - \def\sponsors{ - \scriptsize - - - - - - Sfinansowano ze~środków: - - - - \vspace{1em} - - - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \def\authors{} - \author{\authors} - \title{} - \def\translatorsline{} - - \def\bookurl{} - - \def\rightsinfo{Ten utwór nie jest objęty majątkowym prawem autorskim i~znajduje się w~domenie - publicznej, co oznacza że możesz go swobodnie wykorzystywać, publikować - i~rozpowszechniać. Jeśli utwór opatrzony jest dodatkowymi materiałami - (przypisy, motywy literackie etc.), które podlegają prawu autorskiemu, to - te dodatkowe materiały udostępnione są na licencji - \href{http://creativecommons.org/licenses/by-sa/3.0/}{Creative Commons - Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL}.} - - \def\rightsinfo{Ten utwór jest udostępniony na licencji - \href{}{}.} - - - \def\sourceinfo{ - - Tekst opracowany na podstawie: - \vspace{.6em} - } - \def\publisherinfo{ - - Wydawca: - - - - , - - - \vspace{.6em} - } - \def\description{} - - - \def\isbn{ISBN } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - t - - - - - - - - - - - - - - - \\{} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - wers - - - - em - - - - - - - - - - - - - - - - - - - - - - - - „” - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - , - - - - - - - , - - - - - - - Opracowanie redakcyjne i przypisy: - - . - - - - - - - - , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \includegraphics[height=0.25\textwidth,width=0.25\textwidth,keepaspectratio]{} - - - - - - - - - - - $ - - $ - - - - - - $$ - - $$ - - - - - - 1em - - - - - longtabu - tabu - - to \textwidth - - - - - - - - - - - - - - 1em - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/librarian/picture.py b/librarian/picture.py deleted file mode 100644 index 10d2ae7..0000000 --- a/librarian/picture.py +++ /dev/null @@ -1,213 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from operator import and_ - -from .dcparser import Field, WorkInfo, DCNS -from librarian import (RDFNS, ValidationError, NoDublinCore, ParseError, WLURI) -from xml.parsers.expat import ExpatError -from os import path -from lxml import etree -from lxml.etree import (XMLSyntaxError, XSLTApplyError, Element) -import re -import six - - -class WLPictureURI(WLURI): - _re_wl_uri = re.compile('http://wolnelektury.pl/katalog/obraz/(?P[-a-z0-9]+)/?$') - - @classmethod - def from_slug(cls, slug): - uri = 'http://wolnelektury.pl/katalog/obraz/%s/' % slug - return cls(uri) - - -def as_wlpictureuri_strict(text): - return WLPictureURI.strict(text) - - -class PictureInfo(WorkInfo): - """ - Dublin core metadata for a picture - """ - FIELDS = ( - Field(DCNS('language'), 'language', required=False), - Field(DCNS('subject.period'), 'epochs', salias='epoch', multiple=True), - Field(DCNS('subject.type'), 'kinds', salias='kind', multiple=True), - Field(DCNS('subject.genre'), 'genres', salias='genre', multiple=True, required=False), - Field(DCNS('subject.style'), 'styles', salias='style', multiple=True, required=False), - - Field(DCNS('format.dimensions'), 'dimensions', required=False), - Field(DCNS('format.checksum.sha1'), 'sha1', required=True), - Field(DCNS('description.medium'), 'medium', required=False), - Field(DCNS('description.dimensions'), 'original_dimensions', required=False), - Field(DCNS('format'), 'mime_type', required=False), - Field(DCNS('identifier.url'), 'url', WLPictureURI, strict=as_wlpictureuri_strict) - ) - - -class ImageStore(object): - EXT = ['gif', 'jpeg', 'png', 'swf', 'psd', 'bmp' - 'tiff', 'tiff', 'jpc', 'jp2', 'jpf', 'jb2', 'swc', - 'aiff', 'wbmp', 'xbm'] - MIME = ['image/gif', 'image/jpeg', 'image/png', - 'application/x-shockwave-flash', 'image/psd', 'image/bmp', - 'image/tiff', 'image/tiff', 'application/octet-stream', - 'image/jp2', 'application/octet-stream', 'application/octet-stream', - 'application/x-shockwave-flash', 'image/iff', 'image/vnd.wap.wbmp', 'image/xbm'] - - def __init__(self, dir_): - super(ImageStore, self).__init__() - self.dir = dir_ - - def path(self, slug, mime_type): - """ - Finds file by slug and mime type in our iamge store. - Returns a file objects (perhaps should return a filename?) - """ - try: - i = self.MIME.index(mime_type) - except ValueError: - err = ValueError("Picture %s has unknown mime type: %s" % (slug, mime_type)) - err.slug = slug - err.mime_type = mime_type - raise err - ext = self.EXT[i] - # add some common extensions tiff->tif, jpeg->jpg - return path.join(self.dir, slug + '.' + ext) - - -class WLPicture(object): - def __init__(self, edoc, parse_dublincore=True, image_store=None): - self.edoc = edoc - self.image_store = image_store - - root_elem = edoc.getroot() - - dc_path = './/' + RDFNS('RDF') - - if root_elem.tag != 'picture': - raise ValidationError("Invalid root element. Found '%s', should be 'picture'" % root_elem.tag) - - if parse_dublincore: - self.rdf_elem = root_elem.find(dc_path) - - if self.rdf_elem is None: - raise NoDublinCore('Document has no DublinCore - which is required.') - - self.picture_info = PictureInfo.from_element(self.rdf_elem) - else: - self.picture_info = None - self.frame = None - - @classmethod - def from_bytes(cls, xml, *args, **kwargs): - return cls.from_file(six.BytesIO(xml), *args, **kwargs) - - @classmethod - def from_file(cls, xmlfile, parse_dublincore=True, image_store=None): - - # first, prepare for parsing - if isinstance(xmlfile, six.text_type): - file = open(xmlfile, 'rb') - try: - data = file.read() - finally: - file.close() - else: - data = xmlfile.read() - - if not isinstance(data, six.text_type): - data = data.decode('utf-8') - - data = data.replace(u'\ufeff', '') - - # assume images are in the same directory - if image_store is None and getattr(xmlfile, 'name', None): - image_store = ImageStore(path.dirname(xmlfile.name)) - - try: - parser = etree.XMLParser(remove_blank_text=False) - tree = etree.parse(six.BytesIO(data.encode('utf-8')), parser) - - me = cls(tree, parse_dublincore=parse_dublincore, image_store=image_store) - me.load_frame_info() - return me - except (ExpatError, XMLSyntaxError, XSLTApplyError) as e: - raise ParseError(e) - - @property - def mime_type(self): - if self.picture_info is None: - raise ValueError('DC is not loaded, hence we don\'t know the image type') - return self.picture_info.mime_type - - @property - def slug(self): - return self.picture_info.url.slug - - @property - def image_path(self): - if self.image_store is None: - raise ValueError("No image store associated with whis WLPicture.") - - return self.image_store.path(self.slug, self.mime_type) - - def image_file(self, *args, **kwargs): - return open(self.image_path, 'rb', *args, **kwargs) - - def get_sem_coords(self, sem): - area = sem.find("div[@type='rect']") - if area is None: - area = sem.find("div[@type='whole']") - return [[0, 0], [-1, -1]] - - def has_all_props(node, props): - return reduce(and_, map(lambda prop: prop in node.attrib, props)) - - if not has_all_props(area, ['x1', 'x2', 'y1', 'y2']): - return None - - def n(prop): return int(area.get(prop)) - return [[n('x1'), n('y1')], [n('x2'), n('y2')]] - - def partiter(self): - """ - Iterates the parts of this picture and returns them and their metadata - """ - # omg no support for //sem[(@type='theme') or (@type='object')] ? - for part in list(self.edoc.iterfind("//sem[@type='theme']")) +\ - list(self.edoc.iterfind("//sem[@type='object']")): - pd = {'type': part.get('type')} - - coords = self.get_sem_coords(part) - if coords is None: - continue - pd['coords'] = coords - - def want_unicode(x): - if not isinstance(x, six.text_type): - return x.decode('utf-8') - else: - return x - pd['object'] = part.attrib['type'] == 'object' and want_unicode(part.attrib.get('object', u'')) or None - pd['themes'] = part.attrib['type'] == 'theme' and [part.attrib.get('theme', u'')] or [] - yield pd - - def load_frame_info(self): - k = self.edoc.find("//sem[@object='kadr']") - - if k is not None: - clip = self.get_sem_coords(k) - self.frame = clip - frm = Element("sem", {"type": "frame"}) - frm.append(k.iter("div").next()) - self.edoc.getroot().append(frm) - k.getparent().remove(k) - else: - frm = self.edoc.find("//sem[@type='frame']") - if frm: - self.frame = self.get_sem_coords(frm) - else: - self.frame = None - return self diff --git a/librarian/res/ISO-639-2_8859-1.txt b/librarian/res/ISO-639-2_8859-1.txt deleted file mode 100644 index 65b549e..0000000 --- a/librarian/res/ISO-639-2_8859-1.txt +++ /dev/null @@ -1,486 +0,0 @@ -aar||aa|Afar|afar -abk||ab|Abkhazian|abkhaze -ace|||Achinese|aceh -ach|||Acoli|acoli -ada|||Adangme|adangme -ady|||Adyghe; Adygei|adyghé -afa|||Afro-Asiatic languages|afro-asiatiques, langues -afh|||Afrihili|afrihili -afr||af|Afrikaans|afrikaans -ain|||Ainu|aïnou -aka||ak|Akan|akan -akk|||Akkadian|akkadien -alb|sqi|sq|Albanian|albanais -ale|||Aleut|aléoute -alg|||Algonquian languages|algonquines, langues -alt|||Southern Altai|altai du Sud -amh||am|Amharic|amharique -ang|||English, Old (ca.450-1100)|anglo-saxon (ca.450-1100) -anp|||Angika|angika -apa|||Apache languages|apache, langues -ara||ar|Arabic|arabe -arc|||Official Aramaic (700-300 BCE); Imperial Aramaic (700-300 BCE)|araméen d'empire (700-300 BCE) -arg||an|Aragonese|aragonais -arm|hye|hy|Armenian|arménien -arn|||Mapudungun; Mapuche|mapudungun; mapuche; mapuce -arp|||Arapaho|arapaho -art|||Artificial languages|artificielles, langues -arw|||Arawak|arawak -asm||as|Assamese|assamais -ast|||Asturian; Bable; Leonese; Asturleonese|asturien; bable; léonais; asturoléonais -ath|||Athapascan languages|athapascanes, langues -aus|||Australian languages|australiennes, langues -ava||av|Avaric|avar -ave||ae|Avestan|avestique -awa|||Awadhi|awadhi -aym||ay|Aymara|aymara -aze||az|Azerbaijani|azéri -bad|||Banda languages|banda, langues -bai|||Bamileke languages|bamiléké, langues -bak||ba|Bashkir|bachkir -bal|||Baluchi|baloutchi -bam||bm|Bambara|bambara -ban|||Balinese|balinais -baq|eus|eu|Basque|basque -bas|||Basa|basa -bat|||Baltic languages|baltes, langues -bej|||Beja; Bedawiyet|bedja -bel||be|Belarusian|biélorusse -bem|||Bemba|bemba -ben||bn|Bengali|bengali -ber|||Berber languages|berbères, langues -bho|||Bhojpuri|bhojpuri -bih||bh|Bihari languages|langues bihari -bik|||Bikol|bikol -bin|||Bini; Edo|bini; edo -bis||bi|Bislama|bichlamar -bla|||Siksika|blackfoot -bnt|||Bantu languages|bantou, langues -bos||bs|Bosnian|bosniaque -bra|||Braj|braj -bre||br|Breton|breton -btk|||Batak languages|batak, langues -bua|||Buriat|bouriate -bug|||Buginese|bugi -bul||bg|Bulgarian|bulgare -bur|mya|my|Burmese|birman -byn|||Blin; Bilin|blin; bilen -cad|||Caddo|caddo -cai|||Central American Indian languages|amérindiennes de l'Amérique centrale, langues -car|||Galibi Carib|karib; galibi; carib -cat||ca|Catalan; Valencian|catalan; valencien -cau|||Caucasian languages|caucasiennes, langues -ceb|||Cebuano|cebuano -cel|||Celtic languages|celtiques, langues; celtes, langues -cha||ch|Chamorro|chamorro -chb|||Chibcha|chibcha -che||ce|Chechen|tchétchène -chg|||Chagatai|djaghataï -chi|zho|zh|Chinese|chinois -chk|||Chuukese|chuuk -chm|||Mari|mari -chn|||Chinook jargon|chinook, jargon -cho|||Choctaw|choctaw -chp|||Chipewyan; Dene Suline|chipewyan -chr|||Cherokee|cherokee -chu||cu|Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic|slavon d'église; vieux slave; slavon liturgique; vieux bulgare -chv||cv|Chuvash|tchouvache -chy|||Cheyenne|cheyenne -cmc|||Chamic languages|chames, langues -cop|||Coptic|copte -cor||kw|Cornish|cornique -cos||co|Corsican|corse -cpe|||Creoles and pidgins, English based|créoles et pidgins basés sur l'anglais -cpf|||Creoles and pidgins, French-based|créoles et pidgins basés sur le français -cpp|||Creoles and pidgins, Portuguese-based|créoles et pidgins basés sur le portugais -cre||cr|Cree|cree -crh|||Crimean Tatar; Crimean Turkish|tatar de Crimé -crp|||Creoles and pidgins|créoles et pidgins -csb|||Kashubian|kachoube -cus|||Cushitic languages|couchitiques, langues -cze|ces|cs|Czech|tchèque -dak|||Dakota|dakota -dan||da|Danish|danois -dar|||Dargwa|dargwa -day|||Land Dayak languages|dayak, langues -del|||Delaware|delaware -den|||Slave (Athapascan)|esclave (athapascan) -dgr|||Dogrib|dogrib -din|||Dinka|dinka -div||dv|Divehi; Dhivehi; Maldivian|maldivien -doi|||Dogri|dogri -dra|||Dravidian languages|dravidiennes, langues -dsb|||Lower Sorbian|bas-sorabe -dua|||Duala|douala -dum|||Dutch, Middle (ca.1050-1350)|néerlandais moyen (ca. 1050-1350) -dut|nld|nl|Dutch; Flemish|néerlandais; flamand -dyu|||Dyula|dioula -dzo||dz|Dzongkha|dzongkha -efi|||Efik|efik -egy|||Egyptian (Ancient)|égyptien -eka|||Ekajuk|ekajuk -elx|||Elamite|élamite -eng||en|English|anglais -enm|||English, Middle (1100-1500)|anglais moyen (1100-1500) -epo||eo|Esperanto|espéranto -est||et|Estonian|estonien -ewe||ee|Ewe|éwé -ewo|||Ewondo|éwondo -fan|||Fang|fang -fao||fo|Faroese|féroïen -fat|||Fanti|fanti -fij||fj|Fijian|fidjien -fil|||Filipino; Pilipino|filipino; pilipino -fin||fi|Finnish|finnois -fiu|||Finno-Ugrian languages|finno-ougriennes, langues -fon|||Fon|fon -fre|fra|fr|French|français -frm|||French, Middle (ca.1400-1600)|français moyen (1400-1600) -fro|||French, Old (842-ca.1400)|français ancien (842-ca.1400) -frr|||Northern Frisian|frison septentrional -frs|||Eastern Frisian|frison oriental -fry||fy|Western Frisian|frison occidental -ful||ff|Fulah|peul -fur|||Friulian|frioulan -gaa|||Ga|ga -gay|||Gayo|gayo -gba|||Gbaya|gbaya -gem|||Germanic languages|germaniques, langues -geo|kat|ka|Georgian|géorgien -ger|deu|de|German|allemand -gez|||Geez|guèze -gil|||Gilbertese|kiribati -gla||gd|Gaelic; Scottish Gaelic|gaélique; gaélique écossais -gle||ga|Irish|irlandais -glg||gl|Galician|galicien -glv||gv|Manx|manx; mannois -gmh|||German, Middle High (ca.1050-1500)|allemand, moyen haut (ca. 1050-1500) -goh|||German, Old High (ca.750-1050)|allemand, vieux haut (ca. 750-1050) -gon|||Gondi|gond -gor|||Gorontalo|gorontalo -got|||Gothic|gothique -grb|||Grebo|grebo -grc|||Greek, Ancient (to 1453)|grec ancien (jusqu'à 1453) -gre|ell|el|Greek, Modern (1453-)|grec moderne (après 1453) -grn||gn|Guarani|guarani -gsw|||Swiss German; Alemannic; Alsatian|suisse alémanique; alémanique; alsacien -guj||gu|Gujarati|goudjrati -gwi|||Gwich'in|gwich'in -hai|||Haida|haida -hat||ht|Haitian; Haitian Creole|haïtien; créole haïtien -hau||ha|Hausa|haoussa -haw|||Hawaiian|hawaïen -heb||he|Hebrew|hébreu -her||hz|Herero|herero -hil|||Hiligaynon|hiligaynon -him|||Himachali languages; Western Pahari languages|langues himachalis; langues paharis occidentales -hin||hi|Hindi|hindi -hit|||Hittite|hittite -hmn|||Hmong; Mong|hmong -hmo||ho|Hiri Motu|hiri motu -hrv||hr|Croatian|croate -hsb|||Upper Sorbian|haut-sorabe -hun||hu|Hungarian|hongrois -hup|||Hupa|hupa -iba|||Iban|iban -ibo||ig|Igbo|igbo -ice|isl|is|Icelandic|islandais -ido||io|Ido|ido -iii||ii|Sichuan Yi; Nuosu|yi de Sichuan -ijo|||Ijo languages|ijo, langues -iku||iu|Inuktitut|inuktitut -ile||ie|Interlingue; Occidental|interlingue -ilo|||Iloko|ilocano -ina||ia|Interlingua (International Auxiliary Language Association)|interlingua (langue auxiliaire internationale) -inc|||Indic languages|indo-aryennes, langues -ind||id|Indonesian|indonésien -ine|||Indo-European languages|indo-européennes, langues -inh|||Ingush|ingouche -ipk||ik|Inupiaq|inupiaq -ira|||Iranian languages|iraniennes, langues -iro|||Iroquoian languages|iroquoises, langues -ita||it|Italian|italien -jav||jv|Javanese|javanais -jbo|||Lojban|lojban -jpn||ja|Japanese|japonais -jpr|||Judeo-Persian|judéo-persan -jrb|||Judeo-Arabic|judéo-arabe -kaa|||Kara-Kalpak|karakalpak -kab|||Kabyle|kabyle -kac|||Kachin; Jingpho|kachin; jingpho -kal||kl|Kalaallisut; Greenlandic|groenlandais -kam|||Kamba|kamba -kan||kn|Kannada|kannada -kar|||Karen languages|karen, langues -kas||ks|Kashmiri|kashmiri -kau||kr|Kanuri|kanouri -kaw|||Kawi|kawi -kaz||kk|Kazakh|kazakh -kbd|||Kabardian|kabardien -kha|||Khasi|khasi -khi|||Khoisan languages|khoïsan, langues -khm||km|Central Khmer|khmer central -kho|||Khotanese; Sakan|khotanais; sakan -kik||ki|Kikuyu; Gikuyu|kikuyu -kin||rw|Kinyarwanda|rwanda -kir||ky|Kirghiz; Kyrgyz|kirghiz -kmb|||Kimbundu|kimbundu -kok|||Konkani|konkani -kom||kv|Komi|kom -kon||kg|Kongo|kongo -kor||ko|Korean|coréen -kos|||Kosraean|kosrae -kpe|||Kpelle|kpellé -krc|||Karachay-Balkar|karatchai balkar -krl|||Karelian|carélien -kro|||Kru languages|krou, langues -kru|||Kurukh|kurukh -kua||kj|Kuanyama; Kwanyama|kuanyama; kwanyama -kum|||Kumyk|koumyk -kur||ku|Kurdish|kurde -kut|||Kutenai|kutenai -lad|||Ladino|judéo-espagnol -lah|||Lahnda|lahnda -lam|||Lamba|lamba -lao||lo|Lao|lao -lat||la|Latin|latin -lav||lv|Latvian|letton -lez|||Lezghian|lezghien -lim||li|Limburgan; Limburger; Limburgish|limbourgeois -lin||ln|Lingala|lingala -lit||lt|Lithuanian|lituanien -lol|||Mongo|mongo -loz|||Lozi|lozi -ltz||lb|Luxembourgish; Letzeburgesch|luxembourgeois -lua|||Luba-Lulua|luba-lulua -lub||lu|Luba-Katanga|luba-katanga -lug||lg|Ganda|ganda -lui|||Luiseno|luiseno -lun|||Lunda|lunda -luo|||Luo (Kenya and Tanzania)|luo (Kenya et Tanzanie) -lus|||Lushai|lushai -mac|mkd|mk|Macedonian|macédonien -mad|||Madurese|madourais -mag|||Magahi|magahi -mah||mh|Marshallese|marshall -mai|||Maithili|maithili -mak|||Makasar|makassar -mal||ml|Malayalam|malayalam -man|||Mandingo|mandingue -mao|mri|mi|Maori|maori -map|||Austronesian languages|austronésiennes, langues -mar||mr|Marathi|marathe -mas|||Masai|massaï -may|msa|ms|Malay|malais -mdf|||Moksha|moksa -mdr|||Mandar|mandar -men|||Mende|mendé -mga|||Irish, Middle (900-1200)|irlandais moyen (900-1200) -mic|||Mi'kmaq; Micmac|mi'kmaq; micmac -min|||Minangkabau|minangkabau -mis|||Uncoded languages|langues non codées -mkh|||Mon-Khmer languages|môn-khmer, langues -mlg||mg|Malagasy|malgache -mlt||mt|Maltese|maltais -mnc|||Manchu|mandchou -mni|||Manipuri|manipuri -mno|||Manobo languages|manobo, langues -moh|||Mohawk|mohawk -mon||mn|Mongolian|mongol -mos|||Mossi|moré -mul|||Multiple languages|multilingue -mun|||Munda languages|mounda, langues -mus|||Creek|muskogee -mwl|||Mirandese|mirandais -mwr|||Marwari|marvari -myn|||Mayan languages|maya, langues -myv|||Erzya|erza -nah|||Nahuatl languages|nahuatl, langues -nai|||North American Indian languages|nord-amérindiennes, langues -nap|||Neapolitan|napolitain -nau||na|Nauru|nauruan -nav||nv|Navajo; Navaho|navaho -nbl||nr|Ndebele, South; South Ndebele|ndébélé du Sud -nde||nd|Ndebele, North; North Ndebele|ndébélé du Nord -ndo||ng|Ndonga|ndonga -nds|||Low German; Low Saxon; German, Low; Saxon, Low|bas allemand; bas saxon; allemand, bas; saxon, bas -nep||ne|Nepali|népalais -new|||Nepal Bhasa; Newari|nepal bhasa; newari -nia|||Nias|nias -nic|||Niger-Kordofanian languages|nigéro-kordofaniennes, langues -niu|||Niuean|niué -nno||nn|Norwegian Nynorsk; Nynorsk, Norwegian|norvégien nynorsk; nynorsk, norvégien -nob||nb|Bokmål, Norwegian; Norwegian Bokmål|norvégien bokmål -nog|||Nogai|nogaï; nogay -non|||Norse, Old|norrois, vieux -nor||no|Norwegian|norvégien -nqo|||N'Ko|n'ko -nso|||Pedi; Sepedi; Northern Sotho|pedi; sepedi; sotho du Nord -nub|||Nubian languages|nubiennes, langues -nwc|||Classical Newari; Old Newari; Classical Nepal Bhasa|newari classique -nya||ny|Chichewa; Chewa; Nyanja|chichewa; chewa; nyanja -nym|||Nyamwezi|nyamwezi -nyn|||Nyankole|nyankolé -nyo|||Nyoro|nyoro -nzi|||Nzima|nzema -oci||oc|Occitan (post 1500)|occitan (après 1500) -oji||oj|Ojibwa|ojibwa -ori||or|Oriya|oriya -orm||om|Oromo|galla -osa|||Osage|osage -oss||os|Ossetian; Ossetic|ossète -ota|||Turkish, Ottoman (1500-1928)|turc ottoman (1500-1928) -oto|||Otomian languages|otomi, langues -paa|||Papuan languages|papoues, langues -pag|||Pangasinan|pangasinan -pal|||Pahlavi|pahlavi -pam|||Pampanga; Kapampangan|pampangan -pan||pa|Panjabi; Punjabi|pendjabi -pap|||Papiamento|papiamento -pau|||Palauan|palau -peo|||Persian, Old (ca.600-400 B.C.)|perse, vieux (ca. 600-400 av. J.-C.) -per|fas|fa|Persian|persan -phi|||Philippine languages|philippines, langues -phn|||Phoenician|phénicien -pli||pi|Pali|pali -pol||pl|Polish|polonais -pon|||Pohnpeian|pohnpei -por||pt|Portuguese|portugais -pra|||Prakrit languages|prâkrit, langues -pro|||Provençal, Old (to 1500); Occitan, Old (to 1500)|provençal ancien (jusqu'à 1500); occitan ancien (jusqu'à 1500) -pus||ps|Pushto; Pashto|pachto -qaa-qtz|||Reserved for local use|réservée à l'usage local -que||qu|Quechua|quechua -raj|||Rajasthani|rajasthani -rap|||Rapanui|rapanui -rar|||Rarotongan; Cook Islands Maori|rarotonga; maori des îles Cook -roa|||Romance languages|romanes, langues -roh||rm|Romansh|romanche -rom|||Romany|tsigane -rum|ron|ro|Romanian|roumain -run||rn|Rundi|rundi -rup|||Aromanian; Arumanian; Macedo-Romanian|aroumain; macédo-roumain -rus||ru|Russian|russe -sad|||Sandawe|sandawe -sag||sg|Sango|sango -sah|||Yakut|iakoute -sai|||South American Indian languages|sud-amérindiennes, langues -sal|||Salishan languages|salishennes, langues -sam|||Samaritan Aramaic|samaritain -san||sa|Sanskrit|sanskrit -sas|||Sasak|sasak -sat|||Santali|santal -scn|||Sicilian|sicilien -sco|||Scots|écossais -sel|||Selkup|selkoupe -sem|||Semitic languages|sémitiques, langues -sga|||Irish, Old (to 900)|irlandais ancien (jusqu'à 900) -sgn|||Sign Languages|langues des signes -shn|||Shan|chan -sid|||Sidamo|sidamo -sin||si|Sinhala; Sinhalese|singhalais -sio|||Siouan languages|sioux, langues -sit|||Sino-Tibetan languages|sino-tibétaines, langues -sla|||Slavic languages|slaves, langues -slo|slk|sk|Slovak|slovaque -slv||sl|Slovenian|slovène -sma|||Southern Sami|sami du Sud -sme||se|Northern Sami|sami du Nord -smi|||Sami languages|sames, langues -smj|||Lule Sami|sami de Lule -smn|||Inari Sami|sami d'Inari -smo||sm|Samoan|samoan -sms|||Skolt Sami|sami skolt -sna||sn|Shona|shona -snd||sd|Sindhi|sindhi -snk|||Soninke|soninké -sog|||Sogdian|sogdien -som||so|Somali|somali -son|||Songhai languages|songhai, langues -sot||st|Sotho, Southern|sotho du Sud -spa||es|Spanish; Castilian|espagnol; castillan -srd||sc|Sardinian|sarde -srn|||Sranan Tongo|sranan tongo -srp||sr|Serbian|serbe -srr|||Serer|sérère -ssa|||Nilo-Saharan languages|nilo-sahariennes, langues -ssw||ss|Swati|swati -suk|||Sukuma|sukuma -sun||su|Sundanese|soundanais -sus|||Susu|soussou -sux|||Sumerian|sumérien -swa||sw|Swahili|swahili -swe||sv|Swedish|suédois -syc|||Classical Syriac|syriaque classique -syr|||Syriac|syriaque -tah||ty|Tahitian|tahitien -tai|||Tai languages|tai, langues -tam||ta|Tamil|tamoul -tat||tt|Tatar|tatar -tel||te|Telugu|télougou -tem|||Timne|temne -ter|||Tereno|tereno -tet|||Tetum|tetum -tgk||tg|Tajik|tadjik -tgl||tl|Tagalog|tagalog -tha||th|Thai|thaï -tib|bod|bo|Tibetan|tibétain -tig|||Tigre|tigré -tir||ti|Tigrinya|tigrigna -tiv|||Tiv|tiv -tkl|||Tokelau|tokelau -tlh|||Klingon; tlhIngan-Hol|klingon -tli|||Tlingit|tlingit -tmh|||Tamashek|tamacheq -tog|||Tonga (Nyasa)|tonga (Nyasa) -ton||to|Tonga (Tonga Islands)|tongan (Îles Tonga) -tpi|||Tok Pisin|tok pisin -tsi|||Tsimshian|tsimshian -tsn||tn|Tswana|tswana -tso||ts|Tsonga|tsonga -tuk||tk|Turkmen|turkmène -tum|||Tumbuka|tumbuka -tup|||Tupi languages|tupi, langues -tur||tr|Turkish|turc -tut|||Altaic languages|altaïques, langues -tvl|||Tuvalu|tuvalu -twi||tw|Twi|twi -tyv|||Tuvinian|touva -udm|||Udmurt|oudmourte -uga|||Ugaritic|ougaritique -uig||ug|Uighur; Uyghur|ouïgour -ukr||uk|Ukrainian|ukrainien -umb|||Umbundu|umbundu -und|||Undetermined|indéterminée -urd||ur|Urdu|ourdou -uzb||uz|Uzbek|ouszbek -vai|||Vai|vaï -ven||ve|Venda|venda -vie||vi|Vietnamese|vietnamien -vol||vo|Volapük|volapük -vot|||Votic|vote -wak|||Wakashan languages|wakashanes, langues -wal|||Wolaitta; Wolaytta|wolaitta; wolaytta -war|||Waray|waray -was|||Washo|washo -wel|cym|cy|Welsh|gallois -wen|||Sorbian languages|sorabes, langues -wln||wa|Walloon|wallon -wol||wo|Wolof|wolof -xal|||Kalmyk; Oirat|kalmouk; oïrat -xho||xh|Xhosa|xhosa -yao|||Yao|yao -yap|||Yapese|yapois -yid||yi|Yiddish|yiddish -yor||yo|Yoruba|yoruba -ypk|||Yupik languages|yupik, langues -zap|||Zapotec|zapotèque -zbl|||Blissymbols; Blissymbolics; Bliss|symboles Bliss; Bliss -zen|||Zenaga|zenaga -zgh|||Standard Moroccan Tamazight|amazighe standard marocain -zha||za|Zhuang; Chuang|zhuang; chuang -znd|||Zande languages|zandé, langues -zul||zu|Zulu|zoulou -zun|||Zuni|zuni -zxx|||No linguistic content; Not applicable|pas de contenu linguistique; non applicable -zza|||Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki|zaza; dimili; dimli; kirdki; kirmanjki; zazaki \ No newline at end of file diff --git a/librarian/res/atrium-logo.png b/librarian/res/atrium-logo.png deleted file mode 100644 index 35af904..0000000 Binary files a/librarian/res/atrium-logo.png and /dev/null differ diff --git a/librarian/res/cover-bookoteka.png b/librarian/res/cover-bookoteka.png deleted file mode 100644 index 7196bcf..0000000 Binary files a/librarian/res/cover-bookoteka.png and /dev/null differ diff --git a/librarian/res/cover-gandalf.png b/librarian/res/cover-gandalf.png deleted file mode 100644 index a5c8f50..0000000 Binary files a/librarian/res/cover-gandalf.png and /dev/null differ diff --git a/librarian/res/cover-prestigio.png b/librarian/res/cover-prestigio.png deleted file mode 100644 index b56843f..0000000 Binary files a/librarian/res/cover-prestigio.png and /dev/null differ diff --git a/librarian/res/cover.png b/librarian/res/cover.png deleted file mode 100644 index 0a1511e..0000000 Binary files a/librarian/res/cover.png and /dev/null differ diff --git a/librarian/res/ebookpoint-logo-white.png b/librarian/res/ebookpoint-logo-white.png deleted file mode 100644 index 7a2eb8e..0000000 Binary files a/librarian/res/ebookpoint-logo-white.png and /dev/null differ diff --git a/librarian/res/embeds/latex/template.tex b/librarian/res/embeds/latex/template.tex deleted file mode 100644 index 8e4b807..0000000 --- a/librarian/res/embeds/latex/template.tex +++ /dev/null @@ -1,9 +0,0 @@ -\documentclass{article} -\usepackage{unicode-math} -\setmathfont{Latin Modern Math} -\pagestyle{empty} -\begin{document} - -$%(code)s$ - -\end{document} diff --git a/librarian/res/embeds/mathml/mathml2latex.xslt b/librarian/res/embeds/mathml/mathml2latex.xslt deleted file mode 100644 index 92f60fc..0000000 --- a/librarian/res/embeds/mathml/mathml2latex.xslt +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - \textrm{ - - } - - - - - - - - - - - - - - - - { - - }^{ - - } - - - - { - - }_{ - - } - - - - { - - } - - - - ( - - ) - - - - \frac{ - - }{ - - } - - - - \varepsilon - - - diff --git a/librarian/res/fnp-logo-white.png b/librarian/res/fnp-logo-white.png deleted file mode 100644 index c771f05..0000000 Binary files a/librarian/res/fnp-logo-white.png and /dev/null differ diff --git a/librarian/res/hyph-dictionaries/README_hyph_de.txt b/librarian/res/hyph-dictionaries/README_hyph_de.txt deleted file mode 100644 index b27906a..0000000 --- a/librarian/res/hyph-dictionaries/README_hyph_de.txt +++ /dev/null @@ -1,41 +0,0 @@ -Hyphenation dictionary "hyph_de_DE.dic" ---------------------------------------- - -Language: German (de DE) - according to the reform of 2006-08-01 (i.e. reformed or new spelling) - -Version: 2013-12-06 - Enhanced blacklist to improve the hyphenation module by Karl Zeiler - -Origin: Based on the TeX hyphenation tables "dehyphn.tex", revision level 31. - http://www.ctan.org/tex-archive/language/hyphenation/dehyphn.tex - The TeX hyphenation tables are released under the LaTeX Project - Public License (LPPL) - -License: OpenOffice.org Adaptions of this package are licensed under the - GNU Lesser General Public License (LGPL 2 or later) and are under - Copyright by - -Author: conversion author: Marco Huggenberger - revised conversion and extensions: Daniel Naber - improvements: Karl Zeiler - -Note: This dictionary is based on syllable matching patterns - and thus should be suitable under other variations of German: - HYPH de AT hyph_de_AT - HYPH de CH hyph_de_CH - - -Trennmuster (hyph_de_DE.dic) ----------------------------- - -Die Trennmuster (hyph_de_DE.dic) basieren auf den TeX Trennmustern -"dehyphn.tex", revision level 31. -Lizenz der Trennmuster: LPPL. Die Anpassung der Trennmuster an -den in OpenOffice.org benutzten "ALTLinux LibHnj Hyphenator" wurde -mit dem Script substrings.pl durchgeführt, das unter -http://lingucomponent.openoffice.org/hyphenator.html als Teil der -Datei altlinux_Hyph.zip heruntergeladen werden kann. -Die Original-Trennmuster können hier heruntergeladen werden: -http://www.ctan.org/tex-archive/language/hyphenation/dehyphn.tex - diff --git a/librarian/res/hyph-dictionaries/README_hyph_fr.txt b/librarian/res/hyph-dictionaries/README_hyph_fr.txt deleted file mode 100644 index dbb7210..0000000 --- a/librarian/res/hyph-dictionaries/README_hyph_fr.txt +++ /dev/null @@ -1,70 +0,0 @@ -_____________________________________________________________________________ - - Motifs de division des mots pour le français (fr) - Version 3.0 - - Licence : GNU LGPL. - - Origine : Basé sur les motifs de division de TeX *hyph-fr.tex*, - version renommée (juin 2008) du fichier *frhyph.tex* (V2.12, 2002/12/11) - pour la cohérence avec d'autres fichiers de motifs de division - de la collection hyph-utf8. Voir http://tug.org/tex-hyphen - pour plus d'informations. - Les motifs de division de TeX sont publiés sous la licence LaTeX - Project Public License (LPPL) -- http://www.latex-project.org/lppl.txt - - Licence : Les adaptations pour OpenOffice.org sont publiées sous la licence - GNU Lesser General Public License (LGPL) - version 2.1 ou supérieure -- http://www.gnu.org/licenses/ - - Auteurs : - 3.0 Marc Lodewijck - 2.0 Paul Pichaureau - 1.0 Blaise Drayer - - Journal : - 3.0 Nouvelle version révisée et augmentée : - + Conversion au format de codage Unicode UTF-8 - + Traitement des noms composés à trait d'union - + Redressement de motifs altérés - 2.0 Traitement des mots avec apostrophe - 1.0 Première conversion - - Ce dictionnaire devrait être conforme à toutes les variantes régionales du - français. - -_____________________________________________________________________ - - French word hyphenation patterns - Version 3.0 - - Language: French (fr). - - License: GNU LGPL. - - Origin: Based on the TeX hyphenation tables *hyph-fr.tex*, - renamed (June 2008) from *frhyph.tex* (V2.12, 2002/12/11) - for consistency with other files with hyphenation patterns - in hyph-utf8 package. See http://tug.org/tex-hyphen for more details. - The TeX hyphenation tables are released under the LaTeX Project - Public License (LPPL) -- http://www.latex-project.org/lppl.txt - - License: OpenOffice.org adaptions of this package are licensed under the - GNU Lesser General Public License (LGPL) - version 2.1 or higher -- http://www.gnu.org/licenses/ - - Authors: - 3.0 Marc Lodewijck - 2.0 Paul Pichaureau - 1.0 Blaise Drayer - - Log: - 3.0 New revised and expanded version: - + Conversion to UTF-8 Unicode encoding - + Processing of hyphenated compounds - + Correction of altered patterns - 2.0 Fix for words with apostrophe - 1.0 First conversion - - This dictionary is based on syllable matching patterns and therefore should - be usable under other variations of French. diff --git a/librarian/res/hyph-dictionaries/README_hyph_lt.txt b/librarian/res/hyph-dictionaries/README_hyph_lt.txt deleted file mode 100644 index 5b0ea68..0000000 --- a/librarian/res/hyph-dictionaries/README_hyph_lt.txt +++ /dev/null @@ -1,19 +0,0 @@ -Hyphenation dictionary for Lithuanian -===================================== - -You're looking at the hyphenation tables for OpenOffice for -Lithuanian. - -Language: Lithuanian (lt_LT) -Origin: TeX hyphenation tables by Sigitas Tolusis and Vytas - Statulevicius. The original tables can be found at - http://www.vtex.lt/tex/download/zip/texmf.zip as lthyphen.tex. -Author: Converted to OOo format by Albertas Agejevas -License: LaTeX Project Public Licence - -To enable hyphenation for Lithuanian in OpenOffice, go to -Tools->Options->Language settings->Writing Aids and maybe set -Tools->Options->Language settings->Languages->Western->Lithuanian. - -Then, enable hyphenation in chosen paragraphs by checking -Format->Paragraph->Text Flow->Hyphenation->Automatically. diff --git a/librarian/res/hyph-dictionaries/README_hyph_pl.txt b/librarian/res/hyph-dictionaries/README_hyph_pl.txt deleted file mode 100755 index 23758e8..0000000 --- a/librarian/res/hyph-dictionaries/README_hyph_pl.txt +++ /dev/null @@ -1,37 +0,0 @@ -Hyphenation dictionary ----------------------- - -Language: Polish (pl PL). -Origin: Based on the TeX hyphenation patterns plhyph.tex, -version 3.0a, Wednesday, May 17th, 1995 - -The first version of the patterns was developed -by Hanna Ko³odziejska (1987). - -The adaptation to the LeX format (see below) and extensive modification -were done by Bogus³aw Jackowski & Marek Ryæko (1987--1989). - -The hyphenation rules were further improved and adapted to the -TeX 3.x requirements by Hanna Ko³odziejska (1991). - -Lone-standing version (3.0a) of patterns was prepared (under pressure -from LaTeX users) by Bogus³aw Jackowski and Marek Ryæko, following -Mariusz Olko's suggestions, 1995. - -The LeX format mentioned above was the first version of the adaptation -of TeX to the Polish language. The next version is called MeX. - -The original macro file plhyph.tex belongs to the public domain -under the conditions specified by the author of TeX: - - ``Macro files like PLAIN.TEX should not be changed in any way, - except with respect to preloaded fonts, - unless the changes are authorized by the authors of the macros.'' - - Donald E. Knuth - -Current license: GNU LGPL license. -Author: conversion and corrects author is - Artur Polaczyñski - -HYPH pl PL hyph_pl_PL \ No newline at end of file diff --git a/librarian/res/hyph-dictionaries/hyph_de.dic b/librarian/res/hyph-dictionaries/hyph_de.dic deleted file mode 100644 index aefa716..0000000 --- a/librarian/res/hyph-dictionaries/hyph_de.dic +++ /dev/null @@ -1,7760 +0,0 @@ -ISO8859-1 -#################################################################################### -# This is the hyphenation file "hyph_de_DE.dic" of the German dictionary # -# according to the reform of 2006-08-01 (i.e. reformed or new spelling) # -# # -# Language: German (de DE) # -# # -# Version: 2013-12-06 # -# Enhanced blacklist to improve the hyphenation module by Karl Zeiler # -# # -# Origin: Based on the TeX hyphenation tables "dehyphn.tex", revision level 31. # -# http://www.ctan.org/tex-archive/language/hyphenation/dehyphn.tex # -# The TeX hyphenation tables are released under the LaTeX Project # -# Public License (LPPL) # -# # -# License: OpenOffice.org Adaptions of this package are licensed under the # -# GNU Lesser General Public License (LGPL 2 or later) and are under # -# Copyright by # -# # -# Authors: conversion author: Marco Huggenberger # -# revised conversion and extensions: Daniel Naber # -# improvements: Karl Zeiler # -# # -# Please note, this dictionary is based on syllable matching patterns # -# and thus should be suitable under other variations of German # -# # -# HYPH de DE hyph_de_DE # -# HYPH de AT hyph_de_AT # -# HYPH de CH hyph_de_CH # -#################################################################################### - -.aa6l -.6a1ba -.ab3a4s -.a1be -.ab3ei -.a1bi2 -.ab3it -.a1b1l8 -.a1b1r -.a1b3u -.a1d -.a1do -.ad3o4r -.a2l1t -.alti6 -.a3na3c -.an5a2l1g -.a1n1e -.an2gs -.ang8s2t1 -.a6n1s -.ap1p -.a2r1s -.ar6sc -.a2r1t -.ar6ta -.8ar6tei -.as2z -.au2f1 -.au2s3 -.1be -.be5er1b -.be3na -.be2r1t -.ber6t5r6 -.1bi -.b6ie -.bie6r5 -.bi2ms -.bim6s5t -.1br -.brot3 -.br6u6s -.c8h6 -.1che6f5 -.1da8c -.da2r -.d2a1ri -.dar5in -.da1r5u -.1de -.den6ka -.de1re -.de5r6en -.de1sp2 -.des6pe -.de8s2p2o -.de3s1z -.1di -.dia3s4 -.dien4 -.dy2s1 -.e6hr -.eh1re -.ehre6n5 -.ei1ne6 -.ei6n5eh -.ei8nen -.ei6ns -.ein5sa -.e2n1d -.en1de -.en6der -.en6d5r4 -.en3k4 -.en8ta8 -.en1te -.en8tei -.en4t3r6 -.e1p2o1 -.er1b -.er1ba -.er6ban -.er1be -.er6b5ei -.erbl8 -.er6bla -.e8rd -.er1du -.er6d5um -.e1re -.2er3ei -.e1r5er -.2e1ri -.er3in -.er3o4b -.er1w -.erwi5s -.e1s1p2 -.e2s8t1l -.es8t1n -.ex1a2 -.ex3em -.fa2ls -.fal6sc -.1fe -.fe6s1t5a -.flu4g3 -.1fu -.furc8h8 -.1ga -.ga1ne -.ga6ner -.1ge -.ge3n4a -.ge5rö8 -.ge1s6 -.ha2lb5 -.hal1be6 -.hal6br -.haup4 -.hau4t -.hei1ma6 -.he4r3e -.her6za -.he5x -.hin3 -.hi2r1s -.hir8sc -.ho4c -.hu3sa -.hy5o -.i1be5 -.i1ma -.ima6ge -.in1 -.i1ni6 -.isc8h -.i1s5chi -.ja6gd5 -.1ka -.ka6l1k -.kal6k5o -.ka6ph -.ki4e -.1k2o -.kop6f3 -.1kr8 -.kraf6 -.1kü -.kü5ra -.la2b1b -.lab6br -.1li -.l8i1i -.liie6 -.lo6s5k2 -.1lös -.lö4s3t -.1ma -.ma5d2 -.1mi -.mi2t1 -.no6th -.no1to -.no6top -.o1be -.ob2e8ri -.o1b1l8 -.o8bs2 -.ob6s1t5e -.or3c -.o2r1t -.or2ts -.ort6s5e -.o1st3a -.os1te -.oste8r -.1pe -.p8er -.pe4re6 -.pe3t2s -.1ph6 -.1p2o -.po8str6 -.r6au4m3 -.re5an -.ro8q -.ru5the -.rü5b6e2 -.sc8h8 -.1se -.se6e -.se5n6h -.se5ra -.1si -.si2e -.sp2 -.1spi -.spi1k -.spi6ke -.st4 -.1sy -.sy2n1 -.1tag -.ta1ge -.tage4s5 -.tan6kl8 -.ta8th -.te6e -.te8str6 -.to1d -.to1de4 -.to6der -.t8o1ni -.to8nin -.to6we -.um1 -.u2mp -.umpf4 -.un1 -.u1ne6 -.un1ge -.ung8e5n -.ur1c -.u1re -.ur5en -.1ve -.ver1 -.v2e1ri -.ve6rin -.v2or1 -.vora8 -.1wah -.wah6l5 -.1weg -.we1ge -.we8ge1s -.we8s2t -.wes3te -.wo6r -.wor3a -.wu6n4s -.1zi -.zi4e -.1zu -.z2uc -.zuc8h8 -.ä2n1d -.än1de -.ände8re -.öc8h8 -aa1c -aa2gr4 -aa1l5e -aa6r5a -aa2r1t -a5arti -aa2s1t -aa2t2s -6a1ba -ab3a2r1t -a2b1d -1abdr4 -a1be -6ab8el -abe2n1d -aben6dr4 -ab5e6rk -ab5e2r1r -ab5e2s1se -1a2b1f8 -1a2b1g2 -a2b1h -1abhä -a1bi -ab1ir -a2b1k2 -1ab1k2o -a1bl8 -ab1la -5a6blag -a6bl8aß -ab4ler -a1b1lu -a8blä -5a6blö -a2b1m -ab1ma -abma5c -1a2b1n -a1br -ab1ra -ab1re -5a6brec -ab1ro -a8b1s -ab8s1k2 -abs2z -a2b1t -3abtei -a1bu -ab1ur -1a2b1w -a8b1z -5ab1ze -5ab1zu -a1bä -ab1än -abäu8 -a1ce -a4ce. -ac8h -a5chal -ach5a2r1t -ach5au -a1che -a8chent -ach6er. -a6ch5er1f -a1chi -ach1l6 -a6ch3m -a2ch5n6 -a1cho -ac6hr -ach3re -a1chu -a8ch1w -a1chy -ach5äf -ac2k -ac1k2o -a2c2ks -acks6t8 -ack5sta -a1d -8ad. -a6d5ac -ad3ant -ad8ar -a2d1d -5ad1di -a1de -a8dein -ade5o8 -a1di -adi5en -1ad1j -a2d1l -1adle -a1do -ad1op -adr4 -a2dre -3adres -a2dt1 -1a2d1v -a6dä -a1e2d -ae1r -a1er. -1aero -8afa -a3fal -af1an -a5far -a5fat -af1au -a1fe -a6fen2t1l -a2f1ex1 -a2ff -af1fr6 -afr6 -af5rau -af1re -1afri -a2ft -af1te -af6tent -af1tr6 -af6tra -aft5re -a1fu -a6f5um -8a1fä -a1ga -ag5a1be -a1ge -5a4gent -ag8er -age1s -age1s5e -a2g1g -1ag1gr4 -a1g5las -ag1lo -a1gn8 -ag2ne -a1go -1a2g8o1g -a1gu -a6g5u2n1d -a1ha -a1he -a2h5ein -a4h3er1h8 -a1hi -ahl1a -ah1le -ah1ma -ah4m3ar -ahn1a -a5ho -a6hr -ahra6 -ahr5ab -ah1re -ah8rei -ahre6n8s -ahre4s3 -ah2r1t -ahr8ti -ah1ru -a1hu -ah8ö -ai1d -ai3d2s -ai1e -a2if6 -ai6ns -a3in1se -ai1re -ai4re. -aisc8h -a5i8s2ch. -ai1s8e -ai2s1m -a3ismu -ais6n -ai1so6 -a1j -a1ka -1aka1d -a4ka1de -a1ke -a1ki -a2k1k2 -1ak1k2o -a1kr8 -5akro1 -a5lal -al5a6ns -3al8a6r1m -a2lb -al1be -al8be1b -al8ber1w -albl8 -alb5la -al1bu -3album -a8l1c -a1le -ale1b -a6l5e6be -a4l3ein -a8lel -a1ler -a8ler1b -a8ler1h8 -a6le2r1t -5a6l5eth -a2l1g -1al1gi -al4g1li -a1li -a2l3int -a6ll -al1la -al4lab -al8lan -al4l3ar -al1le -alle3g -a1lo -a4l5ob -a2ls -al1sc -alsc8h -al6s6ch2m -a2l1t -al4the -altr6 -al4t3re -8a1lu -al6u5i -a6lur -alu3ta -a1lä -a1ma -a6ma1te -a1me -8ame. -5a6mei1se -a2m1m -am1me -am6m5ei -am6mum -am2n8 -a2mp -ampf3a6 -a2ms -am1sc -amsc8h -am6s8chw -a2m1t -am2ta -a1mu -a1mä -a3na2c -a1na1d -ana1di -anadi5e -an3a1k2o -an3a6l1p -3a8na1ly -an3a1me -an3a2ra -a1nas -an5as1ti -a1nat -ana2t5s -a2n1d -an1de -an8dent -ande4s3 -a1ne -a2n1ec -a8n5eis -an1e2k -4aner. -a6n5e8rd -a8ner1f -ane6rk -a6n5er1ke -an1f -1anfa -an1fe -5anfe2r1t -1an1fä -an1ga -3angab -an1ge -ange1b -5ange1bo -an3g1li -ang6lis -an2gn8 -an1gr4 -3angri -an2g5t6 -an1h -5anhä -a1ni -ani5g -an6i1k -ani4ka -an2io -an5i8on -an1kl8 -an1k2n8 -an6kno -an1kr8 -an4kro -1an5l6 -an1m -an1ma -anma5c -anmar4 -an1na -3an1n2ah -an1ne -anne4s3 -a1no -5a6n1o2d -5a6n3o1ma -5a6no8rd -1an1r -a6ns -an1sa -an1sc -ansc8h -5anschl6 -an1so -an4so1z -an1st -an1sta -5anstal -an1s2z -an1te -5antenn -an1th -a8n1w -5anwä -a5ny -an1ze -an4z3e1d -5anzeig -an1zi -5anzieh -an1zu -3anzug -an1ä -5anäs -a1nö -anö8d -a1os -a1pa -ap1fe -3apfel -a1ph -a2ph1t2 -aph5ä6 -a1pi -8apl8 -a1p2o -apo1c -apo1s -a6pos2t -a6po1th -1ap1pa -ap1pr6 -a1pr6 -a5pä -a3pü -a1ra -a4r3af -a2r3a6ll -ar1b -ar1be -3arbei -2ar2b1t -ar1c -2a1re -ar3ein -a8r1g -ar2gl -2a1ri -ar2ie -ari5es -a6rk -ar1ke -ar8ke2r1s -ar1l -ar6les -a2rn -ar1na -ar4nan -ar5o6c8h -ar1o2d -a1rol -ar2on -ar3ony -a8ror -a3ros -ar5ox -a2r1s -arsc8h -ar6schl6 -a2r1t -8ar5tei -artr6 -ar6t5ri -a1ru -a1ry -1ar2z1t -arz1w8 -ar8zä -arä8m -arö6 -ar5öm -ar1ü2 -a1sa -asc8h -a1sche -a6schec -asch5l6 -as6ch3m -a6s2chn6 -as1h -a3s4hi -asp2 -as1pa -asp5l8 -as1te -as5te1v -1a2sth -a1str6 -ast3re -8a1ta -ata5c -ata3la -a6tapf -at8a5pl8 -a1te -a6te1li -aten5a -ate5ran -6a2t1f2 -6a2t1g2 -a1th -ath6a -at3hal -1a2th1l -2a1ti -a2t1l -atl8a -5atlant -3atlas -a2t1m8 -8atmus -6a2t1n -a1to -a6t5ops -ato6ra -ato2r1t -a6t5ort. -4a1tr6 -a6t5ru -a2t1t -at2t1h -at5t6hä -6a1tu -a2tz -atz1w8 -a1tä -a1tü -au1a -au1br -au6bre -a2uc -auc8h -auch3a -au1e -aue4l -au1fe -5au4f3ent -au2ff -3auf1fü -au2f1g2 -3auf1ga -1au2f1n -au2f1t -3auf1tr6 -1au2f1w -au1ge -3auge. -a6uk -au1kl8 -au4kle -au1le -aule8s -6aum -au1ma -au8mar -au2m5p -1au2s1b2 -3au2s1d -1au2s1f2 -1au2s3g2 -au1si -au8sin -au4sta -1au2s1w -1aus1z -au1te -aut5eng -au1th -1au1to -au1ße8 -a1v -a1ve -aver1 -ave5r6a -av2e1r6i -a1w -a6wes -a1x -a1xi -a2xia -a6x2io -a1ya -a1z -a1zi -azi5er. -8aß -1ba -ba1d -ba1de -8ba8del -ba1la -ba1na -ban6k5r8 -ba5ot -ba8rd -bar1di -bardi6n -ba1ro -bas1te -basten6 -bau3sp2 -2b1b -bbl8 -bb6le -b2b1li -2b1c -2b1d -1be -be1a -be8at. -be1c8h -8be2cht -bec2k -8be1cke. -be5el -be1en -bee3r4e -be2e8rei -be5e1ta -be1f2 -8be2ff -be1g2 -be1hö8 -bei1s -bei1se -6b5eisen -bei3tr6 -b8el -b4e1l8o -be1lu -belu3t2 -be3na2c -be2n1d -ben1d6o -be1ne -be6n5e2r1s -be6n5er1w -be1no -be4nor -be6ns -ben4se6 -bens5el -be1nä -be1nü -be1o2 -b8er. -be1ra -be8rac -be8r1g -ber1ga -ber8gab. -be2r1r -be1rü -be1s8c -be1se -bes5er1h8 -be1s2p2 -be5th6a -be2ts -bet5sc -be1un -be1ur -8bex -be1z -bezw8 -be6zwec -2b1f8 -2b1g2 -b1ga -bga2s5 -b1ge1 -2b1h -bho1le6 -1bi -bi1bl8 -b6ie -bi1el -b2il -bi1la -bi1lä5 -bi1na -bi1no -bi4no1k -bi6stu -bi5tr6 -bi2t1t -bit4t5r6 -b1j -2b1k2 -b1kü6 -bl8 -b6la. -6b1la1d -6blag -8blam -1blat -b8la2t1t -3blau. -b6la1v -3ble. -b1le1b -b1le1d -8b1leg -8b1leh -8blei1d -8bleih -6b3lein -bl4e4m3o2 -b1li -4blic8h -b4li2n1d -8bling -b2l2io -5blit -b4li2tz -b1loh -8b1los -1blu -5blum -2b1lun -blut3a -blu2ts -blut5sc -3blä -blä6s5c -5blö -3blü -blü8sc -2b1m -2b1n -1bo -bo1c8h -bo1d -bo5d6s -boe5 -8bo2ff -8bon1k -bo1ra -b1o2r1t -2b1p2 -b1q -1br -bra2il6 -brast8 -bre4a -b5re1d -8bre1f -br2ie -8b5riem -b1r2ig -b6ri1ga -bro1s -b1rup -b2ruz -8bröh -brö2s5c -8bs -b1sa -b8sang -b2s1ar -b1sc -b1se -bs3er1l -bs3erz -b1so -b8sof -b1s2p2 -b2st1h -bstr6 -b3stru -b5stä -b1su -b6sun -2b1t -b2t1h -1bu -b6ui -bu1ie -bu6l6k -b8u1re -bu1si -bu6sin -6b1v -2b1w -1by1 -by1t -by6te. -8b1z -1bä -b5ä6s5 -1bü -bü1b6e2 -b3ü4ber1 -b6ü5be1re -bü1ge6 -büge1l5e -bü2r1s -bür6sc -1ca -cag6 -ca5la -c2a6re -ca5y -c1c -1ce -ce1li -celi4c -celic8h5 -ce1ro -c8h -2ch. -1c8hae -ch1ah -ch3a2k1t -cha1me -cha6mer -8c6hanz -5cha1ra -3ch2a1ri -5cha1to -6ch1b2 -1che1f -6chei -ch3e2il -ch3eis -che6rk -6cher1kl8 -6ch1f2 -4ch1h -5chia1d -5chias -6chi6ns -8ch1j -chl6 -5ch4lor -6ch2m -2chn6 -ch1ni -ch8n6ie -5cho. -8chob -c2hoi -choi8d -6ch1p -c6hr -ch3ren -ch6res -ch3rü -2chs -2cht -cht5h6a -cht3hi -5chth2on -ch1ti -ch6tin -6chuh -chu4la -6ch3unt -chu2t6t -8chw -1ci -ci5tr6 -c2k -2ck. -ck1ei -4c2k1h -ck3l8 -ck3n8 -c1k2o -ck5o8f -c1k1r8 -2c2ks -ckst8 -ckstr6 -ck5stra -ck6s5u -c2l -1c8o -con6ne -8cor1b -cos6t -c3q -1c6r -8c1t -1cu -1cy -5cä1 -cö5 -1da. -8daas -2d1a2b1g2 -8da1br -6da2b1t -6d1a2b1w -1dac -da2gr4 -6d5a6l1k -8d5a2m1t -dan1c -dan1ce -dan6ce. -da1ni -dan6ie -dani5er -dan1ke -dan8ker -2d1an5l6 -danla6 -6da6ns -8dan1zi -6dan1zu -d1ap -da2r1a8 -2d1ar1b -d3ar1c -da6r1m -dar1me -dar6men -4d3a2r1t -8darz -1dat -8da2t1m8 -2d1auf -2d1aus -2d1b -2d1c -2d1d -d5de -d3d2h -d1dä -ddä2m1m -ddäm1me8 -1de -2deal -de5an -dec8h -de3cha -de1e -de1f -de1fe6 -6de2ff -2d1e6hr -5d4eic -de5isc -de1la -de8lar -de2ls -del6s5e -del1sp2 -del6spr6 -de1ma -de4mag -de1mu -de8mun -de1ne -de8nep -dene6r -den1ge -8denge. -8deng8en -de5o6d -2deol -de5ram -de8rd -8der2d1b -de1re -d2erei -der5ein -de1ro -de2r1r -d8e2r1s -d2e1ru -der5um -de1sa -de4s3am -de4s3an -de4sau -de1si -de6s2il -de4sin -de1so -de8sor -de1sp2 -de4spr6 -de2su -8deul -de5us. -2d1f -df2l -2d1g -2d1h -1di -dia5c -di5a1ra -di1ce5 -dic8h -di3c6hr -di5ena -di1gn8 -d2il -di1la -di2l8s -di1na -8di2n1d -6din1f -4d3in1h -2d1i6ns -d2io -di5o6d -d2ip -di3p4t -di1se -di8sen -dis1p2 -dis1pe -di5s8p8er -di6s5to -dis3tr6 -di1ta -di8tan -di1ti -di8tin -d1j -6dje -2dju -2d1k -2d1l -2d1m -2d1n6 -d1ni6 -dn1j -dnje6 -1do -6d5o1be -do6ber1f -6d5ony -do3ran -6do8rd -2d1o8r1g -do2r1t -dor4t3h -6do1th -do2t1t -dott8e -2d1p -d5q -dr4 -1drah -8drak -d5r6a2n1d -6d1re. -4drec8h -d6rec2k -4d3reg -8d3reic -dre2if -d5rei1fe -8drem -8d1ren -2d1rer -8dres. -6d5r1h8 -1dria -d1ric -8dri2n1d -droi6 -dro5x -1dru -8drut -drö2s5c -1drü -drü5b -drü8sc -2ds -d1sa -d6san -d1sat6 -d1sc -dsc8h -5d6scha. -d1schi -5dschi1k -d1se -dse8e -d8se8r1g -8ds1l -d1sp2 -d4s1pak -ds2p2o -d8spä -d1st -d1sü -2dt -d1ta -d1te -d1ti -d1to -d2t1s6 -d1tu -d5tä -1du -du5a2ls -du1b6 -du1e -du2ft -duf4t3r6 -4d3uh -d6ui -du5ie -8du2m1l -8du2m1w -2d1u2n1d -du8ni -6d5unt -dur2c -durc8h3 -6dur1l -du2r1s -6dursa -8du2r1t -dus1t -dusc8h -du8sc6hr -2d1v -2d1w -dwa8l -2d1z -1dä -6däh -8dä2n1d -dä6r -dö1b -dö8bl8 -d5öl -dör1f -dör6fl -dö8sc -d5ö4st -1dü -ea1be -ea4ben -e1ac -e1ah -e1a2k1t -e1al. -e5al1f -e1a2l1g -ea1li -e5a8lin -e1a6l1k -e1a6ll -e5a6l1p -e1a2l1t -e5a2l1w -e1am -e1a2n1d -ea1ni -ea6nim -e1ar. -e5ar1f -e1a6rk -e5a6r1m -e3a2r1t -e5at. -e6a1te -e6a5t6l -e8a2ts -e5a2t1t -e6au. -e1aus -e1b -e1ba -e6b5am -e1be -ebe6ns -eben4s5e6 -ebl8 -eb1li -eb4lie -e8bs -eb1se -eb4ser -eb1si -eb4s3in -ec8h -e1che -e8cherz -e1chi -e6ch3m -8e2ch3n6 -ec6h1r -e2chs -ech1se -ech8se2n1d -ech4su -e1chu -ec2k -ec1ka -eck5an -e5c2l -e1d -ee5a -ee3e -ee5g -e1ei -ee5isc -eei4s3t -ee1le -ee6le2n1d -e1e6ll -ee5lö -e1e8rd -ee3r4e -ee8reng -eere6s5 -ee5rä -ee1ta -ee6tat -e1ex -e1f -e6fau -e1fe -e8fe8b -e2ff -ef5fe -3effek -efr6 -ef3rom -e1ge -ege6ra -eg1los -eglo6si -1egy -e1ha -e6h5ac8h -eh5a6ns -e6hap -eh5auf -e1he -e1hi -ehl3a -eh1le -eh3l5ein -eh1mu -eh1ne -eh2n5ec -e1ho -e6hr -ehr1a -eh1re -ehre6n -eh1ri -eh1ru -eh6r5um -e1hu -eh1w -e1hy -e1hä -e1hö -e3hüt -ei1a -eia6s -ei1ba -ei6bar -eic8h -eich3a -eic6h5r -ei1d -ei4dar -ei1de -ei6d5ei -ei8der1f -ei2ds -ei3d4sc -ei1e -e2if -ei1fe -8eifen -eifr6 -3eifri -1eign8 -e2il -ei6l1d -ei1ma -ei6mab -ei8mag -ein1a4 -ei8nat -ei1ne -ei8ner1h8 -ei8ness -ei6ne1te -ein1g -e8i1ni -ein1k -ei1no -ei6n5o1d -ei8no1k -ei4nor -ei6ns -e3in1sä -e2i1o -e1i2rr -ei5ru -ei1sa -ei8sab -eisc8h -ei5s2chn6 -ei1se -ei6s5ent -ei1so -ei8sol -ei1ta -ei4t3al -eit3ar -eit1h -ei6thi -ei8tho -ei2ts -eit1sam -eit8sa2m1t -ei1tu -ei6t5um -e1j -1e4k1d -e1ke -e1ki -e1k2l8 -e1kn8 -ek2ni4 -e1la -e2l1al -6elan -e6lan1f -e8l1an5l6 -e6l5a6ns -el3ar1b -el3a6r1m -e6l3a2r1t -5e6las1ti -e6lau1ge -e2lb -el8bs -elb1st5a -e1le -6ele1f -ele6h -e6l5e1he -e8le2if -e6l5ein1h -1elek -e8lel -3ele1me -e6lemen -e6len1te -e6l5e1pi -e1ler -e4l3e2rr -ele2r1s -e6l5ersc -el1f -elf2l -e2l1g2 -e1li -e6l5i6ns -e6ll -el1le -el1l8er -4e1lo -e4l3o1fe -e2ls -el1so -el8soh -e2l1t -el5ten -el8tent -5elte2rn -e1lu -elut2 -e1lä -e1lü -e2m1d -em1de -em8dei -e2m1m -em1me -em8meis -4e1mo -emo5s -e2mp -1emp1f -1emp1t -e2m1t -1emto -e1mu -emu6rk4 -emur2ks5 -e1mä -ena1be -en5a6ben -ena2c -enac8h -en5a2chs -en5ac2k -e1na1d -en5af -en5a6ll -en3a2l1t -en1am -en3an. -en3ant -en3anz -en1a6p -en1ar -en1a6s -6e1nat -e4n3auf -en3aus -en1c -en2ce -e2n1d -enda6l -en1de -end5er1f -end5e8r1g -en8dess -e1ne -4ene. -e2nec -en5ec2k -ene1f -e8ne2ff -e6n5e6hr -e6n5eim -e8n3eis -6enem. -6enen -e4nent -4ener. -e8ne8rd -e6n3er1f -e4ne8r1g -5ener1gi -ener1l -e6n5erla -en5e2r1s -e6nerst -en5er1w -6enes -e6n5ess -e2nex -en3glo -2e1ni -en1ni -enn6i6s5 -en1no -enn6os4 -en6ns8 -e1no -eno1be -e6nober -eno8f -e6n5opf -e4n3o8rd -e6ns -en1se -en8se2r1s -ens1k2 -ens8kl8 -en1sp2 -ens1p2o -ens6por -en1ta -en5t6ag -en4t3a5go -en1te -enter1b -en8ter1bu -en1ti -en6ti1d -en2t1l -3entl8a -en1tr6 -ent5ric -en2t1w -5entwic -5entwu -1en2t1z -e1nu -en6u5i -e3ny -en1za -en8zan -en1öf -e1nös -e1nüg -eo1c -e5o6fe -eo1k -e5o2k1k2 -e1on. -e3on1f -e5on1k -e5on5l6 -e5on1r -e5opf -e5ops -e5or. -e1o8rd -e1o8r1g -eo5r6h8 -eo1t -e1pa -e1pe -e8pee -e6p5e6g -ep5ent -e1p2f -e1pi -5epi1d -epi1de -e6pidem -e1pl8 -e1p2o -5epos -e6pos. -ep4p3a -e1pr6 -e1pä -e1q -e1ra. -er5aal -8er6a1ba -era1be -e5r6ab8el -er5a6ben -e5ra1bi -er3a8b1s -er3ac8h -era5e -era5k6l8 -e2r3a6ll -er3a2m1t -e3r6a2n1d -e3ra1ne -er3a6ns -e5r8anz. -e1rap -er3ar1c -e3r2a1ri -er3a6si -e1rat -era2t3s -er3auf -e3r6aum -er1b -er8bs -3erb1se -er1c -e1re -4e5re. -er3ec2k -er5e2g1g -e2r5e2h -2erei -e3r4ei. -e8rei1ne -e6r5ein1r -6eren. -e4r3en1m -e1rer -4erer. -e6r5e6r1m -er5er5o -ere2r1s -er5erst -e4r3erz -e2r3ess -er1f -er1fü -5erfül -e8r1g -er1ga -er8gan. -er1ge -erge1b -5erge2b1n -er2g5h -er1gä -5ergänz -er1h8 -5erhö1hu -2e1ri -eri5ak -e6r5iat -e4r3i2n1d -e6r5i6n5i6 -er5i6ns -e6r5int -er2it -eri1ti -er5it2io -e6rk -er1kl8 -3er1klä -er1l -er1lös -5erlös. -e6r1m -er1me -erme6n6s -e2rn -er1na -er6nab -er6ns -3ernst -6e1ro. -e1ro1d -er1o2f -e1r8o1g -6e3roi -ero5i1d -ero8i1de -e3rol -e1rom -e1r2on -e3rop8 -e2r1or -e1ros -e1rot -er5ox -e2r1s -ersc8h4 -er1sta -5erstat -e2r1t -er5tei -er6t5ein -er2t1h -er5t6her -2e1ru -e1r4uf -eru2f4s3 -e4r3u6hr -e2r3u2ms -e5r6us -er1w -5erwer1b -e1ry -erzw8 -er5zwa -er3zwu -erä8m -er5äs -erö8 -e3rös. -e6r1ü2b -e1sa -esa8b -e8s1ap -e6s5a6v -e1sc -esc8h -esch4l6 -e1se -ese1a -ese1b -es5e1be -eser1v -eser1ve5 -e8s1h -e1si -es2il -es5i6ll -es3int -es1k2 -es1k2o -es4kop -e2s1l -e1so -eso8b -e1sp2 -es1pe -es4pei6s5 -es2p2o -es2pu -e2s1se -5essenz -e1sta -e6s4ta8b1s -e6staf -e6st5ak -est3ar -e1sto -e8stob -e1str6 -e6st5res -e1su -es3ur -e2s1z -e1sü -e1ta -e1t8ag -e1t2a1ri -etar2i5e -et8a8ta -e1te -eten6te -eth6a -et5hal -e5thel -e1ti -1e2t1n -e1to -e1tr6 -e2t3rec -e2ts -etsc8h -e8tscha -et8se -e2t1t -et6tei -et2th -et2t1r6 -e1tu -etu1s -e2tz -et1ze -et8zent -et8zw8 -e1tä -e1tö -e1tü -eu1a2 -eu1e -eu1er -eue1re -eu2e8rei -eu5fe -e6ui -euin5 -e6uk2 -e1um. -eu1ni -eu6n2io -eun1te -e5unter -eu1o6 -eu5p -eu1ro -3europ -eu1sp2 -eu5str6 -eu8zo -e1v -eva2l6s -e1ve -ever1 -eve2re2 -eve5r6en -ev2e1r4i -e1w -e2wig -e1xo -ex1or -1e8x3p2 -e8x1t -1extr6 -ey3er. -e1z -e1ä2 -e5ö8 -e1ü -e1ße -e8ßes -fac8h -fa6ch5i -fa1d -fa1de8 -fa6del -fa5el. -fa6ll -fal6lo -fa2l1t -falt8e -fa1na -fan4gr4 -6f1an5l6 -6fap -far1b -far6ba -far4bl8 -fa2rr -far6r5a -2f1a2r1t -fa1sc -fau8str6 -fa3y -2f1b2 -6f1c -2f1d -1fe -2f1ec2k -fe1d -fe6dr4 -feh1le -feh6lei -f6eim -8fei6ns -f5eis -fe1le -fel5en -fe2l1t -8f5elte2rn -8fe2mp -fe5rant -fe8rd -4ferd. -fe2rr -fer1ri8 -fe1sto -fe8stof -fe6str6 -fe1stu -fe6stum -fe1ta -fe8t8ag -fe2t1t -fet6ta -fex1 -2ff -f1fa -f6f5a6r1m -f5fe -ffe5in -ffe6la -ffe1le -ffe8ler -2f2f1f -f1fla -ffl8e -ff3lei -ff1li -ff4lie -f2fs -ff8sa -ff6s5ta -2f1g2 -f1ge -fge1w -fgewen6 -4f1h -1fi -fi1d4 -fi3ds -fie1b4 -f2il -fi1la -fi1le -fi8lei -fi2l1m -fil4m5a -f8in. -fi1na -8fin1f -fisc8h -fi8scho -fi6u -6f1j -2f1k2 -f8lanz -fl8e -4f3lein -f1li -8flib -4fling -f2lix -6f3l2on -5flop -1flor -5f8läc -3flöt -2f1m -2f1n -1fo -foh1 -f2on -fo6na -2f1op -fo5ra -fo6r1m -for1me -for8mei -fo2r1s -for8str6 -fo2r1t -for8th -for6t5r6 -fo5ru -fo2t1t -6f5otte -2f1p8 -f1q -fr6 -f5ram -1f8ran -f8r8aß -f8re. -frei1 -5fr4ei. -f3reic -f3rest -f1rib -8f1ric -6f1r2ig -1fr2is -fr2on -fro8na -fräs5t -2fs -f1sc -f1se -f2s1er -f5str6 -f1stä -fs3tät -2ft -f1tak -f1te -ft5e6h -fte1re6 -ft1h -f1ti -f5to -f1tr6 -ft5ra1d -f2ts -ft1sc -ft2so -f1tu -f2t1w -ft1wi3d4 -f2t1z -1fu -6f5u2ms -6fun1f -fun4ka -fu1ße -fuße6n -fu8ße2n1d -6f1v -2f1w -2f1z -1fä -fä1c -8fä6r1m -6f1äug -fä8ß -fö1de3 -8föf -3för -1fü -fün1f -fün4f3u -1ga -ga6bl8 -6g1a2b1w -8ga8b1z -ga1d -ga1de -g3a4der -ga8ho -ga5isc -4gak -ga1la -6g5a2m1t -ga1na -ga1ne -gan5er1b -1gan6g5a -ga5n1j -6g1an5l6 -ga6ns -8gan1sc -6gar1b -2g1ar1c -2g1a6r1m -ga5ro -ga2r1t -6g3arti -ga8sa -ga8sc -ga1str6 -ga6st3re -2g1a2t1m8 -6g5auf -gau5fr6 -g5aus -2g1b -g5c -6gd -g1da -1ge -ge1a2 -ge6an -ge8at. -ge1e2 -ge6es -ge1f2 -8ge2ff -ge1g2l -ge1im -4g3ei1se -geist5r6 -ge2lb -gel1br -gel8bra -ge2l1t -gel2t8s -ge5lö -g2e1ni -ge8nin -gen3k -6g5en2t1f2 -ge3nä -ge1or -ge1ra -ge6rab -ger8au -ger1h8 -8gerhö -g2e1ri -ger8i6ns -ge1ro -6g5erz. -ge1rä -ge1rü -ge1s -ge1s2p2 -ges1te -ge2s7te. -ge2s7ten -ge2s7ter -ges1ti -ge2s7ti1k -ge5unt -4g3ex3 -2g1f8 -2g1g -g1ha -6g1hei -5ghel. -g5henn -6g1hi -g1ho -1g6hr -g1hö -1gi -g2il -gi5la -gi1me -gi8me. -gi1na -4g3i6ns -gis1tr6 -g1j -2g1k -8gl. -1gla1d -g5lag -glan4z3 -1glas -6glass -5glaub -g3lauf -1gle. -g5le1b -3gleic -g3lein -5gleis -1glem -2g1ler -8g3leu -g1li -gli8a -g2lie -3glie1d -1g2li1k -1g2lim -g6l2io -1gloa -5glom -1gl2on -1glop -g1los -g4loss -g5luf -1g2ly -1glü -2g1m -gn8 -6gn. -1gna -gna2c -8gnac8h -2g1n2ah -g1nas -g1ne -g8neu -g1ni -g2n6ie -g3n6is -1gno -8gnot -1go -goe1 -8gof -2g8o1g -5go1gr4 -6g5oh -g8o1ni -gon6i5e -gon6is -6gonist -go1ra -8go8rd -2g1p2 -g1q -1gr4 -g5rahm -gra8m -gra4s3t -6g1rec -gre6ge -4g3reic -g5reit -8grenn -gr2i4e -g5riem -5gr2if -2g1r2ig -g5ring -6groh -2grot -gro6ß -4grut -2gs -gs1ab -g5sah -gs1ak -gs1an -g1s8a2n1d -gs1ar -gs1au -g1sc -g1se -gs1e1f -g5s8e2il -gs5ein -g2s1er -g1si -gs1in -g2s1o -gso2r -gsp2 -gs1pr6 -g2s1u -2g1t -g3te -g2t1h -1gu -gu5as -gu2e -2gue. -6gue1d -4g3uh -8gu2ms -6g5unt -gut3h -gu2tu -4g1v -2g1w -gy1n -g1z -1gä -8gä8m -6gä6r1m -1gö -1gü -6güb -1haa -ha1b8r -ha1d -ha1de -ha8del -hade4n -8hae -ha5el. -ha2ft -haf6tr6 -2hal. -ha1la -ha2lb -hal4b5a -6ha1le -8han. -ha1na -ha2n1d -han6dr4 -han1ge -han6ge. -2ha1ni -h5an1th -6hanz -6har1b -h3ar1be -ha6r1m -h3ar1me -ha5ro -ha2t1h -h1a2t1m8 -hau1sa -hau6san -h8a8ß -h1b2 -h1c -h1d -he1b -he2bl8 -hec8h -he3cho -h3e2cht -he1d -he5d6s -he1f -5he2ft -he1he -h5e6he. -hei1d -hei8ds -h1e2if -2hein -he3i2s1m -he5i2st. -hei2t8s3 -he2k1t -hek6ta -he6ll -hel1la -hel8lau -8he2l1t -he1me -he6mer -1he2m1m -6h1e2mp -he1ne -h6enen -hen5e2n1d -henkl8 -hen5klo -hen1tr6 -hen6tri -he2nu -8heo -he8q -her3ab -he5rak -her3an -4he1rap -her3au -her1b -h3er1bi -he1ro -he8ro8b -h2e1ru -he4r3um -her1ze -her6z5er -he1sp2 -he4s1pe -he1st -he1ta6 -het5am -he5th -heu3sc -he1xa -hey5e -h1f2 -h1g -h1go -hgol8 -h1h -h1iat -hi2e6r5i -hi1k -hi5k1t -h2il -hil1a2 -hil1f -hil4fr6 -hi5nak -hin4ta -hi2nu -h2io -hi5ob -hi2rn -hir5n5e -hir6ner -hi1sp2 -hi1th -hi5tr6 -5hi2tz -h1j -h6jo -h1k2 -hla2b1b4 -hla4ga -hla6gr4 -h5lai -hl8am -h1las -h1l8aß -h8l1c -h1le1d -h3lein -h1ler -h5l6er. -h1li -h2l2if -h2lim -h8lin1f -h2l5int -h2l2ip -h2lit -h4lor -h3l6o1se -h1läs -h1me -hme5e -h1ne -h2nee -h2nei -hn3eig -h2nel -hne8n -hne4p3f -h2n8erz -h6ne2tz -h1ni -h2n2ip -h2nit -h1nol -h6ns -hn5sp2 -h1nu -h2n2uc -h2nu1d -h2nul -hoc8h1 -1hoh -hoh1le -hoh8lei -2hoi -ho1la -ho4l3ar -1holz -h2on -ho1ra -6ho8r1g -ho2rn -5horn. -ho3s1l -hos1p2 -ho4spi -h1p -hpi6 -h1q -6hr -h1rai -h8rank -h5r6aum -hr1c -hr1c6r -hrcre8 -h1re1d -h3reg -h8r4ei. -h1rer -h4r3er1b -h8re2r1t -h8r1g2 -h1ric -hr5i6ns -h2rom -h2r1t -hr6t5er1l -hr2t1h -hrtr6 -hr6t5ra -hr8tri -h6rum -hr1z -hs3ac8h -h1sam -h6s5a2m1t -h1sc -h1se -h6s5ec -h6s5er1l -hs8erle -h1so -h4sob -h1sp2 -h8sp8aß -hs1pe -h8spel -hs6p2o -hs1pu -h4spun -h1str6 -h1stu -h4s3tum -h1su -hs3u2n1d -h1sü -h5ta. -h5tab -ht3ac -ht1ak -ht3ang -h5tanz -ht1ar -ht1at -h5taub -h1te -h2t1ec -hte1f -h4t3e2ff -h2t3e1he -h4t3e2if -h8teim -h4t3ein -h4t3eis -h6te2mp -h8ten2t1f2 -hte1re -hte8ren -hter1f4 -h6ter1fü -hte8r1g -h8ter1gr4 -h4t3er1h8 -hte2r1s -h6t5ersc -h8terst -h8te1se -h8tess -h2t1eu -h4t3ex -ht1he -ht5hu -h1ti -htr6 -ht5rak -h2ts -hts3ah -ht1sc -ht1se -ht6sex -ht8s1k2 -ht8so -h1tu -h2tz8 -h5tüm -hub5l8 -hu6b5r -huh1l -hu6hr -h5uhr. -hu6ld -huld5a6 -hu1le -hu8lent -hu8lä -h5up. -h1v -h5weib -h3weis -h1z -hä1k -hä8kl8 -hä2l8s -hä1ma -häm6a8tu8 -häsc8h -hä1sche -hä8sche. -hä2t1s -häu4s3c -2hö. -2höe -8höi -hö6s -hös5c -hüh1ne6 -hü2ls -hül4s3t -hü2t1t -hütte8re -ia1d -i5a2d1n6 -i1af -i5ak. -i1al. -i1al1a -i1a2lb -i1a6ld -ia1le -i5alei -i1al1f -i1a2l1g -i3a6l1h -i1a6l1k -i1a6ll -i1a6l1p -i1a8l1r -i1a2ls -i1a2l1t -i1al1v -i5a2l1w -i3alz -i1an. -ia5na -i3a2n1d -ia1n8e -ia8ne8b -i1ang -i3ank -i5ann -i1ant -i1anz -i6a1p2o -i1ar. -ia1ra -ia6rab -i5a2rr -i1as. -i1a2s1m -i1ass -i5a2st. -i1at. -i5a2ts -i1au -ia1z -i5a2z1z -i1be -i6b5eig -i6b5ei1s -ibl8 -ib2le -ib1li -i4blis -i1br -i6b1r2ig -i1bu -i6b5unt -i1bü -i6büb -ic8h -i1che -i6ch5ei -i6cher1b -i1chi -i6ch5i6ns -ich1l6 -i6ch3m -i2ch1n6 -i1cho -i2cht -icht5an -icht3r6 -i1chu -i8ch1w -ic2k -i2c2ks -ickst8 -ick6s5te -ic5l -i1d -id3a6r1m -i1de -3i2deal -ide8na -3i2deol -ide5rö8 -i1di -id2io -i6diot -idr4 -id5rec -i2d1t -ie1a -ie1b -ie1ba -ie6b5ar -ie1be -iebe4s3 -ie2bl8 -ie1b1r -ie8bra -ie4bre -ie8bä -ie1d -ie2dr4 -ie1e8 -ie1f -ie6f5a1d -ie2f5f -ie2f1l -iefr6 -ie4fro -ie2f1t -i1ei -ie1le -ie4l3ec -ie8lei -i1e4lek -i3e6ll -i1en. -i1e2n1d -ie1n6e -i3en1f -i5enn -ien1ne -ien6ne. -i1en1p2 -i1en1r -ie6ns -i5ensa -ien1sta -ien8stal -i5en1v -i1enz -ie5o -ier3a4b -ie4rap -i2e1re -ie4rec -i2erei -ie6r5ein -ie6r5eis -ie1r8er -ie2rn -i3ern. -i2e1ru -ie8rum -ie8ru2n1d -ie1sc -iesc8h -ie6s5che -ie1ta -ie6tau -ie1te -ie8te2r1t -ie5the -ie1tr6 -ie6t5ri -i1e2t1t -ie5un -iex5 -2if -i1fa -if5ang -i6fau -i2ff -if1fr6 -if5lac -if1li -i5f6lie -ifr6 -i1fre -i2ft -ift5a -if6t5r6 -i1ga -ig3a2r1t -2i1ge -ige1s -i8gess -ig5he -i5gla -ign8 -ig2ni -i5go -i1gr4 -i2g3rot -i2gs -ig3s2p2 -i1ha -i8ham -i8ha6ns -i1he -i1hi -ih1n -i6h1r -i1hu -i8hum -ih1w -8i1i -ii2s -ii2t -i1j -i1k -i1ka -i6kak -i8kerz -i6kes -ikl8 -ik4ler -i1ku -i6k5unt -2il -i5lac -i1lag -il3a6ns -i5las -i1lau -il6auf -i1le -ile8h -i8lel -il1f -il2fl -i1li -il2ip -i4l3ipp -i6ll -il1le -il6l5enn -i1lo -i2l1t -ilt8e -i1lu -i1lä -i1ma -i8ma2r1t -i2m1b2 -i1me -i8me1le -i1mi -i8mi1d -i2m1m -im1me -imme6l5a -i1mu -i1mä -i5mö -i1n2ah -ina5he -i1nat -in1au -inau8s -i2n1d -8ind. -in4d3an -in1de -5index -ind2r4 -in1du -3indus -i1ne -i5nec -i2n1ei -i8ner1w -in1f -in1fe -3infek -1in1fo -in1ge -ing8en -5ing2e1ni -in2gs -ing5s6o -in1h -5inhab -i1ni -in6ie -ini5er. -5in1j -in1kä -in8kät -in1na -in8nan -i1no -inoi8d -ino1k -in3o4ku -i6ns -in5sau -in1sp2 -5in1s2pe -ins1ti -5instit -in1str6 -5instru -ins1z -ins4ze -in1te -5inte1re -5inter1v -in3the -in5t2r6 -i5ny -inä2 -i1när -in1äs -inö8 -in5öd -i1nös -2io -io1a8 -io1c -io1d -io1de4 -io2di -ioi8 -i1ol. -i1om. -i1on. -i5on1b2 -i1o6n2s1 -i1ont -i5ops -i5o8p1t -i1or. -i3oral -io3rat -i5orc -i1os. -i1ot. -i1o8x -2ip -i1pa -i1pi -i1p2l8 -i1pr6 -i1q -i1ra -ir1b -ir6bl8 -i1re -i1ri -i6r1m -ir1me -ir8me8d -ir2m1o2 -i2rn -ir1na -ir8nak -i1ro -i2rr -irr1h8 -ir5rho -i2r1s -irsc8h -ir6schl6 -ir6sc6h5r -i5r6us -i5ry -i5rä -i1sa -i1sam -i8sa2m1t -i6sar -i2s1au -isc8h -i1sche -i8scheh -i8s6chei -is6ch5m -isc6h3r -ischä8 -i1se -is8e1le -ise3ra -i4s3er1h8 -is3e2rr -i1si -isi1d -isi6de -i8si2n1d -is1k2 -is1k2o -is4kop -i1so -is2on -iso1n5e -isp2 -is1p2o -is6por -i1stu -i8s5tum -i5s1ty1 -i5sö -i1ta -i4t5ab. -i2t1a2m -i8ta1x -i1te -ite2r1s -i8tersc -i1thi -i1tho -i5t6hr6 -i4t8hä -i1ti -i8ti8d -iti1k -iti6kl8 -i2t1m8 -it1me -itmen4 -i1to -i8tof -itr6 -it3ran -it3rau -i1tri -itr2i5o -i2ts -it1sc -it2se -itsp2 -it5spa -i2t1t -ittr6 -it8tru -i1tu -i2tz -it1ze -it6z5e8r1g -it6z1w8 -i1tä -itä6r5e8 -ität2 -itä2ts5 -i1tü -i1u -iu6r -2i1v -i6va1d -iv2a1ti -iva8tin -i1ve -i8vei -i6v5e1ne -iver1 -i8ver1h8 -i2vob -i8vur -i1w -iwi2 -i5xa -i1xe -i1z -i1ze -ize8n -i1zi -i8zir -i6z5w8 -iä8m -i1ä6r -i5ät. -i5äv -i1ö8 -iü8 -i1ße -i6ß5e2r1s -ja5la -je2t3r6 -6jm -5jo -jo5as -jo1ra -jou6l -j2uc -juc8h -ju5cha -ju1ge -jugen4 -juge2n1d5 -jun2g5s6 -3jä -1ka -kac8h -8ka2chs -8ka2k1z -ka1la -ka6l5d -ka2m5t -ka1na -2k1an5l6 -8kapf -k8a6pl8 -ka5r6a -kar1b -6k3ar1be -ka1ro -kar1p -kar6p5f -ka2r1t -4k3arti -8karz -ka1rä -ka1si -kasi5e -ka1te -ka6te1b -ka2t1t -kat8ta -kau2f6s -kau3t2 -2k1b -2k1c -4k1d -ke6hr -keh2r6s -kehrs5a -8keic -2k1eig -6k5ein -6k5eis -ke1la -ke6lar -ke1le -ke8leis -k4e8lo -8ke2mp -ken1te -k5ente. -k3en2t1f2 -8k5en2t1s -6k1en2t1z -ke1ra -ker1l -k5erlau -2k1f8 -2k1g -2k1h -k2if -ki5fl -8ki1k -kin2g6s5 -6kin1h -k2io -ki5os -ki5sp2 -ki5th -8ki8ö8 -2k1k2 -kl8 -1kla -8klac -kla1ge -k5lag8er -kle1b -kle4br -k3leib -3klei1d -kle5isc -4k3leit -k3lek -k1ler -6k5l6er. -5klet -k1li -2klic -8k3lig -k2lim -k2lin -5kl2ip -5klop -k3lor -1klä -2k1m -k1ma -k3man -kma1ni -kman6i5e -kn8 -k1ne -6kner -k2ni -knä8 -1k2o -ko1a2 -ko1d -ko1de -ko6de. -ko1i -koi8t -ko1mi -ko6min -ko1op -ko1or -ko1ph -ko6pht2 -ko3ra -ko8rd -kor1de -kor6d5er -ko5ru -ko2ts -ko5t6sc -k3ou -3kow -6k5ox -2k1p2 -k1q -1kr8 -4k3ra1d -2k1rec -4k3reic -kre5i1e -2krib -6k1r2ig -2kr2ip -6kro1ba -2ks -k1sa -k6sab -k1sal -ksa2l8s -k1sam -k8sa2m1t -k6san -k1sc -k1se -k2s1ex -ksp2 -k5spat -k5s1pe -k1spi -k8sp2il -ks1p2o -ks6por -k1spr6 -kst8 -k1su -k2s1uf -2k1t -kta8l -kt5a6re -k8tein -kte8re -k2t1h -k8tin1f -ktr6 -k2t3rec -k2t1s -1ku -k2uc -ku1c8h -kuc2k8 -k3u6hr -k6ui -ku5ie -ku2m2s1 -kun1f -kun2ft -kunf2ts5 -ku6n2s -kunst3 -ku1ra -ku8rau -ku4ro -kurz1 -4kus1ti -ku1ta -ku8ß -6k1v -2k1w -ky5n -2k1z -1kä -kä4m -4k3ä1mi -kä1se5 -1kö -kö1c -kö1s -1kü -kü1c -kü2r1s -kür6sc -1la. -8l1a2b1f8 -8la2b1h -la1b2r -2l1a8b1s -lac8h -lac6h3r -la1d -la8dr4 -5la1du -8l1a2d1v -6la2ff -la2f5t -la2gn8 -la1ke -5laken -8la2m1b -la1me -la6mer -la2mp -lam1pe -5lampe. -2l1a2m1t -la1na -1la2n1d -lan4d3a -lan4d3r4 -lan4gr4 -lan1m -8lan1me -6lann -8la8n1w -6lan1ä -8l1ap1pa -lap8p1l8 -lap6pr6 -l8ar. -la5ra -la4r4af -la8rag -la8ran -la6r5a6s -lar1b -l3ar1be -l2a1re -la8rei -la6r1m -6larm. -la8sa -la1sc -la8sta -l2a1t8i -6l5a2t1m8 -4laus3s4 -4l1au1to -1la1w -2lb -l1ba -l8bab -l8bauf -l1be -lbe1d -l8be1de -l1bi -l4b3i6ns -lbl8 -l5blo -l8bs -lb1sta -lbst5an -lbs1t3e -8lc -lc8h -l1che -l8che2r1t -l1chi -l6ch3m -l5cho -l8ch5w -6ld -l1de -l4d3ei -ldr4 -ld1re -l1dü -l6düb -le1b -le2bl8 -le1br -le8bre -lec8h -le2cht -lech2t6s5 -le1d -led2r4 -le1f -6le2ff -le1ga -le4gas -1le6hr -lei6br -le8in1f -8leinn -5lei1stu -le2k1t -4lektr6 -le1le -le1ler -le6l5e2r1s -l4e1mo2 -8le2mp -l8en. -le2n1d -8len2ds -len1du -6lendun -le1ne -l6enen -le8ne2n1d -len8er1w -6l5en2t1s -4l3en2t1w -4l1en2t1z -8len1zy -8leo1z -6le1pi -le6p2ip -8le1p2o -1ler -l6er. -ler1b -8ler8bs -le8rd -6l5er1de -le1re -l2erei -le8reis -le8re2n1d -le4r3er -4l3e8r1g -l8er1gr4 -le6rk -6ler1kl8 -ler1zi -6l5erzie -8lerö8 -le1se -8lesel -le1si -lesi5e -les1k2 -le3s1k2o -le3th6a -le2t1s -5le2uc -4leu1ro -leu4s3t -le5xe -6l1e8x3p2 -l1f -2l1g -l1ge -lge2n1d8 -l8gh -lg1li -lg2lie3 -l3glie1d6 -6l1h -1li -li1ar -li1as -2lic2k -li1d -li8dr4 -li1en -li5en6n -li8e2r1s -li8e2r1t -2ließ -3lig -li1ga -li8ga8b -li1g6n8 -l2il -li1l8a -8li2m1b2 -li1na -li2n1d -4l3in1du -lin2gs5 -4l3in1h -6l5in1j -lin2k4s3 -4lin2k1t -2lint -8lin1v -l2ip -4lipp -5lip1t -li1sa -4li1sam -l2i1v -livi5e -6l1j -6l1k -l8keim -l8kj -lk2l8 -l1k2o -lko8f -lkor8 -l2ks -lk2sa -lk2se -6ll -l1la -ll3a4be -l8la2b1t -ll8an5l6 -l2l1b -l8l1c -l6l1d6 -l1le -l4l3eim -l6l5ei1se -l1ler -ller3a -l4le1ti -l1li -l5l2ip -l1lo -l4l3o2r1t -ll5o1v -l2ls -ll1sp2 -ll6spr6 -l2l1t -llte8 -l1lu -l4l3u8r1g -l1lä -l5lü -l6lüb -2l1m -l1mo -l6m5o6d -6ln -l1na -l1no -8lo1bl8 -lo6br -loc8h -3lo2ch. -lo1fe -l5o4fen -l8o1g -lo1ge -5loge. -5lohn -4l3o6hr -1lo1k -l2on -lo1pe -4l3o4p8er -lo1ra -2l1o8rd -6lo8r1g -4lo2r1t -lo1ru -1los. -l6o1se -lo8sei -lo1si -3losig -lo1v -lo6ve -lo1wi5 -6l1p -lp2f -l1ph -l8pho -l8p1n -l2pst -lp4s3te -l2p1t -l1q -8l1r -2ls -l1sa -l6s1a6r1m -l1sc -l1se -l8sec -l6s5e8r1g -l4s3e2r1s -l8s1h -ls1l -l5s6la -l1sp2 -ls1p2o -ls4por -ls2pu -l1str6 -l1su -l8su1ni -l1sü -2l1t -l6t5a2mp -l4t3ein -l5ten -l6t5eng -l6t5er1p -l4t3hei -lt3her -l2t1ho -l6t5i6b -lt2i1l -ltr6 -l8trö -l2ts -lt1sc -lt1se -lt6s1er -lt4s3o -l1t5u2ms -lu8br -lu1d -lu2dr4 -lu1en8 -8lu8fe -lu2ft -luft3a -luf8tr6 -lu6g5r4 -2luh -l1u6hr -l6ui -lu5it -5l6uk -2l1u2m1f6 -2l1u2m1w -1lun -lu1ni -6l5u6n2io -4l3un1te -lu5ol -4lu8r1g -6lu2r1s -l3u2r1t -lu4sto -lus1tr6 -lu6st5re -lu8su -lu6tal -lu1te -lu6t5e6g -lu8te8r1g -lu3the -lu1to -lu6t5or -lu2t1r6 -lu6ß5 -l1v -l1ve -lver1 -lv2e5r6u8 -2l1w -1ly -lya6 -6ly2m1p2 -ly1no -l1ze -l8zess -l1zo -l8zo8f -lzw8 -l3zwei -lz5wu -3lä2n1d -lä5on -lä6sc -lä2t1s -5läuf -2l1äug -läu6s5c -lä5v -l1öl -1lös -lö1ß6t -6l1ü1b6e2 -1ma -8m1a2b1g2 -mac8h -ma5chan -ma1d2 -ma5el -4ma2g1g -ma1g8n8 -ma1la -ma8lau -ma6l5d -8mal1de -ma1li -mali5e -m8a1lu8 -ma8lut -2m1a2mp -3man -ma2n1d2 -man3ds -8man1gr4 -ma1ni -man2i5o -ma6ns -8m5an1st -6m1ap1pa -mar1b -4m3ar1be -ma6rk -mar8kr8 -ma1r4o -ma2r1s -marsc8h -mar8s6ch2m -3mas -ma1sc -ma1tö -4m5auf -ma5yo -2m1b -m1b6r -2m1c -2m1d -m2ds -md6sä -1me -me1c8h -me5isc -5me6ld -me2ls -mel8sa -8me2mp -me5nal -me2n1d -men4dr4 -me6ns -men1sc -mensc8h -men8schl6 -men8s8chw -men2t1s -8mentsp2 -me1ra -me8r1g -mer4gl -me1ro -3mes -me1se -me6s5ei -me1th -me8ß -2m1f6 -2m1g -2m1h -1mi -mi1a -mi6a1le -m2il -mi1la -2m1i2m1m -mi1na -mi5nü -mi1sa -mi4s3an -mit1h -mitr6 -mi5t6ra -3mi2t1t -mitta8 -mi6ß5 -6mj -2m1k8 -2m1l -2m1m -m1ma -m6ma1d2 -m6m5ak -m1me -m8menth -m8men2t1w -mme6ra -m2m1n8 -m2ms -mm5sp2 -mm5u2ms -mmu2t5s -m8män -m1n8 -m5ni -1mo -mo5ar -mo1d -mo4dr4 -8mof -m8o1g -mo1ga -mo8gal -mo1k -mok2l8 -mo4kla -mo6l5d -m2on -mo2n1d -mon8do -mo1no -mo4n3o1d -m1o6ns -mon2s1tr6 -mon1t8a -6m5ony -mo1pa6 -mo1ra -mo8rd -mor8d5a -mo1sc -mo1sp2 -5mot -moy5 -2mp -m1pa -mpfa6 -mpf3l -m1ph -mphe6 -m1pi -mpin6 -m1pl8 -mp2li -m2plu -m1p2o -mpo8s1te -m1pr6 -mprä5 -mp1t -mp8th -m1pu -mput6 -mpu5ts -m1pö -8m1q -2m1r -2ms -ms5au -m1sc -msc8h -msch4l6 -msp2 -ms6p2o -mspr6 -m3spri -m1str6 -2m1t -mt1ar -m8tein -m2t1h -m2ts -mt6se -mt8sä -mu5e -6m5uh -mu1mi1 -1mun -mu2n1d -mun6dr4 -mu1se -muse5e -mu1ta -2m1v -mvol2 -mvo6ll3 -2m1w -1my -2m1z -mä1k -mä6kl8 -1män -mä1s -mä5tr6 -mäu4s3c -3mäß -mö1b2 -6möl -1mü -5mün -3müt -1na. -n5ab. -8n1a2b1n -n1a8b1s -n1a8b1z -na6bä -na2c -nac8h -na1ch3e -3na2cht -1nae -na5el -n1afr6 -1nag -1n2ah -na8ha -na8ho -1nai -6nair -na1k2o -na4kol -n1a2k1t -nal1a -8na1ly -1na1ma -na1me -na4mer -na1m2n8 -n1a2mp -8n1a2m1t -5nan1c -nan6ce -n1a2n1d -n6and. -2n1ang -1na1ni -1nann -n1a6ns -8na8n1w -5napf. -1n2ar. -na2ra -2n1ar1c -n8a8rd -1n2a1ri -n8a6rk -6n1a6r1m -5n6a2r1s -2n1a2r1t -n8ar1v -6na2t1m8 -na2ts -nat6s5e -1nau1e -4nauf -n3aug -5na6ui -n5a6uk -n6a5um -6n1au2s1b2 -6n1au1to -1na1v -2na1x -3na1z -1n8aß -n1b2 -n1ba -nbau5s -n1c -nc8h -nche5e -n6ch5m -2n1d -nda8d -n2d1ak -n6d5a6ns -n1de -n2d1ei -nde1la -nde8lac -nde2ls -ndel6sa -nder1h8 -n8derhi -nde4se -nde1sta -nde8stal -n2d1j -n2d1n6 -nd1ni6 -ndn6is5 -n1do -n6d5o2r6t -ndr4 -nd3rec -nd3rot -n2ds -nd1sa -nd1sam -nd8sa2m1t -nd6sau -n2dt -ndt1h -n1du -n8du2m1d -1ne -ne5as -ne1b -ne2bl8 -6n5e2b1n -2nec -5ne1ei -ne5en -ne1g4l -2n1egy -4n1ein -8neis -ne1le -4n3e4lem -8ne2m1b -2n1e2mp -nen1a -1ne1ne -6n5e4ne8r1g -nen3k -8nen2t1b2 -4n3en3th -8nen2t1l -8n5en2t1n -8n5en2t1s -ne1ra -ne5r8al -ne8ras -ner1b -8ner1bi -ne8rd -ner1de -6n5erde. -ne1re -n2erei -nere5i6d -ner1f -ner1fo -nerfor6 -ner1h8 -6n5erhö -ner1l -8nerlö -2n1e2rr -ne2r1s -n8ers. -ne2r1t -nertr6 -6n5ertra -2n1erz -ne1si -nesi3e -net1h -neu4ra -neu5sc -8neuß -n1f -n2f5f -nf2l -nfl8e -nflei8 -nf1li -nf5lin -n2ft -nf2ts -nft8st -n1ga -n8g5ac -n6g5d -n1ge -ng8en -nge1ra -nge8ram -n2g1g2 -ng1h -ng1li -n6glic -n1gr4 -ng3r2ip -ng8ru -n2gs -ng2se4 -ng2si -n1gu -n2g1um -n1gy -n1gä -n8gäl -n1h -nhe6r5e -1ni -ni1bl8 -nic8h -ni5chä -ni1d -ni1de -ni8de1e -n6ie -ni1en -nie6s5te -niet5h -ni8e2t1n -n2i1ge -4n3i6gel -n6i1k -n2il -ni1la -2n1i2mp -ni5na -2n1i2n1d -8nin1f -6n5in1h -1ni1ni -ni8nit -6n5inn -2n1i6ns -4n1int -n6is -nis1tr6 -ni1th -ni1tr6 -n1j -n6ji -n1ka -n8ka1d -nk5a6ns -n1ke -nker1l -n8kerla -n1ki -n6k5in1h -nkl8 -n5klö -n1k2n8 -n8k5not -n1kr8 -nk3rot -n8krü -n2ks -nksp2 -nk5s1p2o -n2k1t -nk6t5r6 -n1ku -n8kuh -n1kü -n6küb -n5l6 -n1li -nli4mi -n1m -n1me -nme6n4s -n1na -n1ne -n8ne8r1g -n1ni -nn2i5o -n1no -nn1ta -nn4t3ak -nnt1h -n1nu -nnu1e -n1ny -n1nä -n1nö -n1nü -no5a -no1bl8 -no4b3la -4n3o8bs -2no2b1t -noc8h -no1che8 -no1d -no1di -no6die -no4dis -no8ia -no5isc -no1le -6n5o6le3u -no1ma -no4mal -n8o1ni -non6ie -noni6er -2n1on1k -n1ony -no1pe -4n3o4p8er -6nopf -nop1t -6n1opti -no3ra -n1o4ram -no8rd -nor6da -4n1o8r1g -2n1o2r1t -n6os -no1st -8no2st. -no1ta -no8tan -no1te -no8ter -no1ty1 -noty6pe -6n5ox -n1p2 -n1q -n1r -nrös3 -6ns -n1sac -ns3ang -n1sc -n1se -n8sel1f -n8s5er1f -n8se8r1g -n6se6rk -ns5er1w -n1si -n8sint -nsp2 -n1s2pe -n1spr6 -n1sta -n6s5tat. -n1sto -n6stob -n1str6 -n1ta -n1tag -n4t3a4go -nt5an1h -n2t3a6rk -n2t3a2r1t -n1te -n4t3eis -nte5n6ar -nte1ne -nte8nei -nter3a -nte1re -nt2e6rei -nt1h6a -nt6har -n3ther -nt5hie -n3thus -n1ti -nti1c -n8tin1h -nti1t -n2t1l -ntlo6b -n2t1m8 -nt1me -ntmen8 -n1to -n2t3o4ti -n1tr6 -ntra5f -ntra5ut -nt8rea -n2t3rec -nt8rep -n4t3rin -nt8rop -n4t3rot -n4trü -n2t1s -nts6an -nt2s1k2 -n1tu -n2t1z -n1tä -n1tö -n8töl -n1tü -1nu -nu1a -nu5el -nu5en -4n1u6hr -n6ui -nu5ie -8nu2m1l -6n5u2ms -6n5u2m1w -2n1u2n1d -6nu1ni -6n5un1r -2n1unt -2nup -2nu6r -n5u1ri -nus1k2 -nu3s1kr8 -nu5ta -n1v -8n1w -1nys -n1za -n6z5a6b -n2z1ar -n6zaus -n1zi -nzi4ga -n1zo -n8zof -n1zu -n6z5unt -n1zw8 -n1zwi -n6zwir -1näc -5nä1e -5n6äi -n8äl -nä6m -nä6re -n5ärz -5näus -n1öl -1nöt -n5ö2z -5nü. -6n1ü2b -5nüß -o5ab. -oa2l -o8ala -o1a2m -o1an -o1ba -ob1ac -o1be -obe4ra -o6ber1h8 -5o4be2r1s -o4b2e1ru -obe1se -obe6ser -1ob1j -o1bl8 -o2b1li -o8bs -ob5s1k2 -3ob2st. -ob8sta -obstr6 -obst5re -ob5s1z -oc8h -o1che -oche8b -o8chec -o3chi -och1l6 -o6ch3m -ocho8f -oc6hr -o3chro -o2cht -och3to -o3chu -o8ch1w -o1d -o2d1ag -o2d1d -od2dr4 -o1de -ode5i -ode6n5e -o2dt -od1tr6 -o5e6b -oe1d -oe1de -o5e6der. -oe8du -o1e1f -o1e2l -o1e2p -o1er. -o5e8x -o1fa -o2ff -of1fa -of8fan -1of1fi -of8fin -of6f5la -o5fla -o1fr6 -8o1g -og2n8 -o1ha -o1he -o6h5eis -o1hi -ohl1a -oh1le -oh4l3er -5ohm. -oh2ni -o1ho -o6hr -oh1re -oh1ru -o1hu -oh1w -o1hy -o1hä -o5ia -oi1d -o1id. -o8i1di -oi8dr4 -o5i2ds -oisc8h -o5i8s2ch. -oi1se -oiset6 -o1i2s1m -o3i2st. -o5i6tu -o1j -o1k -ok2l8 -o1kla -ok3lau -o8klä -o2k1t -1okta -o1la -o6ld -old5am -old5r4 -o1le -ole5in -o1le1r -ole3u -o2l1g -ol6gl -o6l1k -ol2k2l8 -ol2k4s1 -o6ll -ol1la -ol8lak -ol8lauf. -ol1le -ol6lel -ol8less -o1lo -o2l1s -ols1te -ol2ster -ol6s1k2 -o1lu -o1ly -oly1e2 -5olym -o1ma -o2mab -o3m6an -o8mau -o2m1b -om1be4 -o1me -o8merz -o2ms -om5sp2 -o1mu -o1mun -o8munt -o1mä -o1mö -o1na -ona8m -o2n1a1x -o1ne -on8ent -o6n5er1b -8o1ni -on6ie -oni5er. -on1k -on1na -on6n5a6b -o1no -ono1c -ono1k -o4no2k1t -1o6ns -on2t1s8 -o1nä -oo8f -1o8o1g -oo2pe -oo2sa -o1pa -o1pe -op8er -3o4pe1ra -opf2l -o3pf1li -opf3lo -opf3r6 -o1pi -o1pl8 -o2p1li -o5p6n -op8pa -op6p1l8 -o1pr6 -op1t -o3p4ter -1opti -o1pä -o5pö -o1q -o1ra. -o3ra1d -o8ra2d1d -1oram -o6rang -o5ras -o8rauf -orc8h -or5cha -o8rd -or1da -or4d3a4m -or1de -or8dei -or8deu -1or2d1n6 -or1do -or4dos -o1re -o5re. -o2re2h -o8r5ein -ore5isc -or6enn -or1f -or8fla -or8f1li -o8r1g -1or1ga -or1ge -5orgel. -or2gl -o1ri -or2ie -ori1en -5o6rient -o2rn -or1na -or8nan -or8nä -o1ro -o2rr -or1r2h8 -o2r1t -or6t5an -or8tau -or8te1re -o1r6us -o1ry -o1rä -or1ü2 -o1sa -o1sa3i -6o1se -o8se6rk -o1s1k2 -o6ske -o6ski -os2kl8 -os2k2o -os2kr8 -os1n -os1ni -osn6i5e -o1so -o2s1o2d -osp2 -os1pe -o3s4p8er -o1sta -o4stam -o6stau -ostr6 -o3stra -ost3re -o1su6 -o6s5ur -os1z -o5s6ze -o1ta -ot3auf -o6taus -o1te -o6ter1w -o1th -othe5u -o2t6h1r6 -o1ti -o1to -oto1a -otr6 -ot1re -o1tri -o1tro -o2ts -ot1sc -o3t1su -o2t1t -ot6t5e8r1g -ot2t3h -ot2t5r6 -ot8tö -o1tu -ou3e -ouf1 -ou5f6l -o5u6gr4 -o6ui -ou5ie -ou1ra -ou6rar -ou1t6a -o1v -o1wa -o1we -o6wer. -o1wi -o1wi1d6 -o1wo -o5wu -o1xe -oy5al. -oy1e -oy1i -o5yo -o1z -oza2r -o1ze -1o2zea -o1zo -ozo3is -oö8 -o1ße -oß5e2l1t -oß1t -3paa -pa6ce -5pa1d -pag2 -1pak -pa1la -pa8na8t -pa1ni -pan6ie -pani5el -pa1no -pa4nor -pa6n1s2 -1pap -pap8s -p2a1re -pa8rei -pa6rk -par8kr8 -par2o8n -par5o6ti -pa2r1t -part8e -5p8ar5tei -3par2t1n -pa2s1se -pas6sep -pa1th -pa4th6a -1pau -6paug -pau3sc -p1b -8p5c -4p1d -1pe -4peic -pe5isc -2pek -pen3k -pen8to8 -p8er -pe1ra -pe1re6 -per5ea -per5e1b -pe4rem -2pe2rr -per1ra -per8ran -3pe2r1s -4per1si -pe3rü -pe4sta -pe2t2s -p1fe -p2f1ec -p4fei -p2f1f -pf2l -5pf8lanz -pfl8e -pf8leg -pf3lei -2p2ft -pf3ta -p1g -1ph -2ph. -2p1haf -6ph1b2 -8ph1d -6p5heit -ph5e1me -6ph1g -phi6e -8ph1k2 -6phn -p5ho6ll -pht2 -ph3th6a -4ph3t1he -phu6 -6ph1z -pi1en -pi5e2rr -p2il -pi1la -pi1na -pi6ns -5pin1se -p2io -pi8o1ni -pion6i8e -1pis -pi1s2k2 -pi1th -p1k -pl8 -5pla -p2lau -4plei -p3lein -2p1ler -6p5les -p1li -2p3lig -p6li1k -6p5ling -p2li1z -plo1mi -plo8min -6p1m -p1n -1p2o -8poh -5pol -po1la -po8lan -po1ly1 -po3ny -po1ra -2po2rn -po2r1t -por4t3h -po5rö -5po1ti -p1pa -p1pe -p6p5ei -ppe6la -pp5f -p2p1h -p1pi -pp1l8 -ppp6 -ppr6 -pp5ren -pp1s -p2pst -pp2s1te -p5pö -pr6 -3preis -1pres -2p3r2ig -5prinz -1prob -1pro1d -5pr8o1g -pro8p1t -pro6t5a -pro1te -prote5i -8proß -prä3l -1präs -prä1te4 -1prüf -psc8h -p5schl6 -2pst -1p2sy -p1t -p8to8d -p2t1s -5p6ty1 -1pu -pu1b2 -2p2uc -pu1d -pu2dr4 -pu2ff -puf8fr6 -6p5uh -pu6n8s -pu1re -pu8rei -pu5s6h -pu1ta -p1v -p3w -5py -py5l -p1z -pä1de -pä6der -p5ä6m -pä8nu -8pär -pät5h -pä2t1s -qu6 -1q6ui -8ra2b1k2 -ra1bl8 -ra6b1la -3rable -ra2br -r1a2b1t -6ra8b1z -ra1d -ra4dan -ra2dr4 -r8afa -5ra3fal -ra1fe -ra4f3er -ra5gla -ra2g3n8 -6ra1ha -ral5am -5ra6ld -4ra2l1g -ra1li -ra8li6ns -2ra6ll -ra2l5t -ra1me -8ramei -r3anal -r6a2n1d -ran1de -ran8der -ran4dr4 -8ran1f -6ran1ga -5ran1gi -ran8g1li -r3an1gr4 -ra6ns -ransp2 -rans5pa -8ra8n1w -r8anz. -ra5or -6rapf -r8a5pl8 -rap1se -rap6s5er -2r1ar1b -1rar1h8 -r1a6r1m -ra5ro -2r1a2r1t -6r1arz -ra1te -ra8tei -ra1th -ra6t5he -6ra2t1l -r4a1tr6 -ra4t3ro -ra2t1t -r5atta -rau1e -raue4n -6raus. -r5au4sta -rau1te -rau8tel -rau2t5s -ray1 -r1b -rbl8 -rb5lass -r6b1ler -rb1li -rb4lie -r1bo -rbon6n -r1br -rbrec8h -r8bre2cht -r8bs -rb6s5tä -r1ce -r8ces -rc8h -r1che -rch1l6 -r6ch3m -rc6hr -rch3re -r2cht -rch3tr6 -r8ch1w -8rd -r1da -r1dac -rdac8h -r8da2chs -r8d1ap -rda5ro -r1de -rde5i6ns -r1di -rd2io5 -r8dir -r1do -rd3ost -r1dr4 -r8drau -1re. -re1ak -3re1a2k1t -re3a2ls -re1am -re6am. -re1as -re1b -re1be -4reben -re6bl8 -rec8h -rech5a -re1d -r8e1di -re3er -re1f -8re2ff -3refl -2reh -5re1ha -r4ei. -reic8h -rei2ch6s5 -rei1e -8reier -6r1eign8 -re5i2mp -4r3ein1a4 -6r3ein1b2 -6rein1g -6r5einn -6rein1r -4r3ei6ns -r3eint -re1li -reli3e -8r5e2l1t -re2mp -6r1emp1f -2re2m1t -ren5a6b -ren8gl -r3en1ni -1re1no -5ren1te -4r3enth -8ren2t1l -4r3en2t1w -8r1en2t1z -ren4zw8 -re1on -re1q -requ6 -re1q6ui5 -1rer -rer1b -rer4bl8 -6rer8bs -4r3e8rd -rer1h8 -8rerhö -re6rk -8rer1kl8 -rer1l -4r3erla -8rerlö -re2rn -4r3er6ns -6r5er1nä -rer5o -re2rr -rer1re -6r5erreg -re2r1t -r5ertr6 -rer1w -r5erwec -r5erö8 -re2sa -re1sc -resc8h -re8s6ch2m -2ress -re5u8ni -re1w -6rewo -2r1ex -r1f -r1fe -r8fe8rd -rf1li -rf4lie -8r1g -r1ga -r8gah -r1ge -rge1b -rge4bl8 -rge5na -rge1s -rgest4 -rgn8 -rg6ne -r2g1ni2 -r1go -r8gob -r1gr4 -r4g3ret -r2gs -rg1se -rg8sel -r1h8 -r2hy -5rhy1t -ri1ar -ric8h -ri5cha -ri1d -ri2d2g -r2ie -rie2g4s5 -ri8ei -ri1el -ri6e1le -ri1en -ri3er. -rie2r1s -ri5ers. -r2if -ri1fa -ri6fan -ri1fe -ri8fer -ri8fr6 -1r2ig -ri1k -ri8kn8 -r2il -ri5la -ri1mä8 -ri1na -ri2n1d -r8in1de -rin4ga -rin6gr4 -1rinn -rin1ne -6rinner -ri1no1 -ri6ns -r8in1sp2 -4rinst -ri1nä2 -r2io -rio1c -ri5o6c8h -ri1o2d -ri3o6st -2r1ir -r2is -ris1k2 -ri3s1k2o -risp2 -ri8spr6 -ri5s1v -r2it -ri1ta -6r5i6tal -ri5tr6 -r2i1v -ri1ve -ri6ve. -8r1j -6rk -r1ke -rke6hr -rkeh2r6s5 -r1ki -rkl8 -rk1li -r3k2lin -r1k2n8 -r2ks -rkst8 -rk3str6 -r2k1t -rk4t3an -rk6to -r1ku -r6kuh -r1kä -rkä4s3t -r1l -r5li -rli1ne -rline5a -6r1m -r1ma -r3man -r6m1an5l6 -rma4p -r4m3a1ph -r1mi -r8min1f -r1mo -r8mob -r2ms -rm5sa -2rn -r1na -rna8be -r5ne -rn2ei -r6ne2if -r6nex -r6n1h -rn1k -r1no -r6n5oc -r6ns -rn1sp2 -r1nä -r1nü -ro1be -ro6be2rn -6ro8bs -ro1c8h -roc2k -3ro2ck. -ro1d -ro5de -ro1e -4ro1fe -ro1he -ro8he2r1t -1ro6hr -ro5i1d -ro1in -ro5isc -ro1ly -6r5olym -r2on -6r1o8o1g -ro1ph -ro6phan -r3o2r1t -ro1s2p2 -ro5s6w -ro1ta -ro4tau -ro1tr6 -ro6ts -5rout -r1p -r1pe -rp8er -rpe8re6 -rp2f -r2ps -r2p1t -r1q -2rr -r1ra -r1re -r1rer6 -rr1h8 -rr6hos -r5rhö -r1ri -r1ro -rro8f -rr8or -rror5a -r1ru -r3ry -r1rä -r1rö -r1rü -2r1s -r2s1te -r2s1ti -r6sab -r4san1f -r1se -rse6e -rse5na -r2s1h -rs1k2 -r6s1ka -r6ski -rs2kl8 -r8s1k2o -r2s1l -rs2p2 -r1sta -r6stauf -r8ster1w -rstr6 -r8stran -r2s1w -rs1wi3d4 -r2s1z -2r1t -2r2t3a2r1t -r8taut -r5tei -rt5e2i1ge -r8te1pe -r4t3er1h8 -rter1l -r8terla -r4t3hei -r5t6hu -r4t3int -rtr6 -r4t5re2if -r2ts -rt1sc -rt1se -rt6s1er -rt6s5o -rt6s5u -r6t5u2n1d -2r8tu2r1t -ru1be6 -ru1en -1r4uf -ru2fs -ruf4st -r6ui -ru1ie -2r1u2m1g -2r1u2m1l -2ru2ms -ru2n1d -run1de -run8der -run4d5r4 -6run2d1z -6run1f -8ru6ns -2r1unt -2r1ur -r6us -ru6sta -rus1tr6 -ru6tr6 -1ru2ts -r1v -r1ve -rven1 -rvi2c -r1w -r1x -r1za -rz5ac -r6z5al -r8z1ar -r1ze -r8ze8rd -r6z5er1f -rz8er1h8 -r2z1t -rz4t3h -r1zu -r8zum -rä4s1te -räu8sc -r1öf -5rö6hr -rö5le -3rö6ll -rö1mi -5römis -r1ör -rö2sc -3rü2mp -1sa. -1saa -sa1be -s3a4ben -sa2bl8 -2s1a8b1s -6s1a2b1t -6s1a2b1w -sac2k -3sa2ck. -sa1d -sa1de -6s3a4der -1saf -s8a1fa -4s1a2ff -sa5fr6 -1sag -1sai -sa1i2k1 -4s1a2k1t -1sal -sa1la -sa6l1p -4s3alpi -sa2l1t -6salter -salz3a -1sam -s5an1b2 -san2c -1sa2n1d -san1ge -s5angeh -6s1an5l6 -2s1a6ns -6s3an1tr6 -8s1a8n1w -s1ap -s6a1ph -8sa1p2o -sap5p6 -s8ar. -2s1ar1b -3sa8r1g -s1a6r1m -sa5ro -2s1a2r1t -6s1arz -1sas -1sat -s8a1t8a -2s1a2t1l -sa1to -sa8tom -3s8au1e -s5au2ff -sa6u5i -s6aur -2s1aus -5s6au1se -2s1b2 -2s1ca -s4ce -sc8h -8s2ch. -3scha. -scha1d -5scha1de -3schaf -3schal -sch5a1me -8schan1c -8s6ch1b2 -1sche -6s1che1f -8schex -2s6ch1f2 -2sch1g -2s4ch1h -1schi -2sch1k2 -schl6 -5schlag -5schlu -s6ch2m -6sch3mäß -s2chn6 -6sch1n8aß -1scho -6scho8rd -6s6ch1p -sc6hr -3schri -8sch1ric -8sch1r2ig -8schrou -6s2chs -2s2cht -sch3ta -sch3tr6 -1schu -8s6ch3unt -6sch1v -2sch1z -5schö -5schü -2s1c8o -s1c6r -scre6 -6s1cu -2s1d -1se -se5an -se1ap -se1b -se1be -se6ben -se5ec -se1ei -see5i6g -se3er1l -se1f -8se2ff -se1ha -se6han -se8hi -se8hö -sei1d -6s5eid. -2s1eig -s8e2il -5sein. -sei5n6e -6s5ein1h -3s8eit -3sel. -se1la -se4lar -se2lb4 -se1le -6s3e4lem -se1ler -se8ler1l -2s1e2mp -sen3a2c -se1ne -se5nec -6s5en2t1s -4s1en2t1z -s8er. -se1re -s2erei -se8reim -s2e1ri -se1r5inn -se6r1m -8sermä -8s5er1zi -serö8 -6ser1öf -se1um -8sexa -6s1e8x3p2 -2s1f2 -sfa6ll -sfal1le -sfal8ler -2s3g2 -s1ge -sge5b2 -s1h -s8he1w -5s6h2ip -5s4hop -1si -2siat -si1b -sic8h -si2cht -sich2t6s -si1d -si1de -6s5i6de1e -sie1ge -siege6s5 -si1en -si5e2rr -s2i1f2 -si1g2n8 -si6g5r4 -si1k -si1ka -si8kau -sik1i -si4kin -si2kl8 -si8kü -s2il -si1la -si2lb -sil6br -si1na -2s1in1f -sin5g1h -2s1in1h -sin1ne -sinne6s5 -2s1i6ns -si5ru -si5str6 -4s1j -s1k2 -6sk. -s1ka -2skau -ske8l6c -skelc8h5 -s6ke1le -1s2ki. -3s4kin. -s6ki1z -s8kj -6skn8 -s1k2o -2s3kow -s1kr8 -3s2krib -3s2kr2ip -2s1ku -8s1kü -s1l -s8lal -slei3t -s4low -2s1m -s1n -6sna -6snot -1so -so1c8h -so1d -2s1o1do -so4dor -so1fe -6s5o4fen -so1lo3 -s2on -so5o8f -4so1pe -so1ra -2s1o8rd -so8r1g -4s1or1ga -so2u5c -so3un -4s3ox -sp2 -8s3paa -5spal -1span -2s1pap -s1pe -s2pec -s4peis -1s2pek -sp8er -s6pe8r1g -4s3pe2r1s -s6pes -2s1pf -s1ph -8sphi -1s2phä -1spi -spi4e -6s5pig -spi6ns -6s5pin1se -2s1pis -spl8 -2s5pla -s1p2o -2s5pol -5s6pom -6s5pos -6s5po1ti -spr6 -1spra -3s8prec -6s3preis -5spring -6s1prob -1spru -s1pu -s2pul -1s2pur -6s5py -5spän -1spü -s1q -2s1r -2ssa -2s1se -2s1si -2s1so -2s1sä -2ssö -2ssü -2s1sc8h -sse8nu -ssi1ni -ssin6i6s -ssoi6r -2st. -1sta -4s1ta1fe4 -2s1tag -sta3la -6s1ta1le -4s2ta2l1g -8sta6l1k -8s2t1a2m1t -6st5an1f -4st3a6ns -6st5a8n1w -6star1b -sta4te -6staus -2s2t1b2 -6s2t1c -6s2t1d -s1te -4s1te2il -3s2tep -6s5tep1pi -8ste2s1se -6s2t1f2 -2s2t1g2 -2sth -st1h6a -st3hei -s8t1hi -st1ho -st5hu -s1ti -s2ti4el -4s2ti2g1m -6s2t1i2n1d -4s2tin1f -s2ti8r -2s2t1k2 -2s2t1l -2s2t1m8 -1sto -sto6ll -6s5toll. -4st3o1pe -6s5topf. -6sto8rd -6s2t1p2 -str6 -4s1trai -s3tral -6s5tr6aum -3str8aß -3s2trec -6s3tre1f -8s3treib -5s4tre2if -6st1re1no -6stres -6st3re1v -2s2t5r2ig -8s2t1r2is -s8tro1ma -st5r6o1se -4st1r4uf -3strum -6s1träg -2s2t1s6 -2s2t1t -1stu -stu5a -4s1t2uc -2s1tu1e -8stun. -2s2t1v -2s2t1w -s1ty1 -s2tyl -6s2tz -1stä -8s5täg -1stö -1stü -8s5tüc8h -4s1tür. -1su -su2b1 -3s2uc -su1e -su2fe -su1ma -su8mar -su2m1f6 -6sumfa -8su2m1k8 -2s1unt -sup1p2 -su1ra -6s5u6ran -su2r1t -6surte -2s1v -2s1w -1sy -8syl. -sy5la -syn1 -sy2na -sy1ne4 -s1z -s1ze -s4ze2n1d -sze1ne -5s6z4ene. -8s1zu -1sä -6s5ä2n1d -s1äug -6säu1gi -6s1äuß -5söm -2s1ü2b -1süc -sü8di -1sün -5süß -taa2t2s3 -4tab. -t6a1ba -taba6k -ta8ban -ta1b2l8 -ta1br -ta6b1re -4ta8b1s -t3ab1sc -8ta8b1z -tac8h -6t3a2cht -ta1d -ta1de -ta6der -6tadr4 -ta2d6s -ta2d2t1 -1ta1fe4 -1tag -ta6ga6 -ta1ge -ta8gei -tage4s -ta2gs -tag6s5t -tah8 -tahl3 -tai1ne -tai6ne. -ta5ir. -ta2k1t -tak8ta -tal3au -1ta1le -ta8leng -ta1ler -ta6l5e2r1t -ta1me -6t5a6mer -6ta2mp -tam1pe6 -2t1a2m1t -ta2n1d -tan5d6a -tan8dr4 -tan2ds -tand1s5a -ta1ni -tan6i5e -6t1an5l6 -2t1an1r -t3a6ns -8t5an1tr6 -ta1nu6 -t5a8n1w -8tanwa -tan8zw8 -ta1ra -ta8rau -tar1b -6tar1be -1t2a1ri -2ta6rk -2t1a6r1m -ta1ro -2ta2r1t -t3arti -6tarz -ta1sc -ta1si -ta6si1en -tas1te -ta8stem -ta8s1to -t5au2f1b2 -4t1au2f1n -8taus. -5tau1se -8t1au2s1f2 -6t1au2s3g2 -t5au8s1l -2t1b2 -2t1c -tc8h -t6chu -2t1d -te2am -tea4s -te1b -te1be -te8ben -tec8h -5t8e2ch3n6 -te1f -4te2ff -te1gr4 -te4g3re -te1ha -te6hau -2te1he -te4hel -2t1e6hr -tei1d -te5id. -teig5l -6t1eign8 -tei8gr4 -1te2il -4tein1h -t5einhe -4teis -tei1se -t5eisen -8tei1w -te1la -te8lam -te4lar -te1le -4t1elek -8telem -te1ma -te6man -te6n5ag -te1ne -ten8er1w -ten5k -te6ns -ten1s4p2 -ten1tr6 -ten8tro -4t3en2t1w -8t1en2t1z -te1pl8 -te6p1li -5tep1pi -ter5a6b -te3ral -ter5au -ter1b -ter1ba -8terbar -ter1be -t5erbe. -6terben -8ter8bs -4t3er2b1t -te8rd -ter1de -t5erde. -te1re -tere1b -ter5e1be -t2erei -ter5ein -te1rer -te8re2r1s -ter1f4 -ter1h8 -8terhö -te6rk -ter1kl8 -6t3er1klä -te2rn -ter1no -ter8nor -te2rr -ter1re -ter6re. -te2r1s -tersc8h4 -t8erscha -te1se -t5e6sel -te2s1ta -te8stau -t3eu1ro -te1xa -tex3e -8t1e8x3p2 -te8x1t -tex6ta -2t1f2 -2t1g2 -2th. -th6a -5tha. -2t1haa -6t1hab -6t5haf -t5hah -8thak -3t2hal. -6tha2ls -6t3ha2n1d -2t1hau -1the. -3t4hea -t1he1b -t5he2il -t3heit -t3hel1f -1t8heo -5t4he1rap -5ther1f -6t5herz -1thes -1thet -5thi. -2t1h2il -t3him -8thir -3this -t5h1j -2th1l -2th1m -th1n -t5hob -t5hof -4t1holz -thop1t -6th1opti -1t6hr6 -4ths -t1hum -1thy -4t1hä -2t1hö -t1hü -ti1a2m -ti1b -tie1f -tie1fe -tie6fer -ti1en -t2i1ge -ti8gerz -tig3l -ti1k -ti8kin -t2il -ti5lat -1ti2l1g -t1i2n1d -tin4k3l8 -tisp2 -ti3spa -ti5str6 -5ti1te -ti5tr6 -t2i1v -ti1ve -ti8vel -ti8vr -2t1j -2t1k2 -2t1l -tl8a -2t1m8 -2t1n -3to1be -8t1ob1j -toc8h -to3cha -5to2cht -8toc2k -to1d -to1de4 -to8del -to8du -to1e -to1fe -6t5o6fen -to1in -toi6r -to6ll -5toll. -to1me -to8me1ne -t2o6ns -2t1ony -to1pe -to4p8er -5topf. -6top1t -to1ra -to1s -to2s1te -to1s1k2 -to6s1ka -tos2l -2to1ti -to1tr6 -t8ou -2t1p2 -6t1q -tr6 -trac8h -tra5cha -tr8afa -tra8far -tra2f5t -1trag -tra6gl -tra6gr4 -t3rahm -1trai -t6ra6ns -tra3sc -tra6st -3trau1e -t4re. -2trec -t3rec8h -t8rec2k -6t1re1d -t8ree -4t1reg -3treib -4tre2if -8t3reis -8tre1p2o -tr6e6t5r6 -t3re1v -4t3re1z -1trib -t6ric2k -tr2ie -tri6er -2t1r2ig -t8rink -tr2io -tri6o5d -tri1z -tri1zi5 -tro1a -3troc -troc2k -trocke6 -tro5i8d -tro1ma -tro3m6an -tro8man. -tr2on -tro3ny -5tropf -6t5ro1sa -t5roß -5trub -5trup -trut5 -1träg -6t1röh -5trüb -tr5ü3bu -t1rüc -t1rüs -2ts -ts1ab -t1sac -tsa8d -ts1ak -t1sal -t6s5a2l1t -ts1an -ts1ar -ts3auf -tsc8h -t3sc6hr -t5schä -t1se -tse6e -tse1e5i -tsei6n6s -ts3ent -ts1er -t8ser1f -t4se6rk -t8s1h -t1si -5t6si1k -t4s3int -t1so -tso2r1t -ts5ort. -tsp2 -ts1p2o -t5s6por -tspr6 -t6sprei -t1st -t2s1te -t1sta -t6s5tanz -t2s1th -ts1ti -t6stit -t1sto -t4s3tor -t1su -1t2sua -t2s1uf -t8sum. -t2s1u8n -t2s1ur -2t1t -tt5e2if -tte6sa -tt1h6a -ttr6 -tt8ret -t2ts -tt1sc -tt1se -tt8s1er -tt5s6z -1t2uc -tuc8h -tuch5a -1tu1e -6tuh -t5u6hr -t6u1i -tu6it -1tu2m1h -6t5u2m1r -1tu2ms -8tu2m1t -6tu2n1d -6tun1f -2t1unt -tu5ra -tu6rau -tu1re -tu6re. -tu4r3er -2t1v -2t1w -1ty1 -ty6a -ty8la -8tym -6ty6o -2tz -tz5al -tz1an -tz1ar -t1ze -t8zec -tzeh6 -tzehn5 -t6z5ei. -t1zo -t6zor -t1zu -t4z3um -t1zä -t6zäu -5täg -6täh -t5ä2l1t -t8än -tä1re8 -8tä8st -6t1äuß -tö2ff -töf5fe -t5öffen -8tö8k -1tön -4tüb -tü1b6e2 -t3ü4ber1 -t6ü5b8er. -5tüc8h -1tür. -u3al. -u5a2lb -u5al1f -u3a6l1h -u5a6l1k -u3a6l1p -u3an. -ua5na -u3a2n1d -u5a6ns -u5ar. -ua6th -u1au -ua1y -u1ba -u2bab -u1bi -ub6ie -ubi5er. -u1br -u6b5r2it -u8bs -ubs2k2 -u5bö -u1bü -u8büb -2uc -uc8h -u1che -u6ch5ec -u1chi -uch1l6 -u6ch3m -u2ch5n6 -uc6h1r -u2cht -uch5to -uchtr6 -ucht5re -u1chu -u8ch1w -uc2k -uc1k1a -uck5in -u1d -ud4a -u1ei -u6e1la -ue1ne8 -u6ep -u1er -uer1a -ue1re -ue1rer -ue8rer1l -uer5o -u8e1sc -u2est -u8e1v -u1fa -u1fe -u2f1ei -u4f3ent -u8fer1h8 -u2ff -uf1fr6 -uf1l -ufr6 -uf1ra -uf1re -uf1rä -uf1rü -u2fs -uf1s2p2 -uf1st -u2ft -uf2t1s -u1ga -u8ga2b1t -u8ga1d -u6gap -u1ge -uge1b8 -u8gn8 -u1go -ugo3s4 -u1ha -u1he -u1hi -uh1le -u1ho -u6hr -uh1re -u1hu -uh1w -u1hä -u1hö -6ui -ui5en -u1ig -u3i6ns -uin1te -uin8tes -uisc8h -u5i8s2ch. -u1j -6uk -u1ke -u1ki -u1kl8 -u8klu -u1k6n8 -u5ky -u1la -u6ld -ul2ds -uld8se -u1le -u6ll -ul1la -ul8lac -ul6lau -ul1le -ul6le6l -ul6lo -u6ln -ul1ni8 -u1lo -ulo6i -u2l1t -ult6a -ult8e -u1lu -ul1v -ul2vr -u1lä -u1lö -u2m1f6 -3umfan -u2m1l -5umlau -u1mo -u8mo8f -u2mp -um1ph -um8pho -u1mu -umu8s -u5mö -u1n1a -un2al -un6at -unau2 -u2n1d -6und. -un1de -un2d1ei -5undein -un1du -un4d3um -un2d1z -3undzw8 -un1dü8 -un8düb -u1ne -une2b -u2n1ec -une2h -u8n3eis -un1f -3unfal -1un1fä -un1ge -5unge1a2 -3un1glü -un2g2s1 -un8gä -u1ni -1u2n2if -un4it -un1kr8 -un8kro -un2k5s -u1no -un1p2 -unpa2 -u6ns -uns2p2 -un1v -unvol4 -unvo6ll5 -u5os. -u1pa -u1pi -u1p2l8 -u1pr6 -u2p4s3t -up1t -up2t1a -u1q -u1ra -ur5a8b1s -ura8d -ur5ah -u6rak -ur3a2l5t -u6rana -u6r5a6ns -u8rap -ur5a6ri -u8ra2t1t -u1re -ur3eig -u8r1g -ur1gr4 -ur8gri -u1ri -ur5i6ns -ur1l -3urlau -u6r1m -ur1me -urmen6 -u2rn -ur1na -ur8nan -u1ro -u2r1s -3ursac -ur8sau -ur1se -ur8sei -ur4s1k2 -u2r1t -3ur5tei -u1ru -ur6u5i6 -u2r1u6r -u1ry -ur2za -ur6zä -ur5ä6m -u5rö -u1rü -urü8c2k3 -u1sa -u1sag -usa4gi -u2s1ar -u2s1au -usc8h -u1sche -u8schec -us8chw -usch5wi -u1se -u2s1ei -use1ke -use8kel -u8s1l -u1sta -u4st3a4b -us3tau -u1su -u2s1uf -u8su2rn -ut1ac -u1tal -uta8m -u1tan -ut1ar -u1tas -ut1au -u1te -u8teic -u4tent -u8ter1f4 -ut2e1ri -u6terin -u4t3hei -ut5ho -ut1hu -u1ti -uti1ne5 -uti6q -u1to -uto5c -u1tr6 -u2ts -ut1sa -ut1s6p2 -ut1st -utstr6 -ut6stro -u1tu -u2tz -utz5w8 -u1u -u1v -u1ve -uve5n -uver1 -uve3r4ä -u1w -u1xe -u5ya -uy5e6 -u1yi -u1ze -u2z1eh -u8zer1h8 -u5ö -u1ße -uße6n -uße1n5e -8van1b2 -6vang -6var1b -va8r8d -v8a6t5a -va1te -va8tei -v4a2t1r6 -2v1b -6v5c -6vd -1ve -6ve5g6 -ver1 -ver5b -verb8l8 -ve2re2 -ve8r1g8 -v2e2ru8 -ve1s -ve2s3p2 -ve3xe -2v1f -2v1g -6v5h -vi6el -vie6w5 -vi1g4 -v2il -vi1le -vi8le8h -vi6ll -vil1le -vil6le. -8vint -vi1ru -vi1tr6 -2v1k -2v1l -2v1m -4v5n -8vo8f -vo2il -voi6le -vo6ll -vol1le -vol8le2n1d -vol8li -v2or1 -vo2re -vo1ri -vo8rin -vo2ro -2v1p -8vra -v6re -2v2s -2v1t -2v1v -4v3w -2v1z -wa2ff -waf5fe8 -wa6g5n8 -1wah -wah8n -wa5la -wa6ld -wal1di -wal8din -wa2l1t -wal6ta -wa2n1d -wan4dr4 -5w2a1re -wa8ru -war4za -1was -w5c -w1d -5wec8h -we1f -we6fl -1weg -we1ge -we8geng -weg5h -weg3l -we2g1r4 -we6hr -weh1re -weh6r5er -5wei1se -weit3r6 -we2l2t -welt3r6 -we6rat -8wer1c -we8rd -5wer1du -wer1f -wer4fl -we6rk -5werk. -wer4ka -wer8ku -we2r1t -wer4ta -wer8te6r1m -we2sp2 -wes1te -we8s4te2n1d -we8str6 -we8stö -we2t1t -wet8ta -wic8h -wi2chs -wich6s5t -1wi1d -wi2dr4 -wie1d -wie1de4 -wieder5 -wi1k6 -wi2m1m -wim6ma -wi2n1d -win4d3r4 -5wi2r1t -wisc8h -wisch5l6 -1wj -6wk -2w1l -8w1n -wo1c -woc8h -wo1che6 -wol6f -wo2r1t -wor6t5r6 -6ws2 -w1s1k2 -6w5t -wu2n1d -wun1de -5wunde. -wun6gr4 -wu1sc -wu2t1 -6w5w -wy5a -wä6r1m -wär1me5 -wä1sc -1xag -x1ak -xa1me -x3a4men -8xa2m1t -x1an -8x1b -x1c -1xe. -x3e4g -1xen -xe1ro -x1erz -1xes -8xf -x1g -8x1h -1xi -8xi1d -xi8so -4xis1te -x1k -6x1l -x1m -8xn -1xo -8x5o6d -8x3p2 -x1r -x1s6 -8x1t -x6tak -x8ter1f4 -x2t1h -1xu -xu1e -x5ul -6x3w -x1z -5ya. -y5an. -y5ank -y1b -y1c -yc8h -y6cha -y4chia -y1d -yen6n -y5e2rn -y1g -y5h -y5in -y1j -y1k2 -y1lak -yl1al -yla8m -y5la1x -y1le -y1lo -y5lu -y8m1n8 -y2m1p2 -y3mu -y1na -yno2d -yn1t -y1on. -y1o4p -y5ou -y1p2o1 -y1pr6 -y8ps -y1r -yr2i3e -y2r1r2 -y1si -y2s5iat -ys8ty1 -y1t -y3w -y1z -yä8m -z5a6b -za1b5l8 -8za6d -1zah -za5is -4z3ak -6z1am -zan1ge -5zange. -8z1an5l6 -2z1a1ra -6z5as -z5auf -3zaun -2z1b -6z1c -6z1d -1ze -ze1d -ze1di -ze4di1k -ze1f -4z3e2ff -8zein -zei4ta -zei1te -zei8te2r1s -ze6la -ze1le -ze8lec -ze2l1t -zel8th -4ze2mp -zen1ge -6z5engel -zen1zi -zen8zin -ze8r1g -8zer1gä -z2e1r8i -ze1ro -ze2r1s8 -ze2r1t -zerta8 -zer8tab -zer8tag -8zerz -ze8s1te -zeu6gr4 -2z1ex -2z1f8 -z1g -4z1h -1zi -zi1en -zi5es. -4z3i2mp -zi1na -6z5in1f -6z5in1ni -zi6ns -zin1se -zin6s5er -zin1su -8zinsuf -zist5r6 -zi5th -zi1tr6 -6z1j -2z1k -2z1l -2z1m -6z1n -1zo -z8o1g -zo6gl -4z3oh -zo1on -zo2rn -zor6na8 -4z1p -z5q -6z1r -2z1s8 -2z1t -z4t3e2n1d -z4t3hei -z8thi -1zu -zu3al -zu1b4 -zu1f2 -6z5u6hr -zu1n2a -zu1ne -8zunem -zun1f8 -8zungl -zu1o -zup8fi -zu1s8 -zu1z -2z1v -zw8 -z1wal -5zwec2k -zwei3s -z1wel -z1wer -z6we8r1g -8z5wes -1zwi -zwi1s -6z1wo -1zy -2z1z -zz8a -z1zi -zzi1s -1zä -1zö -6z1öl. -zö1le -1zü -2z1ü2b -ä1a6 -äb1l8 -äc8h -ä1che -ä3chi -ä2chs -äch8sc -äch8sp2 -ä5chu -äc2k -äc1k5a -äd1a -ä1de -äd5era -ä1di -ä6d5ia -ä1e -ä5fa -äf1l -ä2ft -äf2t6s -äg1h -äg3le -ägn8 -ä1gna -ä6g5nan -ä2gs -äg5str6 -ä1he -ä1hi -äh1le -äh5ne -1ähn5l6 -ä6hr -äh1re -äh5ri -äh1ru -ä1hu -äh1w -6äi -ä1isc -äisc8h -ä6i1sche -ä5i2s1m -ä5j -ä1k -ä8l1c -ä1le -ä8lei -ä2ls -äl1sc -älsc8h -äl6schl6 -ä1mi -ämi1e -äm8n8 -ä2m8s -ä5na -ä2n1d -än1de -5änd2e1ru -ä1ne -äne5i8 -äng3l -änk5l8 -ä1no -ä6ns -än6s5c -ä1pa -äp6s5c -3äq -är1c -ä1re -äre8m -ä8r1g -är1ge -5ärge2rn -är6gl -ä1ri -ä6r1m -är1me -3ärmel -ä1ro -ä2r1t -är2t6s5 -ä1ru -är2z1t -3ärz2t1l -ä5rö -äsc8h -ä1sche -ä6s5chen -ä1se -äse6n8s -ä2s1th -äta8b -ä1te -ät2e1ri4 -äter5it -ä6thy -ä1ti -3ä2t1k2 -ä1to -ä2ts -ätsc8h -ät8schl6 -äts1p2 -ä5tu -äub1l8 -äu1e -1äug -äu8ga -ä6u5i -ä1um. -ä1us. -1äuß -ä1z -ö1b -öc8h -ö1che -ö5chi -ö2chs -öchs1te -öch8s2tei -öch8str6 -ö2cht6 -ö1de -5ö6dem -ö2ff -5öf2f1n -ö1he -öh1l8 -ö6hr -öh1re -ö1hu -ö1is -ö1ke -1ö2k2o -1öl. -ö6l1k -öl6k5l8 -ö6l1p -öl8pl8 -ö1mu -ö5na -ö1ni -öni2g6s3 -ö1no -ö5o6t -öpf3l -öp6s5c -ö1re -ö8r1g -ör8g1li -ö1ri -ö2r1t -ör8tr6 -ö1ru -ös1te -5öste2rr -ö1te -ö5th -ö1ti -ö1tu -ö1v -ö1w -öwe8 -ö2z -ü1b6e2 -3ü4ber1 -üb1l8 -ü1b1r -5ü2bu -üc8h -ü1che -ü1chi -ü8ch3l6 -ü2chs -üch6s5c -ü8c2k -üc1k1a -ück5e2r1s -üd1a2 -ü1de -ü6deu -ü1di -üdi8t -ü2d1o4 -ü2d5s6 -ü1ge -üge4l5a -üg1l -üh5a -ü1he -ü8heh -ü6h5e6rk -üh1le -ü6hr -üh1re -üh1ru -ü1hu -üh1w -ü3k -ü1le -ü6ll -ül4l5a -ül8lo -ü6l1p -ül4ps -ü2ls -ül6s5c -ü1lu -ü2n1d -ün8da -ün1f -ün1fe -ün8fei -ünk5l8 -ün8za -ün6zw8 -ü5pi -ü1re -ü8rei -ür1f -ür8fl -ür8fr6 -ü8r1g -ür1ge -ür8geng -ü1ri -ü1ro -ü2r1s -ür8sta -ü1ru -ü1se -üse8n -ü8sta -üs1te -ü8stes -ü3ta -ü1te -ü1ti -ü2t1t -üt8tr6 -ü1tu -ü2tz -üt1ze -üt8zei -ü1v -ß1a8 -5ßa. -ß8as -ß1b8 -ß1c -ß1d -1ße -ß5ec -8ße8g -8ße8h -2ß1ei -8ßem -ß1f8 -ß1g -ß1h -1ßi -ß1k -ß1l -ß1m -ß1n -ß1o -ß1p8 -ß5q -ß1r -ß1s2 -ßst8 -ß1ta -ß1te -ßt3hei -ß1ti -ß5to -ß1tr6 -1ßu8 -6ß5um -ß1v -ß1w -ß1z -2s1ta. -i1sta -i2s1tal -2s1ta1ni -2s1tan. -fe2s1ta -nd1st -nd2s1te -ve2s1te -3s2tec -stec8h -4s5t8e2ch3n6 -3s2teg -3s2teh -3s2tein -3s2teig -3s2te2if -3s2te6ll -3s2telz -a4s3tel -3s2te2m1m -3s2te2mp -ss1te -s3s2ter -t3s2te2rn -3s2teu1e -6s4t3eu1ro -bs2ti -te2s3ti -ve2s1ti -3s2tic -3s2tie1b -3s2tieg -3s2t2if -3s2t2il -3s2tim -3s2tink -3s2ti1tu -a2s1to -gu2s1to -ku2s1to -i1sto -i2s1tol -i2s1tor -ve2s1to -2s1tung -2s7tus -o1stu -o2s1tul -aus3s4 -ens3s4 -gs3s4 -.mis2s1 -s2s1b8 -s1sche -s2s3chen -s2s3d -s2s5ec -2s2s1ei -s2s3f2 -s2s3g2 -s2s3h -s2s3k2 -s2s3l -s2s3m -s2s3n -s2s3p8 -s2s5q -s2s3r -s2s3s2 -sss2t8 -as2s3te -is2s3te -us2s3te -üs2s3te -s2sth -s2st3hei -s2s3ti -s2s1to -s2s1tr6 -s1su -6ss5um -s2s3v -s2s3w -s2s3z -1cker. -1cke2r1t -c1ka -1cka1d -1cke. -1ckel -1cken -4ck1ent -1cke1re -1cke2rn -1ck2e1ru -1ckie -1ckig -c1ku -1ckun -ta8s7ta7tur -ta1sta -tast6a1tu -.fli7ck8en7tep7pic8h -.f1li -.f2lic2k -.fli1cken -.fli4ck1ent -.flicken1te -.flicken5tep1pi -.mitt7wo8ch7a8be2n1d -.3mi2t1t -.mit2t1w -.mittwo1c -.mittwoc8h -.mittwocha1be -.ja7cken. -.jac2k -.ja1cken -.ja7cken7ta7sche. -.ja4ck1ent -.jacken1ta -.jackenta1sc -.jackentasc8h -.jackenta1sche -.let7s8cho. -.le2t1s -.letsc8h -.let1scho -.men8s7tru7a7ti7on -.1me -.me6ns -.men1str6 -.menstru2a1ti -.menstruat2io -ni7ve8au7st8a7bi7li7tät. -n2i1v -ni1ve -nive1aus -niveau4sta -niveau4st3a4b -niveausta1bi -niveaustab2il -niveaustabi1li -niveaustabili1tä -niveaustabilität2 -.ur7in8stin2k1t -.u1ri -.ur5i6ns -.u4rinst -.urins1ti -.urin3s2tink -.wach8s8tu7be -.wac8h -.wa2chs -.wach1stu -.stau8be1cken -.1sta -.stau1be -.staubec2k -.stau8b7ent7wick7lung -.stauben2t1w -.staub5entwic -.staubentwic2k -.staubentwick3l8 -.staubentwick1lun -en6d5an -en6d5ab -eben7d6a -ebe2n1d -pen7d8an -pe2n1d -ten7d8an -te2n1d -gram4m5a2 -gra2m1m -gram5m6a3t -de1h6a -jek2t3o -je2k1t -ojek3t4o -oje2k1t -ol2l1ernt -ol1ler -olle2rn -berg7a8n7sicht -berg7a8n7sich7ten -bi7lan8z7er7stel7lung -bi7lan8z7er7stel7lun7gen -bi7lan8z7auf7stel7lung -bi7lan8z7auf7stel7lun7gen -Bun7de8s7ar7chiv -Bun7de8s7ar7chi7ve -Bun7de8s7ar7chi7ven -Bun7de8s7ar7chivs -du7el8l7op7fer -du7el8l7op7fern -du7el8l7op7fers -farb7a8n7sicht -farb7a8n7sich7ten -fas8s7an7stich -fas8s7an7stichs -fet8t7ab7sau7gung -fet8t7ab7sau7gun7gen -fi7n8anz7amt -fi7n8anz7amts -fi7n8anz7äm7ter -fi7n8anz7äm7tern -fi7n8anz7aus7stat7tung -fi7n8anz7aus7stat7tun7gen -fi7n8an7zie7rungs7a8spekt -fi7n8an7zie7rungs7a8spek7te -fi7n8an7zie7rungs7a8spek7ten -fi7n8an7zie7rungs7a8spek7tes -fi7n8an7zie7rungs7a8spekts -fin7ge8r7an7satz -fin7ge8r7an7sat7zes -fin7ge8r7an7sät7ze -fin7ge8r7an7sät7zen -glei8s7an7bau -glei8s7an7baus -glei8s7an7bau7ten -gra7fi8k7an7for7de7rung -gra7fi8k7an7for7de7run7gen -gra7fi8k7an7zei7ge -gra7fi8k7an7zei7gen -gra7fi8k7aus7stel7lung -gra7fi8k7aus7stel7lun7gen -gra7fi8k7aus7stat7tung -gra7fi8k7aus7stat7tun7gen -gra7fi8k7ent7wurf -gra7fi8k7ent7wurfs -gra7fi8k7ent7wür7fe -gra7fi8k7ent7wür7fen -gra7phi8k7an7for7de7rung -gra7phi8k7an7for7de7run7gen -gra7phi8k7an7zei7ge -gra7phi8k7an7zei7gen -gra7phi8k7aus7stel7lung -gra7phi8k7aus7stel7lun7gen -gra7phi8k7ent7wurf -gra7phi8k7ent7wurfs -gra7phi8k7ent7wür7fe -gra7phi8k7ent7wür7fen -gym7nas7ti8k7übung -gym7nas7ti8k7übun7gen -hau8s7in7ter7na -hau8s7in7tern -hau8s7in7ter7ne -hau8s7in7ter7nem -hau8s7in7ter7nen -hau8s7in7ter7ner -in7sol7ven8z7an7trag -in7sol7ven8z7an7trags -in7sol7ven8z7an7trä7ge -in7sol7ven8z7an7trä7gen -in7sol7ven8z7er7öff7nung -in7sol7ven8z7er7öff7nun7gen -jo7se8phs7stadt -kom7pe7ten8z7er7war7tung -kom7pe7ten8z7er7war7tun7gen -krei8s7amt -krei8s7amts -krei8s7äm7ter -krei8s7äm7tern -krei8s7amt7mann -krei8s7amt7man7nes -krei8s7amt7manns -krei8s7amt7män7ner -krei8s7amt7män7nern -krei8s7an7zei7ger -krei8s7an7zei7gers -krei8s7an7zei7gern -krei8s7ar7chiv -krei8s7ar7chi7ve -krei8s7ar7chi7ven -krei8s7ar7chivs -krei8s7ar7chi7var -krei8s7ar7chi7vars -krei8s7ar7chi7va7re -krei8s7ar7chi7va7ren -krei8s7au -krei8s7auer -krei8s7in7tern -krei8s7in7ter7ne -krei8s7in7ter7nem -krei8s7in7ter7nen -krei8s7in7ter7ner -krei8s7in7ter7nes -kri7ti8k7an7satz -kri7ti8k7an7sat7zes -kri7ti8k7an7sät7ze -ku7lan8z7an7trag -ku7lan8z7an7trags -ku7lan8z7an7träge -ku7lan8z7an7trä7gen -lack7an7strich -lack7an7strichs -lack7an7stri7che -la7ge8r7ei7gen -la7ge8r7ei7ge7ne -la7ge8r7ei7ge7nen -la7ge8r7ei7ge7ner -la7ge8r7ei7ge7nes -la7ge8r7in7tern -la7ge8r7in7ter7ne -la7ge8r7in7ter7nen -la7ge8r7in7ter7ner -la7ge8r7in7ter7nes -lo7gi8k7an7satz -lo7gi8k7an7sat7zes -lo7gi8k7an7sät7ze -lo7gi8k7an7sät7zen -lo7gis7ti8k7auf7wand -lo7gis7ti8k7auf7wands -me7cha7ni8k7an7teil -me7cha7ni8k7an7tei7le -me7cha7ni8k7an7tei7len -me7cha7ni8k7an7teils -me7cha7ni8k7an7trieb -me7cha7ni8k7an7trie7be -me7cha7ni8k7an7trie7ben -me7cha7ni8k7an7triebs -me7di7e8n7er7zie7hung -me7di7e8n7in7ves7tor -me7di7e8n7in7ves7tors -me7di7e8n7in7ves7to7ren -me7tho7di8k7an7satz -me7tho7di8k7an7sat7zes -me7tho7di8k7an7sät7ze -me7tho7di8k7an7sät7zen -me7tho7di8k7ent7wurf -me7tho7di8k7ent7wurfs -me7tho7di8k7ent7wür7fe -me7tho7di8k7ent7wür7fen -mu7si8k7in7dus7trie -mu7si8k7in7sti7tut -mu7si8k7in7sti7tu7te -mu7si8k7in7sti7tu7ten -mu7si8k7in7sti7tuts -phy7si8k7aus7stel7lung -phy7si8k7aus7stel7lun7gen -phy7si8k7in7sti7tut -phy7si8k7in7sti7tu7te -phy7si8k7in7sti7tu7ten -phy7si8k7in7sti7tuts -pla7sti8k7ab7fall -plas7ti8k7ab7falls -plas7ti8k7ab7fäl7le -plas7ti8k7ab7fäl7len -plas7ti8k7aus7stel7lung -plas7ti8k7aus7stel7lun7gen -plas7ti8k7aus7weis -plas7ti8k7aus7wei7se -plas7ti8k7aus7wei7sen -plas7ti8k7aus7wei7ses -plas7ti8k7ei7mer -plas7ti8k7ei7mern -plas7ti8k7ei7mers -plas7ti8k7ent7wurf -plas7ti8k7ent7wurfs -plas7ti8k7ent7wür7fe -plas7ti8k7ent7wür7fen -po7li7ti8k7an7satz -po7li7ti8k7an7sat7zes -po7li7ti8k7an7sät7ze -po7li7ti8k7an7sät7zen -prin8t7auf7la7ge -prin8t7auf7la7gen -pro7gram8m7ab7lauf -pro7gram8m7ab7laufs -pro7gram8m7ab7läu7fe -pro7gram8m7ab7läu7fen -pro7gram8m7ab7bruch -pro7gram8m7ab7bruchs -pro7gram8m7ab7brü7che -pro7gram8m7ab7brü7chen -pro7gram8m7ab7schal7tung -pro7gram8m7ab7schal7tun7gen -so7w7je8t7uni7on -ver7kauf8s7auf7la7ge -ver7kauf8s7auf7la7gen -max-planc8k-in7sti7tut -max-planc8k-in7sti7tuts -max-planc8k-in7sti7tu7te -max-planc8k-in7sti7tu7ten -prä7g8nant -prä7g8nan7te -prä7g8nant7tem -prä7g8nant7ten -prä7g8nant7ter -prä7g8nant7tes -prä7g8nanz -rest7al7ko7hol -rest7al7ko7ho7le -rest7al7ko7hols diff --git a/librarian/res/hyph-dictionaries/hyph_fr.dic b/librarian/res/hyph-dictionaries/hyph_fr.dic deleted file mode 100644 index e260b9f..0000000 --- a/librarian/res/hyph-dictionaries/hyph_fr.dic +++ /dev/null @@ -1,2848 +0,0 @@ -UTF-8 -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -LEFTHYPHENMIN 2 -RIGHTHYPHENMIN 2 -COUMPOUNDLEFTHYPHENMIN 2 -COUMPOUNDRIGHTHYPHENMIN 2 -%%% Do not remove the following line %%% -NEXTLEVEL -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -2'2 -.a4 -'a4 -.â4 -'â4 -ab2h -a1bî -abî1me -abî2ment. -.a1b2r -'a1b2r -.ab1ré -'ab1ré -.ab3réa -'ab3réa -ab1se -ab3sent. -abs1ti -absti1ne -absti3nent. -ac1ce -ac3cent. -ac1q -acquies1ce -acquies4cent. -ad2h -aè1d2r -a1è2d1re -.ae3s4c2h -'ae3s4c2h -a1g2n -.a1g2n -'a1g2n -.ag1na -'ag1na -.a2g3nat -'a2g3nat -ag1no -a2g3nos -ai1me -ai2ment. -a1la -a2l1al1gi -al1co -1alcool -a1ma -amal1ga -amalga1me -amalga2ment. -â1me -â2ment. -.a1mi -'a1mi -.ami1no -'ami1no -.amino1a2c -'amino1a2c -.a1na -'a1na -.ana3s4t2r -'ana3s4t2r -a1ne -anes1t2h -anest1hé -1a2nesthé1si -a1ni -ani1me -ani2ment. -an1ti -.an1ti -'an1ti -.anti1a2 -'anti1a2 -.anti1e2 -'anti1e2 -.anti1é2 -'anti1é2 -.anti2en1ne -'anti2en1ne -anti1fe -antifer1me -antifer3ment. -.anti1s2 -'anti1s2 -a1po -.a1po -'a1po -.apo2s3ta -'apo2s3ta -apo2s3t2r -ap1pa -appa1re -appa3rent. -ar1c2h -arc1hi -archié1pi -archi1é2pis -.ar1de -.ar3dent. -.ar1ge -'ar1ge -.ar3gent. -'ar3gent. -ar1me -ar2ment. -ar1mi -armil5l -.ar1pe -'ar1pe -.ar3pent. -'ar3pent. -as1me -as2ment. -.as2ta -'as2ta -as1t2r -a2s3t1ro -au1me -au2ment. -a1vi -avil4l -1ba -.1ba -1bâ -.bai1se -.baise1ma -.bai2se3main -1be -1bé -1bè -1bê -4be. -2bent. -4bes. -1bi -.1bi -1bî -.bi1a2c -.bi1a2t -.bi1au -.bio1a2 -.bi2s1a2 -.bi1u2 -1b2l -b1le -4b4le. -2b2lent. -4b4les. -1bo -1bô -bou1me -bou2ment. -bou1ti -boutil3l -1b2r -b1re -4b4re. -2b2rent. -4b4res. -b1ru -bru1me -bru2ment. -1bu -1bû -1by -1ç -1ca -1câ -ca3ou3t2 -ca1pi -capil3l -ca1rê -carê1me -carê2ment. -c1ci -cci1de -cci3dent. -1ce -1cé -1cè -1cê -4ce. -2cent. -4ces. -1c2h -.1c2h4 -4ch. -2chb -c1he -.c1hè -4c4he. -2chent. -4c4hes. -che1vi -chevil4l -.chè1v2r -.chèv1re -.chèvre1fe -.chèvrefeuil2l -.chè2vre3feuil1le -2chg -c1hi -chien1de -chien3dent. -ch2l -ch1le -4ch4le. -4ch4les. -ch1lo -chlo1ra -chlo2r3a2c -chlo1ré -chlo2r3é2t -2chm -2chn -2chp -ch2r -ch1re -4ch4re. -4ch4res. -ch1ro -chro1me -chro2ment. -2chs -2cht -2chw -1ci -.1ci -1cî -cil3l -.ci1sa -.ci2s1alp -1c2k -4ck. -2ckb -c1ke -4c4ke. -2c2kent. -4c4kes. -2ckf -2ckg -2c1k3h -2ckp -2cks -2ckt -1c2l -c1la -cla1me -cla2ment. -c1le -4c4le. -2c2lent. -4c4les. -1co -.1co -1cô -co1acc -co1ac1q -co1a2d -co1ap -co1ar -coas1so -co1assoc -coas1su -co1assur -co1au -co1ax -1cœ -co1é2 -co1ef -co1en -co1ex -co1g2n -cog1ni -co2g3ni1ti -.com1me -.com3ment. -com1pé -compé1te -compé3tent. -.con4 -con1fi -confi1de -confi3dent. -con1ni -conni1ve -conni3vent. -.cons4 -con1ti -conti1ne -conti3nent. -contin1ge -contin3gent. -.con1t2r -.cont1re -.contre1ma -.contremaî1t2r -.cont1re3maît1re -.contre1s2c -co1nu -co2nurb -.co1o2 -.coo1li -.co2o3lie -cor1pu -corpu1le -corpu3lent. -1c2r -c1re -4c4re. -2c2rent. -4c4res. -1cu -.1cu -1cû -.cul4 -cur1re -cur3rent. -1cy -cy1ri -cyril3l -1d2'2 -1da -.1da -1dâ -.da1c2r -.dac1ry -.dacryo1a2 -da1me -da2ment. -d1d2h -1de -1dé -.1dé -1dè -1dê -4de. -.dé1a2 -dé1ca -déca1de -déca3dent. -.dé1io -2dent. -.dé1o2 -.dé2s -4des. -.dé1sa -.dé3s2a3c2r -.dés2a3m -.dé3s2as1t2r -.désa1te -.dé3s2a3tell -.dé3s2c -.dé1se -.dé2s1é2 -.dé3s2é3g2r -.désen1si -.dé3s2ensib -.dé3s2ert -.dé3s2exu -.dé2s1i2 -.dé3s2i3d -.dé3s2i3g2n -.dé3s2i3li -.dési1ne -.dé3s2i3nen -.dé3s2in1vo -.dé3s2i3r -.dé3s2ist -.dé1so -.1dé3s2o3dé -.dé2s1œ -.dé3s2o3l -.déso1pi -.dé3s2o3pil -.dé3s2orm -.dé3s2orp -.dé3s2ou1f2r -.dé3s2p -.dé3s2t -.dé1su -.dé2s1u2n -dé1t2r -dét1ri -détri1me -détri3ment. -d1ha -3d2hal -d1ho -3d2houd -1di -.1di -1dî -.di1a2cé -.dia1ci -.di1a2cid -.di1ald -.di1a2mi -dia1p2h -diaph2r -diaph1ra -diaphrag1me -diaphrag2ment. -.dia1to -.di1a2tom -.di1e2n -di1li -dili1ge -dili3gent. -dis1co -di2s3cop -.di2s3h -dis1si -dissi1de -dissi3dent. -dis1ti -distil3l -d1le -2d2lent. -1do -.1do -1dô -.do1le -.do3lent. -1d2r -d1re -4d4re. -2d2rent. -4d4res. -d1s2 -1du -1dû -1dy -.1dy -.dy2s3 -.dy2s1a2 -.dy2s1i2 -.dy2s1o2 -.dy2s1u2 -.e4 -'e4 -.é4 -'é4 -.è4 -'è4 -.ê4 -'ê4 -é1ce -é3cent. -é1ci -éci1me -éci2ment. -é1cu -écu1me -écu2ment. -é1de -é3dent. -éd2hi -é1d2r -éd1ri -1é2drie -édri1q -1é2drique -é1le -é1lé -1é2lec1t2r -élé1me -1é2lément -é1li -éli1me -éli2ment. -é1lo -élo1q -élo3quent. -è1me -è2ment. -é1mi -.é1mi -émil4l -.émi1ne -.émi3nent. -.e1n1a2 -'e1n1a2 -é1ne -1é2nerg -e1ni -é1ni -éni1te -éni3tent. -e2n1i2v2r -.e1n1o2 -'e1n1o2 -en1t2r -ent1re -entre1ge -entre3gent. -é1pi -épis1co -épi2s3cop -épi3s4co1pe -é1q -é3quent. -équi1po -équipo1te -équipo3tent. -équi1va -équiva1le -équiva4lent. -é1re -é3rent. -er1me -er2ment. -es1ce -es3cent. -e2s3c2h -es1co -e2s3cop -es1ti -esti1me -esti2ment. -.eu2r1a2 -'eu2r1a2 -eus1ta -eu1s2tat -ex1t2r -ext1ra1 -extra2c -extra2i -1fa -1fâ -fa1me -fa2ment. -1fe -1fé -1fè -1fê -4fe. -fé1cu -fécu1le -fécu3lent. -2fent. -4fes. -1fi -1fî -fi1c2h -fic1hu -fichu1me -fichu3ment. -fir1me -fir2ment. -1f2l -f1la -flam1me -flam2ment. -f1le -4f4le. -2f2lent. -4f4les. -1fo -1fô -1f2r -f1re -4f4re. -2f2rent. -4f4res. -f1ri -fri1ti -fritil3l -f1s2 -1fu -1fû -fu1me -fu2ment. -1fy -1ga -1gâ -1ge -.1ge -1gé -1gè -1gê -4ge. -.gem1me -.gem2ment. -2gent. -4ges. -1g2ha -1g2he -1g2hi -1g2ho -1g2hy -1gi -1gî -gil3l -1g2l -g1le -4g4le. -2g2lent. -4g4les. -1g2n -g1ne -4g4ne. -2g2nent. -4g4nes. -1go -1gô -1g2r -g1ra -gram1me -gram2ment. -gran1di -grandi1lo -grandilo1q -grandilo3quent. -g1re -4g4re. -2g2rent. -4g4res. -g1s2 -1gu -1gû -4gue. -2guent. -4gues. -1gy -1ha -1hâ -1he -1hé -1hè -1hê -4he. -hé1mi -hémi1é -hé1mo -hémo1p2t -4hes. -1hi -1hî -hil3l -1ho -1hô -1hu -1hû -hu1me -hu2ment. -1hy -hy1pe -hype4r1 -hype1ra2 -hype1re2 -hype1ré2 -hype1ri2 -hype1ro2 -hypers2 -hype1ru2 -hy1po -hypo1a2 -hypo1e2 -hypo1é2 -hypo1i2 -hypo1o2 -hypo1s2 -hypo1u2 -.i4 -'i4 -.î4 -'î4 -i1al1gi -iar1t2h -i1arth2r -i1b2r -ib1ri -ibril3l -iè1d2r -i1è2d1re -.i1g2n -'i1g2n -.i2g3né -'i2g3né -.i2g3ni -'i2g3ni -il2l -im1ma -imma1ne -imma3nent. -im1mi -immi1ne -immi3nent. -immis1ce -immis4cent. -im1po -impo1te -impo3tent. -im1pu -impu1de -impu3dent. -.i1n1a2 -'i1n1a2 -.ina1ni -'ina1ni -.in2a3nit -'in2a3nit -.inau1gu -'inau1gu -.in2augur -'in2augur -in1ci -inci1de -inci3dent. -in1di -indi1ge -indi3gent. -in1do -indo1le -indo3lent. -in1du -indul1ge -indul3gent. -.i1n1e2 -'i1n1e2 -.i1n1é2 -'i1n1é2 -.inef1fa -'inef1fa -.in2effab -'in2effab -.iné1lu -'iné1lu -.in2é3luc1ta -'in2é3luc1ta -.iné1na -'iné1na -.in2é3nar1ra -'in2é3nar1ra -.in2ept -'in2ept -.in2er -'in2er -.in2exo1ra -'in2exo1ra -in1fo -infor1ma -1informat -.i1n1i2 -'i1n1i2 -.ini1mi -'ini1mi -.in2i3mi1ti -'in2i3mi1ti -.in2i3q -'in2i3q -.in2i3t -'in2i3t -in1no -inno1ce -inno3cent. -.i1n1o2 -'i1n1o2 -.ino1cu -'ino1cu -.in2o3cul -'in2o3cul -.in2ond -'in2ond -in1so -inso1le -inso3lent. -.ins1ta -'ins1ta -.in1s2tab -'in1s2tab -ins1ti -instil3l -in1te -.in1te -'in1te -intel1li -intelli1ge -intelli3gent. -.inte4r3 -'inte4r3 -.inte1ra2 -'inte1ra2 -.inte1re2 -'inte1re2 -.inte1ré2 -'inte1ré2 -.inte1ri2 -'inte1ri2 -.inte1ro2 -'inte1ro2 -.inters2 -'inters2 -.inte1ru2 -'inte1ru2 -in1ti -inti1me -inti2ment. -.i1n1u2 -'i1n1u2 -.in2uit -'in2uit -.in2u3l -'in2u3l -io1a2ct -i1oxy -is1ce -is3cent. -i1s2c2h -i2s3c1hé -isc1hi -i2s3chia -i2s3chio -is1ta -i1s2tat -i1va -iva1le -iva3lent. -1j -ja1ce -ja3cent. -4je. -2jent. -4jes. -2jk -1ka -1kâ -1ke -1ké -1kè -1kê -4ke. -2kent. -4kes. -1k2h -.1k2h4 -4kh. -1ki -1kî -1ko -1kô -1k2r -1ku -1kû -1ky -1la -.1la -1là -1lâ -.la1te -.la3tent. -la1w2r -la2w3re -1le -1lé -1lè -1lê -4le. -2lent. -4les. -1li -1lî -lil3l -l1li -l3lion -l1lu -llu1me -llu2ment. -l1me -l2ment. -1lo -1lô -l1s2t -1lu -1lû -1ly -1ma -.1ma -1mâ -.ma2c3k -.ma1c2r -.mac1ro -.macro1s2c -.ma1g2n -.mag1ni -.magni1ci -.ma2g3nici1de -.magni1fi -.magnifi1ca -.ma2g3nificat -.mag1nu -.ma2g3num -.ma1la -.mala1d2r -.malad1re -.ma2l1a2dres -.ma2l1a2d1ro -.ma2l1ai1sé -.ma2l1ap -.ma2l1a2v -.ma1le -.ma2l1en -.ma1li -.ma2l1int -.ma1lo -.ma2l1oc -.ma2l1o2d -.ma2r1x -1me -1mé -.1mé -1mè -1mê -4me. -mé1co -mécon1te -mécon3tent. -.mé1go -.mé2g1oh -4mes. -.mé2sa -.mé3san -.mé1se -.mé2s1es -.mé2s1i -.mé1su -.mé2s1u2s -.mé1ta -.mé1ta1s2ta -1mi -.1mi -1mî -mil3l -.mil3l -mil1le -mil4let -.mil1li -.milli1am -mi1me -mi2ment. -mit1te -mit3tent. -m1né -m1nè -1m2né1mo -1m2nès -1m2né1si -1mo -.1mo -1mô -1mœ -mo1no -.mo1no -.mono1a2 -.mono1e2 -.mono1é2 -.mono1i2 -.mono1ï2dé -.mono1o2 -.mono1s2 -.mono1u2 -mono1va -monova1le -monova3lent. -mon1t2r -mont1ré -mon2t3réal -moye1nâ -moye2n1â2g -m1s2 -1mu -1mû -mu1ni -muni1fi -munifi1ce -munifi3cent. -1my -1na -1nâ -1ne -1né -1nè -1nê -4ne. -2nent. -4nes. -1ni -1nî -1no -.1no -1nô -1nœ -.no1no -.no2n1obs -n1sa -n3s2at. -n3s2ats. -1nu -1nû -nu1t2r -nut1ri -nutri1me -nutri3ment. -n1x -1ny -.o4 -'o4 -.ô4 -'ô4 -o1b2l -ob1lo -o2b3long -oc1te -1octet -o1d2l -oè1d2r -o1è2d1re -o1g2n -og1no -ogno1mo -o2g3nomo1ni -o2g3no1si -o1io1ni -om1bu -ombud2s3 -ô1me -ô2ment. -om1me -om2ment. -om1ni -omni1po -omnipo1te -omnipo3tent. -omni1s2 -.on1gu -'on1gu -.on3guent. -'on3guent. -o1pu -opu1le -opu3lent. -or1me -or2ment. -os1ta -o1s2tas -o1s2tat -os1té -o1s2té1ro -os1ti -o1s2tim -os1to -o1s2tom -os1t2r -ost1ra -o1s2trad -o1s2tra1tu -ost1ri -ostric1ti -o1s2triction -.oua1ou -'oua1ou -.o1vi -'o1vi -.ovi1s2c -'ovi1s2c -oxy1a2 -1pa -.1pa -1pâ -pa1lé -paléo1é2 -.pa1na -.pa2n1a2f -.pa2n1a2mé -.pa2n1a2ra -.pa1ni -.pa2n1is -.pa1no -.pa2n1o2p2h -.pa2n1opt -pa1pi -papil2l -papil3la -papil3le -papil3li -papil1lo -papil3lom -.pa1ra -.para1c2h -.pa2r1a2c1he -.pa2r1a2c1hè -.para1s2 -.pa1re -.pa3rent. -.pa1r2h -.pa2r3hé -.pa1te -.pa3tent. -1pe -.1pe -1pé -.1pé -1pè -1pê -4pe. -2pent. -.pen2ta -pé1nu -pé2nul -.pe4r -.pe1r1a2 -pé1ré -.pe1r1e2 -.pe1r1é2 -pé1r2é2q -pe1r3h -.pé1ri -.pe1r1i2 -.péri1os -.péri1s2 -.péri2s3s -.péri2s3ta -.péri1u2 -per1ma -perma1ne -perma3nent. -.pe1r1o2 -per1ti -perti1ne -perti3nent. -.pe1r1u2 -4pes. -1p2h -.1p2h4 -4ph. -.p1ha -.pha1la -.phalan3s2t -p1he -4p4he. -2phent. -4p4hes. -ph2l -ph1le -4ph4le. -4ph4les. -2phn -p1ho -pho1to -photo1s2 -ph2r -ph1re -4ph4re. -4ph4res. -2phs -2pht -ph1ta -3ph2ta1lé -ph1ti -3ph2tis -1pi -1pî -pi1ri -piril3l -1p2l -.1p2l -p1le -4p4le. -2p2lent. -4p4les. -p1lu -.p1lu -plu1me -plu2ment. -.plu1ri -.pluri1a -p1ne -1p2né -1p2neu -1po -.1po -1pô -poas1t2r -po1ast1re -po1ly -poly1a2 -poly1e2 -poly1é2 -poly1è2 -poly1i2 -poly1o2 -poly1s2 -poly1u2 -poly1va -polyva1le -polyva3lent. -.pon1te -.pon2tet -.pos2t3h -.pos1ti -.pos2t1in -.pos2t1o2 -.pos2t3r -.post1s2 -1p2r -.1p2r -p1re -p1ré -.p1ré -4p4re. -.pré1a2 -.pré2a3la -.pré2au -.pré1e2 -.pré1é2 -préé1mi -préémi1ne -préémi3nent. -.pré1i2 -2p2rent. -.pré1o2 -.pré1s2 -4p4res. -pré1se -pré3sent. -.pré1u2 -p1ri -pri1va -privat1do -privatdo1ce -privatdo3cent. -privatdo1ze -privatdo3zent. -p1ro -.p1ro -.pro1é2 -proé1mi -proémi1ne -proémi3nent. -.pro1g2n -.prog1na -.pro2g3na1t2h -.pro1s2cé -pros1ta -pro2s3tat -.prou3d2h -p1ru -pru1de -pru3dent. -p1sy -.p1sy -1p2sy1c2h -.1p2sy1c2h -.psyc1ho -.psycho1a2n -p1té -p1tè -1p2tér -1p2tèr -1pu -.1pu -1pû -.pud1d2l -pu1g2n -pug1na -pugna1b2l -pu2g3nab1le -pu2g3nac -pu1pi -pupil3l -pu1si -pusil3l -1py -1q -qua1me -qua2ment. -4que. -2quent. -4ques. -1ra -1râ -ra1di -radio1a2 -rai1me -rai3ment. -ra1me -ra2ment. -r1ci -rcil4l -1re -.1re -1ré -.1ré -1rè -1rê -4re. -.ré1a2 -.ré2a3le -.réa1li -.ré2a3lis -.ré2a3lit -.ré2aux -.ré1e2 -.ré1é2 -.ré2el -.ré2er -.ré2èr -ré1ge -ré3gent. -.ré1i2 -.ré2i3fi -re1le -re3lent. -re1li -reli1me -reli2ment. -ré1ma -réma1ne -réma3nent. -2rent. -.ré1o2 -re1pe -re3pent. -.re1s2 -4res. -.res1ca -.re2s3cap -.res1ci -.re2s3ci1si -.re2s3ci1so -.res1co -.re2s3cou -.res1c2r -.re2s3c1ri -.res1pe -.re2s3pect -.res1pi -.re2s3pir -.res1p2l -.resp1le -.re2s3plend -.res1po -.re2s3pons -.res1q -.re2s3quil -.re2s3s -.res1se -.res3sent. -.re2s3t -.res1ta -.re3s4tab -.re3s4tag -.re3s4tand -.re3s4tat -.res1té -.re3s4tén -.re3s4tér -.res1ti -.re3s4tim -.re3s4tip -.res1to -.re3s4toc -.re3s4top -.re3s4t2r -.rest1re -.re4s5trein -.rest1ri -.re4s5trict -.re4s5trin -.re3s4tu -.re3s4ty -ré1su -résur1ge -résur3gent. -ré1ti -réti1ce -réti3cent. -.ré1t2r -.rét1ro -.rétro1a2 -.réu2 -.ré2uss -1r2h -r1he -4r4he. -4r4hes. -2r3heur -r1hy -2r3hy1d2r -1ri -1rî -ri1me -ri2ment. -rin1ge -rin3gent. -r1mi -rmil4l -1ro -1rô -1ru -1rû -ru1le -ru3lent. -1ry -ry1t2h -ry2thm -ryth1me -ryth2ment. -1sa -.1sa -1sâ -.sar1me -.sar3ment. -s1ca -1s2ca1p2h -1s2c2h -.1s2c2h4 -4s4ch. -sc1he -4s4c4he. -4s4c4hes. -2s2chs -s1c2l -sc1lé -1s2clér -s1co -1s2cop -1se -.1se -1sé -1sè -1sê -4se. -se1mi -semil4l -2sent. -ser1ge -ser3gent. -.ser1me -.ser3ment. -ser1pe -ser3pent. -4ses. -ses1q -sesqui1a2 -.seu2le -1s2h -.1s2h4 -4sh. -s1he -4s4he. -2shent. -4s4hes. -2shm -s1ho -2s3hom -2shr -2shs -1si -1sî -s1la -sla1lo -slalo1me -slalo2ment. -1s2lav -s1lo -1s2lov -1so -.1so -1sô -1sœ -.sou1ve -.sou3vent. -s1pa -spa1ti -1s2patia -s1pe -1s2perm -s1p2h -sp1hé -sp1hè -1s2phér -1s2phèr -s1pi -1s2piel -spi1ro -1s2piros -s1po -1s2por -spo1ru -sporu1le -sporu4lent. -s1ta -.s1ta -.sta2g3n -stan1da -1s2tandard -s1te -s1té -1s2tein -sté1ré -stéréo1s2 -s1ti -.s1ti -1s2tigm -.stil3l -s1to -1s2to1c2k -sto1mo -1s2tomos -s1t2r -st1ro -1s2tro1p2h -st1ru -1s2truc1tu -s1ty -1s2ty1le -1su -.1su -1sû -.su2b1a2 -.su3b2alt -.su2b1é2 -.su3b2é3r -.su1bi -.su2b1in -su1b2l -.su1b2l -sub1li -.sub1li -subli1me -subli2ment. -.subli1mi -.su2b3limin -.su2b3lin -.su2b3lu -sub1s2 -.su1bu -.su2b1ur -suc1cu -succu1le -succu3lent. -su1me -su2ment. -su1pe -supe4r1 -supe1ro2 -supers2 -su1ra -.su2r1a2 -su3r2ah -.su3r2a3t -su1ré -.su2r1e2 -.su2r1é2 -.su3r2eau -.su3r2ell -suré1mi -surémi1ne -surémi3nent. -.su3r2et -.su2r3h -.su1ri -.su2r1i2m -.su2r1inf -.su2r1int -.su1ro -.su2r1of -.su2r1ox -1sy -.1sy -.syn1g2n -.syng1na -.syn2g3na1t2h -1ta -.1ta -1tà -1tâ -ta1c2h -tac1hy -tachy1a2 -.ta1le -.ta3lent. -ta1me -ta2ment. -tan1ge -tan3gent. -t1c2h -tc1hi -tchin3t2 -1te -1té -1tè -1tê -4te. -té1lé -télé1e2 -télé1i2 -télé1o2b -télé1o2p -télé1s2 -tem1pé -tempé1ra -tempéra1me -tempéra3ment. -2tent. -ter1ge -ter3gent. -4tes. -tes1ta -testa1me -testa3ment. -1t2h -.1t2h4 -4th. -t1he -4t4he. -ther1mo -thermo1s2 -4t4hes. -2t3heur -2thl -2thm -2thn -th2r -th1re -4th4re. -4th4res. -th1ri -thril3l -2ths -1ti -1tî -1to -1tô -to1me -to2ment. -tor1re -tor3rent. -1t2r -.1t2r -t1ra -tran2s1a2 -tran3s2act -tran3s2ats -tran2s3h -tran2s1o2 -tran2s3p -trans1pa -transpa1re -transpa3rent. -tran2s1u2 -t1re -4t4re. -2t2rent. -4t4res. -t1ri -.t1ri -.tri1a2c -.tri1a2n -.tri1a2t -tri1de -tri3dent. -.tri1o2n -t1ru -tru1cu -trucu1le -trucu3lent. -t1t2l -1tu -1tû -tu1me -tu2ment. -tung2s3 -tur1bu -turbu1le -turbu3lent. -1ty -.u4 -'u4 -.û4 -'û4 -u1ci -ucil4l -ue1vi -uevil4l -u1ni -uni1a2x -uni1o2v -u2s3t2r -u1vi -uvil4l -1va -1vâ -va1ci -vacil4l -va1ni -vanil2l -vanil1li -vanil3lin -vanil3lis -1ve -1vé -1vè -1vê -4ve. -vé1lo -vélo1s2ki -ve1ni -veni1me -veni2ment. -2vent. -ven1t2r -vent1ri -ventri1po -ventripo1te -ventripo3tent. -4ves. -1vi -1vî -vi1di -vidi1me -vidi2ment. -vil3l -1vo -1vô -vol1ta -vol2t1amp -1v2r -v1re -4v4re. -2v2rent. -4v4res. -1vu -1vû -1vy -1wa -wa2g3n -1we -4we. -2went. -4wes. -1wi -1wo -1w2r -1wu -2xent. -xil3l -.y4 -'y4 -y1al1gi -y1as1t2h -ys1to -y1s2tom -1za -1ze -1zé -1zè -4ze. -2zent. -4zes. -1zi -1zo -1zu -1zy -% -% Additional patterns start here: -% -2’2 -’a4 -4a- -.á4 -'á4 -’á4 -4á- -.à4 -'à4 -’à4 -4à- -’â4 -4â- -.Ã¥4 -'Ã¥4 -’å4 -4Ã¥- -.ä4 -'ä4 -’ä4 -4ä- -.ã4 -'ã4 -’ã4 -4ã- --5a4 --5á4 --5à4 --5â4 --5Ã¥4 --5ä4 --5ã4 -abî2ment- -’a1b2r --5a1b2r -’ab1ré --5ab1ré -’ab3réa --5ab3réa -ab3sent- -absti3nent- -ac3cent- -acquies4cent- -.æ4 -'æ4 -’æ4 -4æ- --5æ4 -’ae3s4c2h --5ae3s4c2h -’a1g2n --5a1g2n -’ag1na --5ag1na -’a2g3nat --5a2g3nat -ai2ment- -amalga2ment- -â2ment- -’a1mi --5a1mi -’ami1no --5ami1no -’amino1a2c --5amino1a2c -’a1na --5a1na -’ana3s4t2r --5ana3s4t2r -ani2ment- -’an1ti --5an1ti -’anti1a2 --5anti1a2 -’anti1e2 -’anti1é2 --5anti1e2 --5anti1é2 -’anti2en1ne --5anti2en1ne -antifer3ment- -’anti1s2 --5anti1s2 -’a1po --5a1po -’apo2s3ta --5apo2s3ta -appa3rent- --5ar1de --ar3dent- -.ar3dent- --5ar3dent. -’ar1ge --5ar1ge --ar3gent- -.ar3gent- -'ar3gent- -’ar3gent- -’ar3gent. --5ar3gent. -ar2ment- -’ar1pe --5ar1pe --ar3pent- -.ar3pent- -'ar3pent- -’ar3pent- -’ar3pent. --5ar3pent. -as2ment- -’as2ta --5as2ta -au2ment- -.b4 -'b4 -’b4 -4b- --5b4 --5bai1se --5baise1ma --5bai2se3main -4be- -2bent- -4bes- --5bi1a2c --5bi1a2t --5bi1au --5bio1a2 --5bi2s1a2 --5bi1u2 -4b4le- -2b2lent- -4b4les- -bou2ment- -4b4re- -2b2rent- -4b4res- -bru2ment- -.c4 -'c4 -’c4 -4c- -.ç4 -'ç4 -’ç4 -4ç- --5c4 --5ç4 -carê2ment- -cci3dent- -4ce- -2cent- -4ces- -4ch- -4c4he- --5c1hè -2chent- -4c4hes- --5chè1v2r --5chèv1re --5chèvre1fe --5chèvrefeuil2l --5chè2vre3feuil1le -chien3dent- -4ch4le- -4ch4les- -4ch4re- -4ch4res- -chro2ment- --5ci1sa --5ci2s1alp -4ck- -4c4ke- -2c2kent- -4c4kes- -cla2ment- -4c4le- -2c2lent- -4c4les- --5com1me --com3ment- -.com3ment- --5com3ment. -compé3tent- --5con4 -confi3dent- -conni3vent- --5cons4 -conti3nent- -contin3gent- --5con1t2r --5cont1re --5contre1ma --5contremaî1t2r --5cont1re3maît1re --5contre1s2c --5co1o2 --5coo1li --5co2o3lie -corpu3lent- -4c4re- -2c2rent- -4c4res- --5cul4 -cur3rent- -1d2’2 -.d4 -'d4 -’d4 -4d- -.ð4 -'ð4 -’ð4 -4ð- --5d4 --5ð4 --5da1c2r --5dac1ry --5dacryo1a2 -da2ment- -4de- --5dé1a2 -déca3dent- --5dé1io -2dent- --5dé1o2 -4des- --5dé2s --5dé1sa --5dé3s2a3c2r --5dés2a3m --5dé3s2as1t2r --5désa1te --5dé3s2a3tell --5dé3s2c --5dé1se --5dé2s1é2 --5dé3s2é3g2r --5désen1si --5dé3s2ensib --5dé3s2ert --5dé3s2exu --5dé2s1i2 --5dé3s2i3d --5dé3s2i3g2n --5dé3s2i3li --5dési1ne --5dé3s2i3nen --5dé3s2in1vo --5dé3s2i3r --5dé3s2ist --5dé1so --5dé2s1œ --5dé3s2o3l --5déso1pi --5dé3s2o3pil --5dé3s2orm --5dé3s2orp --5dé3s2ou1f2r --5dé3s2p --5dé3s2t --5dé1su --5dé2s1u2n -détri3ment- --5di1a2cé --5dia1ci --5di1a2cid --5di1ald --5di1a2mi -diaphrag2ment- --5dia1to --5di1a2tom --5di1e2n -dili3gent- --5di2s3h -dissi3dent- -2d2lent- --5do1le --do3lent- -.do3lent- --5do3lent. -4d4re- -2d2rent- -4d4res- --5dy2s3 --5dy2s1a2 --5dy2s1i2 --5dy2s1o2 --5dy2s1u2 -’e4 -4e- -’é4 -4é- -’è4 -4è- -’ê4 -4ê- -.ë4 -'ë4 -’ë4 -4ë- --5e4 --5é4 --5è4 --5ê4 --5ë4 -é3cent- -éci2ment- -écu2ment- -é3dent- -éli2ment- -élo3quent- -è2ment- --5é1mi --5émi1ne --émi3nent- -.émi3nent- --5émi3nent. -’e1n1a2 --5e1n1a2 -éni3tent- -’e1n1o2 --5e1n1o2 -entre3gent- -é3quent- -équipo3tent- -équiva4lent- -é3rent- -er2ment- -es3cent- -esti2ment- -’eu2r1a2 --5eu2r1a2 -.f4 -'f4 -’f4 -4f- --5f4 -fa2ment- -4fe- -fécu3lent- -2fent- -4fes- -fichu3ment- -fir2ment- -flam2ment- -4f4le- -2f2lent- -4f4les- -4f4re- -2f2rent- -4f4res- -fu2ment- -.g4 -'g4 -’g4 -4g- --5g4 -4ge- --5gem1me --gem2ment- -.gem2ment- --5gem2ment. -2gent- -4ges- -4g4le- -2g2lent- -4g4les- -4g4ne- -2g2nent- -4g4nes- -gram2ment- -grandilo3quent- -4g4re- -2g2rent- -4g4res- -4gue- -2guent- -4gues- -.h4 -'h4 -’h4 -4h- --5h4 -4he- -4hes- -hu2ment- -’i4 -4i- -.í4 -'í4 -’í4 -4í- -.ì4 -'ì4 -’ì4 -4ì- -’î4 -4î- -.ï4 -'ï4 -’ï4 -4ï- --5i4 --5í4 --5ì4 --5î4 --5ï4 -’i1g2n --5i1g2n -’i2g3né --5i2g3né -’i2g3ni --5i2g3ni -imma3nent- -immi3nent- -immis4cent- -impo3tent- -impu3dent- -’i1n1a2 --5i1n1a2 -’ina1ni --5ina1ni -’in2a3nit --5in2a3nit -’inau1gu --5inau1gu -’in2augur --5in2augur -inci3dent- -indi3gent- -indo3lent- -indul3gent- -’i1n1e2 -’i1n1é2 --5i1n1e2 --5i1n1é2 -’inef1fa --5inef1fa -’in2effab --5in2effab -’iné1lu --5iné1lu -’in2é3luc1ta --5in2é3luc1ta -’iné1na --5iné1na -’in2é3nar1ra --5in2é3nar1ra -’in2ept --5in2ept -’in2er --5in2er -’in2exo1ra --5in2exo1ra -’i1n1i2 --5i1n1i2 -’ini1mi --5ini1mi -’in2i3mi1ti --5in2i3mi1ti -’in2i3q --5in2i3q -’in2i3t --5in2i3t -inno3cent- -’i1n1o2 --5i1n1o2 -’ino1cu --5ino1cu -’in2o3cul --5in2o3cul -’in2ond --5in2ond -inso3lent- -’ins1ta --5ins1ta -’in1s2tab --5in1s2tab -’in1te --5in1te -intelli3gent- -’inte4r3 --5inte4r3 -’inte1ra2 --5inte1ra2 -’inte1re2 -’inte1ré2 --5inte1re2 --5inte1ré2 -’inte1ri2 --5inte1ri2 -’inte1ro2 --5inte1ro2 -’inters2 --5inters2 -’inte1ru2 --5inte1ru2 -inti2ment- -’i1n1u2 --5i1n1u2 -’in2uit --5in2uit -’in2u3l --5in2u3l -is3cent- -iva3lent- -.j4 -'j4 -’j4 -4j- --5j4 -ja3cent- -4je- -2jent- -4jes- -.k4 -'k4 -’k4 -4k- --5k4 -4ke- -2kent- -4kes- -4kh- -.l4 -'l4 -’l4 -4l- --5l4 --5la1te --la3tent- -.la3tent- --5la3tent. -4le- -2lent- -4les- -llu2ment- -l2ment- -.m4 -'m4 -’m4 -4m- --5m4 --5ma2c3k --5ma1c2r --5mac1ro --5macro1s2c --5ma1g2n --5mag1ni --5magni1ci --5ma2g3nici1de --5magni1fi --5magnifi1ca --5ma2g3nificat --5mag1nu --5ma2g3num --5ma1la --5mala1d2r --5malad1re --5ma2l1a2dres --5ma2l1a2d1ro --5ma2l1ai1sé --5ma2l1ap --5ma2l1a2v --5ma1le --5ma2l1en --5ma1li --5ma2l1int --5ma1lo --5ma2l1oc --5ma2l1o2d --5ma2r1x -4me- -mécon3tent- --5mé1go --5mé2g1oh -4mes- --5mé2sa --5mé3san --5mé1se --5mé2s1es --5mé2s1i --5mé1su --5mé2s1u2s --5mé1ta --5mé1ta1s2ta --5mil3l --5mil1li --5milli1am -mi2ment- -mit3tent- --5mo1no --5mono1a2 --5mono1e2 --5mono1é2 --5mono1i2 --5mono1ï2dé --5mono1o2 --5mono1s2 --5mono1u2 -monova3lent- -munifi3cent- -.n4 -'n4 -’n4 -4n- -.ñ4 -'ñ4 -’ñ4 -4ñ- --5n4 --5ñ4 -4ne- -2nent- -4nes- --5no1no --5no2n1obs -n3s2at- -n3s2ats- -nutri3ment- -’o4 -4o- -.ó4 -'ó4 -’ó4 -4ó- -.ò4 -'ò4 -’ò4 -4ò- -’ô4 -4ô- -.õ4 -'õ4 -’õ4 -4õ- -.ø4 -'ø4 -’ø4 -4ø- --5o4 --5ó4 --5ò4 --5ô4 --5õ4 --5ø4 -.œ4 -'œ4 -’œ4 -4œ- --5œ4 -ô2ment- -om2ment- -omnipo3tent- -’on1gu --5on1gu --on3guent- -.on3guent- -'on3guent- -’on3guent- -’on3guent. --5on3guent. -opu3lent- -or2ment- -’oua1ou --5oua1ou -’o1vi --5o1vi -’ovi1s2c --5ovi1s2c -.p4 -'p4 -’p4 -4p- --5p4 --5pa1na --5pa2n1a2f --5pa2n1a2mé --5pa2n1a2ra --5pa1ni --5pa2n1is --5pa1no --5pa2n1o2p2h --5pa2n1opt --5pa1ra --5para1c2h --5pa2r1a2c1he --5pa2r1a2c1hè --5para1s2 --5pa1re --pa3rent- -.pa3rent- --5pa3rent. --5pa1r2h --5pa2r3hé --5pa1te --pa3tent- -.pa3tent- --5pa3tent. -4pe- -2pent- --5pen2ta --5pe4r --5pe1r1a2 --5pe1r1e2 --5pe1r1é2 --5pé1ri --5pe1r1i2 --5péri1os --5péri1s2 --5péri2s3s --5péri2s3ta --5péri1u2 -perma3nent- --5pe1r1o2 -perti3nent- --5pe1r1u2 -4pes- -4ph- --5p1ha --5pha1la --5phalan3s2t -4p4he- -2phent- -4p4hes- -4ph4le- -4ph4les- -4ph4re- -4ph4res- -4p4le- -2p2lent- -4p4les- --5p1lu -plu2ment- --5plu1ri --5pluri1a -polyva3lent- --5pon1te --5pon2tet --5pos2t3h --5pos1ti --5pos2t1in --5pos2t1o2 --5pos2t3r --5post1s2 -4p4re- --5p1ré --5pré1a2 --5pré2a3la --5pré2au --5pré1e2 --5pré1é2 -préémi3nent- --5pré1i2 -2p2rent- --5pré1o2 -4p4res- --5pré1s2 -pré3sent- --5pré1u2 -privatdo3cent- -privatdo3zent- --5p1ro --5pro1é2 -proémi3nent- --5pro1g2n --5prog1na --5pro2g3na1t2h --5pro1s2cé --5prou3d2h -pru3dent- --5p1sy --5psyc1ho --5psycho1a2n --5pud1d2l -.q4 -'q4 -’q4 -4q- --5q4 -qua2ment- -4que- -2quent- -4ques- -.r4 -'r4 -’r4 -4r- --5r4 -rai3ment- -ra2ment- -4re- --5ré1a2 --5ré2a3le --5réa1li --5ré2a3lis --5ré2a3lit --5ré2aux --5ré1e2 --5ré1é2 --5ré2el --5ré2er --5ré2èr -ré3gent- --5ré1i2 --5ré2i3fi -re3lent- -reli2ment- -réma3nent- -2rent- --5ré1o2 -re3pent- -4res- --5re1s2 --5res1ca --5re2s3cap --5res1ci --5re2s3ci1si --5re2s3ci1so --5res1co --5re2s3cou --5res1c2r --5re2s3c1ri --5res1pe --5re2s3pect --5res1pi --5re2s3pir --5res1p2l --5resp1le --5re2s3plend --5res1po --5re2s3pons --5res1q --5re2s3quil --5re2s3s --5res1se --res3sent- -.res3sent- --5res3sent. --5re2s3t --5res1ta --5re3s4tab --5re3s4tag --5re3s4tand --5re3s4tat --5res1té --5re3s4tén --5re3s4tér --5res1ti --5re3s4tim --5re3s4tip --5res1to --5re3s4toc --5re3s4top --5re3s4t2r --5rest1re --5re4s5trein --5rest1ri --5re4s5trict --5re4s5trin --5re3s4tu --5re3s4ty -résur3gent- -réti3cent- --5ré1t2r --5rét1ro --5rétro1a2 --5réu2 --5ré2uss -4r4he- -4r4hes- -ri2ment- -rin3gent- -ru3lent- -ryth2ment- -.s4 -'s4 -’s4 -4s- -.Å¡4 -'Å¡4 -’š4 -4Å¡- --5s4 --5Å¡4 --5sar1me --sar3ment- -.sar3ment- --5sar3ment. -4s4ch- -4s4c4he- -4s4c4hes- -4se- -2sent- -ser3gent- --5ser1me --ser3ment- -.ser3ment- --5ser3ment. -ser3pent- -4ses- --5seu2le -4sh- -4s4he- -2shent- -4s4hes- -slalo2ment- --5sou1ve --sou3vent- -.sou3vent- --5sou3vent. -sporu4lent- --5s1ta --5sta2g3n --5s1ti --5stil3l --5su2b1a2 --5su3b2alt --5su2b1é2 --5su3b2é3r --5su1bi --5su2b1in --5su1b2l --5sub1li -subli2ment- --5subli1mi --5su2b3limin --5su2b3lin --5su2b3lu --5su1bu --5su2b1ur -succu3lent- -su2ment- --5su2r1a2 --5su3r2a3t --5su2r1e2 --5su2r1é2 --5su3r2eau --5su3r2ell -surémi3nent- --5su3r2et --5su2r3h --5su1ri --5su2r1i2m --5su2r1inf --5su2r1int --5su1ro --5su2r1of --5su2r1ox --5syn1g2n --5syng1na --5syn2g3na1t2h -.t4 -'t4 -’t4 -4t- --5t4 --5ta1le --ta3lent- -.ta3lent- --5ta3lent. -ta2ment- -tan3gent- -4te- -tempéra3ment- -2tent- -ter3gent- -4tes- -testa3ment- -4th- -.þ4 -'þ4 -’þ4 -4þ- --5þ4 -4t4he- -4t4hes- -4th4re- -4th4res- -to2ment- -tor3rent- -transpa3rent- -4t4re- -2t2rent- -4t4res- --5t1ri --5tri1a2c --5tri1a2n --5tri1a2t -tri3dent- --5tri1o2n -trucu3lent- -tu2ment- -turbu3lent- -’u4 -4u- -.ú4 -'ú4 -’ú4 -4ú- -.ù4 -'ù4 -’ù4 -4ù- -’û4 -4û- -.ü4 -'ü4 -’ü4 -4ü- --5u4 --5ú4 --5ù4 --5û4 --5ü4 -.v4 -'v4 -’v4 -4v- --5v4 -4ve- -veni2ment- -2vent- -ventripo3tent- -4ves- -vidi2ment- -4v4re- -2v2rent- -4v4res- -.w4 -'w4 -’w4 -4w- --5w4 -4we- -2went- -4wes- -.x4 -'x4 -’x4 -4x- --5x4 -2xent- -’y4 -4y- -.ý4 -'ý4 -’ý4 -4ý- -.ÿ4 -'ÿ4 -’ÿ4 -4ÿ- --5y4 --5ý4 --5ÿ4 -.z4 -'z4 -’z4 -4z- -.ž4 -'ž4 -’ž4 -4ž- --5z4 --5ž4 -4ze- -2zent- -4zes- diff --git a/librarian/res/hyph-dictionaries/hyph_lt.dic b/librarian/res/hyph-dictionaries/hyph_lt.dic deleted file mode 100644 index f69c258..0000000 --- a/librarian/res/hyph-dictionaries/hyph_lt.dic +++ /dev/null @@ -1,1547 +0,0 @@ -ISO8859-13 -.ap1 -.api1 -.ap3r -.arbi1 -.arti1 -.as3p -.at1 -.ata1 -.at3r -.að3v -.dina1 -.ek3r -.i2ð3 -.iði2 -.kirti1 -.nu1 -.nusi1 -.pie2è -.sam1 -.sida1 -.sk4 -.st4 -.su5kr -.te3s2 -.uk3 -.u2ð3 -.uþ1 -.ás4 -.ðven1 -a1a2 -a1b -a1c -a2ch -a1d -a4dra -a1e -ae2l -a1f -2a1g -a4gr -ag3ra -a5grio -a5gro -a1h -a5inf -ai4sk -ai4tr -a1j -a1k -ak2l -ak2vi -a2kët -a1l -a3li -a5lo1 -a3ly -a3lë -a3lû -a1m -a1n -an3k2l -an4sk -an4tr -a2o -a1p -ap1a4k -ap3ei -ap3i2m -ap3l -a3pr -ap3s2 -a1r -ar1eit -a4rg -ari4s -a1s -asi1 -asi5s -a4sk -as3kl -a3sl -as2mi -as2mu -a5s4n -a4stu -a1t -at3aug -ate5ist -at3i2m -ato1 -atp4 -a4tru -at1ë2 -atû2þ -a4u -au4kl -au4sk -au4sl -au4t3r -a1v -a1w -a1y -a1z -a1à -2a1è -a1æ -a1ë2 -a1á -a1ð -a3ðn -að4tr -að2v -a1ø -a1û2 -a1þ -aþ2l -ba3c -balta1 -ba4sl -2b1b -2b1c -4b3d -bep4 -be3s2 -besi1 -be3t2 -2b1f -2b1g -2b1h -b1j -2b1k -2b1l -b2la -b2liz -3b2lo -b2lu -2b1m -2b1n -2b1p -2b2r -b3ri -2b1s -2b3t -bu4k -2b1v -2b1w -2b1z -2b1è -2b1ð -2b1þ -car4 -2c1b -2c1c -2c1d -2c1f -2c1g -3chi -2c1k -2c1l -2c1m -2c1n -2c1p -2c1r -2c1s -2c1t -cu4 -cuk5 -2c1v -2c1w -2c1z -2c1è -2c1ð -2c1þ -da3b4 -2d1b -2d1c -2d1d -de4k -dema1 -de4pr -de4sp -2d1f -2d1g -2d1h -di4p -di4s -dis5k -2d1j -2d3k -4d3l -2d1m -2d1n -do3ri -2d1p -2d1r -dro1 -dro2b -d2rë -4drø -2d1s -2d1t -du2a -du4k -du5ka -du4sl -2d1v -d3va -dvi3a -2d1w -d4z -2d1è -2d1ð -d4þ -dþio1 -e1a2 -e2a3l -eapi1 -eat1 -e1b2 -ebe1 -e3bl -eb3r -e1c -e2ch -e3d2 -ed3ri -e4dro -ed3rë -e1e -e1f -e1g -eg3ra -e1h -e1ie -ei4k3l -1ein -ei4sk -ei4sl -2eis3t -eist2ra -ei2ð1 -e1j -e1k -e3kr -e1l -e1m -ema5s4 -2e1n -en3k2l -enk4la -eno1 -ens4 -4enta -enu1 -e2o -e3or -e3o2ð -e3p -ep4li -ep4r -epra1 -epri1 -e1r -ere3a4 -eri4s -ero1 -erë2 -e1s -esi5s -es4k -eska1 -e5sko -e3s2v -e1t -e1u4 -euþ3 -e1v -e3vi -e1w -e1y -e1z -e1à -e1è -e1æ -e1ë -e1á4 -eáp3 -eás3k -eát3r -e1ð -e3ðn -eð2v -eðë3 -e1ø -e1û -e1þ -2f1b -2f1c -2f1d -2f1f -2f1g -2f1h -fi4s5 -2f1k -2f1l -2f1m -2f1n -2f1p -2f1r -fri1 -2f1s -2f1t -2f1v -2f1w -2f1z -2f1è -2f1ð -2f1þ -gað3 -2g1b -2g1c -2g1d -ge4o1 -2g1f -2g1g -2g1h -2g1k -2g1l -g2le -g2lo -2g1m -2g1n -3g2nø -2g1p2 -3g2r -grai2 -g3ran -5g3re -g4rei -g3ri -4g4rio -g3ro. -g4rà -5grá -4grø -2g1s -4g1t -3gu -2g1v -2g1w -gyva1 -2g1z -2g1è -2g1ð -2g1þ -2h1b -2h1c -2h1d -2h1f -2h1g -2h1h -hi4b -2h1k -2h2l -2h1m -h2me -2h1n -2h1p -2h1r -2h1s -2h1t -2h1v -2h1w -2h1z -2h1è -2h1ð -2h1þ -i2a -ia5g4 -i3aið -ia3k -i3antæ -i3antë -iap4 -i3ar -i3b2 -i1c -ice1 -i1d -id2r -id3rë -i2dëm -i2e -ie4d3r -ie3g -i3ei -ie3kl -i3ent -ie4p5r -ie4sk -i1f -2i1g -i3g2l -ig3ru -2i1h -i1i2 -i1j -i1k -i3k2n -ik3r -i1l -ilo1 -i1m -1imd -4i1n -in4kl -5inv -i2o -io4g3r -iok2 -io4pl -i3or -i1p -i2p1j -ip3ru -i1r -ira3s2 -i3ri -4i1s -i5sa -i5si -is4k -i3sl -is4li -i5s4n -i4ste -isto1 -2i3t2 -i2u -i1v -i1w -i1y -i1z -i2à -i1è -i1æ -i1ë2 -i1á -i1ð -i3ðn -ið5t -i4ðv -iðë2 -1iðð -i2ø -i2û -i3þ -3ja. -jauna1 -2j1b -2j1c -2j1d -2j1f -2j1g -2j1h -2j1j -2j1k -2j1l -2j1m -2j1n -jot3 -jo4tv -2j1p -2j1r -2j1s -2j1t -1ju -2j1v -2j1w -2j1z -2j1è -2j1ð -1jû -2j1þ -3ka. -5ka3d -kak3 -ka4kl -ka4pr -3kar -3kas -3kati -5kav -kavar1 -ka3z2 -2k1b -2k1c -2k1d -3ke -ke4b3 -keren1 -2k1f -2k1g -2k1h -k4i -5ki. -5kia -3kib -3kil -5kit -2k1k -2k1l -3k2la -k4lan -4kle. -k2lel -4klo. -4klu. -k2ly -4klà -4klø -2k1m -2k1n -3ko -2k1p -2k2r -k4rau -kris2 -kri5st -k3ro -k4rov -4k3ru -5krun -k4ry -k5rà -2k1s -k4sk -ks3l -k4s3p -4k1t -k3ta -3ku -4kub -ku4k -ku4pr -2k1v -k2va -k3vo -k2vë -2k1w -3kyt -2k1z -5kà -2k1è -2k1ð -kð2ly -kðë3 -2k1þ -3la. -lap4s3to -2l1b -lb3r -2l1c -2l1d -3le. -le3c -le4gr -4leè -2l1f -2l1g -lg3s2t -2l1h -3li. -li4a -5li4o -3liø -2l1j -2l1k -lko1 -2l1l -2l1m -2l1n -3lo. -log4 -4lop -4l1p -lpna1 -2l1r -4l1s -l4sk -l4s3p -4l3t -3lu. -2lup -4l1v -2l1w -3lyè -2l1z -3là -2l1è -3læs -3lëm -3lës -2lëè -3lá4 -4l1ð -3lø -2l1þ -m2a -2m3aid -3mas -mas3ki -2m1b -mb3r -2m1c -2m1d -me3c -meis1 -2m1f -2m1g -2m1h -mi4gl -mi4gr -min4s -mi4tr -2m1k -2m1l -2m1m -2m1n -m2o -2mod -2m1p -m4pl -m3pr -2m1r -4m1s -2m1t -m3ta -3muo -2m1v -2m1w -2m1z -2m1è -2m1ð -2m1þ -na3s2 -na3t2 -2n1b -2n1c -ncen1 -2n1d -n3drë -ne1 -neg4 -nei2m -ne4o3 -neor2 -nerë3 -nesi1 -ne3sl -ne3s2t -ne3t2 -neás3t -2n1f -4n1g -ng3l -ng4r -2n1h -ni4s -2n1j -2n1k -nk3la -nk3r -n3kry -2n1l -2n1m -2n1n -5no -2n1p -2n1r -4n1s -ns4ku -ns3l -n4s3p -nst3r -4n1t -n3ta -nt4pl -n3tru -nt2ruo -nua4 -nu3b2 -nu3g -nu1i -nuk2 -nu4o3 -nuos2 -nu5s4 -2n1v -2n1w -2n1z -4n1è -2n1ð -2n1þ -o1a -o1b -o1c -o1d -o3dr -o1e -o2et -o1f -o1g -o1h -o1i -o1j -o1k -o3kr -o1l -olen1 -o1m -om4pr -o1n -ono1 -o1o2 -o1p -o1r -o2rie -ori4s -or4tr -o2ræ -o1s -o3sl -os3le -os4lo -o3s2v -o3t2 -oto1 -o1v -o1w -o1y -o1z -o1à -o1è -o1æ -o1ë -o1á -o1ð -oð2v -o1ø -o1û -o1þ -pa3 -pad2 -pai2l -pai2m -pai2r -3pan -pap4 -p2ar -parsi1 -pa4r1ë2 -pas2 -pa5sr -p2at2 -2p1b -4p1c -4p3d2 -p2e -per1 -pe2re -pe2r3im -per3s -pe2rë -2p1f -2p1g -2p1h -p2i -p3ieð -2p3k2 -3p2l -p3le -p3li -4plio -p4liu -p3lo -p4loj -p4lu -p4ly -2p1m -4p1n -3po -po4g -poli1 -2p1p -2p2r -p3rai -prau2si -p3rað -p3ri -pris2 -p5ro. -p3rom -p3ry -4prà -p3rë -p3rû -4p1s -psi1 -p5s4k -p4s3ty -p3s2v -4p3t2 -3p4u -pusiau1 -pu4sk -pu4sl -pu4tr -2p1v -2p1w -p2y -2p1z -2p1è -p2ë -4p3ð2 -4p3þ -r2a -3ra. -ra3b -3rac -ra1im -rai4tá -ra3kr -3ral -3ram -ras4l -ra3sm -rau4ka. -3rav -2r1b -rbo1 -r3b4r -2r1c -4r1d -2reb -4rein -4reit -3rel -re4p5 -5res -res3l -3ret -2r1f -2r1g -2r1h -r2i -3ri. -ri3d -3rij -ri3kr -2ril -ri2ma. -2r3imt -3rio -ri3p -risi1 -ri3st -rivin1 -3rià -3riø -2riû -4r1k -rk3ly -r3k4r -4r1l -2r1m -4r1n -r2o -3rod2 -ro4gr -3roj -3rok -3ron -3rop -2r3org -5ros -2r1p -r3p4r -2r1r -4r1s -rs4ko. -rs4p -4r1t -rti5k4 -rti3s2 -r3t2r -r3t2v -r2u -2ruk -3rul -4run -3ruos -2rup -3rus -ru4sk -4ruto -4r1v -2r1w -2r1z -3rà -4ràs -4r1è -4r1ð -r3ð2l -r3ð2m -5rø -2r1þ -sala1 -2s1amþ -san5t -sarka1 -2s3b -2s1c -2s3d -s2e -se4kr -senat4 -2s1f -2s1g -2s1h -si3auk -si3a2v -si3a2ð -si3d -si3k4 -si3p4 -si3s2 -si5ð2v -3s2k2 -4sk. -s5ka. -4ske -5s4ken -5ski -5s4kle -5sk4r -5skub -sk3va -sk3vi -5sky -4skà -5skæ -2s2l -3sle -s3li -s3lo -4s3lu -4s3lû -2s1m -4sme. -4smæ -4s3n -so4dr -3s2p -s3pe -4spn -4spu -4s1r -s3ri -2s1s -2s1t -s2tal -s2ten -4stin -s2tod -s2toj -3s2tov -st2rai -st2v -4stæ -4s3të -4stø -s2tû -su1 -su3bl -su3d2 -su3g2 -suk2l -su3s2 -susi1 -suþ4 -2s1v -s2ve -3s2vy -2s1w -2s1z -sà3 -4s3è -5së -2s1ð -2s1þ -t2a -2tab -ta3kr -ta5s -2tat -taura1 -2taè -2t1b -2t1c -2t1d -2teb -3tem -te4o -te3t2 -2t1f -4t3g -2t1h -t2i -ti4gr -ti4k3l -3tin -2tip -4t3j -4t3k -t4kl -4t3l -4t3m -2t1n -t2o -3toje -2tolá -to3s2 -2tow -2t3p -t4pj -tp3lû -tp4r -2t1r -4trio -t2rið -4tro -4trà -4trø -4t3s4 -tsi1 -tskri1 -4t1t -tua4 -3tur -2t1v -t2vo -4tvëj -2t1w -3tyd -2t1z -2t1è -3tæ -t2ëm -t3ëmu -t3ëmæ -t3ëmë -2t3ð2 -2t3þ -u1a2 -u3ai -u1b -u2bj -u1c -u1d -u1e2 -u1f -u1g -ug4r -ug5rio -u1h -u1i2m -u5in -ui2r -u1j -u1k -u3kl -uk2le -u3kr -u3kv -u5kø -u1l -u1m -u1n -u2o -u3or -uo4sl -u3p -up4l -up3ro -u1r -urk2 -ur3kl -u5ro1 -ur3s2 -u1s -u2s1al -u3sl -us3la -us3le -usva1 -us3ve -u3t2 -uto1 -2utr -u1u -u1v -u1w -u1y -u1z -u1à -u1è -u1æ -u1ë2 -u1á -u1ð -u3ð2l -u3ð2n -uð2v -u1ø -u1û2 -u1þ -uþi2m -u3þl -uþ3v -uþ1ë2 -3va. -vap4 -va3t -2v1b -2v1c -2v1d -v2e -2vep -3ves -2v1f -2v1g -2v1h -viesia1 -vi4s5k -vi4t3r -2v1j -2v1k -2v1l -2v1m -2v1n -2v1p -2v1r -2v4s -2v1t -2v1v -2v1w -2vydau -2v1z -3và -2v1è -3vë -4vëp -2v1ð -2v1þ -2w1b -2w1c -2w1d -2w1f -2w1g -2w1h -2w1k -2w1l -2w1m -2w1n -2w1p -2w1r -2w1s -2w1t -2w1v -2w1w -2w1z -2w1è -2w1ð -2w1þ -y1a -y1b -y1c -y1d -y1e -y1f -y1g -ygia1 -y1h -y1i -y1j -y1k -y4k3l -y1l -y1m -y1n -y1o -y1p -y3r -y1s -y4sk -y1t -y1u -y1v -y1w -y1y -y1z -y1à -y1è -y1æ -y1ë -y1á -y1ð -y1ø -y1û -y1þ -2z1b -2z1c -2z1d -2z1f -2z1g -2z1h -2z1k -2z1l -2z1m -2z1n -2z1p -2z1r -2z1s -2z1t -2z1v -2z1w -2z1z -2z1è -2z1ð -2z1þ -à1a -à1b -à1c -à1d -à1e -à1f -à1g -à1h -à1i -à1j -à1k -à1l -à1m -à1n -à1o -à1p -à1r -à1s -à1t -à1u -à1v -à1w -à1y -à1z -à1à -à1è -à1æ -à1ë -à1á -à1ð -à1ø -à1û -à1þ -2è1b -2è1c -2è1d -èeko1 -2è1f -2è1g -2è1h -èin1 -2è1k -2è1l -2è1m -2è1n -2è1p -2è1r -2è1s -2è1t -2è1v -2è1w -2è1z -2è1è -2è1ð -2è1þ -æ1a -æ1b -æ1c -æ1d -æ1e -æ1f -æ1g -æ1h -æ1i -æ1j -æ1k -æ1l -æ1m -æ1n -æ1o -æ1p -æ1r -æ1s -æ1t -æ1u -æ1v -æ1w -æ1y -æ1z -æ1à -æ1è -æ1æ -æ1ë -æ1á -æ1ð -æ1ø -æ1û -æ1þ -ë1a -ë1b -ë1c -ë1d -ë1e -ë1f -ë1g -ë1h -ë1i -ë1j -ë1k -ë4k3l -2ë3l -ë1m -ë3me -ë1n -ë1o -ë1p -ë1r -2ë1s -ës3l -2ë3t -ë4tr -ë1u -ë1v -ë1w -ë1y -ë1z -ë1à -ë1è -ë1æ -ë1ë -ë1á -ë1ð -ë1ø -ë1û -ë1þ -á1a -á1b -á1c -á1d2 -á2e -á1f -á4g -á1h -á1i -á1j -á2k4 -á2l -á2m -á1n -á1o -á4p -á2r -á1s -ási1 -ás3l -ás2m -ás2r -ást2 -á2t2 -á1u -á2v -á1w -á1y -á1z -á1à -á1è -á1æ -á1ë2 -á1á -á1ð -á1ø -á1û -á1þ -2ð1b2 -2ð1c -2ð3d2 -ð1ei -ðe2v -2ð1f -2ð1g4 -2ð1h -2ð5ist -ðiuk1 -2ð1k2 -2ð1l -ð2lij -ð2lu -3ðly -2ð1m -2ð1n -ð2ne -ðno1 -ðo2r -2ð1p4 -2ð1r -2ð3s4 -ðsi1 -ðsikap1 -4ð3t2 -ðu4ð -3ð1v -ð2vi -ð4vyd -2ð1w -2ð1z -4ð3è -ðë2j -2ð1ð -2ð1þ -ø1a -ø1b -ø1c -ø1d -ø1e -ø1f -ø1g -ø1h -ø1i -ø1j -ø1k -ø1l -ø1m -ø1n -ø1o -ø1p -ø1r -ø1s -ø1t -ø1u -ø1v -ø1w -ø1y -ø1z -ø1à -ø1è -ø1æ -ø1ë -ø1á -ø1ð -ø1ø -ø1û -ø1þ -û1a -û1b -û1c -û1d -û1e -û1f -û1g -û1h -û1i -û1j -û1k -û4k3l -û1l -û1m -û1n -û1o -û1p -û1r -û1s -û4s3k -ûs3l -ûs3t -û1t -û1u -û1v -û1w -û1y -û1z -û1à -û1è -û1æ -û1ë -û1á -û1ð -û1ø -û1û -û1þ -þant4 -þants5 -2þ3b2 -2þ1c -2þ3d2 -þen1 -2þ3f4 -2þ3g -2þ1h -þi3mu -þio3 -þ1j -2þ3k2 -2þ1l -þ2lu -4þ1m -2þ1n -2þ3p -2þ1r -2þ1s -þsi1 -þ4sk -þ4s5l -þs3t -4þ3t2 -þ2u -þu3s2 -3þ2v -þ4vi -þ3vo -2þ1w -2þ1z -2þ1è -þás3 -2þ1ð -2þ1þ diff --git a/librarian/res/hyph-dictionaries/hyph_pl.dic b/librarian/res/hyph-dictionaries/hyph_pl.dic deleted file mode 100644 index 6d5aeb5..0000000 --- a/librarian/res/hyph-dictionaries/hyph_pl.dic +++ /dev/null @@ -1,4824 +0,0 @@ -ISO8859-2 -.a1 -.a2b1s -.a2b2s3t -.a2d3 -.a1d4a1 -.ad4e1 -.ad4i1 -.ad4o1 -.ad4u1 -.ad4y1 -.ad5a2p1t -.ad5i2u1 -.ad5op -.ad5or -.ae2 -.ae3ro1 -.a1eroa2 -.ae1roe2 -.aeroi2 -.aero1o2 -.aerou2 -.a2n1t -.anty1 -.a1ntya2 -.antye2 -.antyi2 -.antyo2 -.antyu2 -.a2r1c -.arcy1 -.arcy3b2 -.arcy3b1z2 -.arcy3k2 -.arcy3³2 -.arcy3m2 -.a1rcya2 -.arcye2 -.arcyi2 -.arcyo2 -.arcyu2 -.a2u1 -.au3g2 -.au3k2 -.au3t2 -.auto1 -.auto3c4h2 -.a1utoa2 -.autoe2 -.autoi2 -.auto1o2 -.a1utotra1 -.autotra2n2s3 -.au1tou2 -.b8 -.4b3b8 -.2b1c8 -.2b1æ8 -.2b1d8 -.be1 -.be2z3 -.beza1 -.be3z4an -.be1ze1 -.be3z4ec -.bezi1 -.be3z4ik -.be2z1c -.bezc4h2 -.bezm2 -.bezo2 -.bezo2b1j -.bezw2 -.be4z3z -.bezzw2 -.2b1f8 -.2b1g8 -.bh8 -.bj8 -.2b1k8 -.bl8 -.b³8 -.2b1m8 -.2b1n8 -.2b1ñ8 -.2b1p8 -.br8 -.br4z8 -.2b1s8 -.2b1¶8 -.2b1t8 -.bv8 -.bw8 -.bx8 -.2b1z8 -.2b1¼8 -.2b1¿8 -.c8 -.ca1 -.ca³o1 -.ca³o3k2 -.ca³o3¶2 -.2c1b8 -.4c3c8 -.2c1æ8 -.2c1d8 -.2c1f8 -.2c1g8 -.c4h8 -.c2h2r -.chr4z8 -.ci1 -.ci2e1 -.cie2n1k -.cienko1 -.cienko3w2 -.ciep³o1 -.ciep³o3kr2 -.cj8 -.2c1k8 -.2c1l8 -.c³8 -.2c1m8 -.2c1n8 -.2c1ñ8 -.2c1p8 -.cr8 -.2c1s8 -.2c1¶8 -.2c1t8 -.cv8 -.cw8 -.cx8 -.c4z8 -.cza1 -.cza2r1n -.czarno1 -.czarno3k2 -.2c2z1k8 -.2c2z1t -.czte1 -.czte1re1 -.cztere2c4h3 -.cztere2c2h1s -.czte1re1chse1 -.czterechse2t3 -.cztero1 -.cztero3¶2 -.czwó1 -.czwó2r3 -.czwó3r4a1 -.czwó3r4±1 -.czwó3r4e1 -.czwó3r4ê1 -.czwó3r4o1 -.2c1¼8 -.2c1¿8 -.æ8 -.2æ1b8 -.2æ1c8 -.4æ3æ8 -.2æ1d8 -.2æ1f8 -.2æ1g8 -.æh8 -.æj8 -.2æ1k8 -.æl8 -.æ³8 -.2æ1m8 -.2æ1n8 -.2æ1ñ8 -.2æ1p8 -.ær8 -.2æ1s8 -.2æ1¶8 -.2æ1t8 -.æv8 -.æw8 -.æwi1 -.æwi2e1 -.æwie2r2æ3 -.æx8 -.2æ1z8 -.2æ1¼8 -.2æ1¿8 -.d8 -.da1 -.dale1 -.daleko1 -.daleko3w2 -.2d1b8 -.2d1c8 -.2d1æ8 -.4d3d8 -.de1 -.de2z3 -.deza2 -.dezabi1 -.de3z4a3bil -.de3z4a3wu1 -.de1ze1 -.de3z4el -.de3z4er -.de3z4y1 -.dezo2 -.2d1f8 -.2d1g8 -.dh8 -.dj8 -.2d1k8 -.dl8 -.d³8 -.d³u1 -.d³ugo1 -.d³ugo3tr2 -.d³ugo3w2 -.2d1m8 -.2d1n8 -.2d1ñ8 -.do1 -.do3b2 -.do3c2 -.do3æ2 -.do3d2 -.do3f2 -.do3g2 -.do3h2 -.do3k2 -.do3l2 -.do3³2 -.do3m2 -.do3p2 -.do3r2 -.do3s2 -.do3¶2 -.do3t2 -.do3w2 -.do3z2 -.do3¼2 -.do3¿2 -.do4k3t -.do4l3n -.do4³3k -.do4m3k -.do4r3s -.do4w3c -.do5m4k2n -.dobr2 -.dobr4z2 -.doc4h2 -.doc4z2 -.dod4z2 -.dod4¼2 -.dod4¿2 -.dogr4z2 -.do2p1c -.dopc4h2 -.dopr4z2 -.dor4z2 -.do2r1¿2 -.dosc4h2 -.dosm2 -.dos4z2 -.do2t1k2 -.dotr2 -.2d1p8 -.dr8 -.dro1 -.dro1go1 -.drogo3w2 -.dr4z8 -.2d1s8 -.2d1¶8 -.2d1t8 -.dv8 -.dw8 -.dwó1 -.dwó2j3 -.dwó3j4a1 -.dwó3j4±1 -.dwó3j4e1 -.dwó3j4ê1 -.dwó3j4o1 -.dx8 -.dy1 -.dy2s3 -.dy2z3 -.dy3s4e1 -.dy3s4o1 -.dy3s4ta1 -.dy3s4y1 -.dy3s4z -.dy3z4e1 -.dyzu2 -.d4z8 -.dzi1 -.dzi2e1 -.dzi1esi1 -.dziesi2ê1 -.dzi1esi1êci1 -.dziesiêci2o1 -.dziesiêcio3¶2 -.dzi1ewi1 -.dziewi2ê1 -.dziewiê2æ3 -.dzi1ewi1êci1 -.dziewiêci2o1 -.dziewiêcio3¶2 -.dziewiê2æ1s -.dzie1wiêæse1 -.dziewiêæse2t3 -.d4¼8 -.d4¿8 -.e1 -.e2k2s3 -.e1me1 -.emes4z -.e1me1sze1 -.e2m3e2s5ze2t -.e1se1 -.e2s1e2s1ma1 -.e2s1ha1 -.e2s1t -.ego1 -.egoa2 -.e1goe2 -.egoi2 -.ego1o2 -.egou2 -.eks4y1 -.e1le1 -.ele2k1t -.elektro1 -.elektroa2 -.e1le1ktroe2 -.elektroi2 -.elektro1o2 -.elektrou2 -.f8 -.fb8 -.2f1c8 -.fæ8 -.fd8 -.4f3f8 -.fg8 -.fh8 -.fj8 -.2f1k8 -.fl8 -.f³8 -.2f1m8 -.2f1n8 -.fñ8 -.fp8 -.fr8 -.fs8 -.f¶8 -.ft8 -.fv8 -.fw8 -.fx8 -.fz8 -.f¼8 -.f¿8 -.g8 -.2g1b8 -.2g1c8 -.2g1æ8 -.2g1d8 -.ge1 -.ge2o3 -.2g1f8 -.4g3g8 -.gh8 -.gj8 -.2g1k8 -.gl8 -.g³8 -.2g1m8 -.gn8 -.2g1ñ8 -.go1 -.go2u3 -.2g1p8 -.gr8 -.gru1 -.grubo1 -.grubo3w2 -.gr4z8 -.2g1s8 -.2g1¶8 -.2g1t8 -.gv8 -.gw8 -.gx8 -.2g1z8 -.2g1¼8 -.2g1¿8 -.h8 -.2h1b8 -.2h1c8 -.2h1æ8 -.2h1d8 -.2h1f8 -.2h1g8 -.4h3h8 -.hi1 -.hipe1 -.hipe2r3 -.hipe3r4o1 -.hipera2 -.hipe1re2 -.2h1j8 -.2h1k8 -.2h1l8 -.2h1³8 -.2h1m8 -.2h1n8 -.2h1ñ8 -.2h1p8 -.2h1r8 -.2h1s8 -.2h1¶8 -.2h1t8 -.hv8 -.2h1w8 -.hx8 -.2h1z8 -.2h1¼8 -.2h1¿8 -.i1 -.i2n3 -.i2s3l -.i1ni1 -.i3n4ic -.i3n4o1 -.i3n4u1 -.i4n5o2k -.i2n1f -.infla1 -.in4f3lan -.ino3w2 -.izo1 -.izoa2 -.izoe2 -.i1zoi2 -.izo1o2 -.izou2 -.j8 -.ja1 -.jad³o1 -.jad³o3w2 -.2j1b8 -.2j1c8 -.2j1æ8 -.2j1d8 -.2j1f8 -.2j1g8 -.2j1h8 -.4j3j8 -.2j1k8 -.2j1l8 -.2j1³8 -.2j1m8 -.2j1n8 -.2j1ñ8 -.2j1p8 -.2j1r8 -.2j1s8 -.2j1¶8 -.2j1t8 -.jv8 -.2j1w8 -.jx8 -.2j1z8 -.2j1¼8 -.2j1¿8 -.k8 -.2k1b8 -.2k1c8 -.2k1æ8 -.2k1d8 -.2k1f8 -.2k1g8 -.kh8 -.ki1 -.ki2l1k -.kilku1 -.kilkuse1 -.kilkuse2t3 -.kilkuseto2 -.kj8 -.4k3k8 -.kl8 -.k³8 -.2k1m8 -.2k1n8 -.2k1ñ8 -.ko1 -.ko1³o1 -.ko³o3w2 -.ko2n1t -.kon2t2r3 -.kon3tr4a1 -.kon3tr4e1 -.ko1ntro2 -.kon3tr4o3l -.kon3tr4o3w -.kon3tr4y1 -.kon4tr5a2gi1 -.kon4tr5a2se1 -.kon4tr5a2sy1 -.kon4tr5a2ta1 -.kon4tr5a2d1m -.kon4tr5a2k1c -.kon4tr5a2l1t -.kon4tr5a2r1g -.kontru2 -.2k1p8 -.kr8 -.kro1 -.kro2æ3 -.kró1 -.kró2t1k -.krótko1 -.krótko3tr2 -.krótko3w2 -.kr4z8 -.2k1s8 -.2k1¶8 -.2k1t8 -.kv8 -.kw8 -.kx8 -.2k1z8 -.2k1¼8 -.2k1¿8 -.l8 -.2l1b8 -.2l1c8 -.2l1æ8 -.2l1d8 -.2l1f8 -.2l1g8 -.2l1h8 -.2l1j8 -.2l1k8 -.4l3l8 -.2l1³8 -.2l1m8 -.2l1n8 -.2l1ñ8 -.2l1p8 -.2l1r8 -.2l1s8 -.2l1¶8 -.2l1t8 -.lu1 -.ludo1 -.ludo3w2 -.lv8 -.2l1w8 -.lx8 -.2l1z8 -.2l1¼8 -.2l1¿8 -.³8 -.2³1b8 -.2³1c8 -.2³1æ8 -.2³1d8 -.2³1f8 -.2³1g8 -.2³1h8 -.2³1j8 -.2³1k8 -.2³1l8 -.4³3³8 -.2³1m8 -.2³1n8 -.2³1ñ8 -.2³1p8 -.2³1r8 -.2³1s8 -.2³1¶8 -.2³1t8 -.³v8 -.2³1w8 -.³x8 -.2³1z8 -.2³1¼8 -.2³1¿8 -.m8 -.2m1b8 -.2m1c8 -.2m1æ8 -.2m1d8 -.2m1f8 -.2m1g8 -.2m1h8 -.mi1 -.mi1li1 -.mili2a1 -.mili3a2m1p -.2m1j8 -.2m1k8 -.2m1l8 -.2m1³8 -.4m3m8 -.2m1n8 -.2m1ñ8 -.mo1 -.mo2¿1n -.mo1¿no1 -.mo¿no3w2 -.2m1p8 -.2m1r8 -.2m1s8 -.2m1¶8 -.2m1t8 -.mv8 -.2m1w8 -.mx8 -.2m1z8 -.2m1¼8 -.2m1¿8 -.n8 -.na1 -.na2d2 -.na2j -.na3b2 -.na3c2 -.na3æ2 -.nad3i2 -.na3d4ir -.nad3³2 -.nad³u1 -.na3d4³ub -.na2d3m2 -.nadmu1 -.na3d4muc4h -.nad3r2 -.na3d4r2w -.nadre1 -.nadre2p1c -.na3d4repc4z -.na3d4re2p1t -.nadrê1 -.na3d4rêc4z -.nadru1 -.na3d4ruk -.na3d4r4z -.nad3w2 -.nadwo1 -.na3d4wo2r1n -.na1da1 -.na3daj -.na3d±1 -.na3de1 -.na3dê1 -.na3do1 -.na3dy1 -.nad4z2 -.na3dzi1 -.na3d4¼2 -.na3f2 -.na3g2 -.na3h2 -.na1ja1 -.na3ja2z1d -.na3j±1 -.na3je1 -.na3jê1 -.na3k2 -.na3l2 -.na3³2 -.na3m2 -.na3p2 -.na3r2 -.na3s2 -.na3¶2 -.na3t2 -.na3u2 -.na3w2 -.na3z2 -.na3¼2 -.na3¿2 -.na4d3o2b2³ -.nado1bo1 -.nadobo2j1c -.na4d3o2bojc4z -.na4d3o2bowi1 -.nado1bro1 -.na4d3o2brot -.na4d3o2dr4z -.nadoki1 -.nadoki2e1 -.na4d3o2kien -.nado2l1b -.na4d3olbr4z -.na4d5rz±1 -.nadrze1 -.na4d5rzec4z -.na4d5rzê1 -.na4d5rzy1 -.nadzi2e1 -.na4d5ziem -.na4f3c -.na4f3t -.na4j3e2f -.na4j3e2g -.na4j3e2k2s -.na4j3e2ko1 -.na4j3e2n -.na4j3e2r -.na4j3e2s -.na4j3e2w -.na4j3e2m1f -.na4j3e2u1 -.na4r3c -.na4r3d -.na4r3k -.na4r3r -.na4r3t -.nabr4z2 -.nac4h2 -.nac4z2 -.na2d3b2 -.na2d3c2 -.na2d3æ2 -.na4d3d2 -.nade3t2 -.na1deta1 -.nad3e2tat -.na2d3f2 -.na2d3g2 -.nad3h2 -.nad3j2 -.na2d3k2 -.nad3l2 -.na2d3n2 -.na2d3p2 -.na2d3s2 -.na2d3¶2 -.na2d3t2 -.nad3u2 -.na2dz1m -.nadzmy1 -.nad5z2mys -.nad5zo1 -.nad5zó1 -.nadzwy1 -.nad5zwyc4z -.nad5¿2 -.nadc4h2 -.nadc4z2 -.nadd4¼2 -.nade3b2 -.nade3c2 -.nade3æ2 -.nade3d2 -.nade3f2 -.nade3g2 -.nade3h2 -.nade3k2 -.nade3l2 -.nade3³2 -.nade3m2 -.nade3p2 -.nade3r2 -.nade3s2 -.nade3¶2 -.nade3w2 -.nade3z2 -.nade3¼2 -.nade3¿2 -.nade4p3c -.nade4p3n -.nade4p3t -.nadec4h2 -.nadec4z2 -.naded4z2 -.naded4¼2 -.naded4¿2 -.nader4z2 -.nade2r1¿2 -.nades4z2 -.nads4z2 -.nad¶ro1 -.nad¶rod4z -.nad¶rodzi1 -.nad¶rodzi2e1 -.nad¶rod5ziem -.nadtr2 -.nagr4z2 -.naj3a2k1t -.naj3a2u1 -.na2j3b2 -.na2j3c2 -.na2j3æ2 -.na2j3d2 -.na2j3f2 -.na2j3g2 -.na2j3h2 -.naj3i2 -.na2j3k2 -.na2j3l2 -.na2j3³2 -.na2j3m2 -.naj3o2 -.naj3o2b2 -.naj3o2c2 -.naj3o2æ2 -.naj3o2d2 -.naj3o2f2 -.naj3o2g2 -.naj3o2h2 -.naj3o2k2 -.naj3o2l2 -.naj3o2³2 -.naj3o2m2 -.naj3o2p2 -.naj3o2r2 -.naj3o2s2 -.naj3o2¶2 -.naj3o2t2 -.naj3o2w2 -.naj3o2z2 -.naj3o2¼2 -.naj3o2¿2 -.na2j3p2 -.na2j3r2 -.najro1 -.naj3ro2z3 -.na2j3s2 -.na2j3¶2 -.na2j3t2 -.naj3u2 -.na2j3w2 -.na2j3z2 -.na2j3¼2 -.na2j3¿2 -.najbe1 -.najbe2z3 -.najbezw2 -.najc4h2 -.najc4z2 -.najdo1 -.najdo3b2 -.najdo3c2 -.najdo3æ2 -.najdo3d2 -.najdo3f2 -.najdo3g2 -.najdo3h2 -.najdo3k2 -.najdo3l2 -.najdo3³2 -.najdo3m2 -.najdo3p2 -.najdo3r2 -.najdo3s2 -.najdo3¶2 -.najdo3t2 -.najdo3w2 -.najdo3z2 -.najdo3¼2 -.najdo3¿2 -.najdoc4h2 -.najdoc4z2 -.najdod4z2 -.najdod4¼2 -.najdod4¿2 -.najdor4z2 -.najdos4z2 -.najdo2t1k2 -.najd4z2 -.najd4¼2 -.najd4¿2 -.najkr2 -.najo2b3c2 -.najo2b3æ2 -.najo2b3d2 -.najo2b3f2 -.najo2b3g2 -.najob3h2 -.najob3j2 -.najo2b3k2 -.najob3l2 -.najob3³2 -.najo2b3m2 -.najo2b3n2 -.najo2b3p2 -.najo2b3s2 -.najo2b3¶2 -.najo2b3t2 -.najob3w2 -.najo2b3¼2 -.najo2b3¿2 -.najobc4h2 -.najobc4z2 -.najobd4z2 -.najobd4¼2 -.najobd4¿2 -.najobr4z2 -.najobs4z2 -.najoc4h2 -.najoc4z2 -.najo2d3c2 -.najo2d3æ2 -.najo4d3d2 -.najo2d3f2 -.najo2d3g2 -.najod3h2 -.najod3j2 -.najo2d3k2 -.najod3l2 -.najo2d3m2 -.najo2d3n2 -.najo2d3p2 -.najo2d3s2 -.najo2d3¶2 -.najo2d3t2 -.najod3w2 -.najod5¿2 -.najodc4h2 -.najodc4z2 -.najodd4z2 -.najodd4¼2 -.najodd4¿2 -.najods4z2 -.najod4z2 -.najod4¼2 -.najor4z2 -.najos4z2 -.najro3z4u1 -.najr4z2 -.najsm2 -.najs4z2 -.naj2t1k2 -.naj2t1r2 -.najuc4z2 -.najzw2 -.nakr2 -.napo1 -.napo2d2 -.napo3b2 -.napo3c2 -.napo3æ2 -.napo3f2 -.napo3g2 -.napo3h2 -.napo3k2 -.napo3l2 -.napo3³2 -.napo3m2 -.napo3p2 -.napo3r2 -.napo3s2 -.napo3¶2 -.napo3t2 -.napo3w2 -.napo3z2 -.napo3¼2 -.napo3¿2 -.napo4m3p -.napoc4h2 -.napoc4z2 -.napo4d3d -.napod4¼2 -.napod4¿2 -.napo2m1k2 -.napor4z2 -.napos4z2 -.napr4z2 -.naro1 -.naro2z3 -.nar4z2 -.na2r1¿2 -.nasm2 -.nas4z2 -.na2t1c -.natc4h2 -.na2t1k2 -.naz3m2 -.nazw2 -.2n1b8 -.2n1c8 -.2n1æ8 -.2n1d8 -.ne1 -.ne2o3 -.2n1f8 -.2n1g8 -.2n1h8 -.ni1 -.ni2e1 -.nie3b2 -.nie3c2 -.nie3æ2 -.nie3d2 -.nie3f2 -.nie3g2 -.nie3h2 -.nie3k2 -.nie3l2 -.nie3³2 -.nie3m2 -.nie3p2 -.nie3r2 -.nie3s2 -.nie3¶2 -.nie3t2 -.nie3u2 -.nie3w2 -.nie3z2 -.nie3¼2 -.nie3¿2 -.nie4c3c -.nie4c3k -.nie4d4¼3 -.nie4m3c -.nie4m3k -.niec4h2 -.niec4z2 -.niedo1 -.niedo3b2 -.niedo3c2 -.niedo3æ2 -.niedo3d2 -.niedo3f2 -.niedo3g2 -.niedo3h2 -.niedo3k2 -.niedo3l2 -.niedo3³2 -.niedo3m2 -.niedo3p2 -.niedo3r2 -.niedo3s2 -.niedo3¶2 -.niedo3t2 -.niedo3w2 -.niedo3z2 -.niedo3¼2 -.niedo3¿2 -.niedobr4z2 -.niedoc4h2 -.niedoc4z2 -.niedod4z2 -.niedod4¼2 -.niedod4¿2 -.niedokr2 -.niedo2m1k2 -.niedo2p1c -.niedopc4h2 -.niedor4z2 -.niedos4z2 -.niedo2t1k2 -.nied4z2 -.nied4¿2 -.nieo2 -.nieob2 -.nieo2b3c2 -.nieo2b3æ2 -.nieo2b3d2 -.nieo2b3f2 -.nieo2b3g2 -.nieob3h2 -.nieob3j2 -.nieo2b3k2 -.nieo2b3m2 -.nieo2b3p2 -.nieo2b3s2 -.nieo2b3¶2 -.nieob3w2 -.nieo2b3¼2 -.nieo2b3¿2 -.nieobc4h2 -.nieobc4z2 -.nieobd4z2 -.nieobd4¼2 -.nieobd4¿2 -.nieobs4z2 -.nieoc2 -.nieoc4h2 -.nieoc4z2 -.nieoæ2 -.nieod2 -.nieo2d3c2 -.nieo2d3æ2 -.nieo4d3d2 -.nieo2d3f2 -.nieo2d3g2 -.nieod3h2 -.nieod3j2 -.nieo2d3k2 -.nieod3l2 -.nieod3³2 -.nieo2d3n2 -.nieo2d3p2 -.nieo2d3s2 -.nieo2d3¶2 -.nieo2d3t2 -.nieodw2 -.nieod3w1r -.nieod5¿2 -.nieodc4h2 -.nieodc4z2 -.nieodd4z2 -.nieodd4¼2 -.nieodd4¿2 -.nieods4z2 -.nieod4z2 -.nieod4¼2 -.nieof2 -.nieog2 -.nieoh2 -.nieok2 -.nieol2 -.nieo³2 -.nieom2 -.nieop2 -.nieor2 -.nieor4z2 -.nieos2 -.nieos4z2 -.nieo¶2 -.nieot2 -.nieow2 -.nieoz2 -.nieo¼2 -.nieo¿2 -.niepo1 -.niepo2d2 -.niepo3b2 -.niepo3c2 -.niepo3æ2 -.niepod3³2 -.niepo3d4³u1 -.niepo2d3m2 -.niepodmu1 -.niepo3d4muc4h -.niepod3r2 -.niepodra1 -.niepo3d4rap -.niepo3d4ra¿ -.nie1podre1 -.niepodre2p1c -.niepo3d4repc4z -.niepo3d4re2p1t -.niepodrê1 -.niepo3d4rêc4z -.niepod3w2 -.niepodwa1 -.niepo3d4waj -.niepo1dwo1 -.niepo3d4woj -.niepo3do1 -.niepo3du1 -.niepo3d4z2 -.niepo3d4¼2 -.niepo3f2 -.niepo3g2 -.niepo3h2 -.niepo3k2 -.niepo3l2 -.niepo3³2 -.niepo3m2 -.niepo3p2 -.niepo3r2 -.niepo3s2 -.niepo3¶2 -.niepo3t2 -.niepo3w2 -.niepo3z2 -.niepo3¼2 -.niepo3¿2 -.niepodoc4h -.niepo1do1cho1 -.niepo4d3o2choc -.niepo4d3o2str4z -.niepoc4h2 -.niepoc4z2 -.niepo2d3b2 -.niepo2d3c2 -.niepo2d3æ2 -.niepo4d3d2 -.niepo2d3f2 -.niepo2d3g2 -.niepod3h2 -.niepod3j2 -.niepo2d3k2 -.niepod3l2 -.niepo2d3n2 -.niepo2d3p2 -.niepo2d3s2 -.niepo2d3¶2 -.niepo2d3t2 -.niepod5¿ -.niepodc4h2 -.niepodc4z2 -.niepodd4¼2 -.niepodd4¿2 -.niepodsm2 -.niepods4z2 -.niepor4z2 -.nieposm2 -.niepos4z2 -.niepr4z -.nie1prze1 -.nieprze2d2 -.nieprze3b2 -.niepr4ze3br4z2 -.nieprze3c2 -.nieprze3æ2 -.nieprzed3³2 -.nieprzed³u1 -.nieprze3d4³u¿ -.nieprze2d3m2 -.nieprzedmu1 -.nieprze3d4muc4h -.nieprzed3r2 -.nieprzedra1 -.nieprzedra1ma1 -.nieprze3d4ramat -.nieprzedru1 -.nieprze3d4ruk -.nieprzedry1 -.nieprze3d4ryl -.niepr4ze3d4r4z2 -.nieprzed3u2 -.nieprze3d4um -.nieprze3dy1 -.nieprze3d4z2 -.nieprze3d4¼2 -.nie1prze1e2 -.nieprze3e2k2s3 -.nieprze3f2 -.nieprze3g2 -.nieprze3h2 -.nieprze3k2 -.nieprze3l2 -.nieprze3³2 -.nieprze3m2 -.nieprze3n2 -.nieprze3p2 -.nieprze3r2 -.nieprze3s2 -.nieprze3¶2 -.nieprze3t2 -.nieprze3w2 -.nieprze3z2 -.nieprze3¼2 -.nieprze3¿2 -.nieprzed³u¿y1 -.nieprze4d5³u¿yc -.nieprze4d5z2a1 -.nieprze4d5z1g2 -.ni1eprzedzi1 -.nieprze4d5zim -.nieprze4d5zj -.nieprze4d5z1l -.nieprze4d5z2w2r -.nieprzedzwo1 -.nieprze4d5zwoj -.nieprze4d5¿2 -.nieprzec4h2 -.nieprzec4z2 -.nieprze2d3c2 -.nieprze2d3æ2 -.nieprze4d3d2 -.nieprze2d3f2 -.nieprze2d3g2 -.nieprzed3h2 -.ni1eprzed3i2 -.nieprzed3j2 -.nieprze2d3k2 -.nieprzed3l2 -.nieprze2d3n2 -.nieprze2d3p2 -.nieprze2d3s2 -.nieprzed3s4z2 -.nieprze2d3¶2 -.nieprze2d3t2 -.nieprzed3w2 -.nieprzedc4h2 -.nieprzedc4z2 -.nieprzedd4z2 -.nieprzedd4¼2 -.nieprzedd4¿2 -.niepr4zegr4z2 -.nieprzekl2 -.nieprzekr2 -.nieprze2³1k2 -.nieprze2p1c -.nieprzepc4h2 -.niepr4zer4z2 -.nieprze2r1¿2 -.nieprzesc4h2 -.nieprzesm2 -.nieprzes4z2 -.nieprze2t1k2 -.nieprzetr2 -.niero1 -.niero2z3 -.nie1ro3z4e1 -.niero3z4u1 -.nierozbr4z2 -.nieroze3r2 -.nierozm2 -.niero2z1¶2 -.niero2z1t -.nieroztr2 -.nier4z2 -.niesu1 -.niesu2b3 -.ni1esubi1 -.ni2e1su3b4i2e1 -.nies4z2 -.nie2t1k2 -.nietr2 -.nieuc4z2 -.nieuw2 -.niewy1 -.niewy3b2 -.niewy3c2 -.niewy3æ2 -.niewy3d2 -.niewy3f2 -.niewy3g2 -.niewy3h2 -.niewy3k2 -.niewy3l2 -.niewy3³2 -.niewy3m2 -.niewy3p2 -.niewy3r2 -.niewy3s2 -.niewy3¶2 -.niewy3t2 -.niewy3w2 -.niewy3z2 -.niewy3¼2 -.niewy3¿2 -.niewybr4z2 -.niewyc4h2 -.niewyc4z2 -.niewyd4z2 -.niewyd4¼2 -.niewyd4¿2 -.niewyr4z2 -.niewys4z2 -.niewy2t1k2 -.niewytr2 -.niezw2 -.2n1j8 -.2n1k8 -.2n1l8 -.2n1³8 -.2n1m8 -.4n3n8 -.2n1ñ8 -.2n1p8 -.2n1r8 -.2n1s8 -.2n1¶8 -.2n1t8 -.nv8 -.2n1w8 -.nx8 -.2n1z8 -.2n1¼8 -.2n1¿8 -.ñ8 -.2ñ1b8 -.2ñ1c8 -.2ñ1æ8 -.2ñ1d8 -.2ñ1f8 -.2ñ1g8 -.2ñ1h8 -.2ñ1j8 -.2ñ1k8 -.2ñ1l8 -.2ñ1³8 -.2ñ1m8 -.2ñ1n8 -.2ñ1ñ8 -.2ñ1p8 -.2ñ1r8 -.2ñ1s8 -.2ñ1¶8 -.2ñ1t8 -.ñv8 -.2ñ1w8 -.ñx8 -.2ñ1z8 -.2ñ1¼8 -.2ñ1¿8 -.o1 -.o2b2 -.o2d2 -.ot2 -.o2t1c -.otc4h -.o2t3c2h2³ -.ob3l2 -.oblu1 -.o3b4luzg -.ob3³2 -.o3b4³±1 -.o3b4³ê1 -.o1b³o1 -.o3b4³oc -.ob3r -.obra1 -.o3b4raæ -.o3b4raso1 -.o1bro1 -.o3b4ron -.o3b4roñ -.obry1 -.o3b4ryz -.o3b4ry¼ -.o3b4r4z2 -.o3be1 -.o3bi1 -.od3i2 -.o3d4i2u1 -.od3r2 -.odra1 -.o3d4rap -.odrê1 -.o3d4rêt -.o1dro1 -.odrobi1 -.o3d4robin -.odru1 -.o3d4rut -.od2r1w -.o3d4rwi1 -.odr4z2 -.odrze1 -.o3d4rzeæ -.o3d4rz2w -.od5z2 -.odzi1 -.o3d6zi2a1 -.o3d6zi2e1 -.o3de1 -.o2l1¶ -.o3l2¶n -.o4b5³oc4z -.o4b5rz±1 -.obrze1 -.o4b5rzez -.obrzê1 -.o4b5rzêd -.obrzu1 -.o4b5rzuc -.o4b5rzut -.obrzy1 -.o4b5rzyn -.o4d7ziar -.o4d7ziem -.oa2 -.oa3z -.o2b3c2 -.o2b3æ2 -.o2b3d2 -.o2b3f2 -.o2b3g2 -.ob3h2 -.ob3j2 -.o2b3k2 -.o2b3m2 -.o2b3n2 -.o1bo1 -.ob3o2str4z -.o2b3p2 -.o2b3s2 -.o2b3¶2 -.o2b3t2 -.obu1 -.ob3u2m2 -.ob3w2 -.o2b3¼2 -.o2b3¿2 -.obc4h2 -.obc4z2 -.obd4z2 -.obd4¼2 -.obd4¿2 -.obe3b2 -.obe3c2 -.obe3æ2 -.obe3d2 -.obe3f2 -.obe3g2 -.obe3h2 -.obe3k2 -.obe3l2 -.obe3³2 -.obe3m2 -.obe3p2 -.obe3r2 -.obe3r3t -.obe3s2 -.obe3¶2 -.obe3t2 -.obe3w2 -.obe3z2 -.obe3¼2 -.obe3¿2 -.obe4c3n -.obe4z3w -.obec4h2 -.obec4z2 -.obed4z2 -.obed4¼2 -.obed4¿2 -.obe2r3m -.ober4z2 -.obe2r1¿2 -.obesc4h2 -.obes4z2 -.obe2t1k2 -.obi3b2 -.obs4z2 -.oc2 -.oc4h2 -.oc2h2r -.ochr4z2 -.oc4z2 -.oæ2 -.oda1 -.od3a2u1 -.o2d3b2 -.o2d3c2 -.o2d3æ2 -.o4d3d2 -.o2d3f2 -.o2d3g2 -.od3h2 -.o1d3i2zo1 -.od3j2 -.o2d3k2 -.od3l2 -.o2d3m2 -.o2d3n2 -.o1do1 -.od3o2s -.o2d3p2 -.o2d3s2 -.o2d3¶2 -.o2d3t2 -.odu1 -.od3u2c4z -.od3u2m2 -.od3w2 -.od5¿2 -.odbe1 -.odbe2z3 -.odc4h2 -.odc4z2 -.odd4z2 -.odd4¼2 -.odd4¿2 -.ode3b2 -.ode3c2 -.ode3æ2 -.ode3d2 -.ode3f2 -.ode3g2 -.ode3h2 -.ode3k2 -.ode3l2 -.ode3³2 -.ode3m2 -.ode3m1k2 -.ode3p2 -.ode3r2 -.ode3s2 -.ode3¶2 -.ode3t2 -.ode3w2 -.ode3z2 -.ode3¼2 -.ode3¿2 -.odec4h2 -.odec4z2 -.oded4z2 -.oded4¼2 -.oded4¿2 -.ode2p1c -.odepc4h2 -.oder4z2 -.ode2r1¿2 -.odes4z2 -.ode2t1c -.odetc4h2 -.ode2t1k2 -.odkr4z2 -.ods4z2 -.od4¼2 -.of2 -.og2 -.ogni1 -.o1gni2o1 -.ognio3tr2 -.ogó1 -.ogó2l1n -.o1gólno1 -.ogólno3k2 -.oh2 -.ok2 -.oka1 -.oka3m2 -.okr2 -.ole1 -.o1le2o3 -.om2 -.op2 -.o2p1c -.opc4h2 -.o2r1t -.or2tê1 -.or4z2 -.o2r2¿2 -.os2 -.osi1 -.osi2e1 -.osie2m3 -.osie2m1s -.osie1mse1 -.osiemse2t3 -.os4z2 -.o¶2 -.o¶mi1 -.o1¶mi2o1 -.o¶mio3¶2 -.ow2 -.oz2 -.o¼2 -.o¿2 -.p8 -.2p1b8 -.2p1c8 -.pc4h8 -.2p1æ8 -.2p1d8 -.pe1 -.pe2r3 -.pe3c2k -.pe3r4e1 -.pe3r4i1 -.pe3r4o1 -.pe3r4u1 -.pe3r4y1 -.pe4r5i2n -.pe1e2 -.pe1e1se1 -.pee2se2l -.pe2³1n -.pe³no1 -.pe³no3kr2 -.pe1pe1 -.pe1pe1e2 -.pepee2r -.pepee2s -.pe1ze1 -.peze2t1p -.pe1ze1tpe1 -.pe1ze1tpe1e2 -.peze2t1pee2r -.2p1f8 -.2p1g8 -.ph8 -.pi1 -.pi2e1 -.pie2r1w -.pierwo1 -.pierwo3w2 -.pi2ê1 -.piê2æ3 -.pi1êci1 -.piêci2o1 -.piêcio3¶2 -.piê2æ1s -.piêæse1 -.piêæse2t3 -.pi2o1 -.pio1no1 -.piono3w2 -.pj8 -.2p1k8 -.pl8 -.p³8 -.p³a1 -.p³asko1 -.p³asko3w2 -.2p1m8 -.2p1n8 -.2p1ñ8 -.po1 -.po2d2 -.po3b2 -.po3c2 -.po3æ2 -.pod3³2 -.po3d4³u1 -.po2d3m2 -.podmu1 -.po3d4muc4h -.po2d3n2 -.podna1 -.po3d4naw -.pod3r2 -.pod2r1w -.po3d4r2wi1 -.podra1 -.po3d4rap -.po3d4ra¿ -.podre1 -.podre2p1c -.po3d4repc4z -.po3d4re2p1t -.podrê1 -.po3d4rêc4z -.po3d4rêtw -.po1dro1 -.po3d4roba1 -.po3d4ro1bo1 -.po3d4robó1 -.po3d4roby1 -.po3d4roc4z -.po3d4ro¿ -.podró1 -.po3d4ró¿ -.podru1 -.po3d4ruzg -.podry1 -.po3d4ryg -.podr4z -.po3d4rze1 -.pod3w2 -.podwa1 -.po3d4waj -.po1dwo1 -.po3d4woi2 -.po3d4woj -.po3d4wor4z -.podwó1 -.po3d4wó2j1n -.po3d4wór -.po3da1 -.po3d±1 -.po3de1 -.po3dej -.po3dê1 -.podi1 -.po3di2u1 -.po3do1 -.po3du1 -.po3dy1 -.po3d4z2 -.po3d4¼2 -.poe2 -.po3e2k2s3 -.po3f2 -.po3g2 -.po3h2 -.po3k2 -.po3l2 -.po3³2 -.po3m2 -.po3p2 -.po3r2 -.po3r1¿ -.po3s2 -.po3¶2 -.po3t2 -.po3w2 -.po3z2 -.po3¼2 -.po3¿2 -.poc4z2 -.po4c2z3d -.po4c2z3t -.pode3k2 -.po4d3e4k2s3 -.podobi1 -.podobi2a1 -.po4d3o2biad -.po1do1bo1 -.podobo2j1c -.po4d3o2bojc4z -.podobó1 -.po4d3o2bóz -.podobra1 -.po4d3o2braz -.podoc4h -.po1do1cho1 -.po4d3o2choc -.po4d3o2d1m -.po4d3o2f -.po4d3o2g -.podoki1 -.podoki2e1 -.po4d3o2kien -.po4d3o2k1n -.podokre1 -.po4d3o2kres -.podokrê1 -.po4d3o2krêg -.podopi1 -.podopi2e1 -.po4d3o2piec4z -.podory1 -.po4d3o2ryw -.podosi1 -.podosi1ni1 -.podosini2a1 -.po4d3o2siniak -.po4d3o2str4z -.podo2b1s -.po4d3obs4z -.po4d3o4d3d -.podo2l1b -.po4d3olbr4z -.podó1 -.po4d3ów -.po4d3u2c4z -.po4d3u2d4z -.po4d3u2pa1 -.podura1 -.po4d3u2ral -.po4d3u2sta1 -.podus4z -.podu2s2z1c -.po4d3u2szc4z -.po4d5rê2cz1n -.podza1 -.po4d5zakr -.po4d5zam -.po4d5zast -.po2dz1b -.po4d5zbi1 -.po4d5ze1 -.podzi1 -.podzi2e1 -.podzie1le1 -.podzi1eleni1 -.po4d5zieleni2±1 -.po4d5zielenic -.po4d5zieleniæ -.podzi2e1le1ni2e1 -.po4d5zielenien -.po4d5zieleni2ê1 -.po4d5zielenil -.po4d5zieleni³ -.po4d5zielenim -.po4d5zieleni2o1 -.po4d5zielenis -.po4d5ziem -.po1dzi2o1 -.po4d5ziom -.po4d5z2w2r -.po4l3s -.po4m3p -.po4ñ3c -.po4r3c -.po4r3f -.po4r3n -.po4r3t -.po4s2t3d -.po4s2t3f -.po4s2t3g -.po4st3h -.po4st3i2 -.po4s2t3k -.po4st3l -.po4s2t3m -.po4s2t3p -.po1stro1 -.po4st3rom -.po4s2t3s -.poduszczy1 -.po5d4uszczyn -.po5r4tê1 -.pobr2 -.pobr4z2 -.poc4h2 -.poc2h2r -.pochr4z2 -.pod3a2l1p -.po2d3b2 -.po2d3c2 -.po2d3æ2 -.po4d3d2 -.po2d3f2 -.po2d3g2 -.pod3h2 -.pod3i2n -.pod3j2 -.po2d3k2 -.pod3l2 -.po2d3p2 -.po2d3s2 -.po2d3¶2 -.pod¶ró1 -.pod3¶ró2d5 -.po2d3t2 -.pod5¿2 -.podc4h2 -.podc4z2 -.podd4¼2 -.podd4¿2 -.pode3b2 -.pode3c2 -.pode3æ2 -.pode3d2 -.pode3f2 -.pode3g2 -.pode3h2 -.pode3l2 -.pode3³2 -.pode3m2 -.pode3p2 -.pode3r2 -.pode3s2 -.pode3¶2 -.pode3t2 -.pode3t1k2 -.pode3w2 -.pode3z2 -.pode3¼2 -.pode3¿2 -.podec4h2 -.podec4z2 -.poded4z2 -.poded4¼2 -.poded4¿2 -.pode2p1c -.podepc4h2 -.poder4z2 -.pode2r1¿2 -.podesc4h2 -.podes4z2 -.podro2z3 -.podsm2 -.pods4z2 -.pogr4z2 -.pokl2 -.pokr2 -.po2³1k2 -.pom4p1k -.po2m1k2 -.pona1 -.pona2d2 -.pona3b2 -.pona3c2 -.pona3c4z2 -.pona3æ2 -.po1na3do1 -.pona3d4¼2 -.pona3f2 -.pona3g2 -.pona3h2 -.pona3k2 -.pona3l2 -.pona3³2 -.pona3m2 -.pona3p2 -.pona3r2 -.pona3s2 -.pona3¶2 -.pona3t2 -.pona3w2 -.pona3z2 -.pona3¼2 -.pona3¿2 -.pona4f3t -.ponabr4z2 -.ponac4h2 -.pona2d3c2 -.ponad3c4h2 -.ponad3c4z2 -.pona2d3æ2 -.pona4d3d -.ponad3d4¼2 -.pona2d3f2 -.pona2d3g2 -.ponad3h2 -.ponad3j2 -.pona2d3k2 -.ponad3l2 -.pona2d3p2 -.pona2d3s2 -.pona2d3¶2 -.pona2d3t2 -.ponad4z2 -.ponar4z2 -.ponasm2 -.ponas4z2 -.ponaz3m2 -.ponazw2 -.poni1 -.poni2e1 -.ponie3k2 -.ponie3w2 -.po2p1c -.popc4h2 -.po1po1 -.popo3w2 -.popr4z2 -.por4t1w -.por4t1f -.por4t1m -.po1ro1 -.poro2z3 -.poro3z4u1 -.por4z2 -.posc4h2 -.posm2 -.pos4z2 -.po2t1k2 -.potr2 -.poz4m2 -.poza1 -.poza3u2 -.pozw2 -.pó1 -.pó2³3 -.pó3³4±1 -.pó³e1 -.pó3³4ec4z -.pó3³4ê1 -.pó3³4y1 -.pó2³1k2 -.pó³kr2 -.pó2³1m2 -.pó³o2 -.pó³ob3r -.pó³o2m2d -.pó2³1p -.pó³pr4z -.pó³przy1 -.pó³przy3m2k -.4p3p8 -.pr8 -.pra1 -.pra3s2 -.pra2w1n -.pra3w2nu1 -.pra3w2z -.pra1pra1 -.prapra2w1n -.prapra3w2nu1 -.pre1 -.predy1 -.predy2s3po1 -.pr4z8 -.prze1 -.prze2d2 -.prze3b2 -.prze3c2 -.prze3æ2 -.przed3³2 -.przed³u1 -.prze3d4³u¿ -.prze2d3m2 -.przedmu1 -.prze3d4muc4h -.przed3o2 -.prze3d4o3br -.prze3d4o3st -.prze3d4o3zo1 -.przed3r2 -.przedra1 -.przedra1ma1 -.prze3d4ramat -.przedru1 -.prze3d4ruk -.przedry1 -.prze3d4ryl -.pr4ze3d4r4z2 -.przed3u2 -.prze3d4um -.prze3d±1 -.prze3dê1 -.prze3dy1 -.prze3d4z2 -.prze3d4¼2 -.prze1e2 -.prze3e2k2s3 -.prze3f2 -.prze3g2 -.prze3h2 -.prze3k2 -.prze3l2 -.prze3³2 -.prze3m2 -.prze3n2 -.prze3p2 -.prze3r2 -.prze3s2 -.prze3¶2 -.prze3t2 -.prze3u2 -.prze3w2 -.prze3z2 -.prze3¼2 -.prze3¿2 -.przed³u¿y1 -.prze4d5³u¿yc -.przedosta1 -.prze4d5o4stat -.prze4d5za1 -.prze4d5z1g2 -.przedzi1 -.prze4d5zim -.prze4d5zj -.prze4d5z1l -.prze4d5z2w2r -.przedzwo1 -.prze4d5zwoj -.prze4d5¿2 -.przebr2 -.pr4zebr4z2 -.przec4h2 -.przec2h2r -.pr4zechr4z2 -.przeci1 -.przeci2w3 -.przeci1wi1 -.prze1ci3w4i2e1 -.przeciwa2 -.przeci4w3w2 -.przec4z2 -.przeda1 -.przedago1 -.przed3a2gon -.przed3a2k1c -.przed3a2l1p -.prze2d3b2 -.prze2d3c2 -.prze2d3æ2 -.prze4d3d2 -.prze1de1 -.przed3e2g1z -.prze1de1me1 -.przed3e2mer -.prze2d3f2 -.prze2d3g2 -.przed3h2 -.przed3i2 -.przed3j2 -.prze2d3k2 -.przed3l2 -.prze2d3n2 -.prze2d3p2 -.prze2d3s2 -.przedsi1 -.przedsi2ê1 -.przed3siê3w2 -.przed3s4z2 -.prze2d3¶2 -.prze2d3t2 -.przed3w2 -.przedc4h2 -.przedc4z2 -.przedd4z2 -.przedd4¼2 -.przedd4¿2 -.pr4zedgr4z2 -.przedy2s3ku1 -.pr4zegr4z2 -.przekl2 -.przekr2 -.prze2³1k2 -.prze2m1k2 -.prze2p1c -.przepc4h2 -.pr4zer4z2 -.prze2r1¿2 -.przesc4h2 -.przesm2 -.przes4z2 -.prze2t1k2 -.przetr2 -.przetra1 -.przetra2n2s3 -.przy1 -.przy3b2 -.przy3c2 -.przy3æ2 -.przy3d2 -.przy3f2 -.przy3g2 -.przy3h2 -.przy3k2 -.przy3l2 -.przy3³2 -.przy3m2 -.przy3p2 -.przy3r2 -.przy3s2 -.przy3¶2 -.przy3t2 -.przy3w2 -.przy3z2 -.przy3¼2 -.przy3¿2 -.przybr2 -.przyc4h2 -.przyc4z2 -.przyd4z2 -.przyd4¼2 -.przyd4¿2 -.pr4zygr4z2 -.przy2m1k2 -.przyo2 -.przyoz2 -.przy2p1c -.przypc4h2 -.pr4zyr4z2 -.przy2r1¿2 -.przysc4h2 -.przys4z2 -.przy2t1k2 -.2p1s8 -.2p1¶8 -.2p1t8 -.pv8 -.pw8 -.px8 -.2p1z8 -.2p1¼8 -.2p1¿8 -.r8 -.2r1b8 -.2r1c8 -.2r1æ8 -.2r1d8 -.re1 -.retra1 -.retra2n2s3 -.2r1f8 -.2r1g8 -.2r1h8 -.2r1j8 -.2r1k8 -.2r1l8 -.2r1³8 -.2r1m8 -.2r1n8 -.2r1ñ8 -.ro1 -.ro2z3 -.ro3z4a1 -.ro3z4e1 -.ro3z4e3b2 -.ro3z4e3c2 -.ro3z4e3æ2 -.ro3z4e3d2 -.ro3z4e3f2 -.ro3z4e3g2 -.ro3z4e3h2 -.ro3z4e3k2 -.ro3z4e3l2 -.ro3z4e3³2 -.ro3z4e3m2 -.ro3z4e3p2 -.ro3z4e3r2 -.ro3z4e3s2 -.ro3z4e3¶2 -.ro3z4e3t2 -.ro3z4e3w2 -.ro3z4e3z2 -.ro3z4e3¼2 -.ro3z4e3¿2 -.ro3z4ej -.ro3z4u1 -.ro4z5a2gi1 -.rozani1 -.ro4z5a2ni2e1 -.ro4z5e2mo1 -.ro4z5e4g3z -.ro4z5e4n3t -.rozbr4z2 -.ro2z1d2 -.rozec4h2 -.rozec4z2 -.rozed4z2 -.rozed4¼2 -.rozed4¿2 -.roze2p1c -.rozepc4h2 -.rozer4z2 -.roze2r1¿2 -.rozesc4h2 -.rozes4z2 -.rozi2 -.rozm2 -.ro1zo2 -.ro2z1p -.ro1zpo1 -.rozpo3w2 -.ro2z1¶2 -.ro2z1t2 -.roztr2 -.rozw2 -.2r1p8 -.4r3r8 -.2r1s8 -.2r1¶8 -.2r1t8 -.rv8 -.2r1w8 -.rx8 -.r4z8 -.2r1¼8 -.2r1¿8 -.s8 -.sa1 -.samo1 -.samo3c4h2 -.samo3k2 -.samo3p2 -.samo3w2 -.samo1ro1 -.samoro2z3 -.2s1b8 -.sc8 -.sc4h8 -.sæ8 -.2s1d8 -.2s1f8 -.2s1g8 -.sh8 -.si1 -.si2e1 -.sie1de1 -.siede2m3 -.siede2m1s -.sie1de1mse1 -.siedemse2t3 -.sie2d1m -.si1edmi1 -.siedmi2o1 -.siedmio3¶2 -.sj8 -.sk8 -.sk±1 -.sk±d4¿ -.sk±2d5¿e1 -.skl8 -.skr8 -.sl8 -.s³8 -.sm8 -.sn8 -.sñ8 -.so1 -.so1bo1 -.sobo3w2 -.sp8 -.spo1 -.spo2d2 -.spo3b2 -.spo3c2 -.spo3æ2 -.spo3d4z2 -.spo3f2 -.spo3g2 -.spo3h2 -.spo3k2 -.spo3l2 -.spo3³2 -.spo3m2 -.spo3p2 -.spo3r2 -.spo3s2 -.spo3¶2 -.spo3t2 -.spo3w2 -.spo3z2 -.spo3¼2 -.spo3¿2 -.spo4r3n -.spo4r3t -.spoc4h2 -.spoc4z2 -.spo4d3d -.spod4¼2 -.spod4¿2 -.spor4z2 -.spos4z2 -.spó1 -.spó2³3 -.sr8 -.2s1s8 -.s¶8 -.st8 -.ste1 -.ste1re1 -.stere2o3 -.stereoa2 -.ste1re1oe2 -.stereoi2 -.stereo1o2 -.stereou2 -.su1 -.su2b3 -.subi1 -.su3b4i2e1 -.subo1 -.su3b4o2t1n -.supe1 -.supe2r3 -.supera1 -.supe3r4at -.superi1 -.supe3r4i2o1 -.supe4r5a2tr -.super4z -.supe2r5z2b -.supe1re2 -.supero1 -.superodr4z -.su1perodrzu1 -.supero2d1rzut -.sv8 -.sw8 -.sx8 -.s4z8 -.sze1 -.sze2s3 -.sze4¶2æ3 -.sze¶1c -.sze1¶2ci1 -.sze¶ci2o1 -.sze¶cio3¶2 -.sze¶2æ1s -.sze1¶æse1 -.sze¶æse2t3 -.2s1¼8 -.2s1¿8 -.¶8 -.2¶1b8 -.¶1c8 -.¶æ8 -.2¶1d8 -.2¶1f8 -.2¶1g8 -.¶h8 -.¶j8 -.2¶1k8 -.¶l8 -.¶³8 -.¶m8 -.¶n8 -.¶ñ8 -.2¶1p8 -.¶r8 -.¶ró1 -.¶ró2d5 -.¶ródr2 -.2¶1s8 -.2¶1¶8 -.2¶1t8 -.¶v8 -.¶w8 -.¶wi1 -.¶wi2a1 -.¶wiat³o1 -.¶wiat³o3w2 -.¶x8 -.2¶1z8 -.2¶1¼8 -.2¶1¿8 -.t8 -.ta1 -.ta2o3 -.tar4z -.ta1rza1 -.ta2r7zan -.2t1b8 -.2t1c8 -.tc4h8 -.2t1æ8 -.2t1d8 -.te1 -.te2o3 -.2t1f8 -.2t1g8 -.th8 -.tj8 -.2t1k8 -.tl8 -.t³8 -.2t1m8 -.2t1n8 -.2t1ñ8 -.to1 -.toa3 -.2t1p8 -.tr8 -.tra1 -.tra2n2s3 -.tran3s4e1 -.transi1 -.tran3s4i2e1 -.tran3s4y1 -.tran3s4z -.tran4s5e2u1 -.tra1nsa2 -.transo2 -.tró1 -.tró2j3 -.tró3j4±1 -.tróje1 -.tró3j4ec4z -.tró3j4ê1 -.tr4z8 -.trze1 -.trze2c4h3 -.trze2c2h1s -.trze1chse1 -.trzechse2t3 -.2t1s8 -.2t1¶8 -.4t3t8 -.tv8 -.tw8 -.tx8 -.ty1 -.tysi1 -.tysi2±1 -.tysi±2c3 -.tysi±3c4a1 -.tysi±3c4e1 -.tysi±3c4z -.tysi±4c5z³ -.2t1z8 -.2t1¼8 -.2t1¿8 -.u1 -.u3b2 -.u3c2 -.u3d2 -.u3f2 -.u3g2 -.u3h2 -.u3k2 -.u3l2 -.u3³2 -.u3m2 -.u3n2 -.u3p2 -.u3r2 -.u3s2 -.u3t2 -.u3w2 -.u3z2 -.u3¼2 -.u3¿2 -.u4d3k -.u4f3n -.ukle1 -.u4k3lej -.u4l3s -.u4l3t -.u2m1b -.u4m3br -.u4n3c -.u4n3d -.u4p3p -.u4p3p2s -.u4r3s -.u4s2t3n -.u4s2t1c -.u4s2t1k -.u4z3be1 -.ube1 -.ube2z3 -.ubezw2 -.ubr2 -.uc4h2 -.uc4z2 -.uæ2 -.ud4z2 -.ud4¼2 -.ud4¿2 -.ukr2 -.u2m1k2 -.u2p1c -.upc4h2 -.upo1 -.upo2d2 -.upo3b2 -.upo3c2 -.upo3æ2 -.upo3da1 -.upo3f2 -.upo3g2 -.upo3h2 -.upo3k2 -.upo3l2 -.upo3³2 -.upo3m2 -.upo3p2 -.upo3r2 -.upo3s2 -.upo3¶2 -.upo3t2 -.upo3w2 -.upo3z2 -.upo3¼2 -.upo3¿2 -.upoc4h2 -.upoc4z2 -.upo4d3d -.upod4¼2 -.upod4¿2 -.upor4z2 -.upos4z2 -.uro1 -.uro2z3 -.ur4z2 -.u2r1¿2 -.usc4h2 -.us4z2 -.u¶2 -.u2t1k2 -.utr2 -.uze1 -.uze3w2 -.v8 -.vb8 -.vc8 -.væ8 -.vd8 -.vf8 -.vg8 -.vh8 -.vj8 -.vk8 -.vl8 -.v³8 -.vm8 -.vn8 -.vñ8 -.vp8 -.vr8 -.vs8 -.v¶8 -.vt8 -.vv8 -.vw8 -.vx8 -.vz8 -.v¼8 -.v¿8 -.w8 -.2w1b8 -.2w1c8 -.2w1æ8 -.2w1d8 -.we1 -.we3b2 -.we3c2 -.we3æ2 -.we3d2 -.we3f2 -.we3g2 -.we3h2 -.we3k2 -.we3l2 -.we3³2 -.we3m2 -.we3n2 -.we3p2 -.we3r2 -.we3s2 -.we3¶2 -.we3t2 -.we3w2 -.we3z2 -.we3¿2 -.we4k3t -.we4l3w -.we4³3n -.we4n3d -.we4n3t -.we4r3b -.we4r3d -.we4r3n -.we4r3s -.we4r3t -.we4s3pr4z -.wes2t1c -.we4s3tc4h2 -.we4z3br -.we4z3g³ -.wec4h2 -.wec4z2 -.wed4z2 -.wed4¼2 -.wed4¿2 -.we2m1k2 -.we2p1c -.wepc4h2 -.wer4z2 -.wes4z2 -.we2t1k2 -.we2w1n -.wewn±1 -.wewn±2tr4z3 -.2w1f8 -.2w1g8 -.wh8 -.wi1 -.wi2e1 -.wielo1 -.wielo3d2 -.wielo3k2 -.wielo3¶2 -.wielu1 -.wie1luse1 -.wieluse2t3 -.wi2l1c -.wilc4z -.wilczo1 -.wilczo3m2 -.2w1j8 -.2w1k8 -.2w1l8 -.2w1³8 -.2w1m8 -.2w1n8 -.wni1 -.wni2e1 -.wniebo1 -.wniebo3w2 -.2w1ñ8 -.wo1 -.wo1do1 -.wodo3w2 -.2w1p8 -.2w1r8 -.2w1s8 -.wspó1 -.wspó2³3 -.wspó³i2 -.wspó³o1 -.wspó³o2b3w -.wspó³u2 -.wspó2³1w2 -.ws4z -.wsze1 -.wsze2c4h3 -.wszecho2 -.wszec2h2w2 -.2w1¶8 -.2w1t8 -.wv8 -.4w3w8 -.wx8 -.wy1 -.wy3b2 -.wy3c2 -.wy3æ2 -.wy3d2 -.wy3f2 -.wy3g2 -.wy3h2 -.wy3k2 -.wy3l2 -.wy3³2 -.wy3m2 -.wyo2 -.wy3o2d3r -.wy3p2 -.wy3r2 -.wy3s2 -.wy3¶2 -.wy3t2 -.wy3w2 -.wy3z2 -.wy3¼2 -.wy3¿2 -.wyc4z2 -.wy4cz3ha1 -.wy2¿1s -.wy4¿3s4z -.wybr2 -.wybr4z2 -.wyc4h2 -.wydr2 -.wyd4z2 -.wyd4¼2 -.wyd4¿2 -.wye2 -.wye2k2s3 -.wygr4z2 -.wyi2 -.wyi2zo1 -.wykl2 -.wykr2 -.wykr4z2 -.wy2m1k2 -.wy2p1c -.wypc4h2 -.wypr4z2 -.wyr4z2 -.wy2r1¿2 -.wysc4h2 -.wysm2 -.wys4z2 -.wy2t1c -.wytc4h2 -.wy2t1k2 -.wytr2 -.2w1z8 -.2w1¼8 -.2w1¿8 -.x8 -.xb8 -.xc8 -.xæ8 -.xd8 -.xf8 -.xg8 -.xh8 -.xj8 -.xk8 -.xl8 -.x³8 -.xm8 -.xn8 -.xñ8 -.xp8 -.xr8 -.xs8 -.x¶8 -.xt8 -.xv8 -.xw8 -.xx8 -.xz8 -.x¼8 -.x¿8 -.z8 -.za1 -.za3b2 -.za3c2 -.za3æ2 -.za3d2 -.za3f2 -.za3g2 -.za3h2 -.za3k2 -.za3l2 -.za3³2 -.za3m2 -.zao2 -.za3o2b3r -.za3o2b3s -.za3p2 -.za3r2 -.za3s2 -.za3¶2 -.za3t2 -.za3u2 -.za3w2 -.za3z2 -.za3¼2 -.za3¿2 -.za4k3t -.za4l3g -.za4l3k -.za4l3t -.za4m3k -.za2r1c -.za4r3c4h -.za4uto1 -.za5m4k2n -.zabr2 -.zabr4z2 -.zac4h2 -.zac4z2 -.zado1 -.zado2¶æ3 -.zado¶æu4 -.zadr2 -.zady1 -.zady2s3po1 -.zad4z2 -.zad4¼2 -.zad4¿2 -.zagr4z2 -.zai2 -.zai2n3 -.zai2zo1 -.zai1ni1 -.zain4ic -.zakl2 -.zakr2 -.zakr4z2 -.zani1 -.zani2e1 -.zanie3d2 -.zar4z2 -.za2r1¿2 -.zasc4h2 -.zasm2 -.zas4z2 -.za2t1k2 -.zatr2 -.zb8 -.2z1c8 -.2z1æ8 -.2z1d8 -.zde1 -.zde2z3 -.zdeza1 -.zde3z4awu1 -.zde1ze1 -.zde3z4el -.zde3z4er -.zde3z4y1 -.zdy1 -.zdysko1 -.zdy2s3ko2n1t -.zdyskre1 -.zdy2s3kred -.zdyskwa1 -.zdy2s3kwal -.ze1 -.ze3b2 -.ze3c2 -.ze3æ2 -.ze3d2 -.ze3f2 -.ze3g2 -.ze3h2 -.ze3k2 -.ze3l2 -.ze3³2 -.ze3m2 -.ze3p2 -.ze3r2 -.ze3s2 -.ze3¶2 -.ze3t2 -.ze3t1k2 -.ze3w2 -.ze3z2 -.ze3¼2 -.ze3¿2 -.ze4r3k -.ze1te1 -.ze1te1me1 -.ze4t3e2m1e2s -.ze1te1se1 -.ze4t3e2s1e2l -.ze4t3e2m1p -.zetha1 -.ze4t3hap -.zec4h2 -.zec4z2 -.zed4z2 -.zed4¼2 -.zed4¿2 -.zekl2 -.ze2p1c -.zepc4h2 -.zer4z2 -.ze2r1¿2 -.zesc4h2 -.zesm4 -.zes4z2 -.2z1f8 -.zg8 -.zh8 -.zi1 -.zi2m1n -.zimno1 -.zimno3kr2 -.zj8 -.2z1k8 -.zl8 -.z³8 -.z³o1 -.z³o3w2 -.zm8 -.zma1 -.zma2r1t -.zmartwy1 -.zmartwy2c4h3 -.zmartwyc2h2w2 -.zn8 -.zni1 -.zni2e1 -.znie3b2 -.znie3c2 -.znie3æ2 -.znie3d2 -.znie3f2 -.znie3g2 -.znie3h2 -.znie3k2 -.znie3l2 -.znie3³2 -.znie3m2 -.znie3n2 -.znie3ñ2 -.znie3p2 -.znie3r2 -.znie3s2 -.znie3¶2 -.znie3t2 -.znie3w2 -.znie3z2 -.znie3¼2 -.znie3¿2 -.znie4d4¼3 -.znie4m3c -.zniec4h2 -.zniec4z2 -.znied4z2 -.znied4¿2 -.znier4z2 -.znies4z2 -.zñ8 -.zo1 -.zo2o3 -.2z1p8 -.zr8 -.zro1 -.zro2z3 -.zro3z4u1 -.2z1s8 -.2z1¶8 -.2z1t8 -.zv8 -.zw8 -.zx8 -.4z3z8 -.z¼8 -.z¿8 -.¼8 -.2¼1b8 -.2¼1c8 -.2¼1æ8 -.2¼1d8 -.¼2d4¼8 -.2¼1f8 -.2¼1g8 -.¼h8 -.¼j8 -.2¼1k8 -.2¼1l8 -.¼³8 -.2¼1m8 -.2¼1n8 -.¼ñ8 -.2¼1p8 -.¼r8 -.2¼1s8 -.2¼1¶8 -.2¼1t8 -.¼v8 -.2¼1w8 -.¼x8 -.2¼1z8 -.4¼3¼8 -.2¼1¿8 -.¿8 -.2¿1b8 -.2¿1c8 -.2¿1æ8 -.2¿1d8 -.2¿1f8 -.2¿1g8 -.¿h8 -.2¿1j8 -.2¿1k8 -.2¿1l8 -.2¿1³8 -.2¿1m8 -.2¿1n8 -.2¿1ñ8 -.2¿1p8 -.2¿1r8 -.2¿1s8 -.2¿1¶8 -.2¿1t8 -.¿v8 -.2¿1w8 -.¿x8 -.2¿1z8 -.2¿1¼8 -.4¿3¿8 -¶1c -1¶2ci1 -2b1c -2b1æ -2b1d -2b1f -2b1g -2b1k -2b1m -2b1n -2b1ñ -2b1p -2b1s -2b1¶ -2b1t -2b1z -2b1¼ -2b1¿ -2b2³1k -2b2r1n -2c1b -2c1æ -2c1d -2c1f -2c1g -2c1k -2c1l -2c1m -2c1n -2c1ñ -2c1p -2c1s -2c1¶ -2c1t -2c1¼ -2c1¿ -c4h -2c2h1b -2c2h1c -2c2h1æ -2c2h1d -2c2h1f -2c2h1g -2c2h1k -2c2h1m -2c2h1n -2c2h1ñ -2c2h1p -2c2h1s -2c2h1¶ -2c2h1t -2c2h1z -2c2h1¼ -2c2h1¿ -c4z -2cz1b -2c2z1c -2c2z1æ -2c2z1d -2c2z1f -2cz1g -2c2z1k -2cz1l -2cz1m -2cz1n -2cz1ñ -2c2z1p -2c2z1s -2c2z1¶ -2c2z1t -2c4z3z -2cz1¼ -2cz1¿ -2æ1b -2æ1c -2æ1d -2æ1f -2æ1g -2æ1k -2æ1m -2æ1n -2æ1ñ -2æ1p -2æ1s -2æ1¶ -2æ1t -2æ1z -2æ1¼ -2æ1¿ -2d1b -2d1c -2d1æ -2d1f -2d1g -2d1k -2d1m -2d1n -2d1ñ -2d1p -2d1s -2d1¶ -2d1t -2d2³1b -d2³1s -2d³s4z -2d2r1n -d4z -2dz1b -2d2z1c -2d2z1æ -2d2z1d -2d2z1f -2dz1g -2d2z1k -2dz1l -2dz1m -2dz1n -2dz1ñ -2d2z1p -2d2z1s -2d2z1¶ -2d2z1t -2d4z3z -2dz1¼ -2dz1¿ -d4¼ -2d2¼1b -2d2¼1c -2d2¼1æ -2d2¼1d -2d2¼1f -2d2¼1g -2d2¼1k -2d2¼1m -2d2¼1n -2d¼1ñ -2d2¼1p -2d2¼1s -2d2¼1¶ -2d2¼1t -2d2¼1z -2d4¼3¼ -2d2¼1¿ -d4¿ -2d2¿1b -2d2¿1c -2d2¿1æ -2d2¿1d -2d2¿1f -2d2¿1g -2d2¿1k -2d2¿1m -2d2¿1n -2d2¿1ñ -2d2¿1p -2d2¿1s -2d2¿1¶ -2d2¿1t -2d2¿1z -2d2¿1¼ -2d4¿3¿ -2f1c -2f1k -2f1m -2f1n -2g1b -2g1c -2g1æ -2g1d -2g1f -2g1k -2g1m -2g1ñ -2g1p -2g1s -2g1¶ -2g1t -2g1z -2g1¼ -2g1¿ -2g2³1b -2h1b -2h1c -2h1æ -2h1d -2h1f -2h1g -2h1j -2h1k -2h1l -2h1³ -2h1m -2h1n -2h1ñ -2h1p -2h1r -2h1s -2h1¶ -2h1t -2h1w -2h1z -2h1¼ -2h1¿ -2j1b -2j1c -2j1æ -2j1d -2j1f -2j1g -2j1h -2j1k -2j1l -2j1³ -2j1m -2j1n -2j1ñ -2j1p -2j1r -2j1s -2j1¶ -2j1t -2j1w -2j1z -2j1¼ -2j1¿ -2k1b -2k1c -2k1æ -2k1d -2k1f -2k1g -2k1m -2k1n -2k1ñ -2k1p -2k1s -2k1s4z -2k1¶ -2k1t -2k1z -2k1¼ -2k1¿ -2k2³1b -2l1b -2l1c -2l1æ -2l1d -2l1f -2l1g -2l1h -2l1j -2l1k -2l1³ -2l1m -2l1n -2l1ñ -2l1p -2l1r -2l1s -2l1¶ -2l1t -2l1w -2l1z -2l1¼ -2l1¿ -2³1b -2³1c -2³1æ -2³1d -2³1f -2³1g -2³1h -2³1j -2³1k -2³1l -2³1m -2³1n -2³1ñ -2³1p -2³1r -2³1s -2³1¶ -2³1t -2³1w -2³1z -2³1¼ -2³1¿ -2m1b -2m1c -2m1æ -2m1d -2m1f -2m1g -2m1h -2m1j -2m1k -2m1l -2m1³ -2m1n -2m1ñ -2m1p -2m1r -2m1s -2m1¶ -2m1t -2m1w -2m1z -2m1¼ -2m1¿ -2n1b -2n1c -2n1æ -2n1d -2n1f -2n1g -2n1h -2n1j -2n1k -2n1l -2n1³ -2n1m -2n1ñ -2n1p -2n1r -2n1s -2n1¶ -2n1t -2n1w -2n1z -2n1¼ -2n1¿ -2n2t1n -2ñ1b -2ñ1c -2ñ1æ -2ñ1d -2ñ1f -2ñ1g -2ñ1h -2ñ1j -2ñ1k -2ñ1l -2ñ1³ -2ñ1m -2ñ1n -2ñ1ñ -2ñ1p -2ñ1r -2ñ1s -2ñ1¶ -2ñ1t -2ñ1w -2ñ1z -2ñ1¼ -2ñ1¿ -2p1b -2p1c -2p1æ -2p1d -2p1f -2p1g -2p1k -2p1m -2p1n -2p1ñ -2p1s -2p1s4z -2p1¶ -2p1t -2p1z -2p1¼ -2p1¿ -2p2l1n -2r1b -2r1c -2r1æ -2r1d -2r1f -2r1g -2r1h -2r1j -2r1k -2r1l -2r1³ -2r1m -2r1n -2r1ñ -2r1p -2r1s -2r1¶ -2r1t -2r1w -2r1¼ -2r1¿ -r4z -2rz1b -2r2z1c -2r2z1æ -2r2z1d -2r2z1f -2rz1g -2rz1h -2rz1j -2r2z1k -2rz1l -2rz1³ -2rz1m -2rz1n -2rz1ñ -2r2z1p -2rz1r -2r2z1s -2r2z1¶ -2r2z1t -2rz1w -2rz1¼ -2rz1¿ -2s1b -2s1d -2s1f -2s1g -2s1s -2s1¼ -2s1¿ -2s2³1b -2s2n1k -2s2t1k -2s2t1n -s2t1s -2sts4z -s4z -2s2z1c -2s2z1æ -2s2z1f -2s2z1k -2sz1l -2sz1m -2sz1n -2s2z1p -2s2z1s -2s2z1¶ -2s2z1t -2sz1w -2s4z3z -2sz2l1n -2¶1b -2¶1d -2¶1f -2¶1g -2¶1k -2¶1p -2¶1s -2¶1¶ -2¶1t -2¶1z -2¶1¼ -2¶1¿ -2¶2æ1c -2¶2l1m -2¶2l1n -2t1b -2t1c -2t1æ -2t1d -2t1f -2t1g -2t1k -2t1m -2t1n -2t1ñ -2t1p -2t1s -2t1¶ -2t1z -2t1¼ -2t1¿ -2t2l1n -2t2r1k -tr4z -2t2rz1n -2w1b -2w1c -2w1æ -2w1d -2w1f -2w1g -2w1j -2w1k -2w1l -2w1³ -2w1m -2w1n -2w1ñ -2w1p -2w1r -2w1s -2w1¶ -2w1t -2w1z -2w1¼ -2w1¿ -2z1c -2z1æ -2z1d -2z1f -2z1k -2z1p -2z1s -2z1¶ -2z1t -2z2d1k -2z2d1n -2¼1b -2¼1c -2¼1æ -2¼1d -2¼1f -2¼1g -2¼1k -2¼1l -2¼1m -2¼1n -2¼1p -2¼1s -2¼1¶ -2¼1t -2¼1w -2¼1z -2¼1¿ -2¿1b -2¿1c -2¿1æ -2¿1d -2¿1f -2¿1g -2¿1j -2¿1k -2¿1l -2¿1³ -2¿1m -2¿1n -2¿1ñ -2¿1p -2¿1r -2¿1s -2¿1¶ -2¿1t -2¿1w -2¿1z -2¿1¼ -dni1 -dni2o1 -3d2niow -3k2s2z2t -3m2k2n -mne1 -3m2nest -3m2nezj -3m2s2k2n -pne1 -3p2ne2u1 -wc4z -wcza1 -3w2czas -w³a1 -3w2³ad -w³o1 -3w2³os -4b3b -4c3c -4æ3æ -4d3d -4f3f -4g3g -4h3h -4j3j -4k3k -4l3l -4³3³ -4m3m -4n3n -4p3p -4r3r -4t3t -4w3w -4z3z -4¼3¼ -4¿3¿ -8b. -8b8b. -8b8c. -8b8æ. -8b8d. -8b8f. -8b8g. -8b8h. -8b8j. -8b8k. -8b8l. -8b8³. -8b8m. -8b8n. -8b8ñ. -8b8p. -8b8r. -br4z -8b8r8z. -8b8s. -8b8¶. -8b8t. -8b8v. -8b8w. -8b8x. -8b8z. -8b8¼. -8b8¿. -8c. -8c8b. -8c8c. -8c8æ. -8c8d. -8c8f. -8c8g. -8c8h. -c2h2³ -8c8h8³. -c2h2r -chr4z -8ch8r8z. -c2h2w -8c8h8w. -8c8j. -8c8k. -8c8l. -8c8³. -8c8m. -8c8n. -8c8ñ. -8c8p. -8c8r. -8c8s. -8c8¶. -8c8t. -8c8v. -8c8w. -8c8x. -8c8z. -8c8z8t. -8c8¼. -8c8¿. -8æ. -8æ8b. -8æ8c. -8æ8æ. -8æ8d. -8æ8f. -8æ8g. -8æ8h. -8æ8j. -8æ8k. -8æ8l. -8æ8³. -8æ8m. -8æ8n. -8æ8ñ. -8æ8p. -8æ8r. -8æ8s. -8æ8¶. -8æ8t. -8æ8v. -8æ8w. -8æ8x. -8æ8z. -8æ8¼. -8æ8¿. -8d. -8d8b. -8d8c. -8d8æ. -8d8d. -8d8f. -8d8g. -8d8h. -8d8j. -8d8k. -8d8l. -8d8³. -8d8m. -8d8n. -8d8ñ. -8d8p. -8d8r. -dr4z -8d8r8z. -8d8s. -8d8¶. -8d8t. -8d8v. -8d8w. -8d8x. -8d8z. -8d8¼. -8d8¿. -8f. -8f8b. -8f8c. -8f8æ. -8f8d. -8f8f. -8f8g. -8f8h. -8f8j. -8f8k. -8f8l. -8f8³. -8f8m. -8f8n. -8f8ñ. -8f8p. -8f8r. -8f8s. -8f8¶. -8f8t. -8f8v. -8f8w. -8f8x. -8f8z. -8f8¼. -8f8¿. -8g. -8g8b. -8g8c. -8g8æ. -8g8d. -8g8f. -8g8g. -8g8h. -8g8j. -8g8k. -8g8l. -8g8³. -8g8m. -8g8n. -8g8ñ. -8g8p. -8g8r. -8g8s. -8g8¶. -8g8t. -8g8v. -8g8w. -8g8x. -8g8z. -8g8¼. -8g8¿. -8h. -8h8b. -8h8c. -8h8æ. -8h8d. -8h8f. -8h8g. -8h8h. -8h8j. -8h8k. -8h8l. -8h8³. -8h8m. -8h8n. -8h8ñ. -8h8p. -8h8r. -8h8s. -8h8¶. -8h8t. -8h8v. -8h8w. -8h8x. -8h8z. -8h8¼. -8h8¿. -8j. -8j8b. -8j8c. -8j8æ. -8j8d. -8j8f. -8j8g. -8j8h. -8j8j. -8j8k. -8j8l. -8j8³. -8j8m. -8j8n. -8j8ñ. -8j8p. -8j8r. -8j8s. -8j8¶. -8j8t. -8j8v. -8j8w. -8j8x. -8j8z. -8j8¼. -8j8¿. -8k. -8k8b. -8k8c. -8k8æ. -8k8d. -8k8f. -8k8g. -8k8h. -8k8j. -8k8k. -8k8l. -8k8³. -8k8m. -8k8n. -8k8ñ. -8k8p. -8k8r. -8k8s. -8k8s8t. -8k8¶. -8k8t. -8k8v. -8k8w. -8k8x. -8k8z. -8k8¼. -8k8¿. -8l. -8l8b. -8l8c. -8l8æ. -8l8d. -8l8f. -8l8g. -8l8h. -8l8j. -8l8k. -8l8l. -8l8³. -8l8m. -8l8n. -8l8ñ. -8l8p. -8l8r. -8l8s. -8l8¶. -8l8t. -8l8v. -8l8w. -8l8x. -8l8z. -8l8¼. -8l8¿. -8³. -8³8b. -8³8c. -8³8æ. -8³8d. -8³8f. -8³8g. -8³8h. -8³8j. -8³8k. -8³8l. -8³8³. -8³8m. -8³8n. -8³8ñ. -8³8p. -8³8r. -8³8s. -8³8¶. -8³8t. -8³8v. -8³8w. -8³8x. -8³8z. -8³8¼. -8³8¿. -8m. -8m8b. -8m8c. -8m8æ. -8m8d. -8m8f. -8m8g. -8m8h. -8m8j. -8m8k. -8m8l. -8m8³. -8m8m. -8m8n. -8m8ñ. -8m8p. -8m8r. -8m8s. -8m8s8t. -8m8¶. -8m8t. -8m8v. -8m8w. -8m8x. -8m8z. -8m8¼. -8m8¿. -8n. -8n8b. -8n8c. -8n8æ. -8n8d. -8n8f. -8n8g. -8n8h. -8n8j. -8n8k. -8n8l. -8n8³. -8n8m. -8n8n. -8n8ñ. -8n8p. -8n8r. -8n8s. -8n8¶. -8n8t. -8n8v. -8n8w. -8n8x. -8n8z. -8n8¼. -8n8¿. -8ñ. -8ñ8b. -8ñ8c. -8ñ8æ. -8ñ8d. -8ñ8f. -8ñ8g. -8ñ8h. -8ñ8j. -8ñ8k. -8ñ8l. -8ñ8³. -8ñ8m. -8ñ8n. -8ñ8ñ. -8ñ8p. -8ñ8r. -8ñ8s. -8ñ8¶. -8ñ8t. -8ñ8v. -8ñ8w. -8ñ8x. -8ñ8z. -8ñ8¼. -8ñ8¿. -8p. -8p8b. -8p8c. -8p8æ. -8p8d. -8p8f. -8p8g. -8p8h. -8p8j. -8p8k. -8p8l. -8p8³. -8p8m. -8p8n. -8p8ñ. -8p8p. -8p8r. -pr4z -8p8r8z. -8p8s. -8p8¶. -8p8t. -8p8v. -8p8w. -8p8x. -8p8z. -8p8¼. -8p8¿. -8r. -8r8b. -8r8c. -8r8æ. -8r8d. -8r8f. -8r8g. -8r8h. -8r8j. -8r8k. -8r8l. -8r8³. -8r8m. -8r8n. -8r8ñ. -8r8p. -8r8r. -8r8s. -rs4z -8r8s8z. -8r8¶. -8r8t. -8r8v. -8r8w. -8r8x. -8r8z. -8r8z8³. -8r8¼. -8r8¿. -8s. -8s8b. -8s8c. -sc4h -8s8c8h. -8s8æ. -8s8d. -8s8f. -8s8g. -8s8h. -8s8j. -8s8k. -skr4z -8sk8r8z. -8s8l. -8s8³. -8s8m. -8s8n. -8s8ñ. -8s8p. -8s8r. -8s8s. -8s8¶. -8s8t. -8s8t8r. -str4z -8s8t8r8z. -8s8t8w. -8s8v. -8s8w. -8s8x. -8s8z. -szc4z -8sz8c8z. -sz2cz1b -8szc8z8b. -8s8z8k. -8s8z8n. -8s8z8t. -8sz8t8r. -8s8¼. -8s8¿. -8¶. -8¶8b. -8¶8c. -8¶8æ. -8¶8d. -8¶8f. -8¶8g. -8¶8h. -8¶8j. -8¶8k. -8¶8l. -8¶8³. -8¶8m. -8¶8n. -8¶8ñ. -8¶8p. -8¶8r. -8¶8s. -8¶8¶. -8¶8t. -8¶8v. -8¶8w. -8¶8x. -8¶8z. -8¶8¼. -8¶8¿. -8t. -8t8b. -8t8c. -8t8æ. -8t8d. -8t8f. -8t8g. -8t8h. -8t8j. -8t8k. -8t8l. -8t8³. -8t8m. -8t8n. -8t8ñ. -8t8p. -8t8r. -8t8r8z. -8t8s. -8t8¶. -8t8t. -8t8v. -8t8w. -8t8x. -8t8z. -8t8¼. -8t8¿. -8v. -8v8b. -8v8c. -8v8æ. -8v8d. -8v8f. -8v8g. -8v8h. -8v8j. -8v8k. -8v8l. -8v8³. -8v8m. -8v8n. -8v8ñ. -8v8p. -8v8r. -8v8s. -8v8¶. -8v8t. -8v8v. -8v8w. -8v8x. -8v8z. -8v8¼. -8v8¿. -8w. -8w8b. -8w8c. -8w8æ. -8w8d. -8w8f. -8w8g. -8w8h. -8w8j. -8w8k. -8w8l. -8w8³. -8w8m. -8w8n. -8w8ñ. -8w8p. -8w8r. -8w8s. -8w8¶. -8w8t. -8w8v. -8w8w. -8w8x. -8w8z. -8w8¼. -8w8¿. -8x. -8x8b. -8x8c. -8x8æ. -8x8d. -8x8f. -8x8g. -8x8h. -8x8j. -8x8k. -8x8l. -8x8³. -8x8m. -8x8n. -8x8ñ. -8x8p. -8x8r. -8x8s. -8x8¶. -8x8t. -8x8v. -8x8w. -8x8x. -8x8z. -8x8¼. -8x8¿. -8z. -8z8b. -8z8c. -8z8æ. -8z8d. -8z8d8r. -zdr4z -8z8d8r8z. -8z8f. -8z8g. -8z8h. -8z8j. -8z8k. -8z8l. -8z8³. -8z8m. -8z8n. -8z8ñ. -8z8p. -8z8r. -8z8s. -8z8¶. -8z8t. -8z8v. -8z8w. -8z8x. -8z8z. -8z8¼. -8z8¿. -8¼. -8¼8b. -8¼8c. -8¼8æ. -8¼8d. -8¼8f. -8¼8g. -8¼8h. -8¼8j. -8¼8k. -8¼8l. -8¼8³. -8¼8m. -8¼8n. -8¼8ñ. -8¼8p. -8¼8r. -8¼8s. -8¼8¶. -8¼8t. -8¼8v. -8¼8w. -8¼8x. -8¼8z. -8¼8¼. -8¼8¿. -8¿. -8¿8b. -8¿8c. -8¿8æ. -8¿8d. -8¿8f. -8¿8g. -8¿8h. -8¿8j. -8¿8k. -8¿8l. -8¿8³. -8¿8m. -8¿8n. -8¿8ñ. -8¿8p. -8¿8r. -8¿8s. -8¿8¶. -8¿8t. -8¿8v. -8¿8w. -8¿8x. -8¿8z. -8¿8¼. -8¿8¿. -a1 -a2u1 -a2y1 -a1a2 -ae2 -ai2 -ao2 -±1 -be1 -be1e2 -be2eth -be2f3s4z2 -be1khe1 -be2k1he2n1d -bi1 -bino1 -bi2n3o2ku1 -bis4z -bi2s2z1k -biszko1 -bi2sz3kop -bizne1 -bi2z3nes -bi2z3ne2s3m -bi2r1m -bi1rmi1 -birmi2n1g -birmingha1 -birmin2g1ham -blo1 -blokha1 -blokha2u1 -blo2k1hauz -bo1 -bo2s3ma1 -b2r2d -bro1 -broa2 -broa1dwa1 -bro2a2d3wa2y1 -bu1 -bus4z -bu2sz1m -bu2sz3me1 -bu2k1s -bu2k1s4z -buk2s2z1p -bukszpa1 -buk2sz3pan -busi1 -busine1 -busine2s2s -busine2ss3m -ca1 -ca2l1d -caldwe1 -cal2d1we4l3l -c2h2j -c2h2l -chu1 -chus1t -cu1 -cur4z -curzo1 -cu2r7zon -de1 -de2u1 -deu2t1s -deutsc4h -deutsc2h2l -deutschla1 -deut4sch3la2n1d -d2rz2w -du1 -dus4z -du2s2z1p -duszpa1 -du2sz3past -d2¿2j -d2¿2l -d2¿2³ -d2¿2r -d2¿2w -d¿e1 -d¿e4z3b -d¿e4z3m -e1 -er4z -erza1 -e2r5zac -e2u1 -e2y1 -e3u2s4z -ea2 -e1e2 -ei2 -eo2 -ê1 -fi1 -fisha1 -fi2s3ha2r1m -fis4z -fi1szbi1 -fi2sz3bin -fo1 -fo2k1s -fo2k2s3t -for4z -forza1 -fo2r5zac -fo2l1k -fo1lklo1 -fol2k1lor -fo2s1f -fosfa1 -fo1sfazo1 -fos2f1a2zot -ga1 -ga2d1g -gadge1 -ga3d2get -gado1 -gado2p1t -ga1do3p2ta1 -go1 -go2l1f -gol2f3s -golfs4z2 -gra1 -gra2n1d -grandi1 -gran2d1ilo1 -gro1 -gro4t3r -hi1 -his4z -hi2s2z3p -hu1 -huc4z -hu2cz1w -huxle1 -hu2x3le2y1 -i1 -i2a1 -i2±1 -i2e1 -i2ê1 -i2i1 -i2o1 -i2ó1 -i2u1 -i2y1 -i4n3n -in2n1s -inn2s1b -innsbru1 -in4nsbru2c1k -i2n1s -in2s1b -insbru1 -in4sbruc -j2t1³ -j2t1r -ja1 -ja4z3z -ja4z4z3b -ja4z4z3m -ka1 -ka2r1l -kar2l1s -karlskro1 -karl2s1kron -karlsru1 -karl2s1ruhe1 -ki1 -ki2r1c -kirc4h -kirc4h3h -kirchho1 -kir2chho4f3f -ko1 -ko2n1g -kongre1 -kongre2s3m -le1 -led1w -lu1 -luftwa1 -luftwa4f3f -lu2ft3waffe1 -lu2k1s -luk2s1f -luksfe1 -lu2ks1fer -ly1 -ly2o2 -ma1 -mar4z -ma2r5z1l -ma2r5z1³ -ma2r5z1n -mi1 -mis4z -mi2sz1m -miszma1 -mi2s4z1mas4z -mi2e1 -mier4z -mi1e2r5zi1 -mie2r5z1³ -mo1 -mo2n1t -montre1 -montrea2 -mon2t3real -moza1 -mozai2 -moza2i3k -mu1 -mur4z -murza1 -murzasi1 -murzasic4h -mu2r7zasic2h3l -na1 -na2³1k -na³ko1 -na4³3ko2w1s -na4r3v -o1 -o2y1 -oa2 -oc4h -o2c2h1m -ochmi1 -och3mistr4z -oe2 -o4f3f -offse1 -of2f3set -oi2 -o1o2 -ou2 -ó1 -ó2w1c -ó4w3c4z -pa1 -pa1na1 -paname1 -pa2n3a2mer -pa1sca1 -pa2s3cal -pa2s3c4h -po1 -po2d1n -podni1 -podni2e1 -po3d4niepr4z -po2m1n -po3m2n±1 -po3m2nê1 -po3m2ni1 -po2r1t -por2t1s -po1rtsmo1 -portsmou2 -po4rt2s3mo2uth -portla1 -po4rt3la2n1d -poli1 -poli2e1 -poli3e2t -poli2u1 -poli3u2re1 -po³u1 -po³u2d1n -po³u3d2ni1 -po2w1s -pows4z -powsze1 -powsze2d1n -powsze3d2ni1 -p2r1c -prc4h -prcha1 -pr2chal -pre1 -pres4z -pre2s2z1p -pre2sz3pa1 -ro1 -roe2 -roe2n1t -roen2t1g -roe1ntge1 -ro2e3nt2gen -ro1kro1 -ro2k3roc4z -ro1sto1 -ro2s3to3c2k -se1 -se2t3le1 -sko1 -skor4z -sko1rzo1 -skorzone1 -sko2r5zoner -s2m2r -so1 -sowi1 -sowi3z2 -sy1 -syno1 -sy2n3o2p1t -syste1 -sy2s1tem -sza1 -s4zas4z -sza2sz1³y1 -sze1 -szezlo1 -sze2z1lo2n1g -sze4¶æ -szto1 -szto1kho1 -szto2k1ho2l1m -szy1 -szy2n1k -szynkwa1 -szyn2k1was -to1 -to2y1 -to1yo2 -to3y2o3t -tu1 -tu2r1b -turbo1 -turbo1o2 -turboodr4z -tu1rboodrzu1 -turboo2d3rzut -ty1 -tygo1 -tygo2d1n -tygo3d2ni1 -u1 -u2y1 -ua2 -ue2 -ui2 -uo2 -u1u2 -vo1 -vo2l1k -vo2l2k2s3 -we1 -we1e2 -we1e1ke1 -we2e2k1e2n1d -we4s2t3f -we4s2t3m -y1 -ya2 -ye2 -yi2 -yo2 -yu2 -ze1 -ze4p3p -¼2d4¼ -.by1 -.byna1 -.byna2j1m -.bynaj2m1n -.bynajmni1 -.bynajmni2e1 -.by9naj9m8nie8j. -.bezac4h -.be9z8a8c8h. -.bezami1 -.be9z8ami. -.gd4z -.gdzi1 -.gdzi2e1 -.gdzi1eni1 -.gdzi2e1ni2e1 -.2g1dzienie2g1d -.gd4zieniegd4z -.gdzi1eni1egdzi1 -.gdzi2e1ni2e1gdzi2e1 -.gdzienie9g8dzie. -.ina1 -.inac4z -.inacze1 -.in8a9cze8j. -.n8a9da8l. -.ni2g1d -.nigdy1 -.n8i9gdy. -.nigd4z -.ni1gdzi1 -.nigdzi2e1 -.n8i9gdzie. -.nie2c2h1¿ -.nie1ch¿e1 -.nie8ch9¿e. -.nie2c2h1b -.niechby1 -.nie8ch9by. -.o2w1s -.ows4z -.owsze1 -.ow9sze8m. -.pó³a1 -.pó³ac4h -.pó9³8a8c8h. -.pó³ami1 -.pó9³8ami. -.pó9³8e8k. -.przyna1 -.przyna2j1m -.przynaj2m1n -.przynajmni1 -.przynajmni2e1 -.przy9naj9m8nie8j. -.sk±di1 -.sk±1din±1 -.sk±d9i8n±8d. -.trója1 -.trójac4h -.tró9j8a8c8h. -.trójami1 -.tró9j8ami. -.tró9j8e8k. -.podó2w1c -.podó4w3c4z -.podówcza1 -.podó3w2czas -.po8d9ó8w9cza8s. diff --git a/librarian/res/jedenprocent.png b/librarian/res/jedenprocent.png deleted file mode 100644 index 1b88c54..0000000 Binary files a/librarian/res/jedenprocent.png and /dev/null differ diff --git a/librarian/res/kmlu-logo-white.png b/librarian/res/kmlu-logo-white.png deleted file mode 100644 index 9850fd4..0000000 Binary files a/librarian/res/kmlu-logo-white.png and /dev/null differ diff --git a/librarian/res/mpv-logo-white.svg b/librarian/res/mpv-logo-white.svg deleted file mode 100644 index 826a7b4..0000000 --- a/librarian/res/mpv-logo-white.svg +++ /dev/null @@ -1,190 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/librarian/res/mpw-logo-white.png b/librarian/res/mpw-logo-white.png deleted file mode 100644 index e6ca31f..0000000 Binary files a/librarian/res/mpw-logo-white.png and /dev/null differ diff --git a/librarian/res/sponsors/nck.png b/librarian/res/sponsors/nck.png deleted file mode 100644 index e53f19c..0000000 Binary files a/librarian/res/sponsors/nck.png and /dev/null differ diff --git a/librarian/res/wl-logo-mono.png b/librarian/res/wl-logo-mono.png deleted file mode 100644 index c99447e..0000000 Binary files a/librarian/res/wl-logo-mono.png and /dev/null differ diff --git a/librarian/res/wl-logo-small.png b/librarian/res/wl-logo-small.png deleted file mode 100644 index b32c46d..0000000 Binary files a/librarian/res/wl-logo-small.png and /dev/null differ diff --git a/librarian/res/wl-logo-white.png b/librarian/res/wl-logo-white.png deleted file mode 100644 index 3a9e62a..0000000 Binary files a/librarian/res/wl-logo-white.png and /dev/null differ diff --git a/librarian/res/wl-logo.png b/librarian/res/wl-logo.png deleted file mode 100644 index 1194a1c..0000000 Binary files a/librarian/res/wl-logo.png and /dev/null differ diff --git a/librarian/sponsor.py b/librarian/sponsor.py deleted file mode 100644 index 1374cda..0000000 --- a/librarian/sponsor.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import unicode_literals - -from librarian import get_resource - - -def sponsor_logo(name): - return { - 'Narodowe Centrum Kultury': get_resource('res/sponsors/nck.png') - }.get(name.strip()) diff --git a/librarian/text.py b/librarian/text.py deleted file mode 100644 index 7ba6d29..0000000 --- a/librarian/text.py +++ /dev/null @@ -1,118 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import unicode_literals - -import copy -from librarian import functions, OutputFile -from lxml import etree -import os -import six - - -functions.reg_substitute_entities() -functions.reg_wrap_words() -functions.reg_strip() -functions.reg_person_name() - -TEMPLATE = u"""\ -%(text)s - - ------ -Ta lektura, podobnie jak tysiące innych, dostępna jest na stronie wolnelektury.pl. -Wersja lektury w opracowaniu merytorycznym i krytycznym (przypisy i motywy) dostępna jest na stronie %(url)s. - -Utwór opracowany został w ramach projektu Wolne Lektury przez fundację Nowoczesna Polska. - -%(license_description)s.%(source)s%(publisher)s - -%(description)s%(contributors)s%(funders)s%(isbn)s -""" - - -def transform(wldoc, flags=None, **options): - """ - Transforms input_file in XML to output_file in TXT. - possible flags: raw-text, - """ - # Parse XSLT - style_filename = os.path.join(os.path.dirname(__file__), 'xslt/book2txt.xslt') - style = etree.parse(style_filename) - - document = copy.deepcopy(wldoc) - del wldoc - document.swap_endlines() - - if flags: - for flag in flags: - document.edoc.getroot().set(flag, 'yes') - if 'wrapping' in options: - options['wrapping'] = str(options['wrapping']) - - result = document.transform(style, **options) - - if not flags or 'raw-text' not in flags: - if document.book_info: - parsed_dc = document.book_info - description = parsed_dc.description - url = document.book_info.url - - license_description = parsed_dc.license_description - license = parsed_dc.license - if license: - license_description = u"Ten utwór jest udostępniony na licencji %s: \n%s" % ( - license_description, license) - else: - license_description = u"Ten utwór nie jest objęty majątkowym prawem autorskim i znajduje się " \ - u"w domenie publicznej, co oznacza że możesz go swobodnie wykorzystywać, " \ - u"publikować i rozpowszechniać. Jeśli utwór opatrzony jest dodatkowymi " \ - u"materiałami (przypisy, motywy literackie etc.), które podlegają prawu " \ - u"autorskiemu, to te dodatkowe materiały udostępnione są na licencji " \ - u"Creative Commons Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL " \ - u"(http://creativecommons.org/licenses/by-sa/3.0/)" - - source = parsed_dc.source_name - if source: - source = "\n\nTekst opracowany na podstawie: " + source - else: - source = '' - - contributors = ', '.join(person.readable() for person in - sorted(set(p for p in (parsed_dc.technical_editors + parsed_dc.editors) if p))) - if contributors: - contributors = "\n\nOpracowanie redakcyjne i przypisy: %s." % contributors - funders = ', '.join(parsed_dc.funders) - if funders: - funders = u"\n\nPublikację wsparli i wsparły: %s." % funders - publisher = '\n\nWydawca: ' + ', '.join(parsed_dc.publisher) - isbn = getattr(parsed_dc, 'isbn_txt', None) - if isbn: - isbn = '\n\n' + isbn - else: - isbn = '' - else: - description = 'Publikacja zrealizowana w ramach projektu Wolne Lektury (http://wolnelektury.pl).' - url = '*' * 10 - license_description = "" - source = "" - contributors = "" - funders = "" - publisher = "" - isbn = "" - result = (TEMPLATE % { - 'description': description, - 'url': url, - 'license_description': license_description, - 'text': six.text_type(result), - 'source': source, - 'contributors': contributors, - 'funders': funders, - 'publisher': publisher, - 'isbn': isbn, - }).encode('utf-8') - else: - result = six.text_type(result).encode('utf-8') - return OutputFile.from_bytes(b"\r\n".join(result.splitlines()) + b"\r\n") diff --git a/librarian/util.py b/librarian/util.py deleted file mode 100644 index c302084..0000000 --- a/librarian/util.py +++ /dev/null @@ -1,126 +0,0 @@ -# Functions to convert between integers and Roman numerals. Doctest examples included. -# by Paul Winkler -# http://code.activestate.com/recipes/81611-roman-numerals/ -# PSFL (GPL compatible) -from __future__ import print_function, unicode_literals - -import os - - -def int_to_roman(input): - """ - Convert an integer to Roman numerals. - - Examples: - >>> int_to_roman(0) - Traceback (most recent call last): - ValueError: Argument must be between 1 and 3999 - - >>> int_to_roman(-1) - Traceback (most recent call last): - ValueError: Argument must be between 1 and 3999 - - >>> int_to_roman(1.5) # doctest: +IGNORE_EXCEPTION_DETAIL - Traceback (most recent call last): - TypeError: expected integer, got - - >>> for i in range(1, 21): print(int_to_roman(i)) - ... - I - II - III - IV - V - VI - VII - VIII - IX - X - XI - XII - XIII - XIV - XV - XVI - XVII - XVIII - XIX - XX - >>> print(int_to_roman(2000)) - MM - >>> print(int_to_roman(1999)) - MCMXCIX - """ - if type(input) != type(1): - raise TypeError("expected integer, got %s" % type(input)) - if not 0 < input < 4000: - raise ValueError("Argument must be between 1 and 3999") - ints = (1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1) - nums = ('M', 'CM', 'D', 'CD','C', 'XC','L','XL','X','IX','V','IV','I') - result = "" - for i in range(len(ints)): - count = int(input / ints[i]) - result += nums[i] * count - input -= ints[i] * count - return result - -def roman_to_int(input): - """ - Convert a roman numeral to an integer. - - >>> r = list(range(1, 4000)) - >>> nums = [int_to_roman(i) for i in r] - >>> ints = [roman_to_int(n) for n in nums] - >>> print(r == ints) - 1 - - >>> roman_to_int('VVVIV') - Traceback (most recent call last): - ... - ValueError: input is not a valid roman numeral: VVVIV - >>> roman_to_int(1) # doctest: +IGNORE_EXCEPTION_DETAIL - Traceback (most recent call last): - ... - TypeError: expected string, got - >>> roman_to_int('a') - Traceback (most recent call last): - ... - ValueError: input is not a valid roman numeral: A - >>> roman_to_int('IL') - Traceback (most recent call last): - ... - ValueError: input is not a valid roman numeral: IL - """ - if type(input) != type(""): - raise TypeError("expected string, got %s" % type(input)) - input = input.upper() - nums = ['M', 'D', 'C', 'L', 'X', 'V', 'I'] - ints = [1000, 500, 100, 50, 10, 5, 1] - places = [] - for c in input: - if not c in nums: - raise ValueError("input is not a valid roman numeral: %s" % input) - for i in range(len(input)): - c = input[i] - value = ints[nums.index(c)] - # If the next place holds a larger number, this value is negative. - try: - nextvalue = ints[nums.index(input[i +1])] - if nextvalue > value: - value *= -1 - except IndexError: - # there is no next place. - pass - places.append(value) - sum = 0 - for n in places: sum += n - # Easiest test for validity... - if int_to_roman(sum) == input: - return sum - else: - raise ValueError('input is not a valid roman numeral: %s' % input) - - -def makedirs(path): - if not os.path.isdir(path): - os.makedirs(path) diff --git a/librarian/xslt/book2html.xslt b/librarian/xslt/book2html.xslt deleted file mode 100644 index 7d2d6b5..0000000 --- a/librarian/xslt/book2html.xslt +++ /dev/null @@ -1,464 +0,0 @@ - - - - - - - - - - - - Książka z serwisu WolneLektury.pl - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    -

    Przypisy

    - -
    - fn- - - [] - - -

    - [przypis autorski] - [przypis tłumacza] - [przypis redakcyjny] - [przypis edytorski] -

    -
    - - - -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - -

    - - -

    -
    - -
    - - - - - - - -
    -
    - - - -
    -

    -
      - -
    -
    -
    - - -
    -
    - - -
    -
    - - -
    - -
    -
    - - -
    -
    - - - -
    -
    - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -
    - - -
    - -
    -
    - - - -

    -
    - - -
    - -
    -
    - - - -

    -
    - - -
    - -
    -
    - - - - -

    -
    - - - -
    -
    - - -
  • -
    - - -

    - - -

    -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - - - padding-left: 1em - - - - - padding-left: em - - - padding-left: 1em - - - - - padding-left: 12em - - - text-align: right - - - -
    -
    - - - -

    -
    - - - - - -
    - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - [] - - - - - - - - - - - - - - - - - - „” - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - -

    *

    -
    - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    - - - - - - tłum. - - , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/librarian/xslt/book2txt.xslt b/librarian/xslt/book2txt.xslt deleted file mode 100644 index 4175e96..0000000 --- a/librarian/xslt/book2txt.xslt +++ /dev/null @@ -1,391 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/ / - - - - - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -„” - - - -** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -* - - - - - - - ------------------------------------------------- - - - - - - - - - - - - - - - - - - - - tłum. - - - , - - - - - - - - - - - - -ISBN - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/librarian/xslt/config.xml b/librarian/xslt/config.xml deleted file mode 100644 index 9eaa34e..0000000 --- a/librarian/xslt/config.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    diff --git a/librarian/xslt/wl2html_base.xslt b/librarian/xslt/wl2html_base.xslt deleted file mode 100644 index 3341658..0000000 --- a/librarian/xslt/wl2html_base.xslt +++ /dev/null @@ -1,363 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - editable - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - - - - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Uwaga! Tekst poza paragrafem

    -

    ##

    -
    -
    -
    -
    - - - - - - - - - -
    - -
    - - - - diff --git a/librarian/xslt/wl2html_full.xslt b/librarian/xslt/wl2html_full.xslt deleted file mode 100644 index 30381c3..0000000 --- a/librarian/xslt/wl2html_full.xslt +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - -
    - - - - - - - - - - -
    -
    - -
    \ No newline at end of file diff --git a/librarian/xslt/wl2html_partial.xslt b/librarian/xslt/wl2html_partial.xslt deleted file mode 100644 index 0e5e27b..0000000 --- a/librarian/xslt/wl2html_partial.xslt +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/setup.py b/setup.py index 9b43f50..53cc182 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ # import os import os.path -from setuptools import setup +from setuptools import setup, find_packages def whole_tree(prefix, path): files = [] @@ -28,10 +28,11 @@ setup( maintainer='Radek Czajka', maintainer_email='radoslaw.czajka@nowoczesnapolska.org.pl', url='http://github.com/fnp/librarian', - packages=['librarian', 'librarian.embeds'], + packages=find_packages(where="src"), + package_dir={"": "src"}, package_data={'librarian': ['xslt/*.xslt', 'xslt/*.xml', 'epub/*', 'pdf/*', 'fb2/*', 'fonts/*'] + - whole_tree(os.path.join(os.path.dirname(__file__), 'librarian'), 'res') + - whole_tree(os.path.join(os.path.dirname(__file__), 'librarian'), 'font-optimizer')}, + whole_tree(os.path.join(os.path.dirname(__file__), 'src/librarian'), 'res') + + whole_tree(os.path.join(os.path.dirname(__file__), 'src/librarian'), 'font-optimizer')}, include_package_data=True, install_requires=[ 'lxml>=2.2,<=4.3', diff --git a/src/librarian/__init__.py b/src/librarian/__init__.py new file mode 100644 index 0000000..119b6b1 --- /dev/null +++ b/src/librarian/__init__.py @@ -0,0 +1,279 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import print_function, unicode_literals + +import os +import re +import shutil +from tempfile import NamedTemporaryFile +import urllib +from lxml import etree +import six +from six.moves.urllib.request import FancyURLopener +from .util import makedirs + + +@six.python_2_unicode_compatible +class UnicodeException(Exception): + def __str__(self): + """ Dirty workaround for Python Unicode handling problems. """ + args = self.args[0] if len(self.args) == 1 else self.args + try: + message = six.text_type(args) + except UnicodeDecodeError: + message = six.text_type(args, encoding='utf-8', errors='ignore') + return message + +class ParseError(UnicodeException): + pass + +class ValidationError(UnicodeException): + pass + +class NoDublinCore(ValidationError): + """There's no DublinCore section, and it's required.""" + pass + +class NoProvider(UnicodeException): + """There's no DocProvider specified, and it's needed.""" + pass + +class XMLNamespace(object): + '''A handy structure to repsent names in an XML namespace.''' + + def __init__(self, uri): + self.uri = uri + + def __call__(self, tag): + return '{%s}%s' % (self.uri, tag) + + def __contains__(self, tag): + return tag.startswith('{' + str(self) + '}') + + def __repr__(self): + return 'XMLNamespace(%r)' % self.uri + + def __str__(self): + return '%s' % self.uri + +class EmptyNamespace(XMLNamespace): + def __init__(self): + super(EmptyNamespace, self).__init__('') + + def __call__(self, tag): + return tag + +# some common namespaces we use +XMLNS = XMLNamespace('http://www.w3.org/XML/1998/namespace') +RDFNS = XMLNamespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#') +DCNS = XMLNamespace('http://purl.org/dc/elements/1.1/') +XINS = XMLNamespace("http://www.w3.org/2001/XInclude") +XHTMLNS = XMLNamespace("http://www.w3.org/1999/xhtml") +NCXNS = XMLNamespace("http://www.daisy.org/z3986/2005/ncx/") +OPFNS = XMLNamespace("http://www.idpf.org/2007/opf") +PLMETNS = XMLNamespace("http://dl.psnc.pl/schemas/plmet/") + +WLNS = EmptyNamespace() + + +@six.python_2_unicode_compatible +class WLURI(object): + """Represents a WL URI. Extracts slug from it.""" + slug = None + + example = 'http://wolnelektury.pl/katalog/lektura/template/' + _re_wl_uri = re.compile(r'http://(www\.)?wolnelektury.pl/katalog/lektur[ay]/' + '(?P[-a-z0-9]+)/?$') + + def __init__(self, uri): + uri = six.text_type(uri) + self.uri = uri + self.slug = uri.rstrip('/').rsplit('/', 1)[-1] + + @classmethod + def strict(cls, uri): + match = cls._re_wl_uri.match(uri) + if not match: + raise ValidationError(u'Invalid URI (%s). Should match: %s' % ( + uri, cls._re_wl_uri.pattern)) + return cls(uri) + + @classmethod + def from_slug(cls, slug): + """Contructs an URI from slug. + + >>> print(WLURI.from_slug('a-slug').uri) + http://wolnelektury.pl/katalog/lektura/a-slug/ + + """ + uri = 'http://wolnelektury.pl/katalog/lektura/%s/' % slug + return cls(uri) + + def __str__(self): + return self.uri + + def __eq__(self, other): + return self.slug == other.slug + + +class DocProvider(object): + """Base class for a repository of XML files. + + Used for generating joined files, like EPUBs. + """ + + def by_slug(self, slug): + """Should return a file-like object with a WL document XML.""" + raise NotImplementedError + + def by_uri(self, uri, wluri=WLURI): + """Should return a file-like object with a WL document XML.""" + wluri = wluri(uri) + return self.by_slug(wluri.slug) + + +class DirDocProvider(DocProvider): + """ Serve docs from a directory of files in form .xml """ + + def __init__(self, dir_): + self.dir = dir_ + self.files = {} + + def by_slug(self, slug): + fname = slug + '.xml' + return open(os.path.join(self.dir, fname), 'rb') + + +from . import dcparser + +DEFAULT_BOOKINFO = dcparser.BookInfo( + { RDFNS('about'): u'http://wiki.wolnepodreczniki.pl/Lektury:Template'}, + { DCNS('creator'): [u'Some, Author'], + DCNS('title'): [u'Some Title'], + DCNS('subject.period'): [u'Unknown'], + DCNS('subject.type'): [u'Unknown'], + DCNS('subject.genre'): [u'Unknown'], + DCNS('date'): ['1970-01-01'], + DCNS('language'): [u'pol'], + # DCNS('date'): [creation_date], + DCNS('publisher'): [u"Fundacja Nowoczesna Polska"], + DCNS('description'): + [u"""Publikacja zrealizowana w ramach projektu + Wolne Lektury (http://wolnelektury.pl). Reprodukcja cyfrowa + wykonana przez Bibliotekę Narodową z egzemplarza + pochodzącego ze zbiorów BN."""], + DCNS('identifier.url'): [WLURI.example], + DCNS('rights'): + [u"Domena publiczna - zm. [OPIS STANU PRAWNEGO TEKSTU]"] }) + +def xinclude_forURI(uri): + e = etree.Element(XINS("include")) + e.set("href", uri) + return etree.tostring(e, encoding='unicode') + +def wrap_text(ocrtext, creation_date, bookinfo=DEFAULT_BOOKINFO): + """Wrap the text within the minimal XML structure with a DC template.""" + bookinfo.created_at = creation_date + + dcstring = etree.tostring(bookinfo.to_etree(), \ + method='xml', encoding='unicode', pretty_print=True) + + return u'\n' + dcstring + u'\n\n' + ocrtext + \ + u'\n\n' + + +def serialize_raw(element): + b = u'' + (element.text or '') + + for child in element.iterchildren(): + e = etree.tostring(child, method='xml', encoding='unicode', + pretty_print=True) + b += e + + return b + +SERIALIZERS = { + 'raw': serialize_raw, +} + +def serialize_children(element, format='raw'): + return SERIALIZERS[format](element) + +def get_resource(path): + return os.path.join(os.path.dirname(__file__), path) + + +class OutputFile(object): + """Represents a file returned by one of the converters.""" + + _bytes = None + _filename = None + + def __del__(self): + if self._filename: + os.unlink(self._filename) + + def __nonzero__(self): + return self._bytes is not None or self._filename is not None + + @classmethod + def from_bytes(cls, bytestring): + """Converter returns contents of a file as a string.""" + + instance = cls() + instance._bytes = bytestring + return instance + + @classmethod + def from_filename(cls, filename): + """Converter returns contents of a file as a named file.""" + + instance = cls() + instance._filename = filename + return instance + + def get_bytes(self): + """Get file's contents as a bytestring.""" + + if self._filename is not None: + with open(self._filename, 'rb') as f: + return f.read() + else: + return self._bytes + + def get_file(self): + """Get file as a file-like object.""" + + if self._bytes is not None: + return six.BytesIO(self._bytes) + elif self._filename is not None: + return open(self._filename, 'rb') + + def get_filename(self): + """Get file as a fs path.""" + + if self._filename is not None: + return self._filename + elif self._bytes is not None: + temp = NamedTemporaryFile(prefix='librarian-', delete=False) + temp.write(self._bytes) + temp.close() + self._filename = temp.name + return self._filename + else: + return None + + def save_as(self, path): + """Save file to a path. Create directories, if necessary.""" + + dirname = os.path.dirname(os.path.abspath(path)) + makedirs(dirname) + shutil.copy(self.get_filename(), path) + + +class URLOpener(FancyURLopener): + version = 'FNP Librarian (http://github.com/fnp/librarian)' +urllib._urlopener = URLOpener() diff --git a/src/librarian/book2anything.py b/src/librarian/book2anything.py new file mode 100755 index 0000000..948d9fd --- /dev/null +++ b/src/librarian/book2anything.py @@ -0,0 +1,139 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import print_function, unicode_literals + +import os.path +import optparse +import six +from librarian import DirDocProvider, ParseError +from librarian.parser import WLDocument +from librarian.cover import make_cover + + +class Option(object): + """Option for optparse. Use it like `optparse.OptionParser.add_option`.""" + def __init__(self, *names, **options): + self.names = names + self.options = options + + def add(self, parser): + parser.add_option(*self.names, **self.options) + + def name(self): + return self.options['dest'] + + def value(self, options): + return getattr(options, self.name()) + + +class Book2Anything(object): + """A class for creating book2... scripts. + + Subclass it for any format you want to convert to. + """ + format_name = None # Set format name, like "PDF". + ext = None # Set file extension, like "pdf". + uses_cover = False # Can it add a cover? + cover_optional = True # Only relevant if uses_cover + uses_provider = False # Does it need a DocProvider? + transform = None # Transform method. Uses WLDocument.as_{ext} by default. + parser_options = [] # List of Option objects for additional parser args. + transform_options = [] # List of Option objects for additional transform args. + transform_flags = [] # List of Option objects for supported transform flags. + + @classmethod + def run(cls): + # Parse commandline arguments + usage = """Usage: %%prog [options] SOURCE [SOURCE...] + Convert SOURCE files to %s format.""" % cls.format_name + + parser = optparse.OptionParser(usage=usage) + + parser.add_option('-v', '--verbose', action='store_true', dest='verbose', default=False, + help='print status messages to stdout') + parser.add_option('-d', '--make-dir', action='store_true', dest='make_dir', default=False, + help='create a directory for author and put the output file in it') + parser.add_option('-o', '--output-file', dest='output_file', metavar='FILE', + help='specifies the output file') + parser.add_option('-O', '--output-dir', dest='output_dir', metavar='DIR', + help='specifies the directory for output') + if cls.uses_cover: + if cls.cover_optional: + parser.add_option('-c', '--with-cover', action='store_true', dest='with_cover', default=False, + help='create default cover') + parser.add_option('-C', '--image-cache', dest='image_cache', metavar='URL', + help='prefix for image download cache' + + (' (implies --with-cover)' if cls.cover_optional else '')) + for option in cls.parser_options + cls.transform_options + cls.transform_flags: + option.add(parser) + + options, input_filenames = parser.parse_args() + + if len(input_filenames) < 1: + parser.print_help() + return 1 + + # Prepare additional args for parser. + parser_args = {} + for option in cls.parser_options: + parser_args[option.name()] = option.value(options) + # Prepare additional args for transform method. + transform_args = {} + for option in cls.transform_options: + transform_args[option.name()] = option.value(options) + # Add flags to transform_args, if any. + transform_flags = [flag.name() for flag in cls.transform_flags if flag.value(options)] + if transform_flags: + transform_args['flags'] = transform_flags + if options.verbose: + transform_args['verbose'] = True + # Add cover support, if any. + if cls.uses_cover: + if options.image_cache: + def cover_class(book_info, *args, **kwargs): + return make_cover(book_info, image_cache=options.image_cache, *args, **kwargs) + transform_args['cover'] = cover_class + elif not cls.cover_optional or options.with_cover: + transform_args['cover'] = make_cover + + # Do some real work + try: + for main_input in input_filenames: + if options.verbose: + print(main_input) + + if isinstance(main_input, six.binary_type): + main_input = main_input.decode('utf-8') + + # Where to find input? + if cls.uses_provider: + path, fname = os.path.realpath(main_input).rsplit('/', 1) + provider = DirDocProvider(path) + else: + provider = None + + # Where to write output? + if not (options.output_file or options.output_dir): + output_file = os.path.splitext(main_input)[0] + '.' + cls.ext + else: + output_file = options.output_file + + # Do the transformation. + doc = WLDocument.from_file(main_input, provider=provider, **parser_args) + transform = cls.transform + if transform is None: + transform = getattr(WLDocument, 'as_%s' % cls.ext) + output = transform(doc, **transform_args) + + doc.save_output_file(output, output_file, options.output_dir, options.make_dir, cls.ext) + + except ParseError as e: + print('%(file)s:%(name)s:%(message)s' % { + 'file': main_input, + 'name': e.__class__.__name__, + 'message': e + }) diff --git a/src/librarian/cover.py b/src/librarian/cover.py new file mode 100644 index 0000000..0f38ec3 --- /dev/null +++ b/src/librarian/cover.py @@ -0,0 +1,614 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import unicode_literals + +import re +from PIL import Image, ImageFont, ImageDraw, ImageFilter +from six import BytesIO +from librarian import get_resource, OutputFile, URLOpener + + +class Metric(object): + """Gets metrics from an object, scaling it by a factor.""" + def __init__(self, obj, scale): + self._obj = obj + self._scale = float(scale) + + def __getattr__(self, name): + src = getattr(self._obj, name) + if src and self._scale: + return type(src)(self._scale * src) + else: + return src + + +class TextBox(object): + """Creates an Image with a series of centered strings.""" + + SHADOW_X = 3 + SHADOW_Y = 3 + SHADOW_BLUR = 3 + + def __init__(self, max_width, max_height, padding_x=None, padding_y=None): + if padding_x is None: + padding_x = self.SHADOW_X + self.SHADOW_BLUR + if padding_y is None: + padding_y = self.SHADOW_Y + self.SHADOW_BLUR + + self.max_width = max_width + self.max_text_width = max_width - 2 * padding_x + self.padding_y = padding_y + self.height = padding_y + self.img = Image.new('RGBA', (max_width, max_height)) + self.draw = ImageDraw.Draw(self.img) + self.shadow_img = None + self.shadow_draw = None + + def skip(self, height): + """Skips some vertical space.""" + self.height += height + + def text(self, text, color='#000', font=None, line_height=20, + shadow_color=None): + """Writes some centered text.""" + text = re.sub(r'\s+', ' ', text) + if shadow_color: + if not self.shadow_img: + self.shadow_img = Image.new('RGBA', self.img.size) + self.shadow_draw = ImageDraw.Draw(self.shadow_img) + while text: + line = text + line_width = self.draw.textsize(line, font=font)[0] + while line_width > self.max_text_width: + parts = line.rsplit(' ', 1) + if len(parts) == 1: + line_width = self.max_text_width + break + line = parts[0] + line_width = self.draw.textsize(line, font=font)[0] + line = line.strip() + ' ' + + pos_x = (self.max_width - line_width) // 2 + + if shadow_color: + self.shadow_draw.text( + (pos_x + self.SHADOW_X, self.height + self.SHADOW_Y), + line, font=font, fill=shadow_color + ) + + self.draw.text((pos_x, self.height), line, font=font, fill=color) + self.height += line_height + # go to next line + text = text[len(line):] + + def image(self): + """Creates the actual Image object.""" + image = Image.new('RGBA', (self.max_width, + self.height + self.padding_y)) + if self.shadow_img: + shadow = self.shadow_img.filter(ImageFilter.BLUR) + image.paste(shadow, (0, 0), shadow) + image.paste(self.img, (0, 0), self.img) + else: + image.paste(self.img, (0, 0)) + return image + + +class Cover(object): + """Abstract base class for cover images generator.""" + width = 600 + height = 800 + background_color = '#fff' + background_img = None + + author_top = 100 + author_margin_left = 20 + author_margin_right = 20 + author_lineskip = 40 + author_color = '#000' + author_shadow = None + author_font_ttf = get_resource('fonts/DejaVuSerif.ttf') + author_font_size = 30 + + title_top = 100 + title_margin_left = 20 + title_margin_right = 20 + title_lineskip = 54 + title_color = '#000' + title_shadow = None + title_font_ttf = get_resource('fonts/DejaVuSerif.ttf') + title_font_size = 40 + + logo_bottom = None + logo_width = None + uses_dc_cover = False + + format = 'JPEG' + scale = 1 + scale_after = 1 + + exts = { + 'JPEG': 'jpg', + 'PNG': 'png', + } + + mime_types = { + 'JPEG': 'image/jpeg', + 'PNG': 'image/png', + } + + def __init__(self, book_info, format=None, width=None, height=None): + self.authors = [auth.readable() for auth in book_info.authors] + self.title = book_info.title + if format is not None: + self.format = format + if width and height: + self.height = int(round(height * self.width / width)) + scale = max(float(width or 0) / self.width, float(height or 0) / self.height) + if scale >= 1: + self.scale = scale + elif scale: + self.scale_after = scale + + def pretty_authors(self): + """Allows for decorating authors' names.""" + return [self.authors] + + def pretty_title(self): + """Allows for decorating title.""" + return self.title + + def image(self): + metr = Metric(self, self.scale) + img = Image.new('RGB', (metr.width, metr.height), self.background_color) + + if self.background_img: + background = Image.open(self.background_img) + img.paste(background, None, background) + del background + + # WL logo + if metr.logo_width: + logo = Image.open(get_resource('res/wl-logo.png')) + logo = logo.resize((metr.logo_width, int(round(logo.size[1] * metr.logo_width / logo.size[0])))) + img.paste(logo, ((metr.width - metr.logo_width) // 2, img.size[1] - logo.size[1] - metr.logo_bottom)) + + top = metr.author_top + tbox = TextBox( + metr.width - metr.author_margin_left - metr.author_margin_right, + metr.height - top, + ) + + author_font = ImageFont.truetype( + self.author_font_ttf, metr.author_font_size) + for pa in self.pretty_authors(): + tbox.text(pa, self.author_color, author_font, metr.author_lineskip, self.author_shadow) + text_img = tbox.image() + img.paste(text_img, (metr.author_margin_left, top), text_img) + + top += text_img.size[1] + metr.title_top + tbox = TextBox( + metr.width - metr.title_margin_left - metr.title_margin_right, + metr.height - top, + ) + title_font = ImageFont.truetype( + self.title_font_ttf, metr.title_font_size) + tbox.text(self.pretty_title(), self.title_color, title_font, metr.title_lineskip, self.title_shadow) + text_img = tbox.image() + img.paste(text_img, (metr.title_margin_left, top), text_img) + + return img + + def final_image(self): + img = self.image() + if self.scale_after != 1: + img = img.resize(( + int(round(img.size[0] * self.scale_after)), + int(round(img.size[1] * self.scale_after))), + Image.ANTIALIAS) + return img + + def mime_type(self): + return self.mime_types[self.format] + + def ext(self): + return self.exts[self.format] + + def save(self, *args, **kwargs): + default_kwargs = { + 'format': self.format, + 'quality': 95, + } + default_kwargs.update(kwargs) + return self.final_image().save(*args, **default_kwargs) + + def output_file(self, *args, **kwargs): + imgstr = BytesIO() + self.save(imgstr, *args, **kwargs) + return OutputFile.from_bytes(imgstr.getvalue()) + + +class WLCover(Cover): + """Wolne Lektury cover without logos.""" + width = 600 + height = 833 + uses_dc_cover = True + author_font_ttf = get_resource('fonts/JunicodeWL-Regular.ttf') + author_font_size = 20 + author_lineskip = 30 + title_font_ttf = get_resource('fonts/DejaVuSerif-Bold.ttf') + title_font_size = 30 + title_lineskip = 40 + title_box_width = 350 + + box_top_margin = 100 + box_bottom_margin = 100 + box_padding_y = 20 + box_above_line = 10 + box_below_line = 15 + box_line_left = 75 + box_line_right = 275 + box_line_width = 2 + + logo_top = 15 + logo_width = 140 + + bar_width = 35 + bar_color = '#000' + box_position = 'middle' + background_color = '#444' + author_color = '#444' + background_img = get_resource('res/cover.png') + format = 'JPEG' + + epoch_colors = { + u'Starożytność': '#9e3610', + u'Średniowiecze': '#564c09', + u'Renesans': '#8ca629', + u'Barok': '#a6820a', + u'Oświecenie': '#f2802e', + u'Romantyzm': '#db4b16', + u'Pozytywizm': '#961060', + u'Modernizm': '#7784e0', + u'Dwudziestolecie międzywojenne': '#3044cf', + u'Współczesność': '#06393d', + } + + kind_box_position = { + u'Liryka': 'top', + u'Epika': 'bottom', + } + + def __init__(self, book_info, format=None, width=None, height=None, bleed=0): + super(WLCover, self).__init__(book_info, format=format, width=width, height=height) + # Set box position. + self.box_position = book_info.cover_box_position or \ + self.kind_box_position.get(book_info.kind, self.box_position) + # Set bar color. + if book_info.cover_bar_color == 'none': + self.bar_width = 0 + else: + self.bar_color = book_info.cover_bar_color or \ + self.epoch_colors.get(book_info.epoch, self.bar_color) + # Set title color. + self.title_color = self.epoch_colors.get(book_info.epoch, self.title_color) + + self.bleed = bleed + self.box_top_margin += bleed + self.box_bottom_margin += bleed + self.bar_width += bleed + + if book_info.cover_url: + url = book_info.cover_url + bg_src = None + if bg_src is None: + bg_src = URLOpener().open(url) + self.background_img = BytesIO(bg_src.read()) + bg_src.close() + + def pretty_authors(self): + return [a.upper() for a in self.authors] + + def add_box(self, img): + if self.box_position == 'none': + return img + + metr = Metric(self, self.scale) + + # Write author name. + box = TextBox(metr.title_box_width, metr.height, padding_y=metr.box_padding_y) + author_font = ImageFont.truetype( + self.author_font_ttf, metr.author_font_size) + for pa in self.pretty_authors(): + box.text(pa, + font=author_font, + line_height=metr.author_lineskip, + color=self.author_color, + shadow_color=self.author_shadow) + + box.skip(metr.box_above_line) + box.draw.line((metr.box_line_left, box.height, metr.box_line_right, box.height), + fill=self.author_color, width=metr.box_line_width) + box.skip(metr.box_below_line) + + # Write title. + title_font = ImageFont.truetype( + self.title_font_ttf, metr.title_font_size) + box.text(self.pretty_title(), + line_height=metr.title_lineskip, + font=title_font, + color=self.title_color, + shadow_color=self.title_shadow) + + box_img = box.image() + + # Find box position. + if self.box_position == 'top': + box_top = metr.box_top_margin + elif self.box_position == 'bottom': + box_top = metr.height - metr.box_bottom_margin - box_img.size[1] + else: # Middle. + box_top = (metr.height - box_img.size[1]) // 2 + + box_left = metr.bar_width + (metr.width - metr.bar_width - box_img.size[0]) // 2 + + # Draw the white box. + ImageDraw.Draw(img).rectangle( + (box_left, box_top, box_left + box_img.size[0], box_top + box_img.size[1]), fill='#fff') + # Paste the contents into the white box. + img.paste(box_img, (box_left, box_top), box_img) + return img + + def add_cut_lines(self, img): + line_ratio = 0.5 + if self.bleed == 0: + return img + metr = Metric(self, self.scale) + draw = ImageDraw.Draw(img) + for corner_x, corner_y in ((0, 0), (metr.width, 0), (0, metr.height), (metr.width, metr.height)): + dir_x = 1 if corner_x == 0 else -1 + dir_y = 1 if corner_y == 0 else -1 + for offset in (-1, 0, 1): + draw.line((corner_x, corner_y + dir_y * metr.bleed + offset, + corner_x + dir_x * metr.bleed * line_ratio, corner_y + dir_y * metr.bleed + offset), + fill='black' if offset == 0 else 'white', width=1) + draw.line((corner_x + dir_x * metr.bleed + offset, corner_y, + corner_x + dir_x * metr.bleed + offset, corner_y + dir_y * metr.bleed * line_ratio), + fill='black' if offset == 0 else 'white', width=1) + return img + + def image(self): + metr = Metric(self, self.scale) + img = Image.new('RGB', (metr.width, metr.height), self.background_color) + draw = ImageDraw.Draw(img) + + draw.rectangle((0, 0, metr.bar_width, metr.height), fill=self.bar_color) + + if self.background_img: + src = Image.open(self.background_img) + trg_size = (metr.width - metr.bar_width, metr.height) + if src.size[0] * trg_size[1] < src.size[1] * trg_size[0]: + resized = ( + trg_size[0], + int(round(src.size[1] * trg_size[0] / src.size[0])) + ) + cut = (resized[1] - trg_size[1]) // 2 + src = src.resize(resized, Image.ANTIALIAS) + src = src.crop((0, cut, src.size[0], src.size[1] - cut)) + else: + resized = ( + int(round(src.size[0] * trg_size[1] / src.size[1])), + trg_size[1], + ) + cut = (resized[0] - trg_size[0]) // 2 + src = src.resize(resized, Image.ANTIALIAS) + src = src.crop((cut, 0, src.size[0] - cut, src.size[1])) + + img.paste(src, (metr.bar_width, 0)) + del src + + img = self.add_box(img) + + # img = self.add_cut_lines(img) + + return img + + +class WLNoBoxCover(WLCover): + def add_box(self, img): + return img + + +class LogoWLCover(WLCover): + gradient_height = 90 + gradient_logo_height = 60 + gradient_logo_margin_right = 30 + gradient_logo_spacing = 40 + gradient_color = '#000' + gradient_opacity = .6 + gradient_logos = [ + 'res/wl-logo-white.png', + 'res/fnp-logo-white.png', + ] + + def __init__(self, book_info, *args, **kwargs): + super(LogoWLCover, self).__init__(book_info, *args, **kwargs) + self.gradient_height += self.bleed + self.gradient_logo_margin_right += self.bleed + + self.additional_cover_logos = [ + BytesIO(URLOpener().open(cover_logo_url).read()) + for cover_logo_url in book_info.cover_logo_urls + ] + + def image(self): + img = super(LogoWLCover, self).image() + metr = Metric(self, self.scale) + gradient = Image.new('RGBA', (metr.width - metr.bar_width, metr.gradient_height), self.gradient_color) + gradient_mask = Image.new('L', (metr.width - metr.bar_width, metr.gradient_height)) + draw = ImageDraw.Draw(gradient_mask) + for line in range(0, metr.gradient_height): + draw.line( + (0, line, metr.width - metr.bar_width, line), + fill=int(255 * self.gradient_opacity * line / metr.gradient_height)) + img.paste(gradient, (metr.bar_width, metr.height - metr.gradient_height), mask=gradient_mask) + + cursor = metr.width - metr.gradient_logo_margin_right + logo_top = int(metr.height - metr.gradient_height / 2 - metr.gradient_logo_height / 2 - metr.bleed / 2) + + logos = [get_resource(logo_path) for logo_path in self.gradient_logos[::-1]] + logos = logos + self.additional_cover_logos + logos = [Image.open(logo_bytes).convert('RGBA') for logo_bytes in logos] + + # See if logos fit into the gradient. If not, scale down accordingly. + space_for_logos = metr.width - metr.bar_width - 2 * metr.gradient_logo_margin_right + widths = [logo.size[0] * metr.gradient_logo_height / logo.size[1] for logo in logos] + taken_space = sum(widths) + (len(logos) - 1) * (metr.gradient_logo_spacing) + logo_scale = space_for_logos / taken_space if taken_space > space_for_logos else 1 + logo_top += int(metr.gradient_logo_height * (1 - logo_scale) / 2) + + for i, logo in enumerate(logos): + logo = logo.resize( + ( + int(round(widths[i] * logo_scale)), + int(round(metr.gradient_logo_height * logo_scale)) + ), + Image.ANTIALIAS) + cursor -= logo.size[0] + img.paste(logo, (cursor, logo_top), mask=logo) + cursor -= int(round(metr.gradient_logo_spacing * logo_scale)) + + return img + + +class EbookpointCover(LogoWLCover): + gradient_logo_height = 58 + gradient_logo_spacing = 25 + gradient_logos = [ + 'res/ebookpoint-logo-white.png', + 'res/wl-logo-white.png', + 'res/fnp-logo-white.png', + ] + + +class VirtualoCover(Cover): + width = 600 + height = 730 + author_top = 73 + title_top = 73 + logo_bottom = 25 + logo_width = 250 + + +class PrestigioCover(Cover): + width = 580 + height = 783 + background_img = get_resource('res/cover-prestigio.png') + + author_top = 446 + author_margin_left = 118 + author_margin_right = 62 + author_lineskip = 60 + author_color = '#fff' + author_shadow = '#000' + author_font_ttf = get_resource('fonts/JunicodeWL-Italic.ttf') + author_font_size = 50 + + title_top = 0 + title_margin_left = 118 + title_margin_right = 62 + title_lineskip = 60 + title_color = '#fff' + title_shadow = '#000' + title_font_ttf = get_resource('fonts/JunicodeWL-Italic.ttf') + title_font_size = 50 + + def pretty_title(self): + return u"„%s”" % self.title + + +class BookotekaCover(Cover): + width = 2140 + height = 2733 + background_img = get_resource('res/cover-bookoteka.png') + + author_top = 480 + author_margin_left = 307 + author_margin_right = 233 + author_lineskip = 156 + author_color = '#d9d919' + author_font_ttf = get_resource('fonts/JunicodeWL-Regular.ttf') + author_font_size = 130 + + title_top = 400 + title_margin_left = 307 + title_margin_right = 233 + title_lineskip = 168 + title_color = '#d9d919' + title_font_ttf = get_resource('fonts/JunicodeWL-Regular.ttf') + title_font_size = 140 + + format = 'PNG' + + +class GandalfCover(Cover): + width = 600 + height = 730 + background_img = get_resource('res/cover-gandalf.png') + author_font_ttf = get_resource('fonts/JunicodeWL-Regular.ttf') + author_font_size = 30 + title_font_ttf = get_resource('fonts/JunicodeWL-Regular.ttf') + title_font_size = 40 + logo_bottom = 25 + logo_width = 250 + format = 'PNG' + + +class KMLUCover(LogoWLCover): + gradient_logo_height = 58 + gradient_logo_spacing = 25 + gradient_logos = [ + 'res/kmlu-logo-white.png', + 'res/wl-logo-white.png', + 'res/fnp-logo-white.png', + ] + + +class MPWCover(LogoWLCover): + gradient_logo_height = 58 + gradient_logo_spacing = 25 + gradient_logos = [ + 'res/mpw-logo-white.png', + 'res/wl-logo-white.png', + 'res/fnp-logo-white.png', + ] + + +class AtriumCover(LogoWLCover): + gradient_logo_height = 58 + gradient_logo_spacing = 25 + gradient_logos = [ + 'res/atrium-logo.png', + 'res/wl-logo-white.png', + 'res/fnp-logo-white.png', + ] + + +COVER_CLASSES = { + 'default': LogoWLCover, + 'kmlu': KMLUCover, + 'mpw': MPWCover, + 'atrium': AtriumCover, +} + + +def make_cover(book_info, *args, **kwargs): + if 'cover_class' in kwargs: + cover_class_name = kwargs.pop('cover_class') + else: + cover_class_name = book_info.cover_class + cover_class = COVER_CLASSES[cover_class_name] + return cover_class(book_info, *args, **kwargs) diff --git a/src/librarian/dcparser.py b/src/librarian/dcparser.py new file mode 100644 index 0000000..92afc01 --- /dev/null +++ b/src/librarian/dcparser.py @@ -0,0 +1,482 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import unicode_literals + +from xml.parsers.expat import ExpatError +from datetime import date +from functools import total_ordering +import time +import re +import six +from librarian.util import roman_to_int + +from librarian import (ValidationError, NoDublinCore, ParseError, DCNS, RDFNS, + XMLNS, WLURI, WLNS, PLMETNS) + +import lxml.etree as etree # ElementTree API using libxml2 +from lxml.etree import XMLSyntaxError + + +class TextPlus(six.text_type): + pass + + +class DatePlus(date): + pass + + +# ============== +# = Converters = +# ============== +@six.python_2_unicode_compatible +@total_ordering +class Person(object): + """Single person with last name and a list of first names.""" + def __init__(self, last_name, *first_names): + self.last_name = last_name + self.first_names = first_names + + @classmethod + def from_text(cls, text): + parts = [token.strip() for token in text.split(',')] + if len(parts) == 1: + surname = parts[0] + names = [] + elif len(parts) != 2: + raise ValueError("Invalid person name. There should be at most one comma: \"%s\"." % text.encode('utf-8')) + else: + surname = parts[0] + if len(parts[1]) == 0: + # there is no non-whitespace data after the comma + raise ValueError("Found a comma, but no names given: \"%s\" -> %r." % (text, parts)) + names = parts[1].split() + return cls(surname, *names) + + def readable(self): + return u" ".join(self.first_names + (self.last_name,)) + + def __eq__(self, right): + return self.last_name == right.last_name and self.first_names == right.first_names + + def __lt__(self, other): + return (self.last_name, self.first_names) < (other.last_name, other.first_names) + + def __hash__(self): + return hash((self.last_name, self.first_names)) + + def __str__(self): + if len(self.first_names) > 0: + return '%s, %s' % (self.last_name, ' '.join(self.first_names)) + else: + return self.last_name + + def __repr__(self): + return 'Person(last_name=%r, first_names=*%r)' % (self.last_name, self.first_names) + + +def as_date(text): + """Dates for digitization of pictures. It seems we need the following: +ranges: '1350-1450', +centuries: "XVIII w.' +half centuries/decades: '2 poł. XVIII w.', 'XVII w., l. 20' +later-then: 'po 1450' +circa 'ok. 1813-1814', 'ok.1876-ok.1886 +turn: 1893/1894 +for now we will translate this to some single date losing information of course. + """ + try: + # check out the "N. poł X w." syntax + if isinstance(text, six.binary_type): + text = text.decode("utf-8") + + century_format = u"(?:([12]) *poł[.]? +)?([MCDXVI]+) *w[.,]*(?: *l[.]? *([0-9]+))?" + vague_format = u"(?:po *|ok. *)?([0-9]{4})(-[0-9]{2}-[0-9]{2})?" + + m = re.match(century_format, text) + m2 = re.match(vague_format, text) + if m: + half = m.group(1) + decade = m.group(3) + century = roman_to_int(m.group(2)) + if half is not None: + if decade is not None: + raise ValueError("Bad date format. Cannot specify both half and decade of century") + half = int(half) + t = ((century*100 + (half-1)*50), 1, 1) + else: + decade = int(decade or 0) + t = ((century*100 + decade), 1, 1) + elif m2: + year = m2.group(1) + mon_day = m2.group(2) + if mon_day: + t = time.strptime(year + mon_day, "%Y-%m-%d") + else: + t = time.strptime(year, '%Y') + else: + raise ValueError + + return DatePlus(t[0], t[1], t[2]) + except ValueError as e: + raise ValueError("Unrecognized date format. Try YYYY-MM-DD or YYYY.") + + +def as_person(text): + return Person.from_text(text) + + +def as_unicode(text): + if isinstance(text, six.text_type): + return text + else: + return TextPlus(text.decode('utf-8')) + + +def as_wluri_strict(text): + return WLURI.strict(text) + + +class Field(object): + def __init__(self, uri, attr_name, validator=as_unicode, strict=None, multiple=False, salias=None, **kwargs): + self.uri = uri + self.name = attr_name + self.validator = validator + self.strict = strict + self.multiple = multiple + self.salias = salias + + self.required = kwargs.get('required', True) and 'default' not in kwargs + self.default = kwargs.get('default', [] if multiple else [None]) + + def validate_value(self, val, strict=False): + if strict and self.strict is not None: + validator = self.strict + else: + validator = self.validator + try: + if self.multiple: + if validator is None: + return val + new_values = [] + for v in val: + nv = v + if v is not None: + nv = validator(v) + if hasattr(v, 'lang'): + setattr(nv, 'lang', v.lang) + new_values.append(nv) + return new_values + elif len(val) > 1: + raise ValidationError("Multiple values not allowed for field '%s'" % self.uri) + elif len(val) == 0: + raise ValidationError("Field %s has no value to assign. Check your defaults." % self.uri) + else: + if validator is None or val[0] is None: + return val[0] + nv = validator(val[0]) + if hasattr(val[0], 'lang'): + setattr(nv, 'lang', val[0].lang) + return nv + except ValueError as e: + raise ValidationError("Field '%s' - invald value: %s" % (self.uri, e.message)) + + def validate(self, fdict, fallbacks=None, strict=False): + if fallbacks is None: + fallbacks = {} + if self.uri not in fdict: + if not self.required: + # Accept single value for single fields and saliases. + if self.name in fallbacks: + if self.multiple: + f = fallbacks[self.name] + else: + f = [fallbacks[self.name]] + elif self.salias and self.salias in fallbacks: + f = [fallbacks[self.salias]] + else: + f = self.default + else: + raise ValidationError("Required field %s not found" % self.uri) + else: + f = fdict[self.uri] + + return self.validate_value(f, strict=strict) + + def __eq__(self, other): + if isinstance(other, Field) and other.name == self.name: + return True + return False + + +class DCInfo(type): + def __new__(mcs, classname, bases, class_dict): + fields = list(class_dict['FIELDS']) + + for base in bases[::-1]: + if hasattr(base, 'FIELDS'): + for field in base.FIELDS[::-1]: + try: + fields.index(field) + except ValueError: + fields.insert(0, field) + + class_dict['FIELDS'] = tuple(fields) + return super(DCInfo, mcs).__new__(mcs, classname, bases, class_dict) + + +class WorkInfo(six.with_metaclass(DCInfo, object)): + FIELDS = ( + Field(DCNS('creator'), 'authors', as_person, salias='author', multiple=True), + Field(DCNS('title'), 'title'), + Field(DCNS('type'), 'type', required=False, multiple=True), + + Field(DCNS('contributor.editor'), 'editors', + as_person, salias='editor', multiple=True, required=False), + Field(DCNS('contributor.technical_editor'), 'technical_editors', + as_person, salias='technical_editor', multiple=True, required=False), + Field(DCNS('contributor.funding'), 'funders', salias='funder', multiple=True, required=False), + Field(DCNS('contributor.thanks'), 'thanks', required=False), + + Field(DCNS('date'), 'created_at'), + Field(DCNS('date.pd'), 'released_to_public_domain_at', as_date, required=False), + Field(DCNS('publisher'), 'publisher', multiple=True), + + Field(DCNS('language'), 'language'), + Field(DCNS('description'), 'description', required=False), + + Field(DCNS('source'), 'source_name', required=False), + Field(DCNS('source.URL'), 'source_urls', salias='source_url', multiple=True, required=False), + Field(DCNS('identifier.url'), 'url', WLURI, strict=as_wluri_strict), + Field(DCNS('rights.license'), 'license', required=False), + Field(DCNS('rights'), 'license_description'), + + Field(PLMETNS('digitisationSponsor'), 'sponsors', multiple=True, required=False), + Field(WLNS('digitisationSponsorNote'), 'sponsor_note', required=False), + Field(WLNS('developmentStage'), 'stage', required=False), + ) + + @classmethod + def from_bytes(cls, xml, *args, **kwargs): + return cls.from_file(six.BytesIO(xml), *args, **kwargs) + + @classmethod + def from_file(cls, xmlfile, *args, **kwargs): + desc_tag = None + try: + iter = etree.iterparse(xmlfile, ['start', 'end']) + for (event, element) in iter: + if element.tag == RDFNS('RDF') and event == 'start': + desc_tag = element + break + + if desc_tag is None: + raise NoDublinCore("DublinCore section not found. \ + Check if there are rdf:RDF and rdf:Description tags.") + + # continue 'till the end of RDF section + for (event, element) in iter: + if element.tag == RDFNS('RDF') and event == 'end': + break + + # if there is no end, Expat should yell at us with an ExpatError + + # extract data from the element and make the info + return cls.from_element(desc_tag, *args, **kwargs) + except XMLSyntaxError as e: + raise ParseError(e) + except ExpatError as e: + raise ParseError(e) + + @classmethod + def from_element(cls, rdf_tag, *args, **kwargs): + # the tree is already parsed, so we don't need to worry about Expat errors + field_dict = {} + desc = rdf_tag.find(".//" + RDFNS('Description')) + + if desc is None: + raise NoDublinCore("There must be a '%s' element inside the RDF." % RDFNS('Description')) + + lang = None + p = desc + while p is not None and lang is None: + lang = p.attrib.get(XMLNS('lang')) + p = p.getparent() + + for e in desc.getchildren(): + fv = field_dict.get(e.tag, []) + if e.text is not None: + text = e.text + if not isinstance(text, six.text_type): + text = text.decode('utf-8') + val = TextPlus(text) + val.lang = e.attrib.get(XMLNS('lang'), lang) + if e.tag == 'meta': + meta_id = e.attrib.get('id') + if meta_id and meta_id.endswith('-id'): + field_dict[meta_id] = [val.replace('ISBN-', 'ISBN ')] + else: + val = e.text + fv.append(val) + field_dict[e.tag] = fv + + return cls(desc.attrib, field_dict, *args, **kwargs) + + def __init__(self, rdf_attrs, dc_fields, fallbacks=None, strict=False): + """rdf_attrs should be a dictionary-like object with any attributes of the RDF:Description. + dc_fields - dictionary mapping DC fields (with namespace) to list of text values for the + given field. """ + + self.about = rdf_attrs.get(RDFNS('about')) + self.fmap = {} + + for field in self.FIELDS: + value = field.validate(dc_fields, fallbacks=fallbacks, strict=strict) + setattr(self, 'prop_' + field.name, value) + self.fmap[field.name] = field + if field.salias: + self.fmap[field.salias] = field + + def __getattribute__(self, name): + try: + field = object.__getattribute__(self, 'fmap')[name] + value = object.__getattribute__(self, 'prop_'+field.name) + if field.name == name: + return value + else: # singular alias + if not field.multiple: + raise "OUCH!! for field %s" % name + + return value[0] if value else None + except (KeyError, AttributeError): + return object.__getattribute__(self, name) + + def __setattr__(self, name, newvalue): + try: + field = object.__getattribute__(self, 'fmap')[name] + if field.name == name: + object.__setattr__(self, 'prop_'+field.name, newvalue) + else: # singular alias + if not field.multiple: + raise "OUCH! while setting field %s" % name + + object.__setattr__(self, 'prop_'+field.name, [newvalue]) + except (KeyError, AttributeError): + return object.__setattr__(self, name, newvalue) + + def update(self, field_dict): + """Update using field_dict. Verify correctness, but don't check if all + required fields are present.""" + for field in self.FIELDS: + if field.name in field_dict: + setattr(self, field.name, field_dict[field.name]) + + def to_etree(self, parent=None): + """XML representation of this object.""" + # etree._namespace_map[str(self.RDF)] = 'rdf' + # etree._namespace_map[str(self.DC)] = 'dc' + + if parent is None: + root = etree.Element(RDFNS('RDF')) + else: + root = parent.makeelement(RDFNS('RDF')) + + description = etree.SubElement(root, RDFNS('Description')) + + if self.about: + description.set(RDFNS('about'), self.about) + + for field in self.FIELDS: + v = getattr(self, field.name, None) + if v is not None: + if field.multiple: + if len(v) == 0: + continue + for x in v: + e = etree.Element(field.uri) + if x is not None: + e.text = six.text_type(x) + description.append(e) + else: + e = etree.Element(field.uri) + e.text = six.text_type(v) + description.append(e) + + return root + + def serialize(self): + rdf = {'about': {'uri': RDFNS('about'), 'value': self.about}} + + dc = {} + for field in self.FIELDS: + v = getattr(self, field.name, None) + if v is not None: + if field.multiple: + if len(v) == 0: + continue + v = [six.text_type(x) for x in v if x is not None] + else: + v = six.text_type(v) + + dc[field.name] = {'uri': field.uri, 'value': v} + rdf['fields'] = dc + return rdf + + def to_dict(self): + result = {'about': self.about} + for field in self.FIELDS: + v = getattr(self, field.name, None) + + if v is not None: + if field.multiple: + if len(v) == 0: + continue + v = [six.text_type(x) for x in v if x is not None] + else: + v = six.text_type(v) + result[field.name] = v + + if field.salias: + v = getattr(self, field.salias) + if v is not None: + result[field.salias] = six.text_type(v) + + return result + + +class BookInfo(WorkInfo): + FIELDS = ( + Field(DCNS('audience'), 'audiences', salias='audience', multiple=True, required=False), + + Field(DCNS('subject.period'), 'epochs', salias='epoch', multiple=True, required=False), + Field(DCNS('subject.type'), 'kinds', salias='kind', multiple=True, required=False), + Field(DCNS('subject.genre'), 'genres', salias='genre', multiple=True, required=False), + + Field(DCNS('subject.location'), 'location', required=False), + + Field(DCNS('contributor.translator'), 'translators', + as_person, salias='translator', multiple=True, required=False), + Field(DCNS('relation.hasPart'), 'parts', WLURI, strict=as_wluri_strict, multiple=True, required=False), + Field(DCNS('relation.isVariantOf'), 'variant_of', WLURI, strict=as_wluri_strict, required=False), + + Field(DCNS('relation.coverImage.url'), 'cover_url', required=False), + Field(DCNS('relation.coverImage.attribution'), 'cover_by', required=False), + Field(DCNS('relation.coverImage.source'), 'cover_source', required=False), + # WLCover-specific. + Field(WLNS('coverBarColor'), 'cover_bar_color', required=False), + Field(WLNS('coverBoxPosition'), 'cover_box_position', required=False), + Field(WLNS('coverClass'), 'cover_class', default=['default']), + Field(WLNS('coverLogoUrl'), 'cover_logo_urls', multiple=True, required=False), + + Field('pdf-id', 'isbn_pdf', required=False), + Field('epub-id', 'isbn_epub', required=False), + Field('mobi-id', 'isbn_mobi', required=False), + Field('txt-id', 'isbn_txt', required=False), + Field('html-id', 'isbn_html', required=False), + ) + + +def parse(file_name, cls=BookInfo): + return cls.from_file(file_name) diff --git a/src/librarian/embeds/__init__.py b/src/librarian/embeds/__init__.py new file mode 100644 index 0000000..fa74530 --- /dev/null +++ b/src/librarian/embeds/__init__.py @@ -0,0 +1,58 @@ +from __future__ import unicode_literals + +import importlib +from lxml import etree + +known_types = { + 'application/mathml+xml': 'librarian.embeds.mathml.MathML', + 'application/x-latex': 'librarian.embeds.latex.LaTeX', +} + +class Embed(): + @classmethod + def transforms_to(cls, mime_types, downgrade=False): + matches = set() + for name, method in cls.__dict__.iteritems(): + if hasattr(method, "embed_converts_to"): + conv_type, conv_downgrade = method.embed_converts_to + if downgrade == conv_downgrade and conv_type in mime_types: + matches.add(conv_type) + return matches + + def transform_to(self, mime_type, downgrade=False): + for name, method in type(cls).__dict__.iteritems(): + if hasattr(method, "embed_converts_to"): + conv_type, conv_downgrade = method.embed_converts_to + if downgrade == conv_downgrade and conv_type == mime_type: + return method(self) + + +class DataEmbed(Embed): + def __init__(self, data=None): + self.data = data + +class TreeEmbed(Embed): + def __init__(self, tree=None): + if isinstance(tree, etree._Element): + tree = etree.ElementTree(tree) + self.tree = tree + +def converts_to(mime_type, downgrade=False): + def decorator(method): + method.embed_converts_to = mime_type, downgrade + return method + return decorator + +def downgrades_to(mime_type): + return converts_to(mime_type, True) + +def create_embed(mime_type, tree=None, data=None): + embed = known_types.get(mime_type) + if embed is None: + embed = DataEmbed if tree is None else TreeEmbed + else: + mod_name, cls_name = embed.rsplit('.', 1) + mod = importlib.import_module(mod_name) + embed = getattr(mod, cls_name) + + return embed(data if tree is None else tree) diff --git a/src/librarian/embeds/latex.py b/src/librarian/embeds/latex.py new file mode 100644 index 0000000..8425d03 --- /dev/null +++ b/src/librarian/embeds/latex.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +import os +import shutil +from subprocess import call, PIPE +from tempfile import mkdtemp +from librarian import get_resource +from . import DataEmbed, create_embed, downgrades_to + + +class LaTeX(DataEmbed): + @downgrades_to('image/png') + def to_png(self): + tmpl = open(get_resource('res/embeds/latex/template.tex'), 'rb').read().decode('utf-8') + tempdir = mkdtemp('-librarian-embed-latex') + fpath = os.path.join(tempdir, 'doc.tex') + with open(fpath, 'wb') as f: + f.write((tmpl % {'code': self.data}).encode('utf-8')) + call(['xelatex', '-interaction=batchmode', '-output-directory', tempdir, fpath], stdout=PIPE, stderr=PIPE) + call(['convert', '-density', '150', os.path.join(tempdir, 'doc.pdf'), '-trim', + os.path.join(tempdir, 'doc.png')]) + pngdata = open(os.path.join(tempdir, 'doc.png'), 'rb').read() + shutil.rmtree(tempdir) + return create_embed('image/png', data=pngdata) diff --git a/src/librarian/embeds/mathml.py b/src/librarian/embeds/mathml.py new file mode 100644 index 0000000..564a9f4 --- /dev/null +++ b/src/librarian/embeds/mathml.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from lxml import etree +import six +from librarian import get_resource +from . import TreeEmbed, create_embed, downgrades_to + + +class MathML(TreeEmbed): + @downgrades_to('application/x-latex') + def to_latex(self): + """ + >>> print(MathML(etree.fromstring('a < b')).to_latex().data.strip()) + a < b + + >>> print(MathML(etree.fromstring('< & &lt; A')).to_latex().data.strip()) + < & < A + + """ + xslt = etree.parse(get_resource('res/embeds/mathml/mathml2latex.xslt')) + output = self.tree.xslt(xslt) + text = six.text_type(output) + # Workaround for entities being preserved in output. But there should be a better way. + text = text.replace('<', '<').replace('&', '&') + return create_embed('application/x-latex', data=text) diff --git a/src/librarian/epub.py b/src/librarian/epub.py new file mode 100644 index 0000000..be9488a --- /dev/null +++ b/src/librarian/epub.py @@ -0,0 +1,718 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import print_function, unicode_literals + +import os +import os.path +import re +import subprocess +from six import BytesIO +from copy import deepcopy +from mimetypes import guess_type + +from lxml import etree +import zipfile +from tempfile import mkdtemp, NamedTemporaryFile +from shutil import rmtree + +from librarian import RDFNS, WLNS, NCXNS, OPFNS, XHTMLNS, DCNS, OutputFile +from librarian.cover import make_cover + +from librarian import functions, get_resource + +from librarian.hyphenator import Hyphenator + +functions.reg_person_name() +functions.reg_lang_code_3to2() + + +def squeeze_whitespace(s): + return re.sub(b'\\s+', b' ', s) + + +def set_hyph_language(source_tree): + def get_short_lng_code(text): + result = '' + text = ''.join(text) + with open(get_resource('res/ISO-639-2_8859-1.txt'), 'rb') as f: + for line in f.read().decode('latin1').split('\n'): + list = line.strip().split('|') + if list[0] == text: + result = list[2] + if result == '': + return text + else: + return result + bibl_lng = etree.XPath('//dc:language//text()', + namespaces={'dc': str(DCNS)})(source_tree) + short_lng = get_short_lng_code(bibl_lng[0]) + try: + return Hyphenator(get_resource('res/hyph-dictionaries/hyph_' + + short_lng + '.dic')) + except: + pass + + +def hyphenate_and_fix_conjunctions(source_tree, hyph): + texts = etree.XPath('/utwor/*[2]//text()')(source_tree) + for t in texts: + parent = t.getparent() + if hyph is not None: + newt = '' + wlist = re.compile(r'\w+|[^\w]', re.UNICODE).findall(t) + for w in wlist: + newt += hyph.inserted(w, u'\u00AD') + else: + newt = t + newt = re.sub(r'(?<=\s\w)\s+', u'\u00A0', newt) + if t.is_text: + parent.text = newt + elif t.is_tail: + parent.tail = newt + + +def inner_xml(node): + """ returns node's text and children as a string + + >>> print(inner_xml(etree.fromstring('
    xyz'))) + xyz + """ + + nt = node.text if node.text is not None else '' + return ''.join([nt] + [etree.tostring(child, encoding='unicode') for child in node]) + + +def set_inner_xml(node, text): + """ sets node's text and children from a string + + >>> e = etree.fromstring('bxx') + >>> set_inner_xml(e, 'xyz') + >>> print(etree.tostring(e, encoding='unicode')) + xyz + """ + + p = etree.fromstring('%s' % text) + node.text = p.text + node[:] = p[:] + + +def node_name(node): + """ Find out a node's name + + >>> print(node_name(etree.fromstring('XYZ'))) + XYZ + """ + + tempnode = deepcopy(node) + + for p in ('pe', 'pa', 'pt', 'pr', 'motyw'): + for e in tempnode.findall('.//%s' % p): + t = e.tail + e.clear() + e.tail = t + etree.strip_tags(tempnode, '*') + return tempnode.text + + +def xslt(xml, sheet, **kwargs): + if isinstance(xml, etree._Element): + xml = etree.ElementTree(xml) + with open(sheet) as xsltf: + transform = etree.XSLT(etree.parse(xsltf)) + params = dict((key, transform.strparam(value)) for key, value in kwargs.items()) + return transform(xml, **params) + + +def replace_characters(node): + def replace_chars(text): + if text is None: + return None + return text.replace(u"\ufeff", u"")\ + .replace("---", u"\u2014")\ + .replace("--", u"\u2013")\ + .replace(",,", u"\u201E")\ + .replace('"', u"\u201D")\ + .replace("'", u"\u2019") + if node.tag in ('uwaga', 'extra'): + t = node.tail + node.clear() + node.tail = t + node.text = replace_chars(node.text) + node.tail = replace_chars(node.tail) + for child in node: + replace_characters(child) + + +def find_annotations(annotations, source, part_no): + for child in source: + if child.tag in ('pe', 'pa', 'pt', 'pr'): + annotation = deepcopy(child) + number = str(len(annotations) + 1) + annotation.set('number', number) + annotation.set('part', str(part_no)) + annotation.tail = '' + annotations.append(annotation) + tail = child.tail + child.clear() + child.tail = tail + child.text = number + if child.tag not in ('extra', 'uwaga'): + find_annotations(annotations, child, part_no) + + +class Stanza(object): + """ + Converts / verse endings into verse elements in a stanza. + + Slashes may only occur directly in the stanza. Any slashes in subelements + will be ignored, and the subelements will be put inside verse elements. + + >>> s = etree.fromstring("a c c/\\nbx/\\nyc/ \\nd") + >>> Stanza(s).versify() + >>> print(etree.tostring(s, encoding='unicode')) + a ccbx/ + ycd + + """ + def __init__(self, stanza_elem): + self.stanza = stanza_elem + self.verses = [] + self.open_verse = None + + def versify(self): + self.push_text(self.stanza.text) + for elem in self.stanza: + self.push_elem(elem) + self.push_text(elem.tail) + tail = self.stanza.tail + self.stanza.clear() + self.stanza.tail = tail + self.stanza.extend(verse for verse in self.verses if verse.text or len(verse) > 0) + + def open_normal_verse(self): + self.open_verse = self.stanza.makeelement("wers_normalny") + self.verses.append(self.open_verse) + + def get_open_verse(self): + if self.open_verse is None: + self.open_normal_verse() + return self.open_verse + + def push_text(self, text): + if not text: + return + for i, verse_text in enumerate(re.split(r"/\s*\n", text)): + if i: + self.open_normal_verse() + if not verse_text.strip(): + continue + verse = self.get_open_verse() + if len(verse): + verse[-1].tail = (verse[-1].tail or "") + verse_text + else: + verse.text = (verse.text or "") + verse_text + + def push_elem(self, elem): + if elem.tag.startswith("wers"): + verse = deepcopy(elem) + verse.tail = None + self.verses.append(verse) + self.open_verse = verse + else: + appended = deepcopy(elem) + appended.tail = None + self.get_open_verse().append(appended) + + +def replace_by_verse(tree): + """ Find stanzas and create new verses in place of a '/' character """ + + stanzas = tree.findall('.//' + WLNS('strofa')) + for stanza in stanzas: + Stanza(stanza).versify() + + +def add_to_manifest(manifest, partno): + """ Adds a node to the manifest section in content.opf file """ + + partstr = 'part%d' % partno + e = manifest.makeelement( + OPFNS('item'), attrib={'id': partstr, 'href': partstr + '.html', + 'media-type': 'application/xhtml+xml'} + ) + manifest.append(e) + + +def add_to_spine(spine, partno): + """ Adds a node to the spine section in content.opf file """ + + e = spine.makeelement(OPFNS('itemref'), attrib={'idref': 'part%d' % partno}) + spine.append(e) + + +class TOC(object): + def __init__(self, name=None, part_href=None): + self.children = [] + self.name = name + self.part_href = part_href + self.sub_number = None + + def add(self, name, part_href, level=0, is_part=True, index=None): + assert level == 0 or index is None + if level > 0 and self.children: + return self.children[-1].add(name, part_href, level - 1, is_part) + else: + t = TOC(name) + t.part_href = part_href + if index is not None: + self.children.insert(index, t) + else: + self.children.append(t) + if not is_part: + t.sub_number = len(self.children) + 1 + return t.sub_number + + def append(self, toc): + self.children.append(toc) + + def extend(self, toc): + self.children.extend(toc.children) + + def depth(self): + if self.children: + return max((c.depth() for c in self.children)) + 1 + else: + return 0 + + def href(self): + src = self.part_href + if self.sub_number is not None: + src += '#sub%d' % self.sub_number + return src + + def write_to_xml(self, nav_map, counter=1): + for child in self.children: + nav_point = nav_map.makeelement(NCXNS('navPoint')) + nav_point.set('id', 'NavPoint-%d' % counter) + nav_point.set('playOrder', str(counter)) + + nav_label = nav_map.makeelement(NCXNS('navLabel')) + text = nav_map.makeelement(NCXNS('text')) + if child.name is not None: + text.text = re.sub(r'\n', ' ', child.name) + else: + text.text = child.name + nav_label.append(text) + nav_point.append(nav_label) + + content = nav_map.makeelement(NCXNS('content')) + content.set('src', child.href()) + nav_point.append(content) + nav_map.append(nav_point) + counter = child.write_to_xml(nav_point, counter + 1) + return counter + + def html_part(self, depth=0): + texts = [] + for child in self.children: + texts.append( + "" % + (depth, child.href(), child.name)) + texts.append(child.html_part(depth + 1)) + return "\n".join(texts) + + def html(self): + with open(get_resource('epub/toc.html'), 'rb') as f: + t = f.read().decode('utf-8') + return t % self.html_part() + + +def used_chars(element): + """ Lists characters used in an ETree Element """ + chars = set((element.text or '') + (element.tail or '')) + for child in element: + chars = chars.union(used_chars(child)) + return chars + + +def chop(main_text): + """ divide main content of the XML file into chunks """ + + # prepare a container for each chunk + part_xml = etree.Element('utwor') + etree.SubElement(part_xml, 'master') + main_xml_part = part_xml[0] # master + + last_node_part = False + + # the below loop are workaround for a problem with epubs in drama ebooks without acts + is_scene = False + is_act = False + for one_part in main_text: + name = one_part.tag + if name == 'naglowek_scena': + is_scene = True + elif name == 'naglowek_akt': + is_act = True + + for one_part in main_text: + name = one_part.tag + if is_act is False and is_scene is True: + if name == 'naglowek_czesc': + yield part_xml + last_node_part = True + main_xml_part[:] = [deepcopy(one_part)] + elif not last_node_part and name == "naglowek_scena": + yield part_xml + main_xml_part[:] = [deepcopy(one_part)] + else: + main_xml_part.append(deepcopy(one_part)) + last_node_part = False + else: + if name == 'naglowek_czesc': + yield part_xml + last_node_part = True + main_xml_part[:] = [deepcopy(one_part)] + elif not last_node_part and name in ("naglowek_rozdzial", "naglowek_akt", "srodtytul"): + yield part_xml + main_xml_part[:] = [deepcopy(one_part)] + else: + main_xml_part.append(deepcopy(one_part)) + last_node_part = False + yield part_xml + + +def transform_chunk(chunk_xml, chunk_no, annotations, empty=False, _empty_html_static=[]): + """ transforms one chunk, returns a HTML string, a TOC object and a set of used characters """ + + toc = TOC() + for element in chunk_xml[0]: + if element.tag == "naglowek_czesc": + toc.add(node_name(element), "part%d.html#book-text" % chunk_no) + elif element.tag in ("naglowek_rozdzial", "naglowek_akt", "srodtytul"): + toc.add(node_name(element), "part%d.html" % chunk_no) + elif element.tag in ('naglowek_podrozdzial', 'naglowek_scena'): + subnumber = toc.add(node_name(element), "part%d.html" % chunk_no, level=1, is_part=False) + element.set('sub', str(subnumber)) + if empty: + if not _empty_html_static: + _empty_html_static.append(open(get_resource('epub/emptyChunk.html')).read()) + chars = set() + output_html = _empty_html_static[0] + else: + find_annotations(annotations, chunk_xml, chunk_no) + replace_by_verse(chunk_xml) + html_tree = xslt(chunk_xml, get_resource('epub/xsltScheme.xsl')) + chars = used_chars(html_tree.getroot()) + output_html = etree.tostring( + html_tree, pretty_print=True, xml_declaration=True, + encoding="utf-8", + doctype='' + ) + return output_html, toc, chars + + +def transform(wldoc, verbose=False, style=None, html_toc=False, + sample=None, cover=None, flags=None, hyphenate=False, ilustr_path='', output_type='epub'): + """ produces a EPUB file + + sample=n: generate sample e-book (with at least n paragraphs) + cover: a cover.Cover factory or True for default + flags: less-advertising, without-fonts, working-copy + """ + + def transform_file(wldoc, chunk_counter=1, first=True, sample=None): + """ processes one input file and proceeds to its children """ + + replace_characters(wldoc.edoc.getroot()) + + hyphenator = set_hyph_language(wldoc.edoc.getroot()) if hyphenate else None + hyphenate_and_fix_conjunctions(wldoc.edoc.getroot(), hyphenator) + + # every input file will have a TOC entry, + # pointing to starting chunk + toc = TOC(wldoc.book_info.title, "part%d.html" % chunk_counter) + chars = set() + if first: + # write book title page + html_tree = xslt(wldoc.edoc, get_resource('epub/xsltTitle.xsl'), outputtype=output_type) + chars = used_chars(html_tree.getroot()) + html_string = etree.tostring( + html_tree, pretty_print=True, xml_declaration=True, + encoding="utf-8", + doctype='' + ) + zip.writestr('OPS/title.html', squeeze_whitespace(html_string)) + # add a title page TOC entry + toc.add(u"Strona tytułowa", "title.html") + elif wldoc.book_info.parts: + # write title page for every parent + if sample is not None and sample <= 0: + chars = set() + html_string = open(get_resource('epub/emptyChunk.html')).read() + else: + html_tree = xslt(wldoc.edoc, get_resource('epub/xsltChunkTitle.xsl')) + chars = used_chars(html_tree.getroot()) + html_string = etree.tostring( + html_tree, pretty_print=True, xml_declaration=True, + encoding="utf-8", + doctype='' + ) + zip.writestr('OPS/part%d.html' % chunk_counter, squeeze_whitespace(html_string)) + add_to_manifest(manifest, chunk_counter) + add_to_spine(spine, chunk_counter) + chunk_counter += 1 + + if len(wldoc.edoc.getroot()) > 1: + # rdf before style master + main_text = wldoc.edoc.getroot()[1] + else: + # rdf in style master + main_text = wldoc.edoc.getroot()[0] + if main_text.tag == RDFNS('RDF'): + main_text = None + + if main_text is not None: + for chunk_xml in chop(main_text): + empty = False + if sample is not None: + if sample <= 0: + empty = True + else: + sample -= len(chunk_xml.xpath('//strofa|//akap|//akap_cd|//akap_dialog')) + chunk_html, chunk_toc, chunk_chars = transform_chunk(chunk_xml, chunk_counter, annotations, empty) + + toc.extend(chunk_toc) + chars = chars.union(chunk_chars) + zip.writestr('OPS/part%d.html' % chunk_counter, squeeze_whitespace(chunk_html)) + add_to_manifest(manifest, chunk_counter) + add_to_spine(spine, chunk_counter) + chunk_counter += 1 + + for child in wldoc.parts(): + child_toc, chunk_counter, chunk_chars, sample = transform_file( + child, chunk_counter, first=False, sample=sample) + toc.append(child_toc) + chars = chars.union(chunk_chars) + + return toc, chunk_counter, chars, sample + + document = deepcopy(wldoc) + del wldoc + + if flags: + for flag in flags: + document.edoc.getroot().set(flag, 'yes') + + document.clean_ed_note() + document.clean_ed_note('abstrakt') + + # add editors info + editors = document.editors() + if editors: + document.edoc.getroot().set('editors', u', '.join(sorted( + editor.readable() for editor in editors))) + if document.book_info.funders: + document.edoc.getroot().set('funders', u', '.join( + document.book_info.funders)) + if document.book_info.thanks: + document.edoc.getroot().set('thanks', document.book_info.thanks) + + opf = xslt(document.book_info.to_etree(), get_resource('epub/xsltContent.xsl')) + manifest = opf.find('.//' + OPFNS('manifest')) + guide = opf.find('.//' + OPFNS('guide')) + spine = opf.find('.//' + OPFNS('spine')) + + output_file = NamedTemporaryFile(prefix='librarian', suffix='.epub', delete=False) + zip = zipfile.ZipFile(output_file, 'w', zipfile.ZIP_DEFLATED) + + functions.reg_mathml_epub(zip) + + if os.path.isdir(ilustr_path): + ilustr_elements = set(ilustr.get('src') for ilustr in document.edoc.findall('//ilustr')) + for i, filename in enumerate(os.listdir(ilustr_path)): + if filename not in ilustr_elements: + continue + file_path = os.path.join(ilustr_path, filename) + zip.write(file_path, os.path.join('OPS', filename)) + image_id = 'image%s' % i + manifest.append(etree.fromstring( + '' % (image_id, filename, guess_type(file_path)[0]))) + + # write static elements + mime = zipfile.ZipInfo() + mime.filename = 'mimetype' + mime.compress_type = zipfile.ZIP_STORED + mime.extra = b'' + zip.writestr(mime, b'application/epub+zip') + zip.writestr( + 'META-INF/container.xml', + b'' + b'' + b'' + b'' + ) + zip.write(get_resource('res/wl-logo-small.png'), + os.path.join('OPS', 'logo_wolnelektury.png')) + zip.write(get_resource('res/jedenprocent.png'), + os.path.join('OPS', 'jedenprocent.png')) + if not style: + style = get_resource('epub/style.css') + zip.write(style, os.path.join('OPS', 'style.css')) + + if cover: + if cover is True: + cover = make_cover + + cover_file = BytesIO() + bound_cover = cover(document.book_info) + bound_cover.save(cover_file) + cover_name = 'cover.%s' % bound_cover.ext() + zip.writestr(os.path.join('OPS', cover_name), cover_file.getvalue()) + del cover_file + + cover_tree = etree.parse(get_resource('epub/cover.html')) + cover_tree.find('//' + XHTMLNS('img')).set('src', cover_name) + zip.writestr('OPS/cover.html', etree.tostring( + cover_tree, pretty_print=True, xml_declaration=True, + encoding="utf-8", + doctype='' + )) + + if bound_cover.uses_dc_cover: + if document.book_info.cover_by: + document.edoc.getroot().set('data-cover-by', document.book_info.cover_by) + if document.book_info.cover_source: + document.edoc.getroot().set('data-cover-source', document.book_info.cover_source) + + manifest.append(etree.fromstring( + '')) + manifest.append(etree.fromstring( + '' % (cover_name, bound_cover.mime_type()))) + spine.insert(0, etree.fromstring('')) + opf.getroot()[0].append(etree.fromstring('')) + guide.append(etree.fromstring('')) + + annotations = etree.Element('annotations') + + toc_file = etree.fromstring( + b'' + b'' + b'' + ) + nav_map = toc_file[-1] + + if html_toc: + manifest.append(etree.fromstring( + '')) + spine.append(etree.fromstring( + '')) + guide.append(etree.fromstring('')) + + toc, chunk_counter, chars, sample = transform_file(document, sample=sample) + + if len(toc.children) < 2: + toc.add(u"Początek utworu", "part1.html") + + # Last modifications in container files and EPUB creation + if len(annotations) > 0: + toc.add("Przypisy", "annotations.html") + manifest.append(etree.fromstring( + '')) + spine.append(etree.fromstring( + '')) + replace_by_verse(annotations) + html_tree = xslt(annotations, get_resource('epub/xsltAnnotations.xsl')) + chars = chars.union(used_chars(html_tree.getroot())) + zip.writestr('OPS/annotations.html', etree.tostring( + html_tree, pretty_print=True, xml_declaration=True, + encoding="utf-8", + doctype='' + )) + + toc.add("Wesprzyj Wolne Lektury", "support.html") + manifest.append(etree.fromstring( + '')) + spine.append(etree.fromstring( + '')) + html_string = open(get_resource('epub/support.html'), 'rb').read() + chars.update(used_chars(etree.fromstring(html_string))) + zip.writestr('OPS/support.html', squeeze_whitespace(html_string)) + + toc.add("Strona redakcyjna", "last.html") + manifest.append(etree.fromstring( + '')) + spine.append(etree.fromstring( + '')) + html_tree = xslt(document.edoc, get_resource('epub/xsltLast.xsl'), outputtype=output_type) + chars.update(used_chars(html_tree.getroot())) + zip.writestr('OPS/last.html', squeeze_whitespace(etree.tostring( + html_tree, pretty_print=True, xml_declaration=True, + encoding="utf-8", + doctype='' + ))) + + if not flags or 'without-fonts' not in flags: + # strip fonts + tmpdir = mkdtemp('-librarian-epub') + try: + cwd = os.getcwd() + except OSError: + cwd = None + + os.chdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'font-optimizer')) + for fname in 'DejaVuSerif.ttf', 'DejaVuSerif-Bold.ttf', 'DejaVuSerif-Italic.ttf', 'DejaVuSerif-BoldItalic.ttf': + optimizer_call = ['perl', 'subset.pl', '--chars', + ''.join(chars).encode('utf-8'), + get_resource('fonts/' + fname), + os.path.join(tmpdir, fname)] + env = {"PERL_USE_UNSAFE_INC": "1"} + if verbose: + print("Running font-optimizer") + subprocess.check_call(optimizer_call, env=env) + else: + dev_null = open(os.devnull, 'w') + subprocess.check_call(optimizer_call, stdout=dev_null, stderr=dev_null, env=env) + zip.write(os.path.join(tmpdir, fname), os.path.join('OPS', fname)) + manifest.append(etree.fromstring( + '' % (fname, fname))) + rmtree(tmpdir) + if cwd is not None: + os.chdir(cwd) + zip.writestr('OPS/content.opf', etree.tostring(opf, pretty_print=True, + xml_declaration=True, encoding="utf-8")) + title = document.book_info.title + attributes = "dtb:uid", "dtb:depth", "dtb:totalPageCount", "dtb:maxPageNumber" + for st in attributes: + meta = toc_file.makeelement(NCXNS('meta')) + meta.set('name', st) + meta.set('content', '0') + toc_file[0].append(meta) + toc_file[0][0].set('content', str(document.book_info.url)) + toc_file[0][1].set('content', str(toc.depth())) + set_inner_xml(toc_file[1], ''.join(('', title, ''))) + + # write TOC + if html_toc: + toc.add(u"Spis treści", "toc.html", index=1) + zip.writestr('OPS/toc.html', toc.html().encode('utf-8')) + toc.write_to_xml(nav_map) + zip.writestr('OPS/toc.ncx', etree.tostring(toc_file, pretty_print=True, + xml_declaration=True, encoding="utf-8")) + zip.close() + + return OutputFile.from_filename(output_file.name) diff --git a/src/librarian/epub/cover.html b/src/librarian/epub/cover.html new file mode 100644 index 0000000..784067c --- /dev/null +++ b/src/librarian/epub/cover.html @@ -0,0 +1,13 @@ + + + + + Okładka + + + +
    + Okładka +
    + + \ No newline at end of file diff --git a/src/librarian/epub/emptyChunk.html b/src/librarian/epub/emptyChunk.html new file mode 100644 index 0000000..1452a99 --- /dev/null +++ b/src/librarian/epub/emptyChunk.html @@ -0,0 +1,8 @@ + + + + + WolneLektury.pl + + + \ No newline at end of file diff --git a/src/librarian/epub/style.css b/src/librarian/epub/style.css new file mode 100644 index 0000000..82ad4b9 --- /dev/null +++ b/src/librarian/epub/style.css @@ -0,0 +1,390 @@ +@page { + margin: 5pt; +} +@font-face { + font-family: "DejaVu Serif"; + font-weight: normal; + font-style: normal; + src: url(DejaVuSerif.ttf); +} +@font-face { + font-family: "DejaVu Serif"; + font-weight: bold; + font-style: normal; + src: url(DejaVuSerif-Bold.ttf); +} +@font-face { + font-family: "DejaVu Serif"; + font-weight: normal; + font-style: italic; + src: url(DejaVuSerif-Italic.ttf); +} +@font-face { + font-family: "DejaVu Serif"; + font-weight: bold; + font-style: italic; + src: url(DejaVuSerif-BoldItalic.ttf); +} + +body, p, h1, h2, h3, h4 { + font-family: "DejaVu Serif", serif; +} + + +body +{ + line-height: 1.5em; + margin: 0; +} + +a +{ + text-decoration: none; + color: #00e; +} + +a img { + border: 0; +} + +#book-text { + margin: 0; +} + +/* =================================================== */ +/* = Common elements: headings, paragraphs and lines = */ +/* =================================================== */ + + +.h2 +{ + font-size: 2em; + margin: 0; + margin-top: 1.5em; + font-weight: bold; + line-height: 1.5em; +} + +.h3 +{ + text-align:left; + font-size: 1.5em; + margin-top: 1.5em; + font-weight: normal; + line-height: 1.5em; +} + +.h4 +{ + font-size: 1em; + margin: 0; + margin-top: 1.5em; + line-height: 1.5em; +} + +p +{ + margin: 0; +} + +/* ======================== */ +/* = Footnotes and themes = */ +/* ======================== */ + +.theme-begin +{ + border-left: 0.1em solid #DDDDDD; + color: #777; + padding: 0 0.5em; + width: 7.5em; + font-style: normal; + font-weight: normal; + font-size: 0.875em; + float: right; + margin-right: -9.5em; + clear: both; + left: 40em; + line-height: 1.5em; + text-align: left; +} + +.annotation +{ + margin-bottom: 0.3em; + text-align: justify; +} + +.block +{ + font-size: 0.875em; + padding: 1em; +} + + +/* ============= */ +/* = Numbering = */ +/* ============= */ + +.anchor sup +{ + line-height: 0; + font-size: 0.7em; +} + +/* =================== */ +/* = Custom elements = */ +/* =================== */ + +.title-page +{ + margin-top: 1.5em; +} + +.title +{ + font-size: 3em; + text-align: center; + line-height: 1.5em; + font-weight: bold; +} + +.author +{ + margin: 0; + text-align: center; + font-weight: bold; + + font-size: 1.5em; + line-height: 1.5em; + margin-bottom: 0.25em; +} + +.intitle +{ + margin: 0; + text-align: center; + font-weight: bold; + + font-size: 1.5em; + line-height: 1.5em; + margin-bottom: 0.25em; +} + +.insubtitle +{ + margin: 0; + text-align: center; + font-weight: bold; + + font-size: 1em; + line-height: 1.5em; + margin-bottom: 0.25em; +} + +.collection +{ + margin: 0; + text-align: center; + font-weight: bold; + + font-size: 1.125em; + line-height: 1.5em; + margin-bottom: -0.25em; +} + +.subtitle +{ + margin: 0; + text-align: center; + font-weight: bold; + + font-size: 1.5em; + line-height: 1.5em; + margin-top: -0.25em; +} + +div.didaskalia +{ + font-style: italic; + margin-top: 0.5em; + margin-bottom: 0.5em; + margin-left: 1.5em; +} + +.kwestia +{ + margin-top: 0.5em; +} + +.paragraph +{ + text-align: justify; + margin: 0; + text-indent: 1.2em; +} + +h1 + .paragraph, h2 + .paragraph +{ + text-indent: 0; +} + +h2 + .paragraph:first-letter +{ + font-size: 1.6em; +} + +.motto +{ + text-align: justify; + font-style: italic; + margin-top: 1.5em; +} + +.motto_podpis, .motto_podpis .paragraph +{ + font-size: 0.875em; + text-align: right; + font-style: italic; +} + +.fragment +{ + border-bottom: 0.1em solid #999; + padding-bottom: 1.5em; +} + +.dedication, .dedication .paragraph +{ + text-align: right; + font-style: italic; +} + +.note +{ + text-align: right; + font-style: italic; + margin-top: 1em; + margin-bottom: 0.5em; +} + +.note .paragraph +{ + text-align: justify; +} + +.frame +{ + border: 1px darkgray solid; + padding: 1em; + margin-top: 1em; + margin-bottom: 1em; +} + +hr.spacer +{ + height: 3em; + visibility: hidden; +} + +hr.spacer-line +{ + margin: 0; + margin-top: 1.5em; + margin-bottom: 1.5em; + border: none; + border-bottom: 0.1em solid #000; +} + +.spacer-asterisk +{ + padding: 0; + margin: 0; + margin-top: 1.5em; + margin-bottom: 1.5em; + text-align: center; +} + +div.person-list ol +{ + list-style: none; + padding: 0; + padding-left: 1.5em; +} + +.place-and-time +{ + font-style: italic; +} + +em.math +{ + font-style: italic; +} +em.foreign-word +{ + font-style: italic; +} +em.book-title +{ + font-style: italic; +} +em.didaskalia +{ + font-style: italic; +} + +em.author-emphasis +{ + letter-spacing: 0.1em; +} + +em.wieksze-odstepy +{ + font-style: normal; + word-spacing: 1em; +} + +.person-list em.person +{ + font-style: normal; + /*font-variant: small-caps;*/ + text-transform: uppercase; +} + +.info +{ + text-align: center; + margin-bottom: 1em; +} +.info div +{ + text-align: center; +} + +.info img +{ + margin: 0; + margin-left: 2em; + margin-right: 2em; +} + +p.minor-info { + text-align: center; + margin-bottom: 1em; + font-size: 0.75em; +} +p.footer { + margin-top: 2em; +} + +table { + border-collapse: collapse; + width: 100%; +} +table.border th, table.border td { + border: 1px solid black; +} + +th, td { + vertical-align: top; +} \ No newline at end of file diff --git a/src/librarian/epub/support.html b/src/librarian/epub/support.html new file mode 100755 index 0000000..9010693 --- /dev/null +++ b/src/librarian/epub/support.html @@ -0,0 +1,46 @@ + + + + + Wesprzyj Wolne Lektury + + + +
    + +

    Wesprzyj Wolne Lektury!

    + +

    + Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji + pożytku publicznego działającej na rzecz wolności korzystania + z dóbr kultury.

    + +

    + Co roku do domeny publicznej przechodzi twórczość kolejnych autorów. + Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie. +

    + +

    + Jak możesz pomóc? +

    + +

    + Logo 1%
    + Przekaż 1% podatku na rozwój Wolnych Lektur:
    + Fundacja Nowoczesna Polska
    + KRS 0000070056 +

    + +

    + Dołącz do Towarzystwa Przyjaciół Wolnych Lektur i pomóż nam rozwijać bibliotekę. +

    + +

    + Przekaż darowiznę na konto: + szczegóły + na stronie Fundacji. +

    + +
    + + diff --git a/src/librarian/epub/toc.html b/src/librarian/epub/toc.html new file mode 100755 index 0000000..3ff7556 --- /dev/null +++ b/src/librarian/epub/toc.html @@ -0,0 +1,14 @@ + + + + + WolneLektury.pl + + + +
    +

    Spis treści

    + %s +
    + + diff --git a/src/librarian/epub/xsltAnnotations.xsl b/src/librarian/epub/xsltAnnotations.xsl new file mode 100644 index 0000000..5588d3e --- /dev/null +++ b/src/librarian/epub/xsltAnnotations.xsl @@ -0,0 +1,70 @@ + + + + + + + + + + + + + <xsl:text>Przypisy</xsl:text> + + + +
    +
    +

    + Przypisy: +

    + +
    +
    + + +
    + + + + + + +

    . [przypis autorski] [przypis tłumacza] [przypis redakcyjny] [przypis edytorski]

    + +
    + + + + + + + + +

    + +

    +
    + + +
    + +
    +
    + + + + „ + + ” + + + + +

    + +

    +
    + +
    diff --git a/src/librarian/epub/xsltChunkTitle.xsl b/src/librarian/epub/xsltChunkTitle.xsl new file mode 100644 index 0000000..8c0e09a --- /dev/null +++ b/src/librarian/epub/xsltChunkTitle.xsl @@ -0,0 +1,40 @@ + + + + + + + + + + + + + <xsl:text>Strona tytułowa</xsl:text> + + + +
    +
    + +
    +
    + + +
    + + + + + + + + + + +

    + +

    +
    + +
    diff --git a/src/librarian/epub/xsltContent.xsl b/src/librarian/epub/xsltContent.xsl new file mode 100644 index 0000000..24315c5 --- /dev/null +++ b/src/librarian/epub/xsltContent.xsl @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + , + + + + + + ; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/librarian/epub/xsltLast.xsl b/src/librarian/epub/xsltLast.xsl new file mode 100644 index 0000000..e29c5f4 --- /dev/null +++ b/src/librarian/epub/xsltLast.xsl @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + <xsl:text>Strona redakcyjna</xsl:text> + + + +
    +

    + + + Ten utwór jest udostępniony na licencji + + + + + + + + + Ten utwór nie jest objęty majątkowym prawem autorskim i znajduje się w domenie + publicznej, co oznacza że możesz go swobodnie wykorzystywać, publikować + i rozpowszechniać. Jeśli utwór opatrzony jest dodatkowymi materiałami + (przypisy, motywy literackie etc.), które podlegają prawu autorskiemu, to + te dodatkowe materiały udostępnione są na licencji + Creative Commons + Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL. + + +

    + +

    Źródło: + + + + + , + + +

    + + +

    Tekst opracowany na podstawie:

    +
    + + +

    + Wydawca: + + + , + +

    +
    + + +

    +
    + + + + + + +

    Okładka na podstawie: + + + + + + + + + + + + + +

    +
    + + + + +

    ISBN

    +
    + +

     

    +

    + Plik wygenerowany dnia . +

    + +
    + + +
    + + + + + + + +

    + Opracowanie redakcyjne i przypisy: + .

    +
    +
    + + + +

    Publikację wsparli i wsparły: + .

    +
    +
    + + + + +
    diff --git a/src/librarian/epub/xsltScheme.xsl b/src/librarian/epub/xsltScheme.xsl new file mode 100644 index 0000000..724d983 --- /dev/null +++ b/src/librarian/epub/xsltScheme.xsl @@ -0,0 +1,405 @@ + + + + + + + + + + + + + WolneLektury.pl + + + + + book-text + + + + + + + + + + + + + + + + + +
    + +
    +
    + + +
    +
    + +
    +
      + +
    +
    +
    + + +
    + +
    +
    + + +
    + +
    +
    + + +
    + +
    +
    + + +
    + +
    +
    + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + +

    + +

    +
    + + + + +

    + +

    +
    + + + + +

    + +

    +
    + + + + +

    + +

    +
    + + + + +

    + +

    +
    + + +

    + +

    +
    + + + +

    + +

    +
    + + + +

    + +

    +
    + + +

    + +

    +
    + + +

    + +

    +
    + + +

    + +

    +
    + + +

    + +

    +
    + + + +

    + +

    +
    + + +
    + +
    +
    + + +
    + +
    +
    + + +

    + +

    +
    + + +
    + +
     
    +
    + + +
    + +  
    +
    + + +
    + +  
    +
    + + +
    + +  
    +
    + + +
    + +  
    +
    + + +
    + + margin-left: em; + + +  
    +
    + + +
    + +  
    +
    + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + „ + + ” + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  • + +
  • +
    + + + + + + +

     

    +
    + + +

    *

    +
    + + +
    +
    + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/src/librarian/epub/xsltTitle.xsl b/src/librarian/epub/xsltTitle.xsl new file mode 100644 index 0000000..0a7279b --- /dev/null +++ b/src/librarian/epub/xsltTitle.xsl @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + <xsl:text>Strona tytułowa</xsl:text> + + + +
    +
    + + + + + + + + + + +
    + +

     

    + + + + +

    [Kopia robocza]

    +
    + + +

    + + + + + Ta lektura, + podobnie jak tysiące innych, jest dostępna on-line na stronie + wolnelektury.pl. +

    +
    + + +

    +
    + +

    + Utwór opracowany został w ramach projektu Wolne Lektury przez fundację Nowoczesna Polska. +

    + + + + +

    ISBN

    +
    + + +
    + + +
    + + + + + + + + + + +

    + +

    +
    + + +

    + +

    +
    + + + +

    + tłum. + + , + + +

    +
    +
    + + + + + + +

    + +

    +
    + + +

    + +

    +
    + + +

    + +

    +
    + + +

    + +

    +
    + + +

    + +

    +
    + + + + + + + +
    diff --git a/src/librarian/fb2.py b/src/librarian/fb2.py new file mode 100644 index 0000000..6dd1c35 --- /dev/null +++ b/src/librarian/fb2.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import unicode_literals + +import os.path +from copy import deepcopy +from lxml import etree +import six + +from librarian import functions, OutputFile +from .epub import replace_by_verse + + +functions.reg_substitute_entities() +functions.reg_person_name() + + +def sectionify(tree): + """Finds section headers and adds a tree of _section tags.""" + sections = [ + 'naglowek_czesc', + 'naglowek_akt', 'naglowek_rozdzial', 'naglowek_scena', + 'naglowek_podrozdzial'] + section_level = dict((v, k) for (k, v) in enumerate(sections)) + + # We can assume there are just subelements an no text at section level. + for level, section_name in reversed(list(enumerate(sections))): + for header in tree.findall('//' + section_name): + section = header.makeelement("_section") + header.addprevious(section) + section.append(header) + sibling = section.getnext() + while (sibling is not None and + section_level.get(sibling.tag, 1000) > level): + section.append(sibling) + sibling = section.getnext() + + +def transform(wldoc, verbose=False, + cover=None, flags=None): + """ produces a FB2 file + + cover: a cover.Cover object or True for default + flags: less-advertising, working-copy + """ + + document = deepcopy(wldoc) + del wldoc + + if flags: + for flag in flags: + document.edoc.getroot().set(flag, 'yes') + + document.clean_ed_note() + document.clean_ed_note('abstrakt') + + style_filename = os.path.join(os.path.dirname(__file__), 'fb2/fb2.xslt') + style = etree.parse(style_filename) + + replace_by_verse(document.edoc) + sectionify(document.edoc) + + result = document.transform(style) + + return OutputFile.from_bytes(six.text_type(result).encode('utf-8')) + +# vim:et diff --git a/src/librarian/fb2/description.xslt b/src/librarian/fb2/description.xslt new file mode 100644 index 0000000..6d7383f --- /dev/null +++ b/src/librarian/fb2/description.xslt @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + literature + + + + + + + + + + + book2fb2 + + + + + 0 + + + + + + ; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/librarian/fb2/drama.xslt b/src/librarian/fb2/drama.xslt new file mode 100755 index 0000000..ab8fb06 --- /dev/null +++ b/src/librarian/fb2/drama.xslt @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + +

    +
    + + +

    +
    + + +

    +
    + + + + + +
    diff --git a/src/librarian/fb2/fb2.xslt b/src/librarian/fb2/fb2.xslt new file mode 100644 index 0000000..2f322e8 --- /dev/null +++ b/src/librarian/fb2/fb2.xslt @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:apply-templates mode="title" + select="autor_utworu|dzielo_nadrzedne|nazwa_utworu|podtytul"/> + <xsl:call-template name="translators" /> + + + + +

    + Utwór opracowany został w ramach projektu + Wolne Lektury + przez fundację + Nowoczesna Polska. +

    +
    + + + +
    + + + + + + + +

    +
    + + + +

    + tłum. + + , + + +

    +
    +
    + + + + + + + + +
    diff --git a/src/librarian/fb2/footnotes.xslt b/src/librarian/fb2/footnotes.xslt new file mode 100644 index 0000000..2fe3d4e --- /dev/null +++ b/src/librarian/fb2/footnotes.xslt @@ -0,0 +1,51 @@ + + + + + + + + + + + fn + +

    + + [przypis autorski] + + + [przypis tłumacza] + + + [przypis redakcyjny] + + + [przypis edytorski] +

    +
    +
    + + + + + + + note + #fn + + [ + + ] + + +
    diff --git a/src/librarian/fb2/inline.xslt b/src/librarian/fb2/inline.xslt new file mode 100644 index 0000000..351d13c --- /dev/null +++ b/src/librarian/fb2/inline.xslt @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + „ + + ” + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/librarian/fb2/paragraphs.xslt b/src/librarian/fb2/paragraphs.xslt new file mode 100644 index 0000000..e2dc26b --- /dev/null +++ b/src/librarian/fb2/paragraphs.xslt @@ -0,0 +1,59 @@ + + + + + + + + + +

    +
    + + + + + + +

    +
    + + + + + + +

    *

    +
    + + +

    ————————

    +
    + + +
    +
    + + + + + + + + + + + + + + +
    diff --git a/src/librarian/fb2/poems.xslt b/src/librarian/fb2/poems.xslt new file mode 100644 index 0000000..257795b --- /dev/null +++ b/src/librarian/fb2/poems.xslt @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/librarian/fb2/sections.xslt b/src/librarian/fb2/sections.xslt new file mode 100644 index 0000000..80ffb65 --- /dev/null +++ b/src/librarian/fb2/sections.xslt @@ -0,0 +1,47 @@ + + + + + + + +
    + + + + + + + + + + +
    +
    + + + +
    + + + +
    + +
    +
    + + + + <p><xsl:apply-templates mode="inline"/></p> + +
    diff --git a/src/librarian/fn_qualifiers.py b/src/librarian/fn_qualifiers.py new file mode 100644 index 0000000..51168e4 --- /dev/null +++ b/src/librarian/fn_qualifiers.py @@ -0,0 +1,198 @@ +# -*- coding: utf-8 +""" +List of standard footnote qualifiers. +This file is generated by scripts/fn_qualifiers_list_from_wiki.py, +do not edit it. +""" +from __future__ import unicode_literals + + +FN_QUALIFIERS = { + 'a.': 'albo', + 'alb.': 'albański', + 'amer.': 'amerykański, amerykańskie', + 'anat.': 'anatomiczne', + 'ang.': 'angielski, angielskie', + 'antr.': 'antropologia, antropologiczny', + 'ar.': 'arabski', + 'archeol.': 'archeologia, archeologiczny', + 'archit.': 'architektura', + 'astr.': 'astronomia', + 'austr.': 'austriacki', + 'austral.': 'australijski', + 'B.': 'biernik', + 'białorus.': 'białoruski', + 'biol.': 'biologia, biologiczny', + 'blm': 'bez liczby mnogiej', + 'blp': 'bez liczby pojedynczej', + 'bot.': 'botanika', + 'bułg.': 'bułgarski', + 'C.': 'celownik', + 'celt.': 'celtycki', + 'chem.': 'chemiczny', + 'chiń.': 'chiński', + 'chrześc.': 'chrześcijański, chrześcijaństwo', + 'cz.': 'czas (gramatyczny)', + 'cz.przesz.': 'czas przeszły', + 'cz.przysz.': 'czas przyszły', + 'cz.ter.': 'czas teraźniejszy', + 'czas.': 'czasownik', + 'czes.': 'czeski', + 'D.': 'dopełniacz', + 'daw.': 'dawne', + 'dk': 'dokonane', + 'druk.': 'drukarstwo, drukowany', + 'dziec.': 'dziecięcy', + 'egip.': 'egipski', + 'ekon.': 'ekonomiczny', + 'elektr.': 'elektryczny', + 'etn.': 'etnografia, etniczny', + 'euf.': 'eufemizm', + 'film.': 'filmowy', + 'filoz.': 'filozoficzny', + 'fiń.': 'fiński', + 'fiz.': 'fizyka', + 'fizjol.': 'fizjologia', + 'fot.': 'fotografia, fotograficzny', + 'fr.': 'francuski', + 'fraz.': 'frazeologia, frazeologiczny', + 'fragm.': 'fragment', + 'genet.': 'genetyka, genetyczny', + 'geogr.': 'geografia, geograficzny', + 'geol.': 'geologia', + 'geom.': 'geometria', + 'gr.': 'grecki', + 'gw.': 'gwara, gwarowe', + 'hand.': 'handel, handlowy', + 'hebr.': 'hebrajski', + 'hind.': 'hinduski', + 'hist.': 'historia, historyczny', + 'hiszp.': 'hiszpański', + 'hol.': 'holenderski', + 'im.': 'imienia', + 'imiesł.': 'imiesłów, imiesłowowy', + 'in.': 'inne, inny', + 'inf.': 'informacja', + 'inform.': 'informatyka', + 'irl.': 'irlandzki', + 'iron.': 'ironicznie', + 'isl.': 'islandzki', + 'itd.': 'i tak dalej', + 'itp.': 'i tym podobne', + 'jap.': 'japoński', + 'jęz.': 'język, językowy, językoznawstwo', + 'kg': 'kilogram', + 'km': 'kilometr', + 'lit.': 'literacki, literatura', + 'lm': 'liczba mnoga', + 'łac.': 'łacina, łacińskie', + 'M.': 'mianownik', + 'm.': 'męski', + 'mat.': 'matematyka', + 'med.': 'medyczne', + 'meteor.': 'meteorologia, meteorologiczny', + 'min.': 'minuta', + 'm.in.': 'między innymi', + 'miner.': 'mineralogia', + 'mit.': 'mitologia', + 'mit. germ.': 'mitologia germańska', + 'mit. gr.': 'mitologia grecka', + 'mit. rzym.': 'mitologia rzymska', + 'mors.': 'morskie', + 'm.-os.': 'męskoosobowy', + 'Ms.': 'miejscownik', + 'muz.': 'muzyczny', + 'N.': 'narzędnik', + 'n.': 'nijaki', + 'ndk': 'niedokonany', + 'ndm': 'nieodmienny', + 'n.e.': 'nasza era', + 'nieos.': 'nieosobowy', + 'niem.': 'niemiecki', + 'norw.': 'norweski', + 'np.': 'na przykład', + 'obelż.': 'obelżywie', + 'odm.': 'odmienny', + 'ok.': 'około', + 'os.': 'osoba, osobowy', + 'płd.': 'południowy', + 'płn.': 'północny', + 'p.n.e.': 'przed naszą erą', + 'pocz.': 'początek', + 'poet.': 'poetyckie', + 'pogard.': 'pogardliwe', + 'pol.': 'polski', + 'polit.': 'polityczny', + 'poł.': 'połowa', + 'popr.': 'poprawnie', + 'por.': 'porównaj', + 'port.': 'portugalski', + 'posp.': 'pospolity', + 'pot.': 'potocznie', + 'praw.': 'prawo, prawnicze', + 'przen.': 'przenośnie', + 'przestarz.': 'przestarzałe', + 'przesz.': 'przeszły', + 'przym.': 'przymiotnik', + 'przysł.': 'przysłowiowy', + 'przysłów.': 'przysłówek', + 'przysz.': 'przyszły', + 'psychol.': 'psychologia, psychologiczny', + 'r.': 'rok', + 'r.m.': 'rodzaj męski', + 'r.n.': 'rodzaj nijaki', + 'r.ż.': 'rodzaj żeński', + 'reg.': 'regionalne', + 'rel.': 'religijny, religioznawstwo', + 'rodz.': 'rodzaj', + 'roln.': 'rolnictwo, rolniczy', + 'ros.': 'rosyjski', + 'rub.': 'rubasznie', + 'rum.': 'rumuński', + 'rzad.': 'rzadki', + 'rzecz.': 'rzeczownik', + 'rzym.': 'rzymski', + 'skand.': 'skandynawski', + 'skrót.': 'skrótowiec', + 'słowac.': 'słowacki', + 'socjol.': 'socjologiczny', + 'sport.': 'sportowy', + 'st.': 'stopień', + 'starop.': 'staropolskie', + 'staroż.': 'starożytny', + 'szt.': 'sztuka', + 'szwedz.': 'szwedzki', + 'śr.': 'środek, środkowy', + 'środ.': 'środowiskowy', + 'teatr.': 'teatralny', + 'techn.': 'techniczny', + 'temp.': 'temperatura', + 'ter.': 'teraźniejszy', + 'tur.': 'turecki', + 'tur.-tat.': 'turecko-tatarski', + 'tys.': 'tysiąc', + 'tzn.': 'to znaczy', + 'uczn.': 'uczniowski', + 'ukr.': 'ukraiński', + 'urb.': 'urbanistyka', + 'W.': 'wołacz', + 'w.': 'wiek', + 'węg.': 'węgierski', + 'wg': 'według', + 'wł.': 'włoski', + 'wojsk.': 'wojskowy', + 'wsch.': 'wschodni', + 'współ.': 'współcześnie', + 'wulg.': 'wulgarne', + 'wym.': 'wymawiaj', + 'zach.': 'zachodnie', + 'zdr.': 'zdrobnienie', + 'zgr.': 'zgrubienie', + 'zn.': 'znaczy, znaczenie', + 'zob.': 'zobacz', + 'zool.': 'zoologia', + 'zwł.': 'zwłaszcza', + 'ż.': 'żeński', + 'żart.': 'żartobliwie', + 'żegl.': 'żeglarskie', + } diff --git a/src/librarian/font-optimizer/.hg/00changelog.i b/src/librarian/font-optimizer/.hg/00changelog.i new file mode 100644 index 0000000..d3a8311 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/00changelog.i differ diff --git a/src/librarian/font-optimizer/.hg/branch b/src/librarian/font-optimizer/.hg/branch new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/src/librarian/font-optimizer/.hg/branch @@ -0,0 +1 @@ +default diff --git a/src/librarian/font-optimizer/.hg/branchheads.cache b/src/librarian/font-optimizer/.hg/branchheads.cache new file mode 100644 index 0000000..12049da --- /dev/null +++ b/src/librarian/font-optimizer/.hg/branchheads.cache @@ -0,0 +1,2 @@ +136826b53242c388267996d1febb0fea90193a06 28 +136826b53242c388267996d1febb0fea90193a06 default diff --git a/src/librarian/font-optimizer/.hg/dirstate b/src/librarian/font-optimizer/.hg/dirstate new file mode 100644 index 0000000..2c2e4dc Binary files /dev/null and b/src/librarian/font-optimizer/.hg/dirstate differ diff --git a/src/librarian/font-optimizer/.hg/hgrc b/src/librarian/font-optimizer/.hg/hgrc new file mode 100644 index 0000000..5945460 --- /dev/null +++ b/src/librarian/font-optimizer/.hg/hgrc @@ -0,0 +1,2 @@ +[paths] +default = http://bitbucket.org/philip/font-optimizer diff --git a/src/librarian/font-optimizer/.hg/requires b/src/librarian/font-optimizer/.hg/requires new file mode 100644 index 0000000..5175383 --- /dev/null +++ b/src/librarian/font-optimizer/.hg/requires @@ -0,0 +1,3 @@ +revlogv1 +store +fncache diff --git a/src/librarian/font-optimizer/.hg/store/00changelog.i b/src/librarian/font-optimizer/.hg/store/00changelog.i new file mode 100644 index 0000000..589167b Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/00changelog.i differ diff --git a/src/librarian/font-optimizer/.hg/store/00manifest.i b/src/librarian/font-optimizer/.hg/store/00manifest.i new file mode 100644 index 0000000..a0513b1 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/00manifest.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/.hgignore.i b/src/librarian/font-optimizer/.hg/store/data/.hgignore.i new file mode 100644 index 0000000..d5dd3e2 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/.hgignore.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/_font/_e_o_t_wrapper.pm.i b/src/librarian/font-optimizer/.hg/store/data/_font/_e_o_t_wrapper.pm.i new file mode 100644 index 0000000..1ad7150 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/_font/_e_o_t_wrapper.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/_font/_subsetter.pm.i b/src/librarian/font-optimizer/.hg/store/data/_font/_subsetter.pm.i new file mode 100644 index 0000000..5d17c4e Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/_font/_subsetter.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/_font/_subsetter/_normalization_data.pm.i b/src/librarian/font-optimizer/.hg/store/data/_font/_subsetter/_normalization_data.pm.i new file mode 100644 index 0000000..93d459c Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/_font/_subsetter/_normalization_data.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/_font/_subsetter/create-data.pl.i b/src/librarian/font-optimizer/.hg/store/data/_font/_subsetter/create-data.pl.i new file mode 100644 index 0000000..5ba7451 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/_font/_subsetter/create-data.pl.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/_l_i_c_e_n_s_e.i b/src/librarian/font-optimizer/.hg/store/data/_l_i_c_e_n_s_e.i new file mode 100644 index 0000000..d0cc9aa Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/_l_i_c_e_n_s_e.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/_r_e_a_d_m_e.txt.i b/src/librarian/font-optimizer/.hg/store/data/_r_e_a_d_m_e.txt.i new file mode 100644 index 0000000..b845651 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/_r_e_a_d_m_e.txt.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/convert-eot.pl.i b/src/librarian/font-optimizer/.hg/store/data/convert-eot.pl.i new file mode 100644 index 0000000..25a4a4b Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/convert-eot.pl.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/.cvsignore.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/.cvsignore.i new file mode 100644 index 0000000..304249e Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/.cvsignore.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_c_o_p_y_i_n_g.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_c_o_p_y_i_n_g.i new file mode 100644 index 0000000..d0f0482 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_c_o_p_y_i_n_g.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_changes.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_changes.i new file mode 100644 index 0000000..e022e4a Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_changes.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_m_a_n_i_f_e_s_t._s_k_i_p.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_m_a_n_i_f_e_s_t._s_k_i_p.i new file mode 100644 index 0000000..57b5f9d Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_m_a_n_i_f_e_s_t._s_k_i_p.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_makefile._p_l.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_makefile._p_l.i new file mode 100644 index 0000000..e008707 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_makefile._p_l.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_r_e_a_d_m_e._t_x_t.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_r_e_a_d_m_e._t_x_t.i new file mode 100644 index 0000000..8cc6335 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_r_e_a_d_m_e._t_x_t.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_t_o_d_o.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_t_o_d_o.i new file mode 100644 index 0000000..690178c Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/_t_o_d_o.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f.pm.i new file mode 100644 index 0000000..8b3c878 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_a_a_t_kern.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_a_a_t_kern.pm.i new file mode 100644 index 0000000..61243bc Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_a_a_t_kern.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_a_a_tutils.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_a_a_tutils.pm.i new file mode 100644 index 0000000..81cb366 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_a_a_tutils.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_anchor.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_anchor.pm.i new file mode 100644 index 0000000..831f79c Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_anchor.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_bsln.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_bsln.pm.i new file mode 100644 index 0000000..da72a7f Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_bsln.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_changes.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_changes.i new file mode 100644 index 0000000..ba56a59 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_changes.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_cmap.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_cmap.pm.i new file mode 100644 index 0000000..6ca0ef4 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_cmap.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_coverage.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_coverage.pm.i new file mode 100644 index 0000000..fbab57c Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_coverage.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_cvt__.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_cvt__.pm.i new file mode 100644 index 0000000..c9d0313 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_cvt__.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_delta.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_delta.pm.i new file mode 100644 index 0000000..c765c0c Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_delta.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_dumper.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_dumper.pm.i new file mode 100644 index 0000000..6f21a21 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_dumper.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_e_b_d_t.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_e_b_d_t.pm.i new file mode 100644 index 0000000..b189d1c Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_e_b_d_t.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_e_b_l_c.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_e_b_l_c.pm.i new file mode 100644 index 0000000..3ff5901 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_e_b_l_c.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fdsc.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fdsc.pm.i new file mode 100644 index 0000000..0cdb3e4 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fdsc.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_feat.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_feat.pm.i new file mode 100644 index 0000000..77d19bc Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_feat.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fmtx.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fmtx.pm.i new file mode 100644 index 0000000..eab522e Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fmtx.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_font.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_font.pm.i new file mode 100644 index 0000000..6749bda Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_font.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fpgm.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fpgm.pm.i new file mode 100644 index 0000000..7a3472b Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_fpgm.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_d_e_f.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_d_e_f.pm.i new file mode 100644 index 0000000..7ee4f49 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_d_e_f.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_p_o_s.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_p_o_s.pm.i new file mode 100644 index 0000000..2cb1d44 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_p_o_s.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_s_u_b.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_s_u_b.pm.i new file mode 100644 index 0000000..c15662e Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_g_s_u_b.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_glyf.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_glyf.pm.i new file mode 100644 index 0000000..0d9f502 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_glyf.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_glyph.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_glyph.pm.i new file mode 100644 index 0000000..59cfdd5 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_glyph.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_gr_feat.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_gr_feat.pm.i new file mode 100644 index 0000000..390bb2d Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_gr_feat.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hdmx.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hdmx.pm.i new file mode 100644 index 0000000..df875b2 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hdmx.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_head.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_head.pm.i new file mode 100644 index 0000000..2a27c08 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_head.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hhea.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hhea.pm.i new file mode 100644 index 0000000..2048db2 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hhea.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hmtx.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hmtx.pm.i new file mode 100644 index 0000000..ccebc5b Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_hmtx.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern.pm.i new file mode 100644 index 0000000..ab7c2fa Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_class_array.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_class_array.pm.i new file mode 100644 index 0000000..f8d3ac1 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_class_array.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_compact_class_array.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_compact_class_array.pm.i new file mode 100644 index 0000000..ae4c920 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_compact_class_array.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_ordered_list.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_ordered_list.pm.i new file mode 100644 index 0000000..1ee7c8a Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_ordered_list.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_state_table.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_state_table.pm.i new file mode 100644 index 0000000..8473671 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_state_table.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_subtable.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_subtable.pm.i new file mode 100644 index 0000000..a171a02 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_kern/_subtable.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_l_t_s_h.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_l_t_s_h.pm.i new file mode 100644 index 0000000..cdb08e4 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_l_t_s_h.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_loca.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_loca.pm.i new file mode 100644 index 0000000..0e9131d Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_loca.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_manual.pod.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_manual.pod.i new file mode 100644 index 0000000..94fb1f9 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_manual.pod.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_maxp.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_maxp.pm.i new file mode 100644 index 0000000..1e8a342 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_maxp.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort.pm.i new file mode 100644 index 0000000..2d39c95 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_chain.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_chain.pm.i new file mode 100644 index 0000000..2ec8260 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_chain.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_contextual.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_contextual.pm.i new file mode 100644 index 0000000..d366880 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_contextual.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_insertion.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_insertion.pm.i new file mode 100644 index 0000000..05e84e1 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_insertion.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_ligature.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_ligature.pm.i new file mode 100644 index 0000000..c36b902 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_ligature.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_noncontextual.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_noncontextual.pm.i new file mode 100644 index 0000000..6f3dd29 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_noncontextual.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_rearrangement.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_rearrangement.pm.i new file mode 100644 index 0000000..fba11e9 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_rearrangement.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_subtable.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_subtable.pm.i new file mode 100644 index 0000000..93a96a6 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_mort/_subtable.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_name.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_name.pm.i new file mode 100644 index 0000000..77d07a6 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_name.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_o_s__2.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_o_s__2.pm.i new file mode 100644 index 0000000..680915c Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_o_s__2.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_o_t_tags.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_o_t_tags.pm.i new file mode 100644 index 0000000..35d40fd Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_o_t_tags.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_old_cmap.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_old_cmap.pm.i new file mode 100644 index 0000000..e28e8f5 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_old_cmap.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_old_mort.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_old_mort.pm.i new file mode 100644 index 0000000..8569493 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_old_mort.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_p_c_l_t.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_p_c_l_t.pm.i new file mode 100644 index 0000000..8d8f7e3 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_p_c_l_t.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_p_s_names.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_p_s_names.pm.i new file mode 100644 index 0000000..6f687e2 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_p_s_names.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_post.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_post.pm.i new file mode 100644 index 0000000..43aea94 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_post.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_prep.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_prep.pm.i new file mode 100644 index 0000000..83259b6 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_prep.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_prop.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_prop.pm.i new file mode 100644 index 0000000..1885a0f Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_prop.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_segarr.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_segarr.pm.i new file mode 100644 index 0000000..eb03abd Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_segarr.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_sill.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_sill.pm.i new file mode 100644 index 0000000..c30cc85 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_sill.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_table.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_table.pm.i new file mode 100644 index 0000000..3ca1604 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_table.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_ttc.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_ttc.pm.i new file mode 100644 index 0000000..366ba1a Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_ttc.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_ttopen.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_ttopen.pm.i new file mode 100644 index 0000000..bb07642 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_ttopen.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_useall.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_useall.pm.i new file mode 100644 index 0000000..727a333 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_useall.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_utils.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_utils.pm.i new file mode 100644 index 0000000..5bf9612 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_utils.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_vhea.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_vhea.pm.i new file mode 100644 index 0000000..1972e4b Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_vhea.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_vmtx.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_vmtx.pm.i new file mode 100644 index 0000000..3756ed1 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_vmtx.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_win32.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_win32.pm.i new file mode 100644 index 0000000..25b5628 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_win32.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_x_m_lparse.pm.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_x_m_lparse.pm.i new file mode 100644 index 0000000..2bbc5ae Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/_font/_t_t_f/_x_m_lparse.pm.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/ttfmod.pl.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/ttfmod.pl.i new file mode 100644 index 0000000..e50d2ca Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/lib/ttfmod.pl.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/_o_f_l.txt.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/_o_f_l.txt.i new file mode 100644 index 0000000..0b8fb4b Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/_o_f_l.txt.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/tags.t.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/tags.t.i new file mode 100644 index 0000000..4181bf2 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/tags.t.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/testfont.ttf.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/testfont.ttf.i new file mode 100644 index 0000000..57ac10e Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/testfont.ttf.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/ttfcopy.t.i b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/ttfcopy.t.i new file mode 100644 index 0000000..5ce2b98 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/ext/_font-_t_t_f/t/ttfcopy.t.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/gen-tests.pl.i b/src/librarian/font-optimizer/.hg/store/data/gen-tests.pl.i new file mode 100644 index 0000000..815d800 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/gen-tests.pl.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/list-features.pl.i b/src/librarian/font-optimizer/.hg/store/data/list-features.pl.i new file mode 100644 index 0000000..1b72a5d Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/list-features.pl.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/modify-names.pl.i b/src/librarian/font-optimizer/.hg/store/data/modify-names.pl.i new file mode 100644 index 0000000..dfd5924 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/modify-names.pl.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/obfuscate-font.pl.i b/src/librarian/font-optimizer/.hg/store/data/obfuscate-font.pl.i new file mode 100644 index 0000000..7853c72 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/obfuscate-font.pl.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/obfuscate-names.pl.i b/src/librarian/font-optimizer/.hg/store/data/obfuscate-names.pl.i new file mode 100644 index 0000000..4120d0e Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/obfuscate-names.pl.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/subset.pl.i b/src/librarian/font-optimizer/.hg/store/data/subset.pl.i new file mode 100644 index 0000000..6dd0437 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/subset.pl.i differ diff --git a/src/librarian/font-optimizer/.hg/store/data/t/subsetter.pl.i b/src/librarian/font-optimizer/.hg/store/data/t/subsetter.pl.i new file mode 100644 index 0000000..122eaa2 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/data/t/subsetter.pl.i differ diff --git a/src/librarian/font-optimizer/.hg/store/fncache b/src/librarian/font-optimizer/.hg/store/fncache new file mode 100644 index 0000000..f8f8690 --- /dev/null +++ b/src/librarian/font-optimizer/.hg/store/fncache @@ -0,0 +1,94 @@ +data/.hgignore.i +data/Font/EOTWrapper.pm.i +data/Font/Subsetter.pm.i +data/Font/Subsetter/NormalizationData.pm.i +data/Font/Subsetter/create-data.pl.i +data/LICENSE.i +data/README.txt.i +data/convert-eot.pl.i +data/ext/Font-TTF/.cvsignore.i +data/ext/Font-TTF/COPYING.i +data/ext/Font-TTF/Changes.i +data/ext/Font-TTF/MANIFEST.SKIP.i +data/ext/Font-TTF/Makefile.PL.i +data/ext/Font-TTF/README.TXT.i +data/ext/Font-TTF/TODO.i +data/ext/Font-TTF/lib/Font/TTF.pm.i +data/ext/Font-TTF/lib/Font/TTF/AATKern.pm.i +data/ext/Font-TTF/lib/Font/TTF/AATutils.pm.i +data/ext/Font-TTF/lib/Font/TTF/Anchor.pm.i +data/ext/Font-TTF/lib/Font/TTF/Bsln.pm.i +data/ext/Font-TTF/lib/Font/TTF/Changes.i +data/ext/Font-TTF/lib/Font/TTF/Cmap.pm.i +data/ext/Font-TTF/lib/Font/TTF/Coverage.pm.i +data/ext/Font-TTF/lib/Font/TTF/Cvt_.pm.i +data/ext/Font-TTF/lib/Font/TTF/Delta.pm.i +data/ext/Font-TTF/lib/Font/TTF/Dumper.pm.i +data/ext/Font-TTF/lib/Font/TTF/EBDT.pm.i +data/ext/Font-TTF/lib/Font/TTF/EBLC.pm.i +data/ext/Font-TTF/lib/Font/TTF/Fdsc.pm.i +data/ext/Font-TTF/lib/Font/TTF/Feat.pm.i +data/ext/Font-TTF/lib/Font/TTF/Fmtx.pm.i +data/ext/Font-TTF/lib/Font/TTF/Font.pm.i +data/ext/Font-TTF/lib/Font/TTF/Fpgm.pm.i +data/ext/Font-TTF/lib/Font/TTF/GDEF.pm.i +data/ext/Font-TTF/lib/Font/TTF/GPOS.pm.i +data/ext/Font-TTF/lib/Font/TTF/GSUB.pm.i +data/ext/Font-TTF/lib/Font/TTF/Glyf.pm.i +data/ext/Font-TTF/lib/Font/TTF/Glyph.pm.i +data/ext/Font-TTF/lib/Font/TTF/GrFeat.pm.i +data/ext/Font-TTF/lib/Font/TTF/Hdmx.pm.i +data/ext/Font-TTF/lib/Font/TTF/Head.pm.i +data/ext/Font-TTF/lib/Font/TTF/Hhea.pm.i +data/ext/Font-TTF/lib/Font/TTF/Hmtx.pm.i +data/ext/Font-TTF/lib/Font/TTF/Kern.pm.i +data/ext/Font-TTF/lib/Font/TTF/Kern/ClassArray.pm.i +data/ext/Font-TTF/lib/Font/TTF/Kern/CompactClassArray.pm.i +data/ext/Font-TTF/lib/Font/TTF/Kern/OrderedList.pm.i +data/ext/Font-TTF/lib/Font/TTF/Kern/StateTable.pm.i +data/ext/Font-TTF/lib/Font/TTF/Kern/Subtable.pm.i +data/ext/Font-TTF/lib/Font/TTF/LTSH.pm.i +data/ext/Font-TTF/lib/Font/TTF/Loca.pm.i +data/ext/Font-TTF/lib/Font/TTF/Manual.pod.i +data/ext/Font-TTF/lib/Font/TTF/Maxp.pm.i +data/ext/Font-TTF/lib/Font/TTF/Mort.pm.i +data/ext/Font-TTF/lib/Font/TTF/Mort/Chain.pm.i +data/ext/Font-TTF/lib/Font/TTF/Mort/Contextual.pm.i +data/ext/Font-TTF/lib/Font/TTF/Mort/Insertion.pm.i +data/ext/Font-TTF/lib/Font/TTF/Mort/Ligature.pm.i +data/ext/Font-TTF/lib/Font/TTF/Mort/Noncontextual.pm.i +data/ext/Font-TTF/lib/Font/TTF/Mort/Rearrangement.pm.i +data/ext/Font-TTF/lib/Font/TTF/Mort/Subtable.pm.i +data/ext/Font-TTF/lib/Font/TTF/Name.pm.i +data/ext/Font-TTF/lib/Font/TTF/OS_2.pm.i +data/ext/Font-TTF/lib/Font/TTF/OTTags.pm.i +data/ext/Font-TTF/lib/Font/TTF/OldCmap.pm.i +data/ext/Font-TTF/lib/Font/TTF/OldMort.pm.i +data/ext/Font-TTF/lib/Font/TTF/PCLT.pm.i +data/ext/Font-TTF/lib/Font/TTF/PSNames.pm.i +data/ext/Font-TTF/lib/Font/TTF/Post.pm.i +data/ext/Font-TTF/lib/Font/TTF/Prep.pm.i +data/ext/Font-TTF/lib/Font/TTF/Prop.pm.i +data/ext/Font-TTF/lib/Font/TTF/Segarr.pm.i +data/ext/Font-TTF/lib/Font/TTF/Sill.pm.i +data/ext/Font-TTF/lib/Font/TTF/Table.pm.i +data/ext/Font-TTF/lib/Font/TTF/Ttc.pm.i +data/ext/Font-TTF/lib/Font/TTF/Ttopen.pm.i +data/ext/Font-TTF/lib/Font/TTF/Useall.pm.i +data/ext/Font-TTF/lib/Font/TTF/Utils.pm.i +data/ext/Font-TTF/lib/Font/TTF/Vhea.pm.i +data/ext/Font-TTF/lib/Font/TTF/Vmtx.pm.i +data/ext/Font-TTF/lib/Font/TTF/Win32.pm.i +data/ext/Font-TTF/lib/Font/TTF/XMLparse.pm.i +data/ext/Font-TTF/lib/ttfmod.pl.i +data/ext/Font-TTF/t/OFL.txt.i +data/ext/Font-TTF/t/tags.t.i +data/ext/Font-TTF/t/testfont.ttf.i +data/ext/Font-TTF/t/ttfcopy.t.i +data/gen-tests.pl.i +data/list-features.pl.i +data/modify-names.pl.i +data/obfuscate-font.pl.i +data/obfuscate-names.pl.i +data/subset.pl.i +data/t/subsetter.pl.i diff --git a/src/librarian/font-optimizer/.hg/store/undo b/src/librarian/font-optimizer/.hg/store/undo new file mode 100644 index 0000000..d1ad357 Binary files /dev/null and b/src/librarian/font-optimizer/.hg/store/undo differ diff --git a/src/librarian/font-optimizer/.hg/tags.cache b/src/librarian/font-optimizer/.hg/tags.cache new file mode 100644 index 0000000..b27879b --- /dev/null +++ b/src/librarian/font-optimizer/.hg/tags.cache @@ -0,0 +1,2 @@ +28 136826b53242c388267996d1febb0fea90193a06 + diff --git a/src/librarian/font-optimizer/.hg/undo.branch b/src/librarian/font-optimizer/.hg/undo.branch new file mode 100644 index 0000000..331d858 --- /dev/null +++ b/src/librarian/font-optimizer/.hg/undo.branch @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/src/librarian/font-optimizer/.hg/undo.desc b/src/librarian/font-optimizer/.hg/undo.desc new file mode 100644 index 0000000..4f5da8a --- /dev/null +++ b/src/librarian/font-optimizer/.hg/undo.desc @@ -0,0 +1,3 @@ +0 +pull +http://bitbucket.org/philip/font-optimizer diff --git a/src/librarian/font-optimizer/.hg/undo.dirstate b/src/librarian/font-optimizer/.hg/undo.dirstate new file mode 100644 index 0000000..e69de29 diff --git a/src/librarian/font-optimizer/.hgignore b/src/librarian/font-optimizer/.hgignore new file mode 100644 index 0000000..5fe60d8 --- /dev/null +++ b/src/librarian/font-optimizer/.hgignore @@ -0,0 +1,4 @@ +~$ +^testoutput/ +^testfonts/ +^tmp/ diff --git a/src/librarian/font-optimizer/Font/EOTWrapper.pm b/src/librarian/font-optimizer/Font/EOTWrapper.pm new file mode 100644 index 0000000..297b930 --- /dev/null +++ b/src/librarian/font-optimizer/Font/EOTWrapper.pm @@ -0,0 +1,141 @@ +# Copyright (c) 2009 Philip Taylor +# +# 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. + +package Font::EOTWrapper; + +use strict; +use warnings; + +use Font::TTF::Font; +use Encode; + +use constant TTEMBED_SUBSET => 0x00000001; +use constant TTEMBED_TTCOMPRESSED => 0x00000004; +use constant TTEMBED_XORENCRYPTDATA => 0x10000000; +use constant DEFAULT_CHARSET => 0x01; + +sub convert { + my ($in_fn, $out_fn) = @_; + + my $font_data = do { + open my $fh, $in_fn or die "Failed to open $in_fn: $!"; + binmode $fh; + local $/; + <$fh> + }; + + my $font = Font::TTF::Font->open($in_fn) or die "Failed to open $in_fn: $!"; + + open my $out, '>', $out_fn or die "Failed to open $out_fn: $!"; + binmode $out; + + $font->{name}->read if $font->{name}; + + my $os2 = $font->{'OS/2'}; + $os2->read; + + my $rootString = ''; + + my $header = ''; + $header .= pack V => length($font_data); + $header .= pack V => 0x00020001; + $header .= pack V => TTEMBED_SUBSET; + $header .= pack C10 => map $os2->{$_}, qw(bFamilyType bSerifStyle bWeight bProportion bContrast bStrokeVariation bArmStyle bLetterform bMidline bXheight); + $header .= pack C => DEFAULT_CHARSET; + $header .= pack C => (($os2->{fsSelection} & 1) ? 1 : 0); + $header .= pack V => $os2->{usWeightClass}; + $header .= pack v => $os2->{fsType}; + $header .= pack v => 0x504C; + $header .= pack VVVV => map $os2->{$_}, qw(ulUnicodeRange1 ulUnicodeRange2 ulUnicodeRange3 ulUnicodeRange4); + $header .= pack VV => map $os2->{$_}, qw(ulCodePageRange1 ulCodePageRange2); + $header .= pack V => $font->{head}{checkSumAdjustment}; + $header .= pack VVVV => 0, 0, 0, 0; + $header .= pack v => 0; + $header .= pack 'v/a*' => encode 'utf-16le' => $font->{name}->find_name(1); # family name + $header .= pack v => 0; + $header .= pack 'v/a*' => encode 'utf-16le' => $font->{name}->find_name(2); # style name + $header .= pack v => 0; + $header .= pack 'v/a*' => encode 'utf-16le' => $font->{name}->find_name(5); # version name + $header .= pack v => 0; + $header .= pack 'v/a*' => encode 'utf-16le' => $font->{name}->find_name(4); # full name + $header .= pack v => 0; + $header .= pack 'v/a*' => encode 'utf-16le' => $rootString; + + $out->print(pack V => 4 + length($header) + length($font_data)); + $out->print($header); + $out->print($font_data); + + $font->release; +} + +sub extract { + my ($in_fn, $out_fn) = @_; + + my $eot_data = do { + open my $fh, $in_fn or die "Failed to open $in_fn: $!"; + binmode $fh; + local $/; + <$fh> + }; + + die "Error: EOT too small" if length $eot_data < 16; + + my ($eot_size, $font_data_size, $version, $flags) = unpack VVVV => substr $eot_data, 0, 16; + + die "Error: Invalid EOTSize ($eot_size, should be ".(length $eot_data).")" if $eot_size != length $eot_data; + die "Error: Invalid Version ($version)" if not ($version == 0x00020000 or $version == 0x00020001 or $version == 0x00020002); + die "Error: Can't handle compressed fonts" if $flags & TTEMBED_TTCOMPRESSED; + + # Skip the header fields + my $rest = substr $eot_data, 16+66; + + my ($family_name, $style_name, $version_name, $full_name, $rest2) = unpack 'v/a* xx v/a* xx v/a* xx v/a* a*' => $rest; + + my $font_data; + if ($version == 0x00020000) { # not 0x00010000 - spec is wrong (http://lists.w3.org/Archives/Public/www-font/2009JulSep/0862.html) + $font_data = $rest2; + } elsif ($version == 0x00020001) { + my ($root, $data) = unpack 'xx v/a* a*' => $rest2; + $font_data = $data; + } elsif ($version == 0x00020002) { + my ($root, $root_checksum, $eudc_codepage, $signature, $eudc_flags, $eudc_font, $data) + = unpack 'xx v/a* V V xx v/a* V v/a* a*' => $rest2; + $font_data = $data; + } + + if ($flags & TTEMBED_XORENCRYPTDATA) { + $font_data ^= ("\x50" x length $font_data); + } + + open my $fh, '>', $out_fn or die "Failed to open $out_fn: $!"; + binmode $fh; + print $fh $font_data; +} + +# sub rootStringChecksum { +# my $s = 0; +# $s += $_ for unpack 'C*', $_[0]; +# return $s ^ 0x50475342; +# } + +1; diff --git a/src/librarian/font-optimizer/Font/Subsetter.pm b/src/librarian/font-optimizer/Font/Subsetter.pm new file mode 100644 index 0000000..7aa60dc --- /dev/null +++ b/src/librarian/font-optimizer/Font/Subsetter.pm @@ -0,0 +1,1606 @@ +# Copyright (c) 2009 Philip Taylor +# +# 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. + +package Font::Subsetter; + +use strict; +use warnings; + +use Carp; +use Unicode::Normalize(); +use Digest::SHA qw(sha1_hex); +use Encode; + +use Font::TTF; +use Font::TTF::Font; + +if ($Font::TTF::VERSION =~ /^0\.([0-3].|4[0-5])$/) { + die "You are using an old version of Font::TTF ($Font::TTF::VERSION) - you need at least v0.46, and preferably the latest SVN trunk from ."; +} + +# Tables can be: +# REQUIRED - will fail if it's not present +# FORBIDDEN - will fail if it's present +# OPTIONAL - will be accepted regardless of whether it's there or not +# IGNORED - like OPTIONAL, but no processing will take place +# UNFINISHED - will emit a warning if it's present, because the code doesn't handle it properly yet +# DROP - will be deleted from the font +# The default for unmentioned tables is FORBIDDEN +my %font_tables = ( + 'cmap' => ['REQUIRED'], + 'head' => ['REQUIRED'], + 'hhea' => ['REQUIRED'], + 'hmtx' => ['REQUIRED'], + 'maxp' => ['REQUIRED'], + 'name' => ['REQUIRED'], + 'OS/2' => ['REQUIRED'], + 'post' => ['REQUIRED'], + # TrueType outlines: + 'cvt ' => ['IGNORED'], + 'fpgm' => ['IGNORED'], + 'glyf' => ['IGNORED'], + 'loca' => ['OPTIONAL'], + 'prep' => ['OPTIONAL'], + # PostScript outlines: (TODO: support these?) + 'CFF ' => ['FORBIDDEN'], + 'VORG' => ['FORBIDDEN'], + # Bitmap glyphs: (TODO: support these?) + 'EBDT' => ['DROP', 'embedded bitmap glyphs will be lost'], + 'EBLC' => ['DROP', 'embedded bitmap glyphs will be lost'], + 'EBSC' => ['DROP', 'embedded bitmap glyphs will be lost'], + # Advanced typographic tables: + 'BASE' => ['UNFINISHED'], + 'GDEF' => ['OPTIONAL'], + 'GPOS' => ['OPTIONAL'], + 'GSUB' => ['OPTIONAL'], + 'JSTF' => ['UNFINISHED'], + # OpenType tables: + 'DSIG' => ['DROP'], # digital signature - don't need it here + 'gasp' => ['IGNORED'], + 'hdmx' => ['OPTIONAL'], + 'kern' => ['OPTIONAL'], + 'LTSH' => ['OPTIONAL'], + 'PCLT' => ['UNFINISHED'], + 'VDMX' => ['IGNORED'], + 'vhea' => ['UNFINISHED'], + 'vmtx' => ['UNFINISHED'], + # SIL Graphite tables: + 'Feat' => ['DROP'], + 'Silf' => ['DROP'], + 'Sill' => ['DROP'], + 'Silt' => ['DROP'], + 'Glat' => ['DROP'], + 'Gloc' => ['DROP'], + # FontForge tables: + 'PfEd' => ['DROP'], + 'FFTM' => ['DROP'], + # Apple Advanced Typography tables: + # (These get dropped because it's better to use cross-platform features instead) + 'feat' => ['DROP'], + 'morx' => ['DROP'], + 'prop' => ['DROP'], + # Undocumented(?) extension for some kind of maths stuff + 'MATH' => ['DROP'], +); + +sub check_tables { + my ($self) = @_; + my $font = $self->{font}; + + my @tables = grep /^[^ ]...$/, sort keys %$font; + for (@tables) { + my $t = $font_tables{$_}; + if (not $t) { + die "Uses unrecognised table '$_'\n"; + } else { + my $status = $t->[0]; + if ($status eq 'FORBIDDEN') { + die "Uses forbidden table '$_'\n"; + } elsif ($status eq 'UNFINISHED') { + warn "Uses unhandled table '$_'\n"; + } elsif ($status eq 'DROP') { + my $note = ($t->[1] ? ' - '.$t->[1] : ''); + warn "Dropping table '$_'$note\n"; + delete $font->{$_}; + } elsif ($status eq 'OPTIONAL') { + } elsif ($status eq 'IGNORED') { + } elsif ($status eq 'REQUIRED') { + } else { + die "Invalid table status $status"; + } + } + } + # TODO: check required tables are present + # TODO: check TrueType or PostScript tables are present +} + +sub read_tables { + my ($self) = @_; + my $font = $self->{font}; + + # Read all the tables that will be needed in the future. + # (In particular, read them before modifying numGlyphs, + # beacuse they often depend on that value.) + for (qw( + cmap hmtx name OS/2 post + glyf loca + BASE GDEF GPOS GSUB JSTF + hdmx kern LTSH + )) { + $font->{$_}->read if $font->{$_}; + } +} + +sub find_codepoint_glyph_mappings { + my ($self) = @_; + my $font = $self->{font}; + + # Find the glyph->codepoint mappings + + my %glyphs; + for my $table (@{$font->{cmap}{Tables}}) { + for my $cp (keys %{$table->{val}}) { + + my $ucp; # Unicode code point + + if ($table->{Platform} == 0 # Unicode + or ($table->{Platform} == 3 and # Windows + ($table->{Encoding} == 1 or # Unicode BMP + $table->{Encoding} == 10)) # Unicode full + ) { + $ucp = $cp; + } elsif ($table->{Platform} == 1 # Mac + and $table->{Encoding} == 0) # Roman + { + $ucp = ord(decode('MacRoman', pack C => $cp)); + } else { + # This table might not map directly onto Unicode codepoints, + # so warn about it + warn "Unrecognised cmap table type (platform $table->{Platform}, encoding $table->{Encoding}) - ignoring its character/glyph mappings\n"; + next; + } + + my $g = $table->{val}{$cp}; # glyph id + $glyphs{$g}{$ucp} = 1; + } + } + $self->{glyphs} = \%glyphs; +} + +sub expand_wanted_chars { + my ($self, $chars) = @_; + # OS X browsers (via ATSUI?) appear to convert text into + # NFC before rendering it. + # So input like "i{combining grave}" is converted to "{i grave}" + # before it's even passed to the font's substitution tables. + # So if @chars contains i and {combining grave}, then we have to + # add {i grave} because that might get used. + # + # So... Include all the unchanged characters. Also include the NFC + # of each character. Then use NormalizationData to add any characters + # that can result from NFCing a string of the wanted characters. + + if (0) { # change to 1 to disable all this fancy stuff + my %cs = map { ord $_ => 1 } split '', $chars; + return %cs; + } + + my %cs = map { ord $_ => 1, ord Unicode::Normalize::NFC($_) => 1 } split '', $chars; + require Font::Subsetter::NormalizationData; + my %new_cs; + for my $c (@Font::Subsetter::NormalizationData::data) { + # Skip this if we've already got the composed character + next if $cs{$c->[0]}; + # Skip this if we don't have all the decomposed characters + next if grep !$cs{$_}, @{$c}[1..$#$c]; + # Otherwise we want the composed character + $new_cs{$c->[0]} = 1; + } + $cs{$_} = 1 for keys %new_cs; + return %cs; +} + +sub want_feature { + my ($self, $wanted, $feature) = @_; + # If no feature list was specified, accept all features + return 1 if not $wanted; + # Otherwise find the four-character tag + $feature =~ /^(\w{4})( _\d+)?$/ or die "Unrecognised feature tag syntax '$feature'"; + return $wanted->{$1} if exists $wanted->{$1}; + return $wanted->{DEFAULT} if exists $wanted->{DEFAULT}; + return 1; +} + +sub find_wanted_lookup_ids { + my ($self, $table) = @_; + + # If we wanted to include all lookups: + # return 0..$#{$table->{LOOKUP}}; + # but actually we only want ones used by wanted features + + my %lookups; + for my $feat_tag (@{$table->{FEATURES}{FEAT_TAGS}}) { + next if not $self->want_feature($self->{features}, $feat_tag); + for (@{$table->{FEATURES}{$feat_tag}{LOOKUPS}}) { + $lookups{$_} = 1; + } + } + + # Iteratively add any chained lookups + my $changed = 1; + while ($changed) { + $changed = 0; + for my $lookup_id (0..$#{$table->{LOOKUP}}) { + next unless $lookups{$lookup_id}; + my $lookup = $table->{LOOKUP}[$lookup_id]; + for my $sub (@{$lookup->{SUB}}) { + if ($sub->{ACTION_TYPE} eq 'l') { + for my $rule (@{$sub->{RULES}}) { + for my $chain (@$rule) { + for my $action (@{$chain->{ACTION}}) { + for (0..@$action/2-1) { + # action is array of (offset, lookup) + $changed = 1 if not $lookups{$action->[$_*2+1]}; + $lookups{$action->[$_*2+1]} = 1; + } + } + } + } + } + } + } + } + + my @keys = sort { $a <=> $b } keys %lookups; + return @keys; +} + +sub find_wanted_glyphs { + my ($self, $chars) = @_; + my $font = $self->{font}; + + my %wanted_chars = $self->expand_wanted_chars($chars); + $self->{wanted_glyphs} = {}; + + # http://www.microsoft.com/typography/otspec/recom.htm suggests that fonts + # should include .notdef, .null, CR, space; so include them all here, if they + # are already defined + if ($font->{post}{VAL}) { + for my $gid (0..$#{$font->{loca}{glyphs}}) { + my $name = $font->{post}{VAL}[$gid]; + if ($name and ($name eq '.notdef' or $name eq '.null' or $name eq 'CR' or $name eq 'space')) { + $self->{wanted_glyphs}{$gid} = 1; + } + } + } else { + # If post.FormatType == 3 then we don't have any glyph names + # so just assume it's the first four + $self->{wanted_glyphs}{$_} = 1 for 0..3; + } + + # We want any glyphs used directly by any characters we want + for my $gid (keys %{$self->{glyphs}}) { + for my $cp (keys %{$self->{glyphs}{$gid}}) { + $self->{wanted_glyphs}{$gid} = 1 if $wanted_chars{$cp}; + } + } + + # Iteratively find new glyphs, until convergence + my @newly_wanted_glyphs = keys %{$self->{wanted_glyphs}}; + while (@newly_wanted_glyphs) { + my @new_glyphs; + + if ($font->{GSUB}) { + + # Handle ligatures and similar things + # (e.g. if we want 'f' and 'i', we want the 'fi' ligature too) + # (NOTE: a lot of this code is duplicating the form of + # fix_gsub, so they ought to be kept roughly in sync) + # + # TODO: There's probably loads of bugs in here, so it + # should be checked and tested more + + for my $lookup_id ($self->find_wanted_lookup_ids($font->{GSUB})) { + my $lookup = $font->{GSUB}{LOOKUP}[$lookup_id]; + for my $sub (@{$lookup->{SUB}}) { + + # Handle the glyph-delta case + if ($sub->{ACTION_TYPE} eq 'o') { + my $adj = $sub->{ADJUST}; + if ($adj >= 32768) { $adj -= 65536 } # fix Font::TTF::Bug (http://rt.cpan.org/Ticket/Display.html?id=42727) + my @covs = $self->coverage_array($sub->{COVERAGE}); + for (@covs) { + # If we want the coveraged glyph, we also want + # that glyph plus delta + if ($self->{wanted_glyphs}{$_}) { + my $new = $_ + $adj; + next if $self->{wanted_glyphs}{$new}; + push @new_glyphs, $new; + $self->{wanted_glyphs}{$new} = 1; + } + } + next; + } + + # Collect the rules which might match initially something + my @rulesets; + if ($sub->{RULES}) { + if (($lookup->{TYPE} == 5 or $lookup->{TYPE} == 6) + and $sub->{FORMAT} == 2) { + # RULES corresponds to class values + # TODO: ought to filter this by classes that contain wanted glyphs + push @rulesets, @{$sub->{RULES}}; + } elsif (($lookup->{TYPE} == 5 or $lookup->{TYPE} == 6) + and $sub->{FORMAT} == 3) { + # COVERAGE is empty; accept all the RULEs, and + # we'll look inside their MATCHes later + push @rulesets, @{$sub->{RULES}}; + } else { + # COVERAGE lists glyphs, and there's a RULE for + # each, so extract the RULEs for wanted COVERAGE + # values + my @covs = $self->coverage_array($sub->{COVERAGE}); + die unless @{$sub->{RULES}} == @covs; + for my $i (0..$#covs) { + if ($self->{wanted_glyphs}{$covs[$i]}) { + push @rulesets, $sub->{RULES}[$i]; + } + } + } + } + + # Collect the rules whose MATCH matches + my @rules; + RULE: for my $rule (map @$_, @rulesets) { + if (not defined $sub->{MATCH_TYPE}) { + # No extra matching other than COVERAGE, + # so just accept this rule + } elsif ($sub->{MATCH_TYPE} eq 'g') { + # RULES->MATCH/PRE/POST are arrays of glyphs that must all match + for my $c (qw(MATCH PRE POST)) { + next unless $rule->{$c}; + next RULE if grep { not $self->{wanted_glyphs}{$_} } @{$rule->{$c}}; + } + } elsif ($sub->{MATCH_TYPE} eq 'o') { + # RULES->MATCH/PRE/POST are arrays of coverage tables, + # and at least one glyph from each table must match + die unless @{$sub->{RULES}} == 1; + die unless @{$sub->{RULES}[0]} == 1; + for my $c (qw(MATCH PRE POST)) { + next unless $sub->{RULES}[0][0]{$c}; + for (@{$sub->{RULES}[0][0]{$c}}) { + my $matched = 0; + for (keys %{$_->{val}}) { + if ($self->{wanted_glyphs}{$_}) { + $matched = 1; + last; + } + } + next RULE if not $matched; + } + } + } elsif ($sub->{MATCH_TYPE} eq 'c') { + # TODO: only includes rules using classes that contain + # wanted glyphs. + # For now, just conservatively accept everything. + } else { + die "Invalid MATCH_TYPE"; + } + push @rules, $rule; + } + + # Find the glyphs in the relevant actions + for my $rule (@rules) { + if ($sub->{ACTION_TYPE} eq 'g') { + die unless $rule->{ACTION}; + for my $new (@{$rule->{ACTION}}) { + next if $self->{wanted_glyphs}{$new}; + push @new_glyphs, $new; + $self->{wanted_glyphs}{$new} = 1; +# warn "adding $new"; + } + } elsif ($sub->{ACTION_TYPE} eq 'l') { + # do nothing - this is just a lookup to run some other rules + } elsif ($sub->{ACTION_TYPE} eq 'a') { + # do nothing - we don't want the alternative glyphs + } else { + die "Invalid ACTION_TYPE"; + } + } + } + } + } + + @newly_wanted_glyphs = @new_glyphs; + } + + # Now we want to add glyphs that are used for composite rendering, + # which don't participate in any GSUB behaviour + @newly_wanted_glyphs = keys %{$self->{wanted_glyphs}}; + while (@newly_wanted_glyphs) { + my @new_glyphs; + + if ($font->{loca}) { + # If we want a composite glyph, we want all of its + # component glyphs too + # (e.g. á is the 'a' glyph plus the acute glyph): + for my $gid (@newly_wanted_glyphs) { + my $glyph = $font->{loca}{glyphs}[$gid]; + next unless $glyph; + $glyph->read; + next unless $glyph->{numberOfContours} == -1; + $glyph->read_dat; + for (@{$glyph->{comps}}) { + next if $self->{wanted_glyphs}{$_->{glyph}}; + push @new_glyphs, $_->{glyph}; + $self->{wanted_glyphs}{$_->{glyph}} = 1; + } + $glyph->update; + } + } + + @newly_wanted_glyphs = @new_glyphs; + } +} + +sub update_classdef_table { + my ($self, $table) = @_; + die "Expected table" if not $table; + die "Expected classdef" if $table->{cover}; + my @vals; + for my $gid (keys %{$table->{val}}) { + next if not $self->{wanted_glyphs}{$gid}; + my $v = $table->{val}{$gid}; + push @vals, $self->{glyph_id_old_to_new}{$gid}, $v; + } + my $ret = new Font::TTF::Coverage(0, @vals); + # Font::TTF bug (http://rt.cpan.org/Ticket/Display.html?id=42716): + # 'max' is not set by new(), so do it manually: + my $max = 0; + for (values %{$ret->{val}}) { $max = $_ if $_ > $max } + $ret->{max} = $max; + return $ret; +} + +# Returns a map such that map[old_class_value] = new_class_value +# (or undef if the class is removed) +# This differs from update_classdef_table in that it can +# reorder and optimise the class ids +sub update_mapped_classdef_table { + my ($self, $table) = @_; + die "Expected table" if not $table; + die "Expected classdef" if $table->{cover}; + my @vals; + my %used_classes; + $used_classes{0} = 1; # 0 is implicitly in every classdef + for my $gid (keys %{$table->{val}}) { + next if not $self->{wanted_glyphs}{$gid}; + my $v = $table->{val}{$gid}; + push @vals, $self->{glyph_id_old_to_new}{$gid}, $v; + $used_classes{$v} = 1; + } + + my @map_new_to_old = sort { $a <=> $b } keys %used_classes; + my @map_old_to_new; + $map_old_to_new[$map_new_to_old[$_]] = $_ for 0..$#map_new_to_old; + + # Update the class numbers + for (0..@vals/2-1) { + $vals[$_*2+1] = $map_old_to_new[$vals[$_*2+1]]; + } + + my $ret = new Font::TTF::Coverage(0, @vals); + # Font::TTF bug (http://rt.cpan.org/Ticket/Display.html?id=42716): + # 'max' is not set by new(), so do it manually: + my $max = 0; + for (values %{$ret->{val}}) { $max = $_ if $_ > $max } + $ret->{max} = $max; + return ($ret, \@map_old_to_new, \@map_new_to_old); +} + +# Removes unwanted glyphs from a coverage table, for +# cases where nobody else is referring to indexes in this table +sub update_coverage_table { + my ($self, $table) = @_; + die "Expected table" if not $table; + die "Expected cover" if not $table->{cover}; + my @vals = keys %{$table->{val}}; + @vals = grep $self->{wanted_glyphs}{$_}, @vals; + @vals = sort { $a <=> $b } @vals; + @vals = map $self->{glyph_id_old_to_new}{$_}, @vals; + return new Font::TTF::Coverage(1, @vals); +} + +# Returns a map such that map[new_coverage_index] = old_coverage_index +sub update_mapped_coverage_table { + my ($self, $table) = @_; + die "Expected table" if not $table; + die "Expected coverage" if not $table->{cover}; + + my @map; + my @new_vals; + # Get the covered values (in order) + my @vals = $self->coverage_array($table); + for my $i (0..$#vals) { + # Create a new list of all the wanted values + if ($self->{wanted_glyphs}{$vals[$i]}) { + push @new_vals, $self->{glyph_id_old_to_new}{$vals[$i]}; + push @map, $i; + } + } + return (new Font::TTF::Coverage(1, @new_vals), @map); +} + +sub coverage_array { + my ($self, $table) = @_; + Carp::confess "Expected table" if not $table; + return sort { $table->{val}{$a} <=> $table->{val}{$b} } keys %{$table->{val}}; +} + +sub empty_coverage { + my ($self, $table) = @_; + Carp::confess "Expected table" if not $table; + return 1 if not $table->{val}; + return 1 if not keys %{$table->{val}}; + return 0; +} + +# Update the loca table to delete unwanted glyphs. +# Must be called before all the other fix_* methods. +sub remove_unwanted_glyphs { + my ($self) = @_; + my $font = $self->{font}; + + return unless $font->{loca}; + + my %glyph_id_old_to_new; + my %glyph_id_new_to_old; + + my $glyphs = $font->{loca}{glyphs}; + my @new_glyphs; + for my $i (0..$#$glyphs) { + if ($self->{wanted_glyphs}{$i}) { + push @new_glyphs, $glyphs->[$i]; + $glyph_id_old_to_new{$i} = $#new_glyphs; + $glyph_id_new_to_old{$#new_glyphs} = $i; + } + } + $font->{loca}{glyphs} = \@new_glyphs; + $font->{maxp}{numGlyphs} = scalar @new_glyphs; + + $self->{glyph_id_old_to_new} = \%glyph_id_old_to_new; + $self->{glyph_id_new_to_old} = \%glyph_id_new_to_old; +} + + +# Only the platform=3 encoding=1 cmap is really needed +# (for Windows, OS X, Linux), so save space (and potentially +# enhance cross-platformness) by stripping out all the others. +# (But keep platform=3 encoding=10 too, for UCS-4 characters.) +# (And Opera 10 on OS X wants one with platform=0 too.) +sub strip_cmap { + my ($self) = @_; + my $font = $self->{font}; + + if (not grep { $_->{Platform} == 3 and $_->{Encoding} == 1 } @{$font->{cmap}{Tables}}) { + warn "No cmap found with platform=3 encoding=1 - the font is likely to not work on Windows.\n"; + # Stop now, instead of stripping out all of the cmap tables + return; + } + + my @matched_tables = grep { + ($_->{Platform} == 3 and ($_->{Encoding} == 1 || $_->{Encoding} == 10)) + or ($_->{Platform} == 0) + } @{$font->{cmap}{Tables}}; + + $font->{cmap}{Tables} = \@matched_tables; +} + +# Only the platform=3 encoding=1 names are really needed +# (for Windows, OS X, Linux), so save space (and potentially +# enhance cross-platformness) by stripping out all the others. +sub strip_name { + my ($self) = @_; + my $font = $self->{font}; + + for my $id (0..$#{$font->{name}{strings}}) { + my $str = $font->{name}{strings}[$id]; + next if not $str; + my $plat = 3; + my $enc = 1; + my $langs = $str->[$plat][$enc]; + if (not $langs) { + warn "No name found with id=$id with platform=3 encoding=1 - the font is likely to not work on Windows.\n" + unless $id == 18; # warn except for some Mac-specific names + return; + } + $font->{name}{strings}[$id] = []; + $font->{name}{strings}[$id][$plat][$enc] = $langs; + # NOTE: this keeps all the languages for each string, which is + # potentially wasteful if there are lots (but in practice most fonts + # seem to only have English) + } +} + +sub fix_cmap { + my ($self) = @_; + my $font = $self->{font}; + + # Delete mappings for unwanted glyphs + + for my $table (@{$font->{cmap}{Tables}}) { + # (Already warned about unrecognised table types + # in find_codepoint_glyph_mappings) + my %new_vals; + for my $cp (keys %{$table->{val}}) { + my $gid = $table->{val}{$cp}; + if ($self->{wanted_glyphs}{$gid}) { + $new_vals{$cp} = $self->{glyph_id_old_to_new}{$gid}; + } + } + $table->{val} = \%new_vals; + if ($table->{Format} == 0) { + @{$table->{val}}{0..255} = map { defined($_) ? $_ : 0 } @{$table->{val}}{0..255}; + } + } +} + +sub fix_head { + # TODO: Should think about: + # created + # modified + # xMin (depends on glyph data) + # yMin (depends on glyph data) + # xMax (depends on glyph data) + # yMax (depends on glyph data) +} + +sub fix_hhea { + # TODO: Should think about: + # advanceWidthMax (depends on hmtx) + # minLeftSideBearing (depends on hmtx) + # minRightSideBearing (depends on hmtx) + # xMaxExtent (depends on hmtx) +} + +sub fix_hmtx { + my ($self) = @_; + my $font = $self->{font}; + + # Map the advance/lsb arrays from old to new glyph ids + my @new_advances; + my @new_lsbs; + for my $gid (0..$font->{maxp}{numGlyphs}-1) { + push @new_advances, $font->{hmtx}{advance}[$self->{glyph_id_new_to_old}{$gid}]; + push @new_lsbs, $font->{hmtx}{lsb}[$self->{glyph_id_new_to_old}{$gid}]; + } + $font->{hmtx}{advance} = \@new_advances; + $font->{hmtx}{lsb} = \@new_lsbs; +} + +sub fix_maxp { # Must come after loca, prep, fpgm + my ($self) = @_; + my $font = $self->{font}; + + # Update some of the 'max' values that Font::TTF + # is capable of updating + $font->{maxp}->update; +} + +sub fix_os_2 { # Must come after cmap, hmtx, hhea, GPOS, GSUB + my ($self) = @_; + my $font = $self->{font}; + + # Update some of the metric values that Font::TTF + # is capable of updating + $font->{'OS/2'}->update; + + if ($font->{'OS/2'}{Version} >= 2) { + # TODO: handle cases where these are non-default + warn "Unexpected defaultChar $font->{'OS/2'}{defaultChar}\n" + unless $font->{'OS/2'}{defaultChar} == 0; + warn "Unexpected breakChar $font->{'OS/2'}{breakChar}\n" + unless $font->{'OS/2'}{breakChar} == 0x20; + } +} + +sub fix_post { + my ($self) = @_; + my $font = $self->{font}; + + if ($font->{post}{FormatType} == 0) { + warn "Invalid 'post' table type. (If you're using the obfuscate-font.pl script, make sure it comes *after* the subsetting.)\n"; + } + + # Update PostScript name mappings for new glyph ids + if ($font->{post}{VAL}) { + my @new_vals; + for my $gid (0..$font->{maxp}{numGlyphs}-1) { + push @new_vals, $font->{post}{VAL}[$self->{glyph_id_new_to_old}{$gid}]; + } + $font->{post}{VAL} = \@new_vals; + } +} + + + + +sub fix_loca { + my ($self) = @_; + my $font = $self->{font}; + + # remove_unwanted_glyphs has already removed some + # of the glyph data from this table + + # Update references inside composite glyphs + for my $glyph (@{$font->{loca}{glyphs}}) { + next unless $glyph; + $glyph->read; + next unless $glyph->{numberOfContours} == -1; + $glyph->read_dat; + for (@{$glyph->{comps}}) { + # (find_unwanted_glyphs guarantees that the + # component glyphs will be present) + $_->{glyph} = $self->{glyph_id_old_to_new}{$_->{glyph}}; + } + } +} + + + +sub fix_gdef { + my ($self) = @_; + my $font = $self->{font}; + + if ($font->{GDEF}{GLYPH}) { + $font->{GDEF}{GLYPH} = $self->update_classdef_table($font->{GDEF}{GLYPH}); + if ($self->empty_coverage($font->{GDEF}{GLYPH})) { + delete $font->{GDEF}{GLYPH}; + } + } + + if ($font->{GDEF}{MARKS}) { + $font->{GDEF}{MARKS} = $self->update_classdef_table($font->{GDEF}{MARKS}); + if ($self->empty_coverage($font->{GDEF}{MARKS})) { + delete $font->{GDEF}{MARKS}; + } + } + + if ($font->{GDEF}{ATTACH}) { + die "TODO" if $font->{GDEF}{ATTACH}{POINTS}; + $font->{GDEF}{ATTACH}{COVERAGE} = $self->update_coverage_table($font->{GDEF}{ATTACH}{COVERAGE}); + if ($self->empty_coverage($font->{GDEF}{ATTACH}{COVERAGE})) { + delete $font->{GDEF}{ATTACH}; + } + } + + if ($font->{GDEF}{LIG}) { + + if ($font->{GDEF}{LIG}{LIGS}) { + die "GDEF LIG LIGS != COVERAGE" if + @{$font->{GDEF}{LIG}{LIGS}} != keys %{$font->{GDEF}{LIG}{COVERAGE}{val}}; + + my @coverage_map; + ($font->{GDEF}{LIG}{COVERAGE}, @coverage_map) = $self->update_mapped_coverage_table($font->{GDEF}{LIG}{COVERAGE}); + $font->{GDEF}{LIG}{LIGS} = [ map $font->{GDEF}{LIG}{LIGS}[$_], @coverage_map ]; + + } else { + $font->{GDEF}{LIG}{COVERAGE} = $self->update_coverage_table($font->{GDEF}{LIG}{COVERAGE}); + } + + if ($self->empty_coverage($font->{GDEF}{LIG}{COVERAGE})) { + delete $font->{GDEF}{LIG}; + } + } + +} + +sub fix_ttopen { + my ($self, $table, $inner) = @_; + + my @lookups; + my %lookup_map; + for my $lookup_id ($self->find_wanted_lookup_ids($table)) { + my $lookup = $table->{LOOKUP}[$lookup_id]; + my @subtables; + for my $sub (@{$lookup->{SUB}}) { + if ($inner->($lookup, $sub)) { + push @subtables, $sub; + } + } + + # Only keep lookups that have some subtables + if (@subtables) { + $lookup->{SUB} = \@subtables; + push @lookups, $lookup; + $lookup_map{$lookup_id} = $#lookups; + } + } + + $table->{LOOKUP} = \@lookups; + + # Update lookup references inside actions + for my $lookup (@{$table->{LOOKUP}}) { + for my $sub (@{$lookup->{SUB}}) { + if ($sub->{ACTION_TYPE} eq 'l') { + for my $rule (@{$sub->{RULES}}) { + for my $chain (@$rule) { + my @actions; + for my $action (@{$chain->{ACTION}}) { + my @steps; + for (0..@$action/2-1) { + # action is array of (offset, lookup) + # so just update the lookup + if (exists $lookup_map{$action->[$_*2+1]}) { + push @steps, ($action->[$_*2], $lookup_map{$action->[$_*2+1]}); + } + } + push @actions, \@steps; + } + $chain->{ACTION} = \@actions; + } + } + } + } + } + + # Remove all features that are not wanted + # and update all references to those features (in the languages list), + # and update the features' lookup references + + my @features; # array of [tag, feature] + my %kept_features; + for my $feat_tag (@{$table->{FEATURES}{FEAT_TAGS}}) { + next unless $self->want_feature($self->{features}, $feat_tag); # drop unwanted features + my $feat = $table->{FEATURES}{$feat_tag}; + $feat->{LOOKUPS} = [ map { exists $lookup_map{$_} ? ($lookup_map{$_}) : () } @{$feat->{LOOKUPS}} ]; + next unless @{$feat->{LOOKUPS}}; # drop empty features to save some space + push @features, [ $feat_tag, $feat ]; + $kept_features{$feat_tag} = 1; + } + + $table->{FEATURES} = { + FEAT_TAGS => [map $_->[0], @features], + map +($_->[0] => $_->[1]), @features, + }; + + # Remove any references from scripts to features that no longer exist + for my $script_tag (keys %{$table->{SCRIPTS}}) { + my $script = $table->{SCRIPTS}{$script_tag}; + for my $tag ('DEFAULT', @{$script->{LANG_TAGS}}) { + next if $script->{$tag}{' REFTAG'}; # ignore langs that are just copies of another + $script->{$tag}{FEATURES} = [ + grep $kept_features{$_}, @{$script->{$tag}{FEATURES}} + ]; + + } + } + + # TODO: it'd be nice to delete languages that have no features + +} + +sub fix_gpos { + my ($self) = @_; + my $font = $self->{font}; + + $self->fix_ttopen($font->{GPOS}, + sub { + my ($lookup, $sub) = @_; + + # There's always a COVERAGE here first. + # (If it's empty, the client will skip the entire subtable, + # so we could delete it entirely, but that would involve updating + # the FEATURES->*->LOOKUPS lists too, so don't do that yet.) + # + # The rest depends on Type: + # + # Lookup Type 1 (Single Adjustment Positioning Subtable): + # Format 1: Just COVERAGE, applies same value to all + # Format 2: Just COVERAGE, RULES[n] gives value for each + # + # Lookup Type 2 (Pair Adjustment Positioning Subtable): + # Format 1: COVERAGE gives first glyph, RULES[n][m]{MATCH}[0] gives second glyph + # Format 2: COVERAGE gives first glyph, CLASS gives first glyph class, MATCH[0] gives second glyph class + # + # Lookup Type 3 (Cursive Attachment Positioning Subtable): + # Format 1: Just COVERAGE, RULES[n] gives value for each + # + # Lookup Type 4 (MarkToBase Attachment Positioning Subtable): + # Format 1: MATCH[0] gives mark coverage, COVERAGE gives base coverage, MARKS[n] per mark, RULES[n] per base + # + # Lookup Type 5 (MarkToLigature Attachment Positioning Subtable): + # Format 1: pretty much the same as 4, but s/base/ligature/ + # + # Lookup Type 6 (MarkToMark Attachment Positioning Subtable): + # Format 1: pretty much the same as 4, but s/base/mark/ + # + # Lookup Type 7 (Contextual Positioning Subtables): + # Format 1: COVERAGE gives first glyph, RULES[n][m]{MATCH}[o] gives next glyphs + # Format 2: COVERAGE gives first glyph, CLASS gives classes to glyphs, RULES[n] is per class + # Format 3: COVERAGE absent, RULES[0][0]{MATCH}[o] gives glyph coverages + # + # Lookup Type 8 (Chaining Contextual Positioning Subtable): + # Format 1: COVERAGE gives first glyph, RULES[n][m]{PRE/MATCH/POST} give context glyphs + # Format 2: COVERAGE gives first glyph, PRE_CLASS/CLASS/POST_CLASS give classes + # Format 3: COVERAGE absent, RULES[0][0]{PRE/MATCH/POST}[o] give coverages + # + # Lookup Type 9 (Extension Positioning): + # Not supported + + die if $lookup->{TYPE} >= 9; + + # Update the COVERAGE table, and remember some mapping + # information to update things that refer to the table + my @coverage_map; + my $old_coverage_count; + if ($sub->{COVERAGE}) { + $old_coverage_count = scalar keys %{$sub->{COVERAGE}{val}}; + ($sub->{COVERAGE}, @coverage_map) = $self->update_mapped_coverage_table($sub->{COVERAGE}); + + # If there's no coverage left, then drop this subtable + return 0 if $self->empty_coverage($sub->{COVERAGE}); + } + + if ($sub->{RULES} and $sub->{COVERAGE} and not + # Skip cases where RULES is indexed by CLASS, not COVERAGE + (($lookup->{TYPE} == 2 or + $lookup->{TYPE} == 7 or + $lookup->{TYPE} == 8) + and $sub->{FORMAT} == 2) + ) { + # There's a RULES array per COVERAGE entry, so + # shuffle them around to match the new COVERAGE + if (@{$sub->{RULES}} != $old_coverage_count) { + die "Internal error: RULES ($sub->{RULES}) does not match COVERAGE ($sub->{COVERAGE}) -- " + . @{$sub->{RULES}} . " vs $old_coverage_count."; + } + $sub->{RULES} = [ map $sub->{RULES}[$_], @coverage_map ]; + } + + if (not defined $sub->{MATCH_TYPE} or $sub->{MATCH_TYPE} eq 'g') { + if ($sub->{MATCH}) { + die unless @{$sub->{MATCH}} == 1; + die unless $sub->{MARKS}; + die unless @{$sub->{MARKS}} == keys %{$sub->{MATCH}[0]{val}}; + my @match_map; + ($sub->{MATCH}[0], @match_map) = $self->update_mapped_coverage_table($sub->{MATCH}[0]); + + # If there's no coverage left, then drop this subtable + return 0 if $self->empty_coverage($sub->{MATCH}[0]); + + # Update MARKS to correspond to the new MATCH coverage + $sub->{MARKS} = [ map $sub->{MARKS}[$_], @match_map ]; + } + + # RULES->MATCH is an array of glyphs, so translate them all + for (@{$sub->{RULES}}) { + for (@$_) { + $_->{MATCH} = [ map $self->{glyph_id_old_to_new}{$_}, + grep $self->{wanted_glyphs}{$_}, @{$_->{MATCH}} ]; + } + } + } elsif ($sub->{MATCH_TYPE}) { + if ($sub->{MATCH_TYPE} eq 'o') { + # RULES->MATCH/PRE/POST are arrays of coverage tables, so translate them all + die unless @{$sub->{RULES}} == 1; + die unless @{$sub->{RULES}[0]} == 1; + my $r = $sub->{RULES}[0][0]; + for my $c (qw(MATCH PRE POST)) { + $r->{$c} = [ map $self->update_coverage_table($_), @{$r->{$c}} ] if $r->{$c}; + } + } elsif ($sub->{MATCH_TYPE} eq 'c') { + die "Didn't expect any rule matches" if grep $_->{MATCH}, map @$_, @{$sub->{RULES}}; + die unless @{$sub->{MATCH}} == 1; + + my $class_map; + ($sub->{CLASS}, undef, $class_map) = $self->update_mapped_classdef_table($sub->{CLASS}); + # Special case: If this results in an empty CLASS, it'll + # break in FF3.5 on Linux, so assign all the COVERAGE glyphs onto + # class 1 and update $class_map appropriately + if ($sub->{CLASS}{max} == 0) { + $sub->{CLASS} = new Font::TTF::Coverage(0, map +($_ => 1), keys %{$sub->{COVERAGE}{val}}); + $class_map = [0, 0]; # just duplicate class 0 into class 1 (this is a bit inefficient) + } + + $sub->{RULES} = [ @{$sub->{RULES}}[@$class_map] ]; + + # Update the MATCH classdef table + my $match_map; + ($sub->{MATCH}[0], undef, $match_map) = $self->update_mapped_classdef_table($sub->{MATCH}[0]); + + # If the MATCH table is now empty, drop this lookup + # (else FF3.5 on Linux drops the GPOS table entirely) + return 0 if @$match_map <= 1; + + # RULES[n] is a list of substitutions per MATCH class, so + # update all those lists for the new classdef + $sub->{RULES} = [ map { [ @{$_}[@$match_map] ] } @{$sub->{RULES}} ]; + + } else { + die "Invalid MATCH_TYPE"; + } + } + + if (($lookup->{TYPE} == 7 or + $lookup->{TYPE} == 8) + and $sub->{FORMAT} == 2) { + # Update some class tables + for my $c (qw(CLASS PRE_CLASS POST_CLASS)) { + $sub->{$c} = $self->update_classdef_table($sub->{$c}) if $sub->{$c}; + } + } + + return 1; + } + ); +} + +sub fix_gsub { + my ($self) = @_; + my $font = $self->{font}; + + $self->fix_ttopen($font->{GSUB}, + sub { + my ($lookup, $sub) = @_; + + # There's always a COVERAGE here first. + # (If it's empty, the client will skip the entire subtable, + # so we could delete it entirely, but that would involve updating + # the FEATURES->*->LOOKUPS lists and Contextual subtable indexes + # too, so don't do that yet.) + # + # The rest depends on Type: + # + # Lookup Type 1 (Single Substitution Subtable): + # Format 1: Just COVERAGE, and ADJUST gives glyph id delta + # Format 2: Just COVERAGE, then RULES[n]{ACTION}[0] gives replacement glyph for each + # + # Lookup Type 2 (Multiple Substitution Subtable): + # Format 1: Just COVERAGE, then RULES[n]{ACTION} gives replacement glyphs (must be at least 1) + # + # Lookup Type 3 (Alternate Substitution Subtable): + # Format 1: Just COVERAGE, then RULES[n]{ACTION} gives alternate glyphs + # [This can just be deleted since we have no way to use those glyphs] + # + # Lookup Type 4 (Ligature Substitution Subtable): + # Format 1: COVERAGE gives first glyph, RULES[n]{MATCH}[m] gives next glyphs to match, RULES[n]{ACTION}[0] gives replacement glyph + # + # Lookup Type 5 (Contextual Substitution Subtable): + # Format *: like type 7 in GPOS, but ACTION gives indexes into GSUB{LOOKUP} + # + # Lookup Type 6 (Chaining Contextual Substitution Subtable): + # Format *: like type 8 in GPOS, but ACTION gives indexes into GSUB{LOOKUP} + # + # Lookup Type 7 (Extension Substitution): + # Blah + + die if $lookup->{TYPE} >= 7; + + # Update the COVERAGE table, and remember some mapping + # information to update things that refer to the table + my @coverage_map; + my $old_coverage_count; + if ($sub->{COVERAGE}) { + $old_coverage_count = scalar keys %{$sub->{COVERAGE}{val}}; + ($sub->{COVERAGE}, @coverage_map) = $self->update_mapped_coverage_table($sub->{COVERAGE}); + + # If there's no coverage left, then drop this subtable + return 0 if $self->empty_coverage($sub->{COVERAGE}); + } + + if ($sub->{ACTION_TYPE} eq 'o') {; + my $adj = $sub->{ADJUST}; + if ($adj >= 32768) { $adj -= 65536 } # fix Font::TTF::Bug (http://rt.cpan.org/Ticket/Display.html?id=42727) + my @covs = $self->coverage_array($sub->{COVERAGE}); + if (@covs == 0) { + # Nothing's covered, but deleting this whole subtable is + # non-trivial so just zero it out + $sub->{ADJUST} = 0; + } elsif (@covs == 1) { + my $gid_base = $covs[0]; + my $old_gid_base = $self->{glyph_id_new_to_old}{$gid_base}; + my $old_gid = $old_gid_base + $adj; + $sub->{ADJUST} = $self->{glyph_id_old_to_new}{$old_gid} - $gid_base; + } else { + # The glyphs are probably all reordered, so we can't just + # adjust ADJUST. + # So switch this to a format 2 table: + $sub->{FORMAT} = 2; + $sub->{ACTION_TYPE} = 'g'; + delete $sub->{ADJUST}; + my @gids; + for (@covs) { + push @gids, $self->{glyph_id_old_to_new}{$self->{glyph_id_new_to_old}{$_} + $adj}; + } + $sub->{RULES} = [ map [{ACTION => [$_]}], @gids ]; + } + # Stop and keep this table, since done everything that's needed + return 1; + } + die if $sub->{ADJUST}; + + if ($sub->{RULES} and not + # Skip cases where RULES is indexed by CLASS, not COVERAGE, + # and cases where there's no COVERAGE at all + (($lookup->{TYPE} == 5 or $lookup->{TYPE} == 6) + and ($sub->{FORMAT} == 2 or $sub->{FORMAT} == 3)) + ) { + # There's a RULES array per COVERAGE entry, so + # shuffle them around to match the new COVERAGE + die unless @{$sub->{RULES}} == $old_coverage_count; + $sub->{RULES} = [ map $sub->{RULES}[$_], @coverage_map ]; + } + + # TODO: refactor + if ($sub->{MATCH_TYPE}) { + # Fix all the glyph indexes + if ($sub->{MATCH_TYPE} eq 'g') { + # RULES->MATCH/PRE/POST are arrays of glyphs, so translate them all, + # and if they rely on any unwanted glyphs then drop the rule entirely + for my $i (0..$#{$sub->{RULES}}) { + my $ruleset = $sub->{RULES}[$i]; + my @rules; + RULE: for my $rule (@$ruleset) { + for my $c (qw(MATCH PRE POST)) { + next unless $rule->{$c}; + next RULE if grep { not $self->{wanted_glyphs}{$_} } @{$rule->{$c}}; + $rule->{$c} = [ map $self->{glyph_id_old_to_new}{$_}, @{$rule->{$c}} ] + } + push @rules, $rule; + } + if (not @rules) { + # XXX: This is a really horrid hack. + # The proper solution is to delete the ruleset, + # and adjust COVERAGE to match. + push @rules, { ACTION => [0], MATCH => [-1] }; + } + $sub->{RULES}[$i] = \@rules; + } + } elsif ($sub->{MATCH_TYPE} eq 'o') { + # RULES->MATCH/PRE/POST are arrays of coverage tables, so translate them all + die unless @{$sub->{RULES}} == 1; + die unless @{$sub->{RULES}[0]} == 1; + my $r = $sub->{RULES}[0][0]; + for my $c (qw(MATCH PRE POST)) { + $r->{$c} = [ map $self->update_coverage_table($_), @{$r->{$c}} ] if $r->{$c}; + } + } elsif ($sub->{MATCH_TYPE} eq 'c') { + # RULES refers to class values, which haven't changed at all, + # so we don't need to update those values + } else { + die "Invalid MATCH_TYPE"; + } + } + + my %class_maps; + for my $c (qw(CLASS PRE_CLASS POST_CLASS)) { + ($sub->{$c}, $class_maps{$c}) = $self->update_mapped_classdef_table($sub->{$c}) if $sub->{$c}; + } + + + if ($sub->{MATCH_TYPE} and $sub->{MATCH_TYPE} eq 'c') { + # To make things work in Pango, we need to change all the + # class numbers so there aren't gaps: + my %classes = ( + MATCH => 'CLASS', + PRE => 'PRE_CLASS', + POST => 'POST_CLASS', + ); + my @rules; + for my $rule (@{$sub->{RULES}}) { + my @chains; + CHAIN: for my $chain (@$rule) { + for my $c (qw(MATCH PRE POST)) { + next unless $chain->{$c}; + my $map = $class_maps{$classes{$c}} or die "Got a $c but no $classes{$c}"; + # If any of the values are for a class that no longer has + # any entries, we should drop this whole chain because + # there's no chance it's going to match + next CHAIN if grep { not defined $map->[$_] } @{$chain->{$c}}; + # Otherwise just update the class numbers + $chain->{$c} = [ map $map->[$_], @{$chain->{$c}} ]; + } + push @chains, $chain; + } + push @rules, \@chains; + } + $sub->{RULES} = \@rules; + # If all the rules are empty, drop this whole subtable (which maybe is + # needed to avoid https://bugzilla.mozilla.org/show_bug.cgi?id=475242 ?) + return 0 if not grep @$_, @{$sub->{RULES}}; + } + + if ($sub->{ACTION_TYPE}) { + if ($sub->{ACTION_TYPE} eq 'g') { + for (@{$sub->{RULES}}) { + for (@$_) { + $_->{ACTION} = [ map $self->{glyph_id_old_to_new}{$_}, + grep $self->{wanted_glyphs}{$_}, @{$_->{ACTION}} ]; + } + } + } elsif ($sub->{ACTION_TYPE} eq 'l') { + # nothing to change here + } elsif ($sub->{ACTION_TYPE} eq 'a') { + # We don't want to bother with alternate glyphs at all, + # so just delete everything. + # (We need to have empty rules, and can't just delete them + # entirely, else FontTools becomes unhappy.) + # (TODO: Maybe we do want alternate glyphs? + # If so, be sure to update find_wanted_glyphs too) + for (@{$sub->{RULES}}) { + for (@$_) { + $_->{ACTION} = []; + } + } + } elsif ($sub->{ACTION_TYPE} eq 'o') { + die "Should have handled ACTION_TYPE o earlier"; + } else { + die "Invalid ACTION_TYPE"; + } + } + + return 1; + } + ); +} + +# Fold certain GSUB features into the cmap table +sub fold_gsub { + my ($self, $features) = @_; + + my $font = $self->{font}; + my $table = $font->{GSUB}; + + # Find the lookup IDs corresponding to the desired features + + my %wanted = (DEFAULT => 0); + $wanted{$_} = 1 for @$features; + + my %lookups; + for my $feat_tag (@{$table->{FEATURES}{FEAT_TAGS}}) { + next if not $self->want_feature(\%wanted, $feat_tag); + for (@{$table->{FEATURES}{$feat_tag}{LOOKUPS}}) { + $lookups{$_} = $feat_tag; + } + } + + # Find the glyph mapping from those lookups + + my %glyph_map; # (old glyph id => new glyph id) + + for my $lookup_id (0..$#{$table->{LOOKUP}}) { + next unless exists $lookups{$lookup_id}; + my $lookup = $table->{LOOKUP}[$lookup_id]; + if ($lookup->{TYPE} != 1) { + warn "GSUB lookup $lookup_id (from feature '$lookups{$lookup_id}') is not a 'single' type lookup (type=$lookup->{TYPE}), and cannot be applied.\n"; + next; + } + + # For each glyph, only the first substitution per lookup is applied, + # so we build a map of the firsts for this lookup (then fold it into + # the global map later) + my %lookup_glyph_map; + + for my $sub (@{$lookup->{SUB}}) { + my @covs = $self->coverage_array($sub->{COVERAGE}); + if ($sub->{ACTION_TYPE} eq 'o') { + my $adj = $sub->{ADJUST}; + if ($adj >= 32768) { $adj -= 65536 } # fix Font::TTF::Bug (http://rt.cpan.org/Ticket/Display.html?id=42727) + for my $i (0..$#covs) { + my $old = $covs[$i]; + my $new = $old + $adj; + $lookup_glyph_map{$old} = $new if not exists $lookup_glyph_map{$old}; + } + } elsif ($sub->{ACTION_TYPE} eq 'g') { + next if @covs == 0 and not $sub->{RULES}; + die unless @{$sub->{RULES}} == @covs; + for my $i (0..$#covs) { + my $old = $covs[$i]; + die unless @{$sub->{RULES}[$i]} == 1; + die unless @{$sub->{RULES}[$i][0]{ACTION}} == 1; + my $new = $sub->{RULES}[$i][0]{ACTION}[0]; + $lookup_glyph_map{$old} = $new; + } + } else { + die "Invalid ACTION_TYPE $sub->{ACTION_TYPE}"; + } + } + + # Fold the lookup's glyph map into the global glyph map + for my $gid (keys %lookup_glyph_map) { + # Add any new substitutions + $glyph_map{$gid} = $lookup_glyph_map{$gid} if not exists $glyph_map{$gid}; + } + for my $gid (keys %glyph_map) { + # Handle chained substitutions + $glyph_map{$gid} = $lookup_glyph_map{$glyph_map{$gid}} if exists $lookup_glyph_map{$glyph_map{$gid}}; + } + } + + # Apply the glyph mapping to cmap + + for my $table (@{$font->{cmap}{Tables}}) { + for my $cp (keys %{$table->{val}}) { + my $gid = $table->{val}{$cp}; + $table->{val}{$cp} = $glyph_map{$gid} if exists $glyph_map{$gid}; + } + } +} + +sub fix_hdmx { + my ($self) = @_; + my $font = $self->{font}; + + for my $ppem (grep /^\d+$/, keys %{$font->{hdmx}}) { + my @new_widths; + for my $gid (0..$font->{maxp}{numGlyphs}-1) { + push @new_widths, $font->{hdmx}{$ppem}[$self->{glyph_id_new_to_old}{$gid}]; + } + $font->{hdmx}{$ppem} = \@new_widths; + } +} + +sub fix_kern { + my ($self) = @_; + my $font = $self->{font}; + + # We don't handle version 1 kern tables yet, so just drop them entirely. + # http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6kern.html + # https://bugzilla.mozilla.org/show_bug.cgi?id=487549 + if ($font->{kern}{Version} != 0) { + warn "Unhandled kern table version $font->{kern}{Version} - deleting all kerning data\n"; + delete $font->{kern}; + return; + } + + for my $table (@{$font->{kern}{tables}}) { + if ($table->{type} == 0) { + my %kern; + for my $l (keys %{$table->{kern}}) { + next unless $self->{wanted_glyphs}{$l}; + for my $r (keys %{$table->{kern}{$l}}) { + next unless $self->{wanted_glyphs}{$r}; + $kern{$self->{glyph_id_old_to_new}{$l}}{$self->{glyph_id_old_to_new}{$r}} = $table->{kern}{$l}{$r}; + } + } + $table->{kern} = \%kern; + } elsif ($table->{type} == 2) { + die "kern table type 2 not supported yet"; + } else { + die "Invalid kern table type"; + } + } +} + +sub fix_ltsh { + my ($self) = @_; + my $font = $self->{font}; + + my @glyphs; + for my $gid (0..$font->{maxp}{numGlyphs}-1) { + push @glyphs, $font->{LTSH}{glyphs}[$self->{glyph_id_new_to_old}{$gid}]; + } + $font->{LTSH}{glyphs} = \@glyphs; +} + +sub delete_copyright { + my ($self) = @_; + my $font = $self->{font}; + # XXX - shouldn't be deleting copyright text + $font->{name}{strings}[0] = undef; + $font->{name}{strings}[10] = undef; + $font->{name}{strings}[13] = undef; +} + +sub change_name { + my ($self, $uid) = @_; + my $font = $self->{font}; + + for (1,3,4,6) { + my $str = $font->{name}{strings}[$_]; + for my $plat (0..$#$str) { + next unless $str->[$plat]; + for my $enc (0..$#{$str->[$plat]}) { + next unless $str->[$plat][$enc]; + for my $lang (keys %{$str->[$plat][$enc]}) { + next unless exists $str->[$plat][$enc]{$lang}; + $str->[$plat][$enc]{$lang} = "$uid - subset of " . $str->[$plat][$enc]{$lang}; + } + } + } + } +} + +sub license_desc_subst { + my ($self, $new) = @_; + my $font = $self->{font}; + + my $str = $font->{name}{strings}[13]; + for my $plat (0..$#$str) { + next unless $str->[$plat]; + for my $enc (0..$#{$str->[$plat]}) { + next unless $str->[$plat][$enc]; + for my $lang (keys %{$str->[$plat][$enc]}) { + next unless exists $str->[$plat][$enc]{$lang}; + $str->[$plat][$enc]{$lang} =~ s/\$\{LICENSESUBST\}/$new/g; + } + } + } +} + +# IE silently rejects non-CFF fonts if the Font Family Name is not a prefix of +# the Full Font Name. This can occur when automatically converting CFF fonts +# to non-CFF fonts, so it's useful to check and fix it here. +sub fix_full_font_name { + my ($self, $new) = @_; + my $font = $self->{font}; + + my $str1 = $font->{name}{strings}[1]; + for my $plat (0..$#$str1) { + next unless $str1->[$plat]; + for my $enc (0..$#{$str1->[$plat]}) { + next unless $str1->[$plat][$enc]; + for my $lang (keys %{$str1->[$plat][$enc]}) { + next unless exists $str1->[$plat][$enc]{$lang}; + my $name = $str1->[$plat][$enc]{$lang}; + my $fullname = $font->{name}{strings}[4][$plat][$enc]{$lang}; + if (substr($fullname, 0, length $name) ne $name) { + warn "Full Name ('$fullname') does not start with Family Name ('$name') and will break in IE - fixing automatically\n"; + $font->{name}{strings}[4][$plat][$enc]{$lang} = $name; + } + } + } + } +} + +sub new { + my $class = shift; + my $self = {}; + bless $self, $class; + return $self; +} + +sub preload { + my ($self, $filename) = @_; + my $font = Font::TTF::Font->open($filename) or die "Failed to open $filename: $!"; + $self->{font} = $font; + $self->read_tables; +} + +sub subset { + my ($self, $filename, $chars, $options) = @_; + + $self->{features} = $options->{features}; + + my $uid = substr(sha1_hex(encode_utf8("$filename $chars")), 0, 16); + + if (not $self->{font}) { + $self->preload($filename); + } + + my $font = $self->{font}; + + $self->check_tables; + + $self->{num_glyphs_old} = $font->{maxp}{numGlyphs}; + + $self->fold_gsub($options->{fold_features}) + if $options->{fold_features}; + + my $fsType = $font->{'OS/2'}{fsType}; + warn "fsType is $fsType - subsetting and embedding might not be permitted by the license\n" if $fsType != 0; + + $self->strip_cmap; + $self->strip_name; + + $self->find_codepoint_glyph_mappings; + $self->find_wanted_glyphs($chars); + $self->remove_unwanted_glyphs; + + $self->fix_cmap; + $self->fix_head; + $self->fix_hhea; + $self->fix_hmtx; + # name: nothing to fix (though maybe could be optimised?) + $self->fix_post; + + # cvt_: nothing to fix + # fpgm: nothing to fix + # glyf: just a stub, in Font::TTF + $self->fix_loca; + # prep: nothing to fix + + # BASE: TODO + $self->fix_gdef if $font->{GDEF}; + $self->fix_gpos if $font->{GPOS}; + $self->fix_gsub if $font->{GSUB}; + # JSTF: TODO + + $self->fix_hdmx if $font->{hdmx}; + $self->fix_kern if $font->{kern}; + $self->fix_ltsh if $font->{LTSH}; + + $self->fix_maxp; # Must come after loca, prep, fpgm + $self->fix_os_2; # Must come after cmap, hmtx, hhea, GPOS, GSUB + + $self->fix_full_font_name; + + $self->change_name($uid); + + $self->license_desc_subst($options->{license_desc_subst}) + if defined $options->{license_desc_subst}; + + $self->{num_glyphs_new} = $font->{maxp}{numGlyphs}; +} + +sub num_glyphs_old { + my ($self) = @_; + return $self->{num_glyphs_old}; +} + +sub num_glyphs_new { + my ($self) = @_; + return $self->{num_glyphs_new}; +} + +sub glyph_names { + my ($self) = @_; + my $font = $self->{font}; + if (@{$font->{post}{VAL}}) { + return @{$font->{post}{VAL}}; + } + my $n = $#{$font->{loca}{glyphs}}; + return join ' ', map { chr($_) =~ /[a-zA-Z0-9- \|]/ ? "'".chr($_)."'" : sprintf 'U+%04x', $_ } map { keys %{$self->{glyphs}{$_}} } + map $self->{glyph_id_new_to_old}{$_}, 0..$n; +} + +sub feature_status { + my ($self) = @_; + my $font = $self->{font}; + my %feats; + my @feats; + for my $table (grep defined, $font->{GPOS}, $font->{GSUB}) { + for my $feature (@{$table->{FEATURES}{FEAT_TAGS}}) { + $feature =~ /^(\w{4})( _\d+)?$/ or die "Unrecognised feature tag syntax '$feature'"; + my $tag = $1; + next if $feats{$tag}++; + push @feats, $tag; + } + } + return @feats; +} + +sub write { + my ($self, $fh) = @_; + my $font = $self->{font}; + $font->out($fh) or die $!; +} + +sub release { + my ($self) = @_; + my $font = $self->{font}; + $font->release; +} + +1; diff --git a/src/librarian/font-optimizer/Font/Subsetter/NormalizationData.pm b/src/librarian/font-optimizer/Font/Subsetter/NormalizationData.pm new file mode 100644 index 0000000..dca81d6 --- /dev/null +++ b/src/librarian/font-optimizer/Font/Subsetter/NormalizationData.pm @@ -0,0 +1,1377 @@ +package Font::Subsetter::NormalizationData; +use strict; +use warnings; +our @data = ( +[192,65,768], +[193,65,769], +[194,65,770], +[195,65,771], +[196,65,776], +[197,65,778], +[199,67,807], +[200,69,768], +[201,69,769], +[202,69,770], +[203,69,776], +[204,73,768], +[205,73,769], +[206,73,770], +[207,73,776], +[209,78,771], +[210,79,768], +[211,79,769], +[212,79,770], +[213,79,771], +[214,79,776], +[217,85,768], +[218,85,769], +[219,85,770], +[220,85,776], +[221,89,769], +[224,97,768], +[225,97,769], +[226,97,770], +[227,97,771], +[228,97,776], +[229,97,778], +[231,99,807], +[232,101,768], +[233,101,769], +[234,101,770], +[235,101,776], +[236,105,768], +[237,105,769], +[238,105,770], +[239,105,776], +[241,110,771], +[242,111,768], +[243,111,769], +[244,111,770], +[245,111,771], +[246,111,776], +[249,117,768], +[250,117,769], +[251,117,770], +[252,117,776], +[253,121,769], +[255,121,776], +[256,65,772], +[257,97,772], +[258,65,774], +[259,97,774], +[260,65,808], +[261,97,808], +[262,67,769], +[263,99,769], +[264,67,770], +[265,99,770], +[266,67,775], +[267,99,775], +[268,67,780], +[269,99,780], +[270,68,780], +[271,100,780], +[274,69,772], +[275,101,772], +[276,69,774], +[277,101,774], +[278,69,775], +[279,101,775], +[280,69,808], +[281,101,808], +[282,69,780], +[283,101,780], +[284,71,770], +[285,103,770], +[286,71,774], +[287,103,774], +[288,71,775], +[289,103,775], +[290,71,807], +[291,103,807], +[292,72,770], +[293,104,770], +[296,73,771], +[297,105,771], +[298,73,772], +[299,105,772], +[300,73,774], +[301,105,774], +[302,73,808], +[303,105,808], +[304,73,775], +[308,74,770], +[309,106,770], +[310,75,807], +[311,107,807], +[313,76,769], +[314,108,769], +[315,76,807], +[316,108,807], +[317,76,780], +[318,108,780], +[323,78,769], +[324,110,769], +[325,78,807], +[326,110,807], +[327,78,780], +[328,110,780], +[332,79,772], +[333,111,772], +[334,79,774], +[335,111,774], +[336,79,779], +[337,111,779], +[340,82,769], +[341,114,769], +[342,82,807], +[343,114,807], +[344,82,780], +[345,114,780], +[346,83,769], +[347,115,769], +[348,83,770], +[349,115,770], +[350,83,807], +[351,115,807], +[352,83,780], +[353,115,780], +[354,84,807], +[355,116,807], +[356,84,780], +[357,116,780], +[360,85,771], +[361,117,771], +[362,85,772], +[363,117,772], +[364,85,774], +[365,117,774], +[366,85,778], +[367,117,778], +[368,85,779], +[369,117,779], +[370,85,808], +[371,117,808], +[372,87,770], +[373,119,770], +[374,89,770], +[375,121,770], +[376,89,776], +[377,90,769], +[378,122,769], +[379,90,775], +[380,122,775], +[381,90,780], +[382,122,780], +[416,79,795], +[417,111,795], +[431,85,795], +[432,117,795], +[461,65,780], +[462,97,780], +[463,73,780], +[464,105,780], +[465,79,780], +[466,111,780], +[467,85,780], +[468,117,780], +[469,85,776,772], +[469,220,772], +[470,117,776,772], +[470,252,772], +[471,85,776,769], +[471,220,769], +[472,117,776,769], +[472,252,769], +[473,85,776,780], +[473,220,780], +[474,117,776,780], +[474,252,780], +[475,85,776,768], +[475,220,768], +[476,117,776,768], +[476,252,768], +[478,65,776,772], +[478,196,772], +[479,97,776,772], +[479,228,772], +[480,65,775,772], +[480,550,772], +[481,97,775,772], +[481,551,772], +[482,198,772], +[483,230,772], +[486,71,780], +[487,103,780], +[488,75,780], +[489,107,780], +[490,79,808], +[491,111,808], +[492,79,808,772], +[492,332,808], +[492,490,772], +[493,111,808,772], +[493,333,808], +[493,491,772], +[494,439,780], +[495,658,780], +[496,106,780], +[500,71,769], +[501,103,769], +[504,78,768], +[505,110,768], +[506,65,778,769], +[506,197,769], +[507,97,778,769], +[507,229,769], +[508,198,769], +[509,230,769], +[510,216,769], +[511,248,769], +[512,65,783], +[513,97,783], +[514,65,785], +[515,97,785], +[516,69,783], +[517,101,783], +[518,69,785], +[519,101,785], +[520,73,783], +[521,105,783], +[522,73,785], +[523,105,785], +[524,79,783], +[525,111,783], +[526,79,785], +[527,111,785], +[528,82,783], +[529,114,783], +[530,82,785], +[531,114,785], +[532,85,783], +[533,117,783], +[534,85,785], +[535,117,785], +[536,83,806], +[537,115,806], +[538,84,806], +[539,116,806], +[542,72,780], +[543,104,780], +[550,65,775], +[551,97,775], +[552,69,807], +[553,101,807], +[554,79,776,772], +[554,214,772], +[555,111,776,772], +[555,246,772], +[556,79,771,772], +[556,213,772], +[557,111,771,772], +[557,245,772], +[558,79,775], +[559,111,775], +[560,79,775,772], +[560,558,772], +[561,111,775,772], +[561,559,772], +[562,89,772], +[563,121,772], +[901,168,769], +[902,913,769], +[904,917,769], +[905,919,769], +[906,921,769], +[908,927,769], +[910,933,769], +[911,937,769], +[912,953,776,769], +[912,970,769], +[938,921,776], +[939,933,776], +[940,945,769], +[941,949,769], +[942,951,769], +[943,953,769], +[944,965,776,769], +[944,971,769], +[970,953,776], +[971,965,776], +[972,959,769], +[973,965,769], +[974,969,769], +[979,978,769], +[980,978,776], +[1024,1045,768], +[1025,1045,776], +[1027,1043,769], +[1031,1030,776], +[1036,1050,769], +[1037,1048,768], +[1038,1059,774], +[1049,1048,774], +[1081,1080,774], +[1104,1077,768], +[1105,1077,776], +[1107,1075,769], +[1111,1110,776], +[1116,1082,769], +[1117,1080,768], +[1118,1091,774], +[1142,1140,783], +[1143,1141,783], +[1217,1046,774], +[1218,1078,774], +[1232,1040,774], +[1233,1072,774], +[1234,1040,776], +[1235,1072,776], +[1238,1045,774], +[1239,1077,774], +[1242,1240,776], +[1243,1241,776], +[1244,1046,776], +[1245,1078,776], +[1246,1047,776], +[1247,1079,776], +[1250,1048,772], +[1251,1080,772], +[1252,1048,776], +[1253,1080,776], +[1254,1054,776], +[1255,1086,776], +[1258,1256,776], +[1259,1257,776], +[1260,1069,776], +[1261,1101,776], +[1262,1059,772], +[1263,1091,772], +[1264,1059,776], +[1265,1091,776], +[1266,1059,779], +[1267,1091,779], +[1268,1063,776], +[1269,1095,776], +[1272,1067,776], +[1273,1099,776], +[1570,1575,1619], +[1571,1575,1620], +[1572,1608,1620], +[1573,1575,1621], +[1574,1610,1620], +[1728,1749,1620], +[1730,1729,1620], +[1747,1746,1620], +[2345,2344,2364], +[2353,2352,2364], +[2356,2355,2364], +[2507,2503,2494], +[2508,2503,2519], +[2888,2887,2902], +[2891,2887,2878], +[2892,2887,2903], +[2964,2962,3031], +[3018,3014,3006], +[3019,3015,3006], +[3020,3014,3031], +[3144,3142,3158], +[3264,3263,3285], +[3271,3270,3285], +[3272,3270,3286], +[3274,3270,3266], +[3275,3270,3266,3285], +[3275,3274,3285], +[3402,3398,3390], +[3403,3399,3390], +[3404,3398,3415], +[3546,3545,3530], +[3548,3545,3535], +[3549,3545,3535,3530], +[3549,3548,3530], +[3550,3545,3551], +[4134,4133,4142], +[7680,65,805], +[7681,97,805], +[7682,66,775], +[7683,98,775], +[7684,66,803], +[7685,98,803], +[7686,66,817], +[7687,98,817], +[7688,67,807,769], +[7688,262,807], +[7688,199,769], +[7689,99,807,769], +[7689,263,807], +[7689,231,769], +[7690,68,775], +[7691,100,775], +[7692,68,803], +[7693,100,803], +[7694,68,817], +[7695,100,817], +[7696,68,807], +[7697,100,807], +[7698,68,813], +[7699,100,813], +[7700,69,772,768], +[7700,274,768], +[7701,101,772,768], +[7701,275,768], +[7702,69,772,769], +[7702,274,769], +[7703,101,772,769], +[7703,275,769], +[7704,69,813], +[7705,101,813], +[7706,69,816], +[7707,101,816], +[7708,69,807,774], +[7708,276,807], +[7708,552,774], +[7709,101,807,774], +[7709,277,807], +[7709,553,774], +[7710,70,775], +[7711,102,775], +[7712,71,772], +[7713,103,772], +[7714,72,775], +[7715,104,775], +[7716,72,803], +[7717,104,803], +[7718,72,776], +[7719,104,776], +[7720,72,807], +[7721,104,807], +[7722,72,814], +[7723,104,814], +[7724,73,816], +[7725,105,816], +[7726,73,776,769], +[7726,207,769], +[7727,105,776,769], +[7727,239,769], +[7728,75,769], +[7729,107,769], +[7730,75,803], +[7731,107,803], +[7732,75,817], +[7733,107,817], +[7734,76,803], +[7735,108,803], +[7736,76,803,772], +[7736,7734,772], +[7737,108,803,772], +[7737,7735,772], +[7738,76,817], +[7739,108,817], +[7740,76,813], +[7741,108,813], +[7742,77,769], +[7743,109,769], +[7744,77,775], +[7745,109,775], +[7746,77,803], +[7747,109,803], +[7748,78,775], +[7749,110,775], +[7750,78,803], +[7751,110,803], +[7752,78,817], +[7753,110,817], +[7754,78,813], +[7755,110,813], +[7756,79,771,769], +[7756,213,769], +[7757,111,771,769], +[7757,245,769], +[7758,79,771,776], +[7758,213,776], +[7759,111,771,776], +[7759,245,776], +[7760,79,772,768], +[7760,332,768], +[7761,111,772,768], +[7761,333,768], +[7762,79,772,769], +[7762,332,769], +[7763,111,772,769], +[7763,333,769], +[7764,80,769], +[7765,112,769], +[7766,80,775], +[7767,112,775], +[7768,82,775], +[7769,114,775], +[7770,82,803], +[7771,114,803], +[7772,82,803,772], +[7772,7770,772], +[7773,114,803,772], +[7773,7771,772], +[7774,82,817], +[7775,114,817], +[7776,83,775], +[7777,115,775], +[7778,83,803], +[7779,115,803], +[7780,83,769,775], +[7780,346,775], +[7781,115,769,775], +[7781,347,775], +[7782,83,780,775], +[7782,352,775], +[7783,115,780,775], +[7783,353,775], +[7784,83,803,775], +[7784,7776,803], +[7784,7778,775], +[7785,115,803,775], +[7785,7777,803], +[7785,7779,775], +[7786,84,775], +[7787,116,775], +[7788,84,803], +[7789,116,803], +[7790,84,817], +[7791,116,817], +[7792,84,813], +[7793,116,813], +[7794,85,804], +[7795,117,804], +[7796,85,816], +[7797,117,816], +[7798,85,813], +[7799,117,813], +[7800,85,771,769], +[7800,360,769], +[7801,117,771,769], +[7801,361,769], +[7802,85,772,776], +[7802,362,776], +[7803,117,772,776], +[7803,363,776], +[7804,86,771], +[7805,118,771], +[7806,86,803], +[7807,118,803], +[7808,87,768], +[7809,119,768], +[7810,87,769], +[7811,119,769], +[7812,87,776], +[7813,119,776], +[7814,87,775], +[7815,119,775], +[7816,87,803], +[7817,119,803], +[7818,88,775], +[7819,120,775], +[7820,88,776], +[7821,120,776], +[7822,89,775], +[7823,121,775], +[7824,90,770], +[7825,122,770], +[7826,90,803], +[7827,122,803], +[7828,90,817], +[7829,122,817], +[7830,104,817], +[7831,116,776], +[7832,119,778], +[7833,121,778], +[7835,383,775], +[7840,65,803], +[7841,97,803], +[7842,65,777], +[7843,97,777], +[7844,65,770,769], +[7844,194,769], +[7845,97,770,769], +[7845,226,769], +[7846,65,770,768], +[7846,194,768], +[7847,97,770,768], +[7847,226,768], +[7848,65,770,777], +[7848,194,777], +[7849,97,770,777], +[7849,226,777], +[7850,65,770,771], +[7850,194,771], +[7851,97,770,771], +[7851,226,771], +[7852,65,803,770], +[7852,194,803], +[7852,7840,770], +[7853,97,803,770], +[7853,226,803], +[7853,7841,770], +[7854,65,774,769], +[7854,258,769], +[7855,97,774,769], +[7855,259,769], +[7856,65,774,768], +[7856,258,768], +[7857,97,774,768], +[7857,259,768], +[7858,65,774,777], +[7858,258,777], +[7859,97,774,777], +[7859,259,777], +[7860,65,774,771], +[7860,258,771], +[7861,97,774,771], +[7861,259,771], +[7862,65,803,774], +[7862,258,803], +[7862,7840,774], +[7863,97,803,774], +[7863,259,803], +[7863,7841,774], +[7864,69,803], +[7865,101,803], +[7866,69,777], +[7867,101,777], +[7868,69,771], +[7869,101,771], +[7870,69,770,769], +[7870,202,769], +[7871,101,770,769], +[7871,234,769], +[7872,69,770,768], +[7872,202,768], +[7873,101,770,768], +[7873,234,768], +[7874,69,770,777], +[7874,202,777], +[7875,101,770,777], +[7875,234,777], +[7876,69,770,771], +[7876,202,771], +[7877,101,770,771], +[7877,234,771], +[7878,69,803,770], +[7878,202,803], +[7878,7864,770], +[7879,101,803,770], +[7879,234,803], +[7879,7865,770], +[7880,73,777], +[7881,105,777], +[7882,73,803], +[7883,105,803], +[7884,79,803], +[7885,111,803], +[7886,79,777], +[7887,111,777], +[7888,79,770,769], +[7888,212,769], +[7889,111,770,769], +[7889,244,769], +[7890,79,770,768], +[7890,212,768], +[7891,111,770,768], +[7891,244,768], +[7892,79,770,777], +[7892,212,777], +[7893,111,770,777], +[7893,244,777], +[7894,79,770,771], +[7894,212,771], +[7895,111,770,771], +[7895,244,771], +[7896,79,803,770], +[7896,212,803], +[7896,7884,770], +[7897,111,803,770], +[7897,244,803], +[7897,7885,770], +[7898,79,795,769], +[7898,211,795], +[7898,416,769], +[7899,111,795,769], +[7899,243,795], +[7899,417,769], +[7900,79,795,768], +[7900,210,795], +[7900,416,768], +[7901,111,795,768], +[7901,242,795], +[7901,417,768], +[7902,79,795,777], +[7902,7886,795], +[7902,416,777], +[7903,111,795,777], +[7903,7887,795], +[7903,417,777], +[7904,79,795,771], +[7904,213,795], +[7904,416,771], +[7905,111,795,771], +[7905,245,795], +[7905,417,771], +[7906,79,795,803], +[7906,7884,795], +[7906,416,803], +[7907,111,795,803], +[7907,7885,795], +[7907,417,803], +[7908,85,803], +[7909,117,803], +[7910,85,777], +[7911,117,777], +[7912,85,795,769], +[7912,218,795], +[7912,431,769], +[7913,117,795,769], +[7913,250,795], +[7913,432,769], +[7914,85,795,768], +[7914,217,795], +[7914,431,768], +[7915,117,795,768], +[7915,249,795], +[7915,432,768], +[7916,85,795,777], +[7916,7910,795], +[7916,431,777], +[7917,117,795,777], +[7917,7911,795], +[7917,432,777], +[7918,85,795,771], +[7918,360,795], +[7918,431,771], +[7919,117,795,771], +[7919,361,795], +[7919,432,771], +[7920,85,795,803], +[7920,7908,795], +[7920,431,803], +[7921,117,795,803], +[7921,7909,795], +[7921,432,803], +[7922,89,768], +[7923,121,768], +[7924,89,803], +[7925,121,803], +[7926,89,777], +[7927,121,777], +[7928,89,771], +[7929,121,771], +[7936,945,787], +[7937,945,788], +[7938,945,787,768], +[7938,7936,768], +[7939,945,788,768], +[7939,7937,768], +[7940,945,787,769], +[7940,7936,769], +[7941,945,788,769], +[7941,7937,769], +[7942,945,787,834], +[7942,7936,834], +[7943,945,788,834], +[7943,7937,834], +[7944,913,787], +[7945,913,788], +[7946,913,787,768], +[7946,7944,768], +[7947,913,788,768], +[7947,7945,768], +[7948,913,787,769], +[7948,7944,769], +[7949,913,788,769], +[7949,7945,769], +[7950,913,787,834], +[7950,7944,834], +[7951,913,788,834], +[7951,7945,834], +[7952,949,787], +[7953,949,788], +[7954,949,787,768], +[7954,7952,768], +[7955,949,788,768], +[7955,7953,768], +[7956,949,787,769], +[7956,7952,769], +[7957,949,788,769], +[7957,7953,769], +[7960,917,787], +[7961,917,788], +[7962,917,787,768], +[7962,7960,768], +[7963,917,788,768], +[7963,7961,768], +[7964,917,787,769], +[7964,7960,769], +[7965,917,788,769], +[7965,7961,769], +[7968,951,787], +[7969,951,788], +[7970,951,787,768], +[7970,7968,768], +[7971,951,788,768], +[7971,7969,768], +[7972,951,787,769], +[7972,7968,769], +[7973,951,788,769], +[7973,7969,769], +[7974,951,787,834], +[7974,7968,834], +[7975,951,788,834], +[7975,7969,834], +[7976,919,787], +[7977,919,788], +[7978,919,787,768], +[7978,7976,768], +[7979,919,788,768], +[7979,7977,768], +[7980,919,787,769], +[7980,7976,769], +[7981,919,788,769], +[7981,7977,769], +[7982,919,787,834], +[7982,7976,834], +[7983,919,788,834], +[7983,7977,834], +[7984,953,787], +[7985,953,788], +[7986,953,787,768], +[7986,7984,768], +[7987,953,788,768], +[7987,7985,768], +[7988,953,787,769], +[7988,7984,769], +[7989,953,788,769], +[7989,7985,769], +[7990,953,787,834], +[7990,7984,834], +[7991,953,788,834], +[7991,7985,834], +[7992,921,787], +[7993,921,788], +[7994,921,787,768], +[7994,7992,768], +[7995,921,788,768], +[7995,7993,768], +[7996,921,787,769], +[7996,7992,769], +[7997,921,788,769], +[7997,7993,769], +[7998,921,787,834], +[7998,7992,834], +[7999,921,788,834], +[7999,7993,834], +[8000,959,787], +[8001,959,788], +[8002,959,787,768], +[8002,8000,768], +[8003,959,788,768], +[8003,8001,768], +[8004,959,787,769], +[8004,8000,769], +[8005,959,788,769], +[8005,8001,769], +[8008,927,787], +[8009,927,788], +[8010,927,787,768], +[8010,8008,768], +[8011,927,788,768], +[8011,8009,768], +[8012,927,787,769], +[8012,8008,769], +[8013,927,788,769], +[8013,8009,769], +[8016,965,787], +[8017,965,788], +[8018,965,787,768], +[8018,8016,768], +[8019,965,788,768], +[8019,8017,768], +[8020,965,787,769], +[8020,8016,769], +[8021,965,788,769], +[8021,8017,769], +[8022,965,787,834], +[8022,8016,834], +[8023,965,788,834], +[8023,8017,834], +[8025,933,788], +[8027,933,788,768], +[8027,8025,768], +[8029,933,788,769], +[8029,8025,769], +[8031,933,788,834], +[8031,8025,834], +[8032,969,787], +[8033,969,788], +[8034,969,787,768], +[8034,8032,768], +[8035,969,788,768], +[8035,8033,768], +[8036,969,787,769], +[8036,8032,769], +[8037,969,788,769], +[8037,8033,769], +[8038,969,787,834], +[8038,8032,834], +[8039,969,788,834], +[8039,8033,834], +[8040,937,787], +[8041,937,788], +[8042,937,787,768], +[8042,8040,768], +[8043,937,788,768], +[8043,8041,768], +[8044,937,787,769], +[8044,8040,769], +[8045,937,788,769], +[8045,8041,769], +[8046,937,787,834], +[8046,8040,834], +[8047,937,788,834], +[8047,8041,834], +[8048,945,768], +[8050,949,768], +[8052,951,768], +[8054,953,768], +[8056,959,768], +[8058,965,768], +[8060,969,768], +[8064,945,787,837], +[8064,8115,787], +[8064,7936,837], +[8065,945,788,837], +[8065,8115,788], +[8065,7937,837], +[8066,945,787,768,837], +[8066,8115,787,768], +[8066,8064,768], +[8066,7936,837,768], +[8066,7936,768,837], +[8066,7938,837], +[8067,945,788,768,837], +[8067,8115,788,768], +[8067,8065,768], +[8067,7937,837,768], +[8067,7937,768,837], +[8067,7939,837], +[8068,945,787,769,837], +[8068,8115,787,769], +[8068,8064,769], +[8068,7936,837,769], +[8068,7936,769,837], +[8068,7940,837], +[8069,945,788,769,837], +[8069,8115,788,769], +[8069,8065,769], +[8069,7937,837,769], +[8069,7937,769,837], +[8069,7941,837], +[8070,945,787,834,837], +[8070,8115,787,834], +[8070,8064,834], +[8070,7936,837,834], +[8070,7936,834,837], +[8070,7942,837], +[8071,945,788,834,837], +[8071,8115,788,834], +[8071,8065,834], +[8071,7937,837,834], +[8071,7937,834,837], +[8071,7943,837], +[8072,913,787,837], +[8072,8124,787], +[8072,7944,837], +[8073,913,788,837], +[8073,8124,788], +[8073,7945,837], +[8074,913,787,768,837], +[8074,8124,787,768], +[8074,8072,768], +[8074,7944,837,768], +[8074,7944,768,837], +[8074,7946,837], +[8075,913,788,768,837], +[8075,8124,788,768], +[8075,8073,768], +[8075,7945,837,768], +[8075,7945,768,837], +[8075,7947,837], +[8076,913,787,769,837], +[8076,8124,787,769], +[8076,8072,769], +[8076,7944,837,769], +[8076,7944,769,837], +[8076,7948,837], +[8077,913,788,769,837], +[8077,8124,788,769], +[8077,8073,769], +[8077,7945,837,769], +[8077,7945,769,837], +[8077,7949,837], +[8078,913,787,834,837], +[8078,8124,787,834], +[8078,8072,834], +[8078,7944,837,834], +[8078,7944,834,837], +[8078,7950,837], +[8079,913,788,834,837], +[8079,8124,788,834], +[8079,8073,834], +[8079,7945,837,834], +[8079,7945,834,837], +[8079,7951,837], +[8080,951,787,837], +[8080,8131,787], +[8080,7968,837], +[8081,951,788,837], +[8081,8131,788], +[8081,7969,837], +[8082,951,787,768,837], +[8082,8131,787,768], +[8082,8080,768], +[8082,7968,837,768], +[8082,7968,768,837], +[8082,7970,837], +[8083,951,788,768,837], +[8083,8131,788,768], +[8083,8081,768], +[8083,7969,837,768], +[8083,7969,768,837], +[8083,7971,837], +[8084,951,787,769,837], +[8084,8131,787,769], +[8084,8080,769], +[8084,7968,837,769], +[8084,7968,769,837], +[8084,7972,837], +[8085,951,788,769,837], +[8085,8131,788,769], +[8085,8081,769], +[8085,7969,837,769], +[8085,7969,769,837], +[8085,7973,837], +[8086,951,787,834,837], +[8086,8131,787,834], +[8086,8080,834], +[8086,7968,837,834], +[8086,7968,834,837], +[8086,7974,837], +[8087,951,788,834,837], +[8087,8131,788,834], +[8087,8081,834], +[8087,7969,837,834], +[8087,7969,834,837], +[8087,7975,837], +[8088,919,787,837], +[8088,8140,787], +[8088,7976,837], +[8089,919,788,837], +[8089,8140,788], +[8089,7977,837], +[8090,919,787,768,837], +[8090,8140,787,768], +[8090,8088,768], +[8090,7976,837,768], +[8090,7976,768,837], +[8090,7978,837], +[8091,919,788,768,837], +[8091,8140,788,768], +[8091,8089,768], +[8091,7977,837,768], +[8091,7977,768,837], +[8091,7979,837], +[8092,919,787,769,837], +[8092,8140,787,769], +[8092,8088,769], +[8092,7976,837,769], +[8092,7976,769,837], +[8092,7980,837], +[8093,919,788,769,837], +[8093,8140,788,769], +[8093,8089,769], +[8093,7977,837,769], +[8093,7977,769,837], +[8093,7981,837], +[8094,919,787,834,837], +[8094,8140,787,834], +[8094,8088,834], +[8094,7976,837,834], +[8094,7976,834,837], +[8094,7982,837], +[8095,919,788,834,837], +[8095,8140,788,834], +[8095,8089,834], +[8095,7977,837,834], +[8095,7977,834,837], +[8095,7983,837], +[8096,969,787,837], +[8096,8179,787], +[8096,8032,837], +[8097,969,788,837], +[8097,8179,788], +[8097,8033,837], +[8098,969,787,768,837], +[8098,8179,787,768], +[8098,8096,768], +[8098,8032,837,768], +[8098,8032,768,837], +[8098,8034,837], +[8099,969,788,768,837], +[8099,8179,788,768], +[8099,8097,768], +[8099,8033,837,768], +[8099,8033,768,837], +[8099,8035,837], +[8100,969,787,769,837], +[8100,8179,787,769], +[8100,8096,769], +[8100,8032,837,769], +[8100,8032,769,837], +[8100,8036,837], +[8101,969,788,769,837], +[8101,8179,788,769], +[8101,8097,769], +[8101,8033,837,769], +[8101,8033,769,837], +[8101,8037,837], +[8102,969,787,834,837], +[8102,8179,787,834], +[8102,8096,834], +[8102,8032,837,834], +[8102,8032,834,837], +[8102,8038,837], +[8103,969,788,834,837], +[8103,8179,788,834], +[8103,8097,834], +[8103,8033,837,834], +[8103,8033,834,837], +[8103,8039,837], +[8104,937,787,837], +[8104,8188,787], +[8104,8040,837], +[8105,937,788,837], +[8105,8188,788], +[8105,8041,837], +[8106,937,787,768,837], +[8106,8188,787,768], +[8106,8104,768], +[8106,8040,837,768], +[8106,8040,768,837], +[8106,8042,837], +[8107,937,788,768,837], +[8107,8188,788,768], +[8107,8105,768], +[8107,8041,837,768], +[8107,8041,768,837], +[8107,8043,837], +[8108,937,787,769,837], +[8108,8188,787,769], +[8108,8104,769], +[8108,8040,837,769], +[8108,8040,769,837], +[8108,8044,837], +[8109,937,788,769,837], +[8109,8188,788,769], +[8109,8105,769], +[8109,8041,837,769], +[8109,8041,769,837], +[8109,8045,837], +[8110,937,787,834,837], +[8110,8188,787,834], +[8110,8104,834], +[8110,8040,837,834], +[8110,8040,834,837], +[8110,8046,837], +[8111,937,788,834,837], +[8111,8188,788,834], +[8111,8105,834], +[8111,8041,837,834], +[8111,8041,834,837], +[8111,8047,837], +[8112,945,774], +[8113,945,772], +[8114,945,768,837], +[8114,8115,768], +[8114,8048,837], +[8115,945,837], +[8116,945,769,837], +[8116,8115,769], +[8116,940,837], +[8118,945,834], +[8119,945,834,837], +[8119,8115,834], +[8119,8118,837], +[8120,913,774], +[8121,913,772], +[8122,913,768], +[8124,913,837], +[8129,168,834], +[8130,951,768,837], +[8130,8131,768], +[8130,8052,837], +[8131,951,837], +[8132,951,769,837], +[8132,8131,769], +[8132,942,837], +[8134,951,834], +[8135,951,834,837], +[8135,8131,834], +[8135,8134,837], +[8136,917,768], +[8138,919,768], +[8140,919,837], +[8141,8127,768], +[8142,8127,769], +[8143,8127,834], +[8144,953,774], +[8145,953,772], +[8146,953,776,768], +[8146,970,768], +[8150,953,834], +[8151,953,776,834], +[8151,970,834], +[8152,921,774], +[8153,921,772], +[8154,921,768], +[8157,8190,768], +[8158,8190,769], +[8159,8190,834], +[8160,965,774], +[8161,965,772], +[8162,965,776,768], +[8162,971,768], +[8164,961,787], +[8165,961,788], +[8166,965,834], +[8167,965,776,834], +[8167,971,834], +[8168,933,774], +[8169,933,772], +[8170,933,768], +[8172,929,788], +[8173,168,768], +[8178,969,768,837], +[8178,8179,768], +[8178,8060,837], +[8179,969,837], +[8180,969,769,837], +[8180,8179,769], +[8180,974,837], +[8182,969,834], +[8183,969,834,837], +[8183,8179,834], +[8183,8182,837], +[8184,927,768], +[8186,937,768], +[8188,937,837], +[8602,8592,824], +[8603,8594,824], +[8622,8596,824], +[8653,8656,824], +[8654,8660,824], +[8655,8658,824], +[8708,8707,824], +[8713,8712,824], +[8716,8715,824], +[8740,8739,824], +[8742,8741,824], +[8769,8764,824], +[8772,8771,824], +[8775,8773,824], +[8777,8776,824], +[8800,61,824], +[8802,8801,824], +[8813,8781,824], +[8814,60,824], +[8815,62,824], +[8816,8804,824], +[8817,8805,824], +[8820,8818,824], +[8821,8819,824], +[8824,8822,824], +[8825,8823,824], +[8832,8826,824], +[8833,8827,824], +[8836,8834,824], +[8837,8835,824], +[8840,8838,824], +[8841,8839,824], +[8876,8866,824], +[8877,8872,824], +[8878,8873,824], +[8879,8875,824], +[8928,8828,824], +[8929,8829,824], +[8930,8849,824], +[8931,8850,824], +[8938,8882,824], +[8939,8883,824], +[8940,8884,824], +[8941,8885,824], +[12364,12363,12441], +[12366,12365,12441], +[12368,12367,12441], +[12370,12369,12441], +[12372,12371,12441], +[12374,12373,12441], +[12376,12375,12441], +[12378,12377,12441], +[12380,12379,12441], +[12382,12381,12441], +[12384,12383,12441], +[12386,12385,12441], +[12389,12388,12441], +[12391,12390,12441], +[12393,12392,12441], +[12400,12399,12441], +[12401,12399,12442], +[12403,12402,12441], +[12404,12402,12442], +[12406,12405,12441], +[12407,12405,12442], +[12409,12408,12441], +[12410,12408,12442], +[12412,12411,12441], +[12413,12411,12442], +[12436,12358,12441], +[12446,12445,12441], +[12460,12459,12441], +[12462,12461,12441], +[12464,12463,12441], +[12466,12465,12441], +[12468,12467,12441], +[12470,12469,12441], +[12472,12471,12441], +[12474,12473,12441], +[12476,12475,12441], +[12478,12477,12441], +[12480,12479,12441], +[12482,12481,12441], +[12485,12484,12441], +[12487,12486,12441], +[12489,12488,12441], +[12496,12495,12441], +[12497,12495,12442], +[12499,12498,12441], +[12500,12498,12442], +[12502,12501,12441], +[12503,12501,12442], +[12505,12504,12441], +[12506,12504,12442], +[12508,12507,12441], +[12509,12507,12442], +[12532,12454,12441], +[12535,12527,12441], +[12536,12528,12441], +[12537,12529,12441], +[12538,12530,12441], +[12542,12541,12441], +); + +1; diff --git a/src/librarian/font-optimizer/Font/Subsetter/create-data.pl b/src/librarian/font-optimizer/Font/Subsetter/create-data.pl new file mode 100644 index 0000000..e0a38fb --- /dev/null +++ b/src/librarian/font-optimizer/Font/Subsetter/create-data.pl @@ -0,0 +1,100 @@ +use strict; +use warnings; + +use Unicode::Normalize; + +print <) { + my @c = split /;/, $_; + # Find characters which canonically decompose (without any + # compatibility tag "") + next unless $c[5] and $c[5] !~ /^[ord($1)-ord('a')]/eg; $_ } split / /, $cs2; + # If NFC didn't collapse everything into single characters, this string is not interesting + next if grep length != 1, @x; + # If the string doesn't NFC into the desired character, it's not interesting + next unless Unicode::Normalize::NFC(join '', @x) eq chr hex $c[0]; + # This string is good + push @data, [hex $c[0], map ord, @x]; + } + } + } elsif (@norm == 4) { + my ($a, $b, $c, $d) = @norm; + for my $cs (permut([$a, $b, $c, $d], [])) { + for my $cs2 ('ab c d', 'a bc d', 'a b cd', 'ab cd', 'abc d', 'a bcd') { + my @x = map Unicode::Normalize::NFC($_), map { s/(.)/$cs->[ord($1)-ord('a')]/eg; $_ } split / /, $cs2; + next if grep length != 1, @x; + next unless Unicode::Normalize::NFC(join '', @x) eq chr hex $c[0]; + push @data, [hex $c[0], map ord, @x]; + } + } + } elsif (@norm > 4) { + die "\@norm too big"; + } +} + +print uniq(map "[".join(',', @$_)."],\n", @data); + +print < \$verbose, + 'ttf-to-eot' => \$ttf_to_eot, + 'eot-to-ttf' => \$eot_to_ttf, + ) or help(); + + @ARGV == 2 or help(); + + my ($input_file, $output_file) = @ARGV; + + if ($ttf_to_eot and $eot_to_ttf) { + help(); + } + + if (not ($ttf_to_eot or $eot_to_ttf)) { + if ($input_file =~ /\.[ot]tf$/i and $output_file =~ /\.eot$/i) { + $ttf_to_eot = 1; + } elsif ($input_file =~ /\.eot$/i and $output_file =~ /\.[ot]tf$/i) { + $eot_to_ttf = 1; + } else { + help(); + } + } + + if ($ttf_to_eot) { + Font::EOTWrapper::convert($input_file, $output_file); + } elsif ($eot_to_ttf) { + Font::EOTWrapper::extract($input_file, $output_file); + } +} diff --git a/src/librarian/font-optimizer/ext/Font-TTF/.cvsignore b/src/librarian/font-optimizer/ext/Font-TTF/.cvsignore new file mode 100644 index 0000000..459bc9c --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/.cvsignore @@ -0,0 +1,2 @@ +*.gz +MANIFEST diff --git a/src/librarian/font-optimizer/ext/Font-TTF/COPYING b/src/librarian/font-optimizer/ext/Font-TTF/COPYING new file mode 100644 index 0000000..cbda892 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/COPYING @@ -0,0 +1,76 @@ + +Artistic License 2.0 + +Copyright (c) 2000-2006, The Perl Foundation. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. +Preamble + +This license establishes the terms under which a given free software Package may be copied, modified, distributed, and/or redistributed. The intent is that the Copyright Holder maintains some artistic control over the development of that Package while still keeping the Package available as open source and free software. + +You are always permitted to make arrangements wholly outside of this license directly with the Copyright Holder of a given Package. If the terms of this license do not permit the full use that you propose to make of the Package, you should contact the Copyright Holder and seek a different licensing arrangement. +Definitions + +"Copyright Holder" means the individual(s) or organization(s) named in the copyright notice for the entire Package. + +"Contributor" means any party that has contributed code or other material to the Package, in accordance with the Copyright Holder's procedures. + +"You" and "your" means any person who would like to copy, distribute, or modify the Package. + +"Package" means the collection of files distributed by the Copyright Holder, and derivatives of that collection and/or of those files. A given Package may consist of either the Standard Version, or a Modified Version. + +"Distribute" means providing a copy of the Package or making it accessible to anyone else, or in the case of a company or organization, to others outside of your company or organization. + +"Distributor Fee" means any fee that you charge for Distributing this Package or providing support for this Package to another party. It does not mean licensing fees. + +"Standard Version" refers to the Package if it has not been modified, or has been modified only in ways explicitly requested by the Copyright Holder. + +"Modified Version" means the Package, if it has been changed, and such changes were not explicitly requested by the Copyright Holder. + +"Original License" means this Artistic License as Distributed with the Standard Version of the Package, in its current version or as it may be modified by The Perl Foundation in the future. + +"Source" form means the source code, documentation source, and configuration files for the Package. + +"Compiled" form means the compiled bytecode, object code, binary, or any other form resulting from mechanical transformation or translation of the Source form. +Permission for Use and Modification Without Distribution + +(1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not Distribute the Modified Version. +Permissions for Redistribution of the Standard Version + +(2) You may Distribute verbatim copies of the Source form of the Standard Version of this Package in any medium without restriction, either gratis or for a Distributor Fee, provided that you duplicate all of the original copyright notices and associated disclaimers. At your discretion, such verbatim copies may or may not include a Compiled form of the Package. + +(3) You may apply any bug fixes, portability changes, and other modifications made available from the Copyright Holder. The resulting Package will still be considered the Standard Version, and as such will be subject to the Original License. +Distribution of Modified Versions of the Package as Source + +(4) You may Distribute your Modified Version as Source (either gratis or for a Distributor Fee, and with or without a Compiled form of the Modified Version) provided that you clearly document how it differs from the Standard Version, including, but not limited to, documenting any non-standard features, executables, or modules, and provided that you do at least ONE of the following: + +(a) make the Modified Version available to the Copyright Holder of the Standard Version, under the Original License, so that the Copyright Holder may include your modifications in the Standard Version. +(b) ensure that installation of your Modified Version does not prevent the user installing or running the Standard Version. In addition, the Modified Version must bear a name that is different from the name of the Standard Version. +(c) allow anyone who receives a copy of the Modified Version to make the Source form of the Modified Version available to others under +(i) the Original License or +(ii) a license that permits the licensee to freely copy, modify and redistribute the Modified Version using the same licensing terms that apply to the copy that the licensee received, and requires that the Source form of the Modified Version, and of any works derived from it, be made freely available in that license fees are prohibited but Distributor Fees are allowed. +Distribution of Compiled Forms of the Standard Version or Modified Versions without the Source + +(5) You may Distribute Compiled forms of the Standard Version without the Source, provided that you include complete instructions on how to get the Source of the Standard Version. Such instructions must be valid at the time of your distribution. If these instructions, at any time while you are carrying out such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If you provide valid instructions or cease distribution within thirty days after you become aware that the instructions are invalid, then you do not forfeit any of your rights under this license. + +(6) You may Distribute a Modified Version in Compiled form without the Source, provided that you comply with Section 4 with respect to the Source of the Modified Version. +Aggregating or Linking the Package + +(7) You may aggregate the Package (either the Standard Version or Modified Version) with other packages and Distribute the resulting aggregation provided that you do not charge a licensing fee for the Package. Distributor Fees are permitted, and licensing fees for other components in the aggregation are permitted. The terms of this license apply to the use and Distribution of the Standard or Modified Versions as included in the aggregation. + +(8) You are permitted to link Modified and Standard Versions with other works, to embed the Package in a larger work of your own, or to build stand-alone binary or bytecode versions of applications that include the Package, and Distribute the result without restriction, provided the result does not expose a direct interface to the Package. +Items That are Not Considered Part of a Modified Version + +(9) Works (including, but not limited to, modules and scripts) that merely extend or make use of the Package, do not, by themselves, cause the Package to be a Modified Version. In addition, such works are not considered parts of the Package itself, and are not subject to the terms of this license. +General Provisions + +(10) Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license. + +(11) If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license. + +(12) This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder. + +(13) This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed. + +(14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/Changes b/src/librarian/font-optimizer/ext/Font-TTF/Changes new file mode 100644 index 0000000..1821632 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/Changes @@ -0,0 +1,6 @@ +0.45 + +* Introduce changelog +* tidy up 0.44 package, fix README to be more accurate +* tests failing on perl 5.8.2 and before due to no use Exporter qw(import); + Fix OTTags accordingly. diff --git a/src/librarian/font-optimizer/ext/Font-TTF/MANIFEST.SKIP b/src/librarian/font-optimizer/ext/Font-TTF/MANIFEST.SKIP new file mode 100644 index 0000000..464c50e --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/MANIFEST.SKIP @@ -0,0 +1,26 @@ +blib/ +\.\$\$\$ +\.tmp +\.bak +CVS/ +\.tar +\.tgz +\.old +misc/ +Build/ +exes/ +\.cvsignore +^# +\.svn/ +Makefile$ +\.par$ +-stamp$ +debian/ +pm_to_blib +\~$ +dev/ +build/ +dists/ +^libfont- +description-pak +^doc diff --git a/src/librarian/font-optimizer/ext/Font-TTF/Makefile.PL b/src/librarian/font-optimizer/ext/Font-TTF/Makefile.PL new file mode 100644 index 0000000..c0518d5 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/Makefile.PL @@ -0,0 +1,108 @@ +use ExtUtils::MakeMaker; +use Getopt::Std; + +getopts('d:rv:'); + +%pbuilderopts = ( + 'gutsy' => '--bindmounts /media/hosk_1' + ); + +$opt_v ||= 1; + +if ($^O eq 'linux' && !defined $opt_d) +{ + $opt_d = `lsb_release -c`; + $opt_d =~ s/^.*?(\w+)\s*$/$1/o; +} + +@theselibs = (grep {-f } glob("lib/Font/TTF/*"), "lib/Font/TTF.pm"); + +# incantation to enable MY::pm_to_blib later on +if ($^O eq 'MSWin32') +{ + push(@ExtUtils::MakeMaker::Overridable, qw(pm_to_blib)); + @extras = ('dist' => { 'TO_UNIX' => 'perl -Mtounix -e "tounix(\"$(DISTVNAME)\")"' }); +} + +%makeinfo = ( + NAME => 'Font::TTF', + VERSION_FROM => 'lib/Font/TTF.pm', +# VERSION => "0.38", +# HTMLLIBPODS => {map {my $t = $_; $t=~s/\..*?$/.html/o; $t='blib/Html/'.$t; $_ => $t;} @theselibs}, +# HTMLSCRIPTPODS => {map {my $t=$_; $t=~s/\..*?$/.html/o; $t='blib/Html/'.$t; $_ => $t;} @scripts}, + AUTHOR => "martin_hosken\@sil.org", + ABSTRACT => "TTF font support for Perl", + @extras + ); + +WriteMakefile(%makeinfo); + +if ($^O eq 'MSWin32') { +# incantation to solve the problem of everyone's $Config{make} being 'nmake' +# when we want 'pmake'. And $Config{} is read only. +# actually, this is just a copy of the code from ExtUtiles::MM_Win32 tidied +# up (to expose tabs) and the dependency on Config removed +sub MY::pm_to_blib +{ + my $self = shift; + my($autodir) = $self->catdir('$(INST_LIB)','auto'); + return <<"EOT"; + +pm_to_blib: \$(TO_INST_PM) +\t$self->{NOECHO}\$(PERL) \"-I\$(INST_ARCHLINE)\" \"-I\$(INST_LIB)\" \\ +\t\"-I\$(PERL_ARCHLIB)\" \"-I\$(PERL_LIB)\" -MExtUtils::Install \\ +\t-e \"pm_to_blib({ qw[\$(PM_TO_BLIB)] }, '$autodir') +\t$self->{NOECHO}\$(TOUCH) \$@ + +EOT +} + +} +elsif ($^O eq 'linux') +{ + +sub MY::postamble +{ + my ($self) = @_; + my ($res); + my ($package) = lc($self->{'NAME'}); + my ($pversion) = $self->{'VERSION'}; + my ($svn) = `svnversion`; + my ($sign) = '--auto-debsign' if ($opt_r); + my ($fpackage); + + $svn =~ s/[0-9]*://og; + $svn =~ s/\s+$//o; + $package =~ s/::/-/; + $package = "lib${package}-perl"; + $pversion .= "+$svn" unless ($opt_r); + $fpackage = "$package-$pversion"; + + $res = <<"EOT"; +deb-base: dist + rm -fr $self->{'DISTVNAME'} + rm -fr $fpackage + tar xvzf $self->{'DISTVNAME'}.tar.gz + mv $self->{'DISTVNAME'} $fpackage + tar cfz "${package}_$pversion.orig.tar.gz" $fpackage + cp -a debian $fpackage + cd $fpackage && find . -name .svn | xargs rm -rf + +# make deb builds an interim deb from svn source for release +deb: deb-base +EOT + + foreach $d (split(' ', $opt_d)) + { + $res .= <<"EOT"; + mkdir -p dists/$d + dch -D $d -v $pversion-$opt_v -m -b -c $fpackage/debian/changelog "Auto build from perl for $d" + cd $fpackage && pdebuild --buildresult ../dists/$d -- --basetgz /var/cache/pbuilder/base-$d.tgz $pbuilderopts{$d} +EOT + } + + return $res; +} + +} + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/README.TXT b/src/librarian/font-optimizer/ext/Font-TTF/README.TXT new file mode 100644 index 0000000..ad6a602 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/README.TXT @@ -0,0 +1,99 @@ + Perl Module: Font::TTF + +=head1 Introduction + +Perl module for TrueType font hacking. Supports reading, processing and +writing of the following tables: GDEF, GPOS, GSUB, LTSH, OS/2, PCLT, +bsln, cmap, cvt, fdsc, feat, fpgm, glyf, hdmx, head, hhea, hmtx, kern, +loca, maxp, mort, name, post, prep, prop, vhea, vmtx and the reading and +writing of all other table types. + +In short, you can do almost anything with a standard TrueType font with +this module. Be Brave! + +Any suggestions, improvements, additions, subclasses, etc. would be gratefully +received and probably included in a future release. Please send them to me. + +This module has been tested on Win32, Unix and Mac. + +Applications that were associated with this module have been moved to Font::TTF::Scripts where great things can be done. + +=head1 SYNOPSIS + +Here is the regression test (you provide your own font). Run it once and then +again on the output of the first run. There should be no differences between +the outputs of the two runs. + + use Font::TTF::Font; + + $f = Font::TTF::Font->open($ARGV[0]); + + # force a read of all the tables + $f->tables_do(sub { $_[0]->read; }); + + # force read of all glyphs (use read_dat to use lots of memory!) + # $f->{'loca'}->glyphs_do(sub { $_[0]->read; }); + $f->{'loca'}->glyphs_do(sub { $_[0]->read_dat; }); + # NB. no need to $g->update since $_[0]->{'glyf'}->out will do it for us + + $f->out($ARGV[1]); + $f->DESTROY; # forces close of $in and maybe memory reclaim! + +=head1 Installation + +If you have received this package as part of an Activestate PPM style .zip file +then type + + ppm install Font-TTF.ppd + +Otherwise. + +To configure this module, cd to the directory that contains this README file +and type the following. + + perl Makefile.PL + +Alternatively, if you plan to install Font::TTF somewhere other than +your system's perl library directory. You can type something like this: + + perl Makefile.PL PREFIX=/home/me/perl INSTALLDIRS=perl + +Then to build you run make. + + make + +If you have write access to the perl library directories, you may then +install by typing: + + make install + +To tidy up, type: + + make realclean + +Win32 users should use pmake instead of make. Alternatively installation can be +done on Win32 by typing: + + Setup + +Or using the install feature in tools like WinZip. + +=head1 CHANGES + +=head2 Future Changes + +I do not anticipate any more restructuring changes (but reserve the right to do so). + +=head1 AUTHOR + +Martin Hosken L + +Copyright Martin Hosken 1998 and following. + +No warranty or expression of effectiveness for anything, least of all anyone's +safety, is implied in this software or documentation. + +=head2 Licensing + +The Perl TTF module is licensed under the Perl Artistic License. + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/TODO b/src/librarian/font-optimizer/ext/Font-TTF/TODO new file mode 100644 index 0000000..a562dc4 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/TODO @@ -0,0 +1,5 @@ + +* update() is a mess. What is needed is a mark sweep clean algorithm where the + dirty is used only for tables that have changed. Thus if a table is updated + it could well become dirty! Also need to be able to pass a force parameter + to force a table to update and all the tables in its dependency tree. diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF.pm new file mode 100644 index 0000000..59237d3 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF.pm @@ -0,0 +1,24 @@ +package Font::TTF; + +$VERSION = '0.46'; # MJPH 26-JAN-2009 Various bug fixes, add Sill table +# $VERSION = '0.45'; # MJPH 11-JUN-2008 Packaging tidying +# $VERSION = '0.44'; # MJPH 9-JUN-2008 Various bug fixes +# $VERSION = '0.43'; # MJPH 20-NOV-2007 Add a test! +# $VERSION = '0.42'; # MJPH 11-OCT-2007 Add Volt2ttf support +# $VERSION = '0.41'; # MJPH 27-MAR-2007 Remove warnings from font copy +# Bug fixes in Ttopen, GDEF +# Remove redundant head and maxp ->reads +# $VERSION = '0.40'; # MJPH 31-JUL-2006 Add EBDT, EBLC tables +# $VERSION = 0.39; + +1; + +=head1 NAME + +Font::TTF - Perl module for TrueType Font hacking + +=head1 DESCRIPTION + +This module allows you to do almost anything to a TrueType/OpenType Font +including modify and inspect nearly all tables. + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/AATKern.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/AATKern.pm new file mode 100644 index 0000000..6aa1e62 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/AATKern.pm @@ -0,0 +1,140 @@ +package Font::TTF::AATKern; + +=head1 NAME + +Font::TTF::AATKern - AAT Kern table + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; +use Font::TTF::Kern::Subtable; + +@ISA = qw(Font::TTF::Table); + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self) = @_; + + $self->SUPER::read or return $self; + + my ($dat, $fh, $numSubtables); + $fh = $self->{' INFILE'}; + + $fh->read($dat, 8); + ($self->{'version'}, $numSubtables) = TTF_Unpack("vL", $dat); + + my $subtables = []; + foreach (1 .. $numSubtables) { + my $subtableStart = $fh->tell(); + + $fh->read($dat, 8); + my ($length, $coverage, $tupleIndex) = TTF_Unpack("LSS", $dat); + my $type = $coverage & 0x00ff; + + my $subtable = Font::TTF::Kern::Subtable->create($type, $coverage, $length); + $subtable->read($fh); + + $subtable->{'tupleIndex'} = $tupleIndex if $subtable->{'variation'}; + $subtable->{' PARENT'} = $self; + push @$subtables, $subtable; + } + + $self->{'subtables'} = $subtables; + + $self; +} + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying + +=cut + +sub out +{ + my ($self, $fh) = @_; + + return $self->SUPER::out($fh) unless $self->{' read'}; + + my $subtables = $self->{'subtables'}; + $fh->print(TTF_Pack("vL", $self->{'version'}, scalar @$subtables)); + + foreach (@$subtables) { + $_->out($fh); + } +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + + $self->read unless $self->{' read'}; + + $fh = 'STDOUT' unless defined $fh; + + $fh->printf("version %f\n", $self->{'version'}); + + my $subtables = $self->{'subtables'}; + foreach (@$subtables) { + $_->print($fh); + } +} + +sub dumpXML +{ + my ($self, $fh) = @_; + $self->read unless $self->{' read'}; + + my $post = $self->{' PARENT'}->{'post'}; + $post->read; + + $fh = 'STDOUT' unless defined $fh; + $fh->printf("\n", $self->{'version'}); + + my $subtables = $self->{'subtables'}; + foreach (@$subtables) { + $fh->printf("<%s", $_->type); + $fh->printf(" vertical=\"1\"") if $_->{'vertical'}; + $fh->printf(" crossStream=\"1\"") if $_->{'crossStream'}; + $fh->printf(" variation=\"1\"") if $_->{'variation'}; + $fh->printf(" tupleIndex=\"%s\"", $_->{'tupleIndex'}) if exists $_->{'tupleIndex'}; + $fh->printf(">\n"); + + $_->dumpXML($fh); + + $fh->printf("\n", $_->type); + } + + $fh->printf("\n"); +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/AATutils.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/AATutils.pm new file mode 100644 index 0000000..96ceb7e --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/AATutils.pm @@ -0,0 +1,689 @@ +package Font::TTF::AATutils; + +use strict; +use vars qw(@ISA @EXPORT); +require Exporter; + +use Font::TTF::Utils; +use IO::File; + +@ISA = qw(Exporter); +@EXPORT = qw( + AAT_read_lookup + AAT_pack_lookup + AAT_write_lookup + AAT_pack_classes + AAT_write_classes + AAT_pack_states + AAT_write_states + AAT_read_state_table + AAT_read_subtable + xmldump +); + +sub xmldump +{ + my ($var, $links, $depth, $processedVars, $type) = @_; + + $processedVars = {} unless (defined $processedVars); + print("\n") if $depth == 0; # not necessarily true encoding for all text! + + my $indent = "\t" x $depth; + + my ($objType, $addr) = ($var =~ m/^.+=(.+)\((.+)\)$/); + unless (defined $type) { + if (defined $addr) { + if (defined $processedVars->{$addr}) { + if ($links) { + printf("%s%s\n", $indent, "$objType"); + } + else { + printf("%s%s\n", $indent, "$objType"); + } + return; + } + $processedVars->{$addr} = 1; + } + } + + $type = ref $var unless defined $type; + + if ($type eq 'REF') { + printf("%s\n", $indent, $$var); + } + elsif ($type eq 'SCALAR') { + printf("%s%s\n", $indent, $var); + } + elsif ($type eq 'ARRAY') { + # printf("%s\n", $indent); + foreach (0 .. $#$var) { + if (ref($var->[$_])) { + printf("%s\n", $indent, $_); + xmldump($var->[$_], $links, $depth + 1, $processedVars); + printf("%s\n", $indent); + } + else { + printf("%s%s\n", $indent, $_, $var->[$_]); + } + } + # printf("%s\n", $indent); + } + elsif ($type eq 'HASH') { + # printf("%s\n", $indent); + foreach (sort keys %$var) { + if (ref($var->{$_})) { + printf("%s\n", $indent, $_); + xmldump($var->{$_}, $links, $depth + 1, $processedVars); + printf("%s\n", $indent); + } + else { + printf("%s%s\n", $indent, $_, $var->{$_}); + } + } + # printf("%s\n", $indent); + } + elsif ($type eq 'CODE') { + printf("%s\n", $indent, $var); + } + elsif ($type eq 'GLOB') { + printf("%s\n", $indent, $var); + } + elsif ($type eq '') { + printf("%s%s\n", $indent, $var); + } + else { + if ($links) { + printf("%s\n", $indent, $type, $addr); + } + else { + printf("%s\n", $indent, $type); + } + xmldump($var, $links, $depth + 1, $processedVars, $objType); + printf("%s\n", $indent); + } +} + +=head2 ($classes, $states) = AAT_read_subtable($fh, $baseOffset, $subtableStart, $limits) + +=cut + +sub AAT_read_subtable +{ + my ($fh, $baseOffset, $subtableStart, $limits) = @_; + + my $limit = 0xffffffff; + foreach (@$limits) { + $limit = $_ if ($_ > $subtableStart and $_ < $limit); + } + die if $limit == 0xffffffff; + + my $dat; + $fh->seek($baseOffset + $subtableStart, IO::File::SEEK_SET); + $fh->read($dat, $limit - $subtableStart); + + $dat; +} + +=head2 $length = AAT_write_state_table($fh, $classes, $states, $numExtraTables, $packEntry) + +$packEntry is a subroutine for packing an entry into binary form, called as + +$dat = $packEntry($entry, $entryTable, $numEntries) + +where the entry is a comma-separated list of nextStateOffset, flags, actions + +=cut + +sub AAT_pack_state_table +{ + my ($classes, $states, $numExtraTables, $packEntry) = @_; + + my ($dat) = pack("n*", (0) x (4 + $numExtraTables)); # placeholders for stateSize, classTable, stateArray, entryTable + + my ($firstGlyph, $lastGlyph) = (0xffff, 0, 0); + my (@classTable, $i); + foreach $i (0 .. $#$classes) { + my $class = $classes->[$i]; + foreach (@$class) { + $firstGlyph = $_ if $_ < $firstGlyph; + $lastGlyph = $_ if $_ > $lastGlyph; + $classTable[$_] = $i; + } + } + + my $classTable = length($dat); + $dat .= pack("nnC*", $firstGlyph, $lastGlyph - $firstGlyph + 1, + map { defined $classTable[$_] ? $classTable[$_] : 1 } ($firstGlyph .. $lastGlyph)); + $dat .= pack("C", 0) if (($lastGlyph - $firstGlyph) & 1) == 0; # pad if odd number of glyphs + + my $stateArray = length($dat); + my (@entries, %entries); + my $state = $states->[0]; + my $stateSize = @$state; + die "stateSize below minimum allowed (4)" if $stateSize < 4; + die "stateSize (" . $stateSize . ") too small for max class number (" . $#$classes . ")" if $stateSize < $#$classes + 1; + warn "state array has unreachable columns" if $stateSize > $#$classes + 1; + + foreach (@$states) { + die "inconsistent state size" if @$_ != $stateSize; + foreach (@$_) { + my $actions = $_->{'actions'}; + my $entry = join(",", $stateArray + $_->{'nextState'} * $stateSize, $_->{'flags'}, ref($actions) eq 'ARRAY' ? @$actions : $actions); + if (not defined $entries{$entry}) { + push @entries, $entry; + $entries{$entry} = $#entries; + die "too many different state array entries" if $#entries == 256; + } + $dat .= pack("C", $entries{$entry}); + } + } + $dat .= pack("C", 0) if (@$states & 1) != 0 and ($stateSize & 1) != 0; # pad if state array size is odd + + my $entryTable = length($dat); + $dat .= map { &$packEntry($_, $entryTable, $#entries + 1) } @entries; + + my ($dat1) = pack("nnnn", $stateSize, $classTable, $stateArray, $entryTable); + substr($dat, 0, length($dat1)) = $dat1; + + return $dat; +} + +sub AAT_write_state_table +{ + my ($fh, $classes, $states, $numExtraTables, $packEntry) = @_; + + my $stateTableStart = $fh->tell(); + + $fh->print(pack("n*", (0) x (4 + $numExtraTables))); # placeholders for stateSize, classTable, stateArray, entryTable + + my ($firstGlyph, $lastGlyph) = (0xffff, 0, 0); + my (@classTable, $i); + foreach $i (0 .. $#$classes) { + my $class = $classes->[$i]; + foreach (@$class) { + $firstGlyph = $_ if $_ < $firstGlyph; + $lastGlyph = $_ if $_ > $lastGlyph; + $classTable[$_] = $i; + } + } + + my $classTable = $fh->tell() - $stateTableStart; + $fh->print(pack("nnC*", $firstGlyph, $lastGlyph - $firstGlyph + 1, + map { defined $classTable[$_] ? $classTable[$_] : 1 } ($firstGlyph .. $lastGlyph))); + $fh->print(pack("C", 0)) if (($lastGlyph - $firstGlyph) & 1) == 0; # pad if odd number of glyphs + + my $stateArray = $fh->tell() - $stateTableStart; + my (@entries, %entries); + my $state = $states->[0]; + my $stateSize = @$state; + die "stateSize below minimum allowed (4)" if $stateSize < 4; + die "stateSize (" . $stateSize . ") too small for max class number (" . $#$classes . ")" if $stateSize < $#$classes + 1; + warn "state array has unreachable columns" if $stateSize > $#$classes + 1; + + foreach (@$states) { + die "inconsistent state size" if @$_ != $stateSize; + foreach (@$_) { + my $actions = $_->{'actions'}; + my $entry = join(",", $stateArray + $_->{'nextState'} * $stateSize, $_->{'flags'}, ref($actions) eq 'ARRAY' ? @$actions : $actions); + if (not defined $entries{$entry}) { + push @entries, $entry; + $entries{$entry} = $#entries; + die "too many different state array entries" if $#entries == 256; + } + $fh->print(pack("C", $entries{$entry})); + } + } + $fh->print(pack("C", 0)) if (@$states & 1) != 0 and ($stateSize & 1) != 0; # pad if state array size is odd + + my $entryTable = $fh->tell() - $stateTableStart; + $fh->print(map { &$packEntry($_, $entryTable, $#entries + 1) } @entries); + + my $length = $fh->tell() - $stateTableStart; + $fh->seek($stateTableStart, IO::File::SEEK_SET); + $fh->print(pack("nnnn", $stateSize, $classTable, $stateArray, $entryTable)); + + $fh->seek($stateTableStart + $length, IO::File::SEEK_SET); + $length; +} + +sub AAT_pack_classes +{ + my ($classes) = @_; + + my ($firstGlyph, $lastGlyph) = (0xffff, 0, 0); + my (@classTable, $i); + foreach $i (0 .. $#$classes) { + my $class = $classes->[$i]; + foreach (@$class) { + $firstGlyph = $_ if $_ < $firstGlyph; + $lastGlyph = $_ if $_ > $lastGlyph; + $classTable[$_] = $i; + } + } + + my ($dat) = pack("nnC*", $firstGlyph, $lastGlyph - $firstGlyph + 1, + map { defined $classTable[$_] ? $classTable[$_] : 1 } ($firstGlyph .. $lastGlyph)); + $dat .= pack("C", 0) if (($lastGlyph - $firstGlyph) & 1) == 0; # pad if odd number of glyphs + + return $dat; +} + +sub AAT_write_classes +{ + my ($fh, $classes) = @_; + + $fh->print(AAT_pack_classes($fh, $classes)); +} + +sub AAT_pack_states +{ + my ($classes, $stateArray, $states, $buildEntryProc) = @_; + + my ($entries, %entryHash); + my $state = $states->[0]; + my $stateSize = @$state; + + die "stateSize below minimum allowed (4)" if $stateSize < 4; + die "stateSize (" . $stateSize . ") too small for max class number (" . $#$classes . ")" if $stateSize < $#$classes + 1; + warn "state array has unreachable columns" if $stateSize > $#$classes + 1; + + my ($dat); + foreach (@$states) { + die "inconsistent state size" if @$_ != $stateSize; + foreach (@$_) { + my $entry = join(",", $stateArray + $_->{'nextState'} * $stateSize, &$buildEntryProc($_)); + if (not defined $entryHash{$entry}) { + push @$entries, $entry; + $entryHash{$entry} = $#$entries; + die "too many different state array entries" if $#$entries == 256; + } + $dat .= pack("C", $entryHash{$entry}); + } + } + $dat .= pack("C", 0) if (@$states & 1) != 0 and ($stateSize & 1) != 0; # pad if state array size is odd + + ($dat, $stateSize, $entries); +} + +sub AAT_write_states +{ + my ($fh, $classes, $stateArray, $states, $buildEntryProc) = @_; + + my ($entries, %entryHash); + my $state = $states->[0]; + my $stateSize = @$state; + + die "stateSize below minimum allowed (4)" if $stateSize < 4; + die "stateSize (" . $stateSize . ") too small for max class number (" . $#$classes . ")" if $stateSize < $#$classes + 1; + warn "state array has unreachable columns" if $stateSize > $#$classes + 1; + + foreach (@$states) { + die "inconsistent state size" if @$_ != $stateSize; + foreach (@$_) { + my $entry = join(",", $stateArray + $_->{'nextState'} * $stateSize, &$buildEntryProc($_)); + if (not defined $entryHash{$entry}) { + push @$entries, $entry; + $entryHash{$entry} = $#$entries; + die "too many different state array entries" if $#$entries == 256; + } + $fh->print(pack("C", $entryHash{$entry})); + } + } + $fh->print(pack("C", 0)) if (@$states & 1) != 0 and ($stateSize & 1) != 0; # pad if state array size is odd + + ($stateSize, $entries); +} + +=head2 ($classes, $states, $entries) = AAT_read_state_table($fh, $numActionWords) + +=cut + +sub AAT_read_state_table +{ + my ($fh, $numActionWords) = @_; + + my $stateTableStart = $fh->tell(); + my $dat; + $fh->read($dat, 8); + my ($stateSize, $classTable, $stateArray, $entryTable) = unpack("nnnn", $dat); + + my $classes; # array of lists of glyphs + + $fh->seek($stateTableStart + $classTable, IO::File::SEEK_SET); + $fh->read($dat, 4); + my ($firstGlyph, $nGlyphs) = unpack("nn", $dat); + $fh->read($dat, $nGlyphs); + foreach (unpack("C*", $dat)) { + if ($_ != 1) { + my $class = $classes->[$_]; + push(@$class, $firstGlyph); + $classes->[$_] = $class unless defined $classes->[$_]; + } + $firstGlyph++; + } + + $fh->seek($stateTableStart + $stateArray, IO::File::SEEK_SET); + my $states; # array of arrays of hashes{nextState, flags, actions} + + my $entrySize = 4 + ($numActionWords * 2); + my $lastState = 1; + my $entries; + while ($#$states < $lastState) { + $fh->read($dat, $stateSize); + my @stateEntries = unpack("C*", $dat); + my $state; + foreach (@stateEntries) { + if (not defined $entries->[$_]) { + my $loc = $fh->tell(); + $fh->seek($stateTableStart + $entryTable + ($_ * $entrySize), IO::File::SEEK_SET); + $fh->read($dat, $entrySize); + my ($nextState, $flags, $actions); + ($nextState, $flags, @$actions) = unpack("n*", $dat); + $nextState -= $stateArray; + $nextState /= $stateSize; + $entries->[$_] = { 'nextState' => $nextState, 'flags' => $flags }; + $entries->[$_]->{'actions'} = $actions if $numActionWords > 0; + $lastState = $nextState if ($nextState > $lastState); + $fh->seek($loc, IO::File::SEEK_SET); + } + push(@$state, $entries->[$_]); + } + push(@$states, $state); + } + + ($classes, $states, $entries); +} + +=head2 ($format, $lookup) = AAT_read_lookup($fh, $valueSize, $length, $default) + +=cut + +sub AAT_read_lookup +{ + my ($fh, $valueSize, $length, $default) = @_; + + my $lookupStart = $fh->tell(); + my ($dat, $unpackChar); + if ($valueSize == 1) { + $unpackChar = "C"; + } + elsif ($valueSize == 2) { + $unpackChar = "n"; + } + elsif ($valueSize == 4) { + $unpackChar = "N"; + } + else { + die "unsupported value size"; + } + + $fh->read($dat, 2); + my $format = unpack("n", $dat); + my $lookup; + + if ($format == 0) { + $fh->read($dat, $length - 2); + my $i = -1; + $lookup = { map { $i++; ($_ != $default) ? ($i, $_) : () } unpack($unpackChar . "*", $dat) }; + } + + elsif ($format == 2) { + $fh->read($dat, 10); + my ($unitSize, $nUnits, $searchRange, $entrySelector, $rangeShift) = unpack("nnnnn", $dat); + die if $unitSize != 4 + $valueSize; + foreach (1 .. $nUnits) { + $fh->read($dat, $unitSize); + my ($lastGlyph, $firstGlyph, $value) = unpack("nn" . $unpackChar, $dat); + if ($firstGlyph != 0xffff and $value != $default) { + foreach ($firstGlyph .. $lastGlyph) { + $lookup->{$_} = $value; + } + } + } + } + + elsif ($format == 4) { + $fh->read($dat, 10); + my ($unitSize, $nUnits, $searchRange, $entrySelector, $rangeShift) = unpack("nnnnn", $dat); + die if $unitSize != 6; + foreach (1 .. $nUnits) { + $fh->read($dat, $unitSize); + my ($lastGlyph, $firstGlyph, $offset) = unpack("nnn", $dat); + if ($firstGlyph != 0xffff) { + my $loc = $fh->tell(); + $fh->seek($lookupStart + $offset, IO::File::SEEK_SET); + $fh->read($dat, ($lastGlyph - $firstGlyph + 1) * $valueSize); + my @values = unpack($unpackChar . "*", $dat); + foreach (0 .. $lastGlyph - $firstGlyph) { + $lookup->{$firstGlyph + $_} = $values[$_] if $values[$_] != $default; + } + $fh->seek($loc, IO::File::SEEK_SET); + } + } + } + + elsif ($format == 6) { + $fh->read($dat, 10); + my ($unitSize, $nUnits, $searchRange, $entrySelector, $rangeShift) = unpack("nnnnn", $dat); + die if $unitSize != 2 + $valueSize; + foreach (1 .. $nUnits) { + $fh->read($dat, $unitSize); + my ($glyph, $value) = unpack("n" . $unpackChar, $dat); + $lookup->{$glyph} = $value if $glyph != 0xffff and $value != $default; + } + } + + elsif ($format == 8) { + $fh->read($dat, 4); + my ($firstGlyph, $glyphCount) = unpack("nn", $dat); + $fh->read($dat, $glyphCount * $valueSize); + $firstGlyph--; + $lookup = { map { $firstGlyph++; $_ != $default ? ($firstGlyph, $_) : () } unpack($unpackChar . "*", $dat) }; + } + + else { + die "unknown lookup format"; + } + + $fh->seek($lookupStart + $length, IO::File::SEEK_SET); + + ($format, $lookup); +} + +=head2 AAT_write_lookup($fh, $format, $lookup, $valueSize, $default) + +=cut + +sub AAT_pack_lookup +{ + my ($format, $lookup, $valueSize, $default) = @_; + + my $packChar; + if ($valueSize == 1) { + $packChar = "C"; + } + elsif ($valueSize == 2) { + $packChar = "n"; + } + elsif ($valueSize == 4) { + $packChar = "N"; + } + else { + die "unsupported value size"; + } + + my ($dat) = pack("n", $format); + + my ($firstGlyph, $lastGlyph) = (0xffff, 0); + foreach (keys %$lookup) { + $firstGlyph = $_ if $_ < $firstGlyph; + $lastGlyph = $_ if $_ > $lastGlyph; + } + my $glyphCount = $lastGlyph - $firstGlyph + 1; + + if ($format == 0) { + $dat .= pack($packChar . "*", map { defined $lookup->{$_} ? $lookup->{$_} : defined $default ? $default : $_ } (0 .. $lastGlyph)); + } + + elsif ($format == 2) { + my $prev = $default; + my $segStart = $firstGlyph; + my $dat1; + foreach ($firstGlyph .. $lastGlyph + 1) { + my $val = $lookup->{$_}; + $val = $default unless defined $val; + if ($val != $prev) { + $dat1 .= pack("nn" . $packChar, $_ - 1, $segStart, $prev) if $prev != $default; + $prev = $val; + $segStart = $_; + } + } + $dat1 .= pack("nn" . $packChar, 0xffff, 0xffff, 0); + my $unitSize = 4 + $valueSize; + $dat .= pack("nnnnn", $unitSize, TTF_bininfo(length($dat1) / $unitSize, $unitSize)); + $dat .= $dat1; + } + + elsif ($format == 4) { + my $segArray = new Font::TTF::Segarr($valueSize); + $segArray->add_segment($firstGlyph, 1, map { $lookup->{$_} } ($firstGlyph .. $lastGlyph)); + my ($start, $end, $offset); + $offset = 12 + @$segArray * 6 + 6; # 12 is size of format word + binSearchHeader; 6 bytes per segment; 6 for terminating segment + my $dat1; + foreach (@$segArray) { + $start = $_->{'START'}; + $end = $start + $_->{'LEN'} - 1; + $dat1 .= pack("nnn", $end, $start, $offset); + $offset += $_->{'LEN'} * 2; + } + $dat1 .= pack("nnn", 0xffff, 0xffff, 0); + $dat .= pack("nnnnn", 6, TTF_bininfo(length($dat1) / 6, 6)); + $dat .= $dat1; + foreach (@$segArray) { + $dat1 = $_->{'VAL'}; + $dat .= pack($packChar . "*", @$dat1); + } + } + + elsif ($format == 6) { + die "unsupported" if $valueSize != 2; + my $dat1 = pack("n*", map { $_, $lookup->{$_} } sort { $a <=> $b } grep { $lookup->{$_} ne $default } keys %$lookup); + my $unitSize = 2 + $valueSize; + $dat .= pack("nnnnn", $unitSize, TTF_bininfo(length($dat1) / $unitSize, $unitSize)); + $dat .= $dat1; + } + + elsif ($format == 8) { + $dat .= pack("nn", $firstGlyph, $lastGlyph - $firstGlyph + 1); + $dat .= pack($packChar . "*", map { defined $lookup->{$_} ? $lookup->{$_} : defined $default ? $default : $_ } ($firstGlyph .. $lastGlyph)); + } + + else { + die "unknown lookup format"; + } + + my $padBytes = (4 - (length($dat) & 3)) & 3; + $dat .= pack("C*", (0) x $padBytes); + + return $dat; +} + +sub AAT_write_lookup +{ + my ($fh, $format, $lookup, $valueSize, $default) = @_; + + my $lookupStart = $fh->tell(); + my $packChar; + if ($valueSize == 1) { + $packChar = "C"; + } + elsif ($valueSize == 2) { + $packChar = "n"; + } + elsif ($valueSize == 4) { + $packChar = "N"; + } + else { + die "unsupported value size"; + } + + $fh->print(pack("n", $format)); + + my ($firstGlyph, $lastGlyph) = (0xffff, 0); + foreach (keys %$lookup) { + $firstGlyph = $_ if $_ < $firstGlyph; + $lastGlyph = $_ if $_ > $lastGlyph; + } + my $glyphCount = $lastGlyph - $firstGlyph + 1; + + if ($format == 0) { + $fh->print(pack($packChar . "*", map { defined $lookup->{$_} ? $lookup->{$_} : defined $default ? $default : $_ } (0 .. $lastGlyph))); + } + + elsif ($format == 2) { + my $prev = $default; + my $segStart = $firstGlyph; + my $dat; + foreach ($firstGlyph .. $lastGlyph + 1) { + my $val = $lookup->{$_}; + $val = $default unless defined $val; + if ($val != $prev) { + $dat .= pack("nn" . $packChar, $_ - 1, $segStart, $prev) if $prev != $default; + $prev = $val; + $segStart = $_; + } + } + $dat .= pack("nn" . $packChar, 0xffff, 0xffff, 0); + my $unitSize = 4 + $valueSize; + $fh->print(pack("nnnnn", $unitSize, TTF_bininfo(length($dat) / $unitSize, $unitSize))); + $fh->print($dat); + } + + elsif ($format == 4) { + my $segArray = new Font::TTF::Segarr($valueSize); + $segArray->add_segment($firstGlyph, 1, map { $lookup->{$_} } ($firstGlyph .. $lastGlyph)); + my ($start, $end, $offset); + $offset = 12 + @$segArray * 6 + 6; # 12 is size of format word + binSearchHeader; 6 bytes per segment; 6 for terminating segment + my $dat; + foreach (@$segArray) { + $start = $_->{'START'}; + $end = $start + $_->{'LEN'} - 1; + $dat .= pack("nnn", $end, $start, $offset); + $offset += $_->{'LEN'} * 2; + } + $dat .= pack("nnn", 0xffff, 0xffff, 0); + $fh->print(pack("nnnnn", 6, TTF_bininfo(length($dat) / 6, 6))); + $fh->print($dat); + foreach (@$segArray) { + $dat = $_->{'VAL'}; + $fh->print(pack($packChar . "*", @$dat)); + } + } + + elsif ($format == 6) { + die "unsupported" if $valueSize != 2; + my $dat = pack("n*", map { $_, $lookup->{$_} } sort { $a <=> $b } grep { $lookup->{$_} ne $default } keys %$lookup); + my $unitSize = 2 + $valueSize; + $fh->print(pack("nnnnn", $unitSize, TTF_bininfo(length($dat) / $unitSize, $unitSize))); + $fh->print($dat); + } + + elsif ($format == 8) { + $fh->print(pack("nn", $firstGlyph, $lastGlyph - $firstGlyph + 1)); + $fh->print(pack($packChar . "*", map { defined $lookup->{$_} ? $lookup->{$_} : defined $default ? $default : $_ } ($firstGlyph .. $lastGlyph))); + } + + else { + die "unknown lookup format"; + } + + my $length = $fh->tell() - $lookupStart; + my $padBytes = (4 - ($length & 3)) & 3; + $fh->print(pack("C*", (0) x $padBytes)); + $length += $padBytes; + + $length; +} + +1; + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Anchor.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Anchor.pm new file mode 100644 index 0000000..b901e83 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Anchor.pm @@ -0,0 +1,216 @@ +package Font::TTF::Anchor; + +=head1 NAME + +Font::TTF::Anchor - Anchor points for GPOS tables + +=head1 DESCRIPTION + +The Anchor defines an anchor point on a glyph providing various information +depending on how much is available, including such information as the co-ordinates, +a curve point and even device specific modifiers. + +=head1 INSTANCE VARIABLES + +=over 4 + +=item x + +XCoordinate of the anchor point + +=item y + +YCoordinate of the anchor point + +=item p + +Curve point on the glyph to use as the anchor point + +=item xdev + +Device table (delta) for the xcoordinate + +=item ydev + +Device table (delta) for the ycoordinate + +=item xid + +XIdAnchor for multiple master horizontal metric id + +=item yid + +YIdAnchor for multiple master vertical metric id + +=back + +=head1 METHODS + +=cut + +use strict; +use Font::TTF::Utils; + + +=head2 new + +Creates a new Anchor + +=cut + +sub new +{ + my ($class) = shift; + my ($self) = {@_}; + + bless $self, $class; +} + + +=head2 read($fh) + +Reads the anchor from the given file handle at that point. The file handle is left +at an arbitrary read point, usually the end of something! + +=cut + +sub read +{ + my ($self, $fh) = @_; + my ($dat, $loc, $fmt, $p, $xoff, $yoff); + + $fh->read($dat, 6); + $fmt = unpack('n', $dat); + if ($fmt == 4) + { ($self->{'xid'}, $self->{'yid'}) = TTF_Unpack('S2', substr($dat,2)); } + else + { ($self->{'x'}, $self->{'y'}) = TTF_Unpack('s2', substr($dat,2)); } + + if ($fmt == 2) + { + $fh->read($dat, 2); + $self->{'p'} = unpack('n', $dat); + } elsif ($fmt == 3) + { + $fh->read($dat, 4); + ($xoff, $yoff) = unpack('n2', $dat); + $loc = $fh->tell() - 10; + if ($xoff) + { + $fh->seek($loc + $xoff, 0); + $self->{'xdev'} = Font::TTF::Delta->new->read($fh); + } + if ($yoff) + { + $fh->seek($loc + $yoff, 0); + $self->{'ydev'} = Font::TTF::Delta->new->read($fh); + } + } + $self; +} + + +=head2 out($fh, $style) + +Outputs the Anchor to the given file handle at this point also addressing issues +of deltas. If $style is set, then no output is sent to the file handle. The return +value is the output string. + +=cut + +sub out +{ + my ($self, $fh, $style) = @_; + my ($xoff, $yoff, $fmt, $out); + + if (defined $self->{'xid'} || defined $self->{'yid'}) + { $out = TTF_Pack('SSS', 4, $self->{'xid'}, $self->{'yid'}); } + elsif (defined $self->{'p'}) + { $out = TTF_Pack('Ssss', 2, @{$self}{'x', 'y', 'p'}); } + elsif (defined $self->{'xdev'} || defined $self->{'ydev'}) + { + $out = TTF_Pack('Sss', 3, @{$self}{'x', 'y'}); + if (defined $self->{'xdev'}) + { + $out .= pack('n2', 10, 0); + $out .= $self->{'xdev'}->out($fh, 1); + $yoff = length($out) - 10; + } + else + { $out .= pack('n2', 0, 0); } + if (defined $self->{'ydev'}) + { + $yoff = 10 unless $yoff; + substr($out, 8, 2) = pack('n', $yoff); + $out .= $self->{'ydev'}->out($fh, 1); + } + } else + { $out = TTF_Pack('Sss', 1, @{$self}{'x', 'y'}); } + $fh->print($out) unless $style; + $out; +} + + +sub signature +{ + my ($self) = @_; + return join (",", map {"${_}=$self->{$_}"} qw(x y p xdev ydev xid yid)); +} + + +=head2 $a->out_xml($context) + +Outputs the anchor in XML + +=cut + +sub out_xml +{ + my ($self, $context, $depth) = @_; + my ($fh) = $context->{'fh'}; + my ($end); + + $fh->print("$depthprint(" p='$self->{'p'}'") if defined ($self->{'p'}); + $end = (defined $self->{'xdev'} || defined $self->{'ydev'} || defined $self->{'xid'} || defined $self->{'yid'}); + unless ($end) + { + $fh->print("/>\n"); + return $self; + } + + if (defined $self->{'xdev'}) + { + $fh->print("$depth$context->{'indent'}\n"); + $self->{'xdev'}->out_xml($context, $depth . ($context->{'indent'} x 2)); + $fh->print("$depth$context->{'indent'}\n"); + } + + if (defined $self->{'ydev'}) + { + $fh->print("$depth$context->{'indent'}\n"); + $self->{'ydev'}->out_xml($context, $depth . ($context->{'indent'} x 2)); + $fh->print("$depth$context->{'indent'}\n"); + } + + if (defined $self->{'xid'} || defined $self->{'yid'}) + { + $fh->print("$depth$context->{'indent'}print(" xid='$self->{'xid'}'") if defined ($self->{'xid'}); + $fh->print(" yid='$self->{'yid'}'") if defined ($self->{'yid'}); + $fh->print("/>\n"); + } + $fh->print("$depth\n"); + $self; +} + + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + +1; + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Bsln.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Bsln.pm new file mode 100644 index 0000000..281a512 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Bsln.pm @@ -0,0 +1,163 @@ +package Font::TTF::Bsln; + +=head1 NAME + +Font::TTF::Bsln - Baseline table in a font + +=head1 DESCRIPTION + +=head1 INSTANCE VARIABLES + +=item version + +=item xformat + +=item defaultBaseline + +=item deltas + +=item stdGlyph + +=item ctlPoints + +=item lookupFormat + +=item lookup + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); + +use Font::TTF::AATutils; +use Font::TTF::Utils; +require Font::TTF::Table; + +@ISA = qw(Font::TTF::Table); + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self) = @_; + my ($dat, $fh); + + $self->SUPER::read or return $self; + + $fh = $self->{' INFILE'}; + $fh->read($dat, 8); + my ($version, $format, $defaultBaseline) = TTF_Unpack("vSS", $dat); + + if ($format == 0 or $format == 1) { + $fh->read($dat, 64); + $self->{'deltas'} = [TTF_Unpack("s*", $dat)]; + } + elsif ($format == 2 or $format == 3) { + $fh->read($dat, 2); + $self->{'stdGlyph'} = unpack("n", $dat); + $fh->read($dat, 64); + $self->{'ctlPoints'} = unpack("n*", $dat); + } + else { + die "unknown table format"; + } + + if ($format == 1 or $format == 3) { + my $len = $self->{' LENGTH'} - ($fh->tell() - $self->{' OFFSET'}); + my ($lookupFormat, $lookup) = AAT_read_lookup($fh, 2, $len, $defaultBaseline); + $self->{'lookupFormat'} = $lookupFormat; + $self->{'lookup'} = $lookup; + } + + $self->{'version'} = $version; + $self->{'format'} = $format; + $self->{'defaultBaseline'} = $defaultBaseline; + + $self; +} + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying + +=cut + +sub out +{ + my ($self, $fh) = @_; + + return $self->SUPER::out($fh) unless $self->{' read'}; + + my $format = $self->{'format'}; + my $defaultBaseline = $self->{'defaultBaseline'}; + $fh->print(TTF_Pack("vSS", $self->{'version'}, $format, $defaultBaseline)); + + AAT_write_lookup($fh, $self->{'lookupFormat'}, $self->{'lookup'}, 2, $defaultBaseline) if ($format == 1 or $format == 3); +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + + $self->read; + + $fh = 'STDOUT' unless defined $fh; + + my $format = $self->{'format'}; + $fh->printf("version %f\nformat %d\ndefaultBaseline %d\n", $self->{'version'}, $format, $self->{'defaultBaseline'}); + if ($format == 0 or $format == 1) { + $fh->printf("\tdeltas:\n"); + my $deltas = $self->{'deltas'}; + foreach (0 .. 31) { + $fh->printf("\t\t%d: %d%s\n", $_, $deltas->[$_], defined baselineName_($_) ? "\t# " . baselineName_($_) : ""); + } + } + if ($format == 2 or $format == 3) { + $fh->printf("\tstdGlyph = %d\n", $self->{'stdGlyph'}); + my $ctlPoints = $self->{'ctlPoints'}; + foreach (0 .. 31) { + $fh->printf("\t\t%d: %d%s\n", $_, $ctlPoints->[$_], defined baselineName_($_) ? "\t# " . baselineName_($_) : ""); + } + } + if ($format == 1 or $format == 3) { + $fh->printf("lookupFormat %d\n", $self->{'lookupFormat'}); + my $lookup = $self->{'lookup'}; + foreach (sort { $a <=> $b } keys %$lookup) { + $fh->printf("\tglyph %d: %d%s\n", $_, $lookup->{$_}, defined baselineName_($_) ? "\t# " . baselineName_($_) : ""); + } + } +} + +sub baselineName_ +{ + my ($b) = @_; + my @baselines = ( 'Roman', 'Ideographic centered', 'Ideographic low', 'Hanging', 'Math' ); + $baselines[$b]; +} + +1; + + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Changes b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Changes new file mode 100644 index 0000000..2382b82 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Changes @@ -0,0 +1,108 @@ +Note. The version number implies a release point. Thus changes that go into a +version occur above the version number, not after it. + +* 0.05 +** cmap + debug reverse() + provide scripts as .pl instead of .bat to placate Unix world + rename makefile.pl to Makefile.PL to keep Unix happy + Add ttfremap script + +* 0.06 .. 0.08 + Fixes to get this stuff working in Unix + +* 0.09 + Never released + +* 0.10 +** cmap + Make reverse return the lowest codepoint that matches rather than + the highest +** font + Use IO::File everywhere to allow passing in of psuedo-file objects + rather than file names +** Utils + Debug FDot2.14 conversion + +* 0.11 +** cmap + Don't store empty entries in the cmap + +* 0.12 +Various changes to reduce warnings + +** glyph + Add update_bbox + Do full glyph writes if loca read rather than glyf read + Get glyph update working usefully. Clarify glyf->read + +* 0.13 + +** glyph + Debug update_bbox for compound glyphs + Add empty() to clear to unread state (allows apps to save memory) + +** OS/2 + update update() to account for new cmap structure + +** Post + Correct mu to pi in Postscript name list. The list now follows the + MS convention for good or ill. + +** Table + Add empty() to clear a table to its unread state + +** Scripts +*** psfix + Added. Creates Post table based on cmap information + +*** eurofix + Added bullet hacking and generally backwards, forwards, all + ways mapping. + +*** ttfenc + Now supports the difference between MS post name list and TeXs + +* 0.14 + + Sort out mix up over CVS mess + +* 0.15 + +** Table + read_dat no longer marks table as read + +** Cvt_ + Mark table as read when read + +** Fpgm + Mark table as read when read + +** Prep + Mark table as read when read + +** Font + Add support for Mac sfnt version code ('true') + Be stricter on out @fontlist, only output tables that exist + +* 0.16 + +** Install + add pmake support + +** glyph + tidy up pod + +** kern + tidy up pod + +** name + add utf8 support + +* 0.17 + +** Utils + Debug TTF_bininfo >>= seems to have stopped working! + +* 0.18 + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Cmap.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Cmap.pm new file mode 100644 index 0000000..bb3d63c --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Cmap.pm @@ -0,0 +1,612 @@ +package Font::TTF::Cmap; + +=head1 NAME + +Font::TTF::Cmap - Character map table + +=head1 DESCRIPTION + +Looks after the character map. For ease of use, the actual cmap is held in +a hash against codepoint. Thus for a given table: + + $gid = $font->{'cmap'}{'Tables'}[0]{'val'}{$code}; + +Note that C<$code> should be a true value (0x1234) rather than a string representation. + +=head1 INSTANCE VARIABLES + +The instance variables listed here are not preceeded by a space due to their +emulating structural information in the font. + +=over 4 + +=item Num + +Number of subtables in this table + +=item Tables + +An array of subtables ([0..Num-1]) + +=back + +Each subtables also has its own instance variables which are, again, not +preceeded by a space. + +=over 4 + +=item Platform + +The platform number for this subtable + +=item Encoding + +The encoding number for this subtable + +=item Format + +Gives the stored format of this subtable + +=item Ver + +Gives the version (or language) information for this subtable + +=item val + +A hash keyed by the codepoint value (not a string) storing the glyph id + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Table; +use Font::TTF::Utils; + +@ISA = qw(Font::TTF::Table); + + +=head2 $t->read + +Reads the cmap into memory. Format 4 subtables read the whole subtable and +fill in the segmented array accordingly. + +=cut + +sub read +{ + my ($self) = @_; + my ($dat, $i, $j, $k, $id, @ids, $s); + my ($start, $end, $range, $delta, $form, $len, $num, $ver, $sg); + my ($fh) = $self->{' INFILE'}; + + $self->SUPER::read or return $self; + $fh->read($dat, 4); + $self->{'Num'} = unpack("x2n", $dat); + $self->{'Tables'} = []; + for ($i = 0; $i < $self->{'Num'}; $i++) + { + $s = {}; + $fh->read($dat, 8); + ($s->{'Platform'}, $s->{'Encoding'}, $s->{'LOC'}) = (unpack("nnN", $dat)); + $s->{'LOC'} += $self->{' OFFSET'}; + push(@{$self->{'Tables'}}, $s); + } + for ($i = 0; $i < $self->{'Num'}; $i++) + { + $s = $self->{'Tables'}[$i]; + $fh->seek($s->{'LOC'}, 0); + $fh->read($dat, 2); + $form = unpack("n", $dat); + + $s->{'Format'} = $form; + if ($form == 0) + { + my $j = 0; + + $fh->read($dat, 4); + ($len, $s->{'Ver'}) = unpack('n2', $dat); + $fh->read($dat, 256); + $s->{'val'} = {map {$j++; ($_ ? ($j - 1, $_) : ())} unpack("C*", $dat)}; + } elsif ($form == 6) + { + my ($start, $ecount); + + $fh->read($dat, 8); + ($len, $s->{'Ver'}, $start, $ecount) = unpack('n4', $dat); + $fh->read($dat, $ecount << 1); + $s->{'val'} = {map {$start++; ($_ ? ($start - 1, $_) : ())} unpack("n*", $dat)}; + } elsif ($form == 2) # Contributed by Huw Rogers + { + $fh->read($dat, 4); + ($len, $s->{'Ver'}) = unpack('n2', $dat); + $fh->read($dat, 512); + my ($j, $k, $l, $m, $n, @subHeaderKeys, @subHeaders, $subHeader); + $n = 1; + for ($j = 0; $j < 256; $j++) { + my $k = unpack('@'.($j<<1).'n', $dat)>>3; + $n = $k + 1 if $k >= $n; + $subHeaders[$subHeaderKeys[$j] = $k] ||= [ ]; + } + $fh->read($dat, $n<<3); # read subHeaders[] + for ($k = 0; $k < $n; $k++) { + $subHeader = $subHeaders[$k]; + $l = $k<<3; + @$subHeader = unpack('@'.$l.'n4', $dat); + $subHeader->[2] = unpack('s', pack('S', $subHeader->[2])) + if $subHeader->[2] & 0x8000; # idDelta + $subHeader->[3] = + ($subHeader->[3] - (($n - $k)<<3) + 6)>>1; # idRangeOffset + } + $fh->read($dat, $len - ($n<<3) - 518); # glyphIndexArray[] + for ($j = 0; $j < 256; $j++) { + $k = $subHeaderKeys[$j]; + $subHeader = $subHeaders[$k]; + unless ($k) { + $l = $j - $subHeader->[0]; + if ($l >= 0 && $l < $subHeader->[1]) { + $m = unpack('@'.(($l + $subHeader->[3])<<1).'n', $dat); + $m += $subHeader->[2] if $m; + $s->{'val'}{$j} = $m; + } + } else { + for ($l = 0; $l < $subHeader->[1]; $l++) { + $m = unpack('@'.(($l + $subHeader->[3])<<1).'n', $dat); + $m += $subHeader->[2] if $m; + $s->{'val'}{($j<<8) + $l + $subHeader->[0]} = $m; + } + } + } + } elsif ($form == 4) + { + $fh->read($dat, 12); + ($len, $s->{'Ver'}, $num) = unpack('n3', $dat); + $num >>= 1; + $fh->read($dat, $len - 14); + for ($j = 0; $j < $num; $j++) + { + $end = unpack("n", substr($dat, $j << 1, 2)); + $start = unpack("n", substr($dat, ($j << 1) + ($num << 1) + 2, 2)); + $delta = unpack("n", substr($dat, ($j << 1) + ($num << 2) + 2, 2)); + $delta -= 65536 if $delta > 32767; + $range = unpack("n", substr($dat, ($j << 1) + $num * 6 + 2, 2)); + for ($k = $start; $k <= $end; $k++) + { + if ($range == 0 || $range == 65535) # support the buggy FOG with its range=65535 for final segment + { $id = $k + $delta; } + else + { $id = unpack("n", substr($dat, ($j << 1) + $num * 6 + + 2 + ($k - $start) * 2 + $range, 2)) + $delta; } + $id -= 65536 if $id >= 65536; + $s->{'val'}{$k} = $id if ($id); + } + } + } elsif ($form == 8 || $form == 12) + { + $fh->read($dat, 10); + ($len, $s->{'Ver'}) = unpack('x2N2', $dat); + if ($form == 8) + { + $fh->read($dat, 8196); + $num = unpack("N", substr($dat, 8192, 4)); # don't need the map + } else + { + $fh->read($dat, 4); + $num = unpack("N", $dat); + } + $fh->read($dat, 12 * $num); + for ($j = 0; $j < $num; $j++) + { + ($start, $end, $sg) = unpack("N3", substr($dat, $j * 12, 12)); + for ($k = $start; $k <= $end; $k++) + { $s->{'val'}{$k} = $sg++; } + } + } elsif ($form == 10) + { + $fh->read($dat, 18); + ($len, $s->{'Ver'}, $start, $num) = unpack('x2N4', $dat); + $fh->read($dat, $num << 1); + for ($j = 0; $j < $num; $j++) + { $s->{'val'}{$start + $j} = unpack("n", substr($dat, $j << 1, 2)); } + } + } + $self; +} + + +=head2 $t->ms_lookup($uni) + +Finds a Unicode table, giving preference to the MS one, and looks up the given +Unicode codepoint in it to find the glyph id. + +=cut + +sub ms_lookup +{ + my ($self, $uni) = @_; + + $self->find_ms || return undef unless (defined $self->{' mstable'}); + return $self->{' mstable'}{'val'}{$uni}; +} + + +=head2 $t->find_ms + +Finds the a Unicode table, giving preference to the Microsoft one, and sets the C instance variable +to it if found. Returns the table it finds. + +=cut +sub find_ms +{ + my ($self) = @_; + my ($i, $s, $alt, $found); + + return $self->{' mstable'} if defined $self->{' mstable'}; + $self->read; + for ($i = 0; $i < $self->{'Num'}; $i++) + { + $s = $self->{'Tables'}[$i]; + if ($s->{'Platform'} == 3) + { + $self->{' mstable'} = $s; + last if ($s->{'Encoding'} == 10); + $found = 1 if ($s->{'Encoding'} == 1); + } elsif ($s->{'Platform'} == 0 || ($s->{'Platform'} == 2 && $s->{'Encoding'} == 1)) + { $alt = $s; } + } + $self->{' mstable'} = $alt if ($alt && !$found); + $self->{' mstable'}; +} + + +=head2 $t->ms_enc + +Returns the encoding of the microsoft table (0 => symbol, etc.). Returns undef if there is +no Microsoft cmap. + +=cut + +sub ms_enc +{ + my ($self) = @_; + my ($s); + + return $self->{' mstable'}{'Encoding'} + if (defined $self->{' mstable'} && $self->{' mstable'}{'Platform'} == 3); + + foreach $s (@{$self->{'Tables'}}) + { + return $s->{'Encoding'} if ($s->{'Platform'} == 3); + } + return undef; +} + + +=head2 $t->out($fh) + +Writes out a cmap table to a filehandle. If it has not been read, then +just copies from input file to output + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($loc, $s, $i, $base_loc, $j, @keys); + + return $self->SUPER::out($fh) unless $self->{' read'}; + + + $self->{'Tables'} = [sort {$a->{'Platform'} <=> $b->{'Platform'} + || $a->{'Encoding'} <=> $b->{'Encoding'} + || $a->{'Ver'} <=> $b->{'Ver'}} @{$self->{'Tables'}}]; + $self->{'Num'} = scalar @{$self->{'Tables'}}; + + $base_loc = $fh->tell(); + $fh->print(pack("n2", 0, $self->{'Num'})); + + for ($i = 0; $i < $self->{'Num'}; $i++) + { $fh->print(pack("nnN", $self->{'Tables'}[$i]{'Platform'}, $self->{'Tables'}[$i]{'Encoding'}, 0)); } + + for ($i = 0; $i < $self->{'Num'}; $i++) + { + $s = $self->{'Tables'}[$i]; + if ($s->{'Format'} < 8) + { @keys = sort {$a <=> $b} grep { $_ <= 0xFFFF} keys %{$s->{'val'}}; } + else + { @keys = sort {$a <=> $b} keys %{$s->{'val'}}; } + $s->{' outloc'} = $fh->tell(); + if ($s->{'Format'} < 8) + { $fh->print(pack("n3", $s->{'Format'}, 0, $s->{'Ver'})); } # come back for length + else + { $fh->print(pack("n2N2", $s->{'Format'}, 0, 0, $s->{'Ver'})); } + + if ($s->{'Format'} == 0) + { + $fh->print(pack("C256", @{$s->{'val'}}{0 .. 255})); + } elsif ($s->{'Format'} == 6) + { + $fh->print(pack("n2", $keys[0], $keys[-1] - $keys[0] + 1)); + $fh->print(pack("n*", @{$s->{'val'}}{$keys[0] .. $keys[-1]})); + } elsif ($s->{'Format'} == 2) # Contributed by Huw Rogers + { + my ($g, $k, $h, $l, $m, $n); + my (@subHeaderKeys, @subHeaders, $subHeader, @glyphIndexArray); + $n = 0; + @subHeaderKeys = (-1) x 256; + for $j (@keys) { + next unless defined($g = $s->{'val'}{$j}); + $h = int($j>>8); + $l = ($j & 0xff); + if (($k = $subHeaderKeys[$h]) < 0) { + $subHeader = [ $l, 1, 0, 0, [ $g ] ]; + $subHeaders[$k = $n++] = $subHeader; + $subHeaderKeys[$h] = $k; + } else { + $subHeader = $subHeaders[$k]; + $m = ($l - $subHeader->[0] + 1) - $subHeader->[1]; + $subHeader->[1] += $m; + push @{$subHeader->[4]}, (0) x ($m - 1), $g - $subHeader->[2]; + } + } + @subHeaderKeys = map { $_ < 0 ? 0 : $_ } @subHeaderKeys; + $subHeader = $subHeaders[0]; + $subHeader->[3] = 0; + push @glyphIndexArray, @{$subHeader->[4]}; + splice(@$subHeader, 4); + { + my @subHeaders_ = sort {@{$a->[4]} <=> @{$b->[4]}} @subHeaders[1..$#subHeaders]; + my ($f, $d, $r, $subHeader_); + for ($k = 0; $k < @subHeaders_; $k++) { + $subHeader = $subHeaders_[$k]; + $f = $r = shift @{$subHeader->[4]}; + $subHeader->[5] = join(':', + map { + $d = $_ - $r; + $r = $_; + $d < 0 ? + sprintf('-%04x', -$d) : + sprintf('+%04x', $d) + } @{$subHeader->[4]}); + unshift @{$subHeader->[4]}, $f; + } + for ($k = 0; $k < @subHeaders_; $k++) { + $subHeader = $subHeaders_[$k]; + next unless $subHeader->[4]; + $subHeader->[3] = @glyphIndexArray; + push @glyphIndexArray, @{$subHeader->[4]}; + for ($l = $k + 1; $l < @subHeaders_; $l++) { + $subHeader_ = $subHeaders_[$l]; + next unless $subHeader_->[4]; + $d = $subHeader_->[5]; + if ($subHeader->[5] =~ /\Q$d\E/) { + my $o = length($`)/6; #` + $subHeader_->[2] += + $subHeader_->[4]->[$o] - $subHeader->[4]->[0]; + $subHeader_->[3] = $subHeader->[3] + $o; + splice(@$subHeader_, 4); + } + } + splice(@$subHeader, 4); + } + } + $fh->print(pack('n*', map { $_<<3 } @subHeaderKeys)); + for ($j = 0; $j < 256; $j++) { + $k = $subHeaderKeys[$j]; + $subHeader = $subHeaders[$k]; + } + for ($k = 0; $k < $n; $k++) { + $subHeader = $subHeaders[$k]; + $fh->print(pack('n4', + $subHeader->[0], + $subHeader->[1], + $subHeader->[2] < 0 ? + unpack('S', pack('s', $subHeader->[2])) : + $subHeader->[2], + ($subHeader->[3]<<1) + (($n - $k)<<3) - 6 + )); + } + $fh->print(pack('n*', @glyphIndexArray)); + } elsif ($s->{'Format'} == 4) + { + my ($num, $sRange, $eSel, $eShift, @starts, @ends, $doff); + my (@deltas, $delta, @range, $flat, $k, $segs, $count, $newseg, $v); + + push(@keys, 0xFFFF) unless ($keys[-1] == 0xFFFF); + $newseg = 1; $num = 0; + for ($j = 0; $j <= $#keys && $keys[$j] <= 0xFFFF; $j++) + { + $v = $s->{'val'}{$keys[$j]} || 0; + if ($newseg) + { + $delta = $v; + $doff = $j; + $flat = 1; + push(@starts, $keys[$j]); + $newseg = 0; + } + $delta = 0 if ($delta + $j - $doff != $v); + $flat = 0 if ($v == 0); + if ($j == $#keys || $keys[$j] + 1 != $keys[$j+1]) + { + push (@ends, $keys[$j]); + push (@deltas, $delta ? $delta - $keys[$doff] : 0); + push (@range, $flat); + $num++; + $newseg = 1; + } + } + + ($num, $sRange, $eSel, $eShift) = Font::TTF::Utils::TTF_bininfo($num, 2); + $fh->print(pack("n4", $num * 2, $sRange, $eSel, $eShift)); + $fh->print(pack("n*", @ends)); + $fh->print(pack("n", 0)); + $fh->print(pack("n*", @starts)); + $fh->print(pack("n*", @deltas)); + + $count = 0; + for ($j = 0; $j < $num; $j++) + { + $delta = $deltas[$j]; + if ($delta != 0 && $range[$j] == 1) + { $range[$j] = 0; } + else + { + $range[$j] = ($count + $num - $j) << 1; + $count += $ends[$j] - $starts[$j] + 1; + } + } + + $fh->print(pack("n*", @range)); + + for ($j = 0; $j < $num; $j++) + { + next if ($range[$j] == 0); + $fh->print(pack("n*", map {$_ || 0} @{$s->{'val'}}{$starts[$j] .. $ends[$j]})); + } + } elsif ($s->{'Format'} == 8 || $s->{'Format'} == 12) + { + my (@jobs, $start, $current, $curr_glyf, $map); + + $current = 0; $curr_glyf = 0; + $map = "\000" x 8192; + foreach $j (@keys) + { + if ($j > 0xFFFF) + { + if (defined $s->{'val'}{$j >> 16}) + { $s->{'Format'} = 12; } + vec($map, $j >> 16, 1) = 1; + } + if ($j != $current + 1 || $s->{'val'}{$j} != $curr_glyf + 1) + { + push (@jobs, [$start, $current, $curr_glyf - ($current - $start)]) if (defined $start); + $start = $j; $current = $j; $curr_glyf = $s->{'val'}{$j}; + } + $current = $j; + $curr_glyf = $s->{'val'}{$j}; + } + push (@jobs, [$start, $current, $curr_glyf - ($current - $start)]) if (defined $start); + $fh->print($map) if ($s->{'Format'} == 8); + $fh->print(pack('N', $#jobs + 1)); + foreach $j (@jobs) + { $fh->print(pack('N3', @{$j})); } + } elsif ($s->{'Format'} == 10) + { + $fh->print(pack('N2', $keys[0], $keys[-1] - $keys[0] + 1)); + $fh->print(pack('n*', $s->{'val'}{$keys[0] .. $keys[-1]})); + } + + $loc = $fh->tell(); + if ($s->{'Format'} < 8) + { + $fh->seek($s->{' outloc'} + 2, 0); + $fh->print(pack("n", $loc - $s->{' outloc'})); + } else + { + $fh->seek($s->{' outloc'} + 4, 0); + $fh->print(pack("N", $loc - $s->{' outloc'})); + } + $fh->seek($base_loc + 8 + ($i << 3), 0); + $fh->print(pack("N", $s->{' outloc'} - $base_loc)); + $fh->seek($loc, 0); + } + $self; +} + + +=head2 $t->XML_element($context, $depth, $name, $val) + +Outputs the elements of the cmap in XML. We only need to process val here + +=cut + +sub XML_element +{ + my ($self, $context, $depth, $k, $val) = @_; + my ($fh) = $context->{'fh'}; + my ($i); + + return $self if ($k eq 'LOC'); + return $self->SUPER::XML_element($context, $depth, $k, $val) unless ($k eq 'val'); + + $fh->print("$depth\n"); + foreach $i (sort {$a <=> $b} keys %{$val}) + { $fh->printf("%s\n", $depth . $context->{'indent'}, $i, $val->{$i}); } + $fh->print("$depth\n"); + $self; +} + +=head2 @map = $t->reverse(%opt) + +Returns a reverse map of the Unicode cmap. I.e. given a glyph gives the Unicode value for it. Options are: + +=over 4 + +=item tnum + +Table number to use rather than the default Unicode table + +=item array + +Returns each element of reverse as an array since a glyph may be mapped by more +than one Unicode value. The arrays are unsorted. Otherwise store any one unicode value for a glyph. + +=back + +=cut + +sub reverse +{ + my ($self, %opt) = @_; + my ($table) = defined $opt{'tnum'} ? $self->{'Tables'}[$opt{'tnum'}] : $self->find_ms; + my (@res, $code, $gid); + + while (($code, $gid) = each(%{$table->{'val'}})) + { + if ($opt{'array'}) + { push (@{$res[$gid]}, $code); } + else + { $res[$gid] = $code unless (defined $res[$gid] && $res[$gid] > 0 && $res[$gid] < $code); } + } + @res; +} + + +=head2 is_unicode($index) + +Returns whether the table of a given index is known to be a unicode table +(as specified in the specifications) + +=cut + +sub is_unicode +{ + my ($self, $index) = @_; + my ($pid, $eid) = ($self->{'Tables'}[$index]{'Platform'}, $self->{'Tables'}[$index]{'Encoding'}); + + return ($pid == 3 || $pid == 0 || ($pid == 2 && $eid == 1)); +} + +1; + +=head1 BUGS + +=over 4 + +=item * + +No support for format 2 tables (MBCS) + +=back + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Coverage.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Coverage.pm new file mode 100644 index 0000000..909f910 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Coverage.pm @@ -0,0 +1,323 @@ +package Font::TTF::Coverage; + +=head1 NAME + +Font::TTF::Coverage - Opentype coverage and class definition objects + +=head1 DESCRIPTION + +Coverage tables and class definition objects are virtually identical concepts +in OpenType. Their difference comes purely in their storage. Therefore we can +say that a coverage table is a class definition in which the class definition +for each glyph is the corresponding index in the coverage table. The resulting +data structure is that a Coverage table has the following fields: + +=item cover + +A boolean to indicate whether this table is a coverage table (TRUE) or a +class definition (FALSE) + +=item val + +A hash of glyph ids against values (either coverage index or class value) + +=item fmt + +The storage format used is given here, but is recalculated when the table +is written out. + +=item count + +A count of the elements in a coverage table for use with add. Each subsequent +addition is added with the current count and increments the count. + +=head1 METHODS + +=cut + +=head2 new($isCover [, vals]) + +Creates a new coverage table or class definition table, depending upon the +value of $isCover. if $isCover then vals may be a list of glyphs to include in order. +If no $isCover, then vals is a hash of glyphs against class values. + +=cut + +sub new +{ + my ($class) = shift; + my ($isCover) = shift; + my ($self) = {}; + + $self->{'cover'} = $isCover; + $self->{'count'} = 0; + if ($isCover) + { + my ($v); + foreach $v (@_) + { $self->{'val'}{$v} = $self->{'count'}++; } + } + else + { + $self->{'val'} = {@_}; + foreach (values %{$self->{'val'}}) {$self->{'max'} = $_ if $_ > $self->{'max'}} + } + bless $self, $class; +} + + +=head2 read($fh) + +Reads the coverage/class table from the given file handle + +=cut + +sub read +{ + my ($self, $fh) = @_; + my ($dat, $fmt, $num, $i, $c); + + $fh->read($dat, 4); + ($fmt, $num) = unpack("n2", $dat); + $self->{'fmt'} = $fmt; + + if ($self->{'cover'}) + { + if ($fmt == 1) + { + $fh->read($dat, $num << 1); + map {$self->{'val'}{$_} = $i++} unpack("n*", $dat); + } elsif ($fmt == 2) + { + $fh->read($dat, $num * 6); + for ($i = 0; $i < $num; $i++) + { + ($first, $last, $c) = unpack("n3", substr($dat, $i * 6, 6)); + map {$self->{'val'}{$_} = $c++} ($first .. $last); + } + } + $self->{'count'} = $num; + } elsif ($fmt == 1) + { + $fh->read($dat, 2); + $first = $num; + ($num) = unpack("n", $dat); + $fh->read($dat, $num << 1); + map {$self->{'val'}{$first++} = $_; $self->{'max'} = $_ if ($_ > $self->{'max'})} unpack("n*", $dat); + } elsif ($fmt == 2) + { + $fh->read($dat, $num * 6); + for ($i = 0; $i < $num; $i++) + { + ($first, $last, $c) = unpack("n3", substr($dat, $i * 6, 6)); + map {$self->{'val'}{$_} = $c} ($first .. $last); + $self->{'max'} = $c if ($c > $self->{'max'}); + } + } + $self; +} + + +=head2 out($fh, $state) + +Writes the coverage/class table to the given file handle. If $state is 1 then +the output string is returned rather than being output to a filehandle. + +=cut + +sub out +{ + my ($self, $fh, $state) = @_; + my ($g, $eff, $grp, $out); + my ($shipout) = ($state ? sub {$out .= $_[0];} : sub {$fh->print($_[0]);}); + my (@gids) = sort {$a <=> $b} keys %{$self->{'val'}}; + + $fmt = 1; $grp = 1; $eff = 0; + for ($i = 1; $i <= $#gids; $i++) + { + if ($self->{'val'}{$gids[$i]} < $self->{'val'}{$gids[$i-1]} && $self->{'cover'}) + { + $fmt = 2; + last; + } elsif ($gids[$i] == $gids[$i-1] + 1 && ($self->{'cover'} || $self->{'val'}{$gids[$i]} == $self->{'val'}{$gids[$i-1]})) + { $eff++; } + else + { + $grp++; + $eff += $gids[$i] - $gids[$i-1] if (!$self->{'cover'}); + } + } +# if ($self->{'cover'}) + { $fmt = 2 if ($eff / $grp > 3); } +# else +# { $fmt = 2 if ($grp > 1); } + + if ($fmt == 1 && $self->{'cover'}) + { + my ($last) = 0; + &$shipout(pack('n2', 1, scalar @gids)); + &$shipout(pack('n*', @gids)); + } elsif ($fmt == 1) + { + my ($last) = $gids[0]; + &$shipout(pack("n3", 1, $last, $gids[-1] - $last + 1)); + foreach $g (@gids) + { + if ($g > $last + 1) + { &$shipout(pack('n*', (0) x ($g - $last - 1))); } + &$shipout(pack('n', $self->{'val'}{$g})); + $last = $g; + } + } else + { + my ($start, $end, $ind, $numloc, $endloc, $num); + &$shipout(pack("n2", 2, 0)); + $numloc = $fh->tell() - 2 unless $state; + + $start = 0; $end = 0; $num = 0; + while ($end < $#gids) + { + if ($gids[$end + 1] == $gids[$end] + 1 + && $self->{'val'}{$gids[$end + 1]} + == $self->{'val'}{$gids[$end]} + + ($self->{'cover'} ? 1 : 0)) + { + $end++; + next; + } + + &$shipout(pack("n3", $gids[$start], $gids[$end], + $self->{'val'}{$gids[$start]})); + $start = $end + 1; + $end++; + $num++; + } + &$shipout(pack("n3", $gids[$start], $gids[$end], + $self->{'val'}{$gids[$start]})); + $num++; + if ($state) + { substr($out, 2, 2) = pack('n', $num); } + else + { + $endloc = $fh->tell(); + $fh->seek($numloc, 0); + $fh->print(pack("n", $num)); + $fh->seek($endloc, 0); + } + } + return ($state ? $out : $self); +} + + +=head2 $c->add($glyphid[, $class]) + +Adds a glyph id to the coverage table incrementing the count so that each subsequent addition +has the next sequential number. Returns the index number of the glyphid added + +=cut + +sub add +{ + my ($self, $gid, $class) = @_; + + return $self->{'val'}{$gid} if (defined $self->{'val'}{$gid}); + if ($self->{'cover'}) + { + $self->{'val'}{$gid} = $self->{'count'}; + return $self->{'count'}++; + } + else + { + $self->{'val'}{$gid} = $class || '0'; + $self->{'max'} = $class if ($class > $self->{'max'}); + return $class; + } +} + + +=head2 $c->signature + +Returns a vector of all the glyph ids covered by this coverage table or class + +=cut + +sub signature +{ + my ($self) = @_; + my ($vec, $range, $size); + +if (0) +{ + if ($self->{'cover'}) + { $range = 1; $size = 1; } + else + { + $range = $self->{'max'}; + $size = 1; + while ($range > 1) + { + $size = $size << 1; + $range = $range >> 1; + } + $range = $self->{'max'} + 1; + } + foreach (keys %{$self->{'val'}}) + { vec($vec, $_, $size) = $self->{'val'}{$_} > $range ? $range : $self->{'val'}{$_}; } + length($vec) . ":" . $vec; +} + $vec = join(";", map{"$_,$self->{'val'}{$_}"} keys %{$self->{'val'}}); +} + +=head2 @map=$c->sort + +Sorts the coverage table so that indexes are in ascending order of glyphid. +Returns a map such that $map[$new_index]=$old_index. + +=cut + +sub sort +{ + my ($self) = @_; + my (@res, $i); + + foreach (sort {$a <=> $b} keys %{$self->{'val'}}) + { + push(@res, $self->{'val'}{$_}); + $self->{'val'}{$_} = $i++; + } + @res; +} + +=head2 $c->out_xml($context) + +Outputs this coverage/class in XML + +=cut + +sub out_xml +{ + my ($self, $context, $depth) = @_; + my ($fh) = $context->{'fh'}; + + $fh->print("$depth<" . ($self->{'cover'} ? 'coverage' : 'class') . ">\n"); + foreach $gid (sort {$a <=> $b} keys %{$self->{'val'}}) + { + $fh->printf("$depth$context->{'indent'}\n", $gid, $self->{'val'}{$gid}); + } + $fh->print("$depth{'cover'} ? 'coverage' : 'class') . ">\n"); + $self; +} + +sub release +{ } + + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + +1; + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Cvt_.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Cvt_.pm new file mode 100644 index 0000000..2a79f5b --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Cvt_.pm @@ -0,0 +1,81 @@ +package Font::TTF::Cvt_; + +=head1 NAME + +Font::TTF::Cvt_ - Control Value Table in a TrueType font + +=head1 DESCRIPTION + +This is a minimal class adding nothing beyond a table, but is a repository +for cvt type information for those processes brave enough to address hinting. + +=head1 INSTANCE VARIABLES + +=over 4 + +=item val + +This is an array of CVT values. Thus access to the CVT is via: + + $f->{'cvt_'}{'val'}[$num]; + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA $VERSION); +use Font::TTF::Utils; + +@ISA = qw(Font::TTF::Table); + +$VERSION = 0.0001; + +=head2 $t->read + +Reads the CVT table into both the tables C<' dat'> variable and the C +array. + +=cut + +sub read +{ + my ($self) = @_; + + $self->read_dat || return undef; + $self->{' read'} = 1; + $self->{'val'} = [TTF_Unpack("s*", $self->{' dat'})]; + $self; +} + + +=head2 $t->update + +Updates the RAM file copy C<' dat'> to be the same as the array. + +=cut + +sub update +{ + my ($self) = @_; + + return undef unless ($self->{' read'} && $#{$self->{'val'}} >= 0); + $self->{' dat'} = TTF_Pack("s*", @{$self->{'val'}}); + $self; +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Delta.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Delta.pm new file mode 100644 index 0000000..7d63757 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Delta.pm @@ -0,0 +1,173 @@ +package Font::TTF::Delta; + +=head1 NAME + +Font::TTF::Delta - Opentype Device tables + +=head1 DESCRIPTION + +Each device table corresponds to a set of deltas for a particular point over +a range of ppem values. + +=item first + +The first ppem value in the range + +=item last + +The last ppem value in the range + +=item val + +This is an array of deltas corresponding to each ppem in the range between +first and last inclusive. + +=item fmt + +This is the fmt used (log2 of number bits per value) when the device table was +read. It is recalculated on output. + +=head1 METHODS + +=cut + +use strict; +use Font::TTF::Utils; + +=head2 new + +Creates a new device table + +=cut + +sub new +{ + my ($class) = @_; + my ($self) = {}; + + bless $self, $class; +} + + +=head2 read + +Reads a device table from the given IO object at the current location + +=cut + +sub read +{ + my ($self, $fh) = @_; + my ($dat, $fmt, $num, $i, $j, $mask); + + $fh->read($dat, 6); + ($self->{'first'}, $self->{'last'}, $fmt) = TTF_Unpack("S3", $dat); + $self->{'fmt'} = $fmt; + + $fmt = 1 << $fmt; + $num = ((($self->{'last'} - $self->{'first'} + 1) * $fmt) + 15) >> 8; + $fh->read($dat, $num); + + $mask = (0xffff << (16 - $fmt)) & 0xffff; + $j = 0; + for ($i = $self->{'first'}; $i <= $self->{'last'}; $i++) + { + if ($j == 0) + { + $num = TTF_Unpack("S", substr($dat, 0, 2)); + substr($dat, 0, 2) = ''; + } + push (@{$self->{'val'}}, ($num & $mask) >> (16 - $fmt)); + $num <<= $fmt; + $j += $fmt; + $j = 0 if ($j >= 16); + } + $self; +} + + +=head2 out($fh, $style) + +Outputs a device table to the given IO object at the current location, or just +returns the data to be output if $style != 0 + +=cut + +sub out +{ + my ($self, $fh, $style) = @_; + my ($dat, $fmt, $num, $mask, $j, $f, $out); + + foreach $f (@{$self->{'val'}}) + { + my ($tfmt) = $f > 0 ? $f + 1 : -$f; + $fmt = $tfmt if $tfmt > $fmt; + } + + if ($fmt > 8) + { $fmt = 3; } + elsif ($fmt > 2) + { $fmt = 2; } + else + { $fmt = 1; } + + $out = TTF_Pack("S3", $self->{'first'}, $self->{'last'}, $fmt); + + $fmt = 1 << $fmt; + $mask = 0xffff >> (16 - $fmt); + $j = 0; $dat = 0; + foreach $f (@{$self->{'val'}}) + { + $dat |= ($f & $mask) << (16 - $fmt - $j); + $j += $fmt; + if ($j >= 16) + { + $j = 0; + $out .= TTF_Pack("S", $dat); + $dat = 0; + } + } + $out .= pack('n', $dat) if ($j > 0); + $fh->print($out) unless $style; + $out; +} + +=head2 $d->signature() + +Returns a content based identifying string for this delta for +compression purposes + +=cut + +sub signature +{ + my ($self) = @_; + return join (",", $self->{'first'}, $self->{'last'}, @{$self->{'val'}}); +} + + +=head2 $d->out_xml($context) + +Outputs a delta in XML + +=cut + +sub out_xml +{ + my ($self, $context, $depth) = @_; + my ($fh) = $context->{'fh'}; + + $fh->printf("%s\n", $depth, $self->{'first'}, $self->{'last'}); + $fh->print("$depth$context->{'indent'}" . join (' ', @{$self->{'val'}}) . "\n") if defined ($self->{'val'}); + $fh->print("$depth\n"); +} + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + +1; + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Dumper.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Dumper.pm new file mode 100644 index 0000000..7cc8699 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Dumper.pm @@ -0,0 +1,79 @@ +package Font::TTF::Dumper; + +=head1 NAME + +Font::TTF::Dumper - Debug dump of a font datastructure, avoiding recursion on ' PARENT' + +=head1 SYNOPSIS + + Font::TTF::Dumper; + + # Print a table from the font structure: + print ttfdump($font->{$tag}); + + # Print font table with name + print ttfdump($font->{'head'}, 'head'); + + # Print one glyph's data: + print ttfdump($font->{'loca'}->read->{'glyphs'}[$gid], "glyph_$gid"); + +=head1 DESCRIPTION + +Font::TTF data structures are trees created from hashes and arrays. When trying to figure +out how the structures work, sometimes it is helpful to use Data::Dumper on them. However, +many of the object structures have ' PARENT' links that refer back to the object's parent, +which means that Data::Dumper ends up dumping the whole font no matter what. + +The purpose of this module is to do just one thing: invoke Data::Dumper with a +filter that skips over the ' PARENT' element of any hash. + +To reduce output further, this module also skips over ' CACHE' elements and any +hash element whose value is a Font::TTF::Glyph or Font::TTF::Font object. +(Really should make this configurable.) + +=cut + +use strict; +use Data::Dumper; + +use vars qw(@EXPORT @ISA); +require Exporter; +@ISA = qw( Exporter ); +@EXPORT = qw( ttfdump ); + +my %skip = ( Font => 1, Glyph => 1 ); + +sub ttfdump +{ + my ($var, $name) = @_; + my $res; + + my $d = Data::Dumper->new([$var]); + $d->Names([$name]) if defined $name; + $d->Sortkeys(\&myfilter); # This is the trick to keep from dumping the whole font + $d->Indent(3); # I want array indicies + $d->Useqq(1); # Perlquote -- slower but there might be binary data. + $res = $d->Dump; + $d->DESTROY; + $res; +} + +sub myfilter +{ + my ($hash) = @_; + my @a = grep { + ($_ eq ' PARENT' || $_ eq ' CACHE') ? 0 : + ref($hash->{$_}) =~ m/^Font::TTF::(.*)$/ ? !$skip{$1} : + 1 + } (keys %{$hash}) ; + # Sort numerically if that is reasonable: + return [ sort {$a =~ /\D/ || $b =~ /\D/ ? $a cmp $b : $a <=> $b} @a ]; +} + +1; + +=head1 See also + +L + +=cut diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/EBDT.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/EBDT.pm new file mode 100644 index 0000000..257e8d7 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/EBDT.pm @@ -0,0 +1,285 @@ +package Font::TTF::EBDT; + +=head1 NAME + +Font::TTF::EBDT - Embeeded Bitmap Data Table + +=head1 DESCRIPTION + +Contains the metrics and bitmap image data. + +=head1 INSTANCE VARIABLES + +Only has 'bitmap' instance variable. It is an array of assosiative +array keyed by glyph-id. The element is an object which consists +of metric information and image data. + +=over 4 + +=item bitmap object + +=over 8 +=item format +Only 7 is supported. +=item height +=item width +=item horiBearingX +=item horiBearingY +=item horiAdvance +=item vertBearingX +=item vertBearingY +=item vertAdvance +=item imageData + +=back + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +require Font::TTF::Table; + +@ISA = qw(Font::TTF::Table); + + +=head2 $t->read + +Reads the embedded bitmap data from the TTF file into memory. +This routine should be called _after_ {'EBLC'}->read. + +=cut + +sub read +{ + my ($self) = shift; + my ($fh) = $self->{' INFILE'}; + my ($i, $dat); + my ($eblc) = $self->{' PARENT'}->{'EBLC'}; + my ($bst_array); + + $eblc->read; + $self->SUPER::read || return $self; + + # ebdtHeader + $fh->read($dat, 4); # version + + $bst_array = $eblc->{'bitmapSizeTable'}; + + for ($i = 0; $i < $eblc->{'Num'}; $i++) + { + my ($bst) = $bst_array->[$i]; + my ($format) = $bst->{'imageFormat'}; + my ($offset) = $bst->{'imageDataOffset'}; + my ($j); + my ($ist_array) = $eblc->{'indexSubTableArray'}[$i]; + my ($bitmap) = {}; + + die "Only EBDT format 7 is implemented." unless ($format == 7); + + $self->{'bitmap'}[$i] = $bitmap; + + for ($j = 0; $j < $bst->{'numberOfIndexSubTables'}; $j++) { + my ($ista) = $ist_array->[$j]; + my ($offsetArray) = $eblc->{'indexSubTable'}[$i][$j]; + my ($p, $o0, $c); + +# if ($fh->tell != $self->{' OFFSET'} + $offset) { +# $fh->seek($self->{' OFFSET'} + $offset, 0); +# } + + $p = 0; + $o0 = $offsetArray->[$p++]; + for ($c = $ista->{'firstGlyphIndex'}; $c <= $ista->{'lastGlyphIndex'}; $c++) + { + my ($b) = {}; + my ($o1) = $offsetArray->[$p++]; + my ($len) = $o1 - $o0 - 8; + +# if ($fh->tell != $self->{' OFFSET'} + $offset + $o0) { +# $fh->seek($self->{' OFFSET'} + $offset + $o0, 0); +# } + + $fh->read($dat, 8); + ($b->{'height'}, + $b->{'width'}, + $b->{'horiBearingX'}, + $b->{'horiBearingY'}, + $b->{'horiAdvance'}, + $b->{'vertBearingX'}, + $b->{'vertBearingY'}, + $b->{'vertAdvance'}) + = unpack("cccccccc", $dat); + + $fh->read($dat, $len); + $b->{'imageData'} = $dat; + $b->{'format'} = 7; # bitmap and bigMetrics + + $bitmap->{$c} = $b; + $o0 = $o1; + } + + $offset += $o0; + } + } + + $self; +} + + +=head2 $t->update + +Update EBLC information using EBDT data. + +=cut + +sub get_regions +{ + my (@l) = @_; + my (@r) = (); + my ($e); + my ($first); + my ($last); + + $first = $l[0]; + $last = $first - 1; + foreach $e (@l) { + if ($last + 1 != $e) { # not contiguous + $r[++$#r] = [$first, $last]; + $first = $e; + } + + $last = $e; + } + + $r[++$#r] = [$first, $last]; + @r; +} + +sub update +{ + my ($self) = @_; + my ($eblc) = $self->{' PARENT'}->{'EBLC'}; + my ($bst_array) = []; + my ($offset) = 4; + my ($i); + my ($bitmap_array) = $self->{'bitmap'}; + my ($istao) = 8 + 48 * $eblc->{'Num'}; + + $eblc->{'bitmapSizeTable'} = $bst_array; + + for ($i = 0; $i < $eblc->{'Num'}; $i++) { + my ($bst) = {}; + my ($ist_array) = []; + my ($j); + my ($bitmap) = $bitmap_array->[$i]; + my (@regions) = get_regions(sort {$a <=> $b} keys (%$bitmap)); + my ($aotis) = 8 * (1+$#regions); + + $bst->{'indexFormat'} = 1; + $bst->{'imageFormat'} = 7; + $bst->{'imageDataOffset'} = $offset; + $bst->{'numberOfIndexSubTables'} = 1+$#regions; + $bst->{'indexSubTableArrayOffset'} = $istao; + $bst->{'colorRef'} = 0; + + $bst->{'startGlyphIndex'} = $regions[0][0]; + $bst->{'endGlyphIndex'} = $regions[-1][1]; + $bst->{'bitDepth'} = 1; + $bst->{'flags'} = 1; # Horizontal + $bst_array->[$i] = $bst; + + $eblc->{'indexSubTableArray'}[$i] = $ist_array; + for ($j = 0; $j <= $#regions; $j++) { + my ($ista) = {}; + my ($offsetArray) = []; + my ($p, $o0, $c); + $ist_array->[$j] = $ista; + + $ista->{'firstGlyphIndex'} = $regions[$j][0]; + $ista->{'lastGlyphIndex'} = $regions[$j][1]; + $ista->{'additionalOffsetToIndexSubtable'} = $aotis; + $eblc->{'indexSubTable'}[$i][$j] = $offsetArray; + $p = 0; + $o0 = 0; + for ($c = $regions[$j][0]; $c <= $regions[$j][1]; $c++) { + my ($b) = $bitmap->{$c}; + + $offsetArray->[$p++] = $o0; + $o0 += 8 + length($b->{'imageData'}); + } + + $offsetArray->[$p++] = $o0; + + $aotis += ($regions[$j][1] - $regions[$j][0] + 1 + 1)*4; + $offset += $o0; + + # Do we need the element of 0x10007 and absolute offset here, + # at the end of offsetArray? +# if ($j + 1 <= $#regions) { +# $offsetArray->[$p++] = 0x10007; +# $offsetArray->[$p++] = $offset; +# $aotis += 8; +# } + } + + $istao += $aotis + 8; + $bst->{'indexTablesSize'} = $aotis + 8; + } +} + +=head2 $t->out($fh) + +Outputs the bitmap data of embedded bitmap for this font. + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($eblc) = $self->{' PARENT'}->{'EBLC'}; + my ($i); + my ($bitmap_array) = $self->{'bitmap'}; + + $fh->print(pack("N", 0x00020000)); + + for ($i = 0; $i < $eblc->{'Num'}; $i++) { + my ($j); + my ($bitmap) = $bitmap_array->[$i]; + my (@regions) = get_regions(sort {$a <=> $b} keys (%$bitmap)); + + for ($j = 0; $j <= $#regions; $j++) { + my ($c); + + for ($c = $regions[$j][0]; $c <= $regions[$j][1]; $c++) { + my ($b) = $bitmap->{$c}; + + $fh->print(pack("cccccccc", + $b->{'height'}, $b->{'width'}, + $b->{'horiBearingX'}, $b->{'horiBearingY'}, + $b->{'horiAdvance'}, $b->{'vertBearingX'}, + $b->{'vertBearingY'}, $b->{'vertAdvance'})); + $fh->print($b->{'imageData'}); + } + } + } +} + +1; + +=head1 BUGS + +Only Format 7 is implemented. XML output is not supported (yet). + +=head1 AUTHOR + +NIIBE Yutaka L. See L for copyright and +licensing. + +This was written at the CodeFest Akihabara 2006 hosted by FSIJ. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/EBLC.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/EBLC.pm new file mode 100644 index 0000000..7ba6e68 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/EBLC.pm @@ -0,0 +1,228 @@ +package Font::TTF::EBLC; + +=head1 NAME + +Font::TTF::EBLC - Embeeded Bitmap Location Table + +=head1 DESCRIPTION + +Contains the sizes and glyph ranges of bitmaps, and the offsets to +glyph bitmap data in indexSubTables for EBDT. + +Possibly contains glyph metrics information. + +=head1 INSTANCE VARIABLES +The information specified 'B<(R)>ead only' is read only, those +are calculated from EBDT, when it is 'update'-ed. + +=over 4 + +=item bitmapSizeTable +An array of tables of following information + +=over 8 +=item indexSubTableArrayOffset (R) +=item indexTablesSize (R) +=item numberOfIndexSubTables (R) +=item colorRef +=item hori +=item vert +=item startGlyphIndex (R) +=item endGlyphIndex (R) +=item ppemX +=item ppemY +=item bitDepth +=item flags +=back + +=item indexSubTableArray (R) +An array which contains range information. + +=item indexSubTable (R) +An array which contains offsets of EBDT table. + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +require Font::TTF::Table; + +@ISA = qw(Font::TTF::Table); + + +=head2 $t->read + +Reads the location information of embedded bitmap from the TTF file into memory + +=cut + +sub read +{ + my ($self) = @_; + my ($fh) = $self->{' INFILE'}; + my ($i, $dat); + my ($indexSubTableArrayOffset, + $indexTablesSize, + $numberOfIndexSubTables, + $colorRef); + my ($startGlyphIndex, + $endGlyphIndex, + $ppemX, $ppemY, + $bitDepth, $flags); + my (@hori, @vert); + my ($bst, $ista, $ist); + my ($j); + + $self->SUPER::read or return $self; + + # eblcHeader + $fh->read($dat, 4); + $self->{'version'} = unpack("N",$dat); + + $fh->read($dat, 4); + $self->{'Num'} = unpack("N",$dat); + + # bitmapSizeTable + for ($i = 0; $i < $self->{'Num'}; $i++) { + $fh->read($dat, 16); + ($indexSubTableArrayOffset, $indexTablesSize, + $numberOfIndexSubTables, $colorRef) = unpack("NNNN", $dat); + $fh->read($dat, 12); @hori = unpack("cccccccccccc", $dat); + $fh->read($dat, 12); @vert = unpack("cccccccccccc", $dat); + + $fh->read($dat, 8); + ($startGlyphIndex, $endGlyphIndex, + $ppemX, $ppemY, $bitDepth, $flags) = unpack("nnCCCC", $dat); + + $self->{'bitmapSizeTable'}[$i] = { + 'indexSubTableArrayOffset' => $indexSubTableArrayOffset, + 'indexTablesSize' => $indexTablesSize, + 'numberOfIndexSubTables' => $numberOfIndexSubTables, + 'colorRef' => $colorRef, + 'hori' => [@hori], + 'vert' => [@vert], + 'startGlyphIndex' => $startGlyphIndex, + 'endGlyphIndex' => $endGlyphIndex, + 'ppemX' => $ppemX, + 'ppemY' => $ppemY, + 'bitDepth' => $bitDepth, + 'flags' => $flags + }; + } + + for ($i = 0; $i < $self->{'Num'}; $i++) { + my ($count, $x); + + $bst = $self->{'bitmapSizeTable'}[$i]; + + for ($j = 0; $j < $bst->{'numberOfIndexSubTables'}; $j++) { + $ista = {}; + + # indexSubTableArray + $self->{'indexSubTableArray'}[$i][$j] = $ista; + $fh->read($dat, 8); + ($ista->{'firstGlyphIndex'}, + $ista->{'lastGlyphIndex'}, + $ista->{'additionalOffsetToIndexSubtable'}) + = unpack("nnN", $dat); + } + + # indexSubTable + # indexSubHeader + $fh->read($dat, 8); + ($bst->{'indexFormat'}, + $bst->{'imageFormat'}, + $bst->{'imageDataOffset'}) = unpack("nnN", $dat); + + die "Only indexFormat == 1 is supported" unless ($bst->{'indexFormat'} == 1); + + for ($j = 0; $j < $bst->{'numberOfIndexSubTables'}; $j++) { + $ista = $self->{'indexSubTableArray'}[$i][$j]; + $count = $ista->{'lastGlyphIndex'} - $ista->{'firstGlyphIndex'} + 1 + 1; + $fh->seek($self->{' OFFSET'} + $bst->{'indexSubTableArrayOffset'} + + $ista->{'additionalOffsetToIndexSubtable'} + 8, 0); + +# $count += 2 if $j < $bst->{'numberOfIndexSubTables'} - 1; + + $fh->read($dat, 4*$count); + + $self->{'indexSubTable'}[$i][$j] = [unpack("N*", $dat)]; + } + } + + $self; +} + +=head2 $t->out($fh) + +Outputs the location information of embedded bitmap for this font. + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($i); + my ($bst_array) = $self->{'bitmapSizeTable'}; + + $fh->print(pack("N", 0x00020000)); + $fh->print(pack("N", $self->{'Num'})); + + for ($i = 0; $i < $self->{'Num'}; $i++) { + my ($bst) = $bst_array->[$i]; + + $fh->print(pack("NNNN", + $bst->{'indexSubTableArrayOffset'}, + $bst->{'indexTablesSize'}, + $bst->{'numberOfIndexSubTables'}, + $bst->{'colorRef'})); + $fh->print(pack("cccccccccccc", @{$bst->{'hori'}})); + $fh->print(pack("cccccccccccc", @{$bst->{'vert'}})); + $fh->print(pack("nnCCCC", $bst->{'startGlyphIndex'}, + $bst->{'endGlyphIndex'}, $bst->{'ppemX'}, + $bst->{'ppemY'}, $bst->{'bitDepth'}, $bst->{'flags'})); + } + + for ($i = 0; $i < $self->{'Num'}; $i++) { + my ($bst) = $bst_array->[$i]; + my ($j); + + for ($j = 0; $j < $bst->{'numberOfIndexSubTables'}; $j++) { + my ($ista) = $self->{'indexSubTableArray'}[$i][$j]; + + $fh->print("nnN", + $ista->{'firstGlyphIndex'}, + $ista->{'lastGlyphIndex'}, + $ista->{'additionalOffsetToIndexSubtable'}); + } + + $fh->print(pack("nnN", $bst->{'indexFormat'}, $bst->{'imageFormat'}, + $bst->{'imageDataOffset'})); + + die "Only indexFormat == 1 is supported" unless ($bst->{'indexFormat'} == 1); + + for ($j = 0; $j < $bst->{'numberOfIndexSubTables'}; $j++) { + $fh->print(pack("N*", $self->{'indexSubTable'}[$i][$j])); + } + } +} + +1; + +=head1 BUGS + +Only indexFormat ==1 is implemented. XML output is not supported (yet). + +=head1 AUTHOR + +NIIBE Yutaka L. See L for copyright and +licensing. + +This was written at the CodeFest Akihabara 2006 hosted by FSIJ. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fdsc.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fdsc.pm new file mode 100644 index 0000000..3a81a11 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fdsc.pm @@ -0,0 +1,125 @@ +package Font::TTF::Fdsc; + +=head1 NAME + +Font::TTF::Fdsc - Font Descriptors table in a font + +=head1 DESCRIPTION + +=head1 INSTANCE VARIABLES + +=item version + +=item descriptors + +Hash keyed by descriptor tags + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA %fields); +use Font::TTF::Utils; + +@ISA = qw(Font::TTF::Table); + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self) = @_; + my ($dat, $fh, $numDescs, $tag, $descs); + + $self->SUPER::read or return $self; + + $fh = $self->{' INFILE'}; + $fh->read($dat, 4); + $self->{'version'} = TTF_Unpack("v", $dat); + + $fh->read($dat, 4); + + foreach (1 .. unpack("N", $dat)) { + $fh->read($tag, 4); + $fh->read($dat, 4); + $descs->{$tag} = ($tag eq 'nalf') ? unpack("N", $dat) : TTF_Unpack("f", $dat); + } + + $self->{'descriptors'} = $descs; + + $self; +} + + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($descs); + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $fh->print(TTF_Pack("v", $self->{'version'})); + + $descs = $self->{'descriptors'} or {}; + + $fh->print(pack("N", scalar keys %$descs)); + foreach (sort keys %$descs) { + $fh->print($_); + $fh->print(($_ eq 'nalf') ? pack("N", $descs->{$_}) : TTF_Pack("f", $descs->{$_})); + } + + $self; +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + my ($descs, $k); + + $self->read; + + $fh = 'STDOUT' unless defined $fh; + + $descs = $self->{'descriptors'}; + foreach $k (sort keys %$descs) { + if ($k eq 'nalf') { + $fh->printf("Descriptor '%s' = %d\n", $k, $descs->{$k}); + } + else { + $fh->printf("Descriptor '%s' = %f\n", $k, $descs->{$k}); + } + } + + $self; +} + +1; + + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Feat.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Feat.pm new file mode 100644 index 0000000..c837f41 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Feat.pm @@ -0,0 +1,191 @@ +package Font::TTF::Feat; + +=head1 NAME + +Font::TTF::Feat - Font Features + +=head1 DESCRIPTION + +=head1 INSTANCE VARIABLES + +=over 4 + +=item version + +=item features + +An array of hashes of the following form + +=over 8 + +=item feature + +feature id number + +=item name + +name index in name table + +=item exclusive + +exclusive flag + +=item settings + +hash of setting number against name string index + +=back + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); + +use Font::TTF::Utils; + +require Font::TTF::Table; + +@ISA = qw(Font::TTF::Table); + +=head2 $t->read + +Reads the features from the TTF file into memory + +=cut + +sub read +{ + my ($self) = @_; + my ($featureCount, $features); + + $self->SUPER::read_dat or return $self; + + ($self->{'version'}, $featureCount) = TTF_Unpack("vS", $self->{' dat'}); + + $features = []; + foreach (1 .. $featureCount) { + my ($feature, $nSettings, $settingTable, $featureFlags, $nameIndex) + = TTF_Unpack("SSLSS", substr($self->{' dat'}, $_ * 12, 12)); + push @$features, + { + 'feature' => $feature, + 'name' => $nameIndex, + 'exclusive' => (($featureFlags & 0x8000) != 0), + 'settings' => { TTF_Unpack("S*", substr($self->{' dat'}, $settingTable, $nSettings * 4)) } + }; + } + $self->{'features'} = $features; + + delete $self->{' dat'}; # no longer needed, and may become obsolete + + $self; +} + +=head2 $t->out($fh) + +Writes the features to a TTF file + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($features, $numFeatures, $settings, $featuresData, $settingsData); + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $features = $self->{'features'}; + $numFeatures = @$features; + + foreach (@$features) { + $settings = $_->{'settings'}; + $featuresData .= TTF_Pack("SSLSS", + $_->{'feature'}, + scalar keys %$settings, + 12 + 12 * $numFeatures + length $settingsData, + ($_->{'exclusive'} ? 0x8000 : 0x0000), + $_->{'name'}); + foreach (sort {$a <=> $b} keys %$settings) { + $settingsData .= TTF_Pack("SS", $_, $settings->{$_}); + } + } + + $fh->print(TTF_Pack("vSSL", $self->{'version'}, $numFeatures, 0, 0)); + $fh->print($featuresData); + $fh->print($settingsData); + + $self; +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + my ($names, $features, $settings); + + $self->read; + + $names = $self->{' PARENT'}->{'name'}; + $names->read; + + $fh = 'STDOUT' unless defined $fh; + + $features = $self->{'features'}; + foreach (@$features) { + $fh->printf("Feature %d, %s, name %d # '%s'\n", + $_->{'feature'}, + ($_->{'exclusive'} ? "exclusive" : "additive"), + $_->{'name'}, + $names->{'strings'}[$_->{'name'}][1][0]{0}); + $settings = $_->{'settings'}; + foreach (sort { $a <=> $b } keys %$settings) { + $fh->printf("\tSetting %d, name %d # '%s'\n", + $_, $settings->{$_}, $names->{'strings'}[$settings->{$_}][1][0]{0}); + } + } + + $self; +} + +sub settingName +{ + my ($self, $feature, $setting) = @_; + + $self->read; + + my $names = $self->{' PARENT'}->{'name'}; + $names->read; + + my $features = $self->{'features'}; + my ($featureEntry) = grep { $_->{'feature'} == $feature } @$features; + my $featureName = $names->{'strings'}[$featureEntry->{'name'}][1][0]{0}; + my $settingName = $featureEntry->{'exclusive'} + ? $names->{'strings'}[$featureEntry->{'settings'}->{$setting}][1][0]{0} + : $names->{'strings'}[$featureEntry->{'settings'}->{$setting & ~1}][1][0]{0} + . (($setting & 1) == 0 ? " On" : " Off"); + + ($featureName, $settingName); +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fmtx.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fmtx.pm new file mode 100644 index 0000000..a9311df --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fmtx.pm @@ -0,0 +1,108 @@ +package Font::TTF::Fmtx; + +=head1 NAME + +Font::TTF::Fmtx - Font Metrics table + +=head1 DESCRIPTION + +This is a simple table with just standards specified instance variables + +=head1 INSTANCE VARIABLES + + version + glyphIndex + horizontalBefore + horizontalAfter + horizontalCaretHead + horizontalCaretBase + verticalBefore + verticalAfter + verticalCaretHead + verticalCaretBase + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA %fields @field_info); + +require Font::TTF::Table; +use Font::TTF::Utils; + +@ISA = qw(Font::TTF::Table); +@field_info = ( + 'version' => 'v', + 'glyphIndex' => 'L', + 'horizontalBefore' => 'c', + 'horizontalAfter' => 'c', + 'horizontalCaretHead' => 'c', + 'horizontalCaretBase' => 'c', + 'verticalBefore' => 'c', + 'verticalAfter' => 'c', + 'verticalCaretHead' => 'c', + 'verticalCaretBase' => 'c'); + +sub init +{ + my ($k, $v, $c, $i); + for ($i = 0; $i < $#field_info; $i += 2) + { + ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); + next unless defined $k && $k ne ""; + $fields{$k} = $v; + } +} + + +=head2 $t->read + +Reads the table into memory as instance variables + +=cut + +sub read +{ + my ($self) = @_; + my ($dat); + + $self->SUPER::read or return $self; + init unless defined $fields{'glyphIndex'}; + $self->{' INFILE'}->read($dat, 16); + + TTF_Read_Fields($self, $dat, \%fields); + $self; +} + + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying. + +=cut + +sub out +{ + my ($self, $fh) = @_; + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $fh->print(TTF_Out_Fields($self, \%fields, 16)); + $self; +} + + +1; + + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Font.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Font.pm new file mode 100644 index 0000000..8f5cc50 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Font.pm @@ -0,0 +1,767 @@ +package Font::TTF::Font; + +=head1 NAME + +Font::TTF::Font - Memory representation of a font + +=head1 SYNOPSIS + +Here is the regression test (you provide your own font). Run it once and then +again on the output of the first run. There should be no differences between +the outputs of the two runs. + + $f = Font::TTF::Font->open($ARGV[0]); + + # force a read of all the tables + $f->tables_do(sub { $_[0]->read; }); + + # force read of all glyphs (use read_dat to use lots of memory!) + # $f->{'loca'}->glyphs_do(sub { $_[0]->read; }); + $f->{'loca'}->glyphs_do(sub { $_[0]->read_dat; }); + # NB. no need to $g->update since $f->{'glyf'}->out will do it for us + + $f->out($ARGV[1]); + $f->release; # clear up memory forcefully! + +=head1 DESCRIPTION + +A Truetype font consists of a header containing a directory of tables which +constitute the rest of the file. This class holds that header and directory and +also creates objects of the appropriate type for each table within the font. +Note that it does not read each table into memory, but creates a short reference +which can be read using the form: + + $f->{$tablename}->read; + +Classes are included that support many of the different TrueType tables. For +those for which no special code exists, the table type C is used, which +defaults to L. The current tables which are supported are: + + table Font::TTF::Table - for unknown tables + EBDT Font::TTF::EBDT + EBLC Font::TTF::EBLC + Feat Font::TTF::GrFeat + GDEF Font::TTF::GDEF + GPOS Font::TTF::GPOS + GSUB Font::TTF::GSUB + LTSH Font::TTF::LTSH + OS/2 Font::TTF::OS_2 + PCLT Font::TTF::PCLT + Sill Font::TTF::Sill + bsln Font::TTF::Bsln + cmap Font::TTF::Cmap - see also Font::TTF::OldCmap + cvt Font::TTF::Cvt_ + fdsc Font::TTF::Fdsc + feat Font::TTF::Feat + fmtx Font::TTF::Fmtx + fpgm Font::TTF::Fpgm + glyf Font::TTF::Glyf - see also Font::TTF::Glyph + hdmx Font::TTF::Hdmx + head Font::TTF::Head + hhea Font::TTF::Hhea + hmtx Font::TTF::Hmtx + kern Font::TTF::Kern - see alternative Font::TTF::AATKern + loca Font::TTF::Loca + maxp Font::TTF::Maxp + mort Font::TTF::Mort - see also Font::TTF::OldMort + name Font::TTF::Name + post Font::TTF::Post + prep Font::TTF::Prep + prop Font::TTF::Prop + vhea Font::TTF::Vhea + vmtx Font::TTF::Vmtx + +Links are: + +L +L L L +L L L L +L L L L L L +L L L L L +L L L L L +L L L L L +L L L L L +L L L + + +=head1 INSTANCE VARIABLES + +Instance variables begin with a space (and have lengths greater than the 4 +characters which make up table names). + +=over + +=item nocsum + +This is used during output to disable the creation of the file checksum in the +head table. For example, during DSIG table creation, this flag will be set to +ensure that the file checksum is left at zero. + +=item noharmony + +If set, do not harmonize the script and lang trees of GPOS and GSUB tables. See L for more info. + +=item fname (R) + +Contains the filename of the font which this object was read from. + +=item INFILE (P) + +The file handle which reflects the source file for this font. + +=item OFFSET (P) + +Contains the offset from the beginning of the read file of this particular +font directory, thus providing support for TrueType Collections. + +=back + +=head1 METHODS + +=cut + +use IO::File; + +use strict; +use vars qw(%tables $VERSION $dumper); +use Symbol(); + +require 5.004; + +$VERSION = 0.38; # MJPH 2-FEB-2008 Add Sill table +# $VERSION = 0.37; # MJPH 7-OCT-2005 Force hhea update if dirty, give more OS/2 stuff in update +# $VERSION = 0.36; # MJPH 19-AUG-2005 Change cmap::reverse api to be opts based +# $VERSION = 0.35; # MJPH 4-MAY-2004 Various fixes to OpenType stuff, separate off scripts +# $VERSION = 0.34; # MJPH 22-MAY-2003 Update PSNames to latest AGL +# $VERSION = 0.33; # MJPH 9-OCT-2002 Support CFF OpenType (just by version=='OTTO'?!) +# $VERSION = 0.32; # MJPH 2-OCT-2002 Bug fixes to TTFBuilder, new methods and some +# extension table support in Ttopen and Coverage +# $VERSION = 0.31; # MJPH 1-JUL-2002 fix read format 12 cmap (bart@cs.pdx.edu) +# improve surrogate support in ttfremap +# fix return warn to return warn,undef +# ensure correct indexToLocFormat +# $VERSION = 0.30; # MJPH 28-MAY-2002 add updated release +# $VERSION = 0.29; # MJPH 9-APR-2002 update ttfbuilder, sort out surrogates +# $VERSION = 0.28; # MJPH 13-MAR-2002 update ttfbuilder, add Font::TTF::Cmap::ms_enc() +# $VERSION = 0.27; # MJPH 6-FEB-2002 update ttfbuilder, support no fpgm, no more __DATA__ +# $VERSION = 0.26; # MJPH 19-SEP-2001 Update ttfbuilder +# $VERSION = 0.25; # MJPH 18-SEP-2001 problems in update of head +# $VERSION = 0.24; # MJPH 1-AUG-2001 Sort out update +# $VERSION = 0.23; # GST 30-MAY-2001 Memory leak fixed +# $VERSION = 0.22; # MJPH 09-APR-2001 Ensure all of AAT stuff included +# $VERSION = 0.21; # MJPH 23-MAR-2001 Improve Opentype support +# $VERSION = 0.20; # MJPH 13-JAN-2001 Add XML output and some of XML input, AAT & OT tables +# $VERSION = 0.19; # MJPH 29-SEP-2000 Add cmap::is_unicode, debug makefile.pl +# $VERSION = 0.18; # MJPH 21-JUL-2000 Debug Utils::TTF_bininfo +# $VERSION = 0.17; # MJPH 16-JUN-2000 Add utf8 support to names +# $VERSION = 0.16; # MJPH 26-APR-2000 Mark read tables as read, tidy up POD +# $VERSION = 0.15; # MJPH 5-FEB-2000 Ensure right versions released +# $VERSION = 0.14; # MJPH 11-SEP-1999 Sort out Unixisms, agian! +# $VERSION = 0.13; # MJPH 9-SEP-1999 Add empty, debug update_bbox +# $VERSION = 0.12; # MJPH 22-JUL-1999 Add update_bbox +# $VERSION = 0.11; # MJPH 7-JUL-1999 Don't store empties in cmaps +# $VERSION = 0.10; # MJPH 21-JUN-1999 Use IO::File +# $VERSION = 0.09; # MJPH 9-JUN-1999 Add 5.004 require, minor tweeks in cmap +# $VERSION = 0.08; # MJPH 19-MAY-1999 Sort out line endings for Unix +# $VERSION = 0.07; # MJPH 28-APR-1999 Get the regression tests to work +# $VERSION = 0.06; # MJPH 26-APR-1999 Start to add to CVS, correct MANIFEST.SKIP +# $VERSION = 0.05; # MJPH 13-APR-1999 See changes for 0.05 +# $VERSION = 0.04; # MJPH 13-MAR-1999 Tidy up Tarball +# $VERSION = 0.03; # MJPH 9-MAR-1999 Move to Font::TTF for CPAN +# $VERSION = 0.02; # MJPH 12-FEB-1999 Add support for ' nocsum' for DSIGS +# $VERSION = 0.0001; + +%tables = ( + 'table' => 'Font::TTF::Table', + 'EBDT' => 'Font::TTF::EBDT', + 'EBLC' => 'Font::TTF::EBLC', + 'Feat' => 'Font::TTF::GrFeat', + 'GDEF' => 'Font::TTF::GDEF', + 'GPOS' => 'Font::TTF::GPOS', + 'GSUB' => 'Font::TTF::GSUB', + 'LTSH' => 'Font::TTF::LTSH', + 'OS/2' => 'Font::TTF::OS_2', + 'PCLT' => 'Font::TTF::PCLT', + 'Sill' => 'Font::TTF::Sill', + 'bsln' => 'Font::TTF::Bsln', + 'cmap' => 'Font::TTF::Cmap', + 'cvt ' => 'Font::TTF::Cvt_', + 'fdsc' => 'Font::TTF::Fdsc', + 'feat' => 'Font::TTF::Feat', + 'fmtx' => 'Font::TTF::Fmtx', + 'fpgm' => 'Font::TTF::Fpgm', + 'glyf' => 'Font::TTF::Glyf', + 'hdmx' => 'Font::TTF::Hdmx', + 'head' => 'Font::TTF::Head', + 'hhea' => 'Font::TTF::Hhea', + 'hmtx' => 'Font::TTF::Hmtx', + 'kern' => 'Font::TTF::Kern', + 'loca' => 'Font::TTF::Loca', + 'maxp' => 'Font::TTF::Maxp', + 'mort' => 'Font::TTF::Mort', + 'name' => 'Font::TTF::Name', + 'post' => 'Font::TTF::Post', + 'prep' => 'Font::TTF::Prep', + 'prop' => 'Font::TTF::Prop', + 'vhea' => 'Font::TTF::Vhea', + 'vmtx' => 'Font::TTF::Vmtx', + ); + +# This is special code because I am fed up of every time I x a table in the debugger +# I get the whole font printed. Thus substitutes my 3 line change to dumpvar into +# the debugger. Clunky, but nice. You are welcome to a copy if you want one. + +BEGIN { + my ($p); + + foreach $p (@INC) + { + if (-f "$p/mydumpvar.pl") + { + $dumper = 'mydumpvar.pl'; + last; + } + } + $dumper ||= 'dumpvar.pl'; +} + +sub main::dumpValue +{ do $dumper; &main::dumpValue; } + + +=head2 Font::TTF::Font->AddTable($tablename, $class) + +Adds the given class to be used when representing the given table name. It also +'requires' the class for you. + +=cut + +sub AddTable +{ + my ($class, $table, $useclass) = @_; + + $tables{$table} = $useclass; +# $useclass =~ s|::|/|oig; +# require "$useclass.pm"; +} + + +=head2 Font::TTF::Font->Init + +For those people who like making fonts without reading them. This subroutine +will require all the table code for the various table types for you. Not +needed if using Font::TTF::Font::read before using a table. + +=cut + +sub Init +{ + my ($class) = @_; + my ($t); + + foreach $t (values %tables) + { + $t =~ s|::|/|oig; + require "$t.pm"; + } +} + +=head2 Font::TTF::Font->new(%props) + +Creates a new font object and initialises with the given properties. This is +primarily for use when a TTF is embedded somewhere. Notice that the properties +are automatically preceded by a space when inserted into the object. This is in +order that fields do not clash with tables. + +=cut + +sub new +{ + my ($class, %props) = @_; + my ($self) = {}; + + bless $self, $class; + + foreach (keys %props) + { $self->{" $_"} = $props{$_}; } + $self; +} + + +=head2 Font::TTF::Font->open($fname) + +Reads the header and directory for the given font file and creates appropriate +objects for each table in the font. + +=cut + +sub open +{ + my ($class, $fname) = @_; + my ($fh); + my ($self) = {}; + + unless (ref($fname)) + { + $fh = IO::File->new($fname) or return undef; + binmode $fh; + } else + { $fh = $fname; } + + $self->{' INFILE'} = $fh; + $self->{' fname'} = $fname; + $self->{' OFFSET'} = 0; + bless $self, $class; + + $self->read; +} + +=head2 $f->read + +Reads a Truetype font directory starting from the current location in the file. +This has been separated from the C function to allow support for embedded +TTFs for example in TTCs. Also reads the C and C tables immediately. + +=cut + +sub read +{ + my ($self) = @_; + my ($fh) = $self->{' INFILE'}; + my ($dat, $i, $ver, $dir_num, $type, $name, $check, $off, $len, $t); + + $fh->seek($self->{' OFFSET'}, 0); + $fh->read($dat, 12); + ($ver, $dir_num) = unpack("Nn", $dat); + $ver == 1 << 16 || $ver == unpack('N', 'OTTO') || $ver == 0x74727565 or return undef; # support Mac sfnts + + for ($i = 0; $i < $dir_num; $i++) + { + $fh->read($dat, 16) || die "Reading table entry"; + ($name, $check, $off, $len) = unpack("a4NNN", $dat); + $self->{$name} = $self->{' PARENT'}->find($self, $name, $check, $off, $len) && next + if (defined $self->{' PARENT'}); + $type = $tables{$name} || 'Font::TTF::Table'; + $t = $type; + if ($^O eq "MacOS") + { $t =~ s/^|::/:/oig; } + else + { $t =~ s|::|/|oig; } + require "$t.pm"; + $self->{$name} = $type->new(PARENT => $self, + NAME => $name, + INFILE => $fh, + OFFSET => $off, + LENGTH => $len, + CSUM => $check); + } + + foreach $t ('head', 'maxp') + { $self->{$t}->read if defined $self->{$t}; } + + $self; +} + + +=head2 $f->out($fname [, @tablelist]) + +Writes a TTF file consisting of the tables in tablelist. The list is checked to +ensure that only tables that exist are output. (This means that you can't have +non table information stored in the font object with key length of exactly 4) + +In many cases the user simply wants to output all the tables in alphabetical order. +This can be done by not including a @tablelist, in which case the subroutine will +output all the defined tables in the font in alphabetical order. + +Returns $f on success and undef on failure, including warnings. + +All output files must include the C table. + +=cut + +sub out +{ + my ($self, $fname, @tlist) = @_; + my ($fh); + my ($dat, $numTables, $sRange, $eSel); + my (%dir, $k, $mloc, $count); + my ($csum, $lsum, $msum, $loc, $oldloc, $len, $shift); + + unless (ref($fname)) + { + $fh = IO::File->new("+>$fname") || return warn("Unable to open $fname for writing"), undef; + binmode $fh; + } else + { $fh = $fname; } + + $self->{' oname'} = $fname; + $self->{' outfile'} = $fh; + + if ($self->{' wantsig'}) + { + $self->{' nocsum'} = 1; +# $self->{'head'}{'checkSumAdjustment'} = 0; + $self->{' tempDSIG'} = $self->{'DSIG'}; + $self->{' tempcsum'} = $self->{'head'}{' CSUM'}; + delete $self->{'DSIG'}; + @tlist = sort {$self->{$a}{' OFFSET'} <=> $self->{$b}{' OFFSET'}} + grep (length($_) == 4 && defined $self->{$_}, keys %$self) if ($#tlist < 0); + } + elsif ($#tlist < 0) + { @tlist = sort keys %$self; } + + @tlist = grep(length($_) == 4 && defined $self->{$_}, @tlist); + $numTables = $#tlist + 1; + $numTables++ if ($self->{' wantsig'}); + + ($numTables, $sRange, $eSel, $shift) = Font::TTF::Utils::TTF_bininfo($numTables, 16); + $dat = pack("Nnnnn", 1 << 16, $numTables, $sRange, $eSel, $shift); + $fh->print($dat); + $msum = unpack("%32N*", $dat); + +# reserve place holders for each directory entry + foreach $k (@tlist) + { + $dir{$k} = pack("A4NNN", $k, 0, 0, 0); + $fh->print($dir{$k}); + } + + $fh->print(pack('A4NNN', '', 0, 0, 0)) if ($self->{' wantsig'}); + + $loc = $fh->tell(); + if ($loc & 3) + { + $fh->print(substr("\000" x 4, $loc & 3)); + $loc += 4 - ($loc & 3); + } + + foreach $k (@tlist) + { + $oldloc = $loc; + $self->{$k}->out($fh); + $loc = $fh->tell(); + $len = $loc - $oldloc; + if ($loc & 3) + { + $fh->print(substr("\000" x 4, $loc & 3)); + $loc += 4 - ($loc & 3); + } + $fh->seek($oldloc, 0); + $csum = 0; $mloc = $loc; + while ($mloc > $oldloc) + { + $count = ($mloc - $oldloc > 4096) ? 4096 : $mloc - $oldloc; + $fh->read($dat, $count); + $csum += unpack("%32N*", $dat); +# this line ensures $csum stays within 32 bit bounds, clipping as necessary + if ($csum > 0xffffffff) { $csum -= 0xffffffff; $csum--; } + $mloc -= $count; + } + $dir{$k} = pack("A4NNN", $k, $csum, $oldloc, $len); + $msum += $csum + unpack("%32N*", $dir{$k}); + while ($msum > 0xffffffff) { $msum -= 0xffffffff; $msum--; } + $fh->seek($loc, 0); + } + + unless ($self->{' nocsum'}) # assuming we want a file checksum + { +# Now we need to sort out the head table's checksum + if (!defined $dir{'head'}) + { # you have to have a head table + $fh->close(); + return warn("No 'head' table to output in $fname"), undef; + } + ($csum, $loc, $len) = unpack("x4NNN", $dir{'head'}); + $fh->seek($loc + 8, 0); + $fh->read($dat, 4); + $lsum = unpack("N", $dat); + if ($lsum != 0) + { + $csum -= $lsum; + if ($csum < 0) { $csum += 0xffffffff; $csum++; } + $msum -= $lsum * 2; # twice (in head and in csum) + while ($msum < 0) { $msum += 0xffffffff; $msum++; } + } + $lsum = 0xB1B0AFBA - $msum; + $fh->seek($loc + 8, 0); + $fh->print(pack("N", $lsum)); + $dir{'head'} = pack("A4NNN", 'head', $csum, $loc, $len); + } elsif ($self->{' wantsig'}) + { + if (!defined $dir{'head'}) + { # you have to have a head table + $fh->close(); + return warn("No 'head' table to output in $fname"), undef; + } + ($csum, $loc, $len) = unpack("x4NNN", $dir{'head'}); + $fh->seek($loc + 8, 0); + $fh->print(pack("N", 0)); +# $dir{'head'} = pack("A4NNN", 'head', $self->{' tempcsum'}, $loc, $len); + } + +# Now we can output the directory again + if ($self->{' wantsig'}) + { @tlist = sort @tlist; } + $fh->seek(12, 0); + foreach $k (@tlist) + { $fh->print($dir{$k}); } + $fh->print(pack('A4NNN', '', 0, 0, 0)) if ($self->{' wantsig'}); + $fh->close(); + $self; +} + + +=head2 $f->out_xml($filename [, @tables]) + +Outputs the font in XML format + +=cut + +sub out_xml +{ + my ($self, $fname, @tlist) = @_; + my ($fh, $context, $numTables, $k); + + $context->{'indent'} = ' ' x 4; + + unless (ref($fname)) + { + $fh = IO::File->new("+>$fname") || return warn("Unable to open $fname"), undef; + binmode $fh; + } else + { $fh = $fname; } + + unless (scalar @tlist > 0) + { + @tlist = sort keys %$self; + @tlist = grep(length($_) == 4 && defined $self->{$_}, @tlist); + } + $numTables = $#tlist + 1; + + $context->{'fh'} = $fh; + $fh->print("\n"); + $fh->print("\n\n"); + + foreach $k (@tlist) + { + $fh->print("
    \n"); + $self->{$k}->out_xml($context, $context->{'indent'}); + $fh->print("
    \n"); + } + + $fh->print("\n"); + $fh->close; + $self; +} + + +=head2 $f->XML_start($context, $tag, %attrs) + +Handles start messages from the XML parser. Of particular interest to us are and +. + +=cut + +sub XML_start +{ + my ($self, $context, $tag, %attrs) = @_; + my ($name, $type, $t); + + if ($tag eq 'font') + { $context->{'tree'}[-1] = $self; } + elsif ($tag eq 'table') + { + $name = $attrs{'name'}; + unless (defined $self->{$name}) + { + $type = $tables{$name} || 'Font::TTF::Table'; + $t = $type; + if ($^O eq "MacOS") + { $t =~ s/^|::/:/oig; } + else + { $t =~ s|::|/|oig; } + require "$t.pm"; + $self->{$name} = $type->new('PARENT' => $self, 'NAME' => $name, 'read' => 1); + } + $context->{'receiver'} = ($context->{'tree'}[-1] = $self->{$name}); + } + $context; +} + + +sub XML_end +{ + my ($self) = @_; + my ($context, $tag, %attrs) = @_; + my ($i); + + return undef unless ($tag eq 'table' && $attrs{'name'} eq 'loca'); + if (defined $context->{'glyphs'} && $context->{'glyphs'} ne $self->{'loca'}{'glyphs'}) + { + for ($i = 0; $i <= $#{$context->{'glyphs'}}; $i++) + { $self->{'loca'}{'glyphs'}[$i] = $context->{'glyphs'}[$i] if defined $context->{'glyphs'}[$i]; } + $context->{'glyphs'} = $self->{'loca'}{'glyphs'}; + } + return undef; +} + +=head2 $f->update + +Sends update to all the tables in the font and then resets all the isDirty +flags on each table. The data structure in now consistent as a font (we hope). + +=cut + +sub update +{ + my ($self) = @_; + + $self->tables_do(sub { $_[0]->update; }); + + $self; +} + +=head2 $f->dirty + +Dirties all the tables in the font + +=cut + +sub dirty +{ $_[0]->tables_do(sub { $_[0]->dirty; }); $_[0]; } + +=head2 $f->tables_do(&func [, tables]) + +Calls &func for each table in the font. Calls the table in alphabetical sort +order as per the order in the directory: + + &func($table, $name); + +May optionally take a list of table names in which case func is called +for each of them in the given order. +=cut + +sub tables_do +{ + my ($self, $func, @tables) = @_; + my ($t); + + foreach $t (@tables ? @tables : sort grep {length($_) == 4} keys %$self) + { &$func($self->{$t}, $t); } + $self; +} + + +=head2 $f->release + +Releases ALL of the memory used by the TTF font and all of its component +objects. After calling this method, do B expect to have anything left in +the C object. + +B, that it is important that you call this method on any +C object when you wish to destruct it and free up its memory. +Internally, we track things in a structure that can result in circular +references, and without calling 'C' these will not properly get +cleaned up by Perl. Once you've called this method, though, don't expect to be +able to do anything else with the C object; it'll have B +internal state whatsoever. + +B As part of the brute-force cleanup done here, this method +will throw a warning message whenever unexpected key values are found within +the C object. This is done to help ensure that any unexpected +and unfreed values are brought to your attention so that you can bug us to keep +the module updated properly; otherwise the potential for memory leaks due to +dangling circular references will exist. + +=cut + +sub release +{ + my ($self) = @_; + +# delete stuff that we know we can, here + + my @tofree = map { delete $self->{$_} } keys %{$self}; + + while (my $item = shift @tofree) + { + my $ref = ref($item); + if (UNIVERSAL::can($item, 'release')) + { $item->release(); } + elsif ($ref eq 'ARRAY') + { push( @tofree, @{$item} ); } + elsif (UNIVERSAL::isa($ref, 'HASH')) + { release($item); } + } + +# check that everything has gone - it better had! + foreach my $key (keys %{$self}) + { warn ref($self) . " still has '$key' key left after release.\n"; } +} + +1; + +=head1 BUGS + +Bugs abound aplenty I am sure. There is a lot of code here and plenty of scope. +The parts of the code which haven't been implemented yet are: + +=over 4 + +=item Post + +Version 4 format types are not supported yet. + +=item Cmap + +Format type 2 (MBCS) has not been implemented yet and therefore may cause +somewhat spurious results for this table type. + +=item Kern + +Only type 0 & type 2 tables are supported (type 1 & type 3 yet to come). + +=item TTC + +The current Font::TTF::Font::out method does not support the writing of TrueType +Collections. + +=back + +In addition there are weaknesses or features of this module library + +=over 4 + +=item * + +There is very little (or no) error reporting. This means that if you have +garbled data or garbled data structures, then you are liable to generate duff +fonts. + +=item * + +The exposing of the internal data structures everywhere means that doing +radical re-structuring is almost impossible. But it stop the code from becoming +ridiculously large. + +=back + +Apart from these, I try to keep the code in a state of "no known bugs", which +given the amount of testing this code has had, is not a guarantee of high +quality, yet. + +For more details see the appropriate class files. + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org + +Copyright Martin Hosken 1998. + +No warranty or expression of effectiveness, least of all regarding anyone's +safety, is implied in this software or documentation. + +=head2 Licensing + +The Perl TTF module is licensed under the Perl Artistic License. + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fpgm.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fpgm.pm new file mode 100644 index 0000000..4cc7709 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Fpgm.pm @@ -0,0 +1,87 @@ +package Font::TTF::Fpgm; + +=head1 NAME + +Font::TTF::Fpgm - Font program in a TrueType font. Called when a font is loaded + +=head1 DESCRIPTION + +This is a minimal class adding nothing beyond a table, but is a repository +for fpgm type information for those processes brave enough to address hinting. + +=cut + +use strict; +use vars qw(@ISA $VERSION); + +@ISA = qw(Font::TTF::Table); + +$VERSION = 0.0001; + +=head2 $t->read + +Reading this table is simply a process of reading all the data into the RAM +copy. Nothing more is done with it. + +=cut + +sub read +{ + $_[0]->read_dat; + $_[0]->{' read'} = 1; +} + +=head2 $t->out_xml($context, $depth) + +Outputs Fpgm program as XML + +=cut + +sub out_xml +{ + my ($self, $context, $depth) = @_; + my ($fh) = $context->{'fh'}; + my ($dat); + + $self->read; + $dat = Font::TTF::Utils::XML_binhint($self->{' dat'}); + $dat =~ s/\n(?!$)/\n$depth$context->{'indent'}/omg; + $fh->print("$depth\n"); + $fh->print("$depth$context->{'indent'}$dat"); + $fh->print("$depth\n"); + $self; +} + + +=head2 $t->XML_end($context, $tag, %attrs) + +Parse all that hinting code + +=cut + +sub XML_end +{ + my ($self) = shift; + my ($context, $tag, %attrs) = @_; + + if ($tag eq 'code') + { + $self->{' dat'} = Font::TTF::Utils::XML_hintbin($context->{'text'}); + return $context; + } else + { return $self->SUPER::XML_end(@_); } +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GDEF.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GDEF.pm new file mode 100644 index 0000000..9519ee8 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GDEF.pm @@ -0,0 +1,313 @@ +package Font::TTF::GDEF; + +=head1 NAME + +Font::TTF::GDEF - Opentype GDEF table support + +=head1 DESCRIPTION + +The GDEF table contains various global lists of information which are apparantly +used in other places in an OpenType renderer. But precisely where is open to +speculation... + +=head1 INSTANCE VARIABLES + +There are 4 tables in the GDEF table, each with their own structure: + +=over 4 + +=item GLYPH + +This is an L Class Definition table containing information +as to what type each glyph is. + +=item ATTACH + +The attach table consists of a coverage table and then attachment points for +each glyph in the coverage table: + +=over 8 + +=item COVERAGE + +This is a coverage table + +=item POINTS + +This is an array of point elements. Each element is an array of curve points +corresponding to the attachment points on that glyph. The order of the curve points +in the array corresponds to the attachment point number specified in the MARKS +coverage table (see below). + +=back + +=item LIG + +This contains the ligature caret positioning information for ligature glyphs + +=over 8 + +=item COVERAGE + +A coverage table to say which glyphs are ligatures + +=item LIGS + +An array of elements for each ligature. Each element is an array of information +for each caret position in the ligature (there being number of components - 1 of +these, generally) + +=over 12 + +=item FMT + +This is the format of the information and is important to provide the semantics +for the value. This value must be set correctly before output + +=item VAL + +The value which has meaning according to FMT + +=item DEVICE + +For FMT = 3, a device table is also referenced which is stored here + +=back + +=back + +=item MARKS + +Due to confusion in the GDEF specification, this field is currently withdrawn until +the confusion is resolved. That way, perhaps this stuff will work! + +This class definition table stores the mark attachment point numbers for each +attachment mark, to indicate which attachment point the mark attaches to on its +base glyph. + +=back + + +=head1 METHODS + +=cut + +use strict; +use Font::TTF::Table; +use Font::TTF::Utils; +use Font::TTF::Ttopen; +use vars qw(@ISA $new_gdef); + +@ISA = qw(Font::TTF::Table); +$new_gdef = 1; + +=head2 $t->read + +Reads the table into the data structure + +=cut + +sub read +{ + my ($self) = @_; + my ($fh) = $self->{' INFILE'}; + my ($boff) = $self->{' OFFSET'}; + my ($dat, $goff, $loff, $aoff, $moff, $r, $s, $bloc); + + $self->SUPER::read or return $self; + $bloc = $fh->tell(); + if ($new_gdef) + { + $fh->read($dat, 12); + ($self->{'Version'}, $goff, $aoff, $loff, $moff) = TTF_Unpack('fS4', $dat); + } + else + { + $fh->read($dat, 10); + ($self->{'Version'}, $goff, $aoff, $loff) = TTF_Unpack('fS3', $dat); + } + + if ($goff > 0) + { + $fh->seek($goff + $boff, 0); + $self->{'GLYPH'} = Font::TTF::Coverage->new(0)->read($fh); + } + + if ($new_gdef && $moff > 0 && $moff < $self->{' LENGTH'}) + { + $fh->seek($moff + $boff, 0); + $self->{'MARKS'} = Font::TTF::Coverage->new(0)->read($fh); + } + + if ($aoff > 0) + { + my ($off, $gcount, $pcount); + + $fh->seek($aoff + $boff, 0); + $fh->read($dat, 4); + ($off, $gcount) = TTF_Unpack('SS', $dat); + $fh->read($dat, $gcount << 1); + + $fh->seek($aoff + $boff + $off, 0); + $self->{'ATTACH'}{'COVERAGE'} = Font::TTF::Coverage->new(1)->read($fh); + + foreach $r (TTF_Unpack('S*', $dat)) + { + unless ($r) + { + push (@{$self->{'ATTACH'}{'POINTS'}}, []); + next; + } + $fh->seek($aoff + $boff + $r, 0); + $fh->read($dat, 2); + $pcount = TTF_Unpack('S', $dat); + $fh->read($dat, $pcount << 1); + push (@{$self->{'ATTACH'}{'POINTS'}}, [TTF_Unpack('S*', $dat)]); + } + } + + if ($loff > 0) + { + my ($lcount, $off, $ccount, $srec, $comp); + + $fh->seek($loff + $boff, 0); + $fh->read($dat, 4); + ($off, $lcount) = TTF_Unpack('SS', $dat); + $fh->read($dat, $lcount << 1); + + $fh->seek($off + $loff + $boff, 0); + $self->{'LIG'}{'COVERAGE'} = Font::TTF::Coverage->new(1)->read($fh); + + foreach $r (TTF_Unpack('S*', $dat)) + { + $fh->seek($r + $loff + $boff, 0); + $fh->read($dat, 2); + $ccount = TTF_Unpack('S', $dat); + $fh->read($dat, $ccount << 1); + + $srec = []; + foreach $s (TTF_Unpack('S*', $dat)) + { + $comp = {}; + $fh->seek($s + $r + $loff + $boff, 0); + $fh->read($dat, 4); + ($comp->{'FMT'}, $comp->{'VAL'}) = TTF_Unpack('S*', $dat); + if ($comp->{'FMT'} == 3) + { + $fh->read($dat, 2); + $off = TTF_Unpack('S', $dat); + if (defined $self->{' CACHE'}{$off + $s + $r}) + { $comp->{'DEVICE'} = $self->{' CACHE'}{$off + $s + $r}; } + else + { + $fh->seek($off + $s + $r + $loff + $boff, 0); + $comp->{'DEVICE'} = Font::TTF::Delta->new->read($fh); + $self->{' CACHE'}{$off + $s + $r} = $comp->{'DEVICE'}; + } + } + push (@$srec, $comp); + } + push (@{$self->{'LIG'}{'LIGS'}}, $srec); + } + } + + $self; +} + + +=head2 $t->out($fh) + +Writes out this table. + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($goff, $aoff, $loff, $moff, @offs, $loc1, $coff, $loc); + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $loc = $fh->tell(); + if ($new_gdef) + { $fh->print(TTF_Pack('fSSSS', $self->{'Version'}, 0, 0, 0, 0)); } + else + { $fh->print(TTF_Pack('fSSS', $self->{'Version'}, 0, 0, 0)); } + + if (defined $self->{'GLYPH'}) + { + $goff = $fh->tell() - $loc; + $self->{'GLYPH'}->out($fh); + } + + if (defined $self->{'ATTACH'}) + { + my ($r); + + $aoff = $fh->tell() - $loc; + $fh->print(pack('n*', (0) x ($#{$self->{'ATTACH'}{'POINTS'}} + 3))); + foreach $r (@{$self->{'ATTACH'}{'POINTS'}}) + { + push (@offs, $fh->tell() - $loc - $aoff); + $fh->print(pack('n*', $#{$r} + 1, @$r)); + } + $coff = $fh->tell() - $loc - $aoff; + $self->{'ATTACH'}{'COVERAGE'}->out($fh); + $loc1 = $fh->tell(); + $fh->seek($aoff + $loc, 0); + $fh->print(pack('n*', $coff, $#offs + 1, @offs)); + $fh->seek($loc1, 0); + } + + if (defined $self->{'LIG'}) + { + my (@reftables, $ltables, $i, $j, $out, $r, $s); + + $ltables = {}; + $loff = $fh->tell() - $loc; + $out = pack('n*', + Font::TTF::Ttopen::ref_cache($self->{'LIG'}{'COVERAGE'}, $ltables, 0), + $#{$self->{'LIG'}{'LIGS'}} + 1, + (0) x ($#{$self->{'LIG'}{'LIGS'}} + 1)); + push (@reftables, [$ltables, 0]); + $i = 0; + foreach $r (@{$self->{'LIG'}{'LIGS'}}) + { + $ltables = {}; + $loc1 = length($out); + substr($out, ($i << 1) + 4, 2) = TTF_Pack('S', $loc1); + $out .= pack('n*', $#{$r} + 1, (0) x ($#{$r} + 1)); + @offs = (); $j = 0; + foreach $s (@$r) + { + substr($out, ($j << 1) + 2 + $loc1, 2) = + TTF_Pack('S', length($out) - $loc1); + $out .= TTF_Pack('SS', $s->{'FMT'}, $s->{'VAL'}); + $out .= pack('n', Font::TTF::Ttopen::ref_cache($s->{'DEVICE'}, + $ltables, length($out))) if ($s->{'FMT'} == 3); + $j++; + } + push (@reftables, [$ltables, $loc1]); + $i++; + } + Font::TTF::Ttopen::out_final($fh, $out, \@reftables); + } + + if ($new_gdef && defined $self->{'MARKS'}) + { + $moff = $fh->tell() - $loc; + $self->{'MARKS'}->out($fh); + } + + $loc1 = $fh->tell(); + $fh->seek($loc + 4, 0); + if ($new_gdef) + { $fh->print(TTF_Pack('S4', $goff, $aoff, $loff, $moff)); } + else + { $fh->print(TTF_Pack('S3', $goff, $aoff, $loff)); } + $fh->seek($loc1, 0); + $self; +} + +1; + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GPOS.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GPOS.pm new file mode 100644 index 0000000..8e8b7ce --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GPOS.pm @@ -0,0 +1,701 @@ +package Font::TTF::GPOS; + +=head1 NAME + +Font::TTF::GPOS - Support for Opentype GPOS tables in conjunction with TTOpen + +=head1 DESCRIPTION + +The GPOS table is one of the most complicated tables in the TTF spec and the +corresponding data structure abstraction is also not trivial. While much of the +structure of a GPOS is shared with a GSUB table via the L + +=head1 INSTANCE VARIABLES + +Here we describe the additions and lookup specific information for GPOS tables. +Unfortunately there is no one abstraction which seems to work comfortable for +all GPOS tables, so we will also examine how the variables are used for different +lookup types. + +The following are the values allowed in the ACTION_TYPE and MATCH_TYPE variables: + +=over 4 + +=item ACTION_TYPE + +This can take any of the following values + +=over 8 + +=item a + +The ACTION is an array of anchor tables + +=item o + +Offset. There is no RULE array. The ADJUST variable contains a value record (see +later in this description) + +=item v + +The ACTION is a value record. + +=item p + +Pair adjustment. The ACTION contains an array of two value records for the matched +two glyphs. + +=item e + +Exit and Entry records. The ACTION contains an array of two anchors corresponding +to the exit and entry anchors for the glyph. + +=item l + +Indicates a lookup based contextual rule as per the GSUB table. + +=back + +=item MATCH_TYPE + +This can take any of the following values + +=over 8 + +=item g + +A glyph array + +=item c + +An array of class values + +=item o + +An array of coverage tables + +=back + +=back + +The following variables are added for Attachment Positioning Subtables: + +=over 4 + +=item MATCH + +This contains an array of glyphs to match against for all RULES. It is much like +having the same MATCH string in all RULES. In the cases it is used so far, it only +ever contains one element. + +=item MARKS + +This contains a Mark array consisting of each element being a subarray of two +elements: + +=over 8 + +=item CLASS + +The class that this mark uses on its base + +=item ANCHOR + +The anchor with which to attach this mark glyph + +=back + +The base table for mark to base, ligature or mark attachment positioning is +structured with the ACTION containing an array of anchors corresponding to each +attachment class. For ligatures, there is more than one RULE in the RULE array +corresponding to each glyph in the coverage table. + +=back + +Other variables which are provided for informational purposes are: + +=over 4 + +=item VFMT + +Value format for the adjustment of the glyph matched by the coverage table. + +=item VFMT2 + +Value format used in pair adjustment for the second glyph in the pair + +=back + +=head2 Value Records + +There is a subtype used in GPOS tables called a value record. It is used to adjust +the position of a glyph from its default position. The value record is variable +length with a bitfield at the beginning to indicate which of the following +entries are included. The bitfield is not stored since it is recalculated at +write time. + +=over 4 + +=item XPlacement + +Horizontal adjustment for placement (not affecting other unattached glyphs) + +=item YPlacement + +Vertical adjustment for placement (not affecting other unattached glyphs) + +=item XAdvance + +Adjust the advance width glyph (used only in horizontal writing systems) + +=item YAdvance + +Adjust the vertical advance (used only in vertical writing systems) + +=item XPlaDevice + +Device table for device specific adjustment of horizontal placement + +=item YPlaDevice + +Device table for device specific adjustment of vertical placement + +=item XAdvDevice + +Device table for device specific adjustment of horizontal advance + +=item YAdDevice + +Device table for device specific adjustment of vertical advance + +=item XIdPlacement + +Horizontal placement metric id (for Multiple Master fonts - but that's all I know!) + +=item YIdPlacement + +Vertical placement metric id + +=item XIdAdvance + +Horizontal advance metric id + +=item YIdAdvance + +Vertical advance metric id + +=back + +=head1 CORRESPONDANCE TO LAYOUT TYPES + +Here is what is stored in the ACTION_TYPE and MATCH_TYPE for each of the known +GPOS subtable types: + + 1.1 1.2 2.1 2.2 3 4 5 6 7.1 7.2 7.3 8.1 8.2 8.3 + ACTION_TYPE o v p p e a a a l l l l l l + MATCH_TYPE g c g c o g c o + + +=head1 METHODS + +=cut + +use strict; +use Font::TTF::Ttopen; +use Font::TTF::Delta; +use Font::TTF::Anchor; +use Font::TTF::Utils; +use vars qw(@ISA); + +@ISA = qw(Font::TTF::Ttopen); + + +=head2 read_sub + +Reads the subtable into the data structures + +=cut + +sub read_sub +{ + my ($self, $fh, $main_lookup, $sindex) = @_; + my ($type) = $main_lookup->{'TYPE'}; + my ($loc) = $fh->tell(); + my ($lookup) = $main_lookup->{'SUB'}[$sindex]; + my ($dat, $mcount, $scount, $i, $j, $count, $fmt, $fmt2, $cover, $srec, $subst); + my ($c1, $c2, $s, $moff, $boff); + + + if ($type == 8) + { + $fh->read($dat, 4); + ($fmt, $cover) = TTF_Unpack('S2', $dat); + if ($fmt < 3) + { + $fh->read($dat, 2); + $count = TTF_Unpack('S', $dat); + } + } else + { + $fh->read($dat, 6); + ($fmt, $cover, $count) = TTF_Unpack("S3", $dat); + } + unless ($fmt == 3 && ($type == 7 || $type == 8)) + { $lookup->{'COVERAGE'} = $self->read_cover($cover, $loc, $lookup, $fh, 1); } + + $lookup->{'FORMAT'} = $fmt; + if ($type == 1 && $fmt == 1) + { + $lookup->{'VFMT'} = $count; + $lookup->{'ADJUST'} = $self->read_value($count, $loc, $lookup, $fh); + $lookup->{'ACTION_TYPE'} = 'o'; + } elsif ($type == 1 && $fmt == 2) + { + $lookup->{'VFMT'} = $count; + $fh->read($dat, 2); + $mcount = unpack('n', $dat); + for ($i = 0; $i < $mcount; $i++) + { push (@{$lookup->{'RULES'}}, [{'ACTION' => + [$self->read_value($count, $loc, $lookup, $fh)]}]); } + $lookup->{'ACTION_TYPE'} = 'v'; + } elsif ($type == 2 && $fmt == 1) + { + $lookup->{'VFMT'} = $count; + $fh->read($dat, 4); + ($fmt2, $mcount) = unpack('n2', $dat); + $lookup->{'VFMT2'} = $fmt2; + $fh->read($dat, $mcount << 1); + foreach $s (unpack('n*', $dat)) + { + $fh->seek($loc + $s, 0); + $fh->read($dat, 2); + $scount = TTF_Unpack('S', $dat); + $subst = []; + for ($i = 0; $i < $scount; $i++) + { + $srec = {}; + $fh->read($dat, 2); + $srec->{'MATCH'} = [TTF_Unpack('S', $dat)]; + $srec->{'ACTION'} = [$self->read_value($count, $loc, $lookup, $fh), + $self->read_value($fmt2, $loc, $lookup, $fh)]; + push (@$subst, $srec); + } + push (@{$lookup->{'RULES'}}, $subst); + } + $lookup->{'ACTION_TYPE'} = 'p'; + $lookup->{'MATCH_TYPE'} = 'g'; + } elsif ($type == 2 && $fmt == 2) + { + $fh->read($dat, 10); + ($lookup->{'VFMT2'}, $c1, $c2, $mcount, $scount) = TTF_Unpack('S*', $dat); + $lookup->{'CLASS'} = $self->read_cover($c1, $loc, $lookup, $fh, 0); + $lookup->{'MATCH'} = [$self->read_cover($c2, $loc, $lookup, $fh, 0)]; + $lookup->{'VFMT'} = $count; + for ($i = 0; $i < $mcount; $i++) + { + $subst = []; + for ($j = 0; $j < $scount; $j++) + { + $srec = {}; + $srec->{'ACTION'} = [$self->read_value($lookup->{'VFMT'}, $loc, $lookup, $fh), + $self->read_value($lookup->{'VFMT2'}, $loc, $lookup, $fh)]; + push (@$subst, $srec); + } + push (@{$lookup->{'RULES'}}, $subst); + } + $lookup->{'ACTION_TYPE'} = 'p'; + $lookup->{'MATCH_TYPE'} = 'c'; + } elsif ($type == 3 && $fmt == 1) + { + $fh->read($dat, $count << 2); + for ($i = 0; $i < $count; $i++) + { push (@{$lookup->{'RULES'}}, [{'ACTION' => + [$self->read_anchor(TTF_Unpack('S', substr($dat, $i << 2, 2)), + $loc, $lookup, $fh), + $self->read_anchor(TTF_Unpack('S', substr($dat, ($i << 2) + 2, 2)), + $loc, $lookup, $fh)]}]); } + $lookup->{'ACTION_TYPE'} = 'e'; + } elsif ($type == 4 || $type == 5 || $type == 6) + { + my (@offs, $mloc, $thisloc, $ncomp, $k); + + $lookup->{'MATCH'} = [$lookup->{'COVERAGE'}]; + $lookup->{'COVERAGE'} = $self->read_cover($count, $loc, $lookup, $fh, 1); + $fh->read($dat, 6); + ($mcount, $moff, $boff) = TTF_Unpack('S*', $dat); + $fh->seek($loc + $moff, 0); + $fh->read($dat, 2); + $count = TTF_Unpack('S', $dat); + for ($i = 0; $i < $count; $i++) + { + $fh->read($dat, 4); + push (@{$lookup->{'MARKS'}}, [TTF_Unpack('S', $dat), + $self->read_anchor(TTF_Unpack('S', substr($dat, 2, 2)) + $moff, + $loc, $lookup, $fh)]); + } + $fh->seek($loc + $boff, 0); + $fh->read($dat, 2); + $count = TTF_Unpack('S', $dat); + $mloc = $fh->tell() - 2; + $thisloc = $mloc; + if ($type == 5) + { + $fh->read($dat, $count << 1); + @offs = TTF_Unpack('S*', $dat); + } + for ($i = 0; $i < $count; $i++) + { + if ($type == 5) + { + $thisloc = $mloc + $offs[$i]; + $fh->seek($thisloc, 0); + $fh->read($dat, 2); + $ncomp = TTF_Unpack('S', $dat); + } else + { $ncomp = 1; } + for ($j = 0; $j < $ncomp; $j++) + { + $subst = []; + $fh->read($dat, $mcount << 1); + for ($k = 0; $k < $mcount; $k++) + { push (@$subst, $self->read_anchor(TTF_Unpack('S', substr($dat, $k << 1, 2)) + $thisloc - $loc, + $loc, $lookup, $fh)); } + + push (@{$lookup->{'RULES'}[$i]}, {'ACTION' => $subst}); + } + } + $lookup->{'ACTION_TYPE'} = 'a'; + } elsif ($type == 7 || $type == 8) + { $self->read_context($lookup, $fh, $type - 2, $fmt, $cover, $count, $loc); } + $lookup; +} + + +=head2 $t->extension + +Returns the table type number for the extension table + +=cut + +sub extension +{ return 9; } + + +=head2 $t->out_sub + +Outputs the subtable to the given filehandle + +=cut + +sub out_sub +{ + my ($self, $fh, $main_lookup, $index, $ctables, $base) = @_; + my ($type) = $main_lookup->{'TYPE'}; + my ($lookup) = $main_lookup->{'SUB'}[$index]; + my ($fmt) = $lookup->{'FORMAT'}; + my ($out, $r, $s, $t, $i, $j, $vfmt, $vfmt2, $loc1); + my ($num) = $#{$lookup->{'RULES'}} + 1; + my ($mtables) = {}; + my (@reftables); + + if ($type == 1 && $fmt == 1) + { + $out = pack('n2', $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base)); + $vfmt = $self->fmt_value($lookup->{'ADJUST'}); + $out .= pack('n', $vfmt) . $self->out_value($lookup->{'ADJUST'}, $vfmt, $ctables, 6 + $base); + } elsif ($type == 1 && $fmt == 2) + { + $vfmt = 0; + foreach $r (@{$lookup->{'RULES'}}) + { $vfmt |= $self->fmt_value($r->[0]{'ACTION'}[0]); } + $out = pack('n4', $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), + $vfmt, $#{$lookup->{'RULES'}} + 1); + foreach $r (@{$lookup->{'RULES'}}) + { $out .= $self->out_value($r->[0]{'ACTION'}[0], $vfmt, $ctables, length($out) + $base); } + } elsif ($type == 2 && $fmt < 3) + { + $vfmt = 0; + $vfmt2 = 0; + foreach $r (@{$lookup->{'RULES'}}) + { + foreach $t (@$r) + { + $vfmt |= $self->fmt_value($t->{'ACTION'}[0]); + $vfmt2 |= $self->fmt_value($t->{'ACTION'}[1]); + } + } + if ($fmt == 1) + { + # start PairPosFormat1 subtable + $out = pack('n5', + $fmt, + Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), + $vfmt, + $vfmt2, + $#{$lookup->{'RULES'}} + 1); # PairSetCount + my $off = 0; + $off += length($out); + $off += 2 * ($#{$lookup->{'RULES'}} + 1); # there will be PairSetCount offsets here + my $pairsets = ''; + my (%cache); + foreach $r (@{$lookup->{'RULES'}}) # foreach PairSet table + { + # write offset to this PairSet at end of PairPosFormat1 table + if (defined $cache{"$r"}) + { $out .= pack('n', $cache{"$r"}); } + else + { + $out .= pack('n', $off); + $cache{"$r"} = $off; + + # generate PairSet itself (using $off as eventual offset within PairPos subtable) + my $pairset = pack('n', $#{$r} + 1); # PairValueCount + foreach $t (@$r) # foreach PairValueRecord + { + $pairset .= pack('n', $t->{'MATCH'}[0]); # SecondGlyph - MATCH has only one entry + $pairset .= + $self->out_value($t->{'ACTION'}[0], $vfmt, $ctables, $off + length($pairset) + $base); + $pairset .= + $self->out_value($t->{'ACTION'}[1], $vfmt2, $ctables, $off + length($pairset) + $base); + } + $off += length($pairset); + $pairsets .= $pairset; + } + } + $out .= $pairsets; + die "internal error: PairPos size not as calculated" if (length($out) != $off); + } else + { + $out = pack('n8', $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), + $vfmt, $vfmt2, + Font::TTF::Ttopen::ref_cache($lookup->{'CLASS'}, $ctables, 8 + $base), + Font::TTF::Ttopen::ref_cache($lookup->{'MATCH'}[0], $ctables, 10 + $base), + $lookup->{'CLASS'}{'max'} + 1, $lookup->{'MATCH'}[0]{'max'} + 1); + + for ($i = 0; $i <= $lookup->{'CLASS'}{'max'}; $i++) + { + for ($j = 0; $j <= $lookup->{'MATCH'}[0]{'max'}; $j++) + { + $out .= $self->out_value($lookup->{'RULES'}[$i][$j]{'ACTION'}[0], $vfmt, $ctables, length($out) + $base); + $out .= $self->out_value($lookup->{'RULES'}[$i][$j]{'ACTION'}[1], $vfmt2, $ctables, length($out) + $base); + } + } + } + } elsif ($type == 3 && $fmt == 1) + { + $out = pack('n3', $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), + $#{$lookup->{'RULES'}} + 1); + foreach $r (@{$lookup->{'RULES'}}) + { + $out .= pack('n2', Font::TTF::Ttopen::ref_cache($r->[0]{'ACTION'}[0], $ctables, length($out) + $base), + Font::TTF::Ttopen::ref_cache($r->[0]{'ACTION'}[1], $ctables, length($out) + 2 + $base)); + } + } elsif ($type == 4 || $type == 5 || $type == 6) + { + my ($loc_off, $loc_t, $ltables); + + $out = pack('n7', $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'MATCH'}[0], $ctables, 2 + $base), + Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 4 + $base), + $#{$lookup->{'RULES'}[0][0]{'ACTION'}} + 1, 12, ($#{$lookup->{'MARKS'}} + 4) << 2, + $#{$lookup->{'MARKS'}} + 1); + foreach $r (@{$lookup->{'MARKS'}}) + { $out .= pack('n2', $r->[0], Font::TTF::Ttopen::ref_cache($r->[1], $mtables, length($out) + 2)); } + push (@reftables, [$mtables, 12]); + + $loc_t = length($out); + substr($out, 10, 2) = pack('n', $loc_t); + $out .= pack('n', $#{$lookup->{'RULES'}} + 1); + if ($type == 5) + { + $loc1 = length($out); + $out .= pack('n*', (0) x ($#{$lookup->{'RULES'}} + 1)); + } + $ltables = {}; + for ($i = 0; $i <= $#{$lookup->{'RULES'}}; $i++) + { + if ($type == 5) + { + $ltables = {}; + $loc_t = length($out); + substr($out, $loc1 + ($i << 1), 2) = TTF_Pack('S', $loc_t - $loc1 + 2); + } + + $r = $lookup->{'RULES'}[$i]; + $out .= pack('n', $#{$r} + 1) if ($type == 5); + foreach $t (@$r) + { + foreach $s (@{$t->{'ACTION'}}) + { $out .= pack('n', Font::TTF::Ttopen::ref_cache($s, $ltables, length($out))); } + } + push (@reftables, [$ltables, $loc_t]) if ($type == 5); + } + push (@reftables, [$ltables, $loc_t]) unless ($type == 5); + $out = Font::TTF::Ttopen::out_final($fh, $out, \@reftables, 1); + } elsif ($type == 7 || $type == 8) + { $out = $self->out_context($lookup, $fh, $type - 2, $fmt, $ctables, $out, $num, $base); } +# push (@reftables, [$ctables, 0]); + $out; +} + + +=head2 $t->read_value($format, $base, $lookup, $fh) + +Reads a value record from the current location in the file, according to the +format given. + +=cut + +sub read_value +{ + my ($self, $fmt, $base, $lookup, $fh) = @_; + my ($flag) = 1; + my ($res) = {}; + my ($s, $i, $dat); + + $s = 0; + for ($i = 0; $i < 12; $i++) + { + $s++ if ($flag & $fmt); + $flag <<= 1; + } + + $fh->read($dat, $s << 1); + $flag = 1; $i = 0; + foreach $s (qw(XPlacement YPlacement XAdvance YAdvance)) + { + $res->{$s} = TTF_Unpack('s', substr($dat, $i++ << 1, 2)) if ($fmt & $flag); + $flag <<= 1; + } + + foreach $s (qw(XPlaDevice YPlaDevice XAdvDevice YAdvDevice)) + { + if ($fmt & $flag) + { $res->{$s} = $self->read_delta(TTF_Unpack('S', substr($i++ << 1, 2)), + $base, $lookup, $fh); } + $flag <<= 1; + } + + foreach $s (qw(XIdPlacement YIdPlacement XIdAdvance YIdAdvance)) + { + $res->{$s} = TTF_Unpack('S', substr($dat, $i++ << 1, 2)) if ($fmt & $flag); + $flag <<= 1; + } + $res; +} + + +=head2 $t->read_delta($offset, $base, $lookup, $fh) + +Reads a delta (device table) at the given offset if it hasn't already been read. +Store the offset and item in the lookup cache ($lookup->{' CACHE'}) + +=cut + +sub read_delta +{ + my ($self, $offset, $base, $lookup, $fh) = @_; + my ($loc) = $fh->tell(); + my ($res, $str); + + return undef unless $offset; + $str = sprintf("%X", $base + $offset); + return $lookup->{' CACHE'}{$str} if defined $lookup->{' CACHE'}{$str}; + $fh->seek($base + $offset, 0); + $res = Font::TTF::Delta->new->read($fh); + $fh->seek($loc, 0); + $lookup->{' CACHE'}{$str} = $res; + return $res; +} + + +=head2 $t->read_anchor($offset, $base, $lookup, $fh) + +Reads an Anchor table at the given offset if it hasn't already been read. + +=cut + +sub read_anchor +{ + my ($self, $offset, $base, $lookup, $fh) = @_; + my ($loc) = $fh->tell(); + my ($res, $str); + + return undef unless $offset; + $str = sprintf("%X", $base + $offset); + return $lookup->{' CACHE'}{$str} if defined $lookup->{' CACHE'}{$str}; + $fh->seek($base + $offset, 0); + $res = Font::TTF::Anchor->new->read($fh); + $fh->seek($loc, 0); + $lookup->{' CACHE'}{$str} = $res; + return $res; +} + + +=head2 $t->fmt_value + +Returns the value format for a given value record + +=cut + +sub fmt_value +{ + my ($self, $value) = @_; + my ($fmt) = 0; + my ($n); + + foreach $n (reverse qw(XPlacement YPlacement XAdvance YAdvance XPlaDevice YPlaDevice + XAdvDevice YAdvDevice XIdPlacement YIdPlacement XIdAdvance + YIdAdvance)) + { + $fmt <<= 1; + $fmt |= 1 if (defined $value->{$n} && (ref $value->{$n} || $value->{$n})); + } + $fmt; +} + + +=head2 $t->out_value + +Returns the output string for the outputting of the value for a given format. Also +updates the offset cache for any device tables referenced. + +=cut + +sub out_value +{ + my ($self, $value, $fmt, $tables, $offset) = @_; + my ($n, $flag, $out); + + $flag = 1; + foreach $n (qw(XPlacement YPlacement XAdvance YAdvance)) + { + $out .= pack('n', $value->{$n}) if ($flag & $fmt); + $flag <<= 1; + } + foreach $n (qw(XPlaDevice YPlaDevice XAdvDevice YAdvDevice)) + { + if ($flag & $fmt) + { + $out .= pack('n', Font::TTF::Ttopen::ref_cache( + $value->{$n}, $tables, $offset + length($out))); + } + $flag <<= 1; + } + foreach $n (qw(XIdPlacement YIdPlacement XIdAdvance YIdAdvance)) + { + $out .= pack('n', $value->{$n}) if ($flag & $fmt); + $flag <<= 1; + } + $out; +} + + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + +1; + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GSUB.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GSUB.pm new file mode 100644 index 0000000..abf0f13 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GSUB.pm @@ -0,0 +1,246 @@ +package Font::TTF::GSUB; + +=head1 NAME + +Font::TTF::GSUB - Module support for the GSUB table in conjunction with TTOpen + +=head1 DESCRIPTION + +Handles the GSUB subtables in relation to Ttopen tables. Due to the variety of +different lookup types, the data structures are not all that straightforward, +although I have tried to make life easy for myself when using this! + +=head1 INSTANCE VARIABLES + +The structure of a GSUB table is the same as that given in L. +Here we give some of the semantics specific to GSUB lookups. + +=over 4 + +=item ACTION_TYPE + +This is a string taking one of 4 values indicating the nature of the information +in the ACTION array of the rule: + +=over 8 + +=item g + +The action contains a string of glyphs to replace the match string by + +=item l + +The action array contains a list of lookups and offsets to run, in order, on +the matched string + +=item a + +The action array is an unordered set of optional replacements for the matched +glyph. The application should make the selection somehow. + +=item o + +The action array is empty (in fact there is no rule array for this type of +rule) and the ADJUST value should be added to the glyph id to find the replacement +glyph id value + +=back + +=item MATCH_TYPE + +This indicates which type of information the various MATCH arrays (MATCH, PRE, +POST) hold in the rule: + +=over 8 + +=item g + +The array holds a string of glyph ids which should match exactly + +=item c + +The array holds a sequence of class definitions which each glyph should +correspondingly match to + +=item o + +The array holds offsets to coverage tables + +=back + +=back + +=head1 CORRESPONDANCE TO LAYOUT TYPES + +The following table gives the values for ACTION_TYPE and MATCH_TYPE for each +of the 11 different lookup types found in the GSUB table definition I have: + + 1.1 1.2 2 3 4 5.1 5.2 5.3 6.1 6.2 6.3 + ACTION_TYPE o g g a g l l l l l l + MATCH_TYPE g g c o g c o + +Hopefully, the rest of the uses of the variables should make sense from this +table. + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::Ttopen; + +@ISA = qw(Font::TTF::Ttopen); + +=head2 $t->read_sub($fh, $lookup, $index) + +Asked by the superclass to read in from the given file the indexth subtable from +lookup number lookup. The file is positioned ready for the read. + +=cut + +sub read_sub +{ + my ($self, $fh, $main_lookup, $sindex) = @_; + my ($type) = $main_lookup->{'TYPE'}; + my ($loc) = $fh->tell(); + my ($lookup) = $main_lookup->{'SUB'}[$sindex]; + my ($dat, $s, @subst, $t, $fmt, $cover, $count, $mcount, $scount, $i, $gid); + my (@srec); + + if ($type == 6) + { + $fh->read($dat, 4); + ($fmt, $cover) = TTF_Unpack('S2', $dat); + if ($fmt < 3) + { + $fh->read($dat, 2); + $count = TTF_Unpack('S', $dat); + } + } else + { + $fh->read($dat, 6); + ($fmt, $cover, $count) = TTF_Unpack("S3", $dat); + } + unless ($fmt == 3 && ($type == 5 || $type == 6)) + { $lookup->{'COVERAGE'} = $self->read_cover($cover, $loc, $lookup, $fh, 1); } + + $lookup->{'FORMAT'} = $fmt; + if ($type == 1 && $fmt == 1) + { + $count -= 65536 if ($count > 32767); + $lookup->{'ADJUST'} = $count; + $lookup->{'ACTION_TYPE'} = 'o'; + } elsif ($type == 1 && $fmt == 2) + { + $fh->read($dat, $count << 1); + @subst = TTF_Unpack('S*', $dat); + foreach $s (@subst) + { push(@{$lookup->{'RULES'}}, [{'ACTION' => [$s]}]); } + $lookup->{'ACTION_TYPE'} = 'g'; + } elsif ($type == 2 || $type == 3) + { + $fh->read($dat, $count << 1); # number of offsets + foreach $s (TTF_Unpack('S*', $dat)) + { + $fh->seek($loc + $s, 0); + $fh->read($dat, 2); + $t = TTF_Unpack('S', $dat); + $fh->read($dat, $t << 1); + push(@{$lookup->{'RULES'}}, [{'ACTION' => [TTF_Unpack('S*', $dat)]}]); + } + $lookup->{'ACTION_TYPE'} = ($type == 2 ? 'g' : 'a'); + } elsif ($type == 4) + { + $fh->read($dat, $count << 1); + foreach $s (TTF_Unpack('S*', $dat)) + { + @subst = (); + $fh->seek($loc + $s, 0); + $fh->read($dat, 2); + $t = TTF_Unpack('S', $dat); + $fh->read($dat, $t << 1); + foreach $t (TTF_Unpack('S*', $dat)) + { + $fh->seek($loc + $s + $t, 0); + $fh->read($dat, 4); + ($gid, $mcount) = TTF_Unpack('S2', $dat); + $fh->read($dat, ($mcount - 1) << 1); + push(@subst, {'ACTION' => [$gid], 'MATCH' => [TTF_Unpack('S*', $dat)]}); + } + push(@{$lookup->{'RULES'}}, [@subst]); + } + $lookup->{'ACTION_TYPE'} = 'g'; + $lookup->{'MATCH_TYPE'} = 'g'; + } elsif ($type == 5 || $type == 6) + { $self->read_context($lookup, $fh, $type, $fmt, $cover, $count, $loc); } + $lookup; +} + + +=head2 $t->extension + +Returns the table type number for the extension table + +=cut + +sub extension +{ return 7; } + + +=head2 $t->out_sub($fh, $lookup, $index) + +Passed the filehandle to output to, suitably positioned, the lookup and subtable +index, this function outputs the subtable to $fh at that point. + +=cut + +sub out_sub +{ + my ($self, $fh, $main_lookup, $index, $ctables, $base) = @_; + my ($type) = $main_lookup->{'TYPE'}; + my ($lookup) = $main_lookup->{'SUB'}[$index]; + my ($fmt) = $lookup->{'FORMAT'}; + my ($out, $r, $t, $i, $j, $offc, $offd, $numd); + my ($num) = $#{$lookup->{'RULES'}} + 1; + + if ($type == 1) + { + $out = pack("nn", $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base)); + if ($fmt == 1) + { $out .= pack("n", $lookup->{'ADJUST'}); } + else + { + $out .= pack("n", $num); + foreach $r (@{$lookup->{'RULES'}}) + { $out .= pack("n", $r->[0]{'ACTION'}[0]); } + } + } elsif ($type == 2 || $type == 3) + { + $out = pack("nnn", $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), + $num); + $out .= pack('n*', (0) x $num); + $offc = length($out); + for ($i = 0; $i < $num; $i++) + { + $out .= pack("n*", $#{$lookup->{'RULES'}[$i][0]{'ACTION'}} + 1, + @{$lookup->{'RULES'}[$i][0]{'ACTION'}}); + substr($out, ($i << 1) + 6, 2) = pack('n', $offc); + $offc = length($out); + } + } elsif ($type == 4 || $type == 5 || $type == 6) + { $out = $self->out_context($lookup, $fh, $type, $fmt, $ctables, $out, $num, $base); } +# Font::TTF::Ttopen::out_final($fh, $out, [[$ctables, 0]]); + $out; +} + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + +1; + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Glyf.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Glyf.pm new file mode 100644 index 0000000..e0268f3 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Glyf.pm @@ -0,0 +1,158 @@ +package Font::TTF::Glyf; + +=head1 NAME + +Font::TTF::Glyf - The Glyf data table + +=head1 DESCRIPTION + +This is a stub table. The real data is held in the loca table. If you want to get a glyf +look it up in the loca table as C<$f->{'loca'}{'glyphs'}[$num]>. It won't be here! + +The difference between reading this table as opposed to the loca table is that +reading this table will cause updated glyphs to be written out rather than just +copying the glyph information from the input file. This causes font writing to be +slower. So read the glyf as opposed to the loca table if you want to change glyf +data. Read the loca table only if you are just wanting to read the glyf information. + +This class is used when writing the glyphs though. + +=head1 METHODS + +=cut + + +use strict; +use vars qw(@ISA); +@ISA = qw(Font::TTF::Table); + +=head2 $t->read + +Reads the C table instead! + +=cut + +sub read +{ + my ($self) = @_; + + $self->{' PARENT'}{'loca'}->read; + $self->{' read'} = 1; + $self; +} + + +=head2 $t->out($fh) + +Writes out all the glyphs in the parent's location table, calculating a new +output location for each one. + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($i, $loca, $offset, $numGlyphs); + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $loca = $self->{' PARENT'}{'loca'}{'glyphs'}; + $numGlyphs = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + + $offset = 0; + for ($i = 0; $i < $numGlyphs; $i++) + { + next unless defined $loca->[$i]; + $loca->[$i]->update; + $loca->[$i]{' OUTLOC'} = $offset; + $loca->[$i]->out($fh); + $offset += $loca->[$i]{' OUTLEN'}; + } + $self->{' PARENT'}{'head'}{'indexToLocFormat'} = ($offset >= 0x20000); + $self; +} + + +=head2 $t->out_xml($context, $depth) + +Outputs all the glyphs in the glyph table just where they are supposed to be output! + +=cut + +sub out_xml +{ + my ($self, $context, $depth) = @_; + my ($fh) = $context->{'fh'}; + my ($loca, $i, $numGlyphs); + + $loca = $self->{' PARENT'}{'loca'}{'glyphs'}; + $numGlyphs = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + + for ($i = 0; $i < $numGlyphs; $i++) + { + $context->{'gid'} = $i; + $loca->[$i]->out_xml($context, $depth) if (defined $loca->[$i]); + } + + $self; +} + + +=head2 $t->XML_start($context, $tag, %attrs) + +Pass control to glyphs as they occur + +=cut + +sub XML_start +{ + my ($self) = shift; + my ($context, $tag, %attrs) = @_; + + if ($tag eq 'glyph') + { + $context->{'tree'}[-1] = Font::TTF::Glyph->new(read => 2, PARENT => $self->{' PARENT'}); + $context->{'receiver'} = $context->{'tree'}[-1]; + } +} + + +=head2 $t->XML_end($context, $tag, %attrs) + +Collect up glyphs and put them into the loca table + +=cut + +sub XML_end +{ + my ($self) = shift; + my ($context, $tag, %attrs) = @_; + + if ($tag eq 'glyph') + { + unless (defined $context->{'glyphs'}) + { + if (defined $self->{' PARENT'}{'loca'}) + { $context->{'glyphs'} = $self->{' PARENT'}{'loca'}{'glyphs'}; } + else + { $context->{'glyphs'} = []; } + } + $context->{'glyphs'}[$attrs{'gid'}] = $context->{'tree'}[-1]; + return $context; + } else + { return $self->SUPER::XML_end(@_); } +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Glyph.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Glyph.pm new file mode 100644 index 0000000..28233cf --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Glyph.pm @@ -0,0 +1,847 @@ +package Font::TTF::Glyph; + +=head1 NAME + +Font::TTF::Glyph - Holds a single glyph's information + +=head1 DESCRIPTION + +This is a single glyph description as held in a TT font. On creation only its +header is read. Thus you can get the bounding box of each glyph without having +to read all the other information. + +=head1 INSTANCE VARIABLES + +In addition to the named variables in a glyph header (C etc.), there are +also all capital instance variables for holding working information, mostly +from the location table. + +The standard attributes each glyph has are: + + numberOfContours + xMin + yMin + xMax + yMax + +There are also other, derived, instance variables for each glyph which are read +when the whole glyph is read (via C): + +=over 4 + +=item instLen + +Number of bytes in the hinting instructions (Warning this variable is deprecated, +use C{'hints'})> instead). + +=item hints + +The string containing the hinting code for the glyph + +=back + +In addition there are other attribute like instance variables for simple glyphs: + +=over 4 + +For each contour there is: + +=over 4 + +=item endPoints + +An array of endpoints for each contour in the glyph. There are +C contours in a glyph. The number of points in a glyph is +equal to the highest endpoint of a contour. + +=back + +There are also a number of arrays indexed by point number + +=over 4 + +=item flags + +The flags associated with reading this point. The flags for a point are +recalculated for a point when it is Cd. Thus the flags are not very +useful. The only important bit is bit 0 which indicates whether the point is +an 'on' curve point, or an 'off' curve point. + +=item x + +The absolute x co-ordinate of the point. + +=item y + +The absolute y co-ordinate of the point + +=back + +=back + +For composite glyphs there are other variables + +=over 4 + +=item metric + +This holds the component number (not its glyph number) of the component from +which the metrics for this glyph should be taken. + +=item comps + +This is an array of hashes for each component. Each hash has a number of +elements: + +=over 4 + +=item glyph + +The glyph number of the glyph which comprises this component of the composite. +NOTE: In some badly generated fonts, C may contain a numerical value +but that glyph might not actually exist in the font file. This could +occur in any glyph, but is particularly likely for glyphs that have +no strokes, such as SPACE, U+00A0 NO-BREAK SPACE, or +U+200B ZERO WIDTH SPACE. + +=item args + +An array of two arguments which may be an x, y co-ordinate or two attachment +points (one on the base glyph the other on the component). See flags for details. + +=item flag + +The flag for this component + +=item scale + +A 4 number array for component scaling. This allows stretching, rotating, etc. +Note that scaling applies to placement co-ordinates (rather than attachment points) +before locating rather than after. + +=back + +=item numPoints + +This is a generated value which contains the number of components read in for this +compound glyph. + +=back + +The private instance variables are: + +=over 4 + +=item INFILE (P) + +The input file form which to read any information + +=item LOC (P) + +Location relative to the start of the glyf table in the read file + +=item BASE (P) + +The location of the glyf table in the read file + +=item LEN (P) + +This is the number of bytes required by the glyph. It should be kept up to date +by calling the C method whenever any of the glyph content changes. + +=item OUTLOC (P) + +Location relative to the start of the glyf table. This variable is only active +whilst the output process is going on. It is used to inform the location table +where the glyph's location is, since the glyf table is output before the loca +table due to alphabetical ordering. + +=item OUTLEN (P) + +This indicates the length of the glyph data when it is output. This more +accurately reflects the internal memory form than the C variable which +only reflects the read file length. The C variable is only set after +calling C or C. + +=back + +=head2 Editing + +If you want to edit a glyph in some way, then you should read_dat the glyph, then +make your changes and then update the glyph or set the $g->{' isdirty'} variable. +It is the application's duty to ensure that the following instance variables are +correct, from which update will calculate the rest, including the bounding box +information. + + numPoints + numberOfContours + endPoints + x, y, flags (only flags bit 0) + instLen + hints + +For components, the numPoints, x, y, endPoints & flags are not required but +the following information is required for each component. + + flag (bits 2, 10, 11, 12) + glyph + args + scale + metric (glyph instance variable) + + +=head1 METHODS + +=cut + +use strict; +use vars qw(%fields @field_info); +use Font::TTF::Utils; +use Font::TTF::Table; + +@field_info = ( + 'numberOfContours' => 's', + 'xMin' => 's', + 'yMin' => 's', + 'xMax' => 's', + 'yMax' => 's'); + +sub init +{ + my ($k, $v, $c, $i); + for ($i = 0; $i < $#field_info; $i += 2) + { + ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); + next unless defined $k && $k ne ""; + $fields{$k} = $v; + } +} + + +=head1 Font::TTF::Glyph->new(%parms) + +Creates a new glyph setting various instance variables + +=cut + +sub new +{ + my ($class, %parms) = @_; + my ($self) = {}; + my ($p); + + bless $self, $class; + foreach $p (keys %parms) + { $self->{" $p"} = $parms{$p}; } + init unless defined $fields{'xMin'}; + $self; +} + + +=head2 $g->read + +Reads the header component of the glyph (bounding box, etc.) and also the +glyph content, but into a data field rather than breaking it down into +its constituent structures. Use read_dat for this. + +=cut + +sub read +{ + my ($self) = @_; + my ($fh) = $self->{' INFILE'}; + my ($dat); + + return $self if $self->{' read'}; + $self->{' read'} = 1; + $fh->seek($self->{' LOC'} + $self->{' BASE'}, 0); + $fh->read($self->{' DAT'}, $self->{' LEN'}); + TTF_Read_Fields($self, $self->{' DAT'}, \%fields); + $self; +} + + +=head2 $g->read_dat + +Reads the contents of the glyph (components and curves, etc.) from the memory +store C into structures within the object. Then, to indicate where the +master form of the data is, it deletes the C instance variable. + +=cut + +sub read_dat +{ + my ($self) = @_; + my ($dat, $num, $max, $i, $flag, $len, $val, $val1, $fp); + + return $self if (defined $self->{' read'} && $self->{' read'} > 1); + $self->read unless $self->{' read'}; + $dat = $self->{' DAT'}; + $fp = 10; + $num = $self->{'numberOfContours'}; + if ($num > 0) + { + $self->{'endPoints'} = [unpack("n*", substr($dat, $fp, $num << 1))]; + $fp += $num << 1; + $max = 0; + foreach (@{$self->{'endPoints'}}) + { $max = $_ if $_ > $max; } +# print STDERR join(",", unpack('C*', $self->{" DAT"})); +# printf STDERR ("(%d,%d in %d=%d @ %d)", scalar @{$self->{'endPoints'}}, $max, length($dat), $self->{' LEN'}, $fp); + $max++ if (@{$self->{'endPoints'}}); + $self->{'numPoints'} = $max; + $self->{'instLen'} = unpack("n", substr($dat, $fp)); + $self->{'hints'} = substr($dat, $fp + 2, $self->{'instLen'}); + $fp += 2 + $self->{'instLen'}; +# read the flags array + for ($i = 0; $i < $max; $i++) + { + $flag = unpack("C", substr($dat, $fp++)); + $self->{'flags'}[$i] = $flag; + if ($flag & 8) + { + $len = unpack("C", substr($dat, $fp++)); + while ($len-- > 0) + { + $i++; + $self->{'flags'}[$i] = $flag; + } + } + } +#read the x array + for ($i = 0; $i < $max; $i++) + { + $flag = $self->{'flags'}[$i]; + if ($flag & 2) + { + $val = unpack("C", substr($dat, $fp++)); + $val = -$val unless ($flag & 16); + } elsif ($flag & 16) + { $val = 0; } + else + { + $val = TTF_Unpack("s", substr($dat, $fp)); + $fp += 2; + } + $self->{'x'}[$i] = $i == 0 ? $val : $self->{'x'}[$i - 1] + $val; + } +#read the y array + for ($i = 0; $i < $max; $i++) + { + $flag = $self->{'flags'}[$i]; + if ($flag & 4) + { + $val = unpack("C", substr($dat, $fp++)); + $val = -$val unless ($flag & 32); + } elsif ($flag & 32) + { $val = 0; } + else + { + $val = TTF_Unpack("s", substr($dat, $fp)); + $fp += 2; + } + $self->{'y'}[$i] = $i == 0 ? $val : $self->{'y'}[$i - 1] + $val; + } + } + +# compound glyph + elsif ($num < 0) + { + $flag = 1 << 5; # cheat to get the loop going + for ($i = 0; $flag & 32; $i++) + { + ($flag, $self->{'comps'}[$i]{'glyph'}) = unpack("n2", substr($dat, $fp)); + $fp += 4; + $self->{'comps'}[$i]{'flag'} = $flag; + if ($flag & 1) # ARGS1_AND_2_ARE_WORDS + { + $self->{'comps'}[$i]{'args'} = [TTF_Unpack("s2", substr($dat, $fp))]; + $fp += 4; + } else + { + $self->{'comps'}[$i]{'args'} = [unpack("c2", substr($dat, $fp))]; + $fp += 2; + } + + if ($flag & 8) + { + $val = TTF_Unpack("F", substr($dat, $fp)); + $fp += 2; + $self->{'comps'}[$i]{'scale'} = [$val, 0, 0, $val]; + } elsif ($flag & 64) + { + ($val, $val1) = TTF_Unpack("F2", substr($dat, $fp)); + $fp += 4; + $self->{'comps'}[$i]{'scale'} = [$val, 0, 0, $val1]; + } elsif ($flag & 128) + { + $self->{'comps'}[$i]{'scale'} = [TTF_Unpack("F4", substr($dat, $fp))]; + $fp += 8; + } + $self->{'metric'} = $i if ($flag & 512); + } + $self->{'numPoints'} = $i; + if ($flag & 256) # HAVE_INSTRUCTIONS + { + $self->{'instLen'} = unpack("n", substr($dat, $fp)); + $self->{'hints'} = substr($dat, $fp + 2, $self->{'instLen'}); + $fp += 2 + $self->{'instLen'}; + } + } + return undef if ($fp > length($dat)); + $self->{' read'} = 2; + $self; +} + + +=head2 $g->out($fh) + +Writes the glyph data to outfile + +=cut + +sub out +{ + my ($self, $fh) = @_; + + $self->read unless $self->{' read'}; + $self->update if $self->{' isDirty'}; + $fh->print($self->{' DAT'}); + $self->{' OUTLEN'} = length($self->{' DAT'}); + $self; +} + + +=head2 $g->out_xml($context, $depth) + +Outputs an XML description of the glyph + +=cut + +sub out_xml +{ + my ($self, $context, $depth) = @_; + my ($addr) = ($self =~ m/\((.+)\)$/o); + my ($k, $ndepth); + + if ($context->{'addresses'}{$addr}) + { + $context->{'fh'}->printf("%s\n", $depth, $context->{'gid'}, $addr); + return $self; + } + else + { + $context->{'fh'}->printf("%s\n", $depth, $context->{'gid'}, $addr); + } + + $ndepth = $depth . $context->{'indent'}; + $self->read_dat; + foreach $k (sort grep {$_ !~ m/^\s/o} keys %{$self}) + { + $self->XML_element($context, $ndepth, $k, $self->{$k}); + } + $context->{'fh'}->print("$depth\n"); + delete $context->{'done_points'}; + $self; +} + + +sub XML_element +{ + my ($self, $context, $depth, $key, $val) = @_; + my ($fh) = $context->{'fh'}; + my ($dind) = $depth . $context->{'indent'}; + my ($i); + + if ($self->{'numberOfContours'} >= 0 && ($key eq 'x' || $key eq 'y' || $key eq 'flags')) + { + return $self if ($context->{'done_points'}); + $context->{'done_points'} = 1; + + $fh->print("$depth\n"); + for ($i = 0; $i <= $#{$self->{'flags'}}; $i++) + { $fh->printf("%s\n", $dind, + $self->{'x'}[$i], $self->{'y'}[$i], $self->{'flags'}[$i]); } + $fh->print("$depth\n"); + } + elsif ($key eq 'hints') + { + my ($dat); + $fh->print("$depth\n"); +# Font::TTF::Utils::XML_hexdump($context, $depth . $context->{'indent'}, $self->{'hints'}); + $dat = Font::TTF::Utils::XML_binhint($self->{'hints'}) || ""; + $dat =~ s/\n(?!$)/\n$depth$context->{'indent'}/mg; + $fh->print("$depth$context->{'indent'}$dat"); + $fh->print("$depth\n"); + } + else + { return Font::TTF::Table::XML_element(@_); } + + $self; +} + + +=head2 $g->update + +Generates a C<$self->{'DAT'}> from the internal structures, if the data has +been read into structures in the first place. If you are building a glyph +from scratch you will need to set the instance variable C<' read'> to 2 (or +something > 1) for the update to work. + +=cut + +sub update +{ + my ($self) = @_; + my ($dat, $loc, $len, $flag, $x, $y, $i, $comp, $num); + + return $self unless (defined $self->{' read'} && $self->{' read'} > 1); + $self->update_bbox; + $self->{' DAT'} = TTF_Out_Fields($self, \%fields, 10); + $num = $self->{'numberOfContours'}; + if ($num > 0) + { + $self->{' DAT'} .= pack("n*", @{$self->{'endPoints'}}); + $len = $self->{'instLen'}; + $self->{' DAT'} .= pack("n", $len); + $self->{' DAT'} .= pack("a" . $len, substr($self->{'hints'}, 0, $len)) if ($len > 0); + for ($i = 0; $i < $self->{'numPoints'}; $i++) + { + $flag = $self->{'flags'}[$i] & 1; + if ($i == 0) + { + $x = $self->{'x'}[$i]; + $y = $self->{'y'}[$i]; + } else + { + $x = $self->{'x'}[$i] - $self->{'x'}[$i - 1]; + $y = $self->{'y'}[$i] - $self->{'y'}[$i - 1]; + } + $flag |= 16 if ($x == 0); + $flag |= 32 if ($y == 0); + if (($flag & 16) == 0 && $x < 256 && $x > -256) + { + $flag |= 2; + $flag |= 16 if ($x >= 0); + } + if (($flag & 32) == 0 && $y < 256 && $y > -256) + { + $flag |= 4; + $flag |= 32 if ($y >= 0); + } + $self->{' DAT'} .= pack("C", $flag); # sorry no repeats + $self->{'flags'}[$i] = $flag; + } + for ($i = 0; $i < $self->{'numPoints'}; $i++) + { + $flag = $self->{'flags'}[$i]; + $x = $self->{'x'}[$i] - (($i == 0) ? 0 : $self->{'x'}[$i - 1]); + if (($flag & 18) == 0) + { $self->{' DAT'} .= TTF_Pack("s", $x); } + elsif (($flag & 18) == 18) + { $self->{' DAT'} .= pack("C", $x); } + elsif (($flag & 18) == 2) + { $self->{' DAT'} .= pack("C", -$x); } + } + for ($i = 0; $i < $self->{'numPoints'}; $i++) + { + $flag = $self->{'flags'}[$i]; + $y = $self->{'y'}[$i] - (($i == 0) ? 0 : $self->{'y'}[$i - 1]); + if (($flag & 36) == 0) + { $self->{' DAT'} .= TTF_Pack("s", $y); } + elsif (($flag & 36) == 36) + { $self->{' DAT'} .= pack("C", $y); } + elsif (($flag & 36) == 4) + { $self->{' DAT'} .= pack("C", -$y); } + } + } + + elsif ($num < 0) + { + for ($i = 0; $i <= $#{$self->{'comps'}}; $i++) + { + $comp = $self->{'comps'}[$i]; + $flag = $comp->{'flag'} & 7158; # bits 2,10,11,12 + $flag |= 1 unless ($comp->{'args'}[0] > -129 && $comp->{'args'}[0] < 128 + && $comp->{'args'}[1] > -129 && $comp->{'args'}[1] < 128); + if (defined $comp->{'scale'}) + { + if ($comp->{'scale'}[1] == 0 && $comp->{'scale'}[2] == 0) + { + if ($comp->{'scale'}[0] == $comp->{'scale'}[3]) + { $flag |= 8 unless ($comp->{'scale'}[0] == 0 + || $comp->{'scale'}[0] == 1); } + else + { $flag |= 64; } + } else + { $flag |= 128; } + } + + $flag |= 512 if (defined $self->{'metric'} && $self->{'metric'} == $i); + if ($i == $#{$self->{'comps'}}) + { $flag |= 256 if (defined $self->{'instLen'} && $self->{'instLen'} > 0); } + else + { $flag |= 32; } + + $self->{' DAT'} .= pack("n", $flag); + $self->{' DAT'} .= pack("n", $comp->{'glyph'}); + $comp->{'flag'} = $flag; + + if ($flag & 1) + { $self->{' DAT'} .= TTF_Pack("s2", @{$comp->{'args'}}); } + else + { $self->{' DAT'} .= pack("CC", @{$comp->{'args'}}); } + + if ($flag & 8) + { $self->{' DAT'} .= TTF_Pack("F", $comp->{'scale'}[0]); } + elsif ($flag & 64) + { $self->{' DAT'} .= TTF_Pack("F2", $comp->{'scale'}[0], $comp->{'scale'}[3]); } + elsif ($flag & 128) + { $self->{' DAT'} .= TTF_Pack("F4", @{$comp->{'scale'}}); } + } + if (defined $self->{'instLen'} && $self->{'instLen'} > 0) + { + $len = $self->{'instLen'}; + $self->{' DAT'} .= pack("n", $len); + $self->{' DAT'} .= pack("a" . $len, substr($self->{'hints'}, 0, $len)); + } + } + my ($olen) = length($self->{' DAT'}); + $self->{' DAT'} .= ("\000") x (4 - ($olen & 3)) if ($olen & 3); + $self->{' OUTLEN'} = length($self->{' DAT'}); + $self->{' read'} = 2; # changed from 1 to 2 so we don't read_dat() again +# we leave numPoints and instLen since maxp stats use this + $self; +} + + +=head2 $g->update_bbox + +Updates the bounding box for this glyph according to the points in the glyph + +=cut + +sub update_bbox +{ + my ($self) = @_; + my ($num, $maxx, $minx, $maxy, $miny, $i, $comp, $x, $y, $compg); + + return $self unless $self->{' read'} > 1; # only if read_dat done + $miny = $minx = 65537; $maxx = $maxy = -65537; + $num = $self->{'numberOfContours'}; + if ($num > 0) + { + for ($i = 0; $i < $self->{'numPoints'}; $i++) + { + ($x, $y) = ($self->{'x'}[$i], $self->{'y'}[$i]); + + $maxx = $x if ($x > $maxx); + $minx = $x if ($x < $minx); + $maxy = $y if ($y > $maxy); + $miny = $y if ($y < $miny); + } + } + + elsif ($num < 0) + { + foreach $comp (@{$self->{'comps'}}) + { + my ($gnx, $gny, $gxx, $gxy); + my ($sxx, $sxy, $syx, $syy); + + my $otherg = $self->{' PARENT'}{'loca'}{'glyphs'}[$comp->{'glyph'}]; + # work around bad fonts: see documentation for 'comps' above + next unless (defined $otherg); + $compg = $otherg->read->update_bbox; + ($gnx, $gny, $gxx, $gxy) = @{$compg}{'xMin', 'yMin', 'xMax', 'yMax'}; + if (defined $comp->{'scale'}) + { + ($sxx, $sxy, $syx, $syy) = @{$comp->{'scale'}}; + ($gnx, $gny, $gxx, $gxy) = ($gnx*$sxx+$gny*$syx + $comp->{'args'}[0], + $gnx*$sxy+$gny*$syy + $comp->{'args'}[1], + $gxx*$sxx+$gxy*$syx + $comp->{'args'}[0], + $gxx*$sxy+$gxy*$syy + $comp->{'args'}[1]); + } elsif ($comp->{'args'}[0] || $comp->{'args'}[1]) + { + $gnx += $comp->{'args'}[0]; + $gny += $comp->{'args'}[1]; + $gxx += $comp->{'args'}[0]; + $gxy += $comp->{'args'}[1]; + } + ($gnx, $gxx) = ($gxx, $gnx) if $gnx > $gxx; + ($gny, $gxy) = ($gxy, $gny) if $gny > $gxy; + $maxx = $gxx if $gxx > $maxx; + $minx = $gnx if $gnx < $minx; + $maxy = $gxy if $gxy > $maxy; + $miny = $gny if $gny < $miny; + } + } + $self->{'xMax'} = $maxx; + $self->{'xMin'} = $minx; + $self->{'yMax'} = $maxy; + $self->{'yMin'} = $miny; + $self; +} + + +=head2 $g->maxInfo + +Returns lots of information about a glyph so that the C table can update +itself. Returns array containing contributions of this glyph to maxPoints, maxContours, +maxCompositePoints, maxCompositeContours, maxSizeOfInstructions, maxComponentElements, +and maxComponentDepth. + +=cut + +sub maxInfo +{ + my ($self) = @_; + my (@res, $i, @n); + + $self->read_dat; # make sure we've read some data + $res[4] = length($self->{'hints'}) if defined $self->{'hints'}; + $res[6] = 1; + if ($self->{'numberOfContours'} > 0) + { + $res[0] = $self->{'numPoints'}; + $res[1] = $self->{'numberOfContours'}; + } elsif ($self->{'numberOfContours'} < 0) + { + for ($i = 0; $i <= $#{$self->{'comps'}}; $i++) + { + my $otherg = + $self->{' PARENT'}{'loca'}{'glyphs'} + [$self->{'comps'}[$i]{'glyph'}]; + + # work around bad fonts: see documentation for 'comps' above + next unless (defined $otherg ); + + @n = $otherg->maxInfo; + + $res[2] += $n[2] == 0 ? $n[0] : $n[2]; + $res[3] += $n[3] == 0 ? $n[1] : $n[3]; + $res[5]++; + $res[6] = $n[6] + 1 if ($n[6] >= $res[6]); + } + } + @res; +} + +=head2 $g->empty + +Empties the glyph of all information to the level of not having been read. +Useful for saving memory in apps with many glyphs being read + +=cut + +sub empty +{ + my ($self) = @_; + my (%keep) = map {(" $_" => 1)} ('LOC', 'OUTLOC', 'PARENT', 'INFILE', 'BASE', + 'OUTLEN', 'LEN'); + map {delete $self->{$_} unless $keep{$_}} keys %$self; + + $self; +} + + +=head2 $g->get_points + +This method creates point information for a compound glyph. The information is +stored in the same place as if the glyph was not a compound, but since +numberOfContours is negative, the glyph is still marked as being a compound + +=cut + +sub get_points +{ + my ($self) = @_; + my ($comp, $compg, $nump, $e, $i); + + $self->read_dat; + return undef unless ($self->{'numberOfContours'} < 0); + + foreach $comp (@{$self->{'comps'}}) + { + $compg = $self->{' PARENT'}{'loca'}{'glyphs'}[$comp->{'glyph'}]; + # work around bad fonts: see documentation for 'comps' above + next unless (defined $compg ); + $compg->get_points; + + for ($i = 0; $i < $compg->{'numPoints'}; $i++) + { + my ($x, $y) = ($compg->{'x'}[$i], $compg->{'y'}[$i]); + if (defined $comp->{'scale'}) + { + ($x, $y) = ($x * $comp->{'scale'}[0] + $y * $comp->{'scale'}[2], + $x * $comp->{'scale'}[1] + $y * $comp->{'scale'}[3]); + } + if (defined $comp->{'args'}) + { ($x, $y) = ($x + $comp->{'args'}[0], $y + $comp->{'args'}[1]); } + push (@{$self->{'x'}}, $x); + push (@{$self->{'y'}}, $y); + push (@{$self->{'flags'}}, $compg->{'flags'}[$i]); + } + foreach $e (@{$compg->{'endPoints'}}) + { push (@{$self->{'endPoints'}}, $e + $nump); } + $nump += $compg->{'numPoints'}; + } + $self->{'numPoints'} = $nump; + $self; +} + + +=head2 $g->get_refs + +Returns an array of all the glyph ids that are used to make up this glyph. That +is all the compounds and their references and so on. If this glyph is not a +compound, then returns an empty array. + +Please note the warning about bad fonts that reference nonexistant glyphs +under INSTANCE VARIABLES above. This function will not attempt to +filter out nonexistant glyph numbers. + +=cut + +sub get_refs +{ + my ($self) = @_; + my (@res, $g); + + $self->read_dat; + return unless ($self->{'numberOfContours'} < 0); + foreach $g (@{$self->{'comps'}}) + { + push (@res, $g->{'glyph'}); + my $otherg = $self->{' PARENT'}{'loca'}{'glyphs'}[$g->{'glyph'}]; + # work around bad fonts: see documentation for 'comps' above + next unless (defined $otherg); + my @list = $otherg->get_refs; + push(@res, @list); + } + return @res; +} + +1; + +=head1 BUGS + +=over 4 + +=item * + +The instance variables used here are somewhat clunky and inconsistent with +the other tables. + +=item * + +C doesn't re-calculate the bounding box or C. + +=back + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GrFeat.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GrFeat.pm new file mode 100644 index 0000000..2732a69 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/GrFeat.pm @@ -0,0 +1,249 @@ +package Font::TTF::GrFeat; + +=head1 NAME + +Font::TTF::GrFeat - Graphite Font Features + +=head1 DESCRIPTION + +=head1 INSTANCE VARIABLES + +=over 4 + +=item version + +=item features + +An array of hashes of the following form + +=over 8 + +=item feature + +feature id number + +=item name + +name index in name table + +=item exclusive + +exclusive flag + +=item default + +the default setting number + +=item settings + +hash of setting number against name string index + +=back + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); + +use Font::TTF::Utils; + +require Font::TTF::Table; + +@ISA = qw(Font::TTF::Table); + +=head2 $t->read + +Reads the features from the TTF file into memory + +=cut + +sub read +{ + my ($self) = @_; + my ($featureCount, $features); + + return $self if $self->{' read'}; + $self->SUPER::read_dat or return $self; + + ($self->{'version'}, $featureCount) = TTF_Unpack("vS", $self->{' dat'}); + + $features = []; + foreach (1 .. $featureCount) { + my ($feature, $nSettings, $settingTable, $featureFlags, $nameIndex, $reserved); + if ($self->{'version'} == 1) + { + ($feature, $nSettings, $settingTable, $featureFlags, $nameIndex) + = TTF_Unpack("SSLSS", substr($self->{' dat'}, $_ * 12, 12)); + #The version 1 Feat table ends with a feature (id 1) named NoName + #with zero settings but with an offset to the last entry in the setting + #array. This last setting has id 0 and an invalid name id. This last + #feature is changed to have one setting. + if ($_ == $featureCount && $nSettings == 0) {$nSettings = 1;} + } + else #version == 2 + {($feature, $nSettings, $reserved, $settingTable, $featureFlags, $nameIndex) + = TTF_Unpack("LSSLSS", substr($self->{' dat'}, 12 + ($_ - 1) * 16, 16))}; + my $feature = + { + 'feature' => $feature, + 'name' => $nameIndex, + }; + + #interpret the featureFlags & store settings + $feature->{'exclusive'} = (($featureFlags & 0x8000) != 0); + + my @settings = TTF_Unpack("S*", substr($self->{' dat'}, $settingTable, $nSettings * 4)); + if ($featureFlags & 0x4000) + {$feature->{'default'} = $featureFlags & 0x00FF;} + else + {$feature->{'default'} = @settings[0];} + $feature->{'settings'} = {@settings}; + + push(@$features, $feature); + } + + $self->{'features'} = $features; + + delete $self->{' dat'}; # no longer needed, and may become obsolete + $self->{' read'} = 1; + $self; +} + +=head2 $t->out($fh) + +Writes the features to a TTF file + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($features, $numFeatures, $settings, $featureFlags, $featuresData, $settingsData); + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $features = $self->{'features'}; + $numFeatures = @$features; + $featuresData, $settingsData = ('', ''); + + foreach (@$features) { + $settings = $_->{'settings'}; + $featureFlags = ($_->{'exclusive'} ? 0x8000 : 0x0000); + +# output default setting first instead of using the featureFlags (as done below) +# $featureFlags = ($_->{'exclusive'} ? 0x8000 : 0x0000) | +# ($_->{'default'} != 0 ? 0x4000 | ($_->{'default'} & 0x00FF) +# : 0x0000); + if ($self->{'version'} == 1) + { + $featuresData .= TTF_Pack("SSLSS", + $_->{'feature'}, + scalar keys %$settings, + 12 + 12 * $numFeatures + length $settingsData, + $featureFlags, + $_->{'name'}); + } + else #version == 2 + { + $featuresData .= TTF_Pack("LSSLSS", + $_->{'feature'}, + scalar keys %$settings, + 0, + 12 + 16 * $numFeatures + length $settingsData, + $featureFlags, + $_->{'name'}); + } + + #output default setting first + #the settings may not be in their original order + my $defaultSetting = $_->{'default'}; + $settingsData .= TTF_Pack("SS", $defaultSetting, $settings->{$defaultSetting}); + foreach (sort {$a <=> $b} keys %$settings) { + if ($_ == $defaultSetting) {next;} #skip default setting + $settingsData .= TTF_Pack("SS", $_, $settings->{$_}); + } + } + + $fh->print(TTF_Pack("vSSL", $self->{'version'}, $numFeatures, 0, 0)); + $fh->print($featuresData); + $fh->print($settingsData); + + $self; +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + my ($names, $features, $settings); + + $self->read; + + $names = $self->{' PARENT'}->{'name'}; + $names->read; + + $fh = 'STDOUT' unless defined $fh; + + $features = $self->{'features'}; + foreach (@$features) { + $fh->printf("Feature %d, %s, default: %d name %d # '%s'\n", + $_->{'feature'}, + ($_->{'exclusive'} ? "exclusive" : "additive"), + $_->{'default'}, + $_->{'name'}, + $names->{'strings'}[$_->{'name'}][3][1]{1033}); + $settings = $_->{'settings'}; + foreach (sort { $a <=> $b } keys %$settings) { + $fh->printf("\tSetting %d, name %d # '%s'\n", + $_, $settings->{$_}, $names->{'strings'}[$settings->{$_}][3][1]{1033}); + } + } + + $self; +} + +sub settingName +{ + my ($self, $feature, $setting) = @_; + + $self->read; + + my $names = $self->{' PARENT'}->{'name'}; + $names->read; + + my $features = $self->{'features'}; + my ($featureEntry) = grep { $_->{'feature'} == $feature } @$features; + my $featureName = $names->{'strings'}[$featureEntry->{'name'}][3][1]{1033}; + my $settingName = $featureEntry->{'exclusive'} + ? $names->{'strings'}[$featureEntry->{'settings'}->{$setting}][3][1]{1033} + : $names->{'strings'}[$featureEntry->{'settings'}->{$setting & ~1}][3][1]{1033} + . (($setting & 1) == 0 ? " On" : " Off"); + + ($featureName, $settingName); +} + +1; + +=head1 BUGS + +The version 1 Feat table ends with a feature (id 1) named NoName +with zero settings but with an offset to the last entry in the setting +array. This last setting has id 0 and an invalid name id. This last +feature is changed to have one setting. + +=head1 AUTHOR + +Alan Ward (derived from Jonathan Kew's Feat.pm). +See L for copyright and licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hdmx.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hdmx.pm new file mode 100644 index 0000000..d1e47cb --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hdmx.pm @@ -0,0 +1,149 @@ +package Font::TTF::Hdmx; + +=head1 NAME + +Font::TTF::Hdmx - Horizontal device metrics + +=head1 DESCRIPTION + +The table consists of an hash of device metric tables indexed by the ppem for +that subtable. Each subtable consists of an array of advance widths in pixels +for each glyph at that ppem (horizontally). + +=head1 INSTANCE VARIABLES + +Individual metrics are accessed using the following referencing: + + $f->{'hdmx'}{$ppem}[$glyph_num] + +In addition there is one instance variable: + +=over 4 + +=item Num + +Number of device tables. + +=back + +=head2 METHODS + +=cut + +use strict; +use vars qw(@ISA); + +@ISA = qw(Font::TTF::Table); + + +=head2 $t->read + +Reads the table into data structures + +=cut + +sub read +{ + my ($self) = @_; + my ($fh) = $self->{' INFILE'}; + my ($numg, $ppem, $i, $numt, $dat, $len); + + $numg = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + $self->SUPER::read or return $self; + + $fh->read($dat, 8); + ($self->{'Version'}, $numt, $len) = unpack("nnN", $dat); + $self->{'Num'} = $numt; + + for ($i = 0; $i < $numt; $i++) + { + $fh->read($dat, $len); + $ppem = unpack("C", $dat); + $self->{$ppem} = [unpack("C$numg", substr($dat, 2))]; + } + $self; +} + + +=head2 $t->out($fh) + +Outputs the device metrics for this font + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($numg, $i, $pad, $len, $numt, @ppem, $max); + + return $self->SUPER::out($fh) unless ($self->{' read'}); + + $numg = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + @ppem = grep(/^\d+$/, sort {$a <=> $b} keys %$self); + $pad = "\000" x (3 - ($numg + 1) % 4); + $len = $numg + 2 + length($pad); + $fh->print(pack("nnN", 0, $#ppem + 1, $len)); + for $i (@ppem) + { + $max = 0; + foreach (@{$self->{$i}}[0..($numg - 1)]) + { $max = $_ if $_ > $max; } + $fh->print(pack("C*", $i, $max, @{$self->{$i}}[0..($numg - 1)]) . $pad); + } + $self; +} + + +=head2 $t->tables_do(&func) + +For each subtable it calls &sub($ref, $ppem) + +=cut + +sub tables_do +{ + my ($self, $func) = @_; + my ($i); + + foreach $i (grep(/^\d+$/, %$self)) + { &$func($self->{$i}, $i); } + $self; +} + + +=head2 $t->XML_element($context, $depth, $key, $value) + +Outputs device metrics a little more tidily + +=cut + +sub XML_element +{ + my ($self) = shift; + my ($context, $depth, $key, $value) = @_; + my ($fh) = $context->{'fh'}; + my ($i); + + return $self->SUPER::XML_element(@_) if (ref($value) ne 'ARRAY'); + $fh->print("$depth\n"); + for ($i = 0; $i <= $#{$value}; $i += 25) + { + $fh->print("$depth$context->{'indent'}". join(' ', @{$value}[$i .. $i + 24]) . "\n"); + } + $fh->print("$depth\n"); + $self; +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Head.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Head.pm new file mode 100644 index 0000000..362e8e4 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Head.pm @@ -0,0 +1,250 @@ +package Font::TTF::Head; + +=head1 NAME + +Font::TTF::Head - The head table for a TTF Font + +=head1 DESCRIPTION + +This is a very basic table with just instance variables as described in the +TTF documentation, using the same names. One of the most commonly used is +C. + +=head1 INSTANCE VARIABLES + +The C table has no internal instance variables beyond those common to all +tables and those specified in the standard: + + version + fontRevision + checkSumAdjustment + magicNumber + flags + unitsPerEm + created + modified + xMin + yMin + xMax + yMax + macStyle + lowestRecPPEM + fontDirectionHint + indexToLocFormat + glyphDataFormat + +The two dates are held as an array of two unsigned longs (32-bits) + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA %fields @field_info); + +require Font::TTF::Table; +use Font::TTF::Utils; + +@ISA = qw(Font::TTF::Table); +@field_info = ( + 'version' => 'v', + 'fontRevision' => 'f', + 'checkSumAdjustment' => 'L', + 'magicNumber' => 'L', + 'flags' => 'S', + 'unitsPerEm' => 'S', + 'created' => 'L2', + 'modified' => 'L2', + 'xMin' => 's', + 'yMin' => 's', + 'xMax' => 's', + 'yMax' => 's', + 'macStyle' => 'S', + 'lowestRecPPEM' => 'S', + 'fontDirectionHint' => 's', + 'indexToLocFormat' => 's', + 'glyphDataFormat' => 's'); + +sub init +{ + my ($k, $v, $c, $i); + for ($i = 0; $i < $#field_info; $i += 2) + { + ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); + next unless defined $k && $k ne ""; + $fields{$k} = $v; + } +} + + +=head2 $t->read + +Reads the table into memory thanks to some utility functions + +=cut + +sub read +{ + my ($self) = @_; + my ($dat); + + $self->SUPER::read || return $self; + + init unless defined $fields{'Ascender'}; + $self->{' INFILE'}->read($dat, 54); + + TTF_Read_Fields($self, $dat, \%fields); + $self; +} + + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying. If in memory +(which is usually) the checkSumAdjustment field is set to 0 as per the default +if the file checksum is not to be considered. + +=cut + +sub out +{ + my ($self, $fh) = @_; + + return $self->SUPER::out($fh) unless $self->{' read'}; # this is never true +# $self->{'checkSumAdjustment'} = 0 unless $self->{' PARENT'}{' wantsig'}; + $fh->print(TTF_Out_Fields($self, \%fields, 54)); + $self; +} + + +=head2 $t->XML_element($context, $depth, $key, $value) + +Handles date process for the XML exporter + +=cut + +sub XML_element +{ + my ($self) = shift; + my ($context, $depth, $key, $value) = @_; + my ($fh) = $context->{'fh'}; + my ($output, @time); + my (@month) = qw(JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC); + + return $self->SUPER::XML_element(@_) unless ($key eq 'created' || $key eq 'modified'); + + @time = gmtime($self->getdate($key eq 'created')); + $output = sprintf("%d/%s/%d %d:%d:%d", $time[3], $month[$time[4]], $time[5] + 1900, + $time[2], $time[1], $time[0]); + $fh->print("$depth<$key>$output\n"); + $self; +} + + +=head2 $t->update + +Updates the head table based on the glyph data and the hmtx table + +=cut + +sub update +{ + my ($self) = @_; + my ($num, $i, $loc, $hmtx); + my ($xMin, $yMin, $xMax, $yMax, $lsbx); + + return undef unless ($self->SUPER::update); + + $num = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + return undef unless (defined $self->{' PARENT'}{'hmtx'} && defined $self->{' PARENT'}{'loca'}); + $hmtx = $self->{' PARENT'}{'hmtx'}->read; + + $self->{' PARENT'}{'loca'}->update; + $hmtx->update; # if we updated, then the flags will be set anyway. + $lsbx = 1; + for ($i = 0; $i < $num; $i++) + { + $loc = $self->{' PARENT'}{'loca'}{'glyphs'}[$i]; + next unless defined $loc; + $loc->read->update_bbox; + $xMin = $loc->{'xMin'} if ($loc->{'xMin'} < $xMin || $i == 0); + $yMin = $loc->{'yMin'} if ($loc->{'yMin'} < $yMin || $i == 0); + $xMax = $loc->{'xMax'} if ($loc->{'xMax'} > $xMax); + $yMax = $loc->{'yMax'} if ($loc->{'yMax'} > $yMax); + $lsbx &= ($loc->{'xMin'} == $hmtx->{'lsb'}[$i]); + } + $self->{'xMin'} = $xMin; + $self->{'yMin'} = $yMin; + $self->{'xMax'} = $xMax; + $self->{'yMax'} = $yMax; + if ($lsbx) + { $self->{'flags'} |= 2; } + else + { $self->{'flags'} &= ~2; } + $self; +} + + +=head2 $t->getdate($is_create) + +Converts font modification time (or creation time if $is_create is set) to a 32-bit integer as returned +from time(). Returns undef if the value is out of range, either before the epoch or after the maximum +storable time. + +=cut + +sub getdate +{ + my ($self, $is_create) = @_; + my ($arr) = $self->{$is_create ? 'created' : 'modified'}; + + $arr->[1] -= 2082844800; # seconds between 1/Jan/1904 and 1/Jan/1970 (midnight) + if ($arr->[1] < 0) + { + $arr->[1] += 0xFFFFFFF; $arr->[1]++; + $arr->[0]--; + } + return undef if $arr->[0] != 0; + return $arr->[1]; +} + + +=head2 $t->setdate($time, $is_create) + +Sets the time information for modification (or creation time if $is_create is set) according to the 32-bit +time information. + +=cut + +sub setdate +{ + my ($self, $time, $is_create) = @_; + my (@arr); + + $arr[1] = $time; + if ($arr[1] >= 0x83DA4F80) + { + $arr[1] -= 0xFFFFFFFF; + $arr[1]--; + $arr[0]++; + } + $arr[1] += 2082844800; + $self->{$is_create ? 'created' : 'modified'} = \@arr; + $self; +} + + +1; + + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hhea.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hhea.pm new file mode 100644 index 0000000..cb923b1 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hhea.pm @@ -0,0 +1,159 @@ +package Font::TTF::Hhea; + +=head1 NAME + +Font::TTF::Hhea - Horizontal Header table + +=head1 DESCRIPTION + +This is a simplte table with just standards specified instance variables + +=head1 INSTANCE VARIABLES + + version + Ascender + Descender + LineGap + advanceWidthMax + minLeftSideBearing + minRightSideBearing + xMaxExtent + caretSlopeRise + caretSlopeRun + metricDataFormat + numberOfHMetrics + + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA %fields @field_info); + +require Font::TTF::Table; +use Font::TTF::Utils; + +@ISA = qw(Font::TTF::Table); +@field_info = ( + 'version' => 'v', + 'Ascender' => 's', + 'Descender' => 's', + 'LineGap' => 's', + 'advanceWidthMax' => 'S', + 'minLeftSideBearing' => 's', + 'minRightSideBearing' => 's', + 'xMaxExtent' => 's', + 'caretSlopeRise' => 's', + 'caretSlopeRun' => 's', + 'metricDataFormat' => '+10s', + 'numberOfHMetrics' => 'S'); + +sub init +{ + my ($k, $v, $c, $i); + for ($i = 0; $i < $#field_info; $i += 2) + { + ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); + next unless defined $k && $k ne ""; + $fields{$k} = $v; + } +} + + +=head2 $t->read + +Reads the table into memory as instance variables + +=cut + +sub read +{ + my ($self) = @_; + my ($dat); + + $self->SUPER::read or return $self; + init unless defined $fields{'Ascender'}; + $self->{' INFILE'}->read($dat, 36); + + TTF_Read_Fields($self, $dat, \%fields); + $self; +} + + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying. + +=cut + +sub out +{ + my ($self, $fh) = @_; + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $self->{'numberOfHMetrics'} = $self->{' PARENT'}{'hmtx'}->numMetrics || $self->{'numberOfHMetrics'}; + $fh->print(TTF_Out_Fields($self, \%fields, 36)); + $self; +} + + +=head2 $t->update + +Updates various parameters in the hhea table from the hmtx table. + +=cut + +sub update +{ + my ($self) = @_; + my ($hmtx) = $self->{' PARENT'}{'hmtx'}; + my ($glyphs); + my ($num, $res); + my ($i, $maw, $mlsb, $mrsb, $mext, $aw, $lsb, $ext); + + return undef unless ($self->SUPER::update); + return undef unless (defined $hmtx && defined $self->{' PARENT'}{'loca'}); + + $hmtx->read->update; + $self->{' PARENT'}{'loca'}->read->update; + $glyphs = $self->{' PARENT'}{'loca'}{'glyphs'}; + $num = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + + for ($i = 0; $i < $num; $i++) + { + $aw = $hmtx->{'advance'}[$i]; + $lsb = $hmtx->{'lsb'}[$i]; + if (defined $glyphs->[$i]) + { $ext = $lsb + $glyphs->[$i]->read->{'xMax'} - $glyphs->[$i]{'xMin'}; } + else + { $ext = $aw; } + $maw = $aw if ($aw > $maw); + $mlsb = $lsb if ($lsb < $mlsb or $i == 0); + $mrsb = $aw - $ext if ($aw - $ext < $mrsb or $i == 0); + $mext = $ext if ($ext > $mext); + } + $self->{'advanceWidthMax'} = $maw; + $self->{'minLeftSideBearing'} = $mlsb; + $self->{'minRightSideBearing'} = $mrsb; + $self->{'xMaxExtent'} = $mext; + $self->{'numberOfHMetrics'} = $hmtx->numMetrics; + $self; +} + + +1; + + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hmtx.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hmtx.pm new file mode 100644 index 0000000..537df94 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Hmtx.pm @@ -0,0 +1,214 @@ +package Font::TTF::Hmtx; + +=head1 NAME + +Font::TTF::Hmtx - Horizontal Metrics + +=head1 DESCRIPTION + +Contains the advance width and left side bearing for each glyph. Given the +compressability of the data onto disk, this table uses information from +other tables, and thus must do part of its output during the output of +other tables + +=head1 INSTANCE VARIABLES + +The horizontal metrics are kept in two arrays by glyph id. The variable names +do not start with a space + +=over 4 + +=item advance + +An array containing the advance width for each glyph + +=item lsb + +An array containing the left side bearing for each glyph + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +require Font::TTF::Table; + +@ISA = qw(Font::TTF::Table); + + +=head2 $t->read + +Reads the horizontal metrics from the TTF file into memory + +=cut + +sub read +{ + my ($self) = @_; + my ($numh, $numg); + + $numh = $self->{' PARENT'}{'hhea'}->read->{'numberOfHMetrics'}; + $numg = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + $self->_read($numg, $numh, "advance", "lsb"); +} + +sub _read +{ + my ($self, $numg, $numh, $tAdv, $tLsb) = @_; + my ($fh) = $self->{' INFILE'}; + my ($i, $dat); + + $self->SUPER::read or return $self; + + for ($i = 0; $i < $numh; $i++) + { + $fh->read($dat, 4); + ($self->{$tAdv}[$i], $self->{$tLsb}[$i]) = unpack("nn", $dat); + $self->{$tLsb}[$i] -= 65536 if ($self->{$tLsb}[$i] >= 32768); + } + + $i--; + while (++$i < $numg) + { + $fh->read($dat, 2); + $self->{$tAdv}[$i] = $self->{$tAdv}[$numh - 1]; + $self->{$tLsb}[$i] = unpack("n", $dat); + $self->{$tLsb}[$i] -= 65536 if ($self->{$tLsb}[$i] >= 32768); + } + $self; +} + +=head2 $t->numMetrics + +Calculates again the number of long metrics required to store the information +here. Returns undef if the table has not been read. + +=cut + +sub numMetrics +{ + my ($self) = @_; + my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + my ($i); + + return undef unless $self->{' read'}; + + for ($i = $numg - 2; $i >= 0; $i--) + { last if ($self->{'advance'}[$i] != $self->{'advance'}[$i + 1]); } + + return $i + 2; +} + + +=head2 $t->out($fh) + +Writes the metrics to a TTF file. Assumes that the C has updated the +numHMetrics from here + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + my ($numh) = $self->{' PARENT'}{'hhea'}->read->{'numberOfHMetrics'}; + $self->_out($fh, $numg, $numh, "advance", "lsb"); +} + +sub _out +{ + my ($self, $fh, $numg, $numh, $tAdv, $tLsb) = @_; + my ($i, $lsb); + + return $self->SUPER::out($fh) unless ($self->{' read'}); + + for ($i = 0; $i < $numg; $i++) + { + $lsb = $self->{$tLsb}[$i]; + $lsb += 65536 if $lsb < 0; + if ($i >= $numh) + { $fh->print(pack("n", $lsb)); } + else + { $fh->print(pack("n2", $self->{$tAdv}[$i], $lsb)); } + } + $self; +} + + +=head2 $t->update + +Updates the lsb values from the xMin from the each glyph + +=cut + +sub update +{ + my ($self) = @_; + my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + my ($i); + + return undef unless ($self->SUPER::update); +# lsb & xMin must always be the same, regardless of any flags! +# return $self unless ($self->{' PARENT'}{'head'}{'flags'} & 2); # lsb & xMin the same + + $self->{' PARENT'}{'loca'}->update; + for ($i = 0; $i < $numg; $i++) + { + my ($g) = $self->{' PARENT'}{'loca'}{'glyphs'}[$i]; + if ($g) + { $self->{'lsb'}[$i] = $g->read->update_bbox->{'xMin'}; } + else + { $self->{'lsb'}[$i] = 0; } + } + $self->{' PARENT'}{'head'}{'flags'} |= 2; + $self; +} + + +=head2 $t->out_xml($context, $depth) + +Outputs the table in XML + +=cut + +sub out_xml +{ + my ($self, $context, $depth) = @_; + my ($fh) = $context->{'fh'}; + my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + my ($addr) = ($self =~ m/\((.+)\)$/o); + my ($i); + + if ($context->{'addresses'}{$addr}) + { + $fh->printf("%s<%s id_ref='%s'/>\n", $depth, $context->{'name'}, $addr); + return $self; + } + else + { $fh->printf("%s<%s id='%s'>\n", $depth, $context->{'name'}, $addr); } + + $self->read; + + for ($i = 0; $i < $numg; $i++) + { $fh->print("$depth$context->{'indent'}\n"); } + + $fh->print("$depth{'name'}>\n"); + $self; +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern.pm new file mode 100644 index 0000000..80f66d9 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern.pm @@ -0,0 +1,296 @@ +package Font::TTF::Kern; + +=head1 NAME + +Font::TTF::Kern - Kerning tables + +=head1 DESCRIPTION + +Kerning tables are held as an ordered collection of subtables each giving +incremental information regarding the kerning of various pairs of glyphs. + +The basic structure of the kerning data structure is: + + $kern = $f->{'kern'}{'tables'}[$tnum]{'kerns'}{$leftnum}{$rightnum}; + +Due to the possible complexity of some kerning tables the above information +is insufficient. Reference also needs to be made to the type of the table and +the coverage field. + +=head1 INSTANCE VARIABLES + +The instance variables for a kerning table are relatively straightforward. + +=over 4 + +=item Version + +Version number of the kerning table + +=item Num + +Number of subtables in the kerning table + +=item tables + +Array of subtables in the kerning table + +=over 4 + +Each subtable has a number of instance variables. + +=item kern + +A two level hash array containing kerning values. The indexing is left +value and then right value. In the case of type 2 tables, the indexing +is via left class and right class. It may seem using hashes is strange, +but most tables are not type 2 and this method saves empty array values. + +=item type + +Stores the table type. Only type 0 and type 2 tables are specified for +TrueType so far. + +=item coverage + +A bit field of coverage information regarding the kerning value. See the +TrueType specification for details. + +=item Version + +Contains the version number of the table. + +=item Num + +Number of kerning pairs in this type 0 table. + +=item left + +An array indexed by glyph - left_first which returns a class number for +the glyph in type 2 tables. + +=item right + +An array indexed by glyph - right_first which returns a class number for +the glyph in type 2 tables. + +=item left_first + +the glyph number of the first element in the left array for type 2 tables. + +=item right_first + +the glyph number of the first element in the right array for type 2 tables. + +=item num_left + +Number of left classes + +=item num_right + +Number of right classes + +=back + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::Table; + +@ISA = qw(Font::TTF::Table); + +=head2 $t->read + +Reads the whole kerning table into structures + +=cut + +sub read +{ + my ($self) = @_; + my ($fh) = $self->{' INFILE'}; + my ($dat, $i, $numt, $len, $cov, $t); + + $self->SUPER::read or return $self; + + $fh->read($dat, 4); + ($self->{'Version'}, $numt) = unpack("n2", $dat); + $self->{'Num'} = $numt; + + for ($i = 0; $i < $numt; $i++) + { + $t = {}; + $fh->read($dat, 6); + ($t->{'Version'}, $len, $cov) = unpack("n3", $dat); + $t->{'coverage'} = $cov & 255; + $t->{'type'} = $cov >> 8; + $fh->read($dat, $len - 6); + if ($t->{'Version'} == 0) + { + $t->{'Num'} = unpack("n", $dat); + my (@vals) = unpack("n*", substr($dat, 8, $t->{'Num'} * 6)); + for (0 .. ($t->{'Num'} - 1)) + { + my ($f, $l, $v); + $f = shift @vals; + $l = shift @vals; + $v = shift @vals; + $v -= 65536 if ($v > 32767); + $t->{'kern'}{$f}{$l} = $v; + } + } elsif ($t->{'Version'} == 2) + { + my ($wid, $off, $numg, $maxl, $maxr, $j); + + $wid = unpack("n", $dat); + $off = unpack("n", substr($dat, 2)); + ($t->{'left_first'}, $numg) = unpack("n2", substr($dat, $off)); + $t->{'left'} = [unpack("C$numg", substr($dat, $off + 4))]; + foreach (@{$t->{'left'}}) + { + $_ /= $wid; + $maxl = $_ if ($_ > $maxl); + } + $t->{'left_max'} = $maxl; + + $off = unpack("n", substr($dat, 4)); + ($t->{'right_first'}, $numg) = unpack("n2", substr($dat, $off)); + $t->{'right'} = [unpack("C$numg", substr($dat, $off + 4))]; + foreach (@{$t->{'right'}}) + { + $_ >>= 1; + $maxr = $_ if ($_ > $maxr); + } + $t->{'right_max'} = $maxr; + + $off = unpack("n", substr($dat, 6)); + for ($j = 0; $j <= $maxl; $j++) + { + my ($k) = 0; + + map { $t->{'kern'}{$j}{$k} = $_ if $_; $k++; } + unpack("n$maxr", substr($dat, $off + $wid * $j)); + } + } + push (@{$self->{'tables'}}, $t); + } + $self; +} + + +=head2 $t->out($fh) + +Outputs the kerning tables to the given file + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($i, $l, $r, $loc, $loc1, $t); + + return $self->SUPER::out($fh) unless ($self->{' read'}); + + $fh->print(pack("n2", $self->{'Version'}, $self->{'Num'})); + for ($i = 0; $i < $self->{'Num'}; $i++) + { + $t = $self->{'tables'}[$i]; + $loc = $fh->tell(); + + $fh->print(pack("nnn", $t->{'Version'}, 0, $t->{'coverage'})); + if ($t->{'Version'} == 0) + { + my ($dat); + foreach $l (sort {$a <=> $b} keys %{$t->{'kern'}}) + { + foreach $r (sort {$a <=> $b} keys %{$t->{'kern'}{$l}}) + { $dat .= TTF_Pack("SSs", $l, $r, $t->{'kern'}{$l}{$r}); } + } + $fh->print(TTF_Pack("SSSS", Font::TTF::Utils::TTF_bininfo(length($dat) / 6, 6))); + $fh->print($dat); + } elsif ($t->{'Version'} == 2) + { + my ($arr); + + $fh->print(pack("nnnn", $t->{'right_max'} << 1, 8, ($#{$t->{'left'}} + 7) << 1, + ($#{$t->{'left'}} + $#{$t->{'right'}} + 10) << 1)); + + $fh->print(pack("nn", $t->{'left_first'}, $#{$t->{'left'}} + 1)); + foreach (@{$t->{'left'}}) + { $fh->print(pack("C", $_ * (($t->{'left_max'} + 1) << 1))); } + + $fh->print(pack("nn", $t->{'right_first'}, $#{$t->{'right'}} + 1)); + foreach (@{$t->{'right'}}) + { $fh->print(pack("C", $_ << 1)); } + + $arr = "\000\000" x (($t->{'left_max'} + 1) * ($t->{'right_max'} + 1)); + foreach $l (keys %{$t->{'kern'}}) + { + foreach $r (keys %{$t->{'kern'}{$l}}) + { substr($arr, ($l * ($t->{'left_max'} + 1) + $r) << 1, 2) + = pack("n", $t->{'kern'}{$l}{$r}); } + } + $fh->print($arr); + } + $loc1 = $fh->tell(); + $fh->seek($loc + 2, 0); + $fh->print(pack("n", $loc1 - $loc)); + $fh->seek($loc1, 0); + } + $self; +} + + +=head2 $t->XML_element($context, $depth, $key, $value) + +Handles outputting the kern hash into XML a little more tidily + +=cut + +sub XML_element +{ + my ($self) = shift; + my ($context, $depth, $key, $value) = @_; + my ($fh) = $context->{'fh'}; + my ($f, $l); + + return $self->SUPER::XML_element(@_) unless ($key eq 'kern'); + $fh->print("$depth\n"); + foreach $f (sort {$a <=> $b} keys %{$value}) + { + foreach $l (sort {$a <=> $b} keys %{$value->{$f}}) + { $fh->print("$depth$context->{'indent'}\n"); } + } + $fh->print("$depth\n"); + $self; +} + +1; + +=head1 BUGS + +=over 4 + +=item * + +Only supports kerning table types 0 & 2. + +=item * + +No real support functions to I anything with the kerning tables yet. + +=back + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/ClassArray.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/ClassArray.pm new file mode 100644 index 0000000..ddc630e --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/ClassArray.pm @@ -0,0 +1,153 @@ +package Font::TTF::Kern::ClassArray; + +=head1 NAME + +Font::TTF::Kern::ClassArray - ClassArray Kern Subtable for AAT + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; +use IO::File; + +@ISA = qw(Font::TTF::Kern::Subtable); + +sub new +{ + my ($class) = @_; + my ($self) = {}; + + $class = ref($class) || $class; + bless $self, $class; +} + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self, $fh) = @_; + + my $subtableStart = $fh->tell() - 8; + my $dat; + $fh->read($dat, 8); + my ($rowWidth, $leftClassTable, $rightClassTable, $array) = unpack("nnnn", $dat); + + $fh->seek($subtableStart + $leftClassTable, IO::File::SEEK_SET); + $fh->read($dat, 4); + my ($firstGlyph, $nGlyphs) = unpack("nn", $dat); + $fh->read($dat, $nGlyphs * 2); + my $leftClasses = []; + foreach (TTF_Unpack("S*", $dat)) { + push @{$leftClasses->[($_ - $array) / $rowWidth]}, $firstGlyph++; + } + + $fh->seek($subtableStart + $rightClassTable, IO::File::SEEK_SET); + $fh->read($dat, 4); + ($firstGlyph, $nGlyphs) = unpack("nn", $dat); + $fh->read($dat, $nGlyphs * 2); + my $rightClasses = []; + foreach (TTF_Unpack("S*", $dat)) { + push @{$rightClasses->[$_ / 2]}, $firstGlyph++; + } + + $fh->seek($subtableStart + $array, IO::File::SEEK_SET); + $fh->read($dat, $self->{'length'} - $array); + + my $offset = 0; + my $kernArray = []; + while ($offset < length($dat)) { + push @$kernArray, [ TTF_Unpack("s*", substr($dat, $offset, $rowWidth)) ]; + $offset += $rowWidth; + } + + $self->{'leftClasses'} = $leftClasses; + $self->{'rightClasses'} = $rightClasses; + $self->{'kernArray'} = $kernArray; + + $fh->seek($subtableStart + $self->{'length'}, IO::File::SEEK_SET); + + $self; +} + +=head2 $t->out_sub($fh) + +Writes the table to a file + +=cut + +sub out_sub +{ +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + + my $post = $self->post(); + + $fh = 'STDOUT' unless defined $fh; + + +} + +sub dumpXML +{ + my ($self, $fh) = @_; + my $post = $self->post(); + + $fh = 'STDOUT' unless defined $fh; + $fh->printf("\n"); + $self->dumpClasses($self->{'leftClasses'}, $fh); + $fh->printf("\n"); + + $fh->printf("\n"); + $self->dumpClasses($self->{'rightClasses'}, $fh); + $fh->printf("\n"); + + $fh->printf("\n"); + my $kernArray = $self->{'kernArray'}; + foreach (0 .. $#$kernArray) { + $fh->printf("\n", $_); + my $row = $kernArray->[$_]; + foreach (0 .. $#$row) { + $fh->printf("\n", $_, $row->[$_]); + } + $fh->printf("\n"); + } + $fh->printf("\n"); +} + +sub type +{ + return 'kernClassArray'; +} + + + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/CompactClassArray.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/CompactClassArray.pm new file mode 100644 index 0000000..ab0304a --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/CompactClassArray.pm @@ -0,0 +1,93 @@ +package Font::TTF::Kern::CompactClassArray; + +=head1 NAME + +Font::TTF::Kern::CompactClassArray - Compact Class Array kern subtable for AAT + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; + +@ISA = qw(Font::TTF::Kern::Subtable); + +sub new +{ + my ($class) = @_; + my ($self) = {}; + + $class = ref($class) || $class; + bless $self, $class; +} + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self, $fh) = @_; + + die "incomplete"; + + $self; +} + +=head2 $t->out($fh) + +Writes the table to a file + +=cut + +sub out_sub +{ + my ($self, $fh) = @_; + + die "incomplete"; + + $self; +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + + my $post = $self->post(); + + $fh = 'STDOUT' unless defined $fh; + + die "incomplete"; +} + + +sub type +{ + return 'kernCompactClassArray'; +} + + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/OrderedList.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/OrderedList.pm new file mode 100644 index 0000000..41cc8c1 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/OrderedList.pm @@ -0,0 +1,108 @@ +package Font::TTF::Kern::OrderedList; + +=head1 NAME + +Font::TTF::Kern::OrderedList - Ordered List Kern subtable for AAT + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; + +@ISA = qw(Font::TTF::Kern::Subtable); + +sub new +{ + my ($class, @options) = @_; + my ($self) = {}; + + $class = ref($class) || $class; + bless $self, $class; +} + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self, $fh) = @_; + + my $dat; + $fh->read($dat, 8); + my ($nPairs, $searchRange, $entrySelector, $rangeShift) = unpack("nnnn", $dat); + + my $pairs = []; + foreach (1 .. $nPairs) { + $fh->read($dat, 6); + my ($left, $right, $kern) = TTF_Unpack("SSs", $dat); + push @$pairs, { 'left' => $left, 'right' => $right, 'kern' => $kern } if $kern != 0; + } + + $self->{'kernPairs'} = $pairs; + + $self; +} + +=head2 $t->out_sub($fh) + +Writes the table to a file + +=cut + +sub out_sub +{ + my ($self, $fh) = @_; + + my $pairs = $self->{'kernPairs'}; + $fh->print(pack("nnnn", TTF_bininfo(scalar @$pairs, 6))); + + foreach (sort { $a->{'left'} <=> $b->{'left'} or $a->{'right'} <=> $b->{'right'} } @$pairs) { + $fh->print(TTF_Pack("SSs", $_->{'left'}, $_->{'right'}, $_->{'kern'})); + } +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub dumpXML +{ + my ($self, $fh) = @_; + + my $postVal = $self->post()->{'VAL'}; + + $fh = 'STDOUT' unless defined $fh; + foreach (@{$self->{'kernPairs'}}) { + $fh->printf("\n", $postVal->[$_->{'left'}], $postVal->[$_->{'right'}], $_->{'kern'}); + } +} + + +sub type +{ + return 'kernOrderedList'; +} + + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/StateTable.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/StateTable.pm new file mode 100644 index 0000000..51d650a --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/StateTable.pm @@ -0,0 +1,143 @@ +package Font::TTF::Kern::StateTable; + +=head1 NAME + +Font::TTF::Kern::StateTable - State Table Kern subtable for AAT + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; +use Font::TTF::Kern::Subtable; +use IO::File; + +@ISA = qw(Font::TTF::Kern::Subtable); + +sub new +{ + my ($class) = @_; + my ($self) = {}; + + $class = ref($class) || $class; + bless $self, $class; +} + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self, $fh) = @_; + my ($dat); + + my $stTableStart = $fh->tell(); + + my ($classes, $states, $entries) = AAT_read_state_table($fh, 0); + + foreach (@$entries) { + my $flags = $_->{'flags'}; + delete $_->{'flags'}; + $_->{'push'} = 1 if $flags & 0x8000; + $_->{'noAdvance'} = 1 if $flags & 0x4000; + $flags &= ~0xC000; + if ($flags != 0) { + my $kernList = []; + $fh->seek($stTableStart + $flags, IO::File::SEEK_SET); + while (1) { + $fh->read($dat, 2); + my $k = TTF_Unpack("s", $dat); + push @$kernList, ($k & ~1); + last if ($k & 1) != 0; + } + $_->{'kernList'} = $kernList; + } + } + + $self->{'classes'} = $classes; + $self->{'states'} = $states; + $self->{'entries'} = $entries; + + $fh->seek($stTableStart - 8 + $self->{'length'}, IO::File::SEEK_SET); + + $self; +} + +=head2 $t->out_sub($fh) + +Writes the table to a file + +=cut + +sub out_sub +{ +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ +} + +sub dumpXML +{ + my ($self, $fh) = @_; + + $fh->printf("\n"); + $self->dumpClasses($self->{'classes'}, $fh); + $fh->printf("\n"); + + $fh->printf("\n"); + my $states = $self->{'states'}; + foreach (0 .. $#$states) { + $fh->printf("\n", $_); + my $members = $states->[$_]; + foreach (0 .. $#$members) { + my $m = $members->[$_]; + $fh->printf("{'nextState'}); + $fh->printf(" push=\"1\"") if $m->{'push'}; + $fh->printf(" noAdvance=\"1\"") if $m->{'noAdvance'}; + if (exists $m->{'kernList'}) { + $fh->printf(">"); + foreach (@{$m->{'kernList'}}) { + $fh->printf("", $_); + } + $fh->printf("\n"); + } + else { + $fh->printf("/>\n"); + } + } + $fh->printf("\n"); + } + $fh->printf("\n"); +} + +sub type +{ + return 'kernStateTable'; +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/Subtable.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/Subtable.pm new file mode 100644 index 0000000..b1db410 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Kern/Subtable.pm @@ -0,0 +1,175 @@ +package Font::TTF::Kern::Subtable; + +=head1 NAME + +Font::TTF::Kern::Subtable - Kern Subtable superclass for AAT + +=head1 METHODS + +=cut + +use strict; +use Font::TTF::Utils; +use Font::TTF::AATutils; +use IO::File; + +require Font::TTF::Kern::OrderedList; +require Font::TTF::Kern::StateTable; +require Font::TTF::Kern::ClassArray; +require Font::TTF::Kern::CompactClassArray; + +sub new +{ + my ($class) = @_; + my ($self) = {}; + + $class = ref($class) || $class; + + bless $self, $class; +} + +sub create +{ + my ($class, $type, $coverage, $length) = @_; + + $class = ref($class) || $class; + + my $subclass; + if ($type == 0) { + $subclass = 'Font::TTF::Kern::OrderedList'; + } + elsif ($type == 1) { + $subclass = 'Font::TTF::Kern::StateTable'; + } + elsif ($type == 2) { + $subclass = 'Font::TTF::Kern::ClassArray'; + } + elsif ($type == 3) { + $subclass = 'Font::TTF::Kern::CompactClassArray'; + } + + my @options; + push @options,'vertical' if ($coverage & 0x8000) != 0; + push @options,'crossStream' if ($coverage & 0x4000) != 0; + push @options,'variation' if ($coverage & 0x2000) != 0; + + my ($subTable) = $subclass->new(@options); + + map { $subTable->{$_} = 1 } @options; + + $subTable->{'type'} = $type; + $subTable->{'length'} = $length; + + $subTable; +} + +=head2 $t->out($fh) + +Writes the table to a file + +=cut + +sub out +{ + my ($self, $fh) = @_; + + my $subtableStart = $fh->tell(); + my $type = $self->{'type'}; + my $coverage = $type; + $coverage += 0x8000 if $self->{'vertical'}; + $coverage += 0x4000 if $self->{'crossStream'}; + $coverage += 0x2000 if $self->{'variation'}; + + $fh->print(TTF_Pack("LSS", 0, $coverage, $self->{'tupleIndex'})); # placeholder for length + + $self->out_sub($fh); + + my $length = $fh->tell() - $subtableStart; + my $padBytes = (4 - ($length & 3)) & 3; + $fh->print(pack("C*", (0) x $padBytes)); + $length += $padBytes; + $fh->seek($subtableStart, IO::File::SEEK_SET); + $fh->print(pack("N", $length)); + $fh->seek($subtableStart + $length, IO::File::SEEK_SET); +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub post +{ + my ($self) = @_; + + my $post = $self->{' PARENT'}{' PARENT'}{'post'}; + if (defined $post) { + $post->read; + } + else { + $post = {}; + } + + return $post; +} + +sub print +{ + my ($self, $fh) = @_; + + my $post = $self->post(); + $fh = 'STDOUT' unless defined $fh; +} + +=head2 $t->print_classes($fh) + +Prints a human-readable representation of the table + +=cut + +sub print_classes +{ + my ($self, $fh) = @_; + + my $post = $self->post(); + + my $classes = $self->{'classes'}; + foreach (0 .. $#$classes) { + my $class = $classes->[$_]; + if (defined $class) { + $fh->printf("\t\tClass %d:\t%s\n", $_, join(", ", map { $_ . " [" . $post->{'VAL'}[$_] . "]" } @$class)); + } + } +} + +sub dumpClasses +{ + my ($self, $classes, $fh) = @_; + my $post = $self->post(); + + foreach (0 .. $#$classes) { + my $c = $classes->[$_]; + if ($#$c > -1) { + $fh->printf("\n", $_); + foreach (@$c) { + $fh->printf("\n", $_, $post->{'VAL'}[$_]); + } + $fh->printf("\n"); + } + } +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/LTSH.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/LTSH.pm new file mode 100644 index 0000000..2b2dea6 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/LTSH.pm @@ -0,0 +1,88 @@ +package Font::TTF::LTSH; + +=head1 NAME + +Font::TTF::LTSH - Linear Threshold table + +=head1 DESCRIPTION + +Holds the linear threshold for each glyph. This is the ppem value at which a +glyph's metrics become linear. The value is set to 1 if a glyph's metrics are +always linear. + +=head1 INSTANCE VARIABLES + +=over 4 + +=item glyphs + +An array of ppem values. One value per glyph + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Table; + +@ISA = qw(Font::TTF::Table); + +=head2 $t->read + +Reads the table + +=cut + +sub read +{ + my ($self) = @_; + my ($fh) = $self->{' INFILE'}; + my ($numg, $dat); + + $self->SUPER::read or return $self; + + $fh->read($dat, 4); + ($self->{'Version'}, $numg) = unpack("nn", $dat); + $self->{'Num'} = $numg; + + $fh->read($dat, $numg); + $self->{'glyphs'} = [unpack("C$numg", $dat)]; + $self; +} + + +=head2 $t->out($fh) + +Outputs the LTSH to the given fh. + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + + return $self->SUPER::out($fh) unless ($self->{' read'}); + + $fh->print(pack("nn", 0, $numg)); + $fh->print(pack("C$numg", @{$self->{'glyphs'}})); + $self; +} + + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Loca.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Loca.pm new file mode 100644 index 0000000..ca641bb --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Loca.pm @@ -0,0 +1,183 @@ +package Font::TTF::Loca; + +=head1 NAME + +Font::TTF::Loca - the Locations table, which is intimately tied to the glyf table + +=head1 DESCRIPTION + +The location table holds the directory of locations of each glyph within the +glyf table. Due to this relationship and the unimportance of the actual locations +when it comes to holding glyphs in memory, reading the location table results +in the creation of glyph objects for each glyph and stores them here. +So if you are looking for glyphs, don't look in the C table, look here +instead. + +Things get complicated if you try to change the glyph list within the one table. +The recommendation is to create another clean location object to replace this +table in the font, ensuring that the old table is read first and to transfer +or copy glyphs across from the read table to the new table. + +=head1 INSTANCE VARIABLES + +The instance variables do not start with a space + +=over 4 + +=item glyphs + +An array of glyph objects for each glyph. + +=item glyphtype + +A string containing the class name to create for each new glyph. If empty, +defaults to L. + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +@ISA = qw(Font::TTF::Table); + +require Font::TTF::Glyph; + + +=head2 $t->new + +Creates a new location table making sure it has a glyphs array + +=cut + +sub new +{ + my ($class) = shift; + my ($res) = $class->SUPER::new(@_); + $res->{'glyphs'} = []; + $res; +} + +=head2 $t->read + +Reads the location table creating glyph objects (L) for each glyph +allowing their later reading. + +=cut + +sub read +{ + my ($self) = @_; + my ($fh) = $self->{' INFILE'}; + my ($locFmt) = $self->{' PARENT'}{'head'}{'indexToLocFormat'}; + my ($numGlyphs) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + my ($glyfLoc) = $self->{' PARENT'}{'glyf'}{' OFFSET'}; + my ($dat, $last, $i, $loc); + + $self->SUPER::read or return $self; + $fh->read($dat, $locFmt ? 4 : 2); + $last = unpack($locFmt ? "N" : "n", $dat); + for ($i = 0; $i < $numGlyphs; $i++) + { + $fh->read($dat, $locFmt ? 4 : 2); + $loc = unpack($locFmt ? "N" : "n", $dat); + $self->{'glyphs'}[$i] = ($self->{'glyphtype'} || "Font::TTF::Glyph")->new( + LOC => $last << ($locFmt ? 0 : 1), + OUTLOC => $last << ($locFmt ? 0 : 1), + PARENT => $self->{' PARENT'}, + INFILE => $fh, + BASE => $glyfLoc, + OUTLEN => ($loc - $last) << ($locFmt ? 0 : 1), + LEN => ($loc - $last) << ($locFmt ? 0 : 1)) if ($loc != $last); + $last = $loc; + } + $self; +} + + +=head2 $t->out($fh) + +Writes the location table out to $fh. Notice that not having read the location +table implies that the glyf table has not been read either, so the numbers in +the location table are still valid. Let's hope that C and +C haven't changed otherwise we are in big trouble. + +The function uses the OUTLOC location in the glyph calculated when the glyf +table was attempted to be output. + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($locFmt) = $self->{' PARENT'}{'head'}{'indexToLocFormat'}; + my ($numGlyphs) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + my ($count, $i, $offset, $g); + + return $self->SUPER::out($fh) unless ($self->{' read'}); + + $count = 0; + for ($i = 0; $i < $numGlyphs; $i++) + { + $g = ($self->{'glyphs'}[$i]) || ""; + unless ($g) + { + $count++; + next; + } else + { + if ($locFmt) + { $fh->print(pack("N", $g->{' OUTLOC'}) x ($count + 1)); } + else + { $fh->print(pack("n", $g->{' OUTLOC'} >> 1) x ($count + 1)); } + $count = 0; + $offset = $g->{' OUTLOC'} + $g->{' OUTLEN'}; + } + } + $fh->print(pack($locFmt ? "N" : "n", ($locFmt ? $offset: $offset >> 1)) x ($count + 1)); +} + + +=head2 $t->out_xml($context, $depth) + +No need to output a loca table, this is dynamically generated + +=cut + +sub out_xml +{ return $_[0]; } + + +=head2 $t->glyphs_do(&func) + +Calls func for each glyph in this location table in numerical order: + + &func($glyph, $glyph_num) + +=cut + +sub glyphs_do +{ + my ($self, $func) = @_; + my ($i); + + for ($i = 0; $i <= $#{$self->{'glyphs'}}; $i++) + { &$func($self->{'glyphs'}[$i], $i) if defined $self->{'glyphs'}[$i]; } + $self; +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Manual.pod b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Manual.pod new file mode 100644 index 0000000..c6d2938 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Manual.pod @@ -0,0 +1,214 @@ + +=head1 NAME + +Font::TTF::Manual - Information regarding the whole module set + +=head1 INTRODUCTION + +This document looks at the whole issue of how the various modules in the +TrueType Font work together. As such it is partly information on this font +system and partly information on TrueType fonts in general. + +Due to the inter-relation between so many tables in a TrueType font, different +tables will make expectations as to which other tables exist. At the very least +a font should consist of a C table and a C table. The system has +been designed around the expectation that the necessary tables for font +rendering in the Windows environment exist. But inter table dependencies have +been kept to what are considered necessary. + +This module set is not meant as a simple to use, mindless, font editing suite, +but as a low-level, get your hands dirty, know what you are doing, set of +classes for those who understand the intricacies (and there are many) of +TrueType fonts. To this end, if you get something wrong in the data structures, +etc. then this module set won't tell you and will happily create fonts which +don't work. + +At the time of writing, not every TrueType table in existence has been +implemented! Only the core basic tables of TrueType 1.0 (i.e. no embedded bitmap +tables, no postscript type tables, no OpenType tables and no GX tables) have +been implemented. If you want to help by implementing another table or two, then +please go ahead and send me your code. For a full list of tables, see +L. + + +=head2 Design Principles + +PERL is not C++. C++ encourages methods to be written for changing and reading +each instance variable in a class. If we did this in this PERL program the +results would be rather large and slow. Instead, since most access will be read +access, we expose as much of the inner storage of an object to user access +directly via hash lookup. The advantage this gives are great. For example, by +following an instance variable chain, looking up the C parameter for a +particular glyph becomes: + + $f->{'loca'}{'glyphs'}[$glyph]{'yMax'} + +Or, if we are feeling very lazy and don't mind waiting: + + $f->{'loca'}{'glyphs'}[$f->{'cmap'}->ms_lookup(0x41)]{'yMax'} + +The disadvantage of this method is that it behoves module users to behave +themselves. Thus it does not hold your hand and ensure that if you make a change +to a table, that the table is marked as I, or that other tables are +updated accordingly. + +It is up to the application developer to understand the implications of the +changes they make to a font, and to take the necessary action to ensure that the +data they get out is what they want. Thus, you could go and change the C +value on a glyph and output a new font with this change, but it is up to you to +ensure that the font's bounding box details in the C table are correct, +and even that your changing C is well motivated. + +To help with using the system, each module (or table) will not only describe the +methods it supports, which are relatively few, but also the instance variables +it supports, which are many. Most of the variables directly reflect table +attributes as specified in the OpenType specification, available from Microsoft +(L), Adobe and Apple. A list of the names +used is also given in each module, but not necessarily with any further +description. After all, this code is not a TrueType manual as well! + + +=head2 Conventions + +There are various conventions used in this system. + +Firstly we consider the documentation conventions regarding instance variables. +Each instance variable is marked indicating whether it is a B<(P)>rivate +variable which users of the module are not expected to read and certainly not +write to or a B<(R)>ead only variable which users may well want to read but not +write to. + + +=head1 METHODS + +This section examines various methods and how the various modules work with +these methods. + + +=head2 read and read_dat + +Before the data structures for a table can be accessed, they need to be filled +in from somewhere. The usual way to do this is to read an existing TrueType +font. This may be achieved by: + + $f = Font::TTF::Font->open($filename) || die "Unable to read $filename"; + +This will open an existing font and read its directory header. Notice that at +this point, none of the tables in the font have been read. (Actually, the +C and C tables are read at this point too since they contain the +commonly required parameters of): + + $f->{'head'}{'unitsPerEm'} + $f->{'maxp'}{'numGlyphs'} + +In order to be able to access information from a table, it is first necessary to +C it. Consider trying to find the advance width of a space character +(U+0020). The following code should do it: + + $f = Font::TTF::Font->open($ARGV[0]); + $snum = $f->{'cmap'}->ms_lookup(0x0020); + $sadv = $f->{'hmtx'}{'advance'}[$snum]; + print $sadv; + +This would result in the value zero being printed, which is far from correct. +But why? The first line would correctly read the font directory. The second line +would, incidently, correctly locate the space character in the Windows cmap +(assuming a non symbol encoded font). The third line would not succeed in its +task since the C table has not been filled in from the font file. To +achieve what we want we would first need to cause it to be read: + + $f->{'hmtx'}->read; + $sadv = $f->{'hmtx'}{'advance'}[$snum]; + +Or for those who are too lazy to write multiple lines, C returns the +object it reads. Thus we could write: + + $sadv = $f->{'hmtx'}->read->{'advance'}[$snum]; + +Why, if we always have to read tables before accessing information from them, +did we not have to do this for the C table? The answer lies in the method +call. It senses that the table hasn't been read and reads it for us. This will +generally happen with all method calls, it is only when we do direct data access +that we have to take the responsibility to read the table first. + +Reading a table does not necessarily result in all the data being placed into +internal data structures. In the case of a simple table C is sufficient. +In fact, the normal case is that C reads the data from the file into +an instance variable called C<' dat'> (including the space) and not into the +data structures. + +This is true except for the C class which represents a single glyph. Here +the process is reversed. Reading a C reads the data for the glyph into +the C<' dat'> instance variable and sets various header attributes for the glyph +(C, C, etc.). The data is converted out of the variable into +data structures via the C method. + +The aim, therefore, is that C should do the natural thing (read into data +structures for those tables and elements for which it is helpful -- all except +C at present) and C should do the unnatural thing: read just +the binary data for normal tables and convert binary data to data structures for +Cs. + +In summary, therefore, use C unless you want to hack around with the +internals of glyphs in which case see L for more details. + + +=head2 update + +The aim of this method is to allow the various data elements in a C font +to update themselves. All tables know how to update themselves. All tables also +contain information which cannot be I but is new knowledge in the font. +As a result, certain tables do nothing when they are updated. We can, therefore, +build an update hierarchy of tables, with the independent tables at the bottom +and C at the top: + + +--loca + | + glyf--+--maxp + | + +---+--head + | + hmtx------+--hhea + + cmap-----OS/2 + + name-- + + post-- + +There is an important universal dependency which it is up to the user to +keep up to date. This is C which is used to iterate over all +the glyphs. Note that the glyphs themselves are not held in the C table +but in the C table, so adding glyphs, etc. automatically involves keeping +the C table up to date. + +=head2 Creating fonts + +Suppose we were creating a font from scratch. How much information do we need +to supply and how much will C do for us? + +The following information is required: + + $f->{'loca'}{'glyphs'} + $f->{'head'}{'upem'} + $f->{'maxp'}{'numGlyphs'} (doesn't come from $f->{'loca'}{'glyphs'}) + $f->{'hmtx'}{'advance'} + $f->{'post'}['format'} + $f->{'post'}{'VAL'} + $f->{'cmap'} + $f->{'name'} + +Pretty much everything else is calculated for you. Details of what is needed +for a glyph may be found in L. Once we have all the +information we need (and there is lots more that you could add) then we simply + + $f->dirty; # mark all tables dirty + $f->update; # update the font + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Maxp.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Maxp.pm new file mode 100644 index 0000000..e2d81b9 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Maxp.pm @@ -0,0 +1,177 @@ +package Font::TTF::Maxp; + +=head1 NAME + +Font::TTF::Maxp - Maximum Profile table in a font + +=head1 DESCRIPTION + +A collection of useful instance variables following the TTF standard. Probably +the most used being C. Note that this particular value is +foundational and should be kept up to date by the application, it is not updated +by C. + +Handles table versions 0.5, 1.0 + +=head1 INSTANCE VARIABLES + +No others beyond those specified in the standard: + + numGlyphs + maxPoints + maxContours + maxCompositePoints + maxCompositeContours + maxZones + maxTwilightPoints + maxStorage + maxFunctionDefs + maxInstructionDefs + maxStackElements + maxSizeOfInstructions + maxComponentElements + maxComponentDepth + + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA %fields @field_info); +use Font::TTF::Utils; + +@ISA = qw(Font::TTF::Table); +@field_info = ( + 'numGlyphs' => 'S', + 'maxPoints' => 'S', + 'maxContours' => 'S', + 'maxCompositePoints' => 'S', + 'maxCompositeContours' => 'S', + 'maxZones' => 'S', + 'maxTwilightPoints' => 'S', + 'maxStorage' => 'S', + 'maxFunctionDefs' => 'S', + 'maxInstructionDefs' => 'S', + 'maxStackElements' => 'S', + 'maxSizeOfInstructions' => 'S', + 'maxComponentElements' => 'S', + 'maxComponentDepth' => 'S'); + +sub init +{ + my ($k, $v, $c, $i); + for ($i = 0; $i < $#field_info; $i += 2) + { + ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); + next unless defined $k && $k ne ""; + $fields{$k} = $v; + } +} + + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self) = @_; + my ($dat); + + $self->SUPER::read or return $self; + + init unless defined $fields{'numGlyphs'}; # any key would do + $self->{' INFILE'}->read($dat, 4); + $self->{'version'} = TTF_Unpack("v", $dat); + + if ($self->{'version'} == 0.5) + { + $self->{' INFILE'}->read($dat, 2); + $self->{'numGlyphs'} = unpack("n", $dat); + } else + { + $self->{' INFILE'}->read($dat, 28); + TTF_Read_Fields($self, $dat, \%fields); + } + $self; +} + + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying. + +=cut + +sub out +{ + my ($self, $fh) = @_; + + return $self->SUPER::out($fh) unless $self->{' read'}; + $fh->print(TTF_Pack("v", $self->{'version'})); + + if ($self->{'version'} == 0.5) + { $fh->print(pack("n", $self->{'numGlyphs'})); } + else + { $fh->print(TTF_Out_Fields($self, \%fields, 28)); } + $self; +} + + +=head2 $t->update + +Calculates all the maximum values for a font based on the glyphs in the font. +Only those fields which require hinting code interpretation are ignored and +left as they were read. + +=cut + +sub update +{ + my ($self) = @_; + my ($i, $num, @n, @m, $j); + my (@name) = qw(maxPoints maxContours maxCompositePoints maxCompositeContours + maxSizeOfInstructions maxComponentElements maxComponentDepth); + + return undef unless ($self->SUPER::update); + return undef if ($self->{'version'} == 0.5); # only got numGlyphs + return undef unless (defined $self->{' PARENT'}{'loca'}); + $self->{' PARENT'}{'loca'}->update; + $num = $self->{'numGlyphs'}; + + for ($i = 0; $i < $num; $i++) + { + my ($g) = $self->{' PARENT'}{'loca'}{'glyphs'}[$i] || next; + + @n = $g->maxInfo; + + for ($j = 0; $j <= $#n; $j++) + { $m[$j] = $n[$j] if $n[$j] > $m[$j]; } + } + + foreach ('prep', 'fpgm') + { $m[4] = length($self->{' PARENT'}{$_}{' dat'}) + if (defined $self->{' PARENT'}{$_} + && length($self->{' PARENT'}{$_}{' dat'}) > $m[4]); + } + + for ($j = 0; $j <= $#name; $j++) + { $self->{$name[$j]} = $m[$j]; } + $self; +} +1; + + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort.pm new file mode 100644 index 0000000..6e954cb --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort.pm @@ -0,0 +1,108 @@ +package Font::TTF::Mort; + +=head1 NAME + +Font::TTF::Mort - Glyph Metamorphosis table in a font + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; +use Font::TTF::Mort::Chain; + +@ISA = qw(Font::TTF::Table); + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self) = @_; + my ($dat, $fh, $numChains); + + $self->SUPER::read or return $self; + + $fh = $self->{' INFILE'}; + + $fh->read($dat, 8); + ($self->{'version'}, $numChains) = TTF_Unpack("vL", $dat); + + my $chains = []; + foreach (1 .. $numChains) { + my $chain = new Font::TTF::Mort::Chain->new; + $chain->read($fh); + $chain->{' PARENT'} = $self; + push @$chains, $chain; + } + + $self->{'chains'} = $chains; + + $self; +} + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying + +=cut + +sub out +{ + my ($self, $fh) = @_; + + return $self->SUPER::out($fh) unless $self->{' read'}; + + my $chains = $self->{'chains'}; + $fh->print(TTF_Pack("vL", $self->{'version'}, scalar @$chains)); + + foreach (@$chains) { + $_->out($fh); + } +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + + $self->read unless $self->{' read'}; + my $feat = $self->{' PARENT'}->{'feat'}; + $feat->read; + my $post = $self->{' PARENT'}->{'post'}; + $post->read; + + $fh = 'STDOUT' unless defined $fh; + + $fh->printf("version %f\n", $self->{'version'}); + + my $chains = $self->{'chains'}; + foreach (@$chains) { + $_->print($fh); + } +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Chain.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Chain.pm new file mode 100644 index 0000000..b8e7b93 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Chain.pm @@ -0,0 +1,196 @@ +package Font::TTF::Mort::Chain; + +=head1 NAME + +Font::TTF::Mort::Chain - Chain Mort subtable for AAT + +=cut + +use strict; +use Font::TTF::Utils; +use Font::TTF::AATutils; +use Font::TTF::Mort::Subtable; +use IO::File; + +=head2 $t->new + +=cut + +sub new +{ + my ($class, %parms) = @_; + my ($self) = {}; + my ($p); + + $class = ref($class) || $class; + foreach $p (keys %parms) + { $self->{" $p"} = $parms{$p}; } + bless $self, $class; +} + +=head2 $t->read($fh) + +Reads the chain into memory + +=cut + +sub read +{ + my ($self, $fh) = @_; + my ($dat); + + my $chainStart = $fh->tell(); + $fh->read($dat, 12); + my ($defaultFlags, $chainLength, $nFeatureEntries, $nSubtables) = TTF_Unpack("LLSS", $dat); + + my $featureEntries = []; + foreach (1 .. $nFeatureEntries) { + $fh->read($dat, 12); + my ($featureType, $featureSetting, $enableFlags, $disableFlags) = TTF_Unpack("SSLL", $dat); + push @$featureEntries, { + 'type' => $featureType, + 'setting' => $featureSetting, + 'enable' => $enableFlags, + 'disable' => $disableFlags + }; + } + + my $subtables = []; + foreach (1 .. $nSubtables) { + my $subtableStart = $fh->tell(); + + $fh->read($dat, 8); + my ($length, $coverage, $subFeatureFlags) = TTF_Unpack("SSL", $dat); + my $type = $coverage & 0x0007; + + my $subtable = Font::TTF::Mort::Subtable->create($type, $coverage, $subFeatureFlags, $length); + $subtable->read($fh); + $subtable->{' PARENT'} = $self; + + push @$subtables, $subtable; + $fh->seek($subtableStart + $length, IO::File::SEEK_SET); + } + + $self->{'defaultFlags'} = $defaultFlags; + $self->{'featureEntries'} = $featureEntries; + $self->{'subtables'} = $subtables; + + $fh->seek($chainStart + $chainLength, IO::File::SEEK_SET); + + $self; +} + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying + +=cut + +sub out +{ + my ($self, $fh) = @_; + + my $chainStart = $fh->tell(); + my ($featureEntries, $subtables) = ($_->{'featureEntries'}, $_->{'subtables'}); + $fh->print(TTF_Pack("LLSS", $_->{'defaultFlags'}, 0, scalar @$featureEntries, scalar @$subtables)); # placeholder for length + + foreach (@$featureEntries) { + $fh->print(TTF_Pack("SSLL", $_->{'type'}, $_->{'setting'}, $_->{'enable'}, $_->{'disable'})); + } + + foreach (@$subtables) { + $_->out($fh); + } + + my $chainLength = $fh->tell() - $chainStart; + $fh->seek($chainStart + 4, IO::File::SEEK_SET); + $fh->print(pack("N", $chainLength)); + $fh->seek($chainStart + $chainLength, IO::File::SEEK_SET); +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the chain + +=cut + +sub feat +{ + my ($self) = @_; + + my $feat = $self->{' PARENT'}{' PARENT'}{'feat'}; + if (defined $feat) { + $feat->read; + } + else { + $feat = {}; + } + + return $feat; +} + +sub print +{ + my ($self, $fh) = @_; + + $fh->printf("version %f\n", $self->{'version'}); + + my $defaultFlags = $self->{'defaultFlags'}; + $fh->printf("chain: defaultFlags = %08x\n", $defaultFlags); + + my $feat = $self->feat(); + my $featureEntries = $self->{'featureEntries'}; + foreach (@$featureEntries) { + $fh->printf("\tfeature %d, setting %d : enableFlags = %08x, disableFlags = %08x # '%s: %s'\n", + $_->{'type'}, $_->{'setting'}, $_->{'enable'}, $_->{'disable'}, + $feat->settingName($_->{'type'}, $_->{'setting'})); + } + + my $subtables = $self->{'subtables'}; + foreach (@$subtables) { + my $type = $_->{'type'}; + my $subFeatureFlags = $_->{'subFeatureFlags'}; + $fh->printf("\n\t%s table, %s, %s, subFeatureFlags = %08x # %s (%s)\n", + subtable_type_($type), $_->{'direction'}, $_->{'orientation'}, $subFeatureFlags, + "Default " . ((($subFeatureFlags & $defaultFlags) != 0) ? "On" : "Off"), + join(", ", + map { + join(": ", $feat->settingName($_->{'type'}, $_->{'setting'}) ) + } grep { ($_->{'enable'} & $subFeatureFlags) != 0 } @$featureEntries + ) ); + + $_->print($fh); + } +} + +sub subtable_type_ +{ + my ($val) = @_; + my ($res); + + my @types = ( + 'Rearrangement', + 'Contextual', + 'Ligature', + undef, + 'Non-contextual', + 'Insertion', + ); + $res = $types[$val] or ('Undefined (' . $val . ')'); + + $res; +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Contextual.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Contextual.pm new file mode 100644 index 0000000..fecc519 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Contextual.pm @@ -0,0 +1,157 @@ +package Font::TTF::Mort::Contextual; + +=head1 NAME + +Font::TTF::Mort::Contextual - Contextual Mort subtable for AAT + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; +use Font::TTF::Mort::Subtable; +use IO::File; + +@ISA = qw(Font::TTF::AAT::Mort::Subtable); + +sub new +{ + my ($class, $direction, $orientation, $subFeatureFlags) = @_; + my ($self) = { + 'direction' => $direction, + 'orientation' => $orientation, + 'subFeatureFlags' => $subFeatureFlags + }; + + $class = ref($class) || $class; + bless $self, $class; +} + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self, $fh) = @_; + my ($dat); + + my $stateTableStart = $fh->tell(); + my ($classes, $states, $entries) = AAT_read_state_table($fh, 2); + + $fh->seek($stateTableStart, IO::File::SEEK_SET); + $fh->read($dat, 10); + my ($stateSize, $classTable, $stateArray, $entryTable, $mappingTables) = unpack("nnnnn", $dat); + my $limits = [$classTable, $stateArray, $entryTable, $mappingTables, $self->{'length'} - 8]; + + foreach (@$entries) { + my $actions = $_->{'actions'}; + foreach (@$actions) { + $_ = $_ ? $_ - ($mappingTables / 2) : undef; + } + } + + $self->{'classes'} = $classes; + $self->{'states'} = $states; + $self->{'mappings'} = [unpack("n*", AAT_read_subtable($fh, $stateTableStart, $mappingTables, $limits))]; + + $self; +} + +=head2 $t->pack_sub() + +=cut + +sub pack_sub +{ + my ($self) = @_; + + my ($dat) = pack("nnnnn", (0) x 5); # placeholders for stateSize, classTable, stateArray, entryTable, mappingTables + + my $classTable = length($dat); + my $classes = $self->{'classes'}; + $dat .= AAT_pack_classes($classes); + + my $stateArray = length($dat); + my $states = $self->{'states'}; + my ($dat1, $stateSize, $entries) = AAT_pack_states($classes, $stateArray, $states, + sub { + my $actions = $_->{'actions'}; + ( $_->{'flags'}, @$actions ) + } + ); + $dat .= $dat1; + + my $entryTable = length($dat); + my $offset = ($entryTable + 8 * @$entries) / 2; + foreach (@$entries) { + my ($nextState, $flags, @parts) = split /,/; + $dat .= pack("nnnn", $nextState, $flags, map { $_ eq "" ? 0 : $_ + $offset } @parts); + } + + my $mappingTables = length($dat); + my $mappings = $self->{'mappings'}; + $dat .= pack("n*", @$mappings); + + $dat1 = pack("nnnnn", $stateSize, $classTable, $stateArray, $entryTable, $mappingTables); + substr($dat, 0, length($dat1)) = $dat1; + + return $dat; +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + + my $post = $self->post(); + + $fh = 'STDOUT' unless defined $fh; + + $self->print_classes($fh); + + $fh->print("\n"); + my $states = $self->{'states'}; + foreach (0 .. $#$states) { + $fh->printf("\t\tState %d:", $_); + my $state = $states->[$_]; + foreach (@$state) { + my $flags; + $flags .= "!" if ($_->{'flags'} & 0x4000); + $flags .= "*" if ($_->{'flags'} & 0x8000); + my $actions = $_->{'actions'}; + $fh->printf("\t(%s%d,%s,%s)", $flags, $_->{'nextState'}, map { defined $_ ? $_ : "=" } @$actions); + } + $fh->print("\n"); + } + + $fh->print("\n"); + my $mappings = $self->{'mappings'}; + foreach (0 .. $#$mappings) { + $fh->printf("\t\tMapping %d: %d [%s]\n", $_, $mappings->[$_], $post->{'VAL'}[$mappings->[$_]]); + } +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Insertion.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Insertion.pm new file mode 100644 index 0000000..d10018b --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Insertion.pm @@ -0,0 +1,179 @@ +package Font::TTF::Mort::Insertion; + +=head1 NAME + +Font::TTF::Mort::Insertion - Insertion Mort subtable for AAT + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; +use IO::File; + +@ISA = qw(Font::TTF::Mort::Subtable); + +sub new +{ + my ($class, $direction, $orientation, $subFeatureFlags) = @_; + my ($self) = { + 'direction' => $direction, + 'orientation' => $orientation, + 'subFeatureFlags' => $subFeatureFlags + }; + + $class = ref($class) || $class; + bless $self, $class; +} + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self, $fh) = @_; + my ($dat); + + my $subtableStart = $fh->tell(); + + my $stateTableStart = $fh->tell(); + my ($classes, $states, $entries) = AAT_read_state_table($fh, 2); + + my %insertListHash; + my $insertLists; + foreach (@$entries) { + my $flags = $_->{'flags'}; + my @insertCount = (($flags & 0x03e0) >> 5, ($flags & 0x001f)); + my $actions = $_->{'actions'}; + foreach (0 .. 1) { + if ($insertCount[$_] > 0) { + $fh->seek($stateTableStart + $actions->[$_], IO::File::SEEK_SET); + $fh->read($dat, $insertCount[$_] * 2); + if (not defined $insertListHash{$dat}) { + push @$insertLists, [unpack("n*", $dat)]; + $insertListHash{$dat} = $#$insertLists; + } + $actions->[$_] = $insertListHash{$dat}; + } + else { + $actions->[$_] = undef; + } + } + } + + $self->{'classes'} = $classes; + $self->{'states'} = $states; + $self->{'insertLists'} = $insertLists; + + $self; +} + +=head2 $t->pack_sub() + +=cut + +sub pack_sub +{ + my ($self) = @_; + + my ($dat) = pack("nnnn", (0) x 4); + + my $classTable = length($dat); + my $classes = $self->{'classes'}; + $dat .= AAT_pack_classes($classes); + + my $stateArray = length($dat); + my $states = $self->{'states'}; + my ($dat1, $stateSize, $entries) = AAT_pack_states($classes, $stateArray, $states, + sub { + my $actions = $_->{'actions'}; + ( $_->{'flags'}, @$actions ) + } + ); + $dat .= $dat1; + + my $entryTable = length($dat); + my $offset = ($entryTable + 8 * @$entries); + my @insListOffsets; + my $insertLists = $self->{'insertLists'}; + foreach (@$insertLists) { + push @insListOffsets, $offset; + $offset += 2 * scalar @$_; + } + foreach (@$entries) { + my ($nextState, $flags, @lists) = split /,/; + $flags &= ~0x03ff; + $flags |= (scalar @{$insertLists->[$lists[0]]}) << 5 if $lists[0] ne ''; + $flags |= (scalar @{$insertLists->[$lists[1]]}) if $lists[1] ne ''; + $dat .= pack("nnnn", $nextState, $flags, + map { $_ eq '' ? 0 : $insListOffsets[$_] } @lists); + } + + foreach (@$insertLists) { + $dat .= pack("n*", @$_); + } + + $dat1 = pack("nnnn", $stateSize, $classTable, $stateArray, $entryTable); + substr($dat, 0, length($dat1)) = $dat1; + + return $dat; +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + + my $post = $self->post(); + + $fh = 'STDOUT' unless defined $fh; + + $self->print_classes($fh); + + $fh->print("\n"); + my $states = $self->{'states'}; + foreach (0 .. $#$states) { + $fh->printf("\t\tState %d:", $_); + my $state = $states->[$_]; + foreach (@$state) { + my $flags; + $flags .= "!" if ($_->{'flags'} & 0x4000); + $flags .= "*" if ($_->{'flags'} & 0x8000); + my $actions = $_->{'actions'}; + $fh->printf("\t(%s%d,%s,%s)", $flags, $_->{'nextState'}, map { defined $_ ? $_ : "=" } @$actions); + } + $fh->print("\n"); + } + + $fh->print("\n"); + my $insertLists = $self->{'insertLists'}; + foreach (0 .. $#$insertLists) { + my $insertList = $insertLists->[$_]; + $fh->printf("\t\tList %d: %s\n", $_, join(", ", map { $_ . " [" . $post->{'VAL'}[$_] . "]" } @$insertList)); + } +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Ligature.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Ligature.pm new file mode 100644 index 0000000..c5cc912 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Ligature.pm @@ -0,0 +1,246 @@ +package Font::TTF::Mort::Ligature; + +=head1 NAME + +Font::TTF::Mort::Ligature - Ligature Mort subtable for AAT + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; +use IO::File; + +@ISA = qw(Font::TTF::Mort::Subtable); + +sub new +{ + my ($class, $direction, $orientation, $subFeatureFlags) = @_; + my ($self) = { + 'direction' => $direction, + 'orientation' => $orientation, + 'subFeatureFlags' => $subFeatureFlags + }; + + $class = ref($class) || $class; + bless $self, $class; +} + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self, $fh) = @_; + my ($dat); + + my $stateTableStart = $fh->tell(); + my ($classes, $states, $entries) = AAT_read_state_table($fh, 0); + + $fh->seek($stateTableStart, IO::File::SEEK_SET); + $fh->read($dat, 14); + my ($stateSize, $classTable, $stateArray, $entryTable, + $ligActionTable, $componentTable, $ligatureTable) = unpack("nnnnnnn", $dat); + my $limits = [$classTable, $stateArray, $entryTable, $ligActionTable, $componentTable, $ligatureTable, $self->{'length'} - 8]; + + my %actions; + my $actionLists; + foreach (@$entries) { + my $offset = $_->{'flags'} & 0x3fff; + $_->{'flags'} &= ~0x3fff; + if ($offset != 0) { + if (not defined $actions{$offset}) { + $fh->seek($stateTableStart + $offset, IO::File::SEEK_SET); + my $actionList; + while (1) { + $fh->read($dat, 4); + my $action = unpack("N", $dat); + my ($last, $store, $component) = (($action & 0x80000000) != 0, ($action & 0xC0000000) != 0, ($action & 0x3fffffff)); + $component -= 0x40000000 if $component > 0x1fffffff; + $component -= $componentTable / 2; + push @$actionList, { 'store' => $store, 'component' => $component }; + last if $last; + } + push @$actionLists, $actionList; + $actions{$offset} = $#$actionLists; + } + $_->{'actions'} = $actions{$offset}; + } + } + + $self->{'componentTable'} = $componentTable; + my $components = [unpack("n*", AAT_read_subtable($fh, $stateTableStart, $componentTable, $limits))]; + foreach (@$components) { + $_ = ($_ - $ligatureTable) . " +" if $_ >= $ligatureTable; + } + $self->{'components'} = $components; + + $self->{'ligatureTable'} = $ligatureTable; + $self->{'ligatures'} = [unpack("n*", AAT_read_subtable($fh, $stateTableStart, $ligatureTable, $limits))]; + + $self->{'classes'} = $classes; + $self->{'states'} = $states; + $self->{'actionLists'} = $actionLists; + + $self; +} + +=head2 $t->pack_sub($fh) + +=cut + +sub pack_sub +{ + my ($self) = @_; + my ($dat); + + $dat .= pack("nnnnnnn", (0) x 7); # placeholders for stateSize, classTable, stateArray, entryTable, actionLists, components, ligatures + + my $classTable = length($dat); + my $classes = $self->{'classes'}; + $dat .= AAT_pack_classes($classes); + + my $stateArray = length($dat); + my $states = $self->{'states'}; + + my ($dat1, $stateSize, $entries) = AAT_pack_states($classes, $stateArray, $states, + sub { + ( $_->{'flags'} & 0xc000, $_->{'actions'} ) + } + ); + $dat .= $dat1; + + my $actionLists = $self->{'actionLists'}; + my %actionListOffset; + my $actionListDataLength = 0; + my @actionListEntries; + foreach (0 .. $#$entries) { + my ($nextState, $flags, $offset) = split(/,/, $entries->[$_]); + if ($offset eq "") { + $offset = undef; + } + else { + if (defined $actionListOffset{$offset}) { + $offset = $actionListOffset{$offset}; + } + else { + $actionListOffset{$offset} = $actionListDataLength; + my $list = $actionLists->[$offset]; + $actionListDataLength += 4 * @$list; + push @actionListEntries, $list; + $offset = $actionListOffset{$offset}; + } + } + $entries->[$_] = [ $nextState, $flags, $offset ]; + } + my $entryTable = length($dat); + my $ligActionLists = ($entryTable + @$entries * 4 + 3) & ~3; + foreach (@$entries) { + $_->[2] += $ligActionLists if defined $_->[2]; + $dat .= pack("nn", $_->[0], $_->[1] + $_->[2]); + } + $dat .= pack("C*", (0) x ($ligActionLists - $entryTable - @$entries * 4)); + + die "internal error" unless length($dat) == $ligActionLists; + + my $componentTable = length($dat) + $actionListDataLength; + my $actionList; + foreach $actionList (@actionListEntries) { + foreach (0 .. $#$actionList) { + my $action = $actionList->[$_]; + my $val = $action->{'component'} + $componentTable / 2; + $val += 0x40000000 if $val < 0; + $val &= 0x3fffffff; + $val |= 0x40000000 if $action->{'store'}; + $val |= 0x80000000 if $_ == $#$actionList; + $dat .= pack("N", $val); + } + } + + die "internal error" unless length($dat) == $componentTable; + + my $components = $self->{'components'}; + my $ligatureTable = $componentTable + @$components * 2; + $dat .= pack("n*", map { (index($_, '+') >= 0 ? $ligatureTable : 0) + $_ } @$components); + + my $ligatures = $self->{'ligatures'}; + $dat .= pack("n*", @$ligatures); + + $dat1 = pack("nnnnnnn", $stateSize, $classTable, $stateArray, $entryTable, $ligActionLists, $componentTable, $ligatureTable); + substr($dat, 0, length($dat1)) = $dat1; + + return $dat; +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + + my $post = $self->post(); + + $fh = 'STDOUT' unless defined $fh; + + $self->print_classes($fh); + + $fh->print("\n"); + my $states = $self->{'states'}; + foreach (0 .. $#$states) { + $fh->printf("\t\tState %d:", $_); + my $state = $states->[$_]; + foreach (@$state) { + my $flags; + $flags .= "!" if ($_->{'flags'} & 0x4000); + $flags .= "*" if ($_->{'flags'} & 0x8000); + $fh->printf("\t(%s%d,%s)", $flags, $_->{'nextState'}, defined $_->{'actions'} ? $_->{'actions'} : "="); + } + $fh->print("\n"); + } + + $fh->print("\n"); + my $actionLists = $self->{'actionLists'}; + foreach (0 .. $#$actionLists) { + $fh->printf("\t\tList %d:\t", $_); + my $actionList = $actionLists->[$_]; + $fh->printf("%s\n", join(", ", map { ($_->{'component'} . ($_->{'store'} ? "*" : "") ) } @$actionList)); + } + + my $ligatureTable = $self->{'ligatureTable'}; + + $fh->print("\n"); + my $components = $self->{'components'}; + foreach (0 .. $#$components) { + $fh->printf("\t\tComponent %d: %s\n", $_, $components->[$_]); + } + + $fh->print("\n"); + my $ligatures = $self->{'ligatures'}; + foreach (0 .. $#$ligatures) { + $fh->printf("\t\tLigature %d: %d [%s]\n", $_, $ligatures->[$_], $post->{'VAL'}[$ligatures->[$_]]); + } +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Noncontextual.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Noncontextual.pm new file mode 100644 index 0000000..730982a --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Noncontextual.pm @@ -0,0 +1,95 @@ +package Font::TTF::Mort::Noncontextual; + +=head1 NAME + +Font::TTF::Mort::Noncontextual - Noncontextual Mort subtable for AAT + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; + +@ISA = qw(Font::TTF::Mort::Subtable); + +sub new +{ + my ($class, $direction, $orientation, $subFeatureFlags) = @_; + my ($self) = { + 'direction' => $direction, + 'orientation' => $orientation, + 'subFeatureFlags' => $subFeatureFlags + }; + + $class = ref($class) || $class; + bless $self, $class; +} + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self, $fh) = @_; + my ($dat); + + my ($format, $lookup) = AAT_read_lookup($fh, 2, $self->{'length'} - 8, undef); + $self->{'format'} = $format; + $self->{'lookup'} = $lookup; + + $self; +} + +=head2 $t->pack_sub($fh) + +=cut + +sub pack_sub +{ + my ($self) = @_; + + return AAT_pack_lookup($self->{'format'}, $self->{'lookup'}, 2, undef); +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + + my $post = $self->post(); + + $fh = 'STDOUT' unless defined $fh; + + my $lookup = $self->{'lookup'}; + $fh->printf("\t\tLookup format %d\n", $self->{'format'}); + if (defined $lookup) { + foreach (sort { $a <=> $b } keys %$lookup) { + $fh->printf("\t\t\t%d [%s] -> %d [%s])\n", $_, $post->{'VAL'}[$_], $lookup->{$_}, $post->{'VAL'}[$lookup->{$_}]); + } + } +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Rearrangement.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Rearrangement.pm new file mode 100644 index 0000000..126144f --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Rearrangement.pm @@ -0,0 +1,107 @@ +package Font::TTF::Mort::Rearrangement; + +=head1 NAME + +Font::TTF::Mort::Rearrangement - Rearrangement Mort subtable for AAT + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; + +@ISA = qw(Font::TTF::Mort::Subtable); + +sub new +{ + my ($class, $direction, $orientation, $subFeatureFlags) = @_; + my ($self) = { + 'direction' => $direction, + 'orientation' => $orientation, + 'subFeatureFlags' => $subFeatureFlags + }; + + $class = ref($class) || $class; + bless $self, $class; +} + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self, $fh) = @_; + + my ($classes, $states) = AAT_read_state_table($fh, 0); + $self->{'classes'} = $classes; + $self->{'states'} = $states; + + $self; +} + +=head2 $t->pack_sub() + +=cut + +sub pack_sub +{ + my ($self) = @_; + + return AAT_pack_state_table($self->{'classes'}, $self->{'states'}, 0); +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + + my $post = $self->post(); + + $fh = 'STDOUT' unless defined $fh; + + $self->print_classes($fh); + + $fh->print("\n"); + my $states = $self->{'states'}; + my @verbs = ( "0", "Ax->xA", "xD->Dx", "AxD->DxA", + "ABx->xAB", "ABx->xBA", "xCD->CDx", "xCD->DCx", + "AxCD->CDxA", "AxCD->DCxA", "ABxD->DxAB", "ABxD->DxBA", + "ABxCD->CDxAB", "ABxCD->CDxBA", "ABxCD->DCxAB", "ABxCD->DCxBA"); + foreach (0 .. $#$states) { + $fh->printf("\t\tState %d:", $_); + my $state = $states->[$_]; + foreach (@$state) { + my $flags; + $flags .= "!" if ($_->{'flags'} & 0x4000); + $flags .= "<" if ($_->{'flags'} & 0x8000); + $flags .= ">" if ($_->{'flags'} & 0x2000); + $fh->printf("\t(%s%d,%s)", $flags, $_->{'nextState'}, $verbs[($_->{'flags'} & 0x000f)]); + } + $fh->print("\n"); + } +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Subtable.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Subtable.pm new file mode 100644 index 0000000..4dd26e0 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Mort/Subtable.pm @@ -0,0 +1,200 @@ +package Font::TTF::Mort::Subtable; + +=head1 NAME + +Font::TTF::Mort::Subtable - Mort subtable superclass for AAT + +=head1 METHODS + +=cut + +use strict; +use Font::TTF::Utils; +use Font::TTF::AATutils; +use IO::File; + +require Font::TTF::Mort::Rearrangement; +require Font::TTF::Mort::Contextual; +require Font::TTF::Mort::Ligature; +require Font::TTF::Mort::Noncontextual; +require Font::TTF::Mort::Insertion; + +sub new +{ + my ($class) = @_; + my ($self) = {}; + + $class = ref($class) || $class; + + bless $self, $class; +} + +sub create +{ + my ($class, $type, $coverage, $subFeatureFlags, $length) = @_; + + $class = ref($class) || $class; + + my $subclass; + if ($type == 0) { + $subclass = 'Font::TTF::Mort::Rearrangement'; + } + elsif ($type == 1) { + $subclass = 'Font::TTF::Mort::Contextual'; + } + elsif ($type == 2) { + $subclass = 'Font::TTF::Mort::Ligature'; + } + elsif ($type == 4) { + $subclass = 'Font::TTF::Mort::Noncontextual'; + } + elsif ($type == 5) { + $subclass = 'Font::TTF::Mort::Insertion'; + } + + my ($self) = $subclass->new( + (($coverage & 0x4000) ? 'RL' : 'LR'), + (($coverage & 0x2000) ? 'VH' : ($coverage & 0x8000) ? 'V' : 'H'), + $subFeatureFlags + ); + + $self->{'type'} = $type; + $self->{'length'} = $length; + + $self; +} + +=head2 $t->out($fh) + +Writes the table to a file + +=cut + +sub out +{ + my ($self, $fh) = @_; + + my ($subtableStart) = $fh->tell(); + my ($type) = $self->{'type'}; + my ($coverage) = $type; + $coverage += 0x4000 if $self->{'direction'} eq 'RL'; + $coverage += 0x2000 if $self->{'orientation'} eq 'VH'; + $coverage += 0x8000 if $self->{'orientation'} eq 'V'; + + $fh->print(TTF_Pack("SSL", 0, $coverage, $self->{'subFeatureFlags'})); # placeholder for length + + my ($dat) = $self->pack_sub(); + $fh->print($dat); + + my ($length) = $fh->tell() - $subtableStart; + my ($padBytes) = (4 - ($length & 3)) & 3; + $fh->print(pack("C*", (0) x $padBytes)); + $length += $padBytes; + $fh->seek($subtableStart, IO::File::SEEK_SET); + $fh->print(pack("n", $length)); + $fh->seek($subtableStart + $length, IO::File::SEEK_SET); +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub post +{ + my ($self) = @_; + + my ($post) = $self->{' PARENT'}{' PARENT'}{' PARENT'}{'post'}; + if (defined $post) { + $post->read; + } + else { + $post = {}; + } + + return $post; +} + +sub feat +{ + my ($self) = @_; + + return $self->{' PARENT'}->feat(); +} + +sub print +{ + my ($self, $fh) = @_; + + my ($feat) = $self->feat(); + my ($post) = $self->post(); + + $fh = 'STDOUT' unless defined $fh; + + my ($type) = $self->{'type'}; + my ($subFeatureFlags) = $self->{'subFeatureFlags'}; + my ($defaultFlags) = $self->{' PARENT'}{'defaultFlags'}; + my ($featureEntries) = $self->{' PARENT'}{'featureEntries'}; + $fh->printf("\n\t%s table, %s, %s, subFeatureFlags = %08x # %s (%s)\n", + subtable_type_($type), $_->{'direction'}, $_->{'orientation'}, $subFeatureFlags, + "Default " . ((($subFeatureFlags & $defaultFlags) != 0) ? "On" : "Off"), + join(", ", + map { + join(": ", $feat->settingName($_->{'type'}, $_->{'setting'}) ) + } grep { ($_->{'enable'} & $subFeatureFlags) != 0 } @$featureEntries + ) ); +} + +sub subtable_type_ +{ + my ($val) = @_; + my ($res); + + my (@types) = ( + 'Rearrangement', + 'Contextual', + 'Ligature', + undef, + 'Non-contextual', + 'Insertion', + ); + $res = $types[$val] or ('Undefined (' . $val . ')'); + + $res; +} + +=head2 $t->print_classes($fh) + +Prints a human-readable representation of the table + +=cut + +sub print_classes +{ + my ($self, $fh) = @_; + + my ($post) = $self->post(); + + my ($classes) = $self->{'classes'}; + foreach (0 .. $#$classes) { + my $class = $classes->[$_]; + if (defined $class) { + $fh->printf("\t\tClass %d:\t%s\n", $_, join(", ", map { $_ . " [" . $post->{'VAL'}[$_] . "]" } @$class)); + } + } +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Name.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Name.pm new file mode 100644 index 0000000..144e926 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Name.pm @@ -0,0 +1,782 @@ +package Font::TTF::Name; + +=head1 NAME + +Font::TTF::Name - String table for a TTF font + +=head1 DESCRIPTION + +Strings are held by number, platform, encoding and language. Strings are +accessed as: + + $f->{'name'}{'strings'}[$number][$platform_id][$encoding_id]{$language_id} + +Notice that the language is held in an associative array due to its sparse +nature on some platforms such as Microsoft ($pid = 3). Notice also that the +array order is different from the stored array order (platform, encoding, +language, number) to allow for easy manipulation of strings by number (which is +what I guess most people will want to do). + +By default, C<$Font::TTF::Name::utf8> is set to 1, and strings will be stored as UTF8 wherever +possible. The method C can be used to find out if a string in a particular +platform and encoding will be returned as UTF8. Unicode strings are always +converted if utf8 is requested. Otherwise, strings are stored according to platform: + +You now have to set <$Font::TTF::Name::utf8> to 0 to get the old behaviour. + +=over 4 + +=item Apple Unicode (platform id = 0) + +Data is stored as network ordered UCS2. There is no encoding id for this platform +but there are language ids as per Mac language ids. + +=item Mac (platform id = 1) + +Data is stored as 8-bit binary data, leaving the interpretation to the user +according to encoding id. + +=item Unicode (platform id = 2) + +Currently stored as 16-bit network ordered UCS2. Upon release of Perl 5.005 this +will change to utf8 assuming current UCS2 semantics for all encoding ids. + +=item Windows (platform id = 3) + +As per Unicode, the data is currently stored as 16-bit network ordered UCS2. Upon +release of Perl 5.005 this will change to utf8 assuming current UCS2 semantics for +all encoding ids. + +=back + +=head1 INSTANCE VARIABLES + +=over 4 + +=item strings + +An array of arrays, etc. + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA $VERSION @apple_encs @apple_encodings $utf8 $cp_1252 @cp_1252 %win_langs %langs_win %langs_mac @ms_langids @mac_langs); +use Font::TTF::Table; +use Font::TTF::Utils; +@ISA = qw(Font::TTF::Table); + +$utf8 = 1; + +{ + my ($count, $i); + eval {require Compress::Zlib;}; + unless ($@) + { + for ($i = 0; $i <= $#apple_encs; $i++) + { + $apple_encodings[0][$i] = [unpack("n*", Compress::Zlib::uncompress(unpack("u", $apple_encs[$i])))] + if (defined $apple_encs[$i]); + foreach (0 .. 127) + { $apple_encodings[0][$i][$_] = $_; } + $count = 0; + $apple_encodings[1][$i] = {map {$_ => $count++} @{$apple_encodings[0][$i]}}; + } + $cp_1252[0] = [unpack("n*", Compress::Zlib::uncompress(unpack("u", $cp_1252)))]; + $count = 0; + $cp_1252[1] = {map({$_ => $count++} @{$cp_1252[0]})}; + } + for ($i = 0; $i < $#ms_langids; $i++) + { + if (defined $ms_langids[$i][1]) + { + my ($j); + for ($j = 0; $j < $#{$ms_langids[$i][1]}; $j++) + { + my ($v) = $ms_langids[$i][1][$j]; + if ($v =~ m/^-/o) + { $win_langs{(($j + 1) << 10) + $i} = $ms_langids[$i][0] . $v; } + else + { $win_langs{(($j + 1) << 10) + $i} = $v; } + } + } + else + { $win_langs{$i + 0x400} = $ms_langids[$i][0]; } + } + %langs_win = map {my ($t) = $win_langs{$_}; my (@res) = ($t => $_); push (@res, $t => $_) if ($t =~ s/-.*$//o && ($_ & 0xFC00) == 0x400); @res} keys %win_langs; + $i = 0; + %langs_mac = map {$_ => $i++} @mac_langs; +} + + +$VERSION = 1.1; # MJPH 17-JUN-2000 Add utf8 support +# $VERSION = 1.001; # MJPH 10-AUG-1998 Put $number first in list + +=head2 $t->read + +Reads all the names into memory + +=cut + +sub read +{ + my ($self) = @_; + my ($fh) = $self->{' INFILE'}; + my ($dat, $num, $stroff, $i, $pid, $eid, $lid, $nid, $len, $off, $here); + + $self->SUPER::read or return $self; + $fh->read($dat, 6); + ($num, $stroff) = unpack("x2nn", $dat); + for ($i = 0; $i < $num; $i++) + { + use bytes; # hack to fix bugs in 5.8.7 + read($fh, $dat, 12); + ($pid, $eid, $lid, $nid, $len, $off) = unpack("n6", $dat); + $here = $fh->tell(); + $fh->seek($self->{' OFFSET'} + $stroff + $off, 0); + $fh->read($dat, $len); + if ($utf8) + { + if ($pid == 1 && defined $apple_encodings[0][$eid]) + { $dat = TTF_word_utf8(pack("n*", map({$apple_encodings[0][$eid][$_]} unpack("C*", $dat)))); } + elsif ($pid == 2 && $eid == 2 && @cp_1252) + { $dat = TTF_word_utf8(pack("n*", map({$cp_1252[0][$_]} unpack("C*", $dat)))); } + elsif ($pid == 0 || $pid == 3 || ($pid == 2 && $eid == 1)) + { $dat = TTF_word_utf8($dat); } + } + $self->{'strings'}[$nid][$pid][$eid]{$lid} = $dat; + $fh->seek($here, 0); + } + $self; +} + + +=head2 $t->out($fh) + +Writes out all the strings + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($pid, $eid, $lid, $nid, $todo, @todo); + my ($len, $offset, $loc, $stroff, $endloc, $str_trans); + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $loc = $fh->tell(); + $fh->print(pack("n3", 0, 0, 0)); + foreach $nid (0 .. $#{$self->{'strings'}}) + { + foreach $pid (0 .. $#{$self->{'strings'}[$nid]}) + { + foreach $eid (0 .. $#{$self->{'strings'}[$nid][$pid]}) + { + foreach $lid (sort keys %{$self->{'strings'}[$nid][$pid][$eid]}) + { + $str_trans = $self->{'strings'}[$nid][$pid][$eid]{$lid}; + if ($utf8) + { + if ($pid == 1 && defined $apple_encodings[1][$eid]) + { $str_trans = pack("C*", + map({$apple_encodings[1][$eid]{$_} || 0x3F} unpack("n*", + TTF_utf8_word($str_trans)))); } + elsif ($pid == 2 && $eid == 2 && @cp_1252) + { $str_trans = pack("C*", + map({$cp_1252[1][$eid]{$_} || 0x3F} unpack("n*", + TTF_utf8_word($str_trans)))); } + elsif ($pid == 2 && $eid == 0) + { $str_trans =~ s/[\xc0-\xff][\x80-\xbf]+/?/og; } + elsif ($pid == 0 || $pid == 3 || ($pid == 2 && $eid == 1)) + { $str_trans = TTF_utf8_word($str_trans); } + } + push (@todo, [$pid, $eid, $lid, $nid, $str_trans]); + } + } + } + } + + $offset = 0; + @todo = (sort {$a->[0] <=> $b->[0] || $a->[1] <=> $b->[1] || $a->[2] <=> $b->[2] + || $a->[3] <=> $b->[3]} @todo); + foreach $todo (@todo) + { + $len = length($todo->[4]); + $fh->print(pack("n6", @{$todo}[0..3], $len, $offset)); + $offset += $len; + } + + $stroff = $fh->tell() - $loc; + foreach $todo (@todo) + { $fh->print($todo->[4]); } + + $endloc = $fh->tell(); + $fh->seek($loc, 0); + $fh->print(pack("n3", 0, $#todo + 1, $stroff)); + $fh->seek($endloc, 0); + $self; +} + + +=head2 $t->XML_element($context, $depth, $key, $value) + +Outputs the string element in nice XML (which is all the table really!) + +=cut + +sub XML_element +{ + my ($self) = shift; + my ($context, $depth, $key, $value) = @_; + my ($fh) = $context->{'fh'}; + my ($nid, $pid, $eid, $lid); + + return $self->SUPER::XML_element(@_) unless ($key eq 'strings'); + + foreach $nid (0 .. $#{$self->{'strings'}}) + { + next unless ref($self->{'strings'}[$nid]); +# $fh->print("$depth\n"); + foreach $pid (0 .. $#{$self->{'strings'}[$nid]}) + { + foreach $eid (0 .. $#{$self->{'strings'}[$nid][$pid]}) + { + foreach $lid (sort {$a <=> $b} keys %{$self->{'strings'}[$nid][$pid][$eid]}) + { + my ($lang) = $self->get_lang($pid, $lid) || $lid; + $fh->printf("%s\n%s%s%s\n%s\n", + $depth, $nid, $pid, $eid, $lang, $depth, + $context->{'indent'}, $self->{'strings'}[$nid][$pid][$eid]{$lid}, $depth); + } + } + } +# $fh->print("$depth\n"); + } + $self; +} + + +=head2 $t->XML_end($context, $tag, %attrs) + +Store strings in the right place + +=cut + +sub XML_end +{ + my ($self) = shift; + my ($context, $tag, %attrs) = @_; + + if ($tag eq 'string') + { + my ($lid) = $self->find_name($attrs{'platform'}, $attrs{'language'}) || $attrs{'language'}; + $self->{'strings'}[$attrs{'id'}][$attrs{'platform'}][$attrs{'encoding'}]{$lid} + = $context->{'text'}; + return $context; + } + else + { return $self->SUPER::XML_end(@_); } +} + +=head2 is_utf8($pid, $eid) + +Returns whether a string of a given platform and encoding is going to be in UTF8 + +=cut + +sub is_utf8 +{ + my ($self, $pid, $eid) = @_; + + return ($utf8 && ($pid == 0 || $pid == 3 || ($pid == 2 && ($eid != 2 || @cp_1252)) + || ($pid == 1 && defined $apple_encodings[$eid]))); +} + + +=head2 find_name($nid) + +Hunts down a name in all the standard places and returns the string and for an +array context the pid, eid & lid as well + +=cut + +sub find_name +{ + my ($self, $nid) = @_; + my ($res, $pid, $eid, $lid, $look, $k); + + my (@lookup) = ([3, 1, 1033], [3, 1, -1], [3, 0, 1033], [3, 0, -1], [2, 1, -1], [2, 2, -1], [2, 0, -1], + [0, 0, 0], [1, 0, 0]); + foreach $look (@lookup) + { + ($pid, $eid, $lid) = @$look; + if ($lid == -1) + { + foreach $k (keys %{$self->{'strings'}[$nid][$pid][$eid]}) + { + if (($res = $self->{strings}[$nid][$pid][$eid]{$k}) ne '') + { + $lid = $k; + last; + } + } + } else + { $res = $self->{strings}[$nid][$pid][$eid]{$lid} } + if ($res ne '') + { return wantarray ? ($res, $pid, $eid, $lid) : $res; } + } + return ''; +} + + +=head2 set_name($nid, $str[, $lang[, @cover]]) + +Sets the given name id string to $str for all platforms and encodings that +this module can handle. If $lang is set, it is interpretted as a language +tag and if the particular language of a string is found to match, then +that string is changed, otherwise no change occurs. + +If supplied, @cover should be a list of references to two-element arrays +containing pid,eid pairs that should added to the name table if not already present. + +This function does not add any names to the table unless @cover is supplied. + +=cut + +sub set_name +{ + my ($self, $nid, $str, $lang, @cover) = @_; + my ($pid, $eid, $lid, $c); + + foreach $pid (0 .. $#{$self->{'strings'}[$nid]}) + { + my $strNL = $str; + $strNL =~ s/\n/\r\n/og if $pid == 3; + $strNL =~ s/\n/\r/og if $pid == 1; + foreach $eid (0 .. $#{$self->{'strings'}[$nid][$pid]}) + { + foreach $lid (keys %{$self->{'strings'}[$nid][$pid][$eid]}) + { + next unless (!defined $lang || $self->match_lang($pid, $lid, $lang)); + $self->{'strings'}[$nid][$pid][$eid]{$lid} = $strNL; + foreach $c (0 .. scalar @cover) + { + next unless ($cover[$c][0] == $pid && $cover[$c][1] == $eid); + delete $cover[$c]; + last; + } + } + } + } + foreach $c (@cover) + { + my ($pid, $eid) = @{$c}; + my ($lid) = $self->find_lang($pid, $lang); + my $strNL = $str; + $strNL =~ s/\n/\r\n/og if $pid == 3; + $strNL =~ s/\n/\r/og if $pid == 1; + $self->{'strings'}[$nid][$pid][$eid]{$lid} = $strNL; + } + return $self; +} + +=head2 Font::TTF::Name->match_lang($pid, $lid, $lang) + +Compares the language associated to the string of given platform and language +with the given language tag. If the language matches the tag (i.e. is equal +or more defined than the given language tag) returns true. This is calculated +by finding whether the associated language tag starts with the given language +tag. + +=cut + +sub match_lang +{ + my ($self, $pid, $lid, $lang) = @_; + my ($langid) = $self->get_lang($pid, $lid); + + return ($lid == $lang) if ($lang != 0 || $lang eq '0'); + return !index(lc($langid), lc($lang)); +} + +=head2 Font::TTF::Name->get_lang($pid, $lid) + +Returns the language tag associated with a particular platform and language id + +=cut + +sub get_lang +{ + my ($self, $pid, $lid) = @_; + + if ($pid == 3) + { return $win_langs{$lid}; } + elsif ($pid == 1) + { return $mac_langs[$lid]; } + return ''; +} + + +=head2 Font::TTF::Name->find_lang($pid, $lang) + +Looks up the language name and returns a lang id if one exists + +=cut + +sub find_lang +{ + my ($self, $pid, $lang) = @_; + + if ($pid == 3) + { return $langs_win{$lang}; } + elsif ($pid == 1) + { return $langs_mac{$lang}; } + return undef; +} + + +BEGIN { +@apple_encs = ( +<<'EOT', +M>)RES==NCW$`@.'G_S5Q*L(!#?+K1VO4:.W6IJA-:\^BM?>L>1&NP(A0Q$BL +M<*!62ZV8Z1)[K]BE$MR#O,=/7OW]7T&*6"NMI4K31EOMM)>N@XXZZ2Q#IBZZ +MZJ:['GKJ)4NVWOKHJ]\_/\!`@PR68XBAALDUW`@CC3+:&&.-,UZ>?!-,-,ED +M4TPUS70SS#3+;`7FF&N>0D7F6V"A119;8JEEEEMAI5566V.M==;;H-A&FVRV +MQ5;;_OTONJ3<%;?<5^NQ1YYXYJGG7GKME3?>>N^=#S[ZY(O/OOKNFU]^JO<[ +M!$?LLMO>$#OAH4-*4F+'[(L+E*F,6SH:%\9%]C@>1W&CN&%2:9QNO]-))5ZH +M<]9.!^/DQ/8X-V[@@#,AS0ZE+KB7R$ODA\:A26@>6H2FH9D?J17^)(I#3C@8 +MLD)V?:(^"BE.AN30,F0XK\(Y5UUVW0TW77/'W;H_;JM6HRJ1&95%M0Y'E5%5 +.5.U4]""JB`?E$` +EOT + +undef, +undef, +undef, +<<'EOT', +M>)RES[=/%```1O$WO8G_@$'J';W70Z2WHS>5WJN%8D6%D;BZ,3*P,;#C2D(8 +M,9&)08V)+4*(1((X2'(#[.:;7[[\*./_%D,L<<230"(!@B213`JII)%.!IED +MD4T.N>213P&%%%%,B!)N4LJMR[Z<"BJIHIH::JFCG@;"--)$,RVTTD8['732 +M13>WN<-=>NBECWX&&&2(848898QQ)IADBFEFF.4>]WG`0^:89X%%'O&8)SSE +M&<]9X@4O><4R*Y?_.ZRSRQ[[''#(1S[PB<]NL\D7OO&5[_S@9TR`(XXYX1=O +M.>4W9_SAG`O^7OF=O>XW*N)WV!%''7/<"2>=S?<\K5O(G[7?/Y>'``` +EOT + +<<'EOT', +M>)RED$LSEW$`A9_-^00L,H-^(=>4Y%^2J'1Q*Y+[I2(BHA`B?!%J6EM1*28S +M;9II[/PI*7*_%TUN\_*VZ%W:FN9LSYEGGD,\_Q?#$?SP)X"C!!)$,"&$$L8Q +MPCG."2(X222GB,+%:XR"42N,P5KG*-1))()H54KG.# +M--*Y20:WR"2+;'+()8]\"BBDB-O$PM +M==3SA`8::>(IS;3PC%;::'?X'^W#?&(0-Z-,,,,TL\PSQP)+K+#,*C]9XQ?K +M_.8/FVRPQ0[;[+&+S=_]_J;KX/Y6I?&U.JQ.Z[GU0@-VBNTR@;Q4G]ZI5V_U +MQG@83^-M?,PAXV6'VF'ZH&Z]4H_>J]]IO=:0W!K6B#[KBT;U56/ZIN\:UX1^ +?:%)3FM:,9C6G>2UH44M:UHI6'?)RES5=OSG$`0.$CYR.(A(3DUS]J4WOO59O6;&F+UMY[7R&(V'N^4ETZ=*"J +M:M:H=>E*0D1B)7HC1KC0[R#G^LEA,/]7((Z(EK2B-?&TH2WM:$\'.M*)SG0A +M@:YTHSL]Z$DO>M.'OO2C/P,8R*`&/X2A#&,X(QC)*$:3R!C&,H[Q3&`BDYC, +M%))(9BK3F,X,9C*+%%*9S1S22">#NN(MWO.>#.\GG(Y_YQ!>^DAT7 +M\8WZ$%$3$OC.#W(IYC=_^!N"1SWF*<]ZP1AO*:'`;*^0%V502J6'*8LRHRQR +M/.)Q3WC2TY[QG+D6FF^!19ZGR(M>BA*]3"'5(9Z8.>:YVSV-DD/CT"0T#RU" +MT]",G^YUG_L]8+$E7O6%!WUIF>4^]9K7?6R%E59YQUM6>]L:[WK/5][WH;7> +4M,X'/O&1-WSF_\` +EOT + +<<'EOT', +M>)RERT=.%5``0-&+7K'&!B(@X/L/^/3>ZZ?SZ=*K@`KVWOL:U!68.#!&8G2@ +M$Q?F5/=@SOB0XO\$$D2**:&4)&644T$E55130RUUU--`(TTTTT(K;;3302== +M=--#[[_?1S\###+$,".,DF:,<2:89(II9KC`+'/,L\`B2RRSPBIKK+/!13;9 +M8IM+7.8*.^QRE6M]SG`0]YQ&.>\)1G/.<%+WG%:][PEI0G +M/>5IL\SVC#F>-=<\\SUG@846>=Y@PFBQ)9::M,QR*ZRTRFIKK+4N!+[[CD]\ +M#I%?9O*-+XGH/N?BMON=CT7\B#MQUR5^^MY#ZH('7?:PJQYQS14/L!?S,S[$ +M=,SD*[]#DH\>==UC;K@8LD)V*`B%(3?D\2<4>=Q-3[B5R#'#66>LM\%&FVRV +GQ5;;;+?#3KOLML=>4_;9[X"##CGLB*.F'7/<"2>=)RED-DVUG$`1;=:U*Y%0C)5O^^/SSS/F>>9#"$JE7D>"D6\3S=>Q^MPU^JF +M&^M"2JJHIH9:ZJBG@4:::*:%M[32 +M1CL==_TNNNFAES[Z&6"0(889890QQIE@DG=,,% +MF;XTRVQSS#7/5[[VC<&8D?D66&C<(HLML=0RRZVPTBJ7K;;&6NNLM\%&FVRV +L):388:===MMCKP,..F2_(XXZYK#CMKGZS[YU-]QTRVUWW'7/?0]N`4(?0WT` +EOT + +<<'EOT', +M>)RED,5.0U$415=(D.X!$"ANMX^VN+M#D>+N[H4"Q5W^APF_PZ\PY.9-"`-& +MY.3LG>-"#_\3@P^'8OP$"%)"*6644T$E55130RUUU--`(TTTTT(K;;3302== +M=-OZ7OH(T<\`@PP19I@11AECG`DFF6*:&6:98YX%%EEBF15666.=#3;98IL= +M=MECGP,.B7#$,5%...6,&.=<<,D5U]QPRQWW//#($\^\\,J;G?_II)ETXS79 +M)L<$C<,['S[GYSY=?FWK6E>Z^?L'BK,:KP0E*DD>R?6E*-7E='DM9BA36A49XKI_!M<9D8J +EOT + +<<'EOT', +M>)RED,E3SW$8QU_77@<''+A]^Y5(2-F7+"%92\B^ES5ES]H,)L(8&21E*UNH +M&"8T8ZS3I(FS_T"$_`L^-^/D8)YY/^]Y/\L\"Y/Y/XN()T8"B0P@B8$,(IG! +MI#"$H0PCE>&DDG,((N99#.+VM8SP8**&0CF]C,%K:RC2*V +M4TP).]C)+G:SA[WLHY3]'.`@ASC,$-(*3WG:,R%ZSDK/!K[@1<][R2HO6^T5:ZSUJM>\[@UO +M6F>]M[SM'>]ZSX90_\"'-MIDLX^">ASPQ*?!M_C,Y[ZP->KE*U_[QK>^\WW( +CM/O!ML"=?K3#3[Z,*_AKOR]V^=5O=OO='_ZTQU^_`2-%:*`` +EOT + +undef, +undef, +undef, +undef, +undef, +undef, +undef, +undef, +undef, +<<'EOT', +M>)REC]=.E&$`1(\%&W@4004%_7:!I?>.Z-+[TJL*=K"`BH`*J,_"+2'A!7PW +MX;\2[LG<3#*9G!F2G$V!&'$***2(!,644$H9Y5102175U%!+'?4TT$@3S;30 +M2AN/:.\HSG +M+++$"U[RBM>\X2WO6&:%]WS@(Y]898W/?.$KZWQC@TVV^,X/?K+-#KO\XC=_ +M(OX!?T/"`0<=-$T+WG9 +M*U[UFNEF>%V]X4TSO666V=[VCG?-,==[WC?/?!_XT&#,N`466F3"8DLLMLD&W2#COMLML>>^V+=IX\2<7BCCGNA)-. +0.>V,L\XY[P*'[!\#D^='L@`` +EOT + +undef, +undef, +undef, +undef, +undef, +undef, +undef, +undef, +undef, +); + +$cp_1252 = ( +<<'EOT', +M>)P-SD-B'5```,#YJ6VE>DEM&[\VD]JVF?H./4'-U+93V[9M:SV;$141(Y74 +MTD@KG?0RR"B3S++(*IOL:%9-$0&YD?BH22(82XF)10.3(@U(DDB$;F_/]% +M0_Y0(!0*A4-\R!5RQ]R*BX\,#'4CB?]];B3)`@LMLM@22RVSW`HKK;):LC76 +M6F>]#3;:9+,MMMIFNQUVVF6W/?;:9[\##CKDL"-2''7,<2><=,II9YQUSGD7 +M7'3)95=<=0@` +EOT +); +#' + +@ms_langids = ( [""], + ['ar', ["-SA", "-IQ", "-EG", "-LY", "-DZ", "-MA", "-TN", + "-OM", "-YE", "-SY", "-JO", "-LB", "-KW", "-AE", + "-BH", "-QA"]], + ['bg-BG'], + ['ca-ES'], + ['zh', ['-TW', 'CN', '-HK', '-SG', '-MO']], + ["cs-CZ"], + ["da-DK"], + ["de", ["-DE", "-CH", "-AT", "-LU", "-LI"]], + ["el-GR"], + ["en", ["-US", "-UK", "-AU", "-CA", "-NZ", "-IE", "-ZA", + "-JM", "029", "-BZ", "-TT", "-ZW", "-PH", "-ID", + "-HK", "-IN", "-MY", "-SG"]], + ["es", ["-ES", "-MX", "-ES", "-GT", "-CR", "-PA", "-DO", + "-VE", "-CO", "-PE", "-AR", "-EC", "-CL", "-UY", + "-PY", "-BO", "-SV", "-HN", "-NI", "-PR", "-US"]], + ["fi-FI"], + ["fr", ["-FR", "-BE", "-CA", "-CH", "-LU", "-MC", "", + "-RE", "-CG", "-SN", "-CM", "-CI", "-ML", "-MA", + "-HT"]], + ["he-IL"], + ["hu-HU"], + ["is-IS"], +# 0010 + ["it", ["-IT", "-CH"]], + ["ja-JP"], + ["ko-KR"], + ["nl", ["-NL", "-BE"]], + ["no", ["-bok-NO", "-nyn-NO"]], + ["pl-PL"], + ["pt", ["-BR", "-PT"]], + ["rm-CH"], + ["ro", ["-RO", "_MD"]], + ["ru-RU"], + ["hr", ["-HR", "-Latn-CS", "Cyrl-CS", "-BA", "", "-Latn-BA", "-Cyrl-BA"]], + ["sk-SK"], + ["sq-AL"], + ["sv", ["-SE", "-FI"]], + ["th-TH"], + ["tr-TR"], +# 0020 + ["ur", ["-PK", "tr-IN"]], + ["id-ID"], + ["uk-UA"], + ["be-BY"], + ["sl-SL"], + ["et-EE"], + ["lv-LV"], + ["lt-LT"], + ["tg-Cyrl-TJ"], + ["fa-IR"], + ["vi-VN"], + ["hy-AM"], + ["az", ["-Latn-AZ", "-Cyrl-AZ"]], + ["eu-ES"], + ["wen". ["wen-DE", "dsb-DE"]], + ["mk-MK"], +# 0030 + ["st"], + ["ts"], + ["tn-ZA"], + ["ven"], + ["xh-ZA"], + ["zu-ZA"], + ["af-ZA"], + ["ka-GE"], + ["fo-FO"], + ["hi-IN"], + ["mt"], + ["se", ["-NO", "-SE", "-FI", "smj-NO", "smj-SE", "sma-NO", "sma-SE", + "", "smn-FI"]], + ["ga-IE"], + ["yi"], + ["ms", ["-MY", "-BN"]], + ["kk-KZ"], +# 0040 + ["ky-KG"], + ["sw-KE"], + ["tk-TM"], + ["uz", ["-Latn-UZ", "-Cyrl-UZ"]], + ["tt-RU"], + ["bn", ["-IN", "-BD"]], + ["pa", ["-IN", "-Arab-PK"]], + ["gu-IN"], + ["or-IN"], + ["ta-IN"], + ["te-IN"], + ["kn-IN"], + ["ml-IN"], + ["as-IN"], + ["mr-IN"], + ["sa-IN"], +# 0050 + ["mn", ["-Cyrl-MN", "-Mong-CN"]], + ["bo", ["-CN", "-BT"]], + ["cy-GB"], + ["km-KH"], + ["lo-LA"], + ["my"], + ["gl-ES"], + ["kok-IN"], + ["mni"], + ["sd", ["-IN", "-PK"]], + ["syr-SY"], + ["si-LK"], + ["chr"], + ["iu", ["-Cans-CA", "-Latn-CA"]], + ["am-ET"], + ["tmz", ["-Arab", "tmz-Latn-DZ"]], +# 0060 + ["ks"], + ["ne", ["-NP", "-IN"]], + ["fy-NL"], + ["ps-AF"], + ["fil-PH"], + ["dv-MV"], + ["bin-NG"], + ["fuv-NG"], + ["ha-Latn-NG"], + ["ibb-NG"], + ["yo-NG"], + ["quz", ["-BO", "-EC", "-PE"]], + ["ns-ZA"], + ["ba-RU"], + ["lb-LU"], + ["kl-GL"], +# 0070 + ["ig-NG"], + ["kau"], + ["om"], + ["ti", ["-ET". "-ER"]], + ["gn"], + ["haw"], + ["la"], + ["so"], + ["ii-CN"], + ["pap"], + ["arn-CL"], + [""], # (unassigned) + ["moh-CA"], + [""], # (unassigned) + ["br-FR"], + [""], # (unassigned) +# 0080 + ["ug-CN"], + [""], # (unassigned) + ["oc-FR"], + ["gsw-FR"], + [""], # (unassigned) + ["sah-RU"], + ["qut-GT"], + ["rw-RW"], + ["wo-SN"], + [""], # (unassigned) + [""], # (unassigned) + [""], # (unassigned) + ["gbz-AF"], +); + +@mac_langs = ( + 'en', 'fr', 'de', 'it', 'nl', 'sv', 'es', 'da', 'pt', 'no', + 'he', 'ja', 'ar', 'fi', 'el', 'is', 'mt', 'tr', 'hr', 'zh-Hant', + 'ur', 'hi', 'th', 'ko', 'lt', 'pl', 'hu', 'et', 'lv', 'se', + 'fo', 'ru' ,'zh-Hans', 'nl', 'ga', 'sq', 'ro', 'cs', 'sk', + 'sl', 'yi', 'sr', 'mk', 'bg', 'uk', 'be', 'uz', 'kk', 'az-Cyrl', + 'az-Latn', 'hy', 'ka', 'mo', 'ky', 'abh', 'tuk', 'mn-Mong', 'mn-Cyrl', 'pst', + 'ku', 'ks', 'sd', 'bo', 'ne', 'sa', 'mr', 'bn', 'as', 'gu', + 'pa', 'or', 'ml', 'kn', 'ta', 'te', 'si', 'my', 'km', 'lo', + 'vi', 'id', 'tl', 'ms-Latn', 'ms-Arab', 'am', 'ti', 'tga', 'so', 'sw', + 'rw', 'rn', 'ny', 'mg', 'eo', '', '', '', '', '', + '', '', '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', 'cy', 'eu', + 'la', 'qu', 'gn', 'ay', 'tt', 'ug', 'dz', 'jv-Latn', 'su-Latn', + 'gl', 'af', 'br', 'iu', 'gd', 'gv', 'gd-IR-x-dotabove', 'to', 'el-polyton', 'kl', + 'az-Latn' +); + +} + +1; + +=head1 BUGS + +=over 4 + +=item * + +Unicode type strings will be stored in utf8 for all known platforms, +once Perl 5.6 has been released and I can find all the mapping tables, etc. + +=back + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OS_2.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OS_2.pm new file mode 100644 index 0000000..0092732 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OS_2.pm @@ -0,0 +1,354 @@ +package Font::TTF::OS_2; + +=head1 NAME + +Font::TTF::OS_2 - the OS/2 table in a TTF font + +=head1 DESCRIPTION + +The OS/2 table has two versions and forms, one an extension of the other. This +module supports both forms and the switching between them. + +=head1 INSTANCE VARIABLES + +No other variables than those in table and those in the standard: + + Version + xAvgCharWidth + usWeightClass + usWidthClass + fsType + ySubscriptXSize + ySubScriptYSize + ySubscriptXOffset + ySubscriptYOffset + ySuperscriptXSize + ySuperscriptYSize + ySuperscriptXOffset + ySuperscriptYOffset + yStrikeoutSize + yStrikeoutPosition + sFamilyClass + bFamilyType + bSerifStyle + bWeight + bProportion + bContrast + bStrokeVariation + bArmStyle + bLetterform + bMidline + bXheight + ulUnicodeRange1 + ulUnicodeRange2 + ulUnicodeRange3 + ulUnicodeRange4 + achVendID + fsSelection + usFirstCharIndex + usLastCharIndex + sTypoAscender + sTypoDescender + sTypoLineGap + usWinAscent + usWinDescent + ulCodePageRange1 + ulCodePageRange2 + xHeight + CapHeight + defaultChar + breakChar + maxLookups + +Notice that versions 0, 1, 2 & 3 of the table are supported. Notice also that the +Panose variable has been broken down into its elements. + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA @fields @lens @field_info @weights); +use Font::TTF::Table; + +@ISA = qw(Font::TTF::Table); +@field_info = ( + 'xAvgCharWidth' => 's', + 'usWeightClass' => 'S', + 'usWidthClass' => 'S', + 'fsType' => 's', + 'ySubscriptXSize' => 's', + 'ySubScriptYSize' => 's', + 'ySubscriptXOffset' => 's', + 'ySubscriptYOffset' => 's', + 'ySuperscriptXSize' => 's', + 'ySuperscriptYSize' => 's', + 'ySuperscriptXOffset' => 's', + 'ySuperscriptYOffset' => 's', + 'yStrikeoutSize' => 's', + 'yStrikeoutPosition' => 's', + 'sFamilyClass' => 's', + 'bFamilyType' => 'C', + 'bSerifStyle' => 'C', + 'bWeight' => 'C', + 'bProportion' => 'C', + 'bContrast' => 'C', + 'bStrokeVariation' => 'C', + 'bArmStyle' => 'C', + 'bLetterform' => 'C', + 'bMidline' => 'C', + 'bXheight' => 'C', + 'ulUnicodeRange1' => 'L', + 'ulUnicodeRange2' => 'L', + 'ulUnicodeRange3' => 'L', + 'ulUnicodeRange4' => 'L', + 'achVendID' => 'L', + 'fsSelection' => 'S', + 'usFirstCharIndex' => 'S', + 'usLastCharIndex' => 'S', + 'sTypoAscender' => 'S', + 'sTypoDescender' => 's', + 'sTypoLineGap' => 'S', + 'usWinAscent' => 'S', + 'usWinDescent' => 'S', + '' => '', + 'ulCodePageRange1' => 'L', + 'ulCodePageRange2' => 'L', + '' => '', + 'xHeight' => 's', + 'CapHeight' => 's', + 'defaultChar' => 'S', + 'breakChar' => 'S', + 'maxLookups' => 's', + '' => '', # i.e. v3 is basically same as v2 + ); + +@weights = qw(64 14 27 35 100 20 14 42 63 3 6 35 20 56 56 17 4 49 56 71 31 10 18 3 18 2 166); + +use Font::TTF::Utils; + +sub init +{ + my ($k, $v, $c, $n, $i, $t, $j); + + $n = 0; + @lens = (76, 84, 94, 94); + for ($j = 0; $j < $#field_info; $j += 2) + { + if ($field_info[$j] eq '') + { + $n++; + next; + } + ($k, $v, $c) = TTF_Init_Fields($field_info[$j], $c, $field_info[$j+1]); + next unless defined $k && $k ne ""; + for ($i = $n; $i < 4; $i++) + { $fields[$i]{$k} = $v; } + } +} + + +=head2 $t->read + +Reads in the various values from disk (see details of OS/2 table) + +=cut + +sub read +{ + my ($self) = @_; + my ($dat, $ver); + + $self->SUPER::read or return $self; + + init unless defined $fields[2]{'xAvgCharWidth'}; + $self->{' INFILE'}->read($dat, 2); + $ver = unpack("n", $dat); + $self->{'Version'} = $ver; + if ($ver < 4) + { + $self->{' INFILE'}->read($dat, $lens[$ver]); + TTF_Read_Fields($self, $dat, $fields[$ver]); + } + $self; +} + + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying. + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($ver); + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $ver = $self->{'Version'}; + $fh->print(pack("n", $ver)); + $fh->print(TTF_Out_Fields($self, $fields[$ver], $lens[$ver])); + $self; +} + + +=head2 $t->XML_element($context, $depth, $key, $value) + +Tidies up the hex values to output them in hex + +=cut + +sub XML_element +{ + my ($self) = shift; + my ($context, $depth, $key, $value) = @_; + my ($fh) = $context->{'fh'}; + + if ($key =~ m/^ul(?:Unicode|CodePage)Range\d$/o) + { $fh->printf("%s<%s>%08X\n", $depth, $key, $value, $key); } + elsif ($key eq 'achVendID') + { $fh->printf("%s<%s name='%s'/>\n", $depth, $key, pack('N', $value)); } + else + { return $self->SUPER::XML_element(@_); } + $self; +} + + +=head2 $t->XML_end($context, $tag, %attrs) + +Now handle them on the way back in + +=cut + +sub XML_end +{ + my ($self) = shift; + my ($context, $tag, %attrs) = @_; + + if ($tag =~ m/^ul(?:Unicode|CodePage)Range\d$/o) + { return hex($context->{'text'}); } + elsif ($tag eq 'achVendID') + { return unpack('N', $attrs{'name'}); } + else + { return $self->SUPER::XML_end(@_); } +} + +=head2 $t->update + +Updates the OS/2 table by getting information from other sources: + +Updates the C and C values based on the MS table in the +cmap. + +Updates the sTypoAscender, sTypoDescender & sTypoLineGap to be the same values +as Ascender, Descender and Linegap from the hhea table (assuming it is dirty) +and also sets usWinAscent to be the sum of Ascender+Linegap and usWinDescent to +be the negative of Descender. + +=cut + +sub update +{ + my ($self) = @_; + my ($map, @keys, $table, $i, $avg, $hmtx); + + return undef unless ($self->SUPER::update); + + $self->{' PARENT'}{'cmap'}->update; + $map = $self->{' PARENT'}{'cmap'}->find_ms || return undef; + $hmtx = $self->{' PARENT'}{'hmtx'}->read; + + @keys = sort {$a <=> $b} grep {$_ < 0x10000} keys %{$map->{'val'}}; + + $self->{'usFirstCharIndex'} = $keys[0]; + $self->{'usLastCharIndex'} = $keys[-1]; + + $table = $self->{' PARENT'}{'hhea'}->read; + + # try any way we can to get some real numbers passed around! + if (($self->{'fsSelection'} & 128) != 0) + { + # assume the user knows what they are doing and has sensible values already + } + elsif ($table->{'Ascender'} != 0 || $table->{'Descender'} != 0) + { + $self->{'sTypoAscender'} = $table->{'Ascender'}; + $self->{'sTypoDescender'} = $table->{'Descender'}; + $self->{'sTypoLineGap'} = $table->{'LineGap'}; + $self->{'usWinAscent'} = $self->{'sTypoAscender'} + $self->{'sTypoLineGap'}; + $self->{'usWinDescent'} = -$self->{'sTypoDescender'}; + } + elsif ($self->{'sTypoAscender'} != 0 || $self->{'sTypoDescender'} != 0) + { + $table->{'Ascender'} = $self->{'sTypoAscender'}; + $table->{'Descender'} = $self->{'sTypoDescender'}; + $table->{'LineGap'} = $self->{'sTypoLineGap'}; + $self->{'usWinAscent'} = $self->{'sTypoAscender'} + $self->{'sTypoLineGap'}; + $self->{'usWinDescent'} = -$self->{'sTypoDescender'}; + } + elsif ($self->{'usWinAscent'} != 0 || $self->{'usWinDescent'} != 0) + { + $self->{'sTypoAscender'} = $table->{'Ascender'} = $self->{'usWinAscent'}; + $self->{'sTypoDescender'} = $table->{'Descender'} = -$self->{'usWinDescent'}; + $self->{'sTypoLineGap'} = $table->{'LineGap'} = 0; + } + + if ($self->{'Version'} < 3) + { + for ($i = 0; $i < 26; $i++) + { $avg += $hmtx->{'advance'}[$map->{'val'}{$i + 0x0061}] * $weights[$i]; } + $avg += $hmtx->{'advance'}[$map->{'val'}{0x0020}] * $weights[-1]; + $self->{'xAvgCharWidth'} = $avg / 1000; + } + elsif ($self->{'Version'} > 2) + { + $i = 0; $avg = 0; + foreach (@{$hmtx->{'advance'}}) + { + next unless ($_); + $i++; + $avg += $_; + } + $avg /= $i if ($i); + $self->{'xAvgCharWidth'} = $avg; + } + + foreach $i (keys %{$map->{'val'}}) + { + if ($i >= 0x10000) + { + $self->{'ulUnicodeRange2'} |= 0x2000000; + last; + } + } + + $self->{'Version'} = 1 if (defined $self->{'ulCodePageRange1'} && $self->{'Version'} < 1); + $self->{'Version'} = 2 if (defined $self->{'maxLookups'} && $self->{'Version'} < 2); + + if ((exists $self->{' PARENT'}{'GPOS'} && $self->{' PARENT'}{'GPOS'}{' read'}) || + (exists $self->{' PARENT'}{'GSUB'} && $self->{' PARENT'}{'GSUB'}{' read'})) + { + # one or both of GPOS & GSUB exist and have been read or modified; so update usMaxContexts + my ($lp, $ls); + $lp = $self->{' PARENT'}{'GPOS'}->maxContext if exists $self->{' PARENT'}{'GPOS'}; + $ls = $self->{' PARENT'}{'GSUB'}->maxContext if exists $self->{' PARENT'}{'GSUB'}; + $self->{'maxLookups'} = $lp > $ls ? $lp : $ls; + } + + $self; +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OTTags.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OTTags.pm new file mode 100644 index 0000000..71338e2 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OTTags.pm @@ -0,0 +1,706 @@ +package Font::TTF::OTTags; + +=head1 NAME + +Font::TTF::OTTags - Utilities for TrueType/OpenType tags + +=head1 SYNOPSIS + + use Font::TTF::OTTags qw( %tttags %ttnames readtagsfile ); + + # Look at built-in stuff: + $script_tag = $tttags{'SCRIPT'}{'Cypriot Syllabary'}; + $lang_name = $ttnames{'LANGUAGE'}{'AFK '} + + # Read latest tags file to add to built-in definitions + readtagsfile ("C:\\Program Files\\Microsoft VOLT\\TAGS.txt"); + +First-level keys to %tttags and %ttnames are: + +=over + +'SCRIPT' -- retrieve script tag or name + +'LANGUAGE' -- retrieve language tag or name + +'FEATURE' -- retrieve feature tag or name + +=back + +Built-in data has been derived from Microsoft's tag registry at +L, +updated to draft v1.5 of the OpenType Spec. + +=head1 METHODS + +=cut + +use strict; +use vars qw( %tttags %ttnames @EXPORT_OK @ISA ); +require Exporter; +@ISA = qw( Exporter ); +@EXPORT_OK = qw( %tttags %ttnames readtagsfile); + + +%tttags = ( + +# All data below derived from VOLT 1.3 TAGS.txt file. +# For conveninence of human checking, these are now sorted alphabetically. + +'SCRIPT' => { + "Arabic" => "arab", + "Armenian" => "armn", + "Balinese" => "bali", + "Bengali v.2" => "bng2", + "Bengali" => "beng", + "Bopomofo" => "bopo", + "Braille" => "brai", + "Buginese" => "bugi", + "Buhid" => "buhd", + "Byzantine Music" => "byzm", + "CJK Ideographic" => "hani", + "Canadian Syllabics" => "cans", + "Carian" => "cari", + "Cham" => "cham", + "Cherokee" => "cher", + "Coptic" => "copt", + "Cypriot Syllabary" => "cprt", + "Cyrillic" => "cyrl", + "Default" => "DFLT", + "Deseret" => "dsrt", + "Devanagari v.2" => "dev2", + "Devanagari" => "deva", + "Ethiopic" => "ethi", + "Georgian" => "geor", + "Glagolitic" => "glag", + "Gothic" => "goth", + "Greek" => "grek", + "Gujarati v.2" => "gjr2", + "Gujarati" => "gujr", + "Gurmukhi v.2" => "gur2", + "Gurmukhi" => "guru", + "Hangul Jamo" => "jamo", + "Hangul" => "hang", + "Hanunoo" => "hano", + "Hebrew" => "hebr", + "Hiragana" => "kana", + "Javanese" => "java", + "Kannada v.2" => "knd2", + "Kannada" => "knda", + "Katakana" => "kana", + "Kayah Li" => "kali", + "Kharosthi" => "khar", + "Khmer" => "khmr", + "Lao" => "lao ", + "Latin" => "latn", + "Lepcha" => "lepc", + "Limbu" => "limb", + "Linear B" => "linb", + "Lycian" => "lyci", + "Lydian" => "lydi", + "Malayalam v.2" => "mlm2", + "Malayalam" => "mlym", + "Mathematical Alphanumeric Symbols" => "math", + "Mongolian" => "mong", + "Musical Symbols" => "musc", + "Myanmar" => "mymr", + "N'Ko" => "nko ", + "New Tai Lue" => "talu", + "Ogham" => "ogam", + "Ol Chiki" => "olck", + "Old Italic" => "ital", + "Old Persian Cuneiform" => "xpeo", + "Oriya v.2" => "ory2", + "Oriya" => "orya", + "Osmanya" => "osma", + "Phags-pa" => "phag", + "Phoenician" => "phnx", + "Rejang" => "rjng", + "Runic" => "runr", + "Saurashtra" => "saur", + "Shavian" => "shaw", + "Sinhala" => "sinh", + "Sumero-Akkadian Cuneiform" => "xsux", + "Sundanese" => "sund", + "Syloti Nagri" => "sylo", + "Syriac" => "syrc", + "Tagalog" => "tglg", + "Tagbanwa" => "tagb", + "Tai Le" => "tale", + "Tamil v.2" => "tml2", + "Tamil" => "taml", + "Telugu v.2" => "tel2", + "Telugu" => "telu", + "Thaana" => "thaa", + "Thai" => "thai", + "Tibetan" => "tibt", + "Tifinagh" => "tfng", + "Ugaritic Cuneiform" => "ugar", + "Vai" => "vai ", + "Yi" => "yi ", + }, + +'LANGUAGE' => { + "Aari" => "ARI ", + "Abaza" => "ABA ", + "Abkhazian" => "ABK ", + "Adyghe" => "ADY ", + "Afar" => "AFR ", + "Afrikaans" => "AFK ", + "Agaw" => "AGW ", + "Albanian" => "SQI ", + "Alsatian" => "ALS ", + "Altai" => "ALT ", + "Amharic" => "AMH ", + "Arabic" => "ARA ", + "Arakanese" => "ARK ", + "Armenian" => "HYE ", + "Assamese" => "ASM ", + "Athapaskan" => "ATH ", + "Avar" => "AVR ", + "Awadhi" => "AWA ", + "Aymara" => "AYM ", + "Azeri" => "AZE ", + "Badaga" => "BAD ", + "Baghelkhandi" => "BAG ", + "Balante" => "BLN ", + "Balkar" => "BAL ", + "Balochi" => "BLI ", + "Balti" => "BLT ", + "Bambara" => "BMB ", + "Bamileke" => "BML ", + "Bashkir" => "BSH ", + "Basque" => "EUQ ", + "Baule" => "BAU ", + "Belarussian" => "BEL ", + "Bemba" => "BEM ", + "Bench" => "BCH ", + "Bengali" => "BEN ", + "Berber" => "BBR ", + "Beti" => "BTI ", + "Bhili" => "BHI ", + "Bhojpuri" => "BHO ", + "Bible Cree" => "BCR ", + "Bikol" => "BIK ", + "Bilen" => "BIL ", + "Blackfoot" => "BKF ", + "Bosnian" => "BOS ", + "Brahui" => "BRH ", + "Braj Bhasha" => "BRI ", + "Breton" => "BRE ", + "Bulgarian" => "BGR ", + "Burmese" => "BRM ", + "Carrier" => "CRR ", + "Catalan" => "CAT ", + "Cebuano" => "CEB ", + "Chaha Gurage" => "CHG ", + "Chattisgarhi" => "CHH ", + "Chechen" => "CHE ", + "Cherokee" => "CHR ", + "Chichewa" => "CHI ", + "Chin" => "QIN ", + "Chinese Hong Kong" => "ZHH ", + "Chinese Phonetic" => "ZHP ", + "Chinese Simplified" => "ZHS ", + "Chinese Traditional" => "ZHT ", + "Chipewyan" => "CHP ", + "Chukchi" => "CHK ", + "Church Slavonic" => "CSL ", + "Chuvash" => "CHU ", + "Comorian" => "CMR ", + "Coptic" => "COP ", + "Corsican" => "COS ", + "Cree" => "CRE ", + "Crimean Tatar" => "CRT ", + "Croatian" => "HRV ", + "Czech" => "CSY ", + "Dangme" => "DNG ", + "Danish" => "DAN ", + "Dargwa" => "DAR ", + "Dari" => "DRI ", + "Default" => "dflt", + "Dhivehi (OBSOLETE)" => "DHV ", + "Dhivehi" => "DIV ", + "Dinka" => "DNK ", + "Djerma" => "DJR ", + "Dogri" => "DGR ", + "Dungan" => "DUN ", + "Dutch" => "NLD ", + "Dzongkha" => "DZN ", + "Eastern Cree" => "ECR ", + "Ebira" => "EBI ", + "Edo" => "EDO ", + "Efik" => "EFI ", + "English" => "ENG ", + "Erzya" => "ERZ ", + "Esperanto" => "NTO ", + "Estonian" => "ETI ", + "Even" => "EVN ", + "Evenki" => "EVK ", + "Ewe" => "EWE ", + "Faroese" => "FOS ", + "Farsi" => "FAR ", + "Fijian" => "FJI ", + "Filipino" => "PIL ", + "Finnish" => "FIN ", + "Flemish" => "FLE ", + "Fon" => "FON ", + "Forest Nenets" => "FNE ", + "French Antillean" => "FAN ", + "French" => "FRA ", + "Frisian" => "FRI ", + "Friulian" => "FRL ", + "Fulani" => "FUL ", + "Futa" => "FTA ", + "Ga" => "GAD ", + "Gaelic" => "GAE ", + "Gagauz" => "GAG ", + "Galician" => "GAL ", + "Garhwali" => "GAW ", + "Garo" => "GRO ", + "Garshuni" => "GAR ", + "Ge'ez" => "GEZ ", + "Georgian" => "KAT ", + "German" => "DEU ", + "Gilyak" => "GIL ", + "Gondi" => "GON ", + "Greek" => "ELL ", + "Greenlandic" => "GRN ", + "Guarani" => "GUA ", + "Gujarati" => "GUJ ", + "Gumuz" => "GMZ ", + "Haitian" => "HAI ", + "Halam" => "HAL ", + "Hammer-Banna" => "HBN ", + "Harari" => "HRI ", + "Harauti" => "HAR ", + "Hausa" => "HAU ", + "Hawaiin" => "HAW ", + "Hebrew" => "IWR ", + "High Mari" => "HMA ", + "Hiligaynon" => "HIL ", + "Hindi" => "HIN ", + "Hindko" => "HND ", + "Ho" => "HO ", + "Hungarian" => "HUN ", + "Icelandic" => "ISL ", + "Igbo" => "IBO ", + "Ijo" => "IJO ", + "Ilokano" => "ILO ", + "Inari Sami" => "ISM ", + "Indonesian" => "IND ", + "Ingush" => "ING ", + "Inuktitut" => "INU ", + "Irish Traditional" => "IRT ", + "Irish" => "IRI ", + "Italian" => "ITA ", + "Japanese" => "JAN ", + "Javanese" => "JAV ", + "Judezmo" => "JUD ", + "Jula" => "JUL ", + "Kabardian" => "KAB ", + "Kachchi" => "KAC ", + "Kalenjin" => "KAL ", + "Kalmyk" => "KLM ", + "Kamba" => "KMB ", + "Kannada" => "KAN ", + "Kanuri" => "KNR ", + "Karachay" => "KAR ", + "Karaim" => "KRM ", + "Karakalpak" => "KRK ", + "Karelian" => "KRL ", + "Karen" => "KRN ", + "Kashmiri" => "KSH ", + "Kazakh" => "KAZ ", + "Kebena" => "KEB ", + "Khakass" => "KHA ", + "Khanty-Kazim" => "KHK ", + "Khanty-Shurishkar" => "KHS ", + "Khanty-Vakhi" => "KHV ", + "Khasi" => "KSI ", + "Khmer" => "KHM ", + "Khowar" => "KHW ", + "Khutsuri Georgian" => "KGE ", + "Kikongo" => "KON ", + "Kikuyu" => "KIK ", + "Kildin Sami" => "KSM ", + "Kirghiz" => "KIR ", + "Kisii" => "KIS ", + "Kodagu" => "KOD ", + "Kokni" => "KKN ", + "Komi-Permyak" => "KOP ", + "Komi-Zyrian" => "KOZ ", + "Komo" => "KMO ", + "Komso" => "KMS ", + "Konkani" => "KOK ", + "Koorete" => "KRT ", + "Korean Old Hangul" => "KOH ", + "Korean" => "KOR ", + "Koryak" => "KYK ", + "Kpelle" => "KPL ", + "Krio" => "KRI ", + "Kui" => "KUI ", + "Kulvi" => "KUL ", + "Kumaoni" => "KMN ", + "Kumyk" => "KUM ", + "Kurdish" => "KUR ", + "Kurukh" => "KUU ", + "Kuy" => "KUY ", + "L-Cree" => "LCR ", + "Ladakhi" => "LDK ", + "Ladin" => "LAD ", + "Lahuli" => "LAH ", + "Lak" => "LAK ", + "Lambani" => "LAM ", + "Lao" => "LAO ", + "Latin" => "LAT ", + "Latvian" => "LVI ", + "Laz" => "LAZ ", + "Lezgi" => "LEZ ", + "Limbu" => "LMB ", + "Lingala" => "LIN ", + "Lithuanian" => "LTH ", + "Lomwe" => "LMW ", + "Low Mari" => "LMA ", + "Lower Sorbian" => "LSB ", + "Luba" => "LUB ", + "Luganda" => "LUG ", + "Luhya" => "LUH ", + "Lule Sami" => "LSM ", + "Luo" => "LUO ", + "Luxembourgish" => "LTZ ", + "Macedonian" => "MKD ", + "Maithili" => "MTH ", + "Majang" => "MAJ ", + "Makua" => "MAK ", + "Malagasy" => "MLG ", + "Malay" => "MLY ", + "Malayalam Reformed" => "MLR ", + "Malayalam Traditional" => "MAL ", + "Male" => "MLE ", + "Malinke" => "MLN ", + "Maltese" => "MTS ", + "Manchu" => "MCH ", + "Mandinka" => "MND ", + "Maninka" => "MNK ", + "Manipuri" => "MNI ", + "Mansi" => "MAN ", + "Manx Gaelic" => "MNX ", + "Maori" => "MRI ", + "Mapudungun" => "MAP ", + "Marathi" => "MAR ", + "Marwari" => "MAW ", + "Mbundu" => "MBN ", + "Me'en" => "MEN ", + "Mende" => "MDE ", + "Mizo" => "MIZ ", + "Mohawk" => "MOH ", + "Moksha" => "MOK ", + "Moldavian" => "MOL ", + "Mon" => "MON ", + "Mongolian" => "MNG ", + "Moose Cree" => "MCR ", + "Moroccan" => "MOR ", + "Mundari" => "MUN ", + "N'Ko" => "NKO ", + "N-Cree" => "NCR ", + "Naga-Assamese" => "NAG ", + "Nagari" => "NGR ", + "Nanai" => "NAN ", + "Naskapi" => "NAS ", + "Ndebele" => "NDB ", + "Ndonga" => "NDG ", + "Nepali" => "NEP ", + "Newari" => "NEW ", + "Nisi" => "NIS ", + "Niuean" => "NIU ", + "Nkole" => "NKL ", + "Nogai" => "NOG ", + "Northern Sami" => "NSM ", + "Northern Tai" => "NTA ", + "Norway House Cree" => "NHC ", + "Norwegian" => "NOR ", + "Nynorsk" => "NYN ", + "Occitan" => "OCI ", + "Oji-Cree" => "OCR ", + "Ojibway" => "OJB ", + "Oriya" => "ORI ", + "Oromo" => "ORO ", + "Ossetian" => "OSS ", + "Palaung" => "PLG ", + "Palestinian Aramaic" => "PAA ", + "Pali" => "PAL ", + "Palpa" => "PAP ", + "Pashto" => "PAS ", + "Polish" => "PLK ", + "Polytonic Greek" => "PGR ", + "Portuguese" => "PTG ", + "Provencal" => "PRO ", + "Punjabi" => "PAN ", + "R-Cree" => "RCR ", + "Rajasthani" => "RAJ ", + "Rhaeto-Romanic" => "RMS ", + "Riang" => "RIA ", + "Romanian" => "ROM ", + "Romany" => "ROY ", + "Ruanda" => "RUA ", + "Russian Buriat" => "RBU ", + "Russian" => "RUS ", + "Rusyn" => "RSY ", + "Sadri" => "SAD ", + "Samoan" => "SMO ", + "Sango" => "SGO ", + "Sanskrit" => "SAN ", + "Santali" => "SAT ", + "Saraiki" => "SRK ", + "Sayisi" => "SAY ", + "Sekota" => "SEK ", + "Selkup" => "SEL ", + "Sena" => "SNA ", + "Serbian" => "SRB ", + "Serer" => "SRR ", + "Shan" => "SHN ", + "Sibe" => "SIB ", + "Sidamo" => "SID ", + "Silte Gurage" => "SIG ", + "Sindhi" => "SND ", + "Sinhalese" => "SNH ", + "Skolt Sami" => "SKS ", + "Slavey" => "SLA ", + "Slovak" => "SKY ", + "Slovenian" => "SLV ", + "Sodo Gurage" => "SOG ", + "Somali" => "SML ", + "Soninke" => "SNK ", + "Sotho" => "SOT ", + "South Slavey" => "SSL ", + "Southern Sami" => "SSM ", + "Spanish" => "ESP ", + "Suri" => "SUR ", + "Sutu" => "SXT ", + "Svan" => "SVA ", + "Swadaya Aramaic" => "SWA ", + "Swahili" => "SWK ", + "Swazi" => "SWZ ", + "Swedish" => "SVE ", + "Syriac" => "SYR ", + "TH-Cree" => "TCR ", + "Tabasaran" => "TAB ", + "Tahitian" => "THT ", + "Tai Lue" => "XBD ", + "Tajiki" => "TAJ ", + "Tamil" => "TAM ", + "Tatar" => "TAT ", + "Telugu" => "TEL ", + "Temne" => "TMN ", + "Thai" => "THA ", + "Tibetan" => "TIB ", + "Tigre" => "TGR ", + "Tigrinya" => "TGY ", + "Todo" => "TOD ", + "Tonga" => "TNG ", + "Tongan" => "TGN ", + "Tsonga" => "TSG ", + "Tswana" => "TNA ", + "Tulu" => "TUL ", + "Tundra Nenets" => "TNE ", + "Turkish" => "TRK ", + "Turkmen" => "TKM ", + "Turoyo Aramaic" => "TUA ", + "Tuvin" => "TUV ", + "Twi" => "TWI ", + "Udmurt" => "UDM ", + "Ukrainian" => "UKR ", + "Upper Sorbian" => "USB ", + "Urdu" => "URD ", + "Uyghur" => "UYG ", + "Uzbek" => "UZB ", + "Venda" => "VEN ", + "Vietnamese" => "VIT ", + "Wa" => "WA ", + "Wagdi" => "WAG ", + "Welsh" => "WEL ", + "West-Cree" => "WCR ", + "Wolof" => "WLF ", + "Woods Cree" => "DCR ", + "Xhosa" => "XHS ", + "Y-Cree" => "YCR ", + "Yakut" => "YAK ", + "Yi Classic" => "YIC ", + "Yi Modern" => "YIM ", + "Yiddish" => "JII ", + "Yoruba" => "YBA ", + "Zande" => "ZND ", + "Zulu" => "ZUL ", + }, + +'FEATURE' => { + "Above-Base Forms" => "abvf", + "Above-Base Mark Positioning" => "abvm", + "Above-Base Substitutions" => "abvs", + "Access All Alternates" => "aalt", + "Akhands" => "akhn", + "Alternate Annotation Forms" => "nalt", + "Alternate Half Widths" => "halt", + "Alternate Vertical Half Metrics" => "vhal", + "Alternate Vertical Metrics" => "valt", + "Alternative Fractions" => "afrc", + "Below-Base Forms" => "blwf", + "Below-Base Mark Positioning" => "blwm", + "Below-Base Substitutions" => "blws", + "Capital Spacing" => "cpsp", + "Case-Sensitive Forms" => "case", + "Centered CJK Punctuation" => "cpct", + "Conjunct Forms After Ro" => "cfar", + "Conjunct Forms" => "cjct", + "Contextual Alternates" => "calt", + "Contextual Ligatures" => "clig", + "Contextual Swash" => "cswh", + "Cursive Positioning" => "curs", + "Default Processing" => "dflt", + "Denominators" => "dnom", + "Diphthongs (OBSOLETE)" => "dpng", + "Discretionary Ligatures" => "dlig", + "Distances" => "dist", + "Expert Forms" => "expt", + "Final Glyph On Line Alternates" => "falt", + "Fractions" => "frac", + "Full Widths" => "fwid", + "Glyph Composition/Decomposition" => "ccmp", + "Halant Forms" => "haln", + "Half Forms" => "half", + "Half Widths" => "hwid", + "Hangul" => "hngl", + "Historical Forms" => "hist", + "Historical Ligatures" => "hlig", + "Hojo (JIS X 0212-1990) Kanji Forms" => "hojo", + "Horizontal Kana Alternates" => "hkna", + "Initial Forms" => "init", + "Isolated Forms" => "isol", + "Italics" => "ital", + "JIS2004 Forms" => "jp04", + "JIS78 Forms" => "jp78", + "JIS83 Forms" => "jp83", + "JIS90 Forms" => "jp90", + "Justification Alternates" => "jalt", + "Kerning" => "kern", + "Leading Jamo Forms" => "ljmo", + "Left Bounds" => "lfbd", + "Lining Figures" => "lnum", + "Localized Forms" => "locl", + "Mark Positioning via Substitution" => "mset", + "Mark Positioning" => "mark", + "Mark to Mark Positioning" => "mkmk", + "Mathematical Greek" => "mgrk", + "Medial Forms #2" => "med2", + "Medial Forms" => "medi", + "NLC Kanji Forms" => "nlck", + "Nukta Forms" => "nukt", + "Numerators" => "numr", + "Oldstyle Figures" => "onum", + "Optical Bounds" => "opbd", + "Optical Size" => "size", + "Ordinals" => "ordn", + "Ornaments" => "ornm", + "Petite Capitals From Capitals" => "c2pc", + "Petite Capitals" => "pcap", + "Post-base Forms" => "pstf", + "Post-base Substitutions" => "psts", + "Pre-base Forms" => "pref", + "Pre-base Substitutions" => "pres", + "Proportional Alternate Vertical Metrics" => "vpal", + "Proportional Alternate Widths" => "palt", + "Proportional Figures" => "pnum", + "Proportional Kana" => "pkna", + "Proportional Widths" => "pwid", + "Quarter Widths" => "qwid", + "Rakar Forms" => "rkrf", + "Randomize" => "rand", + "Reph Forms" => "rphf", + "Required Ligatures" => "rlig", + "Right Bounds" => "rtbd", + "Right-To-Left Alternates" => "rtla", + "Ruby Notation Forms" => "ruby", + "Scientific Inferiors" => "sinf", + "Simplified Forms" => "smpl", + "Slashed Zero" => "zero", + "Small Capitals From Capitals" => "c2sc", + "Small Capitals" => "smcp", + "Standard Ligatures" => "liga", + "Stylistic Alternates" => "salt", + "Stylistic Set 1" => "ss01", + "Stylistic Set 10" => "ss10", + "Stylistic Set 11" => "ss11", + "Stylistic Set 12" => "ss12", + "Stylistic Set 13" => "ss13", + "Stylistic Set 14" => "ss14", + "Stylistic Set 15" => "ss15", + "Stylistic Set 16" => "ss16", + "Stylistic Set 17" => "ss17", + "Stylistic Set 18" => "ss18", + "Stylistic Set 19" => "ss19", + "Stylistic Set 2" => "ss02", + "Stylistic Set 20" => "ss20", + "Stylistic Set 3" => "ss03", + "Stylistic Set 4" => "ss04", + "Stylistic Set 5" => "ss05", + "Stylistic Set 6" => "ss06", + "Stylistic Set 7" => "ss07", + "Stylistic Set 8" => "ss08", + "Stylistic Set 9" => "ss09", + "Subscript" => "subs", + "Superscript" => "sups", + "Swash" => "swsh", + "Tabular Figures" => "tnum", + "Terminal Forms #2" => "fin2", + "Terminal Forms #3" => "fin3", + "Terminal Forms" => "fina", + "Third Widths" => "twid", + "Titling" => "titl", + "Traditional Forms" => "trad", + "Traditional Name Forms" => "tnam", + "Trailing Jamo Forms" => "tjmo", + "Unicase" => "unic", + "Vattu Variants" => "vatu", + "Vertical Alternates and Rotation" => "vrt2", + "Vertical Kana Alternates" => "vkna", + "Vertical Kerning" => "vkrn", + "Vertical Writing" => "vert", + "Vowel Jamo Forms" => "vjmo", + } +); + +{ + foreach my $s (qw ( SCRIPT LANGUAGE FEATURE ) ) + { + map { $ttnames{$s}{$tttags{$s}{$_}} = $_ } keys %{$tttags{$s}}; + } +} + + +=head2 readtagsfile ( filename ) + +Read a file in the syntax of Tags.txt (included with Microsoft VOLT) to obtain additional/replacement tag definitions. + +Returns 0 if can't open the file; else 1. + +=cut + +sub readtagsfile +{ + my $fname = shift; + open (TAGS, $fname) or return 0; + my ($what, $name, $tag); + while () + { + ($what, $name, $tag) = (m/"([^"]*)", "([^"]*)", "([^"]*)"/); #" + $ttnames{$what}{$tag} = $name; + $tttags{$what}{$name} = $tag; + } + close TAGS; + return 1; +} + + + +1; diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OldCmap.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OldCmap.pm new file mode 100644 index 0000000..96545e2 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OldCmap.pm @@ -0,0 +1,358 @@ +package Font::TTF::OldCmap; + +=head1 NAME + +Font::TTF::OldCmap - Character map table + +This module is deprecated + +=head1 DESCRIPTION + +Looks after the character map. The primary structure used for handling a cmap +is the L which handles the segmented arrays of format 4 tables, +and in a simpler form for format 0 tables. + +Due to the complexity of working with segmented arrays, most of the handling of +such arrays is via methods rather than via instance variables. + +One important feature of a format 4 table is that it always contains a segment +with a final address of 0xFFFF. If you are creating a table from scratch this is +important (although L can work quite happily without it). + + +=head1 INSTANCE VARIABLES + +The instance variables listed here are not preceeded by a space due to their +emulating structural information in the font. + +=over 4 + +=item Num + +Number of subtables in this table + +=item Tables + +An array of subtables ([0..Num-1]) + +=back + +Each subtables also has its own instance variables which are, again, not +preceeded by a space. + +=over 4 + +=item Platform + +The platform number for this subtable + +=item Encoding + +The encoding number for this subtable + +=item Format + +Gives the stored format of this subtable + +=item Ver + +Gives the version (or language) information for this subtable + +=item val + +This points to a L which contains the content of the particular +subtable. + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +require Font::TTF::Table; +require Font::TTF::Segarr; + +@ISA = qw(Font::TTF::Table); + + +=head2 $t->read + +Reads the cmap into memory. Format 4 subtables read the whole subtable and +fill in the segmented array accordingly. + +Format 2 subtables are not read at all. + +=cut + +sub read +{ + my ($self) = @_; + my ($dat, $i, $j, $k, $id, @ids, $s); + my ($start, $end, $range, $delta, $form, $len, $num, $ver); + my ($fh) = $self->{' INFILE'}; + + $self->SUPER::read or return $self; + $fh->read($dat, 4); + $self->{'Num'} = unpack("x2n", $dat); + $self->{'Tables'} = []; + for ($i = 0; $i < $self->{'Num'}; $i++) + { + $s = {}; + $fh->read($dat, 8); + ($s->{'Platform'}, $s->{'Encoding'}, $s->{'LOC'}) = (unpack("nnN", $dat)); + $s->{'LOC'} += $self->{' OFFSET'}; + push(@{$self->{'Tables'}}, $s); + } + for ($i = 0; $i < $self->{'Num'}; $i++) + { + $s = $self->{'Tables'}[$i]; + $fh->seek($s->{'LOC'}, 0); + $fh->read($dat, 6); + ($form, $len, $ver) = (unpack("n3", $dat)); + + $s->{'Format'} = $form; + $s->{'Ver'} = $ver; + if ($form == 0) + { + $s->{'val'} = Font::TTF::Segarr->new; + $fh->read($dat, 256); + $s->{'val'}->fastadd_segment(0, 2, unpack("C*", $dat)); + $s->{'Start'} = 0; + $s->{'Num'} = 256; + } elsif ($form == 6) + { + my ($start, $ecount); + + $fh->read($dat, 4); + ($start, $ecount) = unpack("n2", $dat); + $fh->read($dat, $ecount << 1); + $s->{'val'} = Font::TTF::Segarr->new; + $s->{'val'}->fastadd_segment($start, 2, unpack("n*", $dat)); + $s->{'Start'} = $start; + $s->{'Num'} = $ecount; + } elsif ($form == 2) + { +# no idea what to do here yet + } elsif ($form == 4) + { + $fh->read($dat, 8); + $num = unpack("n", $dat); + $num >>= 1; + $fh->read($dat, $len - 14); + $s->{'val'} = Font::TTF::Segarr->new; + for ($j = 0; $j < $num; $j++) + { + $end = unpack("n", substr($dat, $j << 1, 2)); + $start = unpack("n", substr($dat, ($j << 1) + ($num << 1) + 2, 2)); + $delta = unpack("n", substr($dat, ($j << 1) + ($num << 2) + 2, 2)); + $delta -= 65536 if $delta > 32767; + $range = unpack("n", substr($dat, ($j << 1) + $num * 6 + 2, 2)); + @ids = (); + for ($k = $start; $k <= $end; $k++) + { + if ($range == 0) + { $id = $k + $delta; } + else + { $id = unpack("n", substr($dat, ($j << 1) + $num * 6 + + 2 + ($k - $start) * 2 + $range, 2)) + $delta; } + $id -= 65536 if $id > 65536; + push (@ids, $id); + } + $s->{'val'}->fastadd_segment($start, 0, @ids); + } + $s->{'val'}->tidy; + $s->{'Num'} = 0x10000; # always ends here + $s->{'Start'} = $s->{'val'}[0]{'START'}; + } + } + $self; +} + + +=head2 $t->ms_lookup($uni) + +Given a Unicode value in the MS table (Platform 3, Encoding 1) locates that +table and looks up the appropriate glyph number from it. + +=cut + +sub ms_lookup +{ + my ($self, $uni) = @_; + + $self->find_ms || return undef unless (defined $self->{' mstable'}); + return $self->{' mstable'}{'val'}->at($uni); +} + + +=head2 $t->find_ms + +Finds the Microsoft Unicode table and sets the C instance variable +to it if found. Returns the table it finds. + +=cut +sub find_ms +{ + my ($self) = @_; + my ($i, $s, $alt); + + return $self->{' mstable'} if defined $self->{' mstable'}; + $self->read; + for ($i = 0; $i < $self->{'Num'}; $i++) + { + $s = $self->{'Tables'}[$i]; + if ($s->{'Platform'} == 3) + { + $self->{' mstable'} = $s; + last if ($s->{'Encoding'} == 1); + } elsif ($s->{'Platform'} == 0 || ($s->{'Platform'} == 2 && $s->{'Encoding'} == 1)) + { $self->{' mstable'} = $s; } + } + $self->{' mstable'}; +} + + +=head2 $t->out($fh) + +Writes out a cmap table to a filehandle. If it has not been read, then +just copies from input file to output + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($loc, $s, $i, $base_loc, $j); + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $base_loc = $fh->tell(); + $fh->print(pack("n2", 0, $self->{'Num'})); + + for ($i = 0; $i < $self->{'Num'}; $i++) + { $fh->print(pack("nnN", $self->{'Tables'}[$i]{'Platform'}, $self->{'Tables'}[$i]{'Encoding'}, 0)); } + + for ($i = 0; $i < $self->{'Num'}; $i++) + { + $s = $self->{'Tables'}[$i]; + $s->{'val'}->tidy; + $s->{' outloc'} = $fh->tell(); + $fh->print(pack("n3", $s->{'Format'}, 0, $s->{'Ver'})); # come back for length + if ($s->{'Format'} == 0) + { + $fh->print(pack("C256", $s->{'val'}->at(0, 256))); + } elsif ($s->{'Format'} == 6) + { + $fh->print(pack("n2", $s->{'Start'}, $s->{'Num'})); + $fh->print(pack("n*", $s->{'val'}->at($s->{'Start'}, $s->{'Num'}))); + } elsif ($s->{'Format'} == 2) + { + } elsif ($s->{'Format'} == 4) + { + my ($num, $sRange, $eSel); + my (@deltas, $delta, @range, $flat, $k, $segs, $count); + + $num = $#{$s->{'val'}} + 1; + $segs = $s->{'val'}; + for ($sRange = 1, $eSel = 0; $sRange <= $num; $eSel++) + { $sRange <<= 1;} + $eSel--; + $fh->print(pack("n4", $num * 2, $sRange, $eSel, ($num * 2) - $sRange)); + $fh->print(pack("n*", map {$_->{'START'} + $_->{'LEN'} - 1} @$segs)); + $fh->print(pack("n", 0)); + $fh->print(pack("n*", map {$_->{'START'}} @$segs)); + + for ($j = 0; $j < $num; $j++) + { + $delta = $segs->[$j]{'VAL'}[0]; $flat = 1; + for ($k = 1; $k < $segs->[$j]{'LEN'}; $k++) + { + if ($segs->[$j]{'VAL'}[$k] == 0) + { $flat = 0; } + if ($delta + $k != $segs->[$j]{'VAL'}[$k]) + { + $delta = 0; + last; + } + } + push (@range, $flat); + push (@deltas, ($delta ? $delta - $segs->[$j]{'START'} : 0)); + } + $fh->print(pack("n*", @deltas)); + + $count = 0; + for ($j = 0; $j < $num; $j++) + { + $delta = $deltas[$j]; + if ($delta != 0 && $range[$j] == 1) + { $range[$j] = 0; } + else + { + $range[$j] = ($count + $num - $j) << 1; + $count += $segs->[$j]{'LEN'}; + } + } + + $fh->print(pack("n*", @range)); + + for ($j = 0; $j < $num; $j++) + { + next if ($range[$j] == 0); + for ($k = 0; $k < $segs->[$j]{'LEN'}; $k++) + { $fh->print(pack("n", $segs->[$j]{'VAL'}[$k])); } + } + } + + $loc = $fh->tell(); + $fh->seek($s->{' outloc'} + 2, 0); + $fh->print(pack("n", $loc - $s->{' outloc'})); + $fh->seek($base_loc + 8 + ($i << 3), 0); + $fh->print(pack("N", $s->{' outloc'} - $base_loc)); + $fh->seek($loc, 0); + } + $self; +} + + +=head2 @map = $t->reverse([$num]) + +Returns a reverse map of the table of given number or the Microsoft +cmap. I.e. given a glyph gives the Unicode value for it. + +=cut + +sub reverse +{ + my ($self, $tnum) = @_; + my ($table) = defined $tnum ? $self->{'Tables'}[$tnum] : $self->find_ms; + my (@res, $i, $s, $first); + + foreach $s (@{$table->{'val'}}) + { + $first = $s->{'START'}; + map {$res[$_] = $first unless $res[$_]; $first++;} @{$s->{'VAL'}}; + } + @res; +} + +1; + +=head1 BUGS + +=over 4 + +=item * + +No support for format 2 tables (MBCS) + +=back + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OldMort.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OldMort.pm new file mode 100644 index 0000000..4e30f42 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/OldMort.pm @@ -0,0 +1,706 @@ +package Font::TTF::OldMort; + +=head1 NAME + +Font::TTF::OldMort - Glyph Metamorphosis table in a font + +=head1 DESCRIPTION + +=head1 INSTANCE VARIABLES + +=item version + +table version number (Fixed: currently 1.0) + +=item chains + +list of metamorphosis chains, each of which has its own fields: + +=over + +=item defaultFlags + +chain's default subfeature flags (UInt32) + +=item featureEntries + +list of feature entries, each of which has fields: + +=over + +=item type + +=item setting + +=item enable + +=item disable + +=back + +=item subtables + +list of metamorphosis subtables, each of which has fields: + +=over + +=item type + +subtable type (0: rearrangement; 1: contextual substitution; 2: ligature; +4: non-contextual substitution; 5: insertion) + +=item direction + +processing direction ('LR' or 'RL') + +=item orientation + +applies to text in which orientation ('VH', 'V', or 'H') + +=item subFeatureFlags + +the subfeature flags controlling whether the table is used (UInt32) + +=back + +Further fields depend on the type of subtable: + +=over + +Rearrangement table: + +=over + +=item classes + +array of lists of glyphs + +=item states + +array of arrays of hashes{'nextState', 'flags'} + +=back + +Contextual substitution table: + +=over + +=item classes + +array of lists of glyphs + +=item states + +array of array of hashes{'nextState', 'flags', 'actions'}, where C +is an array of two elements which are offsets to be added to [marked, current] +glyph to get index into C (or C if no mapping to be applied) + +=item mappings + +list of glyph codes mapped to through the state table mappings + +=back + +Ligature table: + +Non-contextual substitution table: + +Insertion table: + +=back + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; +use IO::File; + +@ISA = qw(Font::TTF::Table); + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self) = @_; + my ($dat, $fh, $numChains); + + $self->SUPER::read or return $self; + + $fh = $self->{' INFILE'}; + + $fh->read($dat, 8); + ($self->{'version'}, $numChains) = TTF_Unpack("fL", $dat); + + my $chains = []; + foreach (1 .. $numChains) { + my $chainStart = $fh->tell(); + $fh->read($dat, 12); + my ($defaultFlags, $chainLength, $nFeatureEntries, $nSubtables) = TTF_Unpack("LLSS", $dat); + my $featureEntries = []; + foreach (1 .. $nFeatureEntries) { + $fh->read($dat, 12); + my ($featureType, $featureSetting, $enableFlags, $disableFlags) = TTF_Unpack("SSLL", $dat); + push @$featureEntries, { + 'type' => $featureType, + 'setting' => $featureSetting, + 'enable' => $enableFlags, + 'disable' => $disableFlags + }; + } + my $subtables = []; + foreach (1 .. $nSubtables) { + my $subtableStart = $fh->tell(); + $fh->read($dat, 8); + my ($length, $coverage, $subFeatureFlags) = TTF_Unpack("SSL", $dat); + my $type = $coverage & 0x0007; + + my $subtable = { + 'type' => $type, + 'direction' => (($coverage & 0x4000) ? 'RL' : 'LR'), + 'orientation' => (($coverage & 0x2000) ? 'VH' : ($coverage & 0x8000) ? 'V' : 'H'), + 'subFeatureFlags' => $subFeatureFlags + }; + + if ($type == 0) { # rearrangement + my ($classes, $states) = AAT_read_state_table($fh, 0); + $subtable->{'classes'} = $classes; + $subtable->{'states'} = $states; + } + + elsif ($type == 1) { # contextual + my $stateTableStart = $fh->tell(); + my ($classes, $states, $entries) = AAT_read_state_table($fh, 2); + + $fh->seek($stateTableStart, IO::File::SEEK_SET); + $fh->read($dat, 10); + my ($stateSize, $classTable, $stateArray, $entryTable, $mappingTables) = unpack("nnnnn", $dat); + my $limits = [$classTable, $stateArray, $entryTable, $mappingTables, $length - 8]; + + foreach (@$entries) { + my $actions = $_->{'actions'}; + foreach (@$actions) { + $_ = $_ ? $_ - ($mappingTables / 2) : undef; + } + } + + $subtable->{'classes'} = $classes; + $subtable->{'states'} = $states; + $subtable->{'mappings'} = [unpack("n*", AAT_read_subtable($fh, $stateTableStart, $mappingTables, $limits))]; + } + + elsif ($type == 2) { # ligature + my $stateTableStart = $fh->tell(); + my ($classes, $states, $entries) = AAT_read_state_table($fh, 0); + + $fh->seek($stateTableStart, IO::File::SEEK_SET); + $fh->read($dat, 14); + my ($stateSize, $classTable, $stateArray, $entryTable, + $ligActionTable, $componentTable, $ligatureTable) = unpack("nnnnnnn", $dat); + my $limits = [$classTable, $stateArray, $entryTable, $ligActionTable, $componentTable, $ligatureTable, $length - 8]; + + my %actions; + my $actionLists; + foreach (@$entries) { + my $offset = $_->{'flags'} & 0x3fff; + $_->{'flags'} &= ~0x3fff; + if ($offset != 0) { + if (not defined $actions{$offset}) { + $fh->seek($stateTableStart + $offset, IO::File::SEEK_SET); + my $actionList; + while (1) { + $fh->read($dat, 4); + my $action = unpack("N", $dat); + my ($last, $store, $component) = (($action & 0x80000000) != 0, ($action & 0xC0000000) != 0, ($action & 0x3fffffff)); + $component -= 0x40000000 if $component > 0x1fffffff; + $component -= $componentTable / 2; + push @$actionList, { 'store' => $store, 'component' => $component }; + last if $last; + } + push @$actionLists, $actionList; + $actions{$offset} = $#$actionLists; + } + $_->{'actions'} = $actions{$offset}; + } + } + + $subtable->{'componentTable'} = $componentTable; + my $components = [unpack("n*", AAT_read_subtable($fh, $stateTableStart, $componentTable, $limits))]; + foreach (@$components) { + $_ = ($_ - $ligatureTable) . " +" if $_ >= $ligatureTable; + } + $subtable->{'components'} = $components; + + $subtable->{'ligatureTable'} = $ligatureTable; + $subtable->{'ligatures'} = [unpack("n*", AAT_read_subtable($fh, $stateTableStart, $ligatureTable, $limits))]; + + $subtable->{'classes'} = $classes; + $subtable->{'states'} = $states; + $subtable->{'actionLists'} = $actionLists; + } + + elsif ($type == 4) { # non-contextual + my ($format, $lookup) = AAT_read_lookup($fh, 2, $length - 8, undef); + $subtable->{'format'} = $format; + $subtable->{'lookup'} = $lookup; + } + + elsif ($type == 5) { # insertion + my $stateTableStart = $fh->tell(); + my ($classes, $states, $entries) = AAT_read_state_table($fh, 2); + + my %insertListHash; + my $insertLists; + foreach (@$entries) { + my $flags = $_->{'flags'}; + my @insertCount = (($flags & 0x03e0) >> 5, ($flags & 0x001f)); + my $actions = $_->{'actions'}; + foreach (0 .. 1) { + if ($insertCount[$_] > 0) { + $fh->seek($stateTableStart + $actions->[$_], IO::File::SEEK_SET); + $fh->read($dat, $insertCount[$_] * 2); + if (not defined $insertListHash{$dat}) { + push @$insertLists, [unpack("n*", $dat)]; + $insertListHash{$dat} = $#$insertLists; + } + $actions->[$_] = $insertListHash{$dat}; + } + else { + $actions->[$_] = undef; + } + } + } + + $subtable->{'classes'} = $classes; + $subtable->{'states'} = $states; + $subtable->{'insertLists'} = $insertLists; + } + + else { + die "unknown subtable type"; + } + + push @$subtables, $subtable; + $fh->seek($subtableStart + $length, IO::File::SEEK_SET); + } + + push @$chains, { + 'defaultFlags' => $defaultFlags, + 'featureEntries' => $featureEntries, + 'subtables' => $subtables + }; + $fh->seek($chainStart + $chainLength, IO::File::SEEK_SET); + } + + $self->{'chains'} = $chains; + + $self; +} + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying + +=cut + +sub out +{ + my ($self, $fh) = @_; + + return $self->SUPER::out($fh) unless $self->{' read'}; + + my $chains = $self->{'chains'}; + $fh->print(TTF_Pack("fL", $self->{'version'}, scalar @$chains)); + + foreach (@$chains) { + my $chainStart = $fh->tell(); + my ($featureEntries, $subtables) = ($_->{'featureEntries'}, $_->{'subtables'}); + $fh->print(TTF_Pack("LLSS", $_->{'defaultFlags'}, 0, scalar @$featureEntries, scalar @$subtables)); # placeholder for length + + foreach (@$featureEntries) { + $fh->print(TTF_Pack("SSLL", $_->{'type'}, $_->{'setting'}, $_->{'enable'}, $_->{'disable'})); + } + + foreach (@$subtables) { + my $subtableStart = $fh->tell(); + my $type = $_->{'type'}; + my $coverage = $type; + $coverage += 0x4000 if $_->{'direction'} eq 'RL'; + $coverage += 0x2000 if $_->{'orientation'} eq 'VH'; + $coverage += 0x8000 if $_->{'orientation'} eq 'V'; + + $fh->print(TTF_Pack("SSL", 0, $coverage, $_->{'subFeatureFlags'})); # placeholder for length + + if ($type == 0) { # rearrangement + AAT_write_state_table($fh, $_->{'classes'}, $_->{'states'}, 0); + } + + elsif ($type == 1) { # contextual + my $stHeader = $fh->tell(); + $fh->print(pack("nnnnn", (0) x 5)); # placeholders for stateSize, classTable, stateArray, entryTable, mappingTables + + my $classTable = $fh->tell() - $stHeader; + my $classes = $_->{'classes'}; + AAT_write_classes($fh, $classes); + + my $stateArray = $fh->tell() - $stHeader; + my $states = $_->{'states'}; + my ($stateSize, $entries) = AAT_write_states($fh, $classes, $stateArray, $states, + sub { + my $actions = $_->{'actions'}; + ( $_->{'flags'}, @$actions ) + } + ); + + my $entryTable = $fh->tell() - $stHeader; + my $offset = ($entryTable + 8 * @$entries) / 2; + foreach (@$entries) { + my ($nextState, $flags, @parts) = split /,/; + $fh->print(pack("nnnn", $nextState, $flags, map { $_ eq "" ? 0 : $_ + $offset } @parts)); + } + + my $mappingTables = $fh->tell() - $stHeader; + my $mappings = $_->{'mappings'}; + $fh->print(pack("n*", @$mappings)); + + my $loc = $fh->tell(); + $fh->seek($stHeader, IO::File::SEEK_SET); + $fh->print(pack("nnnnn", $stateSize, $classTable, $stateArray, $entryTable, $mappingTables)); + $fh->seek($loc, IO::File::SEEK_SET); + } + + elsif ($type == 2) { # ligature + my $stHeader = $fh->tell(); + $fh->print(pack("nnnnnnn", (0) x 7)); # placeholders for stateSize, classTable, stateArray, entryTable, actionLists, components, ligatures + + my $classTable = $fh->tell() - $stHeader; + my $classes = $_->{'classes'}; + AAT_write_classes($fh, $classes); + + my $stateArray = $fh->tell() - $stHeader; + my $states = $_->{'states'}; + + my ($stateSize, $entries) = AAT_write_states($fh, $classes, $stateArray, $states, + sub { + ( $_->{'flags'} & 0xc000, $_->{'actions'} ) + } + ); + + my $actionLists = $_->{'actionLists'}; + my %actionListOffset; + my $actionListDataLength = 0; + my @actionListEntries; + foreach (0 .. $#$entries) { + my ($nextState, $flags, $offset) = split(/,/, $entries->[$_]); + if ($offset eq "") { + $offset = undef; + } + else { + if (defined $actionListOffset{$offset}) { + $offset = $actionListOffset{$offset}; + } + else { + $actionListOffset{$offset} = $actionListDataLength; + my $list = $actionLists->[$offset]; + $actionListDataLength += 4 * @$list; + push @actionListEntries, $list; + $offset = $actionListOffset{$offset}; + } + } + $entries->[$_] = [ $nextState, $flags, $offset ]; + } + my $entryTable = $fh->tell() - $stHeader; + my $ligActionLists = ($entryTable + @$entries * 4 + 3) & ~3; + foreach (@$entries) { + $_->[2] += $ligActionLists if defined $_->[2]; + $fh->print(pack("nn", $_->[0], $_->[1] + $_->[2])); + } + $fh->print(pack("C*", (0) x ($ligActionLists - $entryTable - @$entries * 4))); + + die "internal error" if $fh->tell() != $ligActionLists + $stHeader; + + my $componentTable = $fh->tell() - $stHeader + $actionListDataLength; + my $actionList; + foreach $actionList (@actionListEntries) { + foreach (0 .. $#$actionList) { + my $action = $actionList->[$_]; + my $val = $action->{'component'} + $componentTable / 2; + $val += 0x40000000 if $val < 0; + $val &= 0x3fffffff; + $val |= 0x40000000 if $action->{'store'}; + $val |= 0x80000000 if $_ == $#$actionList; + $fh->print(pack("N", $val)); + } + } + + die "internal error" if $fh->tell() != $componentTable + $stHeader; + + my $components = $_->{'components'}; + my $ligatureTable = $componentTable + @$components * 2; + $fh->print(pack("n*", map { (index($_, '+') >= 0 ? $ligatureTable : 0) + $_ } @$components)); + + my $ligatures = $_->{'ligatures'}; + $fh->print(pack("n*", @$ligatures)); + + my $loc = $fh->tell(); + $fh->seek($stHeader, IO::File::SEEK_SET); + $fh->print(pack("nnnnnnn", $stateSize, $classTable, $stateArray, $entryTable, $ligActionLists, $componentTable, $ligatureTable)); + $fh->seek($loc, IO::File::SEEK_SET); + } + + elsif ($type == 4) { # non-contextual + AAT_write_lookup($fh, $_->{'format'}, $_->{'lookup'}, 2, undef); + } + + elsif ($type == 5) { # insertion + } + + else { + die "unknown subtable type"; + } + + my $length = $fh->tell() - $subtableStart; + my $padBytes = (4 - ($length & 3)) & 3; + $fh->print(pack("C*", (0) x $padBytes)); + $length += $padBytes; + $fh->seek($subtableStart, IO::File::SEEK_SET); + $fh->print(pack("n", $length)); + $fh->seek($subtableStart + $length, IO::File::SEEK_SET); + } + + my $chainLength = $fh->tell() - $chainStart; + $fh->seek($chainStart + 4, IO::File::SEEK_SET); + $fh->print(pack("N", $chainLength)); + $fh->seek($chainStart + $chainLength, IO::File::SEEK_SET); + } +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + + $self->read; + my $feat = $self->{' PARENT'}->{'feat'}; + $feat->read; + my $post = $self->{' PARENT'}->{'post'}; + $post->read; + + $fh = 'STDOUT' unless defined $fh; + + $fh->printf("version %f\n", $self->{'version'}); + + my $chains = $self->{'chains'}; + foreach (@$chains) { + my $defaultFlags = $_->{'defaultFlags'}; + $fh->printf("chain: defaultFlags = %08x\n", $defaultFlags); + + my $featureEntries = $_->{'featureEntries'}; + foreach (@$featureEntries) { + $fh->printf("\tfeature %d, setting %d : enableFlags = %08x, disableFlags = %08x # '%s: %s'\n", + $_->{'type'}, $_->{'setting'}, $_->{'enable'}, $_->{'disable'}, + $feat->settingName($_->{'type'}, $_->{'setting'})); + } + + my $subtables = $_->{'subtables'}; + foreach (@$subtables) { + my $type = $_->{'type'}; + my $subFeatureFlags = $_->{'subFeatureFlags'}; + $fh->printf("\n\t%s table, %s, %s, subFeatureFlags = %08x # %s (%s)\n", + subtable_type_($type), $_->{'direction'}, $_->{'orientation'}, $subFeatureFlags, + "Default " . ((($subFeatureFlags & $defaultFlags) != 0) ? "On" : "Off"), + join(", ", + map { + join(": ", $feat->settingName($_->{'type'}, $_->{'setting'}) ) + } grep { ($_->{'enable'} & $subFeatureFlags) != 0 } @$featureEntries + ) ); + + if ($type == 0) { # rearrangement + print_classes_($fh, $_, $post); + + $fh->print("\n"); + my $states = $_->{'states'}; + my @verbs = ( "0", "Ax->xA", "xD->Dx", "AxD->DxA", + "ABx->xAB", "ABx->xBA", "xCD->CDx", "xCD->DCx", + "AxCD->CDxA", "AxCD->DCxA", "ABxD->DxAB", "ABxD->DxBA", + "ABxCD->CDxAB", "ABxCD->CDxBA", "ABxCD->DCxAB", "ABxCD->DCxBA"); + foreach (0 .. $#$states) { + $fh->printf("\t\tState %d:", $_); + my $state = $states->[$_]; + foreach (@$state) { + my $flags; + $flags .= "!" if ($_->{'flags'} & 0x4000); + $flags .= "<" if ($_->{'flags'} & 0x8000); + $flags .= ">" if ($_->{'flags'} & 0x2000); + $fh->printf("\t(%s%d,%s)", $flags, $_->{'nextState'}, $verbs[($_->{'flags'} & 0x000f)]); + } + $fh->print("\n"); + } + } + + elsif ($type == 1) { # contextual + print_classes_($fh, $_, $post); + + $fh->print("\n"); + my $states = $_->{'states'}; + foreach (0 .. $#$states) { + $fh->printf("\t\tState %d:", $_); + my $state = $states->[$_]; + foreach (@$state) { + my $flags; + $flags .= "!" if ($_->{'flags'} & 0x4000); + $flags .= "*" if ($_->{'flags'} & 0x8000); + my $actions = $_->{'actions'}; + $fh->printf("\t(%s%d,%s,%s)", $flags, $_->{'nextState'}, map { defined $_ ? $_ : "=" } @$actions); + } + $fh->print("\n"); + } + + $fh->print("\n"); + my $mappings = $_->{'mappings'}; + foreach (0 .. $#$mappings) { + $fh->printf("\t\tMapping %d: %d [%s]\n", $_, $mappings->[$_], $post->{'VAL'}[$mappings->[$_]]); + } + } + + elsif ($type == 2) { # ligature + print_classes_($fh, $_, $post); + + $fh->print("\n"); + my $states = $_->{'states'}; + foreach (0 .. $#$states) { + $fh->printf("\t\tState %d:", $_); + my $state = $states->[$_]; + foreach (@$state) { + my $flags; + $flags .= "!" if ($_->{'flags'} & 0x4000); + $flags .= "*" if ($_->{'flags'} & 0x8000); + $fh->printf("\t(%s%d,%s)", $flags, $_->{'nextState'}, defined $_->{'actions'} ? $_->{'actions'} : "="); + } + $fh->print("\n"); + } + + $fh->print("\n"); + my $actionLists = $_->{'actionLists'}; + foreach (0 .. $#$actionLists) { + $fh->printf("\t\tList %d:\t", $_); + my $actionList = $actionLists->[$_]; + $fh->printf("%s\n", join(", ", map { ($_->{'component'} . ($_->{'store'} ? "*" : "") ) } @$actionList)); + } + + my $ligatureTable = $_->{'ligatureTable'}; + + $fh->print("\n"); + my $components = $_->{'components'}; + foreach (0 .. $#$components) { + $fh->printf("\t\tComponent %d: %s\n", $_, $components->[$_]); + } + + $fh->print("\n"); + my $ligatures = $_->{'ligatures'}; + foreach (0 .. $#$ligatures) { + $fh->printf("\t\tLigature %d: %d [%s]\n", $_, $ligatures->[$_], $post->{'VAL'}[$ligatures->[$_]]); + } + } + + elsif ($type == 4) { # non-contextual + my $lookup = $_->{'lookup'}; + $fh->printf("\t\tLookup format %d\n", $_->{'format'}); + if (defined $lookup) { + foreach (sort { $a <=> $b } keys %$lookup) { + $fh->printf("\t\t\t%d [%s] -> %d [%s])\n", $_, $post->{'VAL'}[$_], $lookup->{$_}, $post->{'VAL'}[$lookup->{$_}]); + } + } + } + + elsif ($type == 5) { # insertion + print_classes_($fh, $_, $post); + + $fh->print("\n"); + my $states = $_->{'states'}; + foreach (0 .. $#$states) { + $fh->printf("\t\tState %d:", $_); + my $state = $states->[$_]; + foreach (@$state) { + my $flags; + $flags .= "!" if ($_->{'flags'} & 0x4000); + $flags .= "*" if ($_->{'flags'} & 0x8000); + my $actions = $_->{'actions'}; + $fh->printf("\t(%s%d,%s,%s)", $flags, $_->{'nextState'}, map { defined $_ ? $_ : "=" } @$actions); + } + $fh->print("\n"); + } + + $fh->print("\n"); + my $insertLists = $_->{'insertLists'}; + foreach (0 .. $#$insertLists) { + my $insertList = $insertLists->[$_]; + $fh->printf("\t\tList %d: %s\n", $_, join(", ", map { $_ . " [" . $post->{'VAL'}[$_] . "]" } @$insertList)); + } + } + + else { + # unknown + } + } + } +} + +sub print_classes_ +{ + my ($fh, $subtable, $post) = @_; + + my $classes = $subtable->{'classes'}; + foreach (0 .. $#$classes) { + my $class = $classes->[$_]; + if (defined $class) { + $fh->printf("\t\tClass %d:\t%s\n", $_, join(", ", map { $_ . " [" . $post->{'VAL'}[$_] . "]" } @$class)); + } + } +} + +sub subtable_type_ +{ + my ($val) = @_; + my ($res); + + my @types = ( + 'Rearrangement', + 'Contextual', + 'Ligature', + undef, + 'Non-contextual', + 'Insertion', + ); + $res = $types[$val] or ('Undefined (' . $val . ')'); + + $res; +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/PCLT.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/PCLT.pm new file mode 100644 index 0000000..2856c16 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/PCLT.pm @@ -0,0 +1,121 @@ +package Font::TTF::PCLT; + +=head1 NAME + +Font::TTF::PCLT - PCLT TrueType font table + +=head1 DESCRIPTION + +The PCLT table holds various pieces HP-PCL specific information. Information +here is generally not used by other software, except for the xHeight and +CapHeight which are stored here (if the table exists in a font). + +=head1 INSTANCE VARIABLES + +Only from table and the standard: + + version + FontNumber + Pitch + xHeight + Style + TypeFamily + CapHeight + SymbolSet + Typeface + CharacterComplement + FileName + StrokeWeight + WidthType + SerifStyle + +Notice that C, C and C return arrays +of unsigned characters of the appropriate length + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA %fields @field_info); + +require Font::TTF::Table; +use Font::TTF::Utils; + +@ISA = qw(Font::TTF::Table); +@field_info = ( + 'version' => 'v', + 'FontNumber' => 'L', + 'Pitch' => 'S', + 'xHeight' => 'S', + 'Style' => 'S', + 'TypeFamily' => 'S', + 'CapHeight' => 'S', + 'SymbolSet' => 'S', + 'Typeface' => 'C16', + 'CharacterComplement' => 'C8', + 'FileName' => 'C6', + 'StrokeWeight' => 'C', + 'WidthType' => 'C', + 'SerifStyle' => 'c'); + +sub init +{ + my ($k, $v, $c, $i); + for ($i = 0; $i < $#field_info; $i += 2) + { + ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); + next unless defined $k && $k ne ""; + $fields{$k} = $v; + } +} + + +=head2 $t->read + +Reads the table into memory thanks to some utility functions + +=cut + +sub read +{ + my ($self) = @_; + my ($dat); + + $self->SUPER::read || return $self; + + init unless defined $fields{'xHeight'}; + $self->{' INFILE'}->read($dat, 54); + + TTF_Read_Fields($self, $dat, \%fields); + $self; +} + + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying. + +=cut + +sub out +{ + my ($self, $fh) = @_; + + return $self->SUPER::out($fh) unless $self->{' read'}; + $fh->print(TTF_Out_Fields($self, \%fields, 54)); +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/PSNames.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/PSNames.pm new file mode 100644 index 0000000..cb4c73b --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/PSNames.pm @@ -0,0 +1,4447 @@ +package Font::TTF::PSNames; + +=head1 NAME + +Font::TTF::PSNames - Utilities for Postscript glyph name processing + +=head1 SYNOPSIS + + use Font::TTF::PSNames qw(parse lookup); + $name = lookup($uni); + $uni = parse($name); + +=head1 METHODS + +=cut + +use strict; +use vars qw(%names %agl @EXPORT_OK @ISA); +require Exporter; +@ISA = qw( Exporter ); +@EXPORT_OK = qw( parse lookup); + +# Adobe Glyph List for New Fonts +# from http://partners.adobe.com/asn/tech/type/aglfn13.txt + +%names = ( + '0020' => 'space', + '0021' => 'exclam', + '0022' => 'quotedbl', + '0023' => 'numbersign', + '0024' => 'dollar', + '0025' => 'percent', + '0026' => 'ampersand', + '0027' => 'quotesingle', + '0028' => 'parenleft', + '0029' => 'parenright', + '002A' => 'asterisk', + '002B' => 'plus', + '002C' => 'comma', + '002D' => 'hyphen', + '002E' => 'period', + '002F' => 'slash', + '0030' => 'zero', + '0031' => 'one', + '0032' => 'two', + '0033' => 'three', + '0034' => 'four', + '0035' => 'five', + '0036' => 'six', + '0037' => 'seven', + '0038' => 'eight', + '0039' => 'nine', + '003A' => 'colon', + '003B' => 'semicolon', + '003C' => 'less', + '003D' => 'equal', + '003E' => 'greater', + '003F' => 'question', + '0040' => 'at', + '0041' => 'A', + '0042' => 'B', + '0043' => 'C', + '0044' => 'D', + '0045' => 'E', + '0046' => 'F', + '0047' => 'G', + '0048' => 'H', + '0049' => 'I', + '004A' => 'J', + '004B' => 'K', + '004C' => 'L', + '004D' => 'M', + '004E' => 'N', + '004F' => 'O', + '0050' => 'P', + '0051' => 'Q', + '0052' => 'R', + '0053' => 'S', + '0054' => 'T', + '0055' => 'U', + '0056' => 'V', + '0057' => 'W', + '0058' => 'X', + '0059' => 'Y', + '005A' => 'Z', + '005B' => 'bracketleft', + '005C' => 'backslash', + '005D' => 'bracketright', + '005E' => 'asciicircum', + '005F' => 'underscore', + '0060' => 'grave', + '0061' => 'a', + '0062' => 'b', + '0063' => 'c', + '0064' => 'd', + '0065' => 'e', + '0066' => 'f', + '0067' => 'g', + '0068' => 'h', + '0069' => 'i', + '006A' => 'j', + '006B' => 'k', + '006C' => 'l', + '006D' => 'm', + '006E' => 'n', + '006F' => 'o', + '0070' => 'p', + '0071' => 'q', + '0072' => 'r', + '0073' => 's', + '0074' => 't', + '0075' => 'u', + '0076' => 'v', + '0077' => 'w', + '0078' => 'x', + '0079' => 'y', + '007A' => 'z', + '007B' => 'braceleft', + '007C' => 'bar', + '007D' => 'braceright', + '007E' => 'asciitilde', +# '00A0' => 'space', + '00A1' => 'exclamdown', + '00A2' => 'cent', + '00A3' => 'sterling', + '00A4' => 'currency', + '00A5' => 'yen', + '00A6' => 'brokenbar', + '00A7' => 'section', + '00A8' => 'dieresis', + '00A9' => 'copyright', + '00AA' => 'ordfeminine', + '00AB' => 'guillemotleft', + '00AC' => 'logicalnot', +# '00AD' => 'hyphen', + '00AE' => 'registered', + '00AF' => 'macron', + '00B0' => 'degree', + '00B1' => 'plusminus', + '00B2' => 'twosuperior', + '00B3' => 'threesuperior', + '00B4' => 'acute', + '00B5' => 'mu', + '00B6' => 'paragraph', + '00B7' => 'periodcentered', + '00B8' => 'cedilla', + '00B9' => 'onesuperior', + '00BA' => 'ordmasculine', + '00BB' => 'guillemotright', + '00BC' => 'onequarter', + '00BD' => 'onehalf', + '00BE' => 'threequarters', + '00BF' => 'questiondown', + '00C0' => 'Agrave', + '00C1' => 'Aacute', + '00C2' => 'Acircumflex', + '00C3' => 'Atilde', + '00C4' => 'Adieresis', + '00C5' => 'Aring', + '00C6' => 'AE', + '00C7' => 'Ccedilla', + '00C8' => 'Egrave', + '00C9' => 'Eacute', + '00CA' => 'Ecircumflex', + '00CB' => 'Edieresis', + '00CC' => 'Igrave', + '00CD' => 'Iacute', + '00CE' => 'Icircumflex', + '00CF' => 'Idieresis', + '00D0' => 'Eth', + '00D1' => 'Ntilde', + '00D2' => 'Ograve', + '00D3' => 'Oacute', + '00D4' => 'Ocircumflex', + '00D5' => 'Otilde', + '00D6' => 'Odieresis', + '00D7' => 'multiply', + '00D8' => 'Oslash', + '00D9' => 'Ugrave', + '00DA' => 'Uacute', + '00DB' => 'Ucircumflex', + '00DC' => 'Udieresis', + '00DD' => 'Yacute', + '00DE' => 'Thorn', + '00DF' => 'germandbls', + '00E0' => 'agrave', + '00E1' => 'aacute', + '00E2' => 'acircumflex', + '00E3' => 'atilde', + '00E4' => 'adieresis', + '00E5' => 'aring', + '00E6' => 'ae', + '00E7' => 'ccedilla', + '00E8' => 'egrave', + '00E9' => 'eacute', + '00EA' => 'ecircumflex', + '00EB' => 'edieresis', + '00EC' => 'igrave', + '00ED' => 'iacute', + '00EE' => 'icircumflex', + '00EF' => 'idieresis', + '00F0' => 'eth', + '00F1' => 'ntilde', + '00F2' => 'ograve', + '00F3' => 'oacute', + '00F4' => 'ocircumflex', + '00F5' => 'otilde', + '00F6' => 'odieresis', + '00F7' => 'divide', + '00F8' => 'oslash', + '00F9' => 'ugrave', + '00FA' => 'uacute', + '00FB' => 'ucircumflex', + '00FC' => 'udieresis', + '00FD' => 'yacute', + '00FE' => 'thorn', + '00FF' => 'ydieresis', + '0100' => 'Amacron', + '0101' => 'amacron', + '0102' => 'Abreve', + '0103' => 'abreve', + '0104' => 'Aogonek', + '0105' => 'aogonek', + '0106' => 'Cacute', + '0107' => 'cacute', + '0108' => 'Ccircumflex', + '0109' => 'ccircumflex', + '010A' => 'Cdotaccent', + '010B' => 'cdotaccent', + '010C' => 'Ccaron', + '010D' => 'ccaron', + '010E' => 'Dcaron', + '010F' => 'dcaron', + '0110' => 'Dcroat', + '0111' => 'dcroat', + '0112' => 'Emacron', + '0113' => 'emacron', + '0114' => 'Ebreve', + '0115' => 'ebreve', + '0116' => 'Edotaccent', + '0117' => 'edotaccent', + '0118' => 'Eogonek', + '0119' => 'eogonek', + '011A' => 'Ecaron', + '011B' => 'ecaron', + '011C' => 'Gcircumflex', + '011D' => 'gcircumflex', + '011E' => 'Gbreve', + '011F' => 'gbreve', + '0120' => 'Gdotaccent', + '0121' => 'gdotaccent', + '0122' => 'Gcommaaccent', + '0123' => 'gcommaaccent', + '0124' => 'Hcircumflex', + '0125' => 'hcircumflex', + '0126' => 'Hbar', + '0127' => 'hbar', + '0128' => 'Itilde', + '0129' => 'itilde', + '012A' => 'Imacron', + '012B' => 'imacron', + '012C' => 'Ibreve', + '012D' => 'ibreve', + '012E' => 'Iogonek', + '012F' => 'iogonek', + '0130' => 'Idotaccent', + '0131' => 'dotlessi', + '0132' => 'IJ', + '0133' => 'ij', + '0134' => 'Jcircumflex', + '0135' => 'jcircumflex', + '0136' => 'Kcommaaccent', + '0137' => 'kcommaaccent', + '0138' => 'kgreenlandic', + '0139' => 'Lacute', + '013A' => 'lacute', + '013B' => 'Lcommaaccent', + '013C' => 'lcommaaccent', + '013D' => 'Lcaron', + '013E' => 'lcaron', + '013F' => 'Ldot', + '0140' => 'ldot', + '0141' => 'Lslash', + '0142' => 'lslash', + '0143' => 'Nacute', + '0144' => 'nacute', + '0145' => 'Ncommaaccent', + '0146' => 'ncommaaccent', + '0147' => 'Ncaron', + '0148' => 'ncaron', + '0149' => 'napostrophe', + '014A' => 'Eng', + '014B' => 'eng', + '014C' => 'Omacron', + '014D' => 'omacron', + '014E' => 'Obreve', + '014F' => 'obreve', + '0150' => 'Ohungarumlaut', + '0151' => 'ohungarumlaut', + '0152' => 'OE', + '0153' => 'oe', + '0154' => 'Racute', + '0155' => 'racute', + '0156' => 'Rcommaaccent', + '0157' => 'rcommaaccent', + '0158' => 'Rcaron', + '0159' => 'rcaron', + '015A' => 'Sacute', + '015B' => 'sacute', + '015C' => 'Scircumflex', + '015D' => 'scircumflex', + '015E' => 'Scedilla', + '015F' => 'scedilla', + '0160' => 'Scaron', + '0161' => 'scaron', + '0162' => 'Tcommaaccent', + '0163' => 'tcommaaccent', + '0164' => 'Tcaron', + '0165' => 'tcaron', + '0166' => 'Tbar', + '0167' => 'tbar', + '0168' => 'Utilde', + '0169' => 'utilde', + '016A' => 'Umacron', + '016B' => 'umacron', + '016C' => 'Ubreve', + '016D' => 'ubreve', + '016E' => 'Uring', + '016F' => 'uring', + '0170' => 'Uhungarumlaut', + '0171' => 'uhungarumlaut', + '0172' => 'Uogonek', + '0173' => 'uogonek', + '0174' => 'Wcircumflex', + '0175' => 'wcircumflex', + '0176' => 'Ycircumflex', + '0177' => 'ycircumflex', + '0178' => 'Ydieresis', + '0179' => 'Zacute', + '017A' => 'zacute', + '017B' => 'Zdotaccent', + '017C' => 'zdotaccent', + '017D' => 'Zcaron', + '017E' => 'zcaron', + '017F' => 'longs', + '0192' => 'florin', + '01A0' => 'Ohorn', + '01A1' => 'ohorn', + '01AF' => 'Uhorn', + '01B0' => 'uhorn', + '01E6' => 'Gcaron', + '01E7' => 'gcaron', + '01FA' => 'Aringacute', + '01FB' => 'aringacute', + '01FC' => 'AEacute', + '01FD' => 'aeacute', + '01FE' => 'Oslashacute', + '01FF' => 'oslashacute', + '0218' => 'Scommaaccent', + '0219' => 'scommaaccent', +# '021A' => 'Tcommaaccent', +# '021B' => 'tcommaaccent', + '02BC' => 'afii57929', + '02BD' => 'afii64937', + '02C6' => 'circumflex', + '02C7' => 'caron', +# '02C9' => 'macron', + '02D8' => 'breve', + '02D9' => 'dotaccent', + '02DA' => 'ring', + '02DB' => 'ogonek', + '02DC' => 'tilde', + '02DD' => 'hungarumlaut', + '0300' => 'gravecomb', + '0301' => 'acutecomb', + '0303' => 'tildecomb', + '0309' => 'hookabovecomb', + '0323' => 'dotbelowcomb', + '0384' => 'tonos', + '0385' => 'dieresistonos', + '0386' => 'Alphatonos', + '0387' => 'anoteleia', + '0388' => 'Epsilontonos', + '0389' => 'Etatonos', + '038A' => 'Iotatonos', + '038C' => 'Omicrontonos', + '038E' => 'Upsilontonos', + '038F' => 'Omegatonos', + '0390' => 'iotadieresistonos', + '0391' => 'Alpha', + '0392' => 'Beta', + '0393' => 'Gamma', +# '0394' => 'Delta', + '0395' => 'Epsilon', + '0396' => 'Zeta', + '0397' => 'Eta', + '0398' => 'Theta', + '0399' => 'Iota', + '039A' => 'Kappa', + '039B' => 'Lambda', + '039C' => 'Mu', + '039D' => 'Nu', + '039E' => 'Xi', + '039F' => 'Omicron', + '03A0' => 'Pi', + '03A1' => 'Rho', + '03A3' => 'Sigma', + '03A4' => 'Tau', + '03A5' => 'Upsilon', + '03A6' => 'Phi', + '03A7' => 'Chi', + '03A8' => 'Psi', +# '03A9' => 'Omega', + '03AA' => 'Iotadieresis', + '03AB' => 'Upsilondieresis', + '03AC' => 'alphatonos', + '03AD' => 'epsilontonos', + '03AE' => 'etatonos', + '03AF' => 'iotatonos', + '03B0' => 'upsilondieresistonos', + '03B1' => 'alpha', + '03B2' => 'beta', + '03B3' => 'gamma', + '03B4' => 'delta', + '03B5' => 'epsilon', + '03B6' => 'zeta', + '03B7' => 'eta', + '03B8' => 'theta', + '03B9' => 'iota', + '03BA' => 'kappa', + '03BB' => 'lambda', +# '03BC' => 'mu', + '03BD' => 'nu', + '03BE' => 'xi', + '03BF' => 'omicron', + '03C0' => 'pi', + '03C1' => 'rho', + '03C2' => 'sigma1', + '03C3' => 'sigma', + '03C4' => 'tau', + '03C5' => 'upsilon', + '03C6' => 'phi', + '03C7' => 'chi', + '03C8' => 'psi', + '03C9' => 'omega', + '03CA' => 'iotadieresis', + '03CB' => 'upsilondieresis', + '03CC' => 'omicrontonos', + '03CD' => 'upsilontonos', + '03CE' => 'omegatonos', + '03D1' => 'theta1', + '03D2' => 'Upsilon1', + '03D5' => 'phi1', + '03D6' => 'omega1', + '0401' => 'afii10023', + '0402' => 'afii10051', + '0403' => 'afii10052', + '0404' => 'afii10053', + '0405' => 'afii10054', + '0406' => 'afii10055', + '0407' => 'afii10056', + '0408' => 'afii10057', + '0409' => 'afii10058', + '040A' => 'afii10059', + '040B' => 'afii10060', + '040C' => 'afii10061', + '040E' => 'afii10062', + '040F' => 'afii10145', + '0410' => 'afii10017', + '0411' => 'afii10018', + '0412' => 'afii10019', + '0413' => 'afii10020', + '0414' => 'afii10021', + '0415' => 'afii10022', + '0416' => 'afii10024', + '0417' => 'afii10025', + '0418' => 'afii10026', + '0419' => 'afii10027', + '041A' => 'afii10028', + '041B' => 'afii10029', + '041C' => 'afii10030', + '041D' => 'afii10031', + '041E' => 'afii10032', + '041F' => 'afii10033', + '0420' => 'afii10034', + '0421' => 'afii10035', + '0422' => 'afii10036', + '0423' => 'afii10037', + '0424' => 'afii10038', + '0425' => 'afii10039', + '0426' => 'afii10040', + '0427' => 'afii10041', + '0428' => 'afii10042', + '0429' => 'afii10043', + '042A' => 'afii10044', + '042B' => 'afii10045', + '042C' => 'afii10046', + '042D' => 'afii10047', + '042E' => 'afii10048', + '042F' => 'afii10049', + '0430' => 'afii10065', + '0431' => 'afii10066', + '0432' => 'afii10067', + '0433' => 'afii10068', + '0434' => 'afii10069', + '0435' => 'afii10070', + '0436' => 'afii10072', + '0437' => 'afii10073', + '0438' => 'afii10074', + '0439' => 'afii10075', + '043A' => 'afii10076', + '043B' => 'afii10077', + '043C' => 'afii10078', + '043D' => 'afii10079', + '043E' => 'afii10080', + '043F' => 'afii10081', + '0440' => 'afii10082', + '0441' => 'afii10083', + '0442' => 'afii10084', + '0443' => 'afii10085', + '0444' => 'afii10086', + '0445' => 'afii10087', + '0446' => 'afii10088', + '0447' => 'afii10089', + '0448' => 'afii10090', + '0449' => 'afii10091', + '044A' => 'afii10092', + '044B' => 'afii10093', + '044C' => 'afii10094', + '044D' => 'afii10095', + '044E' => 'afii10096', + '044F' => 'afii10097', + '0451' => 'afii10071', + '0452' => 'afii10099', + '0453' => 'afii10100', + '0454' => 'afii10101', + '0455' => 'afii10102', + '0456' => 'afii10103', + '0457' => 'afii10104', + '0458' => 'afii10105', + '0459' => 'afii10106', + '045A' => 'afii10107', + '045B' => 'afii10108', + '045C' => 'afii10109', + '045E' => 'afii10110', + '045F' => 'afii10193', + '0462' => 'afii10146', + '0463' => 'afii10194', + '0472' => 'afii10147', + '0473' => 'afii10195', + '0474' => 'afii10148', + '0475' => 'afii10196', + '0490' => 'afii10050', + '0491' => 'afii10098', + '04D9' => 'afii10846', + '05B0' => 'afii57799', + '05B1' => 'afii57801', + '05B2' => 'afii57800', + '05B3' => 'afii57802', + '05B4' => 'afii57793', + '05B5' => 'afii57794', + '05B6' => 'afii57795', + '05B7' => 'afii57798', + '05B8' => 'afii57797', + '05B9' => 'afii57806', + '05BB' => 'afii57796', + '05BC' => 'afii57807', + '05BD' => 'afii57839', + '05BE' => 'afii57645', + '05BF' => 'afii57841', + '05C0' => 'afii57842', + '05C1' => 'afii57804', + '05C2' => 'afii57803', + '05C3' => 'afii57658', + '05D0' => 'afii57664', + '05D1' => 'afii57665', + '05D2' => 'afii57666', + '05D3' => 'afii57667', + '05D4' => 'afii57668', + '05D5' => 'afii57669', + '05D6' => 'afii57670', + '05D7' => 'afii57671', + '05D8' => 'afii57672', + '05D9' => 'afii57673', + '05DA' => 'afii57674', + '05DB' => 'afii57675', + '05DC' => 'afii57676', + '05DD' => 'afii57677', + '05DE' => 'afii57678', + '05DF' => 'afii57679', + '05E0' => 'afii57680', + '05E1' => 'afii57681', + '05E2' => 'afii57682', + '05E3' => 'afii57683', + '05E4' => 'afii57684', + '05E5' => 'afii57685', + '05E6' => 'afii57686', + '05E7' => 'afii57687', + '05E8' => 'afii57688', + '05E9' => 'afii57689', + '05EA' => 'afii57690', + '05F0' => 'afii57716', + '05F1' => 'afii57717', + '05F2' => 'afii57718', + '060C' => 'afii57388', + '061B' => 'afii57403', + '061F' => 'afii57407', + '0621' => 'afii57409', + '0622' => 'afii57410', + '0623' => 'afii57411', + '0624' => 'afii57412', + '0625' => 'afii57413', + '0626' => 'afii57414', + '0627' => 'afii57415', + '0628' => 'afii57416', + '0629' => 'afii57417', + '062A' => 'afii57418', + '062B' => 'afii57419', + '062C' => 'afii57420', + '062D' => 'afii57421', + '062E' => 'afii57422', + '062F' => 'afii57423', + '0630' => 'afii57424', + '0631' => 'afii57425', + '0632' => 'afii57426', + '0633' => 'afii57427', + '0634' => 'afii57428', + '0635' => 'afii57429', + '0636' => 'afii57430', + '0637' => 'afii57431', + '0638' => 'afii57432', + '0639' => 'afii57433', + '063A' => 'afii57434', + '0640' => 'afii57440', + '0641' => 'afii57441', + '0642' => 'afii57442', + '0643' => 'afii57443', + '0644' => 'afii57444', + '0645' => 'afii57445', + '0646' => 'afii57446', + '0647' => 'afii57470', + '0648' => 'afii57448', + '0649' => 'afii57449', + '064A' => 'afii57450', + '064B' => 'afii57451', + '064C' => 'afii57452', + '064D' => 'afii57453', + '064E' => 'afii57454', + '064F' => 'afii57455', + '0650' => 'afii57456', + '0651' => 'afii57457', + '0652' => 'afii57458', + '0660' => 'afii57392', + '0661' => 'afii57393', + '0662' => 'afii57394', + '0663' => 'afii57395', + '0664' => 'afii57396', + '0665' => 'afii57397', + '0666' => 'afii57398', + '0667' => 'afii57399', + '0668' => 'afii57400', + '0669' => 'afii57401', + '066A' => 'afii57381', + '066D' => 'afii63167', + '0679' => 'afii57511', + '067E' => 'afii57506', + '0686' => 'afii57507', + '0688' => 'afii57512', + '0691' => 'afii57513', + '0698' => 'afii57508', + '06A4' => 'afii57505', + '06AF' => 'afii57509', + '06BA' => 'afii57514', + '06D2' => 'afii57519', + '06D5' => 'afii57534', + '1E80' => 'Wgrave', + '1E81' => 'wgrave', + '1E82' => 'Wacute', + '1E83' => 'wacute', + '1E84' => 'Wdieresis', + '1E85' => 'wdieresis', + '1EF2' => 'Ygrave', + '1EF3' => 'ygrave', + '200C' => 'afii61664', + '200D' => 'afii301', + '200E' => 'afii299', + '200F' => 'afii300', + '2012' => 'figuredash', + '2013' => 'endash', + '2014' => 'emdash', + '2015' => 'afii00208', + '2017' => 'underscoredbl', + '2018' => 'quoteleft', + '2019' => 'quoteright', + '201A' => 'quotesinglbase', + '201B' => 'quotereversed', + '201C' => 'quotedblleft', + '201D' => 'quotedblright', + '201E' => 'quotedblbase', + '2020' => 'dagger', + '2021' => 'daggerdbl', + '2022' => 'bullet', + '2024' => 'onedotenleader', + '2025' => 'twodotenleader', + '2026' => 'ellipsis', + '202C' => 'afii61573', + '202D' => 'afii61574', + '202E' => 'afii61575', + '2030' => 'perthousand', + '2032' => 'minute', + '2033' => 'second', + '2039' => 'guilsinglleft', + '203A' => 'guilsinglright', + '203C' => 'exclamdbl', + '2044' => 'fraction', +# '2070' => 'zerosuperior', +# '2074' => 'foursuperior', +# '2075' => 'fivesuperior', +# '2076' => 'sixsuperior', +# '2077' => 'sevensuperior', +# '2078' => 'eightsuperior', +# '2079' => 'ninesuperior', +# '207D' => 'parenleftsuperior', +# '207E' => 'parenrightsuperior', +# '207F' => 'nsuperior', +# '2080' => 'zeroinferior', +# '2081' => 'oneinferior', +# '2082' => 'twoinferior', +# '2083' => 'threeinferior', +# '2084' => 'fourinferior', +# '2085' => 'fiveinferior', +# '2086' => 'sixinferior', +# '2087' => 'seveninferior', +# '2088' => 'eightinferior', +# '2089' => 'nineinferior', +# '208D' => 'parenleftinferior', +# '208E' => 'parenrightinferior', + '20A1' => 'colonmonetary', + '20A3' => 'franc', + '20A4' => 'lira', + '20A7' => 'peseta', + '20AA' => 'afii57636', + '20AB' => 'dong', + '20AC' => 'Euro', + '2105' => 'afii61248', + '2111' => 'Ifraktur', + '2113' => 'afii61289', + '2116' => 'afii61352', + '2118' => 'weierstrass', + '211C' => 'Rfraktur', + '211E' => 'prescription', + '2122' => 'trademark', + '2126' => 'Omega', + '212E' => 'estimated', + '2135' => 'aleph', + '2153' => 'onethird', + '2154' => 'twothirds', + '215B' => 'oneeighth', + '215C' => 'threeeighths', + '215D' => 'fiveeighths', + '215E' => 'seveneighths', + '2190' => 'arrowleft', + '2191' => 'arrowup', + '2192' => 'arrowright', + '2193' => 'arrowdown', + '2194' => 'arrowboth', + '2195' => 'arrowupdn', + '21A8' => 'arrowupdnbse', + '21B5' => 'carriagereturn', + '21D0' => 'arrowdblleft', + '21D1' => 'arrowdblup', + '21D2' => 'arrowdblright', + '21D3' => 'arrowdbldown', + '21D4' => 'arrowdblboth', + '2200' => 'universal', + '2202' => 'partialdiff', + '2203' => 'existential', + '2205' => 'emptyset', + '2206' => 'Delta', + '2207' => 'gradient', + '2208' => 'element', + '2209' => 'notelement', + '220B' => 'suchthat', + '220F' => 'product', + '2211' => 'summation', + '2212' => 'minus', +# '2215' => 'fraction', + '2217' => 'asteriskmath', +# '2219' => 'periodcentered', + '221A' => 'radical', + '221D' => 'proportional', + '221E' => 'infinity', + '221F' => 'orthogonal', + '2220' => 'angle', + '2227' => 'logicaland', + '2228' => 'logicalor', + '2229' => 'intersection', + '222A' => 'union', + '222B' => 'integral', + '2234' => 'therefore', + '223C' => 'similar', + '2245' => 'congruent', + '2248' => 'approxequal', + '2260' => 'notequal', + '2261' => 'equivalence', + '2264' => 'lessequal', + '2265' => 'greaterequal', + '2282' => 'propersubset', + '2283' => 'propersuperset', + '2284' => 'notsubset', + '2286' => 'reflexsubset', + '2287' => 'reflexsuperset', + '2295' => 'circleplus', + '2297' => 'circlemultiply', + '22A5' => 'perpendicular', + '22C5' => 'dotmath', + '2302' => 'house', + '2310' => 'revlogicalnot', + '2320' => 'integraltp', + '2321' => 'integralbt', + '2329' => 'angleleft', + '232A' => 'angleright', + '2500' => 'SF100000', + '2502' => 'SF110000', + '250C' => 'SF010000', + '2510' => 'SF030000', + '2514' => 'SF020000', + '2518' => 'SF040000', + '251C' => 'SF080000', + '2524' => 'SF090000', + '252C' => 'SF060000', + '2534' => 'SF070000', + '253C' => 'SF050000', + '2550' => 'SF430000', + '2551' => 'SF240000', + '2552' => 'SF510000', + '2553' => 'SF520000', + '2554' => 'SF390000', + '2555' => 'SF220000', + '2556' => 'SF210000', + '2557' => 'SF250000', + '2558' => 'SF500000', + '2559' => 'SF490000', + '255A' => 'SF380000', + '255B' => 'SF280000', + '255C' => 'SF270000', + '255D' => 'SF260000', + '255E' => 'SF360000', + '255F' => 'SF370000', + '2560' => 'SF420000', + '2561' => 'SF190000', + '2562' => 'SF200000', + '2563' => 'SF230000', + '2564' => 'SF470000', + '2565' => 'SF480000', + '2566' => 'SF410000', + '2567' => 'SF450000', + '2568' => 'SF460000', + '2569' => 'SF400000', + '256A' => 'SF540000', + '256B' => 'SF530000', + '256C' => 'SF440000', + '2580' => 'upblock', + '2584' => 'dnblock', + '2588' => 'block', + '258C' => 'lfblock', + '2590' => 'rtblock', + '2591' => 'ltshade', + '2592' => 'shade', + '2593' => 'dkshade', + '25A0' => 'filledbox', + '25A1' => 'H22073', + '25AA' => 'H18543', + '25AB' => 'H18551', + '25AC' => 'filledrect', + '25B2' => 'triagup', + '25BA' => 'triagrt', + '25BC' => 'triagdn', + '25C4' => 'triaglf', + '25CA' => 'lozenge', + '25CB' => 'circle', + '25CF' => 'H18533', + '25D8' => 'invbullet', + '25D9' => 'invcircle', + '25E6' => 'openbullet', + '263A' => 'smileface', + '263B' => 'invsmileface', + '263C' => 'sun', + '2640' => 'female', + '2642' => 'male', + '2660' => 'spade', + '2663' => 'club', + '2665' => 'heart', + '2666' => 'diamond', + '266A' => 'musicalnote', + '266B' => 'musicalnotedbl', + 'FB00' => 'ff', + 'FB01' => 'fi', + 'FB02' => 'fl', + 'FB03' => 'ffi', + 'FB04' => 'ffl', + 'FB1F' => 'afii57705', + 'FB2A' => 'afii57694', + 'FB2B' => 'afii57695', + 'FB35' => 'afii57723', + 'FB4B' => 'afii57700', +); + +# Adobe Glyph List 2.0 (sans those in glyph list for *new* fonts) -- thus +# these are all historic names that could occur in fonts +# from http://partners.adobe.com/asn/tech/type/glyphlist.txt + +%agl = ( + 'AEmacron' => "\x{01E2}", + 'AEsmall' => "\x{F7E6}", + 'Aacutesmall' => "\x{F7E1}", + 'Abreveacute' => "\x{1EAE}", + 'Abrevecyrillic' => "\x{04D0}", + 'Abrevedotbelow' => "\x{1EB6}", + 'Abrevegrave' => "\x{1EB0}", + 'Abrevehookabove' => "\x{1EB2}", + 'Abrevetilde' => "\x{1EB4}", + 'Acaron' => "\x{01CD}", + 'Acircle' => "\x{24B6}", + 'Acircumflexacute' => "\x{1EA4}", + 'Acircumflexdotbelow' => "\x{1EAC}", + 'Acircumflexgrave' => "\x{1EA6}", + 'Acircumflexhookabove' => "\x{1EA8}", + 'Acircumflexsmall' => "\x{F7E2}", + 'Acircumflextilde' => "\x{1EAA}", + 'Acute' => "\x{F6C9}", + 'Acutesmall' => "\x{F7B4}", + 'Acyrillic' => "\x{0410}", + 'Adblgrave' => "\x{0200}", + 'Adieresiscyrillic' => "\x{04D2}", + 'Adieresismacron' => "\x{01DE}", + 'Adieresissmall' => "\x{F7E4}", + 'Adotbelow' => "\x{1EA0}", + 'Adotmacron' => "\x{01E0}", + 'Agravesmall' => "\x{F7E0}", + 'Ahookabove' => "\x{1EA2}", + 'Aiecyrillic' => "\x{04D4}", + 'Ainvertedbreve' => "\x{0202}", + 'Amonospace' => "\x{FF21}", + 'Aringbelow' => "\x{1E00}", + 'Aringsmall' => "\x{F7E5}", + 'Asmall' => "\x{F761}", + 'Atildesmall' => "\x{F7E3}", + 'Aybarmenian' => "\x{0531}", + 'Bcircle' => "\x{24B7}", + 'Bdotaccent' => "\x{1E02}", + 'Bdotbelow' => "\x{1E04}", + 'Becyrillic' => "\x{0411}", + 'Benarmenian' => "\x{0532}", + 'Bhook' => "\x{0181}", + 'Blinebelow' => "\x{1E06}", + 'Bmonospace' => "\x{FF22}", + 'Brevesmall' => "\x{F6F4}", + 'Bsmall' => "\x{F762}", + 'Btopbar' => "\x{0182}", + 'Caarmenian' => "\x{053E}", + 'Caron' => "\x{F6CA}", + 'Caronsmall' => "\x{F6F5}", + 'Ccedillaacute' => "\x{1E08}", + 'Ccedillasmall' => "\x{F7E7}", + 'Ccircle' => "\x{24B8}", + 'Cdot' => "\x{010A}", + 'Cedillasmall' => "\x{F7B8}", + 'Chaarmenian' => "\x{0549}", + 'Cheabkhasiancyrillic' => "\x{04BC}", + 'Checyrillic' => "\x{0427}", + 'Chedescenderabkhasiancyrillic' => "\x{04BE}", + 'Chedescendercyrillic' => "\x{04B6}", + 'Chedieresiscyrillic' => "\x{04F4}", + 'Cheharmenian' => "\x{0543}", + 'Chekhakassiancyrillic' => "\x{04CB}", + 'Cheverticalstrokecyrillic' => "\x{04B8}", + 'Chook' => "\x{0187}", + 'Circumflexsmall' => "\x{F6F6}", + 'Cmonospace' => "\x{FF23}", + 'Coarmenian' => "\x{0551}", + 'Csmall' => "\x{F763}", + 'DZ' => "\x{01F1}", + 'DZcaron' => "\x{01C4}", + 'Daarmenian' => "\x{0534}", + 'Dafrican' => "\x{0189}", + 'Dcedilla' => "\x{1E10}", + 'Dcircle' => "\x{24B9}", + 'Dcircumflexbelow' => "\x{1E12}", + 'Ddotaccent' => "\x{1E0A}", + 'Ddotbelow' => "\x{1E0C}", + 'Decyrillic' => "\x{0414}", + 'Deicoptic' => "\x{03EE}", + 'Deltagreek' => "\x{0394}", + 'Dhook' => "\x{018A}", + 'Dieresis' => "\x{F6CB}", + 'DieresisAcute' => "\x{F6CC}", + 'DieresisGrave' => "\x{F6CD}", + 'Dieresissmall' => "\x{F7A8}", + 'Digammagreek' => "\x{03DC}", + 'Djecyrillic' => "\x{0402}", + 'Dlinebelow' => "\x{1E0E}", + 'Dmonospace' => "\x{FF24}", + 'Dotaccentsmall' => "\x{F6F7}", + 'Dslash' => "\x{0110}", + 'Dsmall' => "\x{F764}", + 'Dtopbar' => "\x{018B}", + 'Dz' => "\x{01F2}", + 'Dzcaron' => "\x{01C5}", + 'Dzeabkhasiancyrillic' => "\x{04E0}", + 'Dzecyrillic' => "\x{0405}", + 'Dzhecyrillic' => "\x{040F}", + 'Eacutesmall' => "\x{F7E9}", + 'Ecedillabreve' => "\x{1E1C}", + 'Echarmenian' => "\x{0535}", + 'Ecircle' => "\x{24BA}", + 'Ecircumflexacute' => "\x{1EBE}", + 'Ecircumflexbelow' => "\x{1E18}", + 'Ecircumflexdotbelow' => "\x{1EC6}", + 'Ecircumflexgrave' => "\x{1EC0}", + 'Ecircumflexhookabove' => "\x{1EC2}", + 'Ecircumflexsmall' => "\x{F7EA}", + 'Ecircumflextilde' => "\x{1EC4}", + 'Ecyrillic' => "\x{0404}", + 'Edblgrave' => "\x{0204}", + 'Edieresissmall' => "\x{F7EB}", + 'Edot' => "\x{0116}", + 'Edotbelow' => "\x{1EB8}", + 'Efcyrillic' => "\x{0424}", + 'Egravesmall' => "\x{F7E8}", + 'Eharmenian' => "\x{0537}", + 'Ehookabove' => "\x{1EBA}", + 'Eightroman' => "\x{2167}", + 'Einvertedbreve' => "\x{0206}", + 'Eiotifiedcyrillic' => "\x{0464}", + 'Elcyrillic' => "\x{041B}", + 'Elevenroman' => "\x{216A}", + 'Emacronacute' => "\x{1E16}", + 'Emacrongrave' => "\x{1E14}", + 'Emcyrillic' => "\x{041C}", + 'Emonospace' => "\x{FF25}", + 'Encyrillic' => "\x{041D}", + 'Endescendercyrillic' => "\x{04A2}", + 'Enghecyrillic' => "\x{04A4}", + 'Enhookcyrillic' => "\x{04C7}", + 'Eopen' => "\x{0190}", + 'Ercyrillic' => "\x{0420}", + 'Ereversed' => "\x{018E}", + 'Ereversedcyrillic' => "\x{042D}", + 'Escyrillic' => "\x{0421}", + 'Esdescendercyrillic' => "\x{04AA}", + 'Esh' => "\x{01A9}", + 'Esmall' => "\x{F765}", + 'Etarmenian' => "\x{0538}", + 'Ethsmall' => "\x{F7F0}", + 'Etilde' => "\x{1EBC}", + 'Etildebelow' => "\x{1E1A}", + 'Ezh' => "\x{01B7}", + 'Ezhcaron' => "\x{01EE}", + 'Ezhreversed' => "\x{01B8}", + 'Fcircle' => "\x{24BB}", + 'Fdotaccent' => "\x{1E1E}", + 'Feharmenian' => "\x{0556}", + 'Feicoptic' => "\x{03E4}", + 'Fhook' => "\x{0191}", + 'Fitacyrillic' => "\x{0472}", + 'Fiveroman' => "\x{2164}", + 'Fmonospace' => "\x{FF26}", + 'Fourroman' => "\x{2163}", + 'Fsmall' => "\x{F766}", + 'GBsquare' => "\x{3387}", + 'Gacute' => "\x{01F4}", + 'Gammaafrican' => "\x{0194}", + 'Gangiacoptic' => "\x{03EA}", + 'Gcedilla' => "\x{0122}", + 'Gcircle' => "\x{24BC}", + 'Gdot' => "\x{0120}", + 'Gecyrillic' => "\x{0413}", + 'Ghadarmenian' => "\x{0542}", + 'Ghemiddlehookcyrillic' => "\x{0494}", + 'Ghestrokecyrillic' => "\x{0492}", + 'Gheupturncyrillic' => "\x{0490}", + 'Ghook' => "\x{0193}", + 'Gimarmenian' => "\x{0533}", + 'Gjecyrillic' => "\x{0403}", + 'Gmacron' => "\x{1E20}", + 'Gmonospace' => "\x{FF27}", + 'Grave' => "\x{F6CE}", + 'Gravesmall' => "\x{F760}", + 'Gsmall' => "\x{F767}", + 'Gsmallhook' => "\x{029B}", + 'Gstroke' => "\x{01E4}", + 'HPsquare' => "\x{33CB}", + 'Haabkhasiancyrillic' => "\x{04A8}", + 'Hadescendercyrillic' => "\x{04B2}", + 'Hardsigncyrillic' => "\x{042A}", + 'Hbrevebelow' => "\x{1E2A}", + 'Hcedilla' => "\x{1E28}", + 'Hcircle' => "\x{24BD}", + 'Hdieresis' => "\x{1E26}", + 'Hdotaccent' => "\x{1E22}", + 'Hdotbelow' => "\x{1E24}", + 'Hmonospace' => "\x{FF28}", + 'Hoarmenian' => "\x{0540}", + 'Horicoptic' => "\x{03E8}", + 'Hsmall' => "\x{F768}", + 'Hungarumlaut' => "\x{F6CF}", + 'Hungarumlautsmall' => "\x{F6F8}", + 'Hzsquare' => "\x{3390}", + 'IAcyrillic' => "\x{042F}", + 'IUcyrillic' => "\x{042E}", + 'Iacutesmall' => "\x{F7ED}", + 'Icaron' => "\x{01CF}", + 'Icircle' => "\x{24BE}", + 'Icircumflexsmall' => "\x{F7EE}", + 'Icyrillic' => "\x{0406}", + 'Idblgrave' => "\x{0208}", + 'Idieresisacute' => "\x{1E2E}", + 'Idieresiscyrillic' => "\x{04E4}", + 'Idieresissmall' => "\x{F7EF}", + 'Idot' => "\x{0130}", + 'Idotbelow' => "\x{1ECA}", + 'Iebrevecyrillic' => "\x{04D6}", + 'Iecyrillic' => "\x{0415}", + 'Igravesmall' => "\x{F7EC}", + 'Ihookabove' => "\x{1EC8}", + 'Iicyrillic' => "\x{0418}", + 'Iinvertedbreve' => "\x{020A}", + 'Iishortcyrillic' => "\x{0419}", + 'Imacroncyrillic' => "\x{04E2}", + 'Imonospace' => "\x{FF29}", + 'Iniarmenian' => "\x{053B}", + 'Iocyrillic' => "\x{0401}", + 'Iotaafrican' => "\x{0196}", + 'Ismall' => "\x{F769}", + 'Istroke' => "\x{0197}", + 'Itildebelow' => "\x{1E2C}", + 'Izhitsacyrillic' => "\x{0474}", + 'Izhitsadblgravecyrillic' => "\x{0476}", + 'Jaarmenian' => "\x{0541}", + 'Jcircle' => "\x{24BF}", + 'Jecyrillic' => "\x{0408}", + 'Jheharmenian' => "\x{054B}", + 'Jmonospace' => "\x{FF2A}", + 'Jsmall' => "\x{F76A}", + 'KBsquare' => "\x{3385}", + 'KKsquare' => "\x{33CD}", + 'Kabashkircyrillic' => "\x{04A0}", + 'Kacute' => "\x{1E30}", + 'Kacyrillic' => "\x{041A}", + 'Kadescendercyrillic' => "\x{049A}", + 'Kahookcyrillic' => "\x{04C3}", + 'Kastrokecyrillic' => "\x{049E}", + 'Kaverticalstrokecyrillic' => "\x{049C}", + 'Kcaron' => "\x{01E8}", + 'Kcedilla' => "\x{0136}", + 'Kcircle' => "\x{24C0}", + 'Kdotbelow' => "\x{1E32}", + 'Keharmenian' => "\x{0554}", + 'Kenarmenian' => "\x{053F}", + 'Khacyrillic' => "\x{0425}", + 'Kheicoptic' => "\x{03E6}", + 'Khook' => "\x{0198}", + 'Kjecyrillic' => "\x{040C}", + 'Klinebelow' => "\x{1E34}", + 'Kmonospace' => "\x{FF2B}", + 'Koppacyrillic' => "\x{0480}", + 'Koppagreek' => "\x{03DE}", + 'Ksicyrillic' => "\x{046E}", + 'Ksmall' => "\x{F76B}", + 'LJ' => "\x{01C7}", + 'LL' => "\x{F6BF}", + 'Lcedilla' => "\x{013B}", + 'Lcircle' => "\x{24C1}", + 'Lcircumflexbelow' => "\x{1E3C}", + 'Ldotaccent' => "\x{013F}", + 'Ldotbelow' => "\x{1E36}", + 'Ldotbelowmacron' => "\x{1E38}", + 'Liwnarmenian' => "\x{053C}", + 'Lj' => "\x{01C8}", + 'Ljecyrillic' => "\x{0409}", + 'Llinebelow' => "\x{1E3A}", + 'Lmonospace' => "\x{FF2C}", + 'Lslashsmall' => "\x{F6F9}", + 'Lsmall' => "\x{F76C}", + 'MBsquare' => "\x{3386}", + 'Macron' => "\x{F6D0}", + 'Macronsmall' => "\x{F7AF}", + 'Macute' => "\x{1E3E}", + 'Mcircle' => "\x{24C2}", + 'Mdotaccent' => "\x{1E40}", + 'Mdotbelow' => "\x{1E42}", + 'Menarmenian' => "\x{0544}", + 'Mmonospace' => "\x{FF2D}", + 'Msmall' => "\x{F76D}", + 'Mturned' => "\x{019C}", + 'NJ' => "\x{01CA}", + 'Ncedilla' => "\x{0145}", + 'Ncircle' => "\x{24C3}", + 'Ncircumflexbelow' => "\x{1E4A}", + 'Ndotaccent' => "\x{1E44}", + 'Ndotbelow' => "\x{1E46}", + 'Nhookleft' => "\x{019D}", + 'Nineroman' => "\x{2168}", + 'Nj' => "\x{01CB}", + 'Njecyrillic' => "\x{040A}", + 'Nlinebelow' => "\x{1E48}", + 'Nmonospace' => "\x{FF2E}", + 'Nowarmenian' => "\x{0546}", + 'Nsmall' => "\x{F76E}", + 'Ntildesmall' => "\x{F7F1}", + 'OEsmall' => "\x{F6FA}", + 'Oacutesmall' => "\x{F7F3}", + 'Obarredcyrillic' => "\x{04E8}", + 'Obarreddieresiscyrillic' => "\x{04EA}", + 'Ocaron' => "\x{01D1}", + 'Ocenteredtilde' => "\x{019F}", + 'Ocircle' => "\x{24C4}", + 'Ocircumflexacute' => "\x{1ED0}", + 'Ocircumflexdotbelow' => "\x{1ED8}", + 'Ocircumflexgrave' => "\x{1ED2}", + 'Ocircumflexhookabove' => "\x{1ED4}", + 'Ocircumflexsmall' => "\x{F7F4}", + 'Ocircumflextilde' => "\x{1ED6}", + 'Ocyrillic' => "\x{041E}", + 'Odblacute' => "\x{0150}", + 'Odblgrave' => "\x{020C}", + 'Odieresiscyrillic' => "\x{04E6}", + 'Odieresissmall' => "\x{F7F6}", + 'Odotbelow' => "\x{1ECC}", + 'Ogoneksmall' => "\x{F6FB}", + 'Ogravesmall' => "\x{F7F2}", + 'Oharmenian' => "\x{0555}", + 'Ohm' => "\x{2126}", + 'Ohookabove' => "\x{1ECE}", + 'Ohornacute' => "\x{1EDA}", + 'Ohorndotbelow' => "\x{1EE2}", + 'Ohorngrave' => "\x{1EDC}", + 'Ohornhookabove' => "\x{1EDE}", + 'Ohorntilde' => "\x{1EE0}", + 'Oi' => "\x{01A2}", + 'Oinvertedbreve' => "\x{020E}", + 'Omacronacute' => "\x{1E52}", + 'Omacrongrave' => "\x{1E50}", + 'Omegacyrillic' => "\x{0460}", + 'Omegagreek' => "\x{03A9}", + 'Omegaroundcyrillic' => "\x{047A}", + 'Omegatitlocyrillic' => "\x{047C}", + 'Omonospace' => "\x{FF2F}", + 'Oneroman' => "\x{2160}", + 'Oogonek' => "\x{01EA}", + 'Oogonekmacron' => "\x{01EC}", + 'Oopen' => "\x{0186}", + 'Oslashsmall' => "\x{F7F8}", + 'Osmall' => "\x{F76F}", + 'Ostrokeacute' => "\x{01FE}", + 'Otcyrillic' => "\x{047E}", + 'Otildeacute' => "\x{1E4C}", + 'Otildedieresis' => "\x{1E4E}", + 'Otildesmall' => "\x{F7F5}", + 'Pacute' => "\x{1E54}", + 'Pcircle' => "\x{24C5}", + 'Pdotaccent' => "\x{1E56}", + 'Pecyrillic' => "\x{041F}", + 'Peharmenian' => "\x{054A}", + 'Pemiddlehookcyrillic' => "\x{04A6}", + 'Phook' => "\x{01A4}", + 'Piwrarmenian' => "\x{0553}", + 'Pmonospace' => "\x{FF30}", + 'Psicyrillic' => "\x{0470}", + 'Psmall' => "\x{F770}", + 'Qcircle' => "\x{24C6}", + 'Qmonospace' => "\x{FF31}", + 'Qsmall' => "\x{F771}", + 'Raarmenian' => "\x{054C}", + 'Rcedilla' => "\x{0156}", + 'Rcircle' => "\x{24C7}", + 'Rdblgrave' => "\x{0210}", + 'Rdotaccent' => "\x{1E58}", + 'Rdotbelow' => "\x{1E5A}", + 'Rdotbelowmacron' => "\x{1E5C}", + 'Reharmenian' => "\x{0550}", + 'Ringsmall' => "\x{F6FC}", + 'Rinvertedbreve' => "\x{0212}", + 'Rlinebelow' => "\x{1E5E}", + 'Rmonospace' => "\x{FF32}", + 'Rsmall' => "\x{F772}", + 'Rsmallinverted' => "\x{0281}", + 'Rsmallinvertedsuperior' => "\x{02B6}", + 'Sacutedotaccent' => "\x{1E64}", + 'Sampigreek' => "\x{03E0}", + 'Scarondotaccent' => "\x{1E66}", + 'Scaronsmall' => "\x{F6FD}", + 'Schwa' => "\x{018F}", + 'Schwacyrillic' => "\x{04D8}", + 'Schwadieresiscyrillic' => "\x{04DA}", + 'Scircle' => "\x{24C8}", + 'Sdotaccent' => "\x{1E60}", + 'Sdotbelow' => "\x{1E62}", + 'Sdotbelowdotaccent' => "\x{1E68}", + 'Seharmenian' => "\x{054D}", + 'Sevenroman' => "\x{2166}", + 'Shaarmenian' => "\x{0547}", + 'Shacyrillic' => "\x{0428}", + 'Shchacyrillic' => "\x{0429}", + 'Sheicoptic' => "\x{03E2}", + 'Shhacyrillic' => "\x{04BA}", + 'Shimacoptic' => "\x{03EC}", + 'Sixroman' => "\x{2165}", + 'Smonospace' => "\x{FF33}", + 'Softsigncyrillic' => "\x{042C}", + 'Ssmall' => "\x{F773}", + 'Stigmagreek' => "\x{03DA}", + 'Tcedilla' => "\x{0162}", + 'Tcircle' => "\x{24C9}", + 'Tcircumflexbelow' => "\x{1E70}", + 'Tdotaccent' => "\x{1E6A}", + 'Tdotbelow' => "\x{1E6C}", + 'Tecyrillic' => "\x{0422}", + 'Tedescendercyrillic' => "\x{04AC}", + 'Tenroman' => "\x{2169}", + 'Tetsecyrillic' => "\x{04B4}", + 'Thook' => "\x{01AC}", + 'Thornsmall' => "\x{F7FE}", + 'Threeroman' => "\x{2162}", + 'Tildesmall' => "\x{F6FE}", + 'Tiwnarmenian' => "\x{054F}", + 'Tlinebelow' => "\x{1E6E}", + 'Tmonospace' => "\x{FF34}", + 'Toarmenian' => "\x{0539}", + 'Tonefive' => "\x{01BC}", + 'Tonesix' => "\x{0184}", + 'Tonetwo' => "\x{01A7}", + 'Tretroflexhook' => "\x{01AE}", + 'Tsecyrillic' => "\x{0426}", + 'Tshecyrillic' => "\x{040B}", + 'Tsmall' => "\x{F774}", + 'Twelveroman' => "\x{216B}", + 'Tworoman' => "\x{2161}", + 'Uacutesmall' => "\x{F7FA}", + 'Ucaron' => "\x{01D3}", + 'Ucircle' => "\x{24CA}", + 'Ucircumflexbelow' => "\x{1E76}", + 'Ucircumflexsmall' => "\x{F7FB}", + 'Ucyrillic' => "\x{0423}", + 'Udblacute' => "\x{0170}", + 'Udblgrave' => "\x{0214}", + 'Udieresisacute' => "\x{01D7}", + 'Udieresisbelow' => "\x{1E72}", + 'Udieresiscaron' => "\x{01D9}", + 'Udieresiscyrillic' => "\x{04F0}", + 'Udieresisgrave' => "\x{01DB}", + 'Udieresismacron' => "\x{01D5}", + 'Udieresissmall' => "\x{F7FC}", + 'Udotbelow' => "\x{1EE4}", + 'Ugravesmall' => "\x{F7F9}", + 'Uhookabove' => "\x{1EE6}", + 'Uhornacute' => "\x{1EE8}", + 'Uhorndotbelow' => "\x{1EF0}", + 'Uhorngrave' => "\x{1EEA}", + 'Uhornhookabove' => "\x{1EEC}", + 'Uhorntilde' => "\x{1EEE}", + 'Uhungarumlautcyrillic' => "\x{04F2}", + 'Uinvertedbreve' => "\x{0216}", + 'Ukcyrillic' => "\x{0478}", + 'Umacroncyrillic' => "\x{04EE}", + 'Umacrondieresis' => "\x{1E7A}", + 'Umonospace' => "\x{FF35}", + 'Upsilonacutehooksymbolgreek' => "\x{03D3}", + 'Upsilonafrican' => "\x{01B1}", + 'Upsilondieresishooksymbolgreek' => "\x{03D4}", + 'Upsilonhooksymbol' => "\x{03D2}", + 'Ushortcyrillic' => "\x{040E}", + 'Usmall' => "\x{F775}", + 'Ustraightcyrillic' => "\x{04AE}", + 'Ustraightstrokecyrillic' => "\x{04B0}", + 'Utildeacute' => "\x{1E78}", + 'Utildebelow' => "\x{1E74}", + 'Vcircle' => "\x{24CB}", + 'Vdotbelow' => "\x{1E7E}", + 'Vecyrillic' => "\x{0412}", + 'Vewarmenian' => "\x{054E}", + 'Vhook' => "\x{01B2}", + 'Vmonospace' => "\x{FF36}", + 'Voarmenian' => "\x{0548}", + 'Vsmall' => "\x{F776}", + 'Vtilde' => "\x{1E7C}", + 'Wcircle' => "\x{24CC}", + 'Wdotaccent' => "\x{1E86}", + 'Wdotbelow' => "\x{1E88}", + 'Wmonospace' => "\x{FF37}", + 'Wsmall' => "\x{F777}", + 'Xcircle' => "\x{24CD}", + 'Xdieresis' => "\x{1E8C}", + 'Xdotaccent' => "\x{1E8A}", + 'Xeharmenian' => "\x{053D}", + 'Xmonospace' => "\x{FF38}", + 'Xsmall' => "\x{F778}", + 'Yacutesmall' => "\x{F7FD}", + 'Yatcyrillic' => "\x{0462}", + 'Ycircle' => "\x{24CE}", + 'Ydieresissmall' => "\x{F7FF}", + 'Ydotaccent' => "\x{1E8E}", + 'Ydotbelow' => "\x{1EF4}", + 'Yericyrillic' => "\x{042B}", + 'Yerudieresiscyrillic' => "\x{04F8}", + 'Yhook' => "\x{01B3}", + 'Yhookabove' => "\x{1EF6}", + 'Yiarmenian' => "\x{0545}", + 'Yicyrillic' => "\x{0407}", + 'Yiwnarmenian' => "\x{0552}", + 'Ymonospace' => "\x{FF39}", + 'Ysmall' => "\x{F779}", + 'Ytilde' => "\x{1EF8}", + 'Yusbigcyrillic' => "\x{046A}", + 'Yusbigiotifiedcyrillic' => "\x{046C}", + 'Yuslittlecyrillic' => "\x{0466}", + 'Yuslittleiotifiedcyrillic' => "\x{0468}", + 'Zaarmenian' => "\x{0536}", + 'Zcaronsmall' => "\x{F6FF}", + 'Zcircle' => "\x{24CF}", + 'Zcircumflex' => "\x{1E90}", + 'Zdot' => "\x{017B}", + 'Zdotbelow' => "\x{1E92}", + 'Zecyrillic' => "\x{0417}", + 'Zedescendercyrillic' => "\x{0498}", + 'Zedieresiscyrillic' => "\x{04DE}", + 'Zhearmenian' => "\x{053A}", + 'Zhebrevecyrillic' => "\x{04C1}", + 'Zhecyrillic' => "\x{0416}", + 'Zhedescendercyrillic' => "\x{0496}", + 'Zhedieresiscyrillic' => "\x{04DC}", + 'Zlinebelow' => "\x{1E94}", + 'Zmonospace' => "\x{FF3A}", + 'Zsmall' => "\x{F77A}", + 'Zstroke' => "\x{01B5}", + 'aabengali' => "\x{0986}", + 'aadeva' => "\x{0906}", + 'aagujarati' => "\x{0A86}", + 'aagurmukhi' => "\x{0A06}", + 'aamatragurmukhi' => "\x{0A3E}", + 'aarusquare' => "\x{3303}", + 'aavowelsignbengali' => "\x{09BE}", + 'aavowelsigndeva' => "\x{093E}", + 'aavowelsigngujarati' => "\x{0ABE}", + 'abbreviationmarkarmenian' => "\x{055F}", + 'abbreviationsigndeva' => "\x{0970}", + 'abengali' => "\x{0985}", + 'abopomofo' => "\x{311A}", + 'abreveacute' => "\x{1EAF}", + 'abrevecyrillic' => "\x{04D1}", + 'abrevedotbelow' => "\x{1EB7}", + 'abrevegrave' => "\x{1EB1}", + 'abrevehookabove' => "\x{1EB3}", + 'abrevetilde' => "\x{1EB5}", + 'acaron' => "\x{01CE}", + 'acircle' => "\x{24D0}", + 'acircumflexacute' => "\x{1EA5}", + 'acircumflexdotbelow' => "\x{1EAD}", + 'acircumflexgrave' => "\x{1EA7}", + 'acircumflexhookabove' => "\x{1EA9}", + 'acircumflextilde' => "\x{1EAB}", + 'acutebelowcmb' => "\x{0317}", + 'acutecmb' => "\x{0301}", + 'acutedeva' => "\x{0954}", + 'acutelowmod' => "\x{02CF}", + 'acutetonecmb' => "\x{0341}", + 'acyrillic' => "\x{0430}", + 'adblgrave' => "\x{0201}", + 'addakgurmukhi' => "\x{0A71}", + 'adeva' => "\x{0905}", + 'adieresiscyrillic' => "\x{04D3}", + 'adieresismacron' => "\x{01DF}", + 'adotbelow' => "\x{1EA1}", + 'adotmacron' => "\x{01E1}", + 'aekorean' => "\x{3150}", + 'aemacron' => "\x{01E3}", + 'afii08941' => "\x{20A4}", + 'afii10063' => "\x{F6C4}", + 'afii10064' => "\x{F6C5}", + 'afii10192' => "\x{F6C6}", + 'afii10831' => "\x{F6C7}", + 'afii10832' => "\x{F6C8}", + 'agujarati' => "\x{0A85}", + 'agurmukhi' => "\x{0A05}", + 'ahiragana' => "\x{3042}", + 'ahookabove' => "\x{1EA3}", + 'aibengali' => "\x{0990}", + 'aibopomofo' => "\x{311E}", + 'aideva' => "\x{0910}", + 'aiecyrillic' => "\x{04D5}", + 'aigujarati' => "\x{0A90}", + 'aigurmukhi' => "\x{0A10}", + 'aimatragurmukhi' => "\x{0A48}", + 'ainarabic' => "\x{0639}", + 'ainfinalarabic' => "\x{FECA}", + 'aininitialarabic' => "\x{FECB}", + 'ainmedialarabic' => "\x{FECC}", + 'ainvertedbreve' => "\x{0203}", + 'aivowelsignbengali' => "\x{09C8}", + 'aivowelsigndeva' => "\x{0948}", + 'aivowelsigngujarati' => "\x{0AC8}", + 'akatakana' => "\x{30A2}", + 'akatakanahalfwidth' => "\x{FF71}", + 'akorean' => "\x{314F}", + 'alef' => "\x{05D0}", + 'alefarabic' => "\x{0627}", + 'alefdageshhebrew' => "\x{FB30}", + 'aleffinalarabic' => "\x{FE8E}", + 'alefhamzaabovearabic' => "\x{0623}", + 'alefhamzaabovefinalarabic' => "\x{FE84}", + 'alefhamzabelowarabic' => "\x{0625}", + 'alefhamzabelowfinalarabic' => "\x{FE88}", + 'alefhebrew' => "\x{05D0}", + 'aleflamedhebrew' => "\x{FB4F}", + 'alefmaddaabovearabic' => "\x{0622}", + 'alefmaddaabovefinalarabic' => "\x{FE82}", + 'alefmaksuraarabic' => "\x{0649}", + 'alefmaksurafinalarabic' => "\x{FEF0}", + 'alefmaksurainitialarabic' => "\x{FEF3}", + 'alefmaksuramedialarabic' => "\x{FEF4}", + 'alefpatahhebrew' => "\x{FB2E}", + 'alefqamatshebrew' => "\x{FB2F}", + 'allequal' => "\x{224C}", + 'amonospace' => "\x{FF41}", + 'ampersandmonospace' => "\x{FF06}", + 'ampersandsmall' => "\x{F726}", + 'amsquare' => "\x{33C2}", + 'anbopomofo' => "\x{3122}", + 'angbopomofo' => "\x{3124}", + 'angkhankhuthai' => "\x{0E5A}", + 'anglebracketleft' => "\x{3008}", + 'anglebracketleftvertical' => "\x{FE3F}", + 'anglebracketright' => "\x{3009}", + 'anglebracketrightvertical' => "\x{FE40}", + 'angstrom' => "\x{212B}", + 'anudattadeva' => "\x{0952}", + 'anusvarabengali' => "\x{0982}", + 'anusvaradeva' => "\x{0902}", + 'anusvaragujarati' => "\x{0A82}", + 'apaatosquare' => "\x{3300}", + 'aparen' => "\x{249C}", + 'apostrophearmenian' => "\x{055A}", + 'apostrophemod' => "\x{02BC}", + 'apple' => "\x{F8FF}", + 'approaches' => "\x{2250}", + 'approxequalorimage' => "\x{2252}", + 'approximatelyequal' => "\x{2245}", + 'araeaekorean' => "\x{318E}", + 'araeakorean' => "\x{318D}", + 'arc' => "\x{2312}", + 'arighthalfring' => "\x{1E9A}", + 'aringbelow' => "\x{1E01}", + 'arrowdashdown' => "\x{21E3}", + 'arrowdashleft' => "\x{21E0}", + 'arrowdashright' => "\x{21E2}", + 'arrowdashup' => "\x{21E1}", + 'arrowdownleft' => "\x{2199}", + 'arrowdownright' => "\x{2198}", + 'arrowdownwhite' => "\x{21E9}", + 'arrowheaddownmod' => "\x{02C5}", + 'arrowheadleftmod' => "\x{02C2}", + 'arrowheadrightmod' => "\x{02C3}", + 'arrowheadupmod' => "\x{02C4}", + 'arrowhorizex' => "\x{F8E7}", + 'arrowleftdbl' => "\x{21D0}", + 'arrowleftdblstroke' => "\x{21CD}", + 'arrowleftoverright' => "\x{21C6}", + 'arrowleftwhite' => "\x{21E6}", + 'arrowrightdblstroke' => "\x{21CF}", + 'arrowrightheavy' => "\x{279E}", + 'arrowrightoverleft' => "\x{21C4}", + 'arrowrightwhite' => "\x{21E8}", + 'arrowtableft' => "\x{21E4}", + 'arrowtabright' => "\x{21E5}", + 'arrowupdownbase' => "\x{21A8}", + 'arrowupleft' => "\x{2196}", + 'arrowupleftofdown' => "\x{21C5}", + 'arrowupright' => "\x{2197}", + 'arrowupwhite' => "\x{21E7}", + 'arrowvertex' => "\x{F8E6}", + 'asciicircummonospace' => "\x{FF3E}", + 'asciitildemonospace' => "\x{FF5E}", + 'ascript' => "\x{0251}", + 'ascriptturned' => "\x{0252}", + 'asmallhiragana' => "\x{3041}", + 'asmallkatakana' => "\x{30A1}", + 'asmallkatakanahalfwidth' => "\x{FF67}", + 'asteriskaltonearabic' => "\x{066D}", + 'asteriskarabic' => "\x{066D}", + 'asteriskmonospace' => "\x{FF0A}", + 'asterisksmall' => "\x{FE61}", + 'asterism' => "\x{2042}", + 'asuperior' => "\x{F6E9}", + 'asymptoticallyequal' => "\x{2243}", + 'atmonospace' => "\x{FF20}", + 'atsmall' => "\x{FE6B}", + 'aturned' => "\x{0250}", + 'aubengali' => "\x{0994}", + 'aubopomofo' => "\x{3120}", + 'audeva' => "\x{0914}", + 'augujarati' => "\x{0A94}", + 'augurmukhi' => "\x{0A14}", + 'aulengthmarkbengali' => "\x{09D7}", + 'aumatragurmukhi' => "\x{0A4C}", + 'auvowelsignbengali' => "\x{09CC}", + 'auvowelsigndeva' => "\x{094C}", + 'auvowelsigngujarati' => "\x{0ACC}", + 'avagrahadeva' => "\x{093D}", + 'aybarmenian' => "\x{0561}", + 'ayin' => "\x{05E2}", + 'ayinaltonehebrew' => "\x{FB20}", + 'ayinhebrew' => "\x{05E2}", + 'babengali' => "\x{09AC}", + 'backslashmonospace' => "\x{FF3C}", + 'badeva' => "\x{092C}", + 'bagujarati' => "\x{0AAC}", + 'bagurmukhi' => "\x{0A2C}", + 'bahiragana' => "\x{3070}", + 'bahtthai' => "\x{0E3F}", + 'bakatakana' => "\x{30D0}", + 'barmonospace' => "\x{FF5C}", + 'bbopomofo' => "\x{3105}", + 'bcircle' => "\x{24D1}", + 'bdotaccent' => "\x{1E03}", + 'bdotbelow' => "\x{1E05}", + 'beamedsixteenthnotes' => "\x{266C}", + 'because' => "\x{2235}", + 'becyrillic' => "\x{0431}", + 'beharabic' => "\x{0628}", + 'behfinalarabic' => "\x{FE90}", + 'behinitialarabic' => "\x{FE91}", + 'behiragana' => "\x{3079}", + 'behmedialarabic' => "\x{FE92}", + 'behmeeminitialarabic' => "\x{FC9F}", + 'behmeemisolatedarabic' => "\x{FC08}", + 'behnoonfinalarabic' => "\x{FC6D}", + 'bekatakana' => "\x{30D9}", + 'benarmenian' => "\x{0562}", + 'bet' => "\x{05D1}", + 'betasymbolgreek' => "\x{03D0}", + 'betdagesh' => "\x{FB31}", + 'betdageshhebrew' => "\x{FB31}", + 'bethebrew' => "\x{05D1}", + 'betrafehebrew' => "\x{FB4C}", + 'bhabengali' => "\x{09AD}", + 'bhadeva' => "\x{092D}", + 'bhagujarati' => "\x{0AAD}", + 'bhagurmukhi' => "\x{0A2D}", + 'bhook' => "\x{0253}", + 'bihiragana' => "\x{3073}", + 'bikatakana' => "\x{30D3}", + 'bilabialclick' => "\x{0298}", + 'bindigurmukhi' => "\x{0A02}", + 'birusquare' => "\x{3331}", + 'blackcircle' => "\x{25CF}", + 'blackdiamond' => "\x{25C6}", + 'blackdownpointingtriangle' => "\x{25BC}", + 'blackleftpointingpointer' => "\x{25C4}", + 'blackleftpointingtriangle' => "\x{25C0}", + 'blacklenticularbracketleft' => "\x{3010}", + 'blacklenticularbracketleftvertical' => "\x{FE3B}", + 'blacklenticularbracketright' => "\x{3011}", + 'blacklenticularbracketrightvertical' => "\x{FE3C}", + 'blacklowerlefttriangle' => "\x{25E3}", + 'blacklowerrighttriangle' => "\x{25E2}", + 'blackrectangle' => "\x{25AC}", + 'blackrightpointingpointer' => "\x{25BA}", + 'blackrightpointingtriangle' => "\x{25B6}", + 'blacksmallsquare' => "\x{25AA}", + 'blacksmilingface' => "\x{263B}", + 'blacksquare' => "\x{25A0}", + 'blackstar' => "\x{2605}", + 'blackupperlefttriangle' => "\x{25E4}", + 'blackupperrighttriangle' => "\x{25E5}", + 'blackuppointingsmalltriangle' => "\x{25B4}", + 'blackuppointingtriangle' => "\x{25B2}", + 'blank' => "\x{2423}", + 'blinebelow' => "\x{1E07}", + 'bmonospace' => "\x{FF42}", + 'bobaimaithai' => "\x{0E1A}", + 'bohiragana' => "\x{307C}", + 'bokatakana' => "\x{30DC}", + 'bparen' => "\x{249D}", + 'bqsquare' => "\x{33C3}", + 'braceex' => "\x{F8F4}", + 'braceleftbt' => "\x{F8F3}", + 'braceleftmid' => "\x{F8F2}", + 'braceleftmonospace' => "\x{FF5B}", + 'braceleftsmall' => "\x{FE5B}", + 'bracelefttp' => "\x{F8F1}", + 'braceleftvertical' => "\x{FE37}", + 'bracerightbt' => "\x{F8FE}", + 'bracerightmid' => "\x{F8FD}", + 'bracerightmonospace' => "\x{FF5D}", + 'bracerightsmall' => "\x{FE5C}", + 'bracerighttp' => "\x{F8FC}", + 'bracerightvertical' => "\x{FE38}", + 'bracketleftbt' => "\x{F8F0}", + 'bracketleftex' => "\x{F8EF}", + 'bracketleftmonospace' => "\x{FF3B}", + 'bracketlefttp' => "\x{F8EE}", + 'bracketrightbt' => "\x{F8FB}", + 'bracketrightex' => "\x{F8FA}", + 'bracketrightmonospace' => "\x{FF3D}", + 'bracketrighttp' => "\x{F8F9}", + 'brevebelowcmb' => "\x{032E}", + 'brevecmb' => "\x{0306}", + 'breveinvertedbelowcmb' => "\x{032F}", + 'breveinvertedcmb' => "\x{0311}", + 'breveinverteddoublecmb' => "\x{0361}", + 'bridgebelowcmb' => "\x{032A}", + 'bridgeinvertedbelowcmb' => "\x{033A}", + 'bstroke' => "\x{0180}", + 'bsuperior' => "\x{F6EA}", + 'btopbar' => "\x{0183}", + 'buhiragana' => "\x{3076}", + 'bukatakana' => "\x{30D6}", + 'bulletinverse' => "\x{25D8}", + 'bulletoperator' => "\x{2219}", + 'bullseye' => "\x{25CE}", + 'caarmenian' => "\x{056E}", + 'cabengali' => "\x{099A}", + 'cadeva' => "\x{091A}", + 'cagujarati' => "\x{0A9A}", + 'cagurmukhi' => "\x{0A1A}", + 'calsquare' => "\x{3388}", + 'candrabindubengali' => "\x{0981}", + 'candrabinducmb' => "\x{0310}", + 'candrabindudeva' => "\x{0901}", + 'candrabindugujarati' => "\x{0A81}", + 'capslock' => "\x{21EA}", + 'careof' => "\x{2105}", + 'caronbelowcmb' => "\x{032C}", + 'caroncmb' => "\x{030C}", + 'cbopomofo' => "\x{3118}", + 'ccedillaacute' => "\x{1E09}", + 'ccircle' => "\x{24D2}", + 'ccurl' => "\x{0255}", + 'cdot' => "\x{010B}", + 'cdsquare' => "\x{33C5}", + 'cedillacmb' => "\x{0327}", + 'centigrade' => "\x{2103}", + 'centinferior' => "\x{F6DF}", + 'centmonospace' => "\x{FFE0}", + 'centoldstyle' => "\x{F7A2}", + 'centsuperior' => "\x{F6E0}", + 'chaarmenian' => "\x{0579}", + 'chabengali' => "\x{099B}", + 'chadeva' => "\x{091B}", + 'chagujarati' => "\x{0A9B}", + 'chagurmukhi' => "\x{0A1B}", + 'chbopomofo' => "\x{3114}", + 'cheabkhasiancyrillic' => "\x{04BD}", + 'checkmark' => "\x{2713}", + 'checyrillic' => "\x{0447}", + 'chedescenderabkhasiancyrillic' => "\x{04BF}", + 'chedescendercyrillic' => "\x{04B7}", + 'chedieresiscyrillic' => "\x{04F5}", + 'cheharmenian' => "\x{0573}", + 'chekhakassiancyrillic' => "\x{04CC}", + 'cheverticalstrokecyrillic' => "\x{04B9}", + 'chieuchacirclekorean' => "\x{3277}", + 'chieuchaparenkorean' => "\x{3217}", + 'chieuchcirclekorean' => "\x{3269}", + 'chieuchkorean' => "\x{314A}", + 'chieuchparenkorean' => "\x{3209}", + 'chochangthai' => "\x{0E0A}", + 'chochanthai' => "\x{0E08}", + 'chochingthai' => "\x{0E09}", + 'chochoethai' => "\x{0E0C}", + 'chook' => "\x{0188}", + 'cieucacirclekorean' => "\x{3276}", + 'cieucaparenkorean' => "\x{3216}", + 'cieuccirclekorean' => "\x{3268}", + 'cieuckorean' => "\x{3148}", + 'cieucparenkorean' => "\x{3208}", + 'cieucuparenkorean' => "\x{321C}", + 'circleot' => "\x{2299}", # Actual Adobe glyph list entry -- identified as typo, May 2008 + 'circledot' => "\x{2299}", # What it should have been + 'circlepostalmark' => "\x{3036}", + 'circlewithlefthalfblack' => "\x{25D0}", + 'circlewithrighthalfblack' => "\x{25D1}", + 'circumflexbelowcmb' => "\x{032D}", + 'circumflexcmb' => "\x{0302}", + 'clear' => "\x{2327}", + 'clickalveolar' => "\x{01C2}", + 'clickdental' => "\x{01C0}", + 'clicklateral' => "\x{01C1}", + 'clickretroflex' => "\x{01C3}", + 'clubsuitblack' => "\x{2663}", + 'clubsuitwhite' => "\x{2667}", + 'cmcubedsquare' => "\x{33A4}", + 'cmonospace' => "\x{FF43}", + 'cmsquaredsquare' => "\x{33A0}", + 'coarmenian' => "\x{0581}", + 'colonmonospace' => "\x{FF1A}", + 'colonsign' => "\x{20A1}", + 'colonsmall' => "\x{FE55}", + 'colontriangularhalfmod' => "\x{02D1}", + 'colontriangularmod' => "\x{02D0}", + 'commaabovecmb' => "\x{0313}", + 'commaaboverightcmb' => "\x{0315}", + 'commaaccent' => "\x{F6C3}", + 'commaarabic' => "\x{060C}", + 'commaarmenian' => "\x{055D}", + 'commainferior' => "\x{F6E1}", + 'commamonospace' => "\x{FF0C}", + 'commareversedabovecmb' => "\x{0314}", + 'commareversedmod' => "\x{02BD}", + 'commasmall' => "\x{FE50}", + 'commasuperior' => "\x{F6E2}", + 'commaturnedabovecmb' => "\x{0312}", + 'commaturnedmod' => "\x{02BB}", + 'compass' => "\x{263C}", + 'contourintegral' => "\x{222E}", + 'control' => "\x{2303}", + 'controlACK' => "\x{0006}", + 'controlBEL' => "\x{0007}", + 'controlBS' => "\x{0008}", + 'controlCAN' => "\x{0018}", + 'controlCR' => "\x{000D}", + 'controlDC1' => "\x{0011}", + 'controlDC2' => "\x{0012}", + 'controlDC3' => "\x{0013}", + 'controlDC4' => "\x{0014}", + 'controlDEL' => "\x{007F}", + 'controlDLE' => "\x{0010}", + 'controlEM' => "\x{0019}", + 'controlENQ' => "\x{0005}", + 'controlEOT' => "\x{0004}", + 'controlESC' => "\x{001B}", + 'controlETB' => "\x{0017}", + 'controlETX' => "\x{0003}", + 'controlFF' => "\x{000C}", + 'controlFS' => "\x{001C}", + 'controlGS' => "\x{001D}", + 'controlHT' => "\x{0009}", + 'controlLF' => "\x{000A}", + 'controlNAK' => "\x{0015}", + 'controlRS' => "\x{001E}", + 'controlSI' => "\x{000F}", + 'controlSO' => "\x{000E}", + 'controlSOT' => "\x{0002}", + 'controlSTX' => "\x{0001}", + 'controlSUB' => "\x{001A}", + 'controlSYN' => "\x{0016}", + 'controlUS' => "\x{001F}", + 'controlVT' => "\x{000B}", + 'copyrightsans' => "\x{F8E9}", + 'copyrightserif' => "\x{F6D9}", + 'cornerbracketleft' => "\x{300C}", + 'cornerbracketlefthalfwidth' => "\x{FF62}", + 'cornerbracketleftvertical' => "\x{FE41}", + 'cornerbracketright' => "\x{300D}", + 'cornerbracketrighthalfwidth' => "\x{FF63}", + 'cornerbracketrightvertical' => "\x{FE42}", + 'corporationsquare' => "\x{337F}", + 'cosquare' => "\x{33C7}", + 'coverkgsquare' => "\x{33C6}", + 'cparen' => "\x{249E}", + 'cruzeiro' => "\x{20A2}", + 'cstretched' => "\x{0297}", + 'curlyand' => "\x{22CF}", + 'curlyor' => "\x{22CE}", + 'cyrBreve' => "\x{F6D1}", + 'cyrFlex' => "\x{F6D2}", + 'cyrbreve' => "\x{F6D4}", + 'cyrflex' => "\x{F6D5}", + 'daarmenian' => "\x{0564}", + 'dabengali' => "\x{09A6}", + 'dadarabic' => "\x{0636}", + 'dadeva' => "\x{0926}", + 'dadfinalarabic' => "\x{FEBE}", + 'dadinitialarabic' => "\x{FEBF}", + 'dadmedialarabic' => "\x{FEC0}", + 'dagesh' => "\x{05BC}", + 'dageshhebrew' => "\x{05BC}", + 'dagujarati' => "\x{0AA6}", + 'dagurmukhi' => "\x{0A26}", + 'dahiragana' => "\x{3060}", + 'dakatakana' => "\x{30C0}", + 'dalarabic' => "\x{062F}", + 'dalet' => "\x{05D3}", + 'daletdagesh' => "\x{FB33}", + 'daletdageshhebrew' => "\x{FB33}", + 'dalethatafpatah' => "\x{05D3}\x{05B2}", + 'dalethatafpatahhebrew' => "\x{05D3}\x{05B2}", + 'dalethatafsegol' => "\x{05D3}\x{05B1}", + 'dalethatafsegolhebrew' => "\x{05D3}\x{05B1}", + 'dalethebrew' => "\x{05D3}", + 'dalethiriq' => "\x{05D3}\x{05B4}", + 'dalethiriqhebrew' => "\x{05D3}\x{05B4}", + 'daletholam' => "\x{05D3}\x{05B9}", + 'daletholamhebrew' => "\x{05D3}\x{05B9}", + 'daletpatah' => "\x{05D3}\x{05B7}", + 'daletpatahhebrew' => "\x{05D3}\x{05B7}", + 'daletqamats' => "\x{05D3}\x{05B8}", + 'daletqamatshebrew' => "\x{05D3}\x{05B8}", + 'daletqubuts' => "\x{05D3}\x{05BB}", + 'daletqubutshebrew' => "\x{05D3}\x{05BB}", + 'daletsegol' => "\x{05D3}\x{05B6}", + 'daletsegolhebrew' => "\x{05D3}\x{05B6}", + 'daletsheva' => "\x{05D3}\x{05B0}", + 'daletshevahebrew' => "\x{05D3}\x{05B0}", + 'dalettsere' => "\x{05D3}\x{05B5}", + 'dalettserehebrew' => "\x{05D3}\x{05B5}", + 'dalfinalarabic' => "\x{FEAA}", + 'dammaarabic' => "\x{064F}", + 'dammalowarabic' => "\x{064F}", + 'dammatanaltonearabic' => "\x{064C}", + 'dammatanarabic' => "\x{064C}", + 'danda' => "\x{0964}", + 'dargahebrew' => "\x{05A7}", + 'dargalefthebrew' => "\x{05A7}", + 'dasiapneumatacyrilliccmb' => "\x{0485}", + 'dblGrave' => "\x{F6D3}", + 'dblanglebracketleft' => "\x{300A}", + 'dblanglebracketleftvertical' => "\x{FE3D}", + 'dblanglebracketright' => "\x{300B}", + 'dblanglebracketrightvertical' => "\x{FE3E}", + 'dblarchinvertedbelowcmb' => "\x{032B}", + 'dblarrowleft' => "\x{21D4}", + 'dblarrowright' => "\x{21D2}", + 'dbldanda' => "\x{0965}", + 'dblgrave' => "\x{F6D6}", + 'dblgravecmb' => "\x{030F}", + 'dblintegral' => "\x{222C}", + 'dbllowline' => "\x{2017}", + 'dbllowlinecmb' => "\x{0333}", + 'dbloverlinecmb' => "\x{033F}", + 'dblprimemod' => "\x{02BA}", + 'dblverticalbar' => "\x{2016}", + 'dblverticallineabovecmb' => "\x{030E}", + 'dbopomofo' => "\x{3109}", + 'dbsquare' => "\x{33C8}", + 'dcedilla' => "\x{1E11}", + 'dcircle' => "\x{24D3}", + 'dcircumflexbelow' => "\x{1E13}", + 'ddabengali' => "\x{09A1}", + 'ddadeva' => "\x{0921}", + 'ddagujarati' => "\x{0AA1}", + 'ddagurmukhi' => "\x{0A21}", + 'ddalarabic' => "\x{0688}", + 'ddalfinalarabic' => "\x{FB89}", + 'dddhadeva' => "\x{095C}", + 'ddhabengali' => "\x{09A2}", + 'ddhadeva' => "\x{0922}", + 'ddhagujarati' => "\x{0AA2}", + 'ddhagurmukhi' => "\x{0A22}", + 'ddotaccent' => "\x{1E0B}", + 'ddotbelow' => "\x{1E0D}", + 'decimalseparatorarabic' => "\x{066B}", + 'decimalseparatorpersian' => "\x{066B}", + 'decyrillic' => "\x{0434}", + 'dehihebrew' => "\x{05AD}", + 'dehiragana' => "\x{3067}", + 'deicoptic' => "\x{03EF}", + 'dekatakana' => "\x{30C7}", + 'deleteleft' => "\x{232B}", + 'deleteright' => "\x{2326}", + 'deltaturned' => "\x{018D}", + 'denominatorminusonenumeratorbengali' => "\x{09F8}", + 'dezh' => "\x{02A4}", + 'dhabengali' => "\x{09A7}", + 'dhadeva' => "\x{0927}", + 'dhagujarati' => "\x{0AA7}", + 'dhagurmukhi' => "\x{0A27}", + 'dhook' => "\x{0257}", + 'dialytikatonos' => "\x{0385}", + 'dialytikatonoscmb' => "\x{0344}", + 'diamondsuitwhite' => "\x{2662}", + 'dieresisacute' => "\x{F6D7}", + 'dieresisbelowcmb' => "\x{0324}", + 'dieresiscmb' => "\x{0308}", + 'dieresisgrave' => "\x{F6D8}", + 'dihiragana' => "\x{3062}", + 'dikatakana' => "\x{30C2}", + 'dittomark' => "\x{3003}", + 'divides' => "\x{2223}", + 'divisionslash' => "\x{2215}", + 'djecyrillic' => "\x{0452}", + 'dlinebelow' => "\x{1E0F}", + 'dlsquare' => "\x{3397}", + 'dmacron' => "\x{0111}", + 'dmonospace' => "\x{FF44}", + 'dochadathai' => "\x{0E0E}", + 'dodekthai' => "\x{0E14}", + 'dohiragana' => "\x{3069}", + 'dokatakana' => "\x{30C9}", + 'dollarinferior' => "\x{F6E3}", + 'dollarmonospace' => "\x{FF04}", + 'dollaroldstyle' => "\x{F724}", + 'dollarsmall' => "\x{FE69}", + 'dollarsuperior' => "\x{F6E4}", + 'dorusquare' => "\x{3326}", + 'dotaccentcmb' => "\x{0307}", + 'dotbelowcmb' => "\x{0323}", + 'dotkatakana' => "\x{30FB}", + 'dotlessj' => "\x{F6BE}", + 'dotlessjstrokehook' => "\x{0284}", + 'dottedcircle' => "\x{25CC}", + 'doubleyodpatah' => "\x{FB1F}", + 'doubleyodpatahhebrew' => "\x{FB1F}", + 'downtackbelowcmb' => "\x{031E}", + 'downtackmod' => "\x{02D5}", + 'dparen' => "\x{249F}", + 'dsuperior' => "\x{F6EB}", + 'dtail' => "\x{0256}", + 'dtopbar' => "\x{018C}", + 'duhiragana' => "\x{3065}", + 'dukatakana' => "\x{30C5}", + 'dz' => "\x{01F3}", + 'dzaltone' => "\x{02A3}", + 'dzcaron' => "\x{01C6}", + 'dzcurl' => "\x{02A5}", + 'dzeabkhasiancyrillic' => "\x{04E1}", + 'dzecyrillic' => "\x{0455}", + 'dzhecyrillic' => "\x{045F}", + 'earth' => "\x{2641}", + 'ebengali' => "\x{098F}", + 'ebopomofo' => "\x{311C}", + 'ecandradeva' => "\x{090D}", + 'ecandragujarati' => "\x{0A8D}", + 'ecandravowelsigndeva' => "\x{0945}", + 'ecandravowelsigngujarati' => "\x{0AC5}", + 'ecedillabreve' => "\x{1E1D}", + 'echarmenian' => "\x{0565}", + 'echyiwnarmenian' => "\x{0587}", + 'ecircle' => "\x{24D4}", + 'ecircumflexacute' => "\x{1EBF}", + 'ecircumflexbelow' => "\x{1E19}", + 'ecircumflexdotbelow' => "\x{1EC7}", + 'ecircumflexgrave' => "\x{1EC1}", + 'ecircumflexhookabove' => "\x{1EC3}", + 'ecircumflextilde' => "\x{1EC5}", + 'ecyrillic' => "\x{0454}", + 'edblgrave' => "\x{0205}", + 'edeva' => "\x{090F}", + 'edot' => "\x{0117}", + 'edotbelow' => "\x{1EB9}", + 'eegurmukhi' => "\x{0A0F}", + 'eematragurmukhi' => "\x{0A47}", + 'efcyrillic' => "\x{0444}", + 'egujarati' => "\x{0A8F}", + 'eharmenian' => "\x{0567}", + 'ehbopomofo' => "\x{311D}", + 'ehiragana' => "\x{3048}", + 'ehookabove' => "\x{1EBB}", + 'eibopomofo' => "\x{311F}", + 'eightarabic' => "\x{0668}", + 'eightbengali' => "\x{09EE}", + 'eightcircle' => "\x{2467}", + 'eightcircleinversesansserif' => "\x{2791}", + 'eightdeva' => "\x{096E}", + 'eighteencircle' => "\x{2471}", + 'eighteenparen' => "\x{2485}", + 'eighteenperiod' => "\x{2499}", + 'eightgujarati' => "\x{0AEE}", + 'eightgurmukhi' => "\x{0A6E}", + 'eighthackarabic' => "\x{0668}", + 'eighthangzhou' => "\x{3028}", + 'eighthnotebeamed' => "\x{266B}", + 'eightideographicparen' => "\x{3227}", + 'eightinferior' => "\x{2088}", + 'eightmonospace' => "\x{FF18}", + 'eightoldstyle' => "\x{F738}", + 'eightparen' => "\x{247B}", + 'eightperiod' => "\x{248F}", + 'eightpersian' => "\x{06F8}", + 'eightroman' => "\x{2177}", + 'eightsuperior' => "\x{2078}", + 'eightthai' => "\x{0E58}", + 'einvertedbreve' => "\x{0207}", + 'eiotifiedcyrillic' => "\x{0465}", + 'ekatakana' => "\x{30A8}", + 'ekatakanahalfwidth' => "\x{FF74}", + 'ekonkargurmukhi' => "\x{0A74}", + 'ekorean' => "\x{3154}", + 'elcyrillic' => "\x{043B}", + 'elevencircle' => "\x{246A}", + 'elevenparen' => "\x{247E}", + 'elevenperiod' => "\x{2492}", + 'elevenroman' => "\x{217A}", + 'ellipsisvertical' => "\x{22EE}", + 'emacronacute' => "\x{1E17}", + 'emacrongrave' => "\x{1E15}", + 'emcyrillic' => "\x{043C}", + 'emdashvertical' => "\x{FE31}", + 'emonospace' => "\x{FF45}", + 'emphasismarkarmenian' => "\x{055B}", + 'enbopomofo' => "\x{3123}", + 'encyrillic' => "\x{043D}", + 'endashvertical' => "\x{FE32}", + 'endescendercyrillic' => "\x{04A3}", + 'engbopomofo' => "\x{3125}", + 'enghecyrillic' => "\x{04A5}", + 'enhookcyrillic' => "\x{04C8}", + 'enspace' => "\x{2002}", + 'eokorean' => "\x{3153}", + 'eopen' => "\x{025B}", + 'eopenclosed' => "\x{029A}", + 'eopenreversed' => "\x{025C}", + 'eopenreversedclosed' => "\x{025E}", + 'eopenreversedhook' => "\x{025D}", + 'eparen' => "\x{24A0}", + 'equalmonospace' => "\x{FF1D}", + 'equalsmall' => "\x{FE66}", + 'equalsuperior' => "\x{207C}", + 'erbopomofo' => "\x{3126}", + 'ercyrillic' => "\x{0440}", + 'ereversed' => "\x{0258}", + 'ereversedcyrillic' => "\x{044D}", + 'escyrillic' => "\x{0441}", + 'esdescendercyrillic' => "\x{04AB}", + 'esh' => "\x{0283}", + 'eshcurl' => "\x{0286}", + 'eshortdeva' => "\x{090E}", + 'eshortvowelsigndeva' => "\x{0946}", + 'eshreversedloop' => "\x{01AA}", + 'eshsquatreversed' => "\x{0285}", + 'esmallhiragana' => "\x{3047}", + 'esmallkatakana' => "\x{30A7}", + 'esmallkatakanahalfwidth' => "\x{FF6A}", + 'esuperior' => "\x{F6EC}", + 'etarmenian' => "\x{0568}", + 'etilde' => "\x{1EBD}", + 'etildebelow' => "\x{1E1B}", + 'etnahtafoukhhebrew' => "\x{0591}", + 'etnahtafoukhlefthebrew' => "\x{0591}", + 'etnahtahebrew' => "\x{0591}", + 'etnahtalefthebrew' => "\x{0591}", + 'eturned' => "\x{01DD}", + 'eukorean' => "\x{3161}", + 'euro' => "\x{20AC}", + 'evowelsignbengali' => "\x{09C7}", + 'evowelsigndeva' => "\x{0947}", + 'evowelsigngujarati' => "\x{0AC7}", + 'exclamarmenian' => "\x{055C}", + 'exclamdownsmall' => "\x{F7A1}", + 'exclammonospace' => "\x{FF01}", + 'exclamsmall' => "\x{F721}", + 'ezh' => "\x{0292}", + 'ezhcaron' => "\x{01EF}", + 'ezhcurl' => "\x{0293}", + 'ezhreversed' => "\x{01B9}", + 'ezhtail' => "\x{01BA}", + 'fadeva' => "\x{095E}", + 'fagurmukhi' => "\x{0A5E}", + 'fahrenheit' => "\x{2109}", + 'fathaarabic' => "\x{064E}", + 'fathalowarabic' => "\x{064E}", + 'fathatanarabic' => "\x{064B}", + 'fbopomofo' => "\x{3108}", + 'fcircle' => "\x{24D5}", + 'fdotaccent' => "\x{1E1F}", + 'feharabic' => "\x{0641}", + 'feharmenian' => "\x{0586}", + 'fehfinalarabic' => "\x{FED2}", + 'fehinitialarabic' => "\x{FED3}", + 'fehmedialarabic' => "\x{FED4}", + 'feicoptic' => "\x{03E5}", + 'fifteencircle' => "\x{246E}", + 'fifteenparen' => "\x{2482}", + 'fifteenperiod' => "\x{2496}", + 'finalkaf' => "\x{05DA}", + 'finalkafdagesh' => "\x{FB3A}", + 'finalkafdageshhebrew' => "\x{FB3A}", + 'finalkafhebrew' => "\x{05DA}", + 'finalkafqamats' => "\x{05DA}\x{05B8}", + 'finalkafqamatshebrew' => "\x{05DA}\x{05B8}", + 'finalkafsheva' => "\x{05DA}\x{05B0}", + 'finalkafshevahebrew' => "\x{05DA}\x{05B0}", + 'finalmem' => "\x{05DD}", + 'finalmemhebrew' => "\x{05DD}", + 'finalnun' => "\x{05DF}", + 'finalnunhebrew' => "\x{05DF}", + 'finalpe' => "\x{05E3}", + 'finalpehebrew' => "\x{05E3}", + 'finaltsadi' => "\x{05E5}", + 'finaltsadihebrew' => "\x{05E5}", + 'firsttonechinese' => "\x{02C9}", + 'fisheye' => "\x{25C9}", + 'fitacyrillic' => "\x{0473}", + 'fivearabic' => "\x{0665}", + 'fivebengali' => "\x{09EB}", + 'fivecircle' => "\x{2464}", + 'fivecircleinversesansserif' => "\x{278E}", + 'fivedeva' => "\x{096B}", + 'fivegujarati' => "\x{0AEB}", + 'fivegurmukhi' => "\x{0A6B}", + 'fivehackarabic' => "\x{0665}", + 'fivehangzhou' => "\x{3025}", + 'fiveideographicparen' => "\x{3224}", + 'fiveinferior' => "\x{2085}", + 'fivemonospace' => "\x{FF15}", + 'fiveoldstyle' => "\x{F735}", + 'fiveparen' => "\x{2478}", + 'fiveperiod' => "\x{248C}", + 'fivepersian' => "\x{06F5}", + 'fiveroman' => "\x{2174}", + 'fivesuperior' => "\x{2075}", + 'fivethai' => "\x{0E55}", + 'fmonospace' => "\x{FF46}", + 'fmsquare' => "\x{3399}", + 'fofanthai' => "\x{0E1F}", + 'fofathai' => "\x{0E1D}", + 'fongmanthai' => "\x{0E4F}", + 'forall' => "\x{2200}", + 'fourarabic' => "\x{0664}", + 'fourbengali' => "\x{09EA}", + 'fourcircle' => "\x{2463}", + 'fourcircleinversesansserif' => "\x{278D}", + 'fourdeva' => "\x{096A}", + 'fourgujarati' => "\x{0AEA}", + 'fourgurmukhi' => "\x{0A6A}", + 'fourhackarabic' => "\x{0664}", + 'fourhangzhou' => "\x{3024}", + 'fourideographicparen' => "\x{3223}", + 'fourinferior' => "\x{2084}", + 'fourmonospace' => "\x{FF14}", + 'fournumeratorbengali' => "\x{09F7}", + 'fouroldstyle' => "\x{F734}", + 'fourparen' => "\x{2477}", + 'fourperiod' => "\x{248B}", + 'fourpersian' => "\x{06F4}", + 'fourroman' => "\x{2173}", + 'foursuperior' => "\x{2074}", + 'fourteencircle' => "\x{246D}", + 'fourteenparen' => "\x{2481}", + 'fourteenperiod' => "\x{2495}", + 'fourthai' => "\x{0E54}", + 'fourthtonechinese' => "\x{02CB}", + 'fparen' => "\x{24A1}", + 'gabengali' => "\x{0997}", + 'gacute' => "\x{01F5}", + 'gadeva' => "\x{0917}", + 'gafarabic' => "\x{06AF}", + 'gaffinalarabic' => "\x{FB93}", + 'gafinitialarabic' => "\x{FB94}", + 'gafmedialarabic' => "\x{FB95}", + 'gagujarati' => "\x{0A97}", + 'gagurmukhi' => "\x{0A17}", + 'gahiragana' => "\x{304C}", + 'gakatakana' => "\x{30AC}", + 'gammalatinsmall' => "\x{0263}", + 'gammasuperior' => "\x{02E0}", + 'gangiacoptic' => "\x{03EB}", + 'gbopomofo' => "\x{310D}", + 'gcedilla' => "\x{0123}", + 'gcircle' => "\x{24D6}", + 'gdot' => "\x{0121}", + 'gecyrillic' => "\x{0433}", + 'gehiragana' => "\x{3052}", + 'gekatakana' => "\x{30B2}", + 'geometricallyequal' => "\x{2251}", + 'gereshaccenthebrew' => "\x{059C}", + 'gereshhebrew' => "\x{05F3}", + 'gereshmuqdamhebrew' => "\x{059D}", + 'gershayimaccenthebrew' => "\x{059E}", + 'gershayimhebrew' => "\x{05F4}", + 'getamark' => "\x{3013}", + 'ghabengali' => "\x{0998}", + 'ghadarmenian' => "\x{0572}", + 'ghadeva' => "\x{0918}", + 'ghagujarati' => "\x{0A98}", + 'ghagurmukhi' => "\x{0A18}", + 'ghainarabic' => "\x{063A}", + 'ghainfinalarabic' => "\x{FECE}", + 'ghaininitialarabic' => "\x{FECF}", + 'ghainmedialarabic' => "\x{FED0}", + 'ghemiddlehookcyrillic' => "\x{0495}", + 'ghestrokecyrillic' => "\x{0493}", + 'gheupturncyrillic' => "\x{0491}", + 'ghhadeva' => "\x{095A}", + 'ghhagurmukhi' => "\x{0A5A}", + 'ghook' => "\x{0260}", + 'ghzsquare' => "\x{3393}", + 'gihiragana' => "\x{304E}", + 'gikatakana' => "\x{30AE}", + 'gimarmenian' => "\x{0563}", + 'gimel' => "\x{05D2}", + 'gimeldagesh' => "\x{FB32}", + 'gimeldageshhebrew' => "\x{FB32}", + 'gimelhebrew' => "\x{05D2}", + 'gjecyrillic' => "\x{0453}", + 'glottalinvertedstroke' => "\x{01BE}", + 'glottalstop' => "\x{0294}", + 'glottalstopinverted' => "\x{0296}", + 'glottalstopmod' => "\x{02C0}", + 'glottalstopreversed' => "\x{0295}", + 'glottalstopreversedmod' => "\x{02C1}", + 'glottalstopreversedsuperior' => "\x{02E4}", + 'glottalstopstroke' => "\x{02A1}", + 'glottalstopstrokereversed' => "\x{02A2}", + 'gmacron' => "\x{1E21}", + 'gmonospace' => "\x{FF47}", + 'gohiragana' => "\x{3054}", + 'gokatakana' => "\x{30B4}", + 'gparen' => "\x{24A2}", + 'gpasquare' => "\x{33AC}", + 'gravebelowcmb' => "\x{0316}", + 'gravecmb' => "\x{0300}", + 'gravedeva' => "\x{0953}", + 'gravelowmod' => "\x{02CE}", + 'gravemonospace' => "\x{FF40}", + 'gravetonecmb' => "\x{0340}", + 'greaterequalorless' => "\x{22DB}", + 'greatermonospace' => "\x{FF1E}", + 'greaterorequivalent' => "\x{2273}", + 'greaterorless' => "\x{2277}", + 'greateroverequal' => "\x{2267}", + 'greatersmall' => "\x{FE65}", + 'gscript' => "\x{0261}", + 'gstroke' => "\x{01E5}", + 'guhiragana' => "\x{3050}", + 'gukatakana' => "\x{30B0}", + 'guramusquare' => "\x{3318}", + 'gysquare' => "\x{33C9}", + 'haabkhasiancyrillic' => "\x{04A9}", + 'haaltonearabic' => "\x{06C1}", + 'habengali' => "\x{09B9}", + 'hadescendercyrillic' => "\x{04B3}", + 'hadeva' => "\x{0939}", + 'hagujarati' => "\x{0AB9}", + 'hagurmukhi' => "\x{0A39}", + 'haharabic' => "\x{062D}", + 'hahfinalarabic' => "\x{FEA2}", + 'hahinitialarabic' => "\x{FEA3}", + 'hahiragana' => "\x{306F}", + 'hahmedialarabic' => "\x{FEA4}", + 'haitusquare' => "\x{332A}", + 'hakatakana' => "\x{30CF}", + 'hakatakanahalfwidth' => "\x{FF8A}", + 'halantgurmukhi' => "\x{0A4D}", + 'hamzaarabic' => "\x{0621}", + 'hamzadammaarabic' => "\x{0621}\x{064F}", + 'hamzadammatanarabic' => "\x{0621}\x{064C}", + 'hamzafathaarabic' => "\x{0621}\x{064E}", + 'hamzafathatanarabic' => "\x{0621}\x{064B}", + 'hamzalowarabic' => "\x{0621}", + 'hamzalowkasraarabic' => "\x{0621}\x{0650}", + 'hamzalowkasratanarabic' => "\x{0621}\x{064D}", + 'hamzasukunarabic' => "\x{0621}\x{0652}", + 'hangulfiller' => "\x{3164}", + 'hardsigncyrillic' => "\x{044A}", + 'harpoonleftbarbup' => "\x{21BC}", + 'harpoonrightbarbup' => "\x{21C0}", + 'hasquare' => "\x{33CA}", + 'hatafpatah' => "\x{05B2}", + 'hatafpatah16' => "\x{05B2}", + 'hatafpatah23' => "\x{05B2}", + 'hatafpatah2f' => "\x{05B2}", + 'hatafpatahhebrew' => "\x{05B2}", + 'hatafpatahnarrowhebrew' => "\x{05B2}", + 'hatafpatahquarterhebrew' => "\x{05B2}", + 'hatafpatahwidehebrew' => "\x{05B2}", + 'hatafqamats' => "\x{05B3}", + 'hatafqamats1b' => "\x{05B3}", + 'hatafqamats28' => "\x{05B3}", + 'hatafqamats34' => "\x{05B3}", + 'hatafqamatshebrew' => "\x{05B3}", + 'hatafqamatsnarrowhebrew' => "\x{05B3}", + 'hatafqamatsquarterhebrew' => "\x{05B3}", + 'hatafqamatswidehebrew' => "\x{05B3}", + 'hatafsegol' => "\x{05B1}", + 'hatafsegol17' => "\x{05B1}", + 'hatafsegol24' => "\x{05B1}", + 'hatafsegol30' => "\x{05B1}", + 'hatafsegolhebrew' => "\x{05B1}", + 'hatafsegolnarrowhebrew' => "\x{05B1}", + 'hatafsegolquarterhebrew' => "\x{05B1}", + 'hatafsegolwidehebrew' => "\x{05B1}", + 'hbopomofo' => "\x{310F}", + 'hbrevebelow' => "\x{1E2B}", + 'hcedilla' => "\x{1E29}", + 'hcircle' => "\x{24D7}", + 'hdieresis' => "\x{1E27}", + 'hdotaccent' => "\x{1E23}", + 'hdotbelow' => "\x{1E25}", + 'he' => "\x{05D4}", + 'heartsuitblack' => "\x{2665}", + 'heartsuitwhite' => "\x{2661}", + 'hedagesh' => "\x{FB34}", + 'hedageshhebrew' => "\x{FB34}", + 'hehaltonearabic' => "\x{06C1}", + 'heharabic' => "\x{0647}", + 'hehebrew' => "\x{05D4}", + 'hehfinalaltonearabic' => "\x{FBA7}", + 'hehfinalalttwoarabic' => "\x{FEEA}", + 'hehfinalarabic' => "\x{FEEA}", + 'hehhamzaabovefinalarabic' => "\x{FBA5}", + 'hehhamzaaboveisolatedarabic' => "\x{FBA4}", + 'hehinitialaltonearabic' => "\x{FBA8}", + 'hehinitialarabic' => "\x{FEEB}", + 'hehiragana' => "\x{3078}", + 'hehmedialaltonearabic' => "\x{FBA9}", + 'hehmedialarabic' => "\x{FEEC}", + 'heiseierasquare' => "\x{337B}", + 'hekatakana' => "\x{30D8}", + 'hekatakanahalfwidth' => "\x{FF8D}", + 'hekutaarusquare' => "\x{3336}", + 'henghook' => "\x{0267}", + 'herutusquare' => "\x{3339}", + 'het' => "\x{05D7}", + 'hethebrew' => "\x{05D7}", + 'hhook' => "\x{0266}", + 'hhooksuperior' => "\x{02B1}", + 'hieuhacirclekorean' => "\x{327B}", + 'hieuhaparenkorean' => "\x{321B}", + 'hieuhcirclekorean' => "\x{326D}", + 'hieuhkorean' => "\x{314E}", + 'hieuhparenkorean' => "\x{320D}", + 'hihiragana' => "\x{3072}", + 'hikatakana' => "\x{30D2}", + 'hikatakanahalfwidth' => "\x{FF8B}", + 'hiriq' => "\x{05B4}", + 'hiriq14' => "\x{05B4}", + 'hiriq21' => "\x{05B4}", + 'hiriq2d' => "\x{05B4}", + 'hiriqhebrew' => "\x{05B4}", + 'hiriqnarrowhebrew' => "\x{05B4}", + 'hiriqquarterhebrew' => "\x{05B4}", + 'hiriqwidehebrew' => "\x{05B4}", + 'hlinebelow' => "\x{1E96}", + 'hmonospace' => "\x{FF48}", + 'hoarmenian' => "\x{0570}", + 'hohipthai' => "\x{0E2B}", + 'hohiragana' => "\x{307B}", + 'hokatakana' => "\x{30DB}", + 'hokatakanahalfwidth' => "\x{FF8E}", + 'holam' => "\x{05B9}", + 'holam19' => "\x{05B9}", + 'holam26' => "\x{05B9}", + 'holam32' => "\x{05B9}", + 'holamhebrew' => "\x{05B9}", + 'holamnarrowhebrew' => "\x{05B9}", + 'holamquarterhebrew' => "\x{05B9}", + 'holamwidehebrew' => "\x{05B9}", + 'honokhukthai' => "\x{0E2E}", + 'hookcmb' => "\x{0309}", + 'hookpalatalizedbelowcmb' => "\x{0321}", + 'hookretroflexbelowcmb' => "\x{0322}", + 'hoonsquare' => "\x{3342}", + 'horicoptic' => "\x{03E9}", + 'horizontalbar' => "\x{2015}", + 'horncmb' => "\x{031B}", + 'hotsprings' => "\x{2668}", + 'hparen' => "\x{24A3}", + 'hsuperior' => "\x{02B0}", + 'hturned' => "\x{0265}", + 'huhiragana' => "\x{3075}", + 'huiitosquare' => "\x{3333}", + 'hukatakana' => "\x{30D5}", + 'hukatakanahalfwidth' => "\x{FF8C}", + 'hungarumlautcmb' => "\x{030B}", + 'hv' => "\x{0195}", + 'hypheninferior' => "\x{F6E5}", + 'hyphenmonospace' => "\x{FF0D}", + 'hyphensmall' => "\x{FE63}", + 'hyphensuperior' => "\x{F6E6}", + 'hyphentwo' => "\x{2010}", + 'iacyrillic' => "\x{044F}", + 'ibengali' => "\x{0987}", + 'ibopomofo' => "\x{3127}", + 'icaron' => "\x{01D0}", + 'icircle' => "\x{24D8}", + 'icyrillic' => "\x{0456}", + 'idblgrave' => "\x{0209}", + 'ideographearthcircle' => "\x{328F}", + 'ideographfirecircle' => "\x{328B}", + 'ideographicallianceparen' => "\x{323F}", + 'ideographiccallparen' => "\x{323A}", + 'ideographiccentrecircle' => "\x{32A5}", + 'ideographicclose' => "\x{3006}", + 'ideographiccomma' => "\x{3001}", + 'ideographiccommaleft' => "\x{FF64}", + 'ideographiccongratulationparen' => "\x{3237}", + 'ideographiccorrectcircle' => "\x{32A3}", + 'ideographicearthparen' => "\x{322F}", + 'ideographicenterpriseparen' => "\x{323D}", + 'ideographicexcellentcircle' => "\x{329D}", + 'ideographicfestivalparen' => "\x{3240}", + 'ideographicfinancialcircle' => "\x{3296}", + 'ideographicfinancialparen' => "\x{3236}", + 'ideographicfireparen' => "\x{322B}", + 'ideographichaveparen' => "\x{3232}", + 'ideographichighcircle' => "\x{32A4}", + 'ideographiciterationmark' => "\x{3005}", + 'ideographiclaborcircle' => "\x{3298}", + 'ideographiclaborparen' => "\x{3238}", + 'ideographicleftcircle' => "\x{32A7}", + 'ideographiclowcircle' => "\x{32A6}", + 'ideographicmedicinecircle' => "\x{32A9}", + 'ideographicmetalparen' => "\x{322E}", + 'ideographicmoonparen' => "\x{322A}", + 'ideographicnameparen' => "\x{3234}", + 'ideographicperiod' => "\x{3002}", + 'ideographicprintcircle' => "\x{329E}", + 'ideographicreachparen' => "\x{3243}", + 'ideographicrepresentparen' => "\x{3239}", + 'ideographicresourceparen' => "\x{323E}", + 'ideographicrightcircle' => "\x{32A8}", + 'ideographicsecretcircle' => "\x{3299}", + 'ideographicselfparen' => "\x{3242}", + 'ideographicsocietyparen' => "\x{3233}", + 'ideographicspace' => "\x{3000}", + 'ideographicspecialparen' => "\x{3235}", + 'ideographicstockparen' => "\x{3231}", + 'ideographicstudyparen' => "\x{323B}", + 'ideographicsunparen' => "\x{3230}", + 'ideographicsuperviseparen' => "\x{323C}", + 'ideographicwaterparen' => "\x{322C}", + 'ideographicwoodparen' => "\x{322D}", + 'ideographiczero' => "\x{3007}", + 'ideographmetalcircle' => "\x{328E}", + 'ideographmooncircle' => "\x{328A}", + 'ideographnamecircle' => "\x{3294}", + 'ideographsuncircle' => "\x{3290}", + 'ideographwatercircle' => "\x{328C}", + 'ideographwoodcircle' => "\x{328D}", + 'ideva' => "\x{0907}", + 'idieresisacute' => "\x{1E2F}", + 'idieresiscyrillic' => "\x{04E5}", + 'idotbelow' => "\x{1ECB}", + 'iebrevecyrillic' => "\x{04D7}", + 'iecyrillic' => "\x{0435}", + 'ieungacirclekorean' => "\x{3275}", + 'ieungaparenkorean' => "\x{3215}", + 'ieungcirclekorean' => "\x{3267}", + 'ieungkorean' => "\x{3147}", + 'ieungparenkorean' => "\x{3207}", + 'igujarati' => "\x{0A87}", + 'igurmukhi' => "\x{0A07}", + 'ihiragana' => "\x{3044}", + 'ihookabove' => "\x{1EC9}", + 'iibengali' => "\x{0988}", + 'iicyrillic' => "\x{0438}", + 'iideva' => "\x{0908}", + 'iigujarati' => "\x{0A88}", + 'iigurmukhi' => "\x{0A08}", + 'iimatragurmukhi' => "\x{0A40}", + 'iinvertedbreve' => "\x{020B}", + 'iishortcyrillic' => "\x{0439}", + 'iivowelsignbengali' => "\x{09C0}", + 'iivowelsigndeva' => "\x{0940}", + 'iivowelsigngujarati' => "\x{0AC0}", + 'ikatakana' => "\x{30A4}", + 'ikatakanahalfwidth' => "\x{FF72}", + 'ikorean' => "\x{3163}", + 'ilde' => "\x{02DC}", + 'iluyhebrew' => "\x{05AC}", + 'imacroncyrillic' => "\x{04E3}", + 'imageorapproximatelyequal' => "\x{2253}", + 'imatragurmukhi' => "\x{0A3F}", + 'imonospace' => "\x{FF49}", + 'increment' => "\x{2206}", + 'iniarmenian' => "\x{056B}", + 'integralbottom' => "\x{2321}", + 'integralex' => "\x{F8F5}", + 'integraltop' => "\x{2320}", + 'intisquare' => "\x{3305}", + 'iocyrillic' => "\x{0451}", + 'iotalatin' => "\x{0269}", + 'iparen' => "\x{24A4}", + 'irigurmukhi' => "\x{0A72}", + 'ismallhiragana' => "\x{3043}", + 'ismallkatakana' => "\x{30A3}", + 'ismallkatakanahalfwidth' => "\x{FF68}", + 'issharbengali' => "\x{09FA}", + 'istroke' => "\x{0268}", + 'isuperior' => "\x{F6ED}", + 'iterationhiragana' => "\x{309D}", + 'iterationkatakana' => "\x{30FD}", + 'itildebelow' => "\x{1E2D}", + 'iubopomofo' => "\x{3129}", + 'iucyrillic' => "\x{044E}", + 'ivowelsignbengali' => "\x{09BF}", + 'ivowelsigndeva' => "\x{093F}", + 'ivowelsigngujarati' => "\x{0ABF}", + 'izhitsacyrillic' => "\x{0475}", + 'izhitsadblgravecyrillic' => "\x{0477}", + 'jaarmenian' => "\x{0571}", + 'jabengali' => "\x{099C}", + 'jadeva' => "\x{091C}", + 'jagujarati' => "\x{0A9C}", + 'jagurmukhi' => "\x{0A1C}", + 'jbopomofo' => "\x{3110}", + 'jcaron' => "\x{01F0}", + 'jcircle' => "\x{24D9}", + 'jcrossedtail' => "\x{029D}", + 'jdotlessstroke' => "\x{025F}", + 'jecyrillic' => "\x{0458}", + 'jeemarabic' => "\x{062C}", + 'jeemfinalarabic' => "\x{FE9E}", + 'jeeminitialarabic' => "\x{FE9F}", + 'jeemmedialarabic' => "\x{FEA0}", + 'jeharabic' => "\x{0698}", + 'jehfinalarabic' => "\x{FB8B}", + 'jhabengali' => "\x{099D}", + 'jhadeva' => "\x{091D}", + 'jhagujarati' => "\x{0A9D}", + 'jhagurmukhi' => "\x{0A1D}", + 'jheharmenian' => "\x{057B}", + 'jis' => "\x{3004}", + 'jmonospace' => "\x{FF4A}", + 'jparen' => "\x{24A5}", + 'jsuperior' => "\x{02B2}", + 'kabashkircyrillic' => "\x{04A1}", + 'kabengali' => "\x{0995}", + 'kacute' => "\x{1E31}", + 'kacyrillic' => "\x{043A}", + 'kadescendercyrillic' => "\x{049B}", + 'kadeva' => "\x{0915}", + 'kaf' => "\x{05DB}", + 'kafarabic' => "\x{0643}", + 'kafdagesh' => "\x{FB3B}", + 'kafdageshhebrew' => "\x{FB3B}", + 'kaffinalarabic' => "\x{FEDA}", + 'kafhebrew' => "\x{05DB}", + 'kafinitialarabic' => "\x{FEDB}", + 'kafmedialarabic' => "\x{FEDC}", + 'kafrafehebrew' => "\x{FB4D}", + 'kagujarati' => "\x{0A95}", + 'kagurmukhi' => "\x{0A15}", + 'kahiragana' => "\x{304B}", + 'kahookcyrillic' => "\x{04C4}", + 'kakatakana' => "\x{30AB}", + 'kakatakanahalfwidth' => "\x{FF76}", + 'kappasymbolgreek' => "\x{03F0}", + 'kapyeounmieumkorean' => "\x{3171}", + 'kapyeounphieuphkorean' => "\x{3184}", + 'kapyeounpieupkorean' => "\x{3178}", + 'kapyeounssangpieupkorean' => "\x{3179}", + 'karoriisquare' => "\x{330D}", + 'kashidaautoarabic' => "\x{0640}", + 'kashidaautonosidebearingarabic' => "\x{0640}", + 'kasmallkatakana' => "\x{30F5}", + 'kasquare' => "\x{3384}", + 'kasraarabic' => "\x{0650}", + 'kasratanarabic' => "\x{064D}", + 'kastrokecyrillic' => "\x{049F}", + 'katahiraprolongmarkhalfwidth' => "\x{FF70}", + 'kaverticalstrokecyrillic' => "\x{049D}", + 'kbopomofo' => "\x{310E}", + 'kcalsquare' => "\x{3389}", + 'kcaron' => "\x{01E9}", + 'kcedilla' => "\x{0137}", + 'kcircle' => "\x{24DA}", + 'kdotbelow' => "\x{1E33}", + 'keharmenian' => "\x{0584}", + 'kehiragana' => "\x{3051}", + 'kekatakana' => "\x{30B1}", + 'kekatakanahalfwidth' => "\x{FF79}", + 'kenarmenian' => "\x{056F}", + 'kesmallkatakana' => "\x{30F6}", + 'khabengali' => "\x{0996}", + 'khacyrillic' => "\x{0445}", + 'khadeva' => "\x{0916}", + 'khagujarati' => "\x{0A96}", + 'khagurmukhi' => "\x{0A16}", + 'khaharabic' => "\x{062E}", + 'khahfinalarabic' => "\x{FEA6}", + 'khahinitialarabic' => "\x{FEA7}", + 'khahmedialarabic' => "\x{FEA8}", + 'kheicoptic' => "\x{03E7}", + 'khhadeva' => "\x{0959}", + 'khhagurmukhi' => "\x{0A59}", + 'khieukhacirclekorean' => "\x{3278}", + 'khieukhaparenkorean' => "\x{3218}", + 'khieukhcirclekorean' => "\x{326A}", + 'khieukhkorean' => "\x{314B}", + 'khieukhparenkorean' => "\x{320A}", + 'khokhaithai' => "\x{0E02}", + 'khokhonthai' => "\x{0E05}", + 'khokhuatthai' => "\x{0E03}", + 'khokhwaithai' => "\x{0E04}", + 'khomutthai' => "\x{0E5B}", + 'khook' => "\x{0199}", + 'khorakhangthai' => "\x{0E06}", + 'khzsquare' => "\x{3391}", + 'kihiragana' => "\x{304D}", + 'kikatakana' => "\x{30AD}", + 'kikatakanahalfwidth' => "\x{FF77}", + 'kiroguramusquare' => "\x{3315}", + 'kiromeetorusquare' => "\x{3316}", + 'kirosquare' => "\x{3314}", + 'kiyeokacirclekorean' => "\x{326E}", + 'kiyeokaparenkorean' => "\x{320E}", + 'kiyeokcirclekorean' => "\x{3260}", + 'kiyeokkorean' => "\x{3131}", + 'kiyeokparenkorean' => "\x{3200}", + 'kiyeoksioskorean' => "\x{3133}", + 'kjecyrillic' => "\x{045C}", + 'klinebelow' => "\x{1E35}", + 'klsquare' => "\x{3398}", + 'kmcubedsquare' => "\x{33A6}", + 'kmonospace' => "\x{FF4B}", + 'kmsquaredsquare' => "\x{33A2}", + 'kohiragana' => "\x{3053}", + 'kohmsquare' => "\x{33C0}", + 'kokaithai' => "\x{0E01}", + 'kokatakana' => "\x{30B3}", + 'kokatakanahalfwidth' => "\x{FF7A}", + 'kooposquare' => "\x{331E}", + 'koppacyrillic' => "\x{0481}", + 'koreanstandardsymbol' => "\x{327F}", + 'koroniscmb' => "\x{0343}", + 'kparen' => "\x{24A6}", + 'kpasquare' => "\x{33AA}", + 'ksicyrillic' => "\x{046F}", + 'ktsquare' => "\x{33CF}", + 'kturned' => "\x{029E}", + 'kuhiragana' => "\x{304F}", + 'kukatakana' => "\x{30AF}", + 'kukatakanahalfwidth' => "\x{FF78}", + 'kvsquare' => "\x{33B8}", + 'kwsquare' => "\x{33BE}", + 'labengali' => "\x{09B2}", + 'ladeva' => "\x{0932}", + 'lagujarati' => "\x{0AB2}", + 'lagurmukhi' => "\x{0A32}", + 'lakkhangyaothai' => "\x{0E45}", + 'lamaleffinalarabic' => "\x{FEFC}", + 'lamalefhamzaabovefinalarabic' => "\x{FEF8}", + 'lamalefhamzaaboveisolatedarabic' => "\x{FEF7}", + 'lamalefhamzabelowfinalarabic' => "\x{FEFA}", + 'lamalefhamzabelowisolatedarabic' => "\x{FEF9}", + 'lamalefisolatedarabic' => "\x{FEFB}", + 'lamalefmaddaabovefinalarabic' => "\x{FEF6}", + 'lamalefmaddaaboveisolatedarabic' => "\x{FEF5}", + 'lamarabic' => "\x{0644}", + 'lambdastroke' => "\x{019B}", + 'lamed' => "\x{05DC}", + 'lameddagesh' => "\x{FB3C}", + 'lameddageshhebrew' => "\x{FB3C}", + 'lamedhebrew' => "\x{05DC}", + 'lamedholam' => "\x{05DC}\x{05B9}", + 'lamedholamdagesh' => "\x{05DC}\x{05B9}\x{05BC}", + 'lamedholamdageshhebrew' => "\x{05DC}\x{05B9}\x{05BC}", + 'lamedholamhebrew' => "\x{05DC}\x{05B9}", + 'lamfinalarabic' => "\x{FEDE}", + 'lamhahinitialarabic' => "\x{FCCA}", + 'laminitialarabic' => "\x{FEDF}", + 'lamjeeminitialarabic' => "\x{FCC9}", + 'lamkhahinitialarabic' => "\x{FCCB}", + 'lamlamhehisolatedarabic' => "\x{FDF2}", + 'lammedialarabic' => "\x{FEE0}", + 'lammeemhahinitialarabic' => "\x{FD88}", + 'lammeeminitialarabic' => "\x{FCCC}", + 'lammeemjeeminitialarabic' => "\x{FEDF}\x{FEE4}\x{FEA0}", + 'lammeemkhahinitialarabic' => "\x{FEDF}\x{FEE4}\x{FEA8}", + 'largecircle' => "\x{25EF}", + 'lbar' => "\x{019A}", + 'lbelt' => "\x{026C}", + 'lbopomofo' => "\x{310C}", + 'lcedilla' => "\x{013C}", + 'lcircle' => "\x{24DB}", + 'lcircumflexbelow' => "\x{1E3D}", + 'ldotaccent' => "\x{0140}", + 'ldotbelow' => "\x{1E37}", + 'ldotbelowmacron' => "\x{1E39}", + 'leftangleabovecmb' => "\x{031A}", + 'lefttackbelowcmb' => "\x{0318}", + 'lessequalorgreater' => "\x{22DA}", + 'lessmonospace' => "\x{FF1C}", + 'lessorequivalent' => "\x{2272}", + 'lessorgreater' => "\x{2276}", + 'lessoverequal' => "\x{2266}", + 'lesssmall' => "\x{FE64}", + 'lezh' => "\x{026E}", + 'lhookretroflex' => "\x{026D}", + 'liwnarmenian' => "\x{056C}", + 'lj' => "\x{01C9}", + 'ljecyrillic' => "\x{0459}", + 'll' => "\x{F6C0}", + 'lladeva' => "\x{0933}", + 'llagujarati' => "\x{0AB3}", + 'llinebelow' => "\x{1E3B}", + 'llladeva' => "\x{0934}", + 'llvocalicbengali' => "\x{09E1}", + 'llvocalicdeva' => "\x{0961}", + 'llvocalicvowelsignbengali' => "\x{09E3}", + 'llvocalicvowelsigndeva' => "\x{0963}", + 'lmiddletilde' => "\x{026B}", + 'lmonospace' => "\x{FF4C}", + 'lmsquare' => "\x{33D0}", + 'lochulathai' => "\x{0E2C}", + 'logicalnotreversed' => "\x{2310}", + 'lolingthai' => "\x{0E25}", + 'lowlinecenterline' => "\x{FE4E}", + 'lowlinecmb' => "\x{0332}", + 'lowlinedashed' => "\x{FE4D}", + 'lparen' => "\x{24A7}", + 'lsquare' => "\x{2113}", + 'lsuperior' => "\x{F6EE}", + 'luthai' => "\x{0E26}", + 'lvocalicbengali' => "\x{098C}", + 'lvocalicdeva' => "\x{090C}", + 'lvocalicvowelsignbengali' => "\x{09E2}", + 'lvocalicvowelsigndeva' => "\x{0962}", + 'lxsquare' => "\x{33D3}", + 'mabengali' => "\x{09AE}", + 'macronbelowcmb' => "\x{0331}", + 'macroncmb' => "\x{0304}", + 'macronlowmod' => "\x{02CD}", + 'macronmonospace' => "\x{FFE3}", + 'macute' => "\x{1E3F}", + 'madeva' => "\x{092E}", + 'magujarati' => "\x{0AAE}", + 'magurmukhi' => "\x{0A2E}", + 'mahapakhhebrew' => "\x{05A4}", + 'mahapakhlefthebrew' => "\x{05A4}", + 'mahiragana' => "\x{307E}", + 'maichattawalowleftthai' => "\x{F895}", + 'maichattawalowrightthai' => "\x{F894}", + 'maichattawathai' => "\x{0E4B}", + 'maichattawaupperleftthai' => "\x{F893}", + 'maieklowleftthai' => "\x{F88C}", + 'maieklowrightthai' => "\x{F88B}", + 'maiekthai' => "\x{0E48}", + 'maiekupperleftthai' => "\x{F88A}", + 'maihanakatleftthai' => "\x{F884}", + 'maihanakatthai' => "\x{0E31}", + 'maitaikhuleftthai' => "\x{F889}", + 'maitaikhuthai' => "\x{0E47}", + 'maitholowleftthai' => "\x{F88F}", + 'maitholowrightthai' => "\x{F88E}", + 'maithothai' => "\x{0E49}", + 'maithoupperleftthai' => "\x{F88D}", + 'maitrilowleftthai' => "\x{F892}", + 'maitrilowrightthai' => "\x{F891}", + 'maitrithai' => "\x{0E4A}", + 'maitriupperleftthai' => "\x{F890}", + 'maiyamokthai' => "\x{0E46}", + 'makatakana' => "\x{30DE}", + 'makatakanahalfwidth' => "\x{FF8F}", + 'mansyonsquare' => "\x{3347}", + 'maqafhebrew' => "\x{05BE}", + 'mars' => "\x{2642}", + 'masoracirclehebrew' => "\x{05AF}", + 'masquare' => "\x{3383}", + 'mbopomofo' => "\x{3107}", + 'mbsquare' => "\x{33D4}", + 'mcircle' => "\x{24DC}", + 'mcubedsquare' => "\x{33A5}", + 'mdotaccent' => "\x{1E41}", + 'mdotbelow' => "\x{1E43}", + 'meemarabic' => "\x{0645}", + 'meemfinalarabic' => "\x{FEE2}", + 'meeminitialarabic' => "\x{FEE3}", + 'meemmedialarabic' => "\x{FEE4}", + 'meemmeeminitialarabic' => "\x{FCD1}", + 'meemmeemisolatedarabic' => "\x{FC48}", + 'meetorusquare' => "\x{334D}", + 'mehiragana' => "\x{3081}", + 'meizierasquare' => "\x{337E}", + 'mekatakana' => "\x{30E1}", + 'mekatakanahalfwidth' => "\x{FF92}", + 'mem' => "\x{05DE}", + 'memdagesh' => "\x{FB3E}", + 'memdageshhebrew' => "\x{FB3E}", + 'memhebrew' => "\x{05DE}", + 'menarmenian' => "\x{0574}", + 'merkhahebrew' => "\x{05A5}", + 'merkhakefulahebrew' => "\x{05A6}", + 'merkhakefulalefthebrew' => "\x{05A6}", + 'merkhalefthebrew' => "\x{05A5}", + 'mhook' => "\x{0271}", + 'mhzsquare' => "\x{3392}", + 'middledotkatakanahalfwidth' => "\x{FF65}", + 'middot' => "\x{00B7}", + 'mieumacirclekorean' => "\x{3272}", + 'mieumaparenkorean' => "\x{3212}", + 'mieumcirclekorean' => "\x{3264}", + 'mieumkorean' => "\x{3141}", + 'mieumpansioskorean' => "\x{3170}", + 'mieumparenkorean' => "\x{3204}", + 'mieumpieupkorean' => "\x{316E}", + 'mieumsioskorean' => "\x{316F}", + 'mihiragana' => "\x{307F}", + 'mikatakana' => "\x{30DF}", + 'mikatakanahalfwidth' => "\x{FF90}", + 'minusbelowcmb' => "\x{0320}", + 'minuscircle' => "\x{2296}", + 'minusmod' => "\x{02D7}", + 'minusplus' => "\x{2213}", + 'miribaarusquare' => "\x{334A}", + 'mirisquare' => "\x{3349}", + 'mlonglegturned' => "\x{0270}", + 'mlsquare' => "\x{3396}", + 'mmcubedsquare' => "\x{33A3}", + 'mmonospace' => "\x{FF4D}", + 'mmsquaredsquare' => "\x{339F}", + 'mohiragana' => "\x{3082}", + 'mohmsquare' => "\x{33C1}", + 'mokatakana' => "\x{30E2}", + 'mokatakanahalfwidth' => "\x{FF93}", + 'molsquare' => "\x{33D6}", + 'momathai' => "\x{0E21}", + 'moverssquare' => "\x{33A7}", + 'moverssquaredsquare' => "\x{33A8}", + 'mparen' => "\x{24A8}", + 'mpasquare' => "\x{33AB}", + 'mssquare' => "\x{33B3}", + 'msuperior' => "\x{F6EF}", + 'mturned' => "\x{026F}", + 'mu1' => "\x{00B5}", + 'muasquare' => "\x{3382}", + 'muchgreater' => "\x{226B}", + 'muchless' => "\x{226A}", + 'mufsquare' => "\x{338C}", + 'mugreek' => "\x{03BC}", + 'mugsquare' => "\x{338D}", + 'muhiragana' => "\x{3080}", + 'mukatakana' => "\x{30E0}", + 'mukatakanahalfwidth' => "\x{FF91}", + 'mulsquare' => "\x{3395}", + 'mumsquare' => "\x{339B}", + 'munahhebrew' => "\x{05A3}", + 'munahlefthebrew' => "\x{05A3}", + 'musicflatsign' => "\x{266D}", + 'musicsharpsign' => "\x{266F}", + 'mussquare' => "\x{33B2}", + 'muvsquare' => "\x{33B6}", + 'muwsquare' => "\x{33BC}", + 'mvmegasquare' => "\x{33B9}", + 'mvsquare' => "\x{33B7}", + 'mwmegasquare' => "\x{33BF}", + 'mwsquare' => "\x{33BD}", + 'nabengali' => "\x{09A8}", + 'nabla' => "\x{2207}", + 'nadeva' => "\x{0928}", + 'nagujarati' => "\x{0AA8}", + 'nagurmukhi' => "\x{0A28}", + 'nahiragana' => "\x{306A}", + 'nakatakana' => "\x{30CA}", + 'nakatakanahalfwidth' => "\x{FF85}", + 'nasquare' => "\x{3381}", + 'nbopomofo' => "\x{310B}", + 'nbspace' => "\x{00A0}", + 'ncedilla' => "\x{0146}", + 'ncircle' => "\x{24DD}", + 'ncircumflexbelow' => "\x{1E4B}", + 'ndotaccent' => "\x{1E45}", + 'ndotbelow' => "\x{1E47}", + 'nehiragana' => "\x{306D}", + 'nekatakana' => "\x{30CD}", + 'nekatakanahalfwidth' => "\x{FF88}", + 'newsheqelsign' => "\x{20AA}", + 'nfsquare' => "\x{338B}", + 'ngabengali' => "\x{0999}", + 'ngadeva' => "\x{0919}", + 'ngagujarati' => "\x{0A99}", + 'ngagurmukhi' => "\x{0A19}", + 'ngonguthai' => "\x{0E07}", + 'nhiragana' => "\x{3093}", + 'nhookleft' => "\x{0272}", + 'nhookretroflex' => "\x{0273}", + 'nieunacirclekorean' => "\x{326F}", + 'nieunaparenkorean' => "\x{320F}", + 'nieuncieuckorean' => "\x{3135}", + 'nieuncirclekorean' => "\x{3261}", + 'nieunhieuhkorean' => "\x{3136}", + 'nieunkorean' => "\x{3134}", + 'nieunpansioskorean' => "\x{3168}", + 'nieunparenkorean' => "\x{3201}", + 'nieunsioskorean' => "\x{3167}", + 'nieuntikeutkorean' => "\x{3166}", + 'nihiragana' => "\x{306B}", + 'nikatakana' => "\x{30CB}", + 'nikatakanahalfwidth' => "\x{FF86}", + 'nikhahitleftthai' => "\x{F899}", + 'nikhahitthai' => "\x{0E4D}", + 'ninearabic' => "\x{0669}", + 'ninebengali' => "\x{09EF}", + 'ninecircle' => "\x{2468}", + 'ninecircleinversesansserif' => "\x{2792}", + 'ninedeva' => "\x{096F}", + 'ninegujarati' => "\x{0AEF}", + 'ninegurmukhi' => "\x{0A6F}", + 'ninehackarabic' => "\x{0669}", + 'ninehangzhou' => "\x{3029}", + 'nineideographicparen' => "\x{3228}", + 'nineinferior' => "\x{2089}", + 'ninemonospace' => "\x{FF19}", + 'nineoldstyle' => "\x{F739}", + 'nineparen' => "\x{247C}", + 'nineperiod' => "\x{2490}", + 'ninepersian' => "\x{06F9}", + 'nineroman' => "\x{2178}", + 'ninesuperior' => "\x{2079}", + 'nineteencircle' => "\x{2472}", + 'nineteenparen' => "\x{2486}", + 'nineteenperiod' => "\x{249A}", + 'ninethai' => "\x{0E59}", + 'nj' => "\x{01CC}", + 'njecyrillic' => "\x{045A}", + 'nkatakana' => "\x{30F3}", + 'nkatakanahalfwidth' => "\x{FF9D}", + 'nlegrightlong' => "\x{019E}", + 'nlinebelow' => "\x{1E49}", + 'nmonospace' => "\x{FF4E}", + 'nmsquare' => "\x{339A}", + 'nnabengali' => "\x{09A3}", + 'nnadeva' => "\x{0923}", + 'nnagujarati' => "\x{0AA3}", + 'nnagurmukhi' => "\x{0A23}", + 'nnnadeva' => "\x{0929}", + 'nohiragana' => "\x{306E}", + 'nokatakana' => "\x{30CE}", + 'nokatakanahalfwidth' => "\x{FF89}", + 'nonbreakingspace' => "\x{00A0}", + 'nonenthai' => "\x{0E13}", + 'nonuthai' => "\x{0E19}", + 'noonarabic' => "\x{0646}", + 'noonfinalarabic' => "\x{FEE6}", + 'noonghunnaarabic' => "\x{06BA}", + 'noonghunnafinalarabic' => "\x{FB9F}", + 'noonhehinitialarabic' => "\x{FEE7}\x{FEEC}", + 'nooninitialarabic' => "\x{FEE7}", + 'noonjeeminitialarabic' => "\x{FCD2}", + 'noonjeemisolatedarabic' => "\x{FC4B}", + 'noonmedialarabic' => "\x{FEE8}", + 'noonmeeminitialarabic' => "\x{FCD5}", + 'noonmeemisolatedarabic' => "\x{FC4E}", + 'noonnoonfinalarabic' => "\x{FC8D}", + 'notcontains' => "\x{220C}", + 'notelementof' => "\x{2209}", + 'notgreater' => "\x{226F}", + 'notgreaternorequal' => "\x{2271}", + 'notgreaternorless' => "\x{2279}", + 'notidentical' => "\x{2262}", + 'notless' => "\x{226E}", + 'notlessnorequal' => "\x{2270}", + 'notparallel' => "\x{2226}", + 'notprecedes' => "\x{2280}", + 'notsucceeds' => "\x{2281}", + 'notsuperset' => "\x{2285}", + 'nowarmenian' => "\x{0576}", + 'nparen' => "\x{24A9}", + 'nssquare' => "\x{33B1}", + 'nsuperior' => "\x{207F}", + 'nuhiragana' => "\x{306C}", + 'nukatakana' => "\x{30CC}", + 'nukatakanahalfwidth' => "\x{FF87}", + 'nuktabengali' => "\x{09BC}", + 'nuktadeva' => "\x{093C}", + 'nuktagujarati' => "\x{0ABC}", + 'nuktagurmukhi' => "\x{0A3C}", + 'numbersignmonospace' => "\x{FF03}", + 'numbersignsmall' => "\x{FE5F}", + 'numeralsigngreek' => "\x{0374}", + 'numeralsignlowergreek' => "\x{0375}", + 'numero' => "\x{2116}", + 'nun' => "\x{05E0}", + 'nundagesh' => "\x{FB40}", + 'nundageshhebrew' => "\x{FB40}", + 'nunhebrew' => "\x{05E0}", + 'nvsquare' => "\x{33B5}", + 'nwsquare' => "\x{33BB}", + 'nyabengali' => "\x{099E}", + 'nyadeva' => "\x{091E}", + 'nyagujarati' => "\x{0A9E}", + 'nyagurmukhi' => "\x{0A1E}", + 'oangthai' => "\x{0E2D}", + 'obarred' => "\x{0275}", + 'obarredcyrillic' => "\x{04E9}", + 'obarreddieresiscyrillic' => "\x{04EB}", + 'obengali' => "\x{0993}", + 'obopomofo' => "\x{311B}", + 'ocandradeva' => "\x{0911}", + 'ocandragujarati' => "\x{0A91}", + 'ocandravowelsigndeva' => "\x{0949}", + 'ocandravowelsigngujarati' => "\x{0AC9}", + 'ocaron' => "\x{01D2}", + 'ocircle' => "\x{24DE}", + 'ocircumflexacute' => "\x{1ED1}", + 'ocircumflexdotbelow' => "\x{1ED9}", + 'ocircumflexgrave' => "\x{1ED3}", + 'ocircumflexhookabove' => "\x{1ED5}", + 'ocircumflextilde' => "\x{1ED7}", + 'ocyrillic' => "\x{043E}", + 'odblacute' => "\x{0151}", + 'odblgrave' => "\x{020D}", + 'odeva' => "\x{0913}", + 'odieresiscyrillic' => "\x{04E7}", + 'odotbelow' => "\x{1ECD}", + 'oekorean' => "\x{315A}", + 'ogonekcmb' => "\x{0328}", + 'ogujarati' => "\x{0A93}", + 'oharmenian' => "\x{0585}", + 'ohiragana' => "\x{304A}", + 'ohookabove' => "\x{1ECF}", + 'ohornacute' => "\x{1EDB}", + 'ohorndotbelow' => "\x{1EE3}", + 'ohorngrave' => "\x{1EDD}", + 'ohornhookabove' => "\x{1EDF}", + 'ohorntilde' => "\x{1EE1}", + 'oi' => "\x{01A3}", + 'oinvertedbreve' => "\x{020F}", + 'okatakana' => "\x{30AA}", + 'okatakanahalfwidth' => "\x{FF75}", + 'okorean' => "\x{3157}", + 'olehebrew' => "\x{05AB}", + 'omacronacute' => "\x{1E53}", + 'omacrongrave' => "\x{1E51}", + 'omdeva' => "\x{0950}", + 'omegacyrillic' => "\x{0461}", + 'omegalatinclosed' => "\x{0277}", + 'omegaroundcyrillic' => "\x{047B}", + 'omegatitlocyrillic' => "\x{047D}", + 'omgujarati' => "\x{0AD0}", + 'omonospace' => "\x{FF4F}", + 'onearabic' => "\x{0661}", + 'onebengali' => "\x{09E7}", + 'onecircle' => "\x{2460}", + 'onecircleinversesansserif' => "\x{278A}", + 'onedeva' => "\x{0967}", + 'onefitted' => "\x{F6DC}", + 'onegujarati' => "\x{0AE7}", + 'onegurmukhi' => "\x{0A67}", + 'onehackarabic' => "\x{0661}", + 'onehangzhou' => "\x{3021}", + 'oneideographicparen' => "\x{3220}", + 'oneinferior' => "\x{2081}", + 'onemonospace' => "\x{FF11}", + 'onenumeratorbengali' => "\x{09F4}", + 'oneoldstyle' => "\x{F731}", + 'oneparen' => "\x{2474}", + 'oneperiod' => "\x{2488}", + 'onepersian' => "\x{06F1}", + 'oneroman' => "\x{2170}", + 'onethai' => "\x{0E51}", + 'oogonek' => "\x{01EB}", + 'oogonekmacron' => "\x{01ED}", + 'oogurmukhi' => "\x{0A13}", + 'oomatragurmukhi' => "\x{0A4B}", + 'oopen' => "\x{0254}", + 'oparen' => "\x{24AA}", + 'option' => "\x{2325}", + 'oshortdeva' => "\x{0912}", + 'oshortvowelsigndeva' => "\x{094A}", + 'osmallhiragana' => "\x{3049}", + 'osmallkatakana' => "\x{30A9}", + 'osmallkatakanahalfwidth' => "\x{FF6B}", + 'ostrokeacute' => "\x{01FF}", + 'osuperior' => "\x{F6F0}", + 'otcyrillic' => "\x{047F}", + 'otildeacute' => "\x{1E4D}", + 'otildedieresis' => "\x{1E4F}", + 'oubopomofo' => "\x{3121}", + 'overline' => "\x{203E}", + 'overlinecenterline' => "\x{FE4A}", + 'overlinecmb' => "\x{0305}", + 'overlinedashed' => "\x{FE49}", + 'overlinedblwavy' => "\x{FE4C}", + 'overlinewavy' => "\x{FE4B}", + 'overscore' => "\x{00AF}", + 'ovowelsignbengali' => "\x{09CB}", + 'ovowelsigndeva' => "\x{094B}", + 'ovowelsigngujarati' => "\x{0ACB}", + 'paampssquare' => "\x{3380}", + 'paasentosquare' => "\x{332B}", + 'pabengali' => "\x{09AA}", + 'pacute' => "\x{1E55}", + 'padeva' => "\x{092A}", + 'pagedown' => "\x{21DF}", + 'pageup' => "\x{21DE}", + 'pagujarati' => "\x{0AAA}", + 'pagurmukhi' => "\x{0A2A}", + 'pahiragana' => "\x{3071}", + 'paiyannoithai' => "\x{0E2F}", + 'pakatakana' => "\x{30D1}", + 'palatalizationcyrilliccmb' => "\x{0484}", + 'palochkacyrillic' => "\x{04C0}", + 'pansioskorean' => "\x{317F}", + 'parallel' => "\x{2225}", + 'parenleftaltonearabic' => "\x{FD3E}", + 'parenleftbt' => "\x{F8ED}", + 'parenleftex' => "\x{F8EC}", + 'parenleftinferior' => "\x{208D}", + 'parenleftmonospace' => "\x{FF08}", + 'parenleftsmall' => "\x{FE59}", + 'parenleftsuperior' => "\x{207D}", + 'parenlefttp' => "\x{F8EB}", + 'parenleftvertical' => "\x{FE35}", + 'parenrightaltonearabic' => "\x{FD3F}", + 'parenrightbt' => "\x{F8F8}", + 'parenrightex' => "\x{F8F7}", + 'parenrightinferior' => "\x{208E}", + 'parenrightmonospace' => "\x{FF09}", + 'parenrightsmall' => "\x{FE5A}", + 'parenrightsuperior' => "\x{207E}", + 'parenrighttp' => "\x{F8F6}", + 'parenrightvertical' => "\x{FE36}", + 'paseqhebrew' => "\x{05C0}", + 'pashtahebrew' => "\x{0599}", + 'pasquare' => "\x{33A9}", + 'patah' => "\x{05B7}", + 'patah11' => "\x{05B7}", + 'patah1d' => "\x{05B7}", + 'patah2a' => "\x{05B7}", + 'patahhebrew' => "\x{05B7}", + 'patahnarrowhebrew' => "\x{05B7}", + 'patahquarterhebrew' => "\x{05B7}", + 'patahwidehebrew' => "\x{05B7}", + 'pazerhebrew' => "\x{05A1}", + 'pbopomofo' => "\x{3106}", + 'pcircle' => "\x{24DF}", + 'pdotaccent' => "\x{1E57}", + 'pe' => "\x{05E4}", + 'pecyrillic' => "\x{043F}", + 'pedagesh' => "\x{FB44}", + 'pedageshhebrew' => "\x{FB44}", + 'peezisquare' => "\x{333B}", + 'pefinaldageshhebrew' => "\x{FB43}", + 'peharabic' => "\x{067E}", + 'peharmenian' => "\x{057A}", + 'pehebrew' => "\x{05E4}", + 'pehfinalarabic' => "\x{FB57}", + 'pehinitialarabic' => "\x{FB58}", + 'pehiragana' => "\x{307A}", + 'pehmedialarabic' => "\x{FB59}", + 'pekatakana' => "\x{30DA}", + 'pemiddlehookcyrillic' => "\x{04A7}", + 'perafehebrew' => "\x{FB4E}", + 'percentarabic' => "\x{066A}", + 'percentmonospace' => "\x{FF05}", + 'percentsmall' => "\x{FE6A}", + 'periodarmenian' => "\x{0589}", + 'periodhalfwidth' => "\x{FF61}", + 'periodinferior' => "\x{F6E7}", + 'periodmonospace' => "\x{FF0E}", + 'periodsmall' => "\x{FE52}", + 'periodsuperior' => "\x{F6E8}", + 'perispomenigreekcmb' => "\x{0342}", + 'pfsquare' => "\x{338A}", + 'phabengali' => "\x{09AB}", + 'phadeva' => "\x{092B}", + 'phagujarati' => "\x{0AAB}", + 'phagurmukhi' => "\x{0A2B}", + 'phieuphacirclekorean' => "\x{327A}", + 'phieuphaparenkorean' => "\x{321A}", + 'phieuphcirclekorean' => "\x{326C}", + 'phieuphkorean' => "\x{314D}", + 'phieuphparenkorean' => "\x{320C}", + 'philatin' => "\x{0278}", + 'phinthuthai' => "\x{0E3A}", + 'phisymbolgreek' => "\x{03D5}", + 'phook' => "\x{01A5}", + 'phophanthai' => "\x{0E1E}", + 'phophungthai' => "\x{0E1C}", + 'phosamphaothai' => "\x{0E20}", + 'pieupacirclekorean' => "\x{3273}", + 'pieupaparenkorean' => "\x{3213}", + 'pieupcieuckorean' => "\x{3176}", + 'pieupcirclekorean' => "\x{3265}", + 'pieupkiyeokkorean' => "\x{3172}", + 'pieupkorean' => "\x{3142}", + 'pieupparenkorean' => "\x{3205}", + 'pieupsioskiyeokkorean' => "\x{3174}", + 'pieupsioskorean' => "\x{3144}", + 'pieupsiostikeutkorean' => "\x{3175}", + 'pieupthieuthkorean' => "\x{3177}", + 'pieuptikeutkorean' => "\x{3173}", + 'pihiragana' => "\x{3074}", + 'pikatakana' => "\x{30D4}", + 'pisymbolgreek' => "\x{03D6}", + 'piwrarmenian' => "\x{0583}", + 'plusbelowcmb' => "\x{031F}", + 'pluscircle' => "\x{2295}", + 'plusmod' => "\x{02D6}", + 'plusmonospace' => "\x{FF0B}", + 'plussmall' => "\x{FE62}", + 'plussuperior' => "\x{207A}", + 'pmonospace' => "\x{FF50}", + 'pmsquare' => "\x{33D8}", + 'pohiragana' => "\x{307D}", + 'pointingindexdownwhite' => "\x{261F}", + 'pointingindexleftwhite' => "\x{261C}", + 'pointingindexrightwhite' => "\x{261E}", + 'pointingindexupwhite' => "\x{261D}", + 'pokatakana' => "\x{30DD}", + 'poplathai' => "\x{0E1B}", + 'postalmark' => "\x{3012}", + 'postalmarkface' => "\x{3020}", + 'pparen' => "\x{24AB}", + 'precedes' => "\x{227A}", + 'primemod' => "\x{02B9}", + 'primereversed' => "\x{2035}", + 'projective' => "\x{2305}", + 'prolongedkana' => "\x{30FC}", + 'propellor' => "\x{2318}", + 'proportion' => "\x{2237}", + 'psicyrillic' => "\x{0471}", + 'psilipneumatacyrilliccmb' => "\x{0486}", + 'pssquare' => "\x{33B0}", + 'puhiragana' => "\x{3077}", + 'pukatakana' => "\x{30D7}", + 'pvsquare' => "\x{33B4}", + 'pwsquare' => "\x{33BA}", + 'qadeva' => "\x{0958}", + 'qadmahebrew' => "\x{05A8}", + 'qafarabic' => "\x{0642}", + 'qaffinalarabic' => "\x{FED6}", + 'qafinitialarabic' => "\x{FED7}", + 'qafmedialarabic' => "\x{FED8}", + 'qamats' => "\x{05B8}", + 'qamats10' => "\x{05B8}", + 'qamats1a' => "\x{05B8}", + 'qamats1c' => "\x{05B8}", + 'qamats27' => "\x{05B8}", + 'qamats29' => "\x{05B8}", + 'qamats33' => "\x{05B8}", + 'qamatsde' => "\x{05B8}", + 'qamatshebrew' => "\x{05B8}", + 'qamatsnarrowhebrew' => "\x{05B8}", + 'qamatsqatanhebrew' => "\x{05B8}", + 'qamatsqatannarrowhebrew' => "\x{05B8}", + 'qamatsqatanquarterhebrew' => "\x{05B8}", + 'qamatsqatanwidehebrew' => "\x{05B8}", + 'qamatsquarterhebrew' => "\x{05B8}", + 'qamatswidehebrew' => "\x{05B8}", + 'qarneyparahebrew' => "\x{059F}", + 'qbopomofo' => "\x{3111}", + 'qcircle' => "\x{24E0}", + 'qhook' => "\x{02A0}", + 'qmonospace' => "\x{FF51}", + 'qof' => "\x{05E7}", + 'qofdagesh' => "\x{FB47}", + 'qofdageshhebrew' => "\x{FB47}", + 'qofhatafpatah' => "\x{05E7}\x{05B2}", + 'qofhatafpatahhebrew' => "\x{05E7}\x{05B2}", + 'qofhatafsegol' => "\x{05E7}\x{05B1}", + 'qofhatafsegolhebrew' => "\x{05E7}\x{05B1}", + 'qofhebrew' => "\x{05E7}", + 'qofhiriq' => "\x{05E7}\x{05B4}", + 'qofhiriqhebrew' => "\x{05E7}\x{05B4}", + 'qofholam' => "\x{05E7}\x{05B9}", + 'qofholamhebrew' => "\x{05E7}\x{05B9}", + 'qofpatah' => "\x{05E7}\x{05B7}", + 'qofpatahhebrew' => "\x{05E7}\x{05B7}", + 'qofqamats' => "\x{05E7}\x{05B8}", + 'qofqamatshebrew' => "\x{05E7}\x{05B8}", + 'qofqubuts' => "\x{05E7}\x{05BB}", + 'qofqubutshebrew' => "\x{05E7}\x{05BB}", + 'qofsegol' => "\x{05E7}\x{05B6}", + 'qofsegolhebrew' => "\x{05E7}\x{05B6}", + 'qofsheva' => "\x{05E7}\x{05B0}", + 'qofshevahebrew' => "\x{05E7}\x{05B0}", + 'qoftsere' => "\x{05E7}\x{05B5}", + 'qoftserehebrew' => "\x{05E7}\x{05B5}", + 'qparen' => "\x{24AC}", + 'quarternote' => "\x{2669}", + 'qubuts' => "\x{05BB}", + 'qubuts18' => "\x{05BB}", + 'qubuts25' => "\x{05BB}", + 'qubuts31' => "\x{05BB}", + 'qubutshebrew' => "\x{05BB}", + 'qubutsnarrowhebrew' => "\x{05BB}", + 'qubutsquarterhebrew' => "\x{05BB}", + 'qubutswidehebrew' => "\x{05BB}", + 'questionarabic' => "\x{061F}", + 'questionarmenian' => "\x{055E}", + 'questiondownsmall' => "\x{F7BF}", + 'questiongreek' => "\x{037E}", + 'questionmonospace' => "\x{FF1F}", + 'questionsmall' => "\x{F73F}", + 'quotedblmonospace' => "\x{FF02}", + 'quotedblprime' => "\x{301E}", + 'quotedblprimereversed' => "\x{301D}", + 'quoteleftreversed' => "\x{201B}", + 'quoterightn' => "\x{0149}", + 'quotesinglemonospace' => "\x{FF07}", + 'raarmenian' => "\x{057C}", + 'rabengali' => "\x{09B0}", + 'radeva' => "\x{0930}", + 'radicalex' => "\x{F8E5}", + 'radoverssquare' => "\x{33AE}", + 'radoverssquaredsquare' => "\x{33AF}", + 'radsquare' => "\x{33AD}", + 'rafe' => "\x{05BF}", + 'rafehebrew' => "\x{05BF}", + 'ragujarati' => "\x{0AB0}", + 'ragurmukhi' => "\x{0A30}", + 'rahiragana' => "\x{3089}", + 'rakatakana' => "\x{30E9}", + 'rakatakanahalfwidth' => "\x{FF97}", + 'ralowerdiagonalbengali' => "\x{09F1}", + 'ramiddlediagonalbengali' => "\x{09F0}", + 'ramshorn' => "\x{0264}", + 'ratio' => "\x{2236}", + 'rbopomofo' => "\x{3116}", + 'rcedilla' => "\x{0157}", + 'rcircle' => "\x{24E1}", + 'rdblgrave' => "\x{0211}", + 'rdotaccent' => "\x{1E59}", + 'rdotbelow' => "\x{1E5B}", + 'rdotbelowmacron' => "\x{1E5D}", + 'referencemark' => "\x{203B}", + 'registersans' => "\x{F8E8}", + 'registerserif' => "\x{F6DA}", + 'reharabic' => "\x{0631}", + 'reharmenian' => "\x{0580}", + 'rehfinalarabic' => "\x{FEAE}", + 'rehiragana' => "\x{308C}", + 'rehyehaleflamarabic' => "\x{0631}\x{FEF3}\x{FE8E}\x{0644}", + 'rekatakana' => "\x{30EC}", + 'rekatakanahalfwidth' => "\x{FF9A}", + 'resh' => "\x{05E8}", + 'reshdageshhebrew' => "\x{FB48}", + 'reshhatafpatah' => "\x{05E8}\x{05B2}", + 'reshhatafpatahhebrew' => "\x{05E8}\x{05B2}", + 'reshhatafsegol' => "\x{05E8}\x{05B1}", + 'reshhatafsegolhebrew' => "\x{05E8}\x{05B1}", + 'reshhebrew' => "\x{05E8}", + 'reshhiriq' => "\x{05E8}\x{05B4}", + 'reshhiriqhebrew' => "\x{05E8}\x{05B4}", + 'reshholam' => "\x{05E8}\x{05B9}", + 'reshholamhebrew' => "\x{05E8}\x{05B9}", + 'reshpatah' => "\x{05E8}\x{05B7}", + 'reshpatahhebrew' => "\x{05E8}\x{05B7}", + 'reshqamats' => "\x{05E8}\x{05B8}", + 'reshqamatshebrew' => "\x{05E8}\x{05B8}", + 'reshqubuts' => "\x{05E8}\x{05BB}", + 'reshqubutshebrew' => "\x{05E8}\x{05BB}", + 'reshsegol' => "\x{05E8}\x{05B6}", + 'reshsegolhebrew' => "\x{05E8}\x{05B6}", + 'reshsheva' => "\x{05E8}\x{05B0}", + 'reshshevahebrew' => "\x{05E8}\x{05B0}", + 'reshtsere' => "\x{05E8}\x{05B5}", + 'reshtserehebrew' => "\x{05E8}\x{05B5}", + 'reversedtilde' => "\x{223D}", + 'reviahebrew' => "\x{0597}", + 'reviamugrashhebrew' => "\x{0597}", + 'rfishhook' => "\x{027E}", + 'rfishhookreversed' => "\x{027F}", + 'rhabengali' => "\x{09DD}", + 'rhadeva' => "\x{095D}", + 'rhook' => "\x{027D}", + 'rhookturned' => "\x{027B}", + 'rhookturnedsuperior' => "\x{02B5}", + 'rhosymbolgreek' => "\x{03F1}", + 'rhotichookmod' => "\x{02DE}", + 'rieulacirclekorean' => "\x{3271}", + 'rieulaparenkorean' => "\x{3211}", + 'rieulcirclekorean' => "\x{3263}", + 'rieulhieuhkorean' => "\x{3140}", + 'rieulkiyeokkorean' => "\x{313A}", + 'rieulkiyeoksioskorean' => "\x{3169}", + 'rieulkorean' => "\x{3139}", + 'rieulmieumkorean' => "\x{313B}", + 'rieulpansioskorean' => "\x{316C}", + 'rieulparenkorean' => "\x{3203}", + 'rieulphieuphkorean' => "\x{313F}", + 'rieulpieupkorean' => "\x{313C}", + 'rieulpieupsioskorean' => "\x{316B}", + 'rieulsioskorean' => "\x{313D}", + 'rieulthieuthkorean' => "\x{313E}", + 'rieultikeutkorean' => "\x{316A}", + 'rieulyeorinhieuhkorean' => "\x{316D}", + 'rightangle' => "\x{221F}", + 'righttackbelowcmb' => "\x{0319}", + 'righttriangle' => "\x{22BF}", + 'rihiragana' => "\x{308A}", + 'rikatakana' => "\x{30EA}", + 'rikatakanahalfwidth' => "\x{FF98}", + 'ringbelowcmb' => "\x{0325}", + 'ringcmb' => "\x{030A}", + 'ringhalfleft' => "\x{02BF}", + 'ringhalfleftarmenian' => "\x{0559}", + 'ringhalfleftbelowcmb' => "\x{031C}", + 'ringhalfleftcentered' => "\x{02D3}", + 'ringhalfright' => "\x{02BE}", + 'ringhalfrightbelowcmb' => "\x{0339}", + 'ringhalfrightcentered' => "\x{02D2}", + 'rinvertedbreve' => "\x{0213}", + 'rittorusquare' => "\x{3351}", + 'rlinebelow' => "\x{1E5F}", + 'rlongleg' => "\x{027C}", + 'rlonglegturned' => "\x{027A}", + 'rmonospace' => "\x{FF52}", + 'rohiragana' => "\x{308D}", + 'rokatakana' => "\x{30ED}", + 'rokatakanahalfwidth' => "\x{FF9B}", + 'roruathai' => "\x{0E23}", + 'rparen' => "\x{24AD}", + 'rrabengali' => "\x{09DC}", + 'rradeva' => "\x{0931}", + 'rragurmukhi' => "\x{0A5C}", + 'rreharabic' => "\x{0691}", + 'rrehfinalarabic' => "\x{FB8D}", + 'rrvocalicbengali' => "\x{09E0}", + 'rrvocalicdeva' => "\x{0960}", + 'rrvocalicgujarati' => "\x{0AE0}", + 'rrvocalicvowelsignbengali' => "\x{09C4}", + 'rrvocalicvowelsigndeva' => "\x{0944}", + 'rrvocalicvowelsigngujarati' => "\x{0AC4}", + 'rsuperior' => "\x{F6F1}", + 'rturned' => "\x{0279}", + 'rturnedsuperior' => "\x{02B4}", + 'ruhiragana' => "\x{308B}", + 'rukatakana' => "\x{30EB}", + 'rukatakanahalfwidth' => "\x{FF99}", + 'rupeemarkbengali' => "\x{09F2}", + 'rupeesignbengali' => "\x{09F3}", + 'rupiah' => "\x{F6DD}", + 'ruthai' => "\x{0E24}", + 'rvocalicbengali' => "\x{098B}", + 'rvocalicdeva' => "\x{090B}", + 'rvocalicgujarati' => "\x{0A8B}", + 'rvocalicvowelsignbengali' => "\x{09C3}", + 'rvocalicvowelsigndeva' => "\x{0943}", + 'rvocalicvowelsigngujarati' => "\x{0AC3}", + 'sabengali' => "\x{09B8}", + 'sacutedotaccent' => "\x{1E65}", + 'sadarabic' => "\x{0635}", + 'sadeva' => "\x{0938}", + 'sadfinalarabic' => "\x{FEBA}", + 'sadinitialarabic' => "\x{FEBB}", + 'sadmedialarabic' => "\x{FEBC}", + 'sagujarati' => "\x{0AB8}", + 'sagurmukhi' => "\x{0A38}", + 'sahiragana' => "\x{3055}", + 'sakatakana' => "\x{30B5}", + 'sakatakanahalfwidth' => "\x{FF7B}", + 'sallallahoualayhewasallamarabic' => "\x{FDFA}", + 'samekh' => "\x{05E1}", + 'samekhdagesh' => "\x{FB41}", + 'samekhdageshhebrew' => "\x{FB41}", + 'samekhhebrew' => "\x{05E1}", + 'saraaathai' => "\x{0E32}", + 'saraaethai' => "\x{0E41}", + 'saraaimaimalaithai' => "\x{0E44}", + 'saraaimaimuanthai' => "\x{0E43}", + 'saraamthai' => "\x{0E33}", + 'saraathai' => "\x{0E30}", + 'saraethai' => "\x{0E40}", + 'saraiileftthai' => "\x{F886}", + 'saraiithai' => "\x{0E35}", + 'saraileftthai' => "\x{F885}", + 'saraithai' => "\x{0E34}", + 'saraothai' => "\x{0E42}", + 'saraueeleftthai' => "\x{F888}", + 'saraueethai' => "\x{0E37}", + 'saraueleftthai' => "\x{F887}", + 'sarauethai' => "\x{0E36}", + 'sarauthai' => "\x{0E38}", + 'sarauuthai' => "\x{0E39}", + 'sbopomofo' => "\x{3119}", + 'scarondotaccent' => "\x{1E67}", + 'schwa' => "\x{0259}", + 'schwacyrillic' => "\x{04D9}", + 'schwadieresiscyrillic' => "\x{04DB}", + 'schwahook' => "\x{025A}", + 'scircle' => "\x{24E2}", + 'sdotaccent' => "\x{1E61}", + 'sdotbelow' => "\x{1E63}", + 'sdotbelowdotaccent' => "\x{1E69}", + 'seagullbelowcmb' => "\x{033C}", + 'secondtonechinese' => "\x{02CA}", + 'seenarabic' => "\x{0633}", + 'seenfinalarabic' => "\x{FEB2}", + 'seeninitialarabic' => "\x{FEB3}", + 'seenmedialarabic' => "\x{FEB4}", + 'segol' => "\x{05B6}", + 'segol13' => "\x{05B6}", + 'segol1f' => "\x{05B6}", + 'segol2c' => "\x{05B6}", + 'segolhebrew' => "\x{05B6}", + 'segolnarrowhebrew' => "\x{05B6}", + 'segolquarterhebrew' => "\x{05B6}", + 'segoltahebrew' => "\x{0592}", + 'segolwidehebrew' => "\x{05B6}", + 'seharmenian' => "\x{057D}", + 'sehiragana' => "\x{305B}", + 'sekatakana' => "\x{30BB}", + 'sekatakanahalfwidth' => "\x{FF7E}", + 'semicolonarabic' => "\x{061B}", + 'semicolonmonospace' => "\x{FF1B}", + 'semicolonsmall' => "\x{FE54}", + 'semivoicedmarkkana' => "\x{309C}", + 'semivoicedmarkkanahalfwidth' => "\x{FF9F}", + 'sentisquare' => "\x{3322}", + 'sentosquare' => "\x{3323}", + 'sevenarabic' => "\x{0667}", + 'sevenbengali' => "\x{09ED}", + 'sevencircle' => "\x{2466}", + 'sevencircleinversesansserif' => "\x{2790}", + 'sevendeva' => "\x{096D}", + 'sevengujarati' => "\x{0AED}", + 'sevengurmukhi' => "\x{0A6D}", + 'sevenhackarabic' => "\x{0667}", + 'sevenhangzhou' => "\x{3027}", + 'sevenideographicparen' => "\x{3226}", + 'seveninferior' => "\x{2087}", + 'sevenmonospace' => "\x{FF17}", + 'sevenoldstyle' => "\x{F737}", + 'sevenparen' => "\x{247A}", + 'sevenperiod' => "\x{248E}", + 'sevenpersian' => "\x{06F7}", + 'sevenroman' => "\x{2176}", + 'sevensuperior' => "\x{2077}", + 'seventeencircle' => "\x{2470}", + 'seventeenparen' => "\x{2484}", + 'seventeenperiod' => "\x{2498}", + 'seventhai' => "\x{0E57}", + 'sfthyphen' => "\x{00AD}", + 'shaarmenian' => "\x{0577}", + 'shabengali' => "\x{09B6}", + 'shacyrillic' => "\x{0448}", + 'shaddaarabic' => "\x{0651}", + 'shaddadammaarabic' => "\x{FC61}", + 'shaddadammatanarabic' => "\x{FC5E}", + 'shaddafathaarabic' => "\x{FC60}", + 'shaddafathatanarabic' => "\x{0651}\x{064B}", + 'shaddakasraarabic' => "\x{FC62}", + 'shaddakasratanarabic' => "\x{FC5F}", + 'shadedark' => "\x{2593}", + 'shadelight' => "\x{2591}", + 'shademedium' => "\x{2592}", + 'shadeva' => "\x{0936}", + 'shagujarati' => "\x{0AB6}", + 'shagurmukhi' => "\x{0A36}", + 'shalshelethebrew' => "\x{0593}", + 'shbopomofo' => "\x{3115}", + 'shchacyrillic' => "\x{0449}", + 'sheenarabic' => "\x{0634}", + 'sheenfinalarabic' => "\x{FEB6}", + 'sheeninitialarabic' => "\x{FEB7}", + 'sheenmedialarabic' => "\x{FEB8}", + 'sheicoptic' => "\x{03E3}", + 'sheqel' => "\x{20AA}", + 'sheqelhebrew' => "\x{20AA}", + 'sheva' => "\x{05B0}", + 'sheva115' => "\x{05B0}", + 'sheva15' => "\x{05B0}", + 'sheva22' => "\x{05B0}", + 'sheva2e' => "\x{05B0}", + 'shevahebrew' => "\x{05B0}", + 'shevanarrowhebrew' => "\x{05B0}", + 'shevaquarterhebrew' => "\x{05B0}", + 'shevawidehebrew' => "\x{05B0}", + 'shhacyrillic' => "\x{04BB}", + 'shimacoptic' => "\x{03ED}", + 'shin' => "\x{05E9}", + 'shindagesh' => "\x{FB49}", + 'shindageshhebrew' => "\x{FB49}", + 'shindageshshindot' => "\x{FB2C}", + 'shindageshshindothebrew' => "\x{FB2C}", + 'shindageshsindot' => "\x{FB2D}", + 'shindageshsindothebrew' => "\x{FB2D}", + 'shindothebrew' => "\x{05C1}", + 'shinhebrew' => "\x{05E9}", + 'shinshindot' => "\x{FB2A}", + 'shinshindothebrew' => "\x{FB2A}", + 'shinsindot' => "\x{FB2B}", + 'shinsindothebrew' => "\x{FB2B}", + 'shook' => "\x{0282}", + 'sigmafinal' => "\x{03C2}", + 'sigmalunatesymbolgreek' => "\x{03F2}", + 'sihiragana' => "\x{3057}", + 'sikatakana' => "\x{30B7}", + 'sikatakanahalfwidth' => "\x{FF7C}", + 'siluqhebrew' => "\x{05BD}", + 'siluqlefthebrew' => "\x{05BD}", + 'sindothebrew' => "\x{05C2}", + 'siosacirclekorean' => "\x{3274}", + 'siosaparenkorean' => "\x{3214}", + 'sioscieuckorean' => "\x{317E}", + 'sioscirclekorean' => "\x{3266}", + 'sioskiyeokkorean' => "\x{317A}", + 'sioskorean' => "\x{3145}", + 'siosnieunkorean' => "\x{317B}", + 'siosparenkorean' => "\x{3206}", + 'siospieupkorean' => "\x{317D}", + 'siostikeutkorean' => "\x{317C}", + 'sixarabic' => "\x{0666}", + 'sixbengali' => "\x{09EC}", + 'sixcircle' => "\x{2465}", + 'sixcircleinversesansserif' => "\x{278F}", + 'sixdeva' => "\x{096C}", + 'sixgujarati' => "\x{0AEC}", + 'sixgurmukhi' => "\x{0A6C}", + 'sixhackarabic' => "\x{0666}", + 'sixhangzhou' => "\x{3026}", + 'sixideographicparen' => "\x{3225}", + 'sixinferior' => "\x{2086}", + 'sixmonospace' => "\x{FF16}", + 'sixoldstyle' => "\x{F736}", + 'sixparen' => "\x{2479}", + 'sixperiod' => "\x{248D}", + 'sixpersian' => "\x{06F6}", + 'sixroman' => "\x{2175}", + 'sixsuperior' => "\x{2076}", + 'sixteencircle' => "\x{246F}", + 'sixteencurrencydenominatorbengali' => "\x{09F9}", + 'sixteenparen' => "\x{2483}", + 'sixteenperiod' => "\x{2497}", + 'sixthai' => "\x{0E56}", + 'slashmonospace' => "\x{FF0F}", + 'slong' => "\x{017F}", + 'slongdotaccent' => "\x{1E9B}", + 'smonospace' => "\x{FF53}", + 'sofpasuqhebrew' => "\x{05C3}", + 'softhyphen' => "\x{00AD}", + 'softsigncyrillic' => "\x{044C}", + 'sohiragana' => "\x{305D}", + 'sokatakana' => "\x{30BD}", + 'sokatakanahalfwidth' => "\x{FF7F}", + 'soliduslongoverlaycmb' => "\x{0338}", + 'solidusshortoverlaycmb' => "\x{0337}", + 'sorusithai' => "\x{0E29}", + 'sosalathai' => "\x{0E28}", + 'sosothai' => "\x{0E0B}", + 'sosuathai' => "\x{0E2A}", + 'spacehackarabic' => "\x{0020}", + 'spadesuitblack' => "\x{2660}", + 'spadesuitwhite' => "\x{2664}", + 'sparen' => "\x{24AE}", + 'squarebelowcmb' => "\x{033B}", + 'squarecc' => "\x{33C4}", + 'squarecm' => "\x{339D}", + 'squarediagonalcrosshatchfill' => "\x{25A9}", + 'squarehorizontalfill' => "\x{25A4}", + 'squarekg' => "\x{338F}", + 'squarekm' => "\x{339E}", + 'squarekmcapital' => "\x{33CE}", + 'squareln' => "\x{33D1}", + 'squarelog' => "\x{33D2}", + 'squaremg' => "\x{338E}", + 'squaremil' => "\x{33D5}", + 'squaremm' => "\x{339C}", + 'squaremsquared' => "\x{33A1}", + 'squareorthogonalcrosshatchfill' => "\x{25A6}", + 'squareupperlefttolowerrightfill' => "\x{25A7}", + 'squareupperrighttolowerleftfill' => "\x{25A8}", + 'squareverticalfill' => "\x{25A5}", + 'squarewhitewithsmallblack' => "\x{25A3}", + 'srsquare' => "\x{33DB}", + 'ssabengali' => "\x{09B7}", + 'ssadeva' => "\x{0937}", + 'ssagujarati' => "\x{0AB7}", + 'ssangcieuckorean' => "\x{3149}", + 'ssanghieuhkorean' => "\x{3185}", + 'ssangieungkorean' => "\x{3180}", + 'ssangkiyeokkorean' => "\x{3132}", + 'ssangnieunkorean' => "\x{3165}", + 'ssangpieupkorean' => "\x{3143}", + 'ssangsioskorean' => "\x{3146}", + 'ssangtikeutkorean' => "\x{3138}", + 'ssuperior' => "\x{F6F2}", + 'sterlingmonospace' => "\x{FFE1}", + 'strokelongoverlaycmb' => "\x{0336}", + 'strokeshortoverlaycmb' => "\x{0335}", + 'subset' => "\x{2282}", + 'subsetnotequal' => "\x{228A}", + 'subsetorequal' => "\x{2286}", + 'succeeds' => "\x{227B}", + 'suhiragana' => "\x{3059}", + 'sukatakana' => "\x{30B9}", + 'sukatakanahalfwidth' => "\x{FF7D}", + 'sukunarabic' => "\x{0652}", + 'superset' => "\x{2283}", + 'supersetnotequal' => "\x{228B}", + 'supersetorequal' => "\x{2287}", + 'svsquare' => "\x{33DC}", + 'syouwaerasquare' => "\x{337C}", + 'tabengali' => "\x{09A4}", + 'tackdown' => "\x{22A4}", + 'tackleft' => "\x{22A3}", + 'tadeva' => "\x{0924}", + 'tagujarati' => "\x{0AA4}", + 'tagurmukhi' => "\x{0A24}", + 'taharabic' => "\x{0637}", + 'tahfinalarabic' => "\x{FEC2}", + 'tahinitialarabic' => "\x{FEC3}", + 'tahiragana' => "\x{305F}", + 'tahmedialarabic' => "\x{FEC4}", + 'taisyouerasquare' => "\x{337D}", + 'takatakana' => "\x{30BF}", + 'takatakanahalfwidth' => "\x{FF80}", + 'tatweelarabic' => "\x{0640}", + 'tav' => "\x{05EA}", + 'tavdages' => "\x{FB4A}", + 'tavdagesh' => "\x{FB4A}", + 'tavdageshhebrew' => "\x{FB4A}", + 'tavhebrew' => "\x{05EA}", + 'tbopomofo' => "\x{310A}", + 'tccurl' => "\x{02A8}", + 'tcedilla' => "\x{0163}", + 'tcheharabic' => "\x{0686}", + 'tchehfinalarabic' => "\x{FB7B}", + 'tchehinitialarabic' => "\x{FB7C}", + 'tchehmedialarabic' => "\x{FB7D}", + 'tchehmeeminitialarabic' => "\x{FB7C}\x{FEE4}", + 'tcircle' => "\x{24E3}", + 'tcircumflexbelow' => "\x{1E71}", + 'tdieresis' => "\x{1E97}", + 'tdotaccent' => "\x{1E6B}", + 'tdotbelow' => "\x{1E6D}", + 'tecyrillic' => "\x{0442}", + 'tedescendercyrillic' => "\x{04AD}", + 'teharabic' => "\x{062A}", + 'tehfinalarabic' => "\x{FE96}", + 'tehhahinitialarabic' => "\x{FCA2}", + 'tehhahisolatedarabic' => "\x{FC0C}", + 'tehinitialarabic' => "\x{FE97}", + 'tehiragana' => "\x{3066}", + 'tehjeeminitialarabic' => "\x{FCA1}", + 'tehjeemisolatedarabic' => "\x{FC0B}", + 'tehmarbutaarabic' => "\x{0629}", + 'tehmarbutafinalarabic' => "\x{FE94}", + 'tehmedialarabic' => "\x{FE98}", + 'tehmeeminitialarabic' => "\x{FCA4}", + 'tehmeemisolatedarabic' => "\x{FC0E}", + 'tehnoonfinalarabic' => "\x{FC73}", + 'tekatakana' => "\x{30C6}", + 'tekatakanahalfwidth' => "\x{FF83}", + 'telephone' => "\x{2121}", + 'telephoneblack' => "\x{260E}", + 'telishagedolahebrew' => "\x{05A0}", + 'telishaqetanahebrew' => "\x{05A9}", + 'tencircle' => "\x{2469}", + 'tenideographicparen' => "\x{3229}", + 'tenparen' => "\x{247D}", + 'tenperiod' => "\x{2491}", + 'tenroman' => "\x{2179}", + 'tesh' => "\x{02A7}", + 'tet' => "\x{05D8}", + 'tetdagesh' => "\x{FB38}", + 'tetdageshhebrew' => "\x{FB38}", + 'tethebrew' => "\x{05D8}", + 'tetsecyrillic' => "\x{04B5}", + 'tevirhebrew' => "\x{059B}", + 'tevirlefthebrew' => "\x{059B}", + 'thabengali' => "\x{09A5}", + 'thadeva' => "\x{0925}", + 'thagujarati' => "\x{0AA5}", + 'thagurmukhi' => "\x{0A25}", + 'thalarabic' => "\x{0630}", + 'thalfinalarabic' => "\x{FEAC}", + 'thanthakhatlowleftthai' => "\x{F898}", + 'thanthakhatlowrightthai' => "\x{F897}", + 'thanthakhatthai' => "\x{0E4C}", + 'thanthakhatupperleftthai' => "\x{F896}", + 'theharabic' => "\x{062B}", + 'thehfinalarabic' => "\x{FE9A}", + 'thehinitialarabic' => "\x{FE9B}", + 'thehmedialarabic' => "\x{FE9C}", + 'thereexists' => "\x{2203}", + 'thetasymbolgreek' => "\x{03D1}", + 'thieuthacirclekorean' => "\x{3279}", + 'thieuthaparenkorean' => "\x{3219}", + 'thieuthcirclekorean' => "\x{326B}", + 'thieuthkorean' => "\x{314C}", + 'thieuthparenkorean' => "\x{320B}", + 'thirteencircle' => "\x{246C}", + 'thirteenparen' => "\x{2480}", + 'thirteenperiod' => "\x{2494}", + 'thonangmonthothai' => "\x{0E11}", + 'thook' => "\x{01AD}", + 'thophuthaothai' => "\x{0E12}", + 'thothahanthai' => "\x{0E17}", + 'thothanthai' => "\x{0E10}", + 'thothongthai' => "\x{0E18}", + 'thothungthai' => "\x{0E16}", + 'thousandcyrillic' => "\x{0482}", + 'thousandsseparatorarabic' => "\x{066C}", + 'thousandsseparatorpersian' => "\x{066C}", + 'threearabic' => "\x{0663}", + 'threebengali' => "\x{09E9}", + 'threecircle' => "\x{2462}", + 'threecircleinversesansserif' => "\x{278C}", + 'threedeva' => "\x{0969}", + 'threegujarati' => "\x{0AE9}", + 'threegurmukhi' => "\x{0A69}", + 'threehackarabic' => "\x{0663}", + 'threehangzhou' => "\x{3023}", + 'threeideographicparen' => "\x{3222}", + 'threeinferior' => "\x{2083}", + 'threemonospace' => "\x{FF13}", + 'threenumeratorbengali' => "\x{09F6}", + 'threeoldstyle' => "\x{F733}", + 'threeparen' => "\x{2476}", + 'threeperiod' => "\x{248A}", + 'threepersian' => "\x{06F3}", + 'threequartersemdash' => "\x{F6DE}", + 'threeroman' => "\x{2172}", + 'threethai' => "\x{0E53}", + 'thzsquare' => "\x{3394}", + 'tihiragana' => "\x{3061}", + 'tikatakana' => "\x{30C1}", + 'tikatakanahalfwidth' => "\x{FF81}", + 'tikeutacirclekorean' => "\x{3270}", + 'tikeutaparenkorean' => "\x{3210}", + 'tikeutcirclekorean' => "\x{3262}", + 'tikeutkorean' => "\x{3137}", + 'tikeutparenkorean' => "\x{3202}", + 'tildebelowcmb' => "\x{0330}", + 'tildecmb' => "\x{0303}", + 'tildedoublecmb' => "\x{0360}", + 'tildeoperator' => "\x{223C}", + 'tildeoverlaycmb' => "\x{0334}", + 'tildeverticalcmb' => "\x{033E}", + 'timescircle' => "\x{2297}", + 'tipehahebrew' => "\x{0596}", + 'tipehalefthebrew' => "\x{0596}", + 'tippigurmukhi' => "\x{0A70}", + 'titlocyrilliccmb' => "\x{0483}", + 'tiwnarmenian' => "\x{057F}", + 'tlinebelow' => "\x{1E6F}", + 'tmonospace' => "\x{FF54}", + 'toarmenian' => "\x{0569}", + 'tohiragana' => "\x{3068}", + 'tokatakana' => "\x{30C8}", + 'tokatakanahalfwidth' => "\x{FF84}", + 'tonebarextrahighmod' => "\x{02E5}", + 'tonebarextralowmod' => "\x{02E9}", + 'tonebarhighmod' => "\x{02E6}", + 'tonebarlowmod' => "\x{02E8}", + 'tonebarmidmod' => "\x{02E7}", + 'tonefive' => "\x{01BD}", + 'tonesix' => "\x{0185}", + 'tonetwo' => "\x{01A8}", + 'tonsquare' => "\x{3327}", + 'topatakthai' => "\x{0E0F}", + 'tortoiseshellbracketleft' => "\x{3014}", + 'tortoiseshellbracketleftsmall' => "\x{FE5D}", + 'tortoiseshellbracketleftvertical' => "\x{FE39}", + 'tortoiseshellbracketright' => "\x{3015}", + 'tortoiseshellbracketrightsmall' => "\x{FE5E}", + 'tortoiseshellbracketrightvertical' => "\x{FE3A}", + 'totaothai' => "\x{0E15}", + 'tpalatalhook' => "\x{01AB}", + 'tparen' => "\x{24AF}", + 'trademarksans' => "\x{F8EA}", + 'trademarkserif' => "\x{F6DB}", + 'tretroflexhook' => "\x{0288}", + 'ts' => "\x{02A6}", + 'tsadi' => "\x{05E6}", + 'tsadidagesh' => "\x{FB46}", + 'tsadidageshhebrew' => "\x{FB46}", + 'tsadihebrew' => "\x{05E6}", + 'tsecyrillic' => "\x{0446}", + 'tsere' => "\x{05B5}", + 'tsere12' => "\x{05B5}", + 'tsere1e' => "\x{05B5}", + 'tsere2b' => "\x{05B5}", + 'tserehebrew' => "\x{05B5}", + 'tserenarrowhebrew' => "\x{05B5}", + 'tserequarterhebrew' => "\x{05B5}", + 'tserewidehebrew' => "\x{05B5}", + 'tshecyrillic' => "\x{045B}", + 'tsuperior' => "\x{F6F3}", + 'ttabengali' => "\x{099F}", + 'ttadeva' => "\x{091F}", + 'ttagujarati' => "\x{0A9F}", + 'ttagurmukhi' => "\x{0A1F}", + 'tteharabic' => "\x{0679}", + 'ttehfinalarabic' => "\x{FB67}", + 'ttehinitialarabic' => "\x{FB68}", + 'ttehmedialarabic' => "\x{FB69}", + 'tthabengali' => "\x{09A0}", + 'tthadeva' => "\x{0920}", + 'tthagujarati' => "\x{0AA0}", + 'tthagurmukhi' => "\x{0A20}", + 'tturned' => "\x{0287}", + 'tuhiragana' => "\x{3064}", + 'tukatakana' => "\x{30C4}", + 'tukatakanahalfwidth' => "\x{FF82}", + 'tusmallhiragana' => "\x{3063}", + 'tusmallkatakana' => "\x{30C3}", + 'tusmallkatakanahalfwidth' => "\x{FF6F}", + 'twelvecircle' => "\x{246B}", + 'twelveparen' => "\x{247F}", + 'twelveperiod' => "\x{2493}", + 'twelveroman' => "\x{217B}", + 'twentycircle' => "\x{2473}", + 'twentyhangzhou' => "\x{5344}", + 'twentyparen' => "\x{2487}", + 'twentyperiod' => "\x{249B}", + 'twoarabic' => "\x{0662}", + 'twobengali' => "\x{09E8}", + 'twocircle' => "\x{2461}", + 'twocircleinversesansserif' => "\x{278B}", + 'twodeva' => "\x{0968}", + 'twodotleader' => "\x{2025}", + 'twodotleadervertical' => "\x{FE30}", + 'twogujarati' => "\x{0AE8}", + 'twogurmukhi' => "\x{0A68}", + 'twohackarabic' => "\x{0662}", + 'twohangzhou' => "\x{3022}", + 'twoideographicparen' => "\x{3221}", + 'twoinferior' => "\x{2082}", + 'twomonospace' => "\x{FF12}", + 'twonumeratorbengali' => "\x{09F5}", + 'twooldstyle' => "\x{F732}", + 'twoparen' => "\x{2475}", + 'twoperiod' => "\x{2489}", + 'twopersian' => "\x{06F2}", + 'tworoman' => "\x{2171}", + 'twostroke' => "\x{01BB}", + 'twothai' => "\x{0E52}", + 'ubar' => "\x{0289}", + 'ubengali' => "\x{0989}", + 'ubopomofo' => "\x{3128}", + 'ucaron' => "\x{01D4}", + 'ucircle' => "\x{24E4}", + 'ucircumflexbelow' => "\x{1E77}", + 'ucyrillic' => "\x{0443}", + 'udattadeva' => "\x{0951}", + 'udblacute' => "\x{0171}", + 'udblgrave' => "\x{0215}", + 'udeva' => "\x{0909}", + 'udieresisacute' => "\x{01D8}", + 'udieresisbelow' => "\x{1E73}", + 'udieresiscaron' => "\x{01DA}", + 'udieresiscyrillic' => "\x{04F1}", + 'udieresisgrave' => "\x{01DC}", + 'udieresismacron' => "\x{01D6}", + 'udotbelow' => "\x{1EE5}", + 'ugujarati' => "\x{0A89}", + 'ugurmukhi' => "\x{0A09}", + 'uhiragana' => "\x{3046}", + 'uhookabove' => "\x{1EE7}", + 'uhornacute' => "\x{1EE9}", + 'uhorndotbelow' => "\x{1EF1}", + 'uhorngrave' => "\x{1EEB}", + 'uhornhookabove' => "\x{1EED}", + 'uhorntilde' => "\x{1EEF}", + 'uhungarumlautcyrillic' => "\x{04F3}", + 'uinvertedbreve' => "\x{0217}", + 'ukatakana' => "\x{30A6}", + 'ukatakanahalfwidth' => "\x{FF73}", + 'ukcyrillic' => "\x{0479}", + 'ukorean' => "\x{315C}", + 'umacroncyrillic' => "\x{04EF}", + 'umacrondieresis' => "\x{1E7B}", + 'umatragurmukhi' => "\x{0A41}", + 'umonospace' => "\x{FF55}", + 'underscoremonospace' => "\x{FF3F}", + 'underscorevertical' => "\x{FE33}", + 'underscorewavy' => "\x{FE4F}", + 'uparen' => "\x{24B0}", + 'upperdothebrew' => "\x{05C4}", + 'upsilonlatin' => "\x{028A}", + 'uptackbelowcmb' => "\x{031D}", + 'uptackmod' => "\x{02D4}", + 'uragurmukhi' => "\x{0A73}", + 'ushortcyrillic' => "\x{045E}", + 'usmallhiragana' => "\x{3045}", + 'usmallkatakana' => "\x{30A5}", + 'usmallkatakanahalfwidth' => "\x{FF69}", + 'ustraightcyrillic' => "\x{04AF}", + 'ustraightstrokecyrillic' => "\x{04B1}", + 'utildeacute' => "\x{1E79}", + 'utildebelow' => "\x{1E75}", + 'uubengali' => "\x{098A}", + 'uudeva' => "\x{090A}", + 'uugujarati' => "\x{0A8A}", + 'uugurmukhi' => "\x{0A0A}", + 'uumatragurmukhi' => "\x{0A42}", + 'uuvowelsignbengali' => "\x{09C2}", + 'uuvowelsigndeva' => "\x{0942}", + 'uuvowelsigngujarati' => "\x{0AC2}", + 'uvowelsignbengali' => "\x{09C1}", + 'uvowelsigndeva' => "\x{0941}", + 'uvowelsigngujarati' => "\x{0AC1}", + 'vadeva' => "\x{0935}", + 'vagujarati' => "\x{0AB5}", + 'vagurmukhi' => "\x{0A35}", + 'vakatakana' => "\x{30F7}", + 'vav' => "\x{05D5}", + 'vavdagesh' => "\x{FB35}", + 'vavdagesh65' => "\x{FB35}", + 'vavdageshhebrew' => "\x{FB35}", + 'vavhebrew' => "\x{05D5}", + 'vavholam' => "\x{FB4B}", + 'vavholamhebrew' => "\x{FB4B}", + 'vavvavhebrew' => "\x{05F0}", + 'vavyodhebrew' => "\x{05F1}", + 'vcircle' => "\x{24E5}", + 'vdotbelow' => "\x{1E7F}", + 'vecyrillic' => "\x{0432}", + 'veharabic' => "\x{06A4}", + 'vehfinalarabic' => "\x{FB6B}", + 'vehinitialarabic' => "\x{FB6C}", + 'vehmedialarabic' => "\x{FB6D}", + 'vekatakana' => "\x{30F9}", + 'venus' => "\x{2640}", + 'verticalbar' => "\x{007C}", + 'verticallineabovecmb' => "\x{030D}", + 'verticallinebelowcmb' => "\x{0329}", + 'verticallinelowmod' => "\x{02CC}", + 'verticallinemod' => "\x{02C8}", + 'vewarmenian' => "\x{057E}", + 'vhook' => "\x{028B}", + 'vikatakana' => "\x{30F8}", + 'viramabengali' => "\x{09CD}", + 'viramadeva' => "\x{094D}", + 'viramagujarati' => "\x{0ACD}", + 'visargabengali' => "\x{0983}", + 'visargadeva' => "\x{0903}", + 'visargagujarati' => "\x{0A83}", + 'vmonospace' => "\x{FF56}", + 'voarmenian' => "\x{0578}", + 'voicediterationhiragana' => "\x{309E}", + 'voicediterationkatakana' => "\x{30FE}", + 'voicedmarkkana' => "\x{309B}", + 'voicedmarkkanahalfwidth' => "\x{FF9E}", + 'vokatakana' => "\x{30FA}", + 'vparen' => "\x{24B1}", + 'vtilde' => "\x{1E7D}", + 'vturned' => "\x{028C}", + 'vuhiragana' => "\x{3094}", + 'vukatakana' => "\x{30F4}", + 'waekorean' => "\x{3159}", + 'wahiragana' => "\x{308F}", + 'wakatakana' => "\x{30EF}", + 'wakatakanahalfwidth' => "\x{FF9C}", + 'wakorean' => "\x{3158}", + 'wasmallhiragana' => "\x{308E}", + 'wasmallkatakana' => "\x{30EE}", + 'wattosquare' => "\x{3357}", + 'wavedash' => "\x{301C}", + 'wavyunderscorevertical' => "\x{FE34}", + 'wawarabic' => "\x{0648}", + 'wawfinalarabic' => "\x{FEEE}", + 'wawhamzaabovearabic' => "\x{0624}", + 'wawhamzaabovefinalarabic' => "\x{FE86}", + 'wbsquare' => "\x{33DD}", + 'wcircle' => "\x{24E6}", + 'wdotaccent' => "\x{1E87}", + 'wdotbelow' => "\x{1E89}", + 'wehiragana' => "\x{3091}", + 'wekatakana' => "\x{30F1}", + 'wekorean' => "\x{315E}", + 'weokorean' => "\x{315D}", + 'whitebullet' => "\x{25E6}", + 'whitecircle' => "\x{25CB}", + 'whitecircleinverse' => "\x{25D9}", + 'whitecornerbracketleft' => "\x{300E}", + 'whitecornerbracketleftvertical' => "\x{FE43}", + 'whitecornerbracketright' => "\x{300F}", + 'whitecornerbracketrightvertical' => "\x{FE44}", + 'whitediamond' => "\x{25C7}", + 'whitediamondcontainingblacksmalldiamond' => "\x{25C8}", + 'whitedownpointingsmalltriangle' => "\x{25BF}", + 'whitedownpointingtriangle' => "\x{25BD}", + 'whiteleftpointingsmalltriangle' => "\x{25C3}", + 'whiteleftpointingtriangle' => "\x{25C1}", + 'whitelenticularbracketleft' => "\x{3016}", + 'whitelenticularbracketright' => "\x{3017}", + 'whiterightpointingsmalltriangle' => "\x{25B9}", + 'whiterightpointingtriangle' => "\x{25B7}", + 'whitesmallsquare' => "\x{25AB}", + 'whitesmilingface' => "\x{263A}", + 'whitesquare' => "\x{25A1}", + 'whitestar' => "\x{2606}", + 'whitetelephone' => "\x{260F}", + 'whitetortoiseshellbracketleft' => "\x{3018}", + 'whitetortoiseshellbracketright' => "\x{3019}", + 'whiteuppointingsmalltriangle' => "\x{25B5}", + 'whiteuppointingtriangle' => "\x{25B3}", + 'wihiragana' => "\x{3090}", + 'wikatakana' => "\x{30F0}", + 'wikorean' => "\x{315F}", + 'wmonospace' => "\x{FF57}", + 'wohiragana' => "\x{3092}", + 'wokatakana' => "\x{30F2}", + 'wokatakanahalfwidth' => "\x{FF66}", + 'won' => "\x{20A9}", + 'wonmonospace' => "\x{FFE6}", + 'wowaenthai' => "\x{0E27}", + 'wparen' => "\x{24B2}", + 'wring' => "\x{1E98}", + 'wsuperior' => "\x{02B7}", + 'wturned' => "\x{028D}", + 'wynn' => "\x{01BF}", + 'xabovecmb' => "\x{033D}", + 'xbopomofo' => "\x{3112}", + 'xcircle' => "\x{24E7}", + 'xdieresis' => "\x{1E8D}", + 'xdotaccent' => "\x{1E8B}", + 'xeharmenian' => "\x{056D}", + 'xmonospace' => "\x{FF58}", + 'xparen' => "\x{24B3}", + 'xsuperior' => "\x{02E3}", + 'yaadosquare' => "\x{334E}", + 'yabengali' => "\x{09AF}", + 'yadeva' => "\x{092F}", + 'yaekorean' => "\x{3152}", + 'yagujarati' => "\x{0AAF}", + 'yagurmukhi' => "\x{0A2F}", + 'yahiragana' => "\x{3084}", + 'yakatakana' => "\x{30E4}", + 'yakatakanahalfwidth' => "\x{FF94}", + 'yakorean' => "\x{3151}", + 'yamakkanthai' => "\x{0E4E}", + 'yasmallhiragana' => "\x{3083}", + 'yasmallkatakana' => "\x{30E3}", + 'yasmallkatakanahalfwidth' => "\x{FF6C}", + 'yatcyrillic' => "\x{0463}", + 'ycircle' => "\x{24E8}", + 'ydotaccent' => "\x{1E8F}", + 'ydotbelow' => "\x{1EF5}", + 'yeharabic' => "\x{064A}", + 'yehbarreearabic' => "\x{06D2}", + 'yehbarreefinalarabic' => "\x{FBAF}", + 'yehfinalarabic' => "\x{FEF2}", + 'yehhamzaabovearabic' => "\x{0626}", + 'yehhamzaabovefinalarabic' => "\x{FE8A}", + 'yehhamzaaboveinitialarabic' => "\x{FE8B}", + 'yehhamzaabovemedialarabic' => "\x{FE8C}", + 'yehinitialarabic' => "\x{FEF3}", + 'yehmedialarabic' => "\x{FEF4}", + 'yehmeeminitialarabic' => "\x{FCDD}", + 'yehmeemisolatedarabic' => "\x{FC58}", + 'yehnoonfinalarabic' => "\x{FC94}", + 'yehthreedotsbelowarabic' => "\x{06D1}", + 'yekorean' => "\x{3156}", + 'yenmonospace' => "\x{FFE5}", + 'yeokorean' => "\x{3155}", + 'yeorinhieuhkorean' => "\x{3186}", + 'yerahbenyomohebrew' => "\x{05AA}", + 'yerahbenyomolefthebrew' => "\x{05AA}", + 'yericyrillic' => "\x{044B}", + 'yerudieresiscyrillic' => "\x{04F9}", + 'yesieungkorean' => "\x{3181}", + 'yesieungpansioskorean' => "\x{3183}", + 'yesieungsioskorean' => "\x{3182}", + 'yetivhebrew' => "\x{059A}", + 'yhook' => "\x{01B4}", + 'yhookabove' => "\x{1EF7}", + 'yiarmenian' => "\x{0575}", + 'yicyrillic' => "\x{0457}", + 'yikorean' => "\x{3162}", + 'yinyang' => "\x{262F}", + 'yiwnarmenian' => "\x{0582}", + 'ymonospace' => "\x{FF59}", + 'yod' => "\x{05D9}", + 'yoddagesh' => "\x{FB39}", + 'yoddageshhebrew' => "\x{FB39}", + 'yodhebrew' => "\x{05D9}", + 'yodyodhebrew' => "\x{05F2}", + 'yodyodpatahhebrew' => "\x{FB1F}", + 'yohiragana' => "\x{3088}", + 'yoikorean' => "\x{3189}", + 'yokatakana' => "\x{30E8}", + 'yokatakanahalfwidth' => "\x{FF96}", + 'yokorean' => "\x{315B}", + 'yosmallhiragana' => "\x{3087}", + 'yosmallkatakana' => "\x{30E7}", + 'yosmallkatakanahalfwidth' => "\x{FF6E}", + 'yotgreek' => "\x{03F3}", + 'yoyaekorean' => "\x{3188}", + 'yoyakorean' => "\x{3187}", + 'yoyakthai' => "\x{0E22}", + 'yoyingthai' => "\x{0E0D}", + 'yparen' => "\x{24B4}", + 'ypogegrammeni' => "\x{037A}", + 'ypogegrammenigreekcmb' => "\x{0345}", + 'yr' => "\x{01A6}", + 'yring' => "\x{1E99}", + 'ysuperior' => "\x{02B8}", + 'ytilde' => "\x{1EF9}", + 'yturned' => "\x{028E}", + 'yuhiragana' => "\x{3086}", + 'yuikorean' => "\x{318C}", + 'yukatakana' => "\x{30E6}", + 'yukatakanahalfwidth' => "\x{FF95}", + 'yukorean' => "\x{3160}", + 'yusbigcyrillic' => "\x{046B}", + 'yusbigiotifiedcyrillic' => "\x{046D}", + 'yuslittlecyrillic' => "\x{0467}", + 'yuslittleiotifiedcyrillic' => "\x{0469}", + 'yusmallhiragana' => "\x{3085}", + 'yusmallkatakana' => "\x{30E5}", + 'yusmallkatakanahalfwidth' => "\x{FF6D}", + 'yuyekorean' => "\x{318B}", + 'yuyeokorean' => "\x{318A}", + 'yyabengali' => "\x{09DF}", + 'yyadeva' => "\x{095F}", + 'zaarmenian' => "\x{0566}", + 'zadeva' => "\x{095B}", + 'zagurmukhi' => "\x{0A5B}", + 'zaharabic' => "\x{0638}", + 'zahfinalarabic' => "\x{FEC6}", + 'zahinitialarabic' => "\x{FEC7}", + 'zahiragana' => "\x{3056}", + 'zahmedialarabic' => "\x{FEC8}", + 'zainarabic' => "\x{0632}", + 'zainfinalarabic' => "\x{FEB0}", + 'zakatakana' => "\x{30B6}", + 'zaqefgadolhebrew' => "\x{0595}", + 'zaqefqatanhebrew' => "\x{0594}", + 'zarqahebrew' => "\x{0598}", + 'zayin' => "\x{05D6}", + 'zayindagesh' => "\x{FB36}", + 'zayindageshhebrew' => "\x{FB36}", + 'zayinhebrew' => "\x{05D6}", + 'zbopomofo' => "\x{3117}", + 'zcircle' => "\x{24E9}", + 'zcircumflex' => "\x{1E91}", + 'zcurl' => "\x{0291}", + 'zdot' => "\x{017C}", + 'zdotbelow' => "\x{1E93}", + 'zecyrillic' => "\x{0437}", + 'zedescendercyrillic' => "\x{0499}", + 'zedieresiscyrillic' => "\x{04DF}", + 'zehiragana' => "\x{305C}", + 'zekatakana' => "\x{30BC}", + 'zeroarabic' => "\x{0660}", + 'zerobengali' => "\x{09E6}", + 'zerodeva' => "\x{0966}", + 'zerogujarati' => "\x{0AE6}", + 'zerogurmukhi' => "\x{0A66}", + 'zerohackarabic' => "\x{0660}", + 'zeroinferior' => "\x{2080}", + 'zeromonospace' => "\x{FF10}", + 'zerooldstyle' => "\x{F730}", + 'zeropersian' => "\x{06F0}", + 'zerosuperior' => "\x{2070}", + 'zerothai' => "\x{0E50}", + 'zerowidthjoiner' => "\x{FEFF}", + 'zerowidthnonjoiner' => "\x{200C}", + 'zerowidthspace' => "\x{200B}", + 'zhbopomofo' => "\x{3113}", + 'zhearmenian' => "\x{056A}", + 'zhebrevecyrillic' => "\x{04C2}", + 'zhecyrillic' => "\x{0436}", + 'zhedescendercyrillic' => "\x{0497}", + 'zhedieresiscyrillic' => "\x{04DD}", + 'zihiragana' => "\x{3058}", + 'zikatakana' => "\x{30B8}", + 'zinorhebrew' => "\x{05AE}", + 'zlinebelow' => "\x{1E95}", + 'zmonospace' => "\x{FF5A}", + 'zohiragana' => "\x{305E}", + 'zokatakana' => "\x{30BE}", + 'zparen' => "\x{24B5}", + 'zretroflexhook' => "\x{0290}", + 'zstroke' => "\x{01B6}", + 'zuhiragana' => "\x{305A}", + 'zukatakana' => "\x{30BA}", + ); + +# Add to this list the glyphs for new fonts (from aglfn13): + +map { $agl{$names{$_}} = pack('U',hex ($_))} (keys %names); + + +# %doubles = (map{$_ => "uni$_"} qw(0394 03A9 0162 2215 00AD 02C9 03BC 2219 00A0 0163)); + +=head2 lookup ( $usv [, $noAlt [, $noUni] ]) + +return the Adobe-recommended glyph name for a specific Unicode codepoint (integer). By default +returns C names rather than C or C names + +If C<$noAlt> is true, C and C names are returned rather than C. + +if C<$noUni> is true, returns undef if it would have to resort to C or C +style names. Essentially this represents a straight lookup in the Adobe-recommended list. + +=cut + +sub lookup +{ + my ($num, $noalt, $noUni) = @_; + my ($val) = sprintf("%04X", $num); + + if (defined $names{$val}) + { + return $names{$val} if ($noalt || $names{$val} !~ m/^(?:afii|SF)/o); + } + return undef if $noUni; + if ($num > 0xFFFF) + { return "u$val"; } + elsif ($num) + { return "uni$val"; } + else + { return ".notdef"; } +} + +=head2 parse ( $glyphname ) + +Parse an Adobe-conformant glyph name, generating a Unicode codepoint sequence equivalent to the glyph (or +glyph components, should the name represent a ligature). In scalar context, returns a reference to an +array of Unicodes (decimal). Array is empty if the glyph name is non-conformant. +In list context, the first item returned is the same array reference as above. The second item +is a reference to an array containing the extensions (if any) present on the glyph name. +The '.' that precedes each extension is not included. + +=cut + +sub parse +{ + my ($gname, @USVs, @extensions); + ($gname, @extensions) = split('\.', $_[0]); + # if name originally started with . (e.g., .null) then $gname will now be '' ... need to fix that up: + $gname = '.' . shift(@extensions) if $gname eq ''; + if (defined $gname) + { + foreach $gname (split('_', $gname)) + { + if ($gname =~ /^u[0-9a-fA-F]{4,6}$/) + { + push @USVs, hex(substr($gname, 1)); + } + elsif ($gname =~ /^uni([0-9a-fA-F]{4,4})+$/) + { + push @USVs, map {hex($_)} ($gname =~ /([0-9a-fA-F]{4,4})/g) + } + elsif (exists $agl{$gname}) + { + push @USVs, unpack ('U*', $agl{$gname}); + } + } + } + return \@USVs unless wantarray; + my @res = (\@USVs, \@extensions); + return @res; +} + +#Code used to parse Adobe's agl file and generate text for %agl initialization: +#while () { +# chomp; +# next if m/^#/; +# my ($gname, @nums) = split(/[; ]/); +# if ($#nums > 0 or !defined ($Font::TTF::PSNames::names{$nums[0]}) or $Font::TTF::PSNames::names{$nums[0]} ne $gname) +# { +# print "\t'$gname' => \""; +# map {print "\\x{$_}" } @nums; +# print "\",\n"; +# } +# } + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + +1; diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Post.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Post.pm new file mode 100644 index 0000000..4bf284e --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Post.pm @@ -0,0 +1,306 @@ +package Font::TTF::Post; + +=head1 NAME + +Font::TTF::Post - Holds the Postscript names for each glyph + +=head1 DESCRIPTION + +Holds the postscript names for glyphs. Note that they are not held as an +array, but as indexes into two lists. The first list is the standard Postscript +name list defined by the TrueType standard. The second comes from the font +directly. + +Looking up a glyph from a Postscript name or a name from a glyph number is +achieved through methods rather than variable lookup. + +This class handles PostScript table types of 1, 2, 2.5 & 3, but not version 4. +Support for version 2.5 is as per Apple spec rather than MS. + +The way to look up Postscript names or glyphs is: + + $pname = $f->{'post'}{'VAL'}[$gnum]; + $gnum = $f->{'post'}{'STRINGS'}{$pname}; + +=head1 INSTANCE VARIABLES + +Due to different systems having different limitations, there are various class +variables available to control what post table types can be written. + +=over 4 + +=item $Font::TTF::Post::no25 + +If set tells Font::TTF::Post::out to use table type 2 instead of 2.5 in case apps +can't handle version 2.5. + +=item VAL + +Contains an array indexed by glyph number of Postscript names. This is used when +writing out a font. + +=item STRINGS + +An associative array of Postscript names mapping to the highest glyph with that +name. These may not be in sync with VAL. + +=back + +In addition there are the standard introductory variables defined in the +standard: + + FormatType + italicAngle + underlinePosition + underlineThickness + isFixedPitch + minMemType42 + maxMemType42 + minMemType1 + maxMemType1 + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA @base_set %base_set %fields $VERSION $no25 @field_info @base_set); +require Font::TTF::Table; +use Font::TTF::Utils; + +$no25 = 1; # officially deprecated format 2.5 tables in MS spec 1.3 + +@ISA = qw(Font::TTF::Table); +@field_info = ( + 'FormatType' => 'f', + 'italicAngle' => 'f', + 'underlinePosition' => 's', + 'underlineThickness' => 's', + 'isFixedPitch' => 'L', + 'minMemType42' => 'L', + 'maxMemType42' => 'L', + 'minMemType1' => 'L', + 'maxMemType1' => 'L'); +@base_set = qw(.notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle + parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six + seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q + R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h + i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla + Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute + egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex + odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet + paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity + plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine + ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal + Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash + quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency + guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand + Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex + apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent + ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth + Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter + threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat); + +$VERSION = 0.01; # MJPH 5-AUG-1998 Re-organise data structures + +sub init +{ + my ($k, $v, $c, $i); + for ($i = 0; $i < $#field_info; $i += 2) + { + ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); + next unless defined $k && $k ne ""; + $fields{$k} = $v; + } + $i = 0; + %base_set = map {$_ => $i++} @base_set; +} + + +=head2 $t->read + +Reads the Postscript table into memory from disk + +=cut + +sub read +{ + my ($self) = @_; + my ($dat, $dat1, $i, $off, $c, $maxoff, $form, $angle, $numGlyphs); + my ($fh) = $self->{' INFILE'}; + + $numGlyphs = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + $self->SUPER::read or return $self; + init unless ($fields{'FormatType'}); + $fh->read($dat, 32); + TTF_Read_Fields($self, $dat, \%fields); + + if (int($self->{'FormatType'} + .5) == 1) + { + for ($i = 0; $i < 258; $i++) + { + $self->{'VAL'}[$i] = $base_set[$i]; + $self->{'STRINGS'}{$base_set[$i]} = $i unless (defined $self->{'STRINGS'}{$base_set[$i]}); + } + } elsif (int($self->{'FormatType'} * 2 + .1) == 5) + { + $fh->read($dat, 2); + $numGlyphs = unpack("n", $dat); + $fh->read($dat, $numGlyphs); + for ($i = 0; $i < $numGlyphs; $i++) + { + $off = unpack("c", substr($dat, $i, 1)); + $self->{'VAL'}[$i] = $base_set[$i + $off]; + $self->{'STRINGS'}{$base_set[$i + $off]} = $i unless (defined $self->{'STRINGS'}{$base_set[$i + $off]}); + } + } elsif (int($self->{'FormatType'} + .5) == 2) + { + my (@strings); + + $fh->read($dat, ($numGlyphs + 1) << 1); + for ($i = 0; $i < $numGlyphs; $i++) + { + $off = unpack("n", substr($dat, ($i + 1) << 1, 2)); + $maxoff = $off if (!defined $maxoff || $off > $maxoff); + } + for ($i = 0; $i < $maxoff - 257; $i++) + { + $fh->read($dat1, 1); + $off = unpack("C", $dat1); + $fh->read($dat1, $off); + $strings[$i] = $dat1; + } + for ($i = 0; $i < $numGlyphs; $i++) + { + $off = unpack("n", substr($dat, ($i + 1) << 1, 2)); + if ($off > 257) + { + $self->{'VAL'}[$i] = $strings[$off - 258]; + $self->{'STRINGS'}{$strings[$off - 258]} = $i; + } + else + { + $self->{'VAL'}[$i] = $base_set[$off]; + $self->{'STRINGS'}{$base_set[$off]} = $i unless (defined $self->{'STRINGS'}{$base_set[$off]}); + } + } + } + $self; +} + + +=head2 $t->out($fh) + +Writes out a new Postscript name table from memory or copies from disk + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($i, $num); + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $num = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + + init unless ($fields{'FormatType'}); + + for ($i = $#{$self->{'VAL'}}; !defined $self->{'VAL'}[$i] && $i > 0; $i--) + { pop(@{$self->{'VAL'}}); } + if ($#{$self->{'VAL'}} < 0) + { $self->{'FormatType'} = 3; } + else + { + $self->{'FormatType'} = 1; + for ($i = 0; $i < $num; $i++) + { + if (!defined $base_set{$self->{'VAL'}[$i]}) + { + $self->{'FormatType'} = 2; + last; + } + elsif ($base_set{$self->{'VAL'}[$i]} != $i) + { $self->{'FormatType'} = ($no25 ? 2 : 2.5); } + } + } + + $fh->print(TTF_Out_Fields($self, \%fields, 32)); + + return $self if (int($self->{'FormatType'} + .4) == 3); + + if (int($self->{'FormatType'} + .5) == 2) + { + my (@ind); + my ($count) = 0; + + $fh->print(pack("n", $num)); + for ($i = 0; $i < $num; $i++) + { + if (defined $base_set{$self->{'VAL'}[$i]}) + { $fh->print(pack("n", $base_set{$self->{'VAL'}[$i]})); } + else + { + $fh->print(pack("n", $count + 258)); + $ind[$count++] = $i; + } + } + for ($i = 0; $i < $count; $i++) + { + $fh->print(pack("C", length($self->{'VAL'}[$ind[$i]]))); + $fh->print($self->{'VAL'}[$ind[$i]]); + } + } elsif (int($self->{'FormatType'} * 2 + .5) == 5) + { + $fh->print(pack("n", $num)); + for ($i = 0; $i < $num; $i++) + { $fh->print(pack("c", defined $base_set{$self->{'VAL'}[$i]} ? + $base_set{$self->{'VAL'}[$i]} - $i : -$i)); } + } + + $self; +} + + +=head2 $t->XML_element($context, $depth, $key, $val) + +Outputs the names as one block of XML + +=cut + +sub XML_element +{ + my ($self) = shift; + my ($context, $depth, $key, $val) = @_; + my ($fh) = $context->{'fh'}; + my ($i); + + return $self->SUPER::XML_element(@_) unless ($key eq 'STRINGS' || $key eq 'VAL'); + return unless ($key eq 'VAL'); + + $fh->print("$depth\n"); + for ($i = 0; $i <= $#{$self->{'VAL'}}; $i++) + { $fh->print("$depth$context->{'indent'}\n"); } + $fh->print("$depth\n"); + $self; +} + +1; + +=head1 BUGS + +=over 4 + +=item * + +No support for type 4 tables + +=back + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Prep.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Prep.pm new file mode 100644 index 0000000..453cf5a --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Prep.pm @@ -0,0 +1,89 @@ +package Font::TTF::Prep; + +=head1 NAME + +Font::TTF::Prep - Preparation hinting program. Called when ppem changes + +=head1 DESCRIPTION + +This is a minimal class adding nothing beyond a table, but is a repository +for prep type information for those processes brave enough to address hinting. + +=cut + +use strict; +use vars qw(@ISA $VERSION); +use Font::TTF::Utils; + +@ISA = qw(Font::TTF::Table); + +$VERSION = 0.0001; + + +=head2 $t->read + +Reads the data using C. + +=cut + +sub read +{ + $_[0]->read_dat; + $_[0]->{' read'} = 1; +} + + +=head2 $t->out_xml($context, $depth) + +Outputs Prep program as XML + +=cut + +sub out_xml +{ + my ($self, $context, $depth) = @_; + my ($fh) = $context->{'fh'}; + my ($dat); + + $self->read; + $dat = Font::TTF::Utils::XML_binhint($self->{' dat'}); + $dat =~ s/\n(?!$)/\n$depth$context->{'indent'}/omg; + $fh->print("$depth\n"); + $fh->print("$depth$context->{'indent'}$dat"); + $fh->print("$depth\n"); + $self; +} + + +=head2 $t->XML_end($context, $tag, %attrs) + +Parse all that hinting code + +=cut + +sub XML_end +{ + my ($self) = shift; + my ($context, $tag, %attrs) = @_; + + if ($tag eq 'code') + { + $self->{' dat'} = Font::TTF::Utils::XML_hintbin($context->{'text'}); + return $context; + } else + { return $self->SUPER::XML_end(@_); } +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Prop.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Prop.pm new file mode 100644 index 0000000..b74c654 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Prop.pm @@ -0,0 +1,154 @@ +package Font::TTF::Prop; + +=head1 NAME + +Font::TTF::Prop - Glyph Properties table in a font + +=head1 DESCRIPTION + +=head1 INSTANCE VARIABLES + +=item version + +=item default + +=item lookup + +Hash of property values keyed by glyph number + +=item lookupFormat + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +use Font::TTF::Utils; +use Font::TTF::AATutils; +use Font::TTF::Segarr; + +@ISA = qw(Font::TTF::Table); + +=head2 $t->read + +Reads the table into memory + +=cut + +sub read +{ + my ($self) = @_; + my ($dat, $fh); + my ($version, $lookupPresent, $default); + + $self->SUPER::read or return $self; + + $fh = $self->{' INFILE'}; + $fh->read($dat, 8); + ($version, $lookupPresent, $default) = TTF_Unpack("vSS", $dat); + + if ($lookupPresent) { + my ($format, $lookup) = AAT_read_lookup($fh, 2, $self->{' LENGTH'} - 8, $default); + $self->{'lookup'} = $lookup; + $self->{'format'} = $format; + } + + $self->{'version'} = $version; + $self->{'default'} = $default; + + $self; +} + + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($default, $lookup); + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $default = $self->{'default'}; + $lookup = $self->{'lookup'}; + $fh->print(TTF_Pack("vSS", $self->{'version'}, (defined $lookup ? 1 : 0), $default)); + + AAT_write_lookup($fh, $self->{'format'}, $lookup, 2, $default) if (defined $lookup); +} + +=head2 $t->print($fh) + +Prints a human-readable representation of the table + +=cut + +sub print +{ + my ($self, $fh) = @_; + my ($lookup); + + $self->read; + + $fh = 'STDOUT' unless defined $fh; + + $fh->printf("version %f\ndefault %04x # %s\n", $self->{'version'}, $self->{'default'}, meaning_($self->{'default'})); + $lookup = $self->{'lookup'}; + if (defined $lookup) { + $fh->printf("format %d\n", $self->{'format'}); + foreach (sort { $a <=> $b } keys %$lookup) { + $fh->printf("\t%d -> %04x # %s\n", $_, $lookup->{$_}, meaning_($lookup->{$_})); + } + } +} + +sub meaning_ +{ + my ($val) = @_; + my ($res); + + my @types = ( + "Strong left-to-right", + "Strong right-to-left", + "Arabic letter", + "European number", + "European number separator", + "European number terminator", + "Arabic number", + "Common number separator", + "Block separator", + "Segment separator", + "Whitespace", + "Other neutral"); + $res = $types[$val & 0x001f] or ("Undefined [" . ($val & 0x001f) . "]"); + + $res .= ", floater" if $val & 0x8000; + $res .= ", hang left" if $val & 0x4000; + $res .= ", hang right" if $val & 0x2000; + $res .= ", attaches on right" if $val & 0x0080; + $res .= ", pair" if $val & 0x1000; + my $pairOffset = ($val & 0x0f00) >> 8; + $pairOffset = $pairOffset - 16 if $pairOffset > 7; + $res .= $pairOffset > 0 ? " +" . $pairOffset : $pairOffset < 0 ? " " . $pairOffset : ""; + + $res; +} + +1; + + +=head1 BUGS + +None known + +=head1 AUTHOR + +Jonathan Kew L. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Segarr.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Segarr.pm new file mode 100644 index 0000000..980188d --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Segarr.pm @@ -0,0 +1,376 @@ +package Font::TTF::Segarr; + +=head1 NAME + +Font::TTF::Segarr - Segmented array + +=head1 DESCRIPTION + +Holds data either directly or indirectly as a series of arrays. This class +looks after the set of arrays and masks the individual sub-arrays, thus saving +a class, we hope. + +=head1 INSTANCE VARIABLES + +All instance variables do not start with a space. + +The segmented array is simply an array of segments + +Each segment is a more complex affair: + +=over 4 + +=item START + +In terms of the array, the address for the 0th element in this segment. + +=item LEN + +Number of elements in this segment + +=item VAL + +The array which contains the elements + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@types $VERSION); +$VERSION = 0.0001; + +@types = ('', 'C', 'n', '', 'N'); + +=head2 Font::TTF::Segarr->new($size) + +Creates a new segmented array with a given data size + +=cut + +sub new +{ + my ($class) = @_; + my ($self) = []; + + bless $self, (ref($class) || $class); +} + + +=head2 $s->fastadd_segment($start, $is_sparse, @dat) + +Creates a new segment and adds it to the array assuming no overlap between +the new segment and any others in the array. $is_sparse indicates whether the +passed in array contains Cs or not. If false no checking is done (which +is faster, but riskier). If equal to 2 then 0 is considered undef as well. + +Returns the number of segments inserted. + +=cut + +sub fastadd_segment +{ + my ($self) = shift; + my ($start) = shift; + my ($sparse) = shift; + my ($p, $i, $seg, @seg); + + + if ($sparse) + { + for ($i = 0; $i <= $#_; $i++) + { + if (!defined $seg && (($sparse != 2 && defined $_[$i]) || $_[$i] != 0)) + { $seg->{'START'} = $start + $i; $seg->{'VAL'} = []; } + + if (defined $seg && (($sparse == 2 && $_[$i] == 0) || !defined $_[$i])) + { + $seg->{'LEN'} = $start + $i - $seg->{'START'}; + push(@seg, $seg); + $seg = undef; + } elsif (defined $seg) + { push (@{$seg->{'VAL'}}, $_[$i]); } + } + if (defined $seg) + { + push(@seg, $seg); + $seg->{'LEN'} = $start + $i - $seg->{'START'}; + } + } else + { + $seg->{'START'} = $start; + $seg->{'LEN'} = $#_ + 1; + $seg->{'VAL'} = [@_]; + @seg = ($seg); + } + + for ($i = 0; $i <= $#$self; $i++) + { + if ($self->[$i]{'START'} > $start) + { + splice(@$self, $i, 0, @seg); + return wantarray ? @seg : scalar(@seg); + } + } + push(@$self, @seg); + return wantarray ? @seg : scalar(@seg); +} + + +=head2 $s->add_segment($start, $overwrite, @dat) + +Creates a new segment and adds it to the array allowing for possible overlaps +between the new segment and the existing ones. In the case of overlaps, elements +from the new segment are deleted unless $overwrite is set in which case the +elements already there are over-written. + +This method also checks the data coming in to see if it is sparse (i.e. contains +undef values). Gaps cause new segments to be created or not to over-write existing +values. + +=cut + +sub add_segment +{ + my ($self) = shift; + my ($start) = shift; + my ($over) = shift; + my ($seg, $i, $s, $offset, $j, $newi); + + return $self->fastadd_segment($start, $over, @_) if ($#$self < 0); + $offset = 0; + for ($i = 0; $i <= $#$self && $offset <= $#_; $i++) + { + $s = $self->[$i]; + if ($s->{'START'} <= $start + $offset) # only < for $offset == 0 + { + if ($s->{'START'} + $s->{'LEN'} > $start + $#_) + { + for ($j = $offset; $j <= $#_; $j++) + { + if ($over) + { $s->{'VAL'}[$start - $s->{'START'} + $j] = $_[$j] if defined $_[$j]; } + else + { $s->{'VAL'}[$start - $s->{'START'} + $j] ||= $_[$j] if defined $_[$j]; } + } + $offset = $#_ + 1; + last; + } elsif ($s->{'START'} + $s->{'LEN'} > $start + $offset) # is $offset needed here? + { + for ($j = $offset; $j < $s->{'START'} + $s->{'LEN'} - $start; $j++) + { + if ($over) + { $s->{'VAL'}[$start - $s->{'START'} + $j] = $_[$j] if defined $_[$j]; } + else + { $s->{'VAL'}[$start - $s->{'START'} + $j] ||= $_[$j] if defined $_[$j]; } + } + $offset = $s->{'START'} + $s->{'LEN'} - $start; + } + } else # new seg please + { + if ($s->{'START'} > $start + $#_ + 1) + { + $i += $self->fastadd_segment($start + $offset, 1, @_[$offset .. $#_]) - 1; + $offset = $#_ + 1; + } + else + { + $i += $self->fastadd_segment($start + $offset, 1, @_[$offset .. $s->{'START'} - $start]) - 1; + $offset = $s->{'START'} - $start + 1; + } + } + } + if ($offset <= $#_) + { + $seg->{'START'} = $start + $offset; + $seg->{'LEN'} = $#_ - $offset + 1; + $seg->{'VAL'} = [@_[$offset .. $#_]]; + push (@$self, $seg); + } + $self->tidy; +} + + +=head2 $s->tidy + +Merges any immediately adjacent segments + +=cut + +sub tidy +{ + my ($self) = @_; + my ($i, $sl, $s); + + for ($i = 1; $i <= $#$self; $i++) + { + $sl = $self->[$i - 1]; + $s = $self->[$i]; + if ($s->{'START'} == $sl->{'START'} + $sl->{'LEN'}) + { + $sl->{'LEN'} += $s->{'LEN'}; + push (@{$sl->{'VAL'}}, @{$s->{'VAL'}}); + splice(@$self, $i, 1); + $i--; + } + } + $self; +} + + +=head2 $s->at($addr, [$len]) + +Looks up the data held at the given address by locating the appropriate segment +etc. If $len > 1 then returns an array of values, spaces being filled with undef. + +=cut + +sub at +{ + my ($self, $addr, $len) = @_; + my ($i, $dat, $s, @res, $offset); + + $len = 1 unless defined $len; + $offset = 0; + for ($i = 0; $i <= $#$self; $i++) + { + $s = $self->[$i]; + next if ($s->{'START'} + $s->{'LEN'} < $addr + $offset); # only fires on $offset == 0 + if ($s->{'START'} > $addr + $offset) + { + push (@res, (undef) x ($s->{'START'} > $addr + $len ? + $len - $offset : $s->{'START'} - $addr - $offset)); + $offset = $s->{'START'} - $addr; + } + last if ($s->{'START'} >= $addr + $len); + + if ($s->{'START'} + $s->{'LEN'} >= $addr + $len) + { + push (@res, @{$s->{'VAL'}}[$addr + $offset - $s->{'START'} .. + $addr + $len - $s->{'START'} - 1]); + $offset = $len; + last; + } else + { + push (@res, @{$s->{'VAL'}}[$addr + $offset - $s->{'START'} .. $s->{'LEN'} - 1]); + $offset = $s->{'START'} + $s->{'LEN'} - $addr; + } + } + push (@res, (undef) x ($len - $offset)) if ($offset < $len); + return wantarray ? @res : $res[0]; +} + + +=head2 $s->remove($addr, [$len]) + +Removes the item or items from addr returning them as an array or the first +value in a scalar context. This is very like C, including padding with +undef, but it deletes stuff as it goes. + +=cut + +sub remove +{ + my ($self, $addr, $len) = @_; + my ($i, $dat, $s, @res, $offset); + + $len = 1 unless defined $len; + $offset = 0; + for ($i = 0; $i <= $#$self; $i++) + { + $s = $self->[$i]; + next if ($s->{'START'} + $s->{'LEN'} < $addr + $offset); + if ($s->{'START'} > $addr + $offset) + { + push (@res, (undef) x ($s->{'START'} > $addr + $len ? + $len - $offset : $s->{'START'} - $addr - $offset)); + $offset = $s->{'START'} - $addr; + } + last if ($s->{'START'} >= $addr + $len); + + unless ($s->{'START'} == $addr + $offset) + { + my ($seg) = {}; + + $seg->{'START'} = $s->{'START'}; + $seg->{'LEN'} = $addr + $offset - $s->{'START'}; + $seg->{'VAL'} = [splice(@{$s->{'VAL'}}, 0, $addr + $offset - $s->{'START'})]; + $s->{'LEN'} -= $addr + $offset - $s->{'START'}; + $s->{'START'} = $addr + $offset; + + splice(@$self, $i, 0, $seg); + $i++; + } + + if ($s->{'START'} + $s->{'LEN'} >= $addr + $len) + { + push (@res, splice(@{$s->{'VAL'}}, 0, $len - $offset)); + $s->{'LEN'} -= $len - $offset; + $s->{'START'} += $len - $offset; + $offset = $len; + last; + } else + { + push (@res, @{$s->{'VAL'}}); + $offset = $s->{'START'} + $s->{'LEN'} - $addr; + splice(@$self, $i, 0); + $i--; + } + } + push (@res, (undef) x ($len - $offset)) if ($offset < $len); + return wantarray ? @res : $res[0]; +} + + +=head2 $s->copy + +Deep copies this array + +=cut + +sub copy +{ + my ($self) = @_; + my ($res, $p); + + $res = []; + foreach $p (@$self) + { push (@$res, $self->copy_seg($p)); } + $res; +} + + +=head2 $s->copy_seg($seg) + +Creates a deep copy of a segment + +=cut + +sub copy_seg +{ + my ($self, $seg) = @_; + my ($p, $res); + + $res = {}; + $res->{'VAL'} = [@{$seg->{'VAL'}}]; + foreach $p (keys %$seg) + { $res->{$p} = $seg->{$p} unless defined $res->{$p}; } + $res; +} + + +1; + +=head1 BUGS + +No known bugs. + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Sill.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Sill.pm new file mode 100644 index 0000000..6a17af1 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Sill.pm @@ -0,0 +1,114 @@ +package Font::TTF::Sill; + +=head1 NAME + +Font::TTF::Sill - Graphite language mapping table + +=head1 DESCRIPTION + +=head1 INSTANCE VARIABLES + +=over 4 + +=item version + +Table version number. + +=item langs + +Contains a hash where the key is the language id and the value is an array of +language records + +=back + +=head2 Language Records + +Each language record is itself an array of two values [fid, val]. fid is the +feature id and is held as a long. + +=cut + +use Font::TTF::Utils; +require Font::TTF::Table; + +@ISA = qw(Font::TTF::Table); + +sub read +{ + my ($self) = @_; + my ($num, $i, $j); + + return $self if ($self->{' read'}); + $self->SUPER::read_dat or return $self; + + ($self->{'version'}, $num) = TTF_Unpack("vS", $self->{' dat'}); + + foreach $i (1 .. $num) # ignore bogus entry at end + { + my ($lid, $numf, $offset) = unpack("A4nn", substr($self->{' dat'}, $i * 8 + 4)); # 12 - 8 = 4 since i starts at 1. A4 strips nulls + my (@settings); + + foreach $j (1 .. $numf) + { + my ($fid, $val) = TTF_Unpack("Ls", substr($self->{' dat'}, $offset + $j * 8 - 8)); + push (@settings, [$fid, $val]); + } + $self->{'langs'}{$lid} = [@settings]; + } + delete $self->{' dat'}; + $self->{' read'} = 1; + $self; +} + +sub out +{ + my ($self, $fh) = @_; + my ($num, $range, $select, $shift) = TTF_bininfo(scalar keys %{$self->{'langs'}}, 1); + my ($offset) = $num * 8 + 20; #header = 12, dummy = 8 + my ($k, $s); + + return $self->SUPER::out($fh) unless ($self->{' read'}); + $fh->print(TTF_Pack("vSSSS", $self->{'version'}, $num, $range, $select, $shift)); + foreach $k (sort (keys %{$self->{'langs'}}), '+1') + { + my ($numf) = scalar @{$self->{'langs'}{$k}} unless ($k eq '+1'); + $fh->print(pack("a4nn", $k, $numf, $offset)); + $offset += $numf * 8; + } + + foreach $k (sort keys %{$self->{'langs'}}) + { + foreach $s (@{$self->{'langs'}{$k}}) + { $fh->print(TTF_Pack("LsS", @{$s}, 0)); } + } + $self; +} + +sub XML_element +{ + my ($self) = shift; + my ($context, $depth, $key, $dat) = @_; + my ($fh) = $context->{'fh'}; + my ($k, $s); + + return $self->SUPER::XML_element(@_) unless ($key eq 'langs'); + foreach $k (sort keys %{$self->{'langs'}}) + { + $fh->printf("%s\n", $depth, $k); + foreach $s (@{$self->{'langs'}{$k}}) + { + my ($fid) = $s->[0]; + if ($fid > 0x00FFFFFF) + { $fid = unpack("A4", pack ("N", $fid)); } + else + { $fid = sprintf("%d", $fid); } + $fh->printf("%s%s\n", + $depth, $context->{'indent'}, $fid, $s->[1]); + } + $fh->printf("%s\n", $depth); + } + $self; +} +1; + + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Table.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Table.pm new file mode 100644 index 0000000..bbdb48d --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Table.pm @@ -0,0 +1,382 @@ +package Font::TTF::Table; + +=head1 NAME + +Font::TTF::Table - Superclass for tables and used for tables we don't have a class for + +=head1 DESCRIPTION + +Looks after the purely table aspects of a TTF table, such as whether the table +has been read before, locating the file pointer, etc. Also copies tables from +input to output. + +=head1 INSTANCE VARIABLES + +Instance variables start with a space + +=over 4 + +=item read + +Flag which indicates that the table has already been read from file. + +=item dat + +Allows the creation of unspecific tables. Data is simply output to any font +file being created. + +=item INFILE + +The read file handle + +=item OFFSET + +Location of the file in the input file + +=item LENGTH + +Length in the input directory + +=item CSUM + +Checksum read from the input file's directory + +=item PARENT + +The L that table is part of + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw($VERSION); +use Font::TTF::Utils; + +$VERSION = 0.0001; + +=head2 Font::TTF::Table->new(%parms) + +Creates a new table or subclass. Table instance variables are passed in +at this point as an associative array. + +=cut + +sub new +{ + my ($class, %parms) = @_; + my ($self) = {}; + my ($p); + + $class = ref($class) || $class; + foreach $p (keys %parms) + { $self->{" $p"} = $parms{$p}; } + bless $self, $class; +} + + +=head2 $t->read + +Reads the table from the input file. Acts as a superclass to all true tables. +This method marks the table as read and then just sets the input file pointer +but does not read any data. If the table has already been read, then returns +C else returns C<$self> + +=cut + +sub read +{ + my ($self) = @_; + + return $self->read_dat if (ref($self) eq "Font::TTF::Table"); + return undef if $self->{' read'}; + $self->{' INFILE'}->seek($self->{' OFFSET'}, 0); + $self->{' read'} = 1; + $self; +} + + +=head2 $t->read_dat + +Reads the table into the C instance variable for those tables which don't +know any better + +=cut + +sub read_dat +{ + my ($self) = @_; + +# can't just $self->read here otherwise those tables which start their read sub with +# $self->read_dat are going to permanently loop + return undef if ($self->{' read'}); +# $self->{' read'} = 1; # Let read do this, now out will call us for subclasses + $self->{' INFILE'}->seek($self->{' OFFSET'}, 0); + $self->{' INFILE'}->read($self->{' dat'}, $self->{' LENGTH'}); + $self; +} + +=head2 $t->out($fh) + +Writes out the table to the font file. If there is anything in the +C instance variable then this is output, otherwise the data is copied +from the input file to the output + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($dat, $i, $len, $count); + + if (defined $self->{' dat'}) + { + $fh->print($self->{' dat'}); + return $self; + } + + return undef unless defined $self->{' INFILE'}; + $self->{' INFILE'}->seek($self->{' OFFSET'}, 0); + $len = $self->{' LENGTH'}; + while ($len > 0) + { + $count = ($len > 4096) ? 4096 : $len; + $self->{' INFILE'}->read($dat, $count); + $fh->print($dat); + $len -= $count; + } + $self; +} + + +=head2 $t->out_xml($context) + +Outputs this table in XML format. The table is first read (if not already read) and then if +there is no subclass, then the data is dumped as hex data + +=cut + +sub out_xml +{ + my ($self, $context, $depth) = @_; + my ($k); + + if (ref($self) eq __PACKAGE__) + { + $self->read_dat; + Font::TTF::Utils::XML_hexdump($context, $depth, $self->{' dat'}); + } + else + { + $self->read; + foreach $k (sort grep {$_ !~ m/^\s/o} keys %{$self}) + { + $self->XML_element($context, $depth, $k, $self->{$k}); + } + } + $self; +} + + +=head2 $t->XML_element + +Output a particular element based on its contents. + +=cut + +sub XML_element +{ + my ($self, $context, $depth, $k, $dat) = @_; + my ($fh) = $context->{'fh'}; + my ($ndepth, $d); + + return unless defined $dat; + + if (!ref($dat)) + { + $fh->printf("%s<%s>%s\n", $depth, $k, $dat, $k); + return $self; + } + + $fh->printf("%s<%s>\n", $depth, $k); + $ndepth = $depth . $context->{'indent'}; + + if (ref($dat) eq 'SCALAR') + { $self->XML_element($context, $ndepth, 'scalar', $$dat); } + elsif (ref($dat) eq 'ARRAY') + { + foreach $d (@{$dat}) + { $self->XML_element($context, $ndepth, 'elem', $d); } + } + elsif (ref($dat) eq 'HASH') + { + foreach $d (sort grep {$_ !~ m/^\s/o} keys %{$dat}) + { $self->XML_element($context, $ndepth, $d, $dat->{$d}); } + } + else + { + $context->{'name'} = ref($dat); + $context->{'name'} =~ s/^.*://o; + $dat->out_xml($context, $ndepth); + } + + $fh->printf("%s\n", $depth, $k); + $self; +} + + +=head2 $t->XML_end($context, $tag, %attrs) + +Handles the default type of for those tables which aren't subclassed + +=cut + +sub XML_end +{ + my ($self, $context, $tag, %attrs) = @_; + my ($dat, $addr); + + return undef unless ($tag eq 'data'); + $dat = $context->{'text'}; + $dat =~ s/([0-9a-f]{2})\s*/hex($1)/oig; + if (defined $attrs{'addr'}) + { $addr = hex($attrs{'addr'}); } + else + { $addr = length($self->{' dat'}); } + substr($self->{' dat'}, $addr, length($dat)) = $dat; + return $context; +} + + +=head2 $t->dirty($val) + +This sets the dirty flag to the given value or 1 if no given value. It returns the +value of the flag + +=cut + +sub dirty +{ + my ($self, $val) = @_; + my ($res) = $self->{' isDirty'}; + + $self->{' isDirty'} = defined $val ? $val : 1; + $res; +} + +=head2 $t->update + +Each table knows how to update itself. This consists of doing whatever work +is required to ensure that the memory version of the table is consistent +and that other parameters in other tables have been updated accordingly. +I.e. by the end of sending C to all the tables, the memory version +of the font should be entirely consistent. + +Some tables which do no work indicate to themselves the need to update +themselves by setting isDirty above 1. This method resets that accordingly. + +=cut + +sub update +{ + my ($self) = @_; + + if ($self->{' isDirty'}) + { + $self->read; + $self->{' isDirty'} = 0; + return $self; + } + else + { return undef; } +} + + +=head2 $t->empty + +Clears a table of all data to the level of not having been read + +=cut + +sub empty +{ + my ($self) = @_; + my (%keep); + + foreach (qw(INFILE LENGTH OFFSET CSUM PARENT)) + { $keep{" $_"} = 1; } + + map {delete $self->{$_} unless $keep{$_}} keys %$self; + $self; +} + + +=head2 $t->release + +Releases ALL of the memory used by this table, and all of its component/child +objects. This method is called automatically by +'Font::TTF::Font-Erelease' (so you don't have to call it yourself). + +B, that it is important that this method get called at some point prior +to the actual destruction of the object. Internally, we track things in a +structure that can result in circular references, and without calling +'C' these will not properly get cleaned up by Perl. Once this +method has been called, though, don't expect to be able to do anything with the +C object; it'll have B internal state whatsoever. + +B As part of the brute-force cleanup done here, this method +will throw a warning message whenever unexpected key values are found within +the C object. This is done to help ensure that any +unexpected and unfreed values are brought to your attention so that you can bug +us to keep the module updated properly; otherwise the potential for memory +leaks due to dangling circular references will exist. + +=cut + +sub release +{ + my ($self) = @_; + +# delete stuff that we know we can, here + + my @tofree = map { delete $self->{$_} } keys %{$self}; + + while (my $item = shift @tofree) + { + my $ref = ref($item); + if (UNIVERSAL::can($item, 'release')) + { $item->release(); } + elsif ($ref eq 'ARRAY') + { push( @tofree, @{$item} ); } + elsif (UNIVERSAL::isa($ref, 'HASH')) + { release($item); } + } + +# check that everything has gone - it better had! + foreach my $key (keys %{$self}) + { warn ref($self) . " still has '$key' key left after release.\n"; } +} + + +sub __dumpvar__ +{ + my ($self, $key) = @_; + + return ($key eq ' PARENT' ? '...parent...' : $self->{$key}); +} + +1; + +=head1 BUGS + +No known bugs + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Ttc.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Ttc.pm new file mode 100644 index 0000000..b3eeef0 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Ttc.pm @@ -0,0 +1,164 @@ +package Font::TTF::Ttc; + +=head1 NAME + +Font::TTF::Ttc - Truetype Collection class + +=head1 DESCRIPTION + +A TrueType collection is a collection of TrueType fonts in one file in which +tables may be shared between different directories. In order to support this, +the TTC introduces the concept of a table being shared by different TrueType +fonts. This begs the question of what should happen to the ' PARENT' property +of a particular table. It is made to point to the first directory object which +refers to it. It is therefore up to the application to sort out any confusion. +Confusion only occurs if shared tables require access to non-shared tables. +This should not happen since the shared tables are dealing with glyph +information only and the private tables are dealing with encoding and glyph +identification. Thus the general direction is from identification to glyph and +not the other way around (at least not without knowledge of the particular +context). + +=head1 INSTANCE VARIABLES + +The following instance variables are preceded by a space + +=over 4 + +=item fname (P) + +Filename for this TrueType Collection + +=item INFILE (P) + +The filehandle of this collection + +=back + +The following instance variable does not start with a space + +=over 4 + +=item directs + +An array of directories (Font::TTF::Font objects) for each sub-font in the directory + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw($VERSION); + +use IO::File; + +$VERSION = 0.0001; + +=head2 Font::TTF::Ttc->open($fname) + +Opens and reads the given filename as a TrueType Collection. Reading a collection +involves reading each of the directories which go to make up the collection. + +=cut + +sub open +{ + my ($class, $fname) = @_; + my ($self) = {}; + my ($fh); + + unless (ref($fname)) + { + $fh = IO::File->new($fname) or return undef; + binmode $fh; + } else + { $fh = $fname; } + + bless $self, $class; + $self->{' INFILE'} = $fh; + $self->{' fname'} = $fname; + $fh->seek(0, 0); + $self->read; +} + + +=head2 $c->read + +Reads a Collection by reading all the directories in the collection + +=cut + +sub read +{ + my ($self) = @_; + my ($fh) = $self->{' INFILE'}; + my ($dat, $ttc, $ver, $num, $i, $loc); + + $fh->read($dat, 12); + ($ttc, $ver, $num) = unpack("A4N2", $dat); + + return undef unless $ttc eq "ttcf"; + $fh->read($dat, $num << 2); + for ($i = 0; $i < $num; $i++) + { + $loc = unpack("N", substr($dat, $i << 2, 4)); + $self->{'directs'}[$i] = Font::TTF::Font->new('INFILE' => $fh, + 'PARENT' => $self, + 'OFFSET' => $loc) || return undef; + } + for ($i = 0; $i < $num; $i++) + { $self->{'directs'}[$i]->read; } + $self; +} + + +=head2 $c->find($direct, $name, $check, $off, $len) + +Hunts around to see if a table with the given characteristics of name, checksum, +offset and length has been associated with a directory earlier in the list. +Actually on checks the offset since no two tables can share the same offset in +a TrueType font, collection or otherwise. + +=cut + +sub find +{ + my ($self, $direct, $name, $check, $off, $len) = @_; + my ($d); + + foreach $d (@{$self->{'directs'}}) + { + return undef if $d eq $direct; + next unless defined $d->{$name}; + return $d->{$name} if ($d->{$name}{' OFFSET'} == $off); + } + undef; # wierd that the font passed is not in the list! +} + + +=head2 $c->DESTROY + +Closees any opened files by us + +=cut + +sub DESTROY +{ + my ($self) = @_; + close ($self->{' INFILE'}); + undef; +} + +=head1 BUGS + +No known bugs, but then not ever executed! + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Ttopen.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Ttopen.pm new file mode 100644 index 0000000..610a66e --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Ttopen.pm @@ -0,0 +1,1223 @@ +package Font::TTF::Ttopen; + +=head1 NAME + +Font::TTF::Ttopen - Opentype superclass for standard Opentype lookup based tables +(GSUB and GPOS) + +=head1 DESCRIPTION + +Handles all the script, lang, feature, lookup stuff for a +L/L table leaving the class specifics to the +subclass + +=head1 INSTANCE VARIABLES + +The instance variables of an opentype table form a complex sub-module hierarchy. + +=over 4 + +=item Version + +This contains the version of the table as a floating point number + +=item SCRIPTS + +The scripts list is a hash of script tags. Each script tag (of the form +$t->{'SCRIPTS'}{$tag}) has information below it. + +=over 8 + +=item OFFSET + +This variable is preceeded by a space and gives the offset from the start of the +table (not the table section) to the script table for this script + +=item REFTAG + +This variable is preceded by a space and gives a corresponding script tag to this +one such that the offsets in the file are the same. When writing, it is up to the +caller to ensure that the REFTAGs are set correctly, since these will be used to +assume that the scripts are identical. Note that REFTAG must refer to a script which +has no REFTAG of its own. + +=item DEFAULT + +This corresponds to the default language for this script, if there is one, and +contains the same information as an itemised language + +=item LANG_TAGS + +This contains an array of language tag strings (each 4 bytes) corresponding to +the languages listed by this script + +=item $lang + +Each language is a hash containing its information: + +=over 12 + +=item OFFSET + +This variable is preceeded by a a space and gives the offset from the start of +the whole table to the language table for this language + +=item REFTAG + +This variable is preceded by a space and has the same function as for the script +REFTAG, only for the languages within a script. + +=item RE-ORDER + +This indicates re-ordering information, and has not been set. The value should +always be 0. + +=item DEFAULT + +This holds the index of the default feature, if there is one, or -1 otherwise. + +=item FEATURES + +This is an array of feature tags for all the features enabled for this language + +=back + +=back + +=item FEATURES + +The features section of instance variables corresponds to the feature table in +the opentype table. + +=over 8 + +=item FEAT_TAGS + +This array gives the ordered list of feature tags for this table. It is used during +reading and writing for converting between feature index and feature tag. + +=back + +The rest of the FEATURES variable is itself a hash based on the feature tag for +each feature. Each feature has the following structure: + +=over 8 + +=item OFFSET + +This attribute is preceeded by a space and gives the offset relative to the start of the whole +table of this particular feature. + +=item PARMS + +This is an unused offset to the parameters for each feature + +=item LOOKUPS + +This is an array containing indices to lookups in the LOOKUP instance variable of the table + +=item INDEX + +This gives the feature index for this feature and is used during reading and writing for +converting between feature tag and feature index. + +=back + +=item LOOKUP + +This variable is an array of lookups in order and is indexed via the features of a language of a +script. Each lookup contains subtables and other information: + +=over 8 + +=item OFFSET + +This name is preceeded by a space and contains the offset from the start of the table to this +particular lookup + +=item TYPE + +This is a subclass specific type for a lookup. It stipulates the type of lookup and hence subtables +within the lookup + +=item FLAG + +Holds the lookup flag bits + +=item SUB + +This holds an array of subtables which are subclass specific. Each subtable must have +an OFFSET. The other variables described here are an abstraction used in both the +GSUB and GPOS tables which are the target subclasses of this class. + +=over 12 + +=item OFFSET + +This is preceeded by a space and gives the offset relative to the start of the table for this +subtable + +=item FORMAT + +Gives the sub-table sub format for this GSUB subtable. It is assumed that this +value is correct when it comes time to write the subtable. + +=item COVERAGE + +Most lookups consist of a coverage table corresponding to the first +glyph to match. The offset of this coverage table is stored here and the coverage +table looked up against the GSUB table proper. There are two lookups +without this initial coverage table which is used to index into the RULES array. +These lookups have one element in the RULES array which is used for the whole +match. + +=item RULES + +The rules are a complex array. Each element of the array corresponds to an +element in the coverage table (governed by the coverage index). If there is +no coverage table, then there is considered to be only one element in the rules +array. Each element of the array is itself an array corresponding to the +possibly multiple string matches which may follow the initial glyph. Each +element of this array is a hash with fixed keys corresponding to information +needed to match a glyph string or act upon it. Thus the RULES element is an +array of arrays of hashes which contain the following keys: + +=over 16 + +=item MATCH + +This contains a sequence of elements held as an array. The elements may be +glyph ids (gid), class ids (cids), or offsets to coverage tables. Each element +corresponds to one glyph in the glyph string. See MATCH_TYPE for details of +how the different element types are marked. + +=item PRE + +This array holds the sequence of elements preceeding the first match element +and has the same form as the MATCH array. + +=item POST + +This array holds the sequence of elements to be tested for following the match +string and is of the same form as the MATCH array. + +=item ACTION + +This array holds information regarding what should be done if a match is found. +The array may either hold glyph ids (which are used to replace or insert or +whatever glyphs in the glyph string) or 2 element arrays consisting of: + +=over 20 + +=item OFFSET + +Offset from the start of the matched string that the lookup should start at +when processing the substring. + +=item LOOKUP_INDEX + +The index to a lookup to be acted upon on the match string. + +=back + +=back + +=back + +=back + +=item CLASS + +For those lookups which use class categories rather than glyph ids for matching +this is the offset to the class definition used to categories glyphs in the +match string. + +=item PRE_CLASS + +This is the offset to the class definition for the before match glyphs + +=item POST_CLASS + +This is the offset to the class definition for the after match glyphs. + +=item ACTION_TYPE + +This string holds the type of information held in the ACTION variable of a RULE. +It is subclass specific. + +=item MATCH_TYPE + +This holds the type of information in the MATCH array of a RULE. This is subclass +specific. + +=item ADJUST + +This corresponds to a single action for all items in a coverage table. The meaning +is subclass specific. + +=item CACHE + +This key starts with a space + +A hash of other tables (such as coverage tables, classes, anchors, device tables) +based on the offset given in the subtable to that other information. +Note that the documentation is particularly +unhelpful here in that such tables are given as offsets relative to the +beginning of the subtable not the whole GSUB table. This includes those items which +are stored relative to another base within the subtable. + +=back + + +=head1 METHODS + +=cut + +use Font::TTF::Table; +use Font::TTF::Utils; +use Font::TTF::Coverage; +use strict; +use vars qw(@ISA); + +@ISA = qw(Font::TTF::Table); + +=head2 $t->read + +Reads the table passing control to the subclass to handle the subtable specifics + +=cut + +sub read +{ + my ($self) = @_; + my ($dat, $i, $l, $oScript, $oFeat, $oLook, $tag, $nScript, $off, $dLang, $nLang, $lTag); + my ($nFeat, $nLook, $nSub, $j, $temp); + my ($fh) = $self->{' INFILE'}; + my ($moff) = $self->{' OFFSET'}; + + $self->SUPER::read or return $self; + $fh->read($dat, 10); + ($self->{'Version'}, $oScript, $oFeat, $oLook) = TTF_Unpack("vSSS", $dat); + +# read features first so that in the script/lang hierarchy we can use feature tags + + $fh->seek($moff + $oFeat, 0); + $fh->read($dat, 2); + $nFeat = unpack("n", $dat); + $self->{'FEATURES'} = {}; + $l = $self->{'FEATURES'}; + $fh->read($dat, 6 * $nFeat); + for ($i = 0; $i < $nFeat; $i++) + { + ($tag, $off) = unpack("a4n", substr($dat, $i * 6, 6)); + while (defined $l->{$tag}) + { + if ($tag =~ m/(.*?)\s_(\d+)$/o) + { $tag = $1 . " _" . ($2 + 1); } + else + { $tag .= " _0"; } + } + $l->{$tag}{' OFFSET'} = $off + $oFeat; + $l->{$tag}{'INDEX'} = $i; + push (@{$l->{'FEAT_TAGS'}}, $tag); + } + + foreach $tag (grep {m/^.{4}(?:\s_\d+)?$/o} keys %$l) + { + $fh->seek($moff + $l->{$tag}{' OFFSET'}, 0); + $fh->read($dat, 4); + ($l->{$tag}{'PARMS'}, $nLook) = unpack("n2", $dat); + $fh->read($dat, $nLook * 2); + $l->{$tag}{'LOOKUPS'} = [unpack("n*", $dat)]; + } + +# Now the script/lang hierarchy + + $fh->seek($moff + $oScript, 0); + $fh->read($dat, 2); + $nScript = unpack("n", $dat); + $self->{'SCRIPTS'} = {}; + $l = $self->{'SCRIPTS'}; + $fh->read($dat, 6 * $nScript); + for ($i = 0; $i < $nScript; $i++) + { + ($tag, $off) = unpack("a4n", substr($dat, $i * 6, 6)); + $off += $oScript; + foreach (keys %$l) + { $l->{$tag}{' REFTAG'} = $_ if ($l->{$_}{' OFFSET'} == $off + && !defined $l->{$_}{' REFTAG'}); } + $l->{$tag}{' OFFSET'} = $off; + } + + foreach $tag (keys %$l) + { + next if ($l->{$tag}{' REFTAG'}); + $fh->seek($moff + $l->{$tag}{' OFFSET'}, 0); + $fh->read($dat, 4); + ($dLang, $nLang) = unpack("n2", $dat); + $l->{$tag}{'DEFAULT'}{' OFFSET'} = + $dLang + $l->{$tag}{' OFFSET'} if $dLang; + $fh->read($dat, 6 * $nLang); + for ($i = 0; $i < $nLang; $i++) + { + ($lTag, $off) = unpack("a4n", substr($dat, $i * 6, 6)); + $off += $l->{$tag}{' OFFSET'}; + $l->{$tag}{$lTag}{' OFFSET'} = $off; + foreach (@{$l->{$tag}{'LANG_TAGS'}}, 'DEFAULT') + { $l->{$tag}{$lTag}{' REFTAG'} = $_ if ($l->{$tag}{$_}{' OFFSET'} == $off + && !$l->{$tag}{$_}{' REFTAG'}); } + push (@{$l->{$tag}{'LANG_TAGS'}}, $lTag); + } + foreach $lTag (@{$l->{$tag}{'LANG_TAGS'}}, 'DEFAULT') + { + next unless defined $l->{$tag}{$lTag}; + next if ($l->{$tag}{$lTag}{' REFTAG'}); + $fh->seek($moff + $l->{$tag}{$lTag}{' OFFSET'}, 0); + $fh->read($dat, 6); + ($l->{$tag}{$lTag}{'RE-ORDER'}, $l->{$tag}{$lTag}{'DEFAULT'}, $nFeat) + = unpack("n3", $dat); + $fh->read($dat, $nFeat * 2); + $l->{$tag}{$lTag}{'FEATURES'} = [map {$self->{'FEATURES'}{'FEAT_TAGS'}[$_]} unpack("n*", $dat)]; + } + foreach $lTag (@{$l->{$tag}{'LANG_TAGS'}}, 'DEFAULT') + { + next unless $l->{$tag}{$lTag}{' REFTAG'}; + $temp = $l->{$tag}{$lTag}{' REFTAG'}; + $l->{$tag}{$lTag} = ©($l->{$tag}{$temp}); + $l->{$tag}{$lTag}{' REFTAG'} = $temp; + } + } + foreach $tag (keys %$l) + { + next unless $l->{$tag}{' REFTAG'}; + $temp = $l->{$tag}{' REFTAG'}; + $l->{$tag} = ©($l->{$temp}); + $l->{$tag}{' REFTAG'} = $temp; + } + +# And finally the lookups + + $fh->seek($moff + $oLook, 0); + $fh->read($dat, 2); + $nLook = unpack("n", $dat); + $fh->read($dat, $nLook * 2); + $i = 0; + map { $self->{'LOOKUP'}[$i++]{' OFFSET'} = $_; } unpack("n*", $dat); + + for ($i = 0; $i < $nLook; $i++) + { + $l = $self->{'LOOKUP'}[$i]; + $fh->seek($l->{' OFFSET'} + $moff + $oLook, 0); + $fh->read($dat, 6); + ($l->{'TYPE'}, $l->{'FLAG'}, $nSub) = unpack("n3", $dat); + $fh->read($dat, $nSub * 2); + $j = 0; + my @offsets = unpack("n*", $dat); + my $isExtension = ($l->{'TYPE'} == $self->extension()); + for ($j = 0; $j < $nSub; $j++) + { + $l->{'SUB'}[$j]{' OFFSET'} = $offsets[$j]; + $fh->seek($moff + $oLook + $l->{' OFFSET'} + $l->{'SUB'}[$j]{' OFFSET'}, 0); + if ($isExtension) + { + $fh->read($dat, 8); + my $longOff; + (undef, $l->{'TYPE'}, $longOff) = unpack("nnN", $dat); + $l->{'SUB'}[$j]{' OFFSET'} += $longOff; + $fh->seek($moff + $oLook + $l->{' OFFSET'} + $l->{'SUB'}[$j]{' OFFSET'}, 0); + } + $self->read_sub($fh, $l, $j); + } + } + return $self; +} + +=head2 $t->read_sub($fh, $lookup, $index) + +This stub is to allow subclasses to read subtables of lookups in a table specific manner. A +reference to the lookup is passed in along with the subtable index. The file is located at the +start of the subtable to be read + +=cut + +sub read_sub +{ } + + +=head2 $t->extension() + +Returns the lookup number for the extension table that allows access to 32-bit offsets. + +=cut + +sub extension +{ } + + +=head2 $t->out($fh) + +Writes this Opentype table to the output calling $t->out_sub for each sub table +at the appropriate point in the output. The assumption is that on entry the +number of scripts, languages, features, lookups, etc. are all resolved and +the relationships fixed. This includes a script's LANG_TAGS list and that all +scripts and languages in their respective dictionaries either have a REFTAG or contain +real data. + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($i, $j, $base, $off, $tag, $t, $l, $lTag, $oScript, @script, @tags); + my ($end, $nTags, @offs, $oFeat, $oLook, $nSub, $nSubs, $big, $out); + + return $self->SUPER::out($fh) unless $self->{' read'}; + +# First sort the features + $i = 0; + $self->{'FEATURES'}{'FEAT_TAGS'} = [sort grep {m/^.{4}(?:\s_\d+)?$/o} %{$self->{'FEATURES'}}] + if (!defined $self->{'FEATURES'}{'FEAT_TAGS'}); + foreach $t (@{$self->{'FEATURES'}{'FEAT_TAGS'}}) + { $self->{'FEATURES'}{$t}{'INDEX'} = $i++; } + + $base = $fh->tell(); + $fh->print(TTF_Pack("v", $self->{'Version'})); + $fh->print(pack("n3", 10, 0, 0)); + $oScript = $fh->tell() - $base; + @script = sort grep {length($_) == 4} keys %{$self->{'SCRIPTS'}}; + $fh->print(pack("n", $#script + 1)); + foreach $t (@script) + { $fh->print(pack("a4n", $t, 0)); } + + $end = $fh->tell(); + foreach $t (@script) + { + $fh->seek($end, 0); + $tag = $self->{'SCRIPTS'}{$t}; + next if ($tag->{' REFTAG'}); + $tag->{' OFFSET'} = tell($fh) - $base - $oScript; + $fh->print(pack("n2", 0, $#{$tag->{'LANG_TAGS'}} + 1)); + foreach $lTag (sort @{$tag->{'LANG_TAGS'}}) + { $fh->print(pack("a4n", $lTag, 0)); } + foreach $lTag (@{$tag->{'LANG_TAGS'}}, 'DEFAULT') + { + my ($def); + $l = $tag->{$lTag}; + next if (!defined $l || (defined $l->{' REFTAG'} && $l->{' REFTAG'} ne '')); + $l->{' OFFSET'} = $fh->tell() - $base - $oScript - $tag->{' OFFSET'}; + if (defined $l->{'DEFAULT'}) +# { $def = $self->{'FEATURES'}{$l->{'FEATURES'}[$l->{'DEFAULT'}]}{'INDEX'}; } + { $def = $l->{'DEFAULT'}; } + else + { $def = -1; } + $fh->print(pack("n*", $l->{'RE_ORDER'} || 0, $def, $#{$l->{'FEATURES'}} + 1, + map {$self->{'FEATURES'}{$_}{'INDEX'} || 0} @{$l->{'FEATURES'}})); + } + $end = $fh->tell(); + if ($tag->{'DEFAULT'}{' REFTAG'} || defined $tag->{'DEFAULT'}{'FEATURES'}) + { + $fh->seek($base + $oScript + $tag->{' OFFSET'}, 0); + if (defined $tag->{'DEFAULT'}{' REFTAG'}) + { + my ($ttag); + for ($ttag = $tag->{'DEFAULT'}{' REFTAG'}; defined $tag->{$ttag}{' REFTAG'}; $ttag = $tag->{$ttag}{' REFTAG'}) + { } + $off = $tag->{$ttag}{' OFFSET'}; + } + else + { $off = $tag->{'DEFAULT'}{' OFFSET'}; } + $fh->print(pack("n", $off)); + } + $fh->seek($base + $oScript + $tag->{' OFFSET'} + 4, 0); + foreach (sort @{$tag->{'LANG_TAGS'}}) + { + if (defined $tag->{$_}{' REFTAG'}) + { + my ($ttag); + for ($ttag = $tag->{$_}{' REFTAG'}; defined $tag->{$ttag}{' REFTAG'}; $ttag = $tag->{$ttag}{' REFTAG'}) + { } + $off = $tag->{$ttag}{' OFFSET'}; + } + else + { $off = $tag->{$_}{' OFFSET'}; } + $fh->print(pack("a4n", $_, $off)); + } + } + $fh->seek($base + $oScript + 2, 0); + foreach $t (@script) + { + $tag = $self->{'SCRIPTS'}{$t}; + $off = $tag->{' REFTAG'} ? $tag->{$tag->{' REFTAG'}}{' OFFSET'} : $tag->{' OFFSET'}; + $fh->print(pack("a4n", $t, $off)); + } + + $fh->seek($end, 0); + $oFeat = $end - $base; + $nTags = $#{$self->{'FEATURES'}{'FEAT_TAGS'}} + 1; + $fh->print(pack("n", $nTags)); + $fh->print(pack("a4n", " ", 0) x $nTags); + + foreach $t (@{$self->{'FEATURES'}{'FEAT_TAGS'}}) + { + $tag = $self->{'FEATURES'}{$t}; + $tag->{' OFFSET'} = tell($fh) - $base - $oFeat; + $fh->print(pack("n*", 0, $#{$tag->{'LOOKUPS'}} + 1, @{$tag->{'LOOKUPS'}})); + } + $end = $fh->tell(); + $fh->seek($oFeat + $base + 2, 0); + foreach $t (@{$self->{'FEATURES'}{'FEAT_TAGS'}}) + { $fh->print(pack("a4n", $t, $self->{'FEATURES'}{$t}{' OFFSET'})); } + + undef $big; + $fh->seek($end, 0); + $oLook = $end - $base; + + # Start Lookup List Table + $nTags = $#{$self->{'LOOKUP'}} + 1; + $fh->print(pack("n", $nTags)); + $fh->print(pack("n", 0) x $nTags); + $end = $fh->tell(); # end of LookupListTable = start of Lookups + foreach $tag (@{$self->{'LOOKUP'}}) + { $nSubs += $self->num_sub($tag); } + for ($i = 0; $i < $nTags; $i++) + { + $fh->seek($end, 0); + $tag = $self->{'LOOKUP'}[$i]; + $off = $end - $base - $oLook; # BH 2004-03-04 + # Is there room, from the start of this i'th lookup, for this and the remaining + # lookups to be wrapped in extension lookups? + if (!defined $big && $off + ($nTags - $i) * 6 + $nSubs * 10 > 65535) # BH 2004-03-04 + { + # Not enough room -- need to start an extension! + my ($k, $ext); + $ext = $self->extension(); + # Must turn previous lookup into the first extension + $i--; + $tag = $self->{'LOOKUP'}[$i]; + $end = $tag->{' OFFSET'} + $base + $oLook; + $fh->seek($end, 0); + $big = $i; + # For this and the remaining lookups, build extensions lookups + for ($j = $i; $j < $nTags; $j++) + { + $tag = $self->{'LOOKUP'}[$j]; + $nSub = $self->num_sub($tag); + $fh->print(pack("nnn", $ext, $tag->{'FLAG'}, $nSub)); + $fh->print(pack("n*", map {$_ * 8 + 6 + $nSub * 2} (0 .. $nSub-1))); # BH 2004-03-04 + $tag->{' EXT_OFFSET'} = $fh->tell(); # = first extension lookup subtable + $tag->{' OFFSET'} = $tag->{' EXT_OFFSET'} - $nSub * 2 - 6 - $base - $oLook; # offset to this extension lookup + for ($k = 0; $k < $nSub; $k++) + { $fh->print(pack('nnN', 1, $tag->{'TYPE'}, 0)); } + } + + $tag = $self->{'LOOKUP'}[$i]; + # Leave file positioned after all the extension lookups -- where the referenced lookups will start. + } + $tag->{' OFFSET'} = $off unless defined $big; # BH 2004-03-04 + $nSub = $self->num_sub($tag); + if (!defined $big) + { + $fh->print(pack("nnn", $tag->{'TYPE'}, $tag->{'FLAG'}, $nSub)); + $fh->print(pack("n", 0) x $nSub); + } + else + { $end = $tag->{' EXT_OFFSET'}; } + my (@offs, $out, @refs); + for ($j = 0; $j < $nSub; $j++) + { + my ($ctables) = {}; + my ($base) = length($out); + push(@offs, tell($fh) - $end + $base); + $out .= $self->out_sub($fh, $tag, $j, $ctables, $base); + push (@refs, [$ctables, $base]); + } + out_final($fh, $out, \@refs); + $end = $fh->tell(); + if (!defined $big) + { + $fh->seek($tag->{' OFFSET'} + $base + $oLook + 6, 0); + $fh->print(pack("n*", @offs)); + } + else + { + $fh->seek($tag->{' EXT_OFFSET'}, 0); + for ($j = 0; $j < $nSub; $j++) + { $fh->print(pack('nnN', 1, $tag->{'TYPE'}, $offs[$j] - $j * 8)); } + } + } + $fh->seek($oLook + $base + 2, 0); + $fh->print(pack("n*", map {$self->{'LOOKUP'}[$_]{' OFFSET'}} (0 .. $nTags - 1))); + $fh->seek($base + 6, 0); + $fh->print(pack('n2', $oFeat, $oLook)); + $fh->seek($end, 0); + $self; +} + + +=head2 $t->num_sub($lookup) + +Asks the subclass to count the number of subtables for a particular lookup and to +return that value. Used in out(). + +=cut + +sub num_sub +{ + my ($self, $lookup) = @_; + + return $#{$lookup->{'SUB'}} + 1; +} + + +=head2 $t->out_sub($fh, $lookup, $index) + +This stub is to allow subclasses to output subtables of lookups in a table specific manner. A +reference to the lookup is passed in along with the subtable index. The file is located at the +start of the subtable to be output + +=cut + +sub out_sub +{ } + +=head2 $t->dirty + +Setting GPOS or GSUB dirty means that OS/2 may need updating, so set it dirty. + +=cut + +sub dirty +{ + my ($self, $val) = @_; + my $res = $self->SUPER::dirty ($val); + $self->{' PARENT'}{'OS/2'}->read->dirty($val) if exists $self->{' PARENT'}{'OS/2'}; + $res; +} + +=head2 $t->maxContext + +Returns the length of the longest opentype rule in this table. + +=cut + +sub maxContext +{ + my ($self) = @_; + + # Make sure table is read + $self->read; + + # Calculate my contribution to OS/2 usMaxContext + + my ($maxcontext, $l, $s, $r, $m); + + for $l (@{$self->{'LOOKUP'}}) # Examine each lookup + { + for $s (@{$l->{'SUB'}}) # Multiple possible subtables for this lookup + { + for $r (@{$s->{'RULES'}}) # One ruleset for each covered glyph + { + for $m (@{$r}) # Multiple possible matches for this covered glyph + { + my $lgt; + $lgt++ if exists $s->{'COVERAGE'}; # Count 1 for the coverage table if it exists + for (qw(MATCH PRE POST)) + { + $lgt += @{$m->{$_}} if exists $m->{$_}; + } + $maxcontext = $lgt if $lgt > $maxcontext; + } + } + + } + } + + $maxcontext; +} + + +=head2 $t->update + +Unless $t->{' PARENT'}{' noharmony'} is true, update will make sure that GPOS and GSUB include +the same scripts and languages. Any added scripts and languages will have empty feature sets. + +=cut + +# Assumes we are called on both GSUB and GPOS. So simply ADDS scripts and languages to $self that it finds +# in the other table. + +sub update +{ + my ($self) = @_; + + return undef unless ($self->SUPER::update); + + # Enforce script/lang congruence unless asked not to: + return $self if $self->{' PARENT'}{' noharmony'}; + + # Find my sibling (GSUB or GPOS, depending on which I am) + my $sibling = ref($self) eq 'Font::TTF::GSUB' ? 'GPOS' : ref($self) eq 'Font::TTF::GPOS' ? 'GSUB' : undef; + return $self unless $sibling && exists $self->{' PARENT'}{$sibling}; + $sibling = $self->{' PARENT'}{$sibling}; + next unless defined $sibling; + + # Look through scripts defined in sibling: + for my $sTag (grep {length($_) == 4} keys %{$sibling->{'SCRIPTS'}}) + { + my $sibScript = $sibling->{'SCRIPTS'}{$sTag}; + $sibScript = $sibling->{$sibScript->{' REFTAG'}} if exists $sibScript->{' REFTAG'} && $sibScript->{' REFTAG'} ne ''; + + $self->{'SCRIPTS'}{$sTag} = {} unless defined $self->{'SCRIPTS'}{$sTag}; # Create script if not present in $self + + my $myScript = $self->{'SCRIPTS'}{$sTag}; + $myScript = $self->{$myScript->{' REFTAG'}} if exists $myScript->{' REFTAG'} && $myScript->{' REFTAG'} ne ''; + + foreach my $lTag (@{$sibScript->{'LANG_TAGS'}}) + { + # Ok, found a script/lang that is in our sibling. + next if exists $myScript->{$lTag}; # Already in $self + + # Need to create this lang: + push @{$myScript->{'LANG_TAGS'}}, $lTag; + $myScript->{$lTag} = { 'FEATURES' => [] }; + } + unless (defined $myScript->{'DEFAULT'}) + { + # Create default lang for this script. Link to 'dflt' if it exists + $myScript->{'DEFAULT'} = exists $myScript->{'dflt'} ? {' REFTAG' => 'dflt'} : { 'FEATURES' => [] }; + } + } + $self; +} + +=head1 Internal Functions & Methods + +Most of these methods are used by subclasses for handling such things as coverage +tables. + +=head2 copy($ref) + +Internal function to copy the top level of a dictionary to create a new dictionary. +Only the top level is copied. + +=cut + +sub copy +{ + my ($ref) = @_; + my ($res) = {}; + + foreach (keys %$ref) + { $res->{$_} = $ref->{$_}; } + $res; +} + + +=head2 $t->read_cover($cover_offset, $lookup_loc, $lookup, $fh, $is_cover) + +Reads a coverage table and stores the results in $lookup->{' CACHE'}, that is, if +it hasn't been read already. + +=cut + +sub read_cover +{ + my ($self, $offset, $base, $lookup, $fh, $is_cover) = @_; + my ($loc) = $fh->tell(); + my ($cover, $str); + + return undef unless $offset; + $str = sprintf("%X", $base + $offset); + return $lookup->{' CACHE'}{$str} if defined $lookup->{' CACHE'}{$str}; + $fh->seek($base + $offset, 0); + $cover = Font::TTF::Coverage->new($is_cover)->read($fh); + $fh->seek($loc, 0); + $lookup->{' CACHE'}{$str} = $cover; + return $cover; +} + + +=head2 ref_cache($obj, $cache, $offset) + +Internal function to keep track of the local positioning of subobjects such as +coverage and class definition tables, and their offsets. +What happens is that the cache is a hash of +sub objects indexed by the reference (using a string mashing of the +reference name which is valid for the duration of the reference) and holds a +list of locations in the output string which should be filled in with the +offset to the sub object when the final string is output in out_final. + +Uses tricks for Tie::Refhash + +=cut + +sub ref_cache +{ + my ($obj, $cache, $offset) = @_; + + return 0 unless defined $obj; + unless (defined $cache->{"$obj"}) + { push (@{$cache->{''}}, $obj); } + push (@{$cache->{"$obj"}}, $offset); + return 0; +} + + +=head2 out_final($fh, $out, $cache_list, $state) + +Internal function to actually output everything to the file handle given that +now we know the offset to the first sub object to be output and which sub objects +are to be output and what locations need to be updated, we can now +generate everything. $cache_list is an array of two element arrays. The first element +is a cache object, the second is an offset to be subtracted from each reference +to that object made in the cache. + +If $state is 1, then the output is not sent to the filehandle and the return value +is the string to be output. If $state is absent or 0 then output is not limited +by storing in a string first and the return value is ""; + +=cut + +sub out_final +{ + my ($fh, $out, $cache_list, $state) = @_; + my ($len) = length($out || ''); + my ($base_loc) = $state ? 0 : $fh->tell(); + my ($loc, $t, $r, $s, $master_cache, $offs, $str, %vecs); + + $fh->print($out || '') unless $state; # first output the current attempt + foreach $r (@$cache_list) + { + $offs = $r->[1]; + foreach $t (@{$r->[0]{''}}) + { + $str = "$t"; + if (!defined $master_cache->{$str}) + { + my ($vec) = $t->signature(); + if ($vecs{$vec}) + { $master_cache->{$str} = $master_cache->{$vecs{$vec}}; } + else + { + $vecs{$vec} = $str; + $master_cache->{$str} = ($state ? length($out) : $fh->tell()) + - $base_loc; + if ($state) + { $out .= $t->out($fh, 1); } + else + { $t->out($fh, 0); } + } + } + foreach $s (@{$r->[0]{$str}}) + { substr($out, $s, 2) = pack('n', $master_cache->{$str} - $offs); } + } + } + if ($state) + { return $out; } + else + { + $loc = $fh->tell(); + $fh->seek($base_loc, 0); + $fh->print($out || ''); # the corrected version + $fh->seek($loc, 0); + } +} + + +=head2 $self->read_context($lookup, $fh, $type, $fmt, $cover, $count, $loc) + +Internal method to read context (simple and chaining context) lookup subtables for +the GSUB and GPOS table types. The assumed values for $type correspond to those +for GSUB, so GPOS should adjust the values upon calling. + +=cut + +sub read_context +{ + my ($self, $lookup, $fh, $type, $fmt, $cover, $count, $loc) = @_; + my ($dat, $i, $s, $t, @subst, @srec, $mcount, $scount); + + if ($type == 5 && $fmt < 3) + { + if ($fmt == 2) + { + $fh->read($dat, 2); + $lookup->{'CLASS'} = $self->read_cover($count, $loc, $lookup, $fh, 0); + $count = TTF_Unpack('S', $dat); + } + $fh->read($dat, $count << 1); + foreach $s (TTF_Unpack('S*', $dat)) + { + if ($s == 0) + { + push (@{$lookup->{'RULES'}}, []); + next; + } + @subst = (); + $fh->seek($loc + $s, 0); + $fh->read($dat, 2); + $t = TTF_Unpack('S', $dat); + $fh->read($dat, $t << 1); + foreach $t (TTF_Unpack('S*', $dat)) + { + $fh->seek($loc + $s + $t, 0); + @srec = (); + $fh->read($dat, 4); + ($mcount, $scount) = TTF_Unpack('S2', $dat); + $mcount--; + $fh->read($dat, ($mcount << 1) + ($scount << 2)); + for ($i = 0; $i < $scount; $i++) + { push (@srec, [TTF_Unpack('S2', substr($dat, + ($mcount << 1) + ($i << 2), 4))]); } + push (@subst, {'ACTION' => [@srec], + 'MATCH' => [TTF_Unpack('S*', + substr($dat, 0, $mcount << 1))]}); + } + push (@{$lookup->{'RULES'}}, [@subst]); + } + $lookup->{'ACTION_TYPE'} = 'l'; + $lookup->{'MATCH_TYPE'} = ($fmt == 2 ? 'c' : 'g'); + } elsif ($type == 5 && $fmt == 3) + { + $fh->read($dat, ($cover << 1) + ($count << 2)); + @subst = (); @srec = (); + for ($i = 0; $i < $cover; $i++) + { push (@subst, $self->read_cover(TTF_Unpack('S', substr($dat, $i << 1, 2)), + $loc, $lookup, $fh, 1)); } + for ($i = 0; $i < $count; $i++) + { push (@srec, [TTF_Unpack('S2', substr($dat, ($count << 1) + ($i << 2), 4))]); } + $lookup->{'RULES'} = [[{'ACTION' => [@srec], 'MATCH' => [@subst]}]]; + $lookup->{'ACTION_TYPE'} = 'l'; + $lookup->{'MATCH_TYPE'} = 'o'; + } elsif ($type == 6 && $fmt < 3) + { + if ($fmt == 2) + { + $fh->read($dat, 6); + $lookup->{'PRE_CLASS'} = $self->read_cover($count, $loc, $lookup, $fh, 0) if $count; + ($i, $mcount, $count) = TTF_Unpack('S3', $dat); # messy: 2 classes & count + $lookup->{'CLASS'} = $self->read_cover($i, $loc, $lookup, $fh, 0) if $i; + $lookup->{'POST_CLASS'} = $self->read_cover($mcount, $loc, $lookup, $fh, 0) if $mcount; + } + $fh->read($dat, $count << 1); + foreach $s (TTF_Unpack('S*', $dat)) + { + if ($s == 0) + { + push (@{$lookup->{'RULES'}}, []); + next; + } + @subst = (); + $fh->seek($loc + $s, 0); + $fh->read($dat, 2); + $t = TTF_Unpack('S', $dat); + $fh->read($dat, $t << 1); + foreach $i (TTF_Unpack('S*', $dat)) + { + $fh->seek($loc + $s + $i, 0); + @srec = (); + $t = {}; + $fh->read($dat, 2); + $mcount = TTF_Unpack('S', $dat); + if ($mcount > 0) + { + $fh->read($dat, $mcount << 1); + $t->{'PRE'} = [TTF_Unpack('S*', $dat)]; + } + $fh->read($dat, 2); + $mcount = TTF_Unpack('S', $dat); + if ($mcount > 1) + { + $fh->read($dat, ($mcount - 1) << 1); + $t->{'MATCH'} = [TTF_Unpack('S*', $dat)]; + } + $fh->read($dat, 2); + $mcount = TTF_Unpack('S', $dat); + if ($mcount > 0) + { + $fh->read($dat, $mcount << 1); + $t->{'POST'} = [TTF_Unpack('S*', $dat)]; + } + $fh->read($dat, 2); + $scount = TTF_Unpack('S', $dat); + $fh->read($dat, $scount << 2); + for ($i = 0; $i < $scount; $i++) + { push (@srec, [TTF_Unpack('S2', substr($dat, $i << 2))]); } + $t->{'ACTION'} = [@srec]; + push (@subst, $t); + } + push (@{$lookup->{'RULES'}}, [@subst]); + } + $lookup->{'ACTION_TYPE'} = 'l'; + $lookup->{'MATCH_TYPE'} = ($fmt == 2 ? 'c' : 'g'); + } elsif ($type == 6 && $fmt == 3) + { + $t = {}; + unless ($cover == 0) + { + @subst = (); + $fh->read($dat, $cover << 1); + foreach $s (TTF_Unpack('S*', $dat)) + { push(@subst, $self->read_cover($s, $loc, $lookup, $fh, 1)); } + $t->{'PRE'} = [@subst]; + } + $fh->read($dat, 2); + $count = TTF_Unpack('S', $dat); + unless ($count == 0) + { + @subst = (); + $fh->read($dat, $count << 1); + foreach $s (TTF_Unpack('S*', $dat)) + { push(@subst, $self->read_cover($s, $loc, $lookup, $fh, 1)); } + $t->{'MATCH'} = [@subst]; + } + $fh->read($dat, 2); + $count = TTF_Unpack('S', $dat); + unless ($count == 0) + { + @subst = (); + $fh->read($dat, $count << 1); + foreach $s (TTF_Unpack('S*', $dat)) + { push(@subst, $self->read_cover($s, $loc, $lookup, $fh, 1)); } + $t->{'POST'} = [@subst]; + } + $fh->read($dat, 2); + $count = TTF_Unpack('S', $dat); + @subst = (); + $fh->read($dat, $count << 2); + for ($i = 0; $i < $count; $i++) + { push (@subst, [TTF_Unpack('S2', substr($dat, $i << 2, 4))]); } + $t->{'ACTION'} = [@subst]; + $lookup->{'RULES'} = [[$t]]; + $lookup->{'ACTION_TYPE'} = 'l'; + $lookup->{'MATCH_TYPE'} = 'o'; + } + $lookup; +} + + +=head2 $self->out_context($lookup, $fh, $type, $fmt, $ctables, $out, $num) + +Provides shared behaviour between GSUB and GPOS tables during output for context +(chained and simple) rules. In addition, support is provided here for type 4 GSUB +tables, which are not used in GPOS. The value for $type corresponds to the type +in a GSUB table so calling from GPOS should adjust the value accordingly. + +=cut + +sub out_context +{ + my ($self, $lookup, $fh, $type, $fmt, $ctables, $out, $num, $base) = @_; + my ($offc, $offd, $i, $j, $r, $t, $numd); + + $out ||= ''; + if (($type == 4 || $type == 5 || $type == 6) && ($fmt == 1 || $fmt == 2)) + { + my ($base_off); + + if ($fmt == 1) + { + $out = pack("nnn", $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), + $num); + $base_off = 6; + } elsif ($type == 5) + { + $out = pack("nnnn", $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), + Font::TTF::Ttopen::ref_cache($lookup->{'CLASS'}, $ctables, 4 + $base), $num); + $base_off = 8; + } elsif ($type == 6) + { + $out = pack("n6", $fmt, Font::TTF::Ttopen::ref_cache($lookup->{'COVERAGE'}, $ctables, 2 + $base), + Font::TTF::Ttopen::ref_cache($lookup->{'PRE_CLASS'}, $ctables, 4 + $base), + Font::TTF::Ttopen::ref_cache($lookup->{'CLASS'}, $ctables, 6 + $base), + Font::TTF::Ttopen::ref_cache($lookup->{'POST_CLASS'}, $ctables, 8 + $base), + $num); + $base_off = 12; + } + + $out .= pack('n*', (0) x $num); + $offc = length($out); + for ($i = 0; $i < $num; $i++) + { + $r = $lookup->{'RULES'}[$i]; + next unless exists $r->[0]{'ACTION'}; + $numd = $#{$r} + 1; + substr($out, ($i << 1) + $base_off, 2) = pack('n', $offc); + $out .= pack('n*', $numd, (0) x $numd); + $offd = length($out) - $offc; + for ($j = 0; $j < $numd; $j++) + { + substr($out, $offc + 2 + ($j << 1), 2) = pack('n', $offd); + if ($type == 4) + { + $out .= pack('n*', $r->[$j]{'ACTION'}[0], $#{$r->[$j]{'MATCH'}} + 2, + @{$r->[$j]{'MATCH'}}); + } elsif ($type == 5) + { + $out .= pack('n*', $#{$r->[$j]{'MATCH'}} + 2, + $#{$r->[$j]{'ACTION'}} + 1, + @{$r->[$j]{'MATCH'}}); + foreach $t (@{$r->[$j]{'ACTION'}}) + { $out .= pack('n2', @$t); } + } elsif ($type == 6) + { + $out .= pack('n*', $#{$r->[$j]{'PRE'}} + 1, @{$r->[$j]{'PRE'}}, + $#{$r->[$j]{'MATCH'}} + 2, @{$r->[$j]{'MATCH'}}, + $#{$r->[$j]{'POST'}} + 1, @{$r->[$j]{'POST'}}, + $#{$r->[$j]{'ACTION'}} + 1); + foreach $t (@{$r->[$j]{'ACTION'}}) + { $out .= pack('n2', @$t); } + } + $offd = length($out) - $offc; + } + $offc = length($out); + } + } elsif ($type == 5 && $fmt == 3) + { + $out .= pack('n3', $fmt, $#{$lookup->{'RULES'}[0][0]{'MATCH'}} + 1, + $#{$lookup->{'RULES'}[0][0]{'ACTION'}} + 1); + foreach $t (@{$lookup->{'RULES'}[0][0]{'MATCH'}}) + { $out .= pack('n', Font::TTF::Ttopen::ref_cache($t, $ctables, length($out) + $base)); } + foreach $t (@{$lookup->{'RULES'}[0][0]{'ACTION'}}) + { $out .= pack('n2', @$t); } + } elsif ($type == 6 && $fmt == 3) + { + $r = $lookup->{'RULES'}[0][0]; + no strict 'refs'; # temp fix - more code needed (probably "if" statements in the event 'PRE' or 'POST' are empty) + $out .= pack('n2', $fmt, defined $r->{'PRE'} ? scalar @{$r->{'PRE'}} : 0); + foreach $t (@{$r->{'PRE'}}) + { $out .= pack('n', Font::TTF::Ttopen::ref_cache($t, $ctables, length($out) + $base)); } + $out .= pack('n', defined $r->{'MATCH'} ? scalar @{$r->{'MATCH'}} : 0); + foreach $t (@{$r->{'MATCH'}}) + { $out .= pack('n', Font::TTF::Ttopen::ref_cache($t, $ctables, length($out) + $base)); } + $out .= pack('n', defined $r->{'POST'} ? scalar @{$r->{'POST'}} : 0); + foreach $t (@{$r->{'POST'}}) + { $out .= pack('n', Font::TTF::Ttopen::ref_cache($t, $ctables, length($out) + $base)); } + $out .= pack('n', defined $r->{'ACTION'} ? scalar @{$r->{'ACTION'}} : 0); + foreach $t (@{$r->{'ACTION'}}) + { $out .= pack('n2', @$t); } + } + $out; +} + +=head1 BUGS + +=over 4 + +=item * + +No way to share cachable items (coverage tables, classes, anchors, device tables) +across different lookups. The items are always output after the lookup and +repeated if necessary. Within lookup sharing is possible. + +=back + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + +1; + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Useall.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Useall.pm new file mode 100644 index 0000000..85e69dc --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Useall.pm @@ -0,0 +1,54 @@ +use Font::TTF::Sill; +use Font::TTF::Cvt_; +use Font::TTF::Fpgm; +use Font::TTF::Glyf; +use Font::TTF::Hdmx; +use Font::TTF::Kern; +use Font::TTF::Loca; +use Font::TTF::LTSH; +use Font::TTF::Name; +use Font::TTF::OS_2; +use Font::TTF::PCLT; +use Font::TTF::Post; +use Font::TTF::Prep; +use Font::TTF::Vmtx; +use Font::TTF::AATKern; +use Font::TTF::AATutils; +use Font::TTF::Anchor; +use Font::TTF::Bsln; +use Font::TTF::Delta; +use Font::TTF::Fdsc; +use Font::TTF::Feat; +use Font::TTF::GrFeat; +use Font::TTF::Fmtx; +use Font::TTF::GPOS; +use Font::TTF::Mort; +use Font::TTF::Prop; +use Font::TTF::GDEF; +use Font::TTF::Coverage; +use Font::TTF::GSUB; +use Font::TTF::Hhea; +use Font::TTF::Table; +use Font::TTF::Ttopen; +use Font::TTF::Glyph; +use Font::TTF::Head; +use Font::TTF::Hmtx; +use Font::TTF::Vhea; +use Font::TTF::Cmap; +use Font::TTF::Utils; +use Font::TTF::Maxp; +use Font::TTF::Font; +use Font::TTF::Kern::ClassArray; +use Font::TTF::Kern::CompactClassArray; +use Font::TTF::Kern::OrderedList; +use Font::TTF::Kern::StateTable; +use Font::TTF::Kern::Subtable; +use Font::TTF::Mort::Chain; +use Font::TTF::Mort::Contextual; +use Font::TTF::Mort::Insertion; +use Font::TTF::Mort::Ligature; +use Font::TTF::Mort::Noncontextual; +use Font::TTF::Mort::Rearrangement; +use Font::TTF::Mort::Subtable; + +1; diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Utils.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Utils.pm new file mode 100644 index 0000000..a849ee3 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Utils.pm @@ -0,0 +1,630 @@ +package Font::TTF::Utils; + +=head1 NAME + +Font::TTF::Utils - Utility functions to save fingers + +=head1 DESCRIPTION + +Lots of useful functions to save my fingers, especially for trivial tables + +=head1 FUNCTIONS + +The following functions are exported + +=cut + +use strict; +use vars qw(@ISA @EXPORT $VERSION @EXPORT_OK); +require Exporter; + +@ISA = qw(Exporter); +@EXPORT = qw(TTF_Init_Fields TTF_Read_Fields TTF_Out_Fields TTF_Pack + TTF_Unpack TTF_word_utf8 TTF_utf8_word TTF_bininfo); +@EXPORT_OK = (@EXPORT, qw(XML_hexdump)); +$VERSION = 0.0001; + +=head2 ($val, $pos) = TTF_Init_Fields ($str, $pos) + +Given a field description from the C section, creates an absolute entry +in the fields associative array for the class + +=cut + +sub TTF_Init_Fields +{ + my ($str, $pos, $inval) = @_; + my ($key, $val, $res, $len, $rel); + + $str =~ s/\r?\n$//o; + if ($inval) + { ($key, $val) = ($str, $inval); } + else + { ($key, $val) = split(',\s*', $str); } + return (undef, undef, 0) unless (defined $key && $key ne ""); + if ($val =~ m/^(\+?)(\d*)(\D+)(\d*)/oi) + { + $rel = $1; + if ($rel eq "+") + { $pos += $2; } + elsif ($2 ne "") + { $pos = $2; } + $val = $3; + $len = $4; + } + $len = "" unless defined $len; + $pos = 0 if !defined $pos || $pos eq ""; + $res = "$pos:$val:$len"; + if ($val eq "f" || $val eq 'v' || $val =~ m/^[l]/oi) + { $pos += 4 * ($len ne "" ? $len : 1); } + elsif ($val eq "F" || $val =~ m/^[s]/oi) + { $pos += 2 * ($len ne "" ? $len : 1); } + else + { $pos += 1 * ($len ne "" ? $len : 1); } + + ($key, $res, $pos); +} + + +=head2 TTF_Read_Fields($obj, $dat, $fields) + +Given a block of data large enough to account for all the fields in a table, +processes the data block to convert to the values in the objects instance +variables by name based on the list in the C block which has been run +through C + +=cut + +sub TTF_Read_Fields +{ + my ($self, $dat, $fields) = @_; + my ($pos, $type, $res, $f, $arrlen, $arr, $frac); + + foreach $f (keys %{$fields}) + { + ($pos, $type, $arrlen) = split(':', $fields->{$f}); + $pos = 0 if $pos eq ""; + if ($arrlen ne "") + { $self->{$f} = [TTF_Unpack("$type$arrlen", substr($dat, $pos))]; } + else + { $self->{$f} = TTF_Unpack("$type", substr($dat, $pos)); } + } + $self; +} + + +=head2 TTF_Unpack($fmt, $dat) + +A TrueType types equivalent of Perls C function. Thus $fmt consists of +type followed by an optional number of elements to read including *. The type +may be one of: + + c BYTE + C CHAR + f FIXED + F F2DOT14 + l LONG + L ULONG + s SHORT + S USHORT + v Version number (FIXED) + +Note that C, C and C are not data types but units. + +Returns array of scalar (first element) depending on context + +=cut + +sub TTF_Unpack +{ + my ($fmt, $dat) = @_; + my ($res, $frac, $i, $arrlen, $type, @res); + + while ($fmt =~ s/^([cflsv])(\d+|\*)?//oi) + { + $type = $1; + $arrlen = $2; + $arrlen = 1 if !defined $arrlen || $arrlen eq ""; + $arrlen = -1 if $arrlen eq "*"; + + for ($i = 0; ($arrlen == -1 && $dat ne "") || $i < $arrlen; $i++) + { + if ($type eq "f") + { + ($res, $frac) = unpack("nn", $dat); + substr($dat, 0, 4) = ""; + $res -= 65536 if $res > 32767; + $res += $frac / 65536.; + } + elsif ($type eq "v") + { + ($res, $frac) = unpack("nn", $dat); + substr($dat, 0, 4) = ""; + $res -= 65536 if $res > 32767; + $res = sprintf("%d.%X", $res, $frac); + } + elsif ($type eq "F") + { + $res = unpack("n", $dat); + substr($dat, 0, 2) = ""; +# $res -= 65536 if $res >= 32768; + $frac = $res & 0x3fff; + $res >>= 14; + $res -= 4 if $res > 1; +# $frac -= 16384 if $frac > 8191; + $res += $frac / 16384.; + } + elsif ($type =~ m/^[l]/oi) + { + $res = unpack("N", $dat); + substr($dat, 0, 4) = ""; + $res -= (1 << 32) if ($type eq "l" && $res >= 1 << 31); + } + elsif ($type =~ m/^[s]/oi) + { + $res = unpack("n", $dat); + substr($dat, 0, 2) = ""; + $res -= 65536 if ($type eq "s" && $res >= 32768); + } + elsif ($type eq "c") + { + $res = unpack("c", $dat); + substr($dat, 0, 1) = ""; + } + else + { + $res = unpack("C", $dat); + substr($dat, 0, 1) = ""; + } + push (@res, $res); + } + } + return wantarray ? @res : $res[0]; +} + + +=head2 $dat = TTF_Out_Fields($obj, $fields, $len) + +Given the fields table from C writes out the instance variables from +the object to the filehandle in TTF binary form. + +=cut + +sub TTF_Out_Fields +{ + my ($obj, $fields, $len) = @_; + my ($dat) = "\000" x $len; + my ($f, $pos, $type, $res, $arr, $arrlen, $frac); + + foreach $f (keys %{$fields}) + { + ($pos, $type, $arrlen) = split(':', $fields->{$f}); + if ($arrlen ne "") + { $res = TTF_Pack("$type$arrlen", @{$obj->{$f}}); } + else + { $res = TTF_Pack("$type", $obj->{$f}); } + substr($dat, $pos, length($res)) = $res; + } + $dat; +} + + +=head2 $dat = TTF_Pack($fmt, @data) + +The TrueType equivalent to Perl's C function. See details of C +for how to work the $fmt string. + +=cut + +sub TTF_Pack +{ + my ($fmt, @obj) = @_; + my ($type, $i, $arrlen, $dat, $res, $frac); + + $dat = ''; + while ($fmt =~ s/^([flscv])(\d+|\*)?//oi) + { + $type = $1; + $arrlen = $2 || ""; + $arrlen = $#obj + 1 if $arrlen eq "*"; + $arrlen = 1 if $arrlen eq ""; + + for ($i = 0; $i < $arrlen; $i++) + { + $res = shift(@obj) || 0; + if ($type eq "f") + { + $frac = int(($res - int($res)) * 65536); + $res = (int($res) << 16) + $frac; + $dat .= pack("N", $res); + } + elsif ($type eq "v") + { + if ($res =~ s/\.(\d+)$//o) + { + $frac = $1; + $frac .= "0" x (4 - length($frac)); + } + else + { $frac = 0; } + $dat .= pack('nn', $res, eval("0x$frac")); + } + elsif ($type eq "F") + { + $frac = int(($res - int($res)) * 16384); + $res = (int($res) << 14) + $frac; + $dat .= pack("n", $res); + } + elsif ($type =~ m/^[l]/oi) + { + $res += 1 << 32 if ($type eq 'L' && $res < 0); + $dat .= pack("N", $res); + } + elsif ($type =~ m/^[s]/oi) + { + $res += 1 << 16 if ($type eq 'S' && $res < 0); + $dat .= pack("n", $res); + } + elsif ($type eq "c") + { $dat .= pack("c", $res); } + else + { $dat .= pack("C", $res); } + } + } + $dat; +} + + +=head2 ($num, $range, $select, $shift) = TTF_bininfo($num) + +Calculates binary search information from a number of elements + +=cut + +sub TTF_bininfo +{ + my ($num, $block) = @_; + my ($range, $select, $shift); + + $range = 1; + for ($select = 0; $range <= $num; $select++) + { $range *= 2; } + $select--; $range /= 2; + $range *= $block; + + $shift = $num * $block - $range; + ($num, $range, $select, $shift); +} + + +=head2 TTF_word_utf8($str) + +Returns the UTF8 form of the 16 bit string, assumed to be in big endian order, +including surrogate handling + +=cut + +sub TTF_word_utf8 +{ + my ($str) = @_; + my ($res, $i); + my (@dat) = unpack("n*", $str); + + return pack("U*", @dat) if ($] >= 5.006); + for ($i = 0; $i <= $#dat; $i++) + { + my ($dat) = $dat[$i]; + if ($dat < 0x80) # Thanks to Gisle Aas for some of his old code + { $res .= chr($dat); } + elsif ($dat < 0x800) + { $res .= chr(0xC0 | ($dat >> 6)) . chr(0x80 | ($dat & 0x3F)); } + elsif ($dat >= 0xD800 && $dat < 0xDC00) + { + my ($dat1) = $dat[++$i]; + my ($top) = (($dat & 0x3C0) >> 6) + 1; + $res .= chr(0xF0 | ($top >> 2)) + . chr(0x80 | (($top & 1) << 4) | (($dat & 0x3C) >> 2)) + . chr(0x80 | (($dat & 0x3) << 4) | (($dat1 & 0x3C0) >> 6)) + . chr(0x80 | ($dat1 & 0x3F)); + } else + { $res .= chr(0xE0 | ($dat >> 12)) . chr(0x80 | (($dat >> 6) & 0x3F)) + . chr(0x80 | ($dat & 0x3F)); } + } + $res; +} + + +=head2 TTF_utf8_word($str) + +Returns the 16-bit form in big endian order of the UTF 8 string, including +surrogate handling to Unicode. + +=cut + +sub TTF_utf8_word +{ + my ($str) = @_; + my ($res); + + return pack("n*", unpack("U*", $str)) if ($^V ge v5.6.0); + $str = "$str"; # copy $str + while (length($str)) # Thanks to Gisle Aas for some of his old code + { + $str =~ s/^[\x80-\xBF]+//o; + if ($str =~ s/^([\x00-\x7F]+)//o) + { $res .= pack("n*", unpack("C*", $1)); } + elsif ($str =~ s/^([\xC0-\xDF])([\x80-\xBF])//o) + { $res .= pack("n", ((ord($1) & 0x1F) << 6) | (ord($2) & 0x3F)); } + elsif ($str =~ s/^([\0xE0-\xEF])([\x80-\xBF])([\x80-\xBF])//o) + { $res .= pack("n", ((ord($1) & 0x0F) << 12) + | ((ord($2) & 0x3F) << 6) + | (ord($3) & 0x3F)); } + elsif ($str =~ s/^([\xF0-\xF7])([\x80-\xBF])([\x80-\xBF])([\x80-\xBF])//o) + { + my ($b1, $b2, $b3, $b4) = (ord($1), ord($2), ord($3), ord($4)); + $res .= pack("n", ((($b1 & 0x07) << 8) | (($b2 & 0x3F) << 2) + | (($b3 & 0x30) >> 4)) + 0xD600); # account for offset + $res .= pack("n", ((($b3 & 0x0F) << 6) | ($b4 & 0x3F)) + 0xDC00); + } + elsif ($str =~ s/^[\xF8-\xFF][\x80-\xBF]*//o) + { } + } + $res; +} + + +=head2 XML_hexdump($context, $dat) + +Dumps out the given data as a sequence of blocks each 16 bytes wide + +=cut + +sub XML_hexdump +{ + my ($context, $depth, $dat) = @_; + my ($fh) = $context->{'fh'}; + my ($i, $len, $out); + + $len = length($dat); + for ($i = 0; $i < $len; $i += 16) + { + $out = join(' ', map {sprintf("%02X", ord($_))} (split('', substr($dat, $i, 16)))); + $fh->printf("%s%s\n", $depth, $i, $out); + } +} + + +=head2 XML_outhints + +Converts a binary string of hinting code into a textual representation + +=cut + +{ + my (@hints) = ( + ['SVTCA[0]'], ['SVTCA[1]'], ['SPVTCA[0]'], ['SPVTCA[1]'], ['SFVTCA[0]'], ['SFVTCA[1]'], ['SPVTL[0]'], ['SPVTL[1]'], + ['SFVTL[0]'], ['SFVTL[1]'], ['SPVFS'], ['SFVFS'], ['GPV'], ['GFV'], ['SVFTPV'], ['ISECT'], +# 10 + ['SRP0'], ['SRP1'], ['SRP2'], ['SZP0'], ['SZP1'], ['SZP2'], ['SZPS'], ['SLOOP'], + ['RTG'], ['RTHG'], ['SMD'], ['ELSE'], ['JMPR'], ['SCVTCI'], ['SSWCI'], ['SSW'], +# 20 + ['DUP'], ['POP'], ['CLEAR'], ['SWAP'], ['DEPTH'], ['CINDEX'], ['MINDEX'], ['ALIGNPTS'], + [], ['UTP'], ['LOOPCALL'], ['CALL'], ['FDEF'], ['ENDF'], ['MDAP[0]'], ['MDAP[1]'], +# 30 + ['IUP[0]'], ['IUP[1]'], ['SHP[0]'], ['SHP[1]'], ['SHC[0]'], ['SHC[1]'], ['SHZ[0]'], ['SHZ[1]'], + ['SHPIX'], ['IP'], ['MSIRP[0]'], ['MSIRP[1]'], ['ALIGNRP'], ['RTDG'], ['MIAP[0]'], ['MIAP[1]'], +# 40 + ['NPUSHB', -1, 1], ['NPUSHW', -1, 2], ['WS', 0, 0], ['RS', 0, 0], ['WCVTP', 0, 0], ['RCVT', 0, 0], ['GC[0]'], ['GC[1]'], + ['SCFS'], ['MD[0]'], ['MD[1]'], ['MPPEM'], ['MPS'], ['FLIPON'], ['FLIPOFF'], ['DEBUG'], +# 50 + ['LT'], ['LTEQ'], ['GT'], ['GTEQ'], ['EQ'], ['NEQ'], ['ODD'], ['EVEN'], + ['IF'], ['EIF'], ['AND'], ['OR'], ['NOT'], ['DELTAP1'], ['SDB'], ['SDS'], +# 60 + ['ADD'], ['SUB'], ['DIV'], ['MULT'], ['ABS'], ['NEG'], ['FLOOR'], ['CEILING'], + ['ROUND[0]'], ['ROUND[1]'], ['ROUND[2]'], ['ROUND[3]'], ['NROUND[0]'], ['NROUND[1]'], ['NROUND[2]'], ['NROUND[3]'], +# 70 + ['WCVTF'], ['DELTAP2'], ['DELTAP3'], ['DELTAC1'], ['DELTAC2'], ['DELTAC3'], ['SROUND'], ['S45ROUND'], + ['JROT'], ['JROF'], ['ROFF'], [], ['RUTG'], ['RDTG'], ['SANGW'], [], +# 80 + ['FLIPPT'], ['FLIPRGON'], ['FLIPRGOFF'], [], [], ['SCANCTRL'], ['SDPVTL[0]'], ['SDPVTL[1]'], + ['GETINFO'], ['IDEF'], ['ROLL'], ['MAX'], ['MIN'], ['SCANTYPE'], ['INSTCTRL'], [], +# 90 + [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], +# A0 + [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], +# B0 + ['PUSHB1', 1, 1], ['PUSHB2', 2, 1], ['PUSHB3', 3, 1], ['PUSHB4', 4, 1], ['PUSHB5', 5, 1], ['PUSHB6', 6, 1], ['PUSHB7', 7, 1], ['PUSHB8', 8, 1], + ['PUSHW1', 1, 2], ['PUSHW2', 2, 2], ['PUSHW3', 3, 2], ['PUSHW4', 4, 2], ['PUSHW5', 5, 2], ['PUSHW6', 6, 2], ['PUSHW7', 7, 2], ['PUSHW8', 8, 2], +# C0 + ['MDRP[0]'], ['MDRP[1]'], ['MDRP[2]'], ['MDRP[3]'], ['MDRP[4]'], ['MDRP[5]'], ['MDRP[6]'], ['MDRP[7]'], + ['MDRP[8]'], ['MDRP[9]'], ['MDRP[A]'], ['MDRP[B]'], ['MDRP[C]'], ['MDRP[D]'], ['MDRP[E]'], ['MDRP[F]'], +# D0 + ['MDRP[10]'], ['MDRP[11]'], ['MDRP[12]'], ['MDRP[13]'], ['MDRP[14]'], ['MDRP[15]'], ['MDRP[16]'], ['MDRP[17]'], + ['MDRP[18]'], ['MDRP[19]'], ['MDRP[1A]'], ['MDRP[1B]'], ['MDRP[1C]'], ['MDRP[1D]'], ['MDRP[1E]'], ['MDRP[1F]'], +# E0 + ['MIRP[0]'], ['MIRP[1]'], ['MIRP[2]'], ['MIRP[3]'], ['MIRP[4]'], ['MIRP[5]'], ['MIRP[6]'], ['MIRP[7]'], + ['MIRP[8]'], ['MIRP[9]'], ['MIRP[A]'], ['MIRP[B]'], ['MIRP[C]'], ['MIRP[D]'], ['MIRP[E]'], ['MIRP[F]'], +# F0 + ['MIRP[10]'], ['MIRP[11]'], ['MIRP[12]'], ['MIRP[13]'], ['MIRP[14]'], ['MIRP[15]'], ['MIRP[16]'], ['MIRP[17]'], + ['MIRP[18]'], ['MIRP[19]'], ['MIRP[1A]'], ['MIRP[1B]'], ['MIRP[1C]'], ['MIRP[1D]'], ['MIRP[1E]'], ['MIRP[1F]']); + + my ($i); + my (%hints) = map { $_->[0] => $i++ if (defined $_->[0]); } @hints; + + sub XML_binhint + { + my ($dat) = @_; + my ($len) = length($dat); + my ($res, $i, $text, $size, $num); + + for ($i = 0; $i < $len; $i++) + { + ($text, $num, $size) = @{$hints[ord(substr($dat, $i, 1))]}; + $num = 0 unless (defined $num); + $text = sprintf("UNK[%02X]", ord(substr($dat, $i, 1))) unless defined $text; + $res .= $text; + if ($num != 0) + { + if ($num < 0) + { + $i++; + my ($nnum) = unpack($num == -1 ? 'C' : 'n', substr($dat, $i, -$num)); + $i += -$num - 1; + $num = $nnum; + } + $res .= "\t" . join(' ', unpack($size == 1 ? 'C*' : 'n*', substr($dat, $i + 1, $num * $size))); + $i += $num * $size; + } + $res .= "\n"; + } + $res; + } + + sub XML_hintbin + { + my ($dat) = @_; + my ($l, $res, @words, $num); + + foreach $l (split(/\s*\n\s*/, $dat)) + { + @words = split(/\s*/, $l); + next unless (defined $hints{$words[0]}); + $num = $hints{$words[0]}; + $res .= pack('C', $num); + if ($hints[$num][1] < 0) + { + $res .= pack($hints[$num][1] == -1 ? 'C' : 'n', $#words); + $res .= pack($hints[$num][2] == 1 ? 'C*' : 'n*', @words[1 .. $#words]); + } + elsif ($hints[$num][1] > 0) + { + $res .= pack($hints[$num][2] == 1 ? 'C*' : 'n*', @words[1 .. $hints[$num][1]]); + } + } + $res; + } +} + + +=head2 make_circle($f, $cmap, [$dia, $sb, $opts]) + +Adds a dotted circle to a font. This function is very configurable. The +parameters passed in are: + +=over 4 + +=item $f + +Font to work with. This is required. + +=item $cmap + +A cmap table (not the 'val' sub-element of a cmap) to add the glyph too. Optional. + +=item $dia + +Optional diameter for the main circle. Defaults to 80% em + +=item $sb + +Side bearing. The left and right side-bearings are always the same. This value +defaults to 10% em. + +=back + +There are various options to control all sorts of interesting aspects of the circle + +=over 4 + +=item numDots + +Number of dots in the circle + +=item numPoints + +Number of curve points to use to create each dot + +=item uid + +Unicode reference to store this glyph under in the cmap. Defaults to 0x25CC + +=item pname + +Postscript name to give the glyph. Defaults to uni25CC. + +=item -dRadius + +Radius of each dot. + +=back + +=cut + +sub make_circle +{ + my ($font, $cmap, $dia, $sb, %opts) = @_; + my ($upem) = $font->{'head'}{'unitsPerEm'}; + my ($glyph) = Font::TTF::Glyph->new('PARENT' => $font, 'read' => 2); + my ($PI) = 3.1415926535; + my ($R, $r, $xorg, $yorg); + my ($i, $j, $numg, $maxp); + my ($numc) = $opts{'-numDots'} || 16; + my ($nump) = ($opts{'-numPoints'} * 2) || 8; + my ($uid) = $opts{'-uid'} || 0x25CC; + my ($pname) = $opts{'-pname'} || 'uni25CC'; + + $dia ||= $upem * .8; # .95 to fit exactly + $sb ||= $upem * .1; + $R = $dia / 2; + $r = $opts{'-dRadius'} || ($R * .1); + ($xorg, $yorg) = ($R + $r, $R); + + $xorg += $sb; + $font->{'post'}->read; + $font->{'glyf'}->read; + for ($i = 0; $i < $numc; $i++) + { + my ($pxorg, $pyorg) = ($xorg + $R * cos(2 * $PI * $i / $numc), + $yorg + $R * sin(2 * $PI * $i / $numc)); + for ($j = 0; $j < $nump; $j++) + { + push (@{$glyph->{'x'}}, int ($pxorg + ($j & 1 ? 1/cos(2*$PI/$nump) : 1) * $r * cos(2 * $PI * $j / $nump))); + push (@{$glyph->{'y'}}, int ($pyorg + ($j & 1 ? 1/cos(2*$PI/$nump) : 1) * $r * sin(2 * $PI * $j / $nump))); + push (@{$glyph->{'flags'}}, $j & 1 ? 0 : 1); + } + push (@{$glyph->{'endPoints'}}, $#{$glyph->{'x'}}); + } + $glyph->{'numberOfContours'} = $#{$glyph->{'endPoints'}} + 1; + $glyph->{'numPoints'} = $#{$glyph->{'x'}} + 1; + $glyph->update; + $numg = $font->{'maxp'}{'numGlyphs'}; + $font->{'maxp'}{'numGlyphs'}++; + + $font->{'hmtx'}{'advance'}[$numg] = int($xorg + $R + $r + $sb + .5); + $font->{'hmtx'}{'lsb'}[$numg] = int($xorg - $R - $r + .5); + $font->{'loca'}{'glyphs'}[$numg] = $glyph; + $cmap->{'val'}{$uid} = $numg if ($cmap); + $font->{'post'}{'VAL'}[$numg] = $pname; + delete $font->{'hdmx'}; + delete $font->{'VDMX'}; + delete $font->{'LTSH'}; + + $font->tables_do(sub {$_[0]->dirty;}); + $font->update; + return ($numg - 1); +} + + +1; + +=head1 BUGS + +No known bugs + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Vhea.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Vhea.pm new file mode 100644 index 0000000..2e1a49a --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Vhea.pm @@ -0,0 +1,159 @@ +package Font::TTF::Vhea; + +=head1 NAME + +Font::TTF::Vhea - Vertical Header table + +=head1 DESCRIPTION + +This is a simple table with just standards specified instance variables + +=head1 INSTANCE VARIABLES + + version + Ascender + Descender + LineGap + advanceHeightMax + minTopSideBearing + minBottomSideBearing + yMaxExtent + caretSlopeRise + caretSlopeRun + metricDataFormat + numberOfVMetrics + + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA %fields @field_info); + +require Font::TTF::Table; +use Font::TTF::Utils; + +@ISA = qw(Font::TTF::Table); +@field_info = ( + 'version' => 'v', + 'Ascender' => 's', + 'Descender' => 's', + 'LineGap' => 's', + 'advanceHeightMax' => 'S', + 'minTopSideBearing' => 's', + 'minBottomSideBearing' => 's', + 'yMaxExtent' => 's', + 'caretSlopeRise' => 's', + 'caretSlopeRun' => 's', + 'metricDataFormat' => '+10s', + 'numberOfVMetrics' => 's'); + +sub init +{ + my ($k, $v, $c, $i); + for ($i = 0; $i < $#field_info; $i += 2) + { + ($k, $v, $c) = TTF_Init_Fields($field_info[$i], $c, $field_info[$i + 1]); + next unless defined $k && $k ne ""; + $fields{$k} = $v; + } +} + + +=head2 $t->read + +Reads the table into memory as instance variables + +=cut + +sub read +{ + my ($self) = @_; + my ($dat); + + $self->SUPER::read or return $self; + init unless defined $fields{'Ascender'}; + $self->{' INFILE'}->read($dat, 36); + + TTF_Read_Fields($self, $dat, \%fields); + $self; +} + + +=head2 $t->out($fh) + +Writes the table to a file either from memory or by copying. + +=cut + +sub out +{ + my ($self, $fh) = @_; + + return $self->SUPER::out($fh) unless $self->{' read'}; + + $self->{'numberOfVMetrics'} = $self->{' PARENT'}{'vmtx'}->numMetrics || $self->{'numberOfVMetrics'}; + $fh->print(TTF_Out_Fields($self, \%fields, 36)); + $self; +} + + +=head2 $t->update + +Updates various parameters in the hhea table from the hmtx table, assuming +the C table is dirty. + +=cut + +sub update +{ + my ($self) = @_; + my ($vmtx) = $self->{' PARENT'}{'vmtx'}; + my ($glyphs); + my ($num); + my ($i, $maw, $mlsb, $mrsb, $mext, $aw, $lsb, $ext); + + return undef unless ($self->SUPER::update); + return undef unless (defined $vmtx && defined $self->{' PARENT'}{'loca'}); + $vmtx->read->update; + $self->{' PARENT'}{'loca'}->read->update; + $glyphs = $self->{' PARENT'}{'loca'}{'glyphs'}; + $num = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + + for ($i = 0; $i < $num; $i++) + { + $aw = $vmtx->{'advance'}[$i]; + $lsb = $vmtx->{'top'}[$i]; + if (defined $glyphs->[$i]) + { $ext = $lsb + $glyphs->[$i]->read->{'yMax'} - $glyphs->[$i]{'yMin'}; } + else + { $ext = $aw; } + $maw = $aw if ($aw > $maw); + $mlsb = $lsb if ($lsb < $mlsb or $i == 0); + $mrsb = $aw - $ext if ($aw - $ext < $mrsb or $i == 0); + $mext = $ext if ($ext > $mext); + } + $self->{'advanceHeightMax'} = $maw; + $self->{'minTopSideBearing'} = $mlsb; + $self->{'minBottomSideBearing'} = $mrsb; + $self->{'yMaxExtent'} = $mext; + $self->{'numberOfVMetrics'} = $vmtx->numMetrics; + $self; +} + + +1; + + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Vmtx.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Vmtx.pm new file mode 100644 index 0000000..b74d6df --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Vmtx.pm @@ -0,0 +1,86 @@ +package Font::TTF::Vmtx; + +=head1 NAME + +Font::TTF::Vmtx - Vertical Metrics + +=head1 DESCRIPTION + +Contains the advance height and top side bearing for each glyph. Given the +compressability of the data onto disk, this table uses information from +other tables, and thus must do part of its output during the output of +other tables + +=head1 INSTANCE VARIABLES + +The vertical metrics are kept in two arrays by glyph id. The variable names +do not start with a space + +=over 4 + +=item advance + +An array containing the advance height for each glyph + +=item top + +An array containing the top side bearing for each glyph + +=back + +=head1 METHODS + +=cut + +use strict; +use vars qw(@ISA); +require Font::TTF::Hmtx; + +@ISA = qw(Font::TTF::Hmtx); + + +=head2 $t->read + +Reads the vertical metrics from the TTF file into memory + +=cut + +sub read +{ + my ($self) = @_; + my ($numh, $numg); + + $numh = $self->{' PARENT'}{'vhea'}->read->{'numberOfVMetrics'}; + $numg = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + $self->_read($numg, $numh, "advance", "top"); +} + + +=head2 $t->out($fh) + +Writes the metrics to a TTF file. Assumes that the C has updated the +numVMetrics from here + +=cut + +sub out +{ + my ($self, $fh) = @_; + my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'}; + my ($numh) = $self->{' PARENT'}{'vhea'}{'numberOfVMetrics'}; + $self->_out($fh, $numg, $numh, "advance", "top"); +} + +1; + +=head1 BUGS + +None known + +=head1 AUTHOR + +Martin Hosken Martin_Hosken@sil.org. See L for copyright and +licensing. + +=cut + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Win32.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Win32.pm new file mode 100644 index 0000000..bb8886e --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/Win32.pm @@ -0,0 +1,33 @@ +package Font::TTF::Win32; + +# use strict; +# use vars qw($HKEY_LOCAL_MACHINE); + +use Win32::Registry; +use Win32; +use File::Spec; +use Font::TTF::Font; + + +sub findfonts +{ + my ($sub) = @_; + my ($font_key) = 'SOFTWARE\Microsoft\Windows' . (Win32::IsWinNT() ? ' NT' : '') . '\CurrentVersion\Fonts'; + my ($regFont, $list, $l, $font, $file); + +# get entry from registry for a font of this name + $::HKEY_LOCAL_MACHINE->Open($font_key, $regFont); + $regFont->GetValues($list); + + foreach $l (sort keys %{$list}) + { + my ($fname) = $list->{$l}[0]; + next unless ($fname =~ s/\(TrueType\)$//o); + $file = File::Spec->rel2abs($list->{$l}[2], "$ENV{'windir'}/fonts"); + $font = Font::TTF::Font->open($file) || next; + &{$sub}($font, $fname); + $font->release; + } +} + +1; diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/XMLparse.pm b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/XMLparse.pm new file mode 100644 index 0000000..7b2b571 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/Font/TTF/XMLparse.pm @@ -0,0 +1,176 @@ +package Font::TTF::XMLparse; + +=head1 NAME + +Font::TTF::XMLparse - provides support for XML parsing. Requires Expat module XML::Parser::Expat + +=head1 SYNOPSIS + + use Font::TTF::Font; + use Font::TTF::XMLparse; + + $f = Font::TTF::Font->new; + read_xml($f, $ARGV[0]); + $f->out($ARGV[1]); + +=head1 DESCRIPTION + +This module contains the support routines for parsing XML and generating the +Truetype font structures as a result. The module has been separated from the rest +of the package in order to reduce the dependency that this would bring, of the +whole package on XML::Parser. This way, people without the XML::Parser can still +use the rest of the package. + +The package interacts with another package through the use of a context containing +and element 'receiver' which is an object which can possibly receive one of the +following messages: + +=over 4 + +=item XML_start + +This message is called when an open tag occurs. It is called with the context, +tag name and the attributes. The return value has no meaning. + +=item XML_end + +This messages is called when a close tag occurs. It is called with the context, +tag name and attributes (held over from when the tag was opened). There are 3 +possible return values from such a message: + +=over 8 + +=item undef + +This is the default return value indicating that default processing should +occur in which either the current element on the tree, or the text of this element +should be stored in the parent object. + +=item $context + +This magic value marks that the element should be deleted from the parent. +Nothing is stored in the parent. (This rather than '' is used to allow 0 returns.) + +=item anything + +Anything else is taken as the element content to be stored in the parent. + +=back 4 + +=back 4 + +In addition, the context hash passed to these messages contains the following +keys: + +=over 4 + +=item xml + +This is the expat xml object. The context is also available as +$context->{'xml'}{' mycontext'}. But that is a long winded way of not saying much! + +=item font + +This is the base object that was passed in for XML parsing. + +=item receiver + +This holds the current receiver of parsing events. It may be set in associated +application to adjust which objects should receive messages when. It is also stored +in the parsing stack to ensure that where an object changes it during XML_start, that +that same object that received XML_start will receive the corresponding XML_end + +=item stack + +This is the parsing stack, used internally to hold the current receiver and attributes +for each element open, as a complete hierarchy back to the root element. + +=item tree + +This element contains the storage tree corresponding to the parent of each element +in the stack. The default action is to push undef onto this stack during XML_start +and then to resolve this, either in the associated application (by changing +$context->{'tree'}[-1]) or during XML_end of a child element, by which time we know +whether we are dealing with an array or a hash or what. + +=item text + +Character processing is to insert all the characters into the text element of the +context for available use later. + +=back 4 + +=head1 METHODS + +=cut + +use XML::Parser::Expat; +require Exporter; + +use strict; +use vars qw(@ISA @EXPORT); + +@ISA = qw(Exporter); +@EXPORT = qw(read_xml); + +sub read_xml +{ + my ($font, $fname) = @_; + + my ($xml) = XML::Parser::Expat->new; + my ($context) = {'xml' => $xml, 'font' => $font}; + + $xml->setHandlers('Start' => sub { + my ($x, $tag, %attrs) = @_; + my ($context) = $x->{' mycontext'}; + my ($fn) = $context->{'receiver'}->can('XML_start'); + + push(@{$context->{'tree'}}, undef); + push(@{$context->{'stack'}}, [$context->{'receiver'}, {%attrs}]); + &{$fn}($context->{'receiver'}, $context, $tag, %attrs) if defined $fn; + }, + 'End' => sub { + my ($x, $tag) = @_; + my ($context) = $x->{' mycontext'}; + my ($fn) = $context->{'receiver'}->can('XML_end'); + my ($stackinfo) = pop(@{$context->{'stack'}}); + my ($current, $res); + + $context->{'receiver'} = $stackinfo->[0]; + $context->{'text'} =~ s/^\s*(.*?)\s*$/$1/o; + $res = &{$fn}($context->{'receiver'}, $context, $tag, %{$stackinfo->[1]}) if defined $fn; + $current = pop(@{$context->{'tree'}}); + $current = $context->{'text'} unless (defined $current); + $context->{'text'} = ''; + + if (defined $res) + { + return if ($res eq $context); + $current = $res; + } + return unless $#{$context->{'tree'}} >= 0; + if ($tag eq 'elem') + { + $context->{'tree'}[-1] = [] unless defined $context->{'tree'}[-1]; + push (@{$context->{'tree'}[-1]}, $current); + } else + { + $context->{'tree'}[-1] = {} unless defined $context->{'tree'}[-1]; + $context->{'tree'}[-1]{$tag} = $current; + } + }, + 'Char' => sub { + my ($x, $str) = @_; + $x->{' mycontext'}{'text'} .= $str; + }); + + $xml->{' mycontext'} = $context; + + $context->{'receiver'} = $font; + if (ref $fname) + { return $xml->parse($fname); } + else + { return $xml->parsefile($fname); } +} + + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/lib/ttfmod.pl b/src/librarian/font-optimizer/ext/Font-TTF/lib/ttfmod.pl new file mode 100644 index 0000000..dd10f9e --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/lib/ttfmod.pl @@ -0,0 +1,174 @@ +# Title: TTFMOD.PL +# Author: M. Hosken +# Description: Read TTF file calling user functions for each table +# and output transformed tables to new TTF file. +# Useage: TTFMOD provides the complete control loop for processing +# the TTF files. All that the caller need supply is an +# associative array of functions to call keyed by the TTF +# table name and the two filenames. +# +# &ttfmod($infile, $outfile, *fns [, @must]); +# +# *fns is an associative array keyed by table name with +# values of the name of the subroutine in package main to +# be called to transfer the table from INFILE to OUTFILE. +# The subroutine is called with the following parameters and +# expected return values: +# +# ($len, $csum) = &sub(*INFILE, *OUTFILE, $len); +# +# INFILE and OUTFILE are the input and output streams, $len +# is the length of the table according to the directory. +# The return values are $len = new length of table to be +# given in the table directory. $csum = new value of table +# checksum. A way to test that this is correct is to +# checksum the whole file (e.g. using CSUM.BAT) and to +# ensure that the value is 0xB1B0AFBA according to a 32 bit +# checksum calculated bigendien. +# +# @must consists of a list of tables which must exist in the +# final output file, either by being there alread or by being +# inserted. +# +# Modifications: +# MJPH 1.00 22-SEP-1994 Original +# MJPH 1.1 18-MAR-1998 Added @must to ttfmod() +# MJPH 1.1.1 25-MAR-1998 Added $csum to copytab (to make reusable) + +package ttfmod; + +sub main'ttfmod { + local($infile, $outfile, *fns, @must) = @_; + + # open files as binary. Notice OUTFILE is opened for update not just write + open(INFILE, "$infile") || die "Unable top open \"$infile\" for reading"; + binmode INFILE; + open(OUTFILE, "+>$outfile") || die "Unable to open \"$outfile\" for writing"; + binmode OUTFILE; + + seek(INFILE, 0, 0); + read(INFILE, $dir_head, 12) || die "Reading table header"; + ($dir_num) = unpack("x4n", $dir_head); + print OUTFILE $dir_head; + # read and unpack table directory + for ($i = 0; $i < $dir_num; $i++) + { + read(INFILE, $dir_val, 16) || die "Reading table entry"; + $dir{unpack("a4", $dir_val)} = join(":", $i, unpack("x4NNN", $dir_val)); + print OUTFILE $dir_val; + printf STDERR "%s %08x\n", unpack("a4", $dir_val), unpack("x8N", $dir_val) + if (defined $main'opt_z); + } + foreach $n (@must) + { + next if defined $dir{$n}; + $dir{$n} = "$i:0:-1:0"; + $i++; $dir_num++; + print OUTFILE pack("a4NNN", $n, 0, -1, 0); + } + substr($dir_head, 4, 2) = pack("n", $dir_num); + $csum = unpack("%32N*", $dir_head); + $off = tell(OUTFILE); + seek(OUTFILE, 0, 0); + print OUTFILE $dir_head; + seek (OUTFILE, $off, 0); + # process tables in order they occur in the file + @dirlist = sort byoffset keys(%dir); + foreach $tab (@dirlist) + { + @tab_split = split(':', $dir{$tab}); + seek(INFILE, $tab_split[2], 0); # offset + $tab_split[2] = tell(OUTFILE); + if (defined $fns{$tab}) + { + $temp = "main'$fns{$tab}"; + ($dir_len, $sum) = &$temp(*INFILE, *OUTFILE, $tab_split[3]); + } + else + { + ($dir_len, $sum) = ©tab(*INFILE, *OUTFILE, $tab_split[3]); + } + $tab_split[3] = $dir_len; # len + $tab_split[1] = $sum; # checksum + $out_dir{$tab} = join(":", @tab_split); + } + # now output directory in same order as original directory + @dirlist = sort byindex keys(%out_dir); + foreach $tab (@dirlist) + { + @tab_split = split(':', $out_dir{$tab}); + seek (OUTFILE, 12 + $tab_split[0] * 16, 0); # directory index + print OUTFILE pack("A4N3", $tab, @tab_split[1..3]); + foreach $i (1..3, 1) # checksum directory values with csum twice + { + $csum += $tab_split[$i]; + # this line ensures $csum stays within 32 bit bounds, clipping as necessary + if ($csum > 0xffffffff) { $csum -= 0xffffffff; $csum--; } + } + # checksum the tag + $csum += unpack("N", $tab); + if ($csum > 0xffffffff) { $csum -= 0xffffffff; $csum--; } + } + # handle main checksum + @tab_split = split(':', $out_dir{"head"}); + seek(OUTFILE, $tab_split[2], 0); + read(OUTFILE, $head_head, 12); # read first bit of "head" table + @head_split = unpack("N3", $head_head); + $tab_split[1] -= $head_split[2]; # subtract old checksum + $csum -= $head_split[2] * 2; # twice because had double effect + # already + if ($csum < 0 ) { $csum += 0xffffffff; $csum++; } + $head_split[2] = 0xB1B0AFBA - $csum; # calculate new checksum + seek (OUTFILE, 12 + $tab_split[0] * 16, 0); + print OUTFILE pack("A4N3", "head", @tab_split[1..3]); + seek (OUTFILE, $tab_split[2], 0); # rewrite first bit of "head" table + print OUTFILE pack("N3", @head_split); + + # finish up + close(OUTFILE); + close(INFILE); + } + +# support function for sorting by table offset +sub byoffset { + @t1 = split(':', $dir{$a}); + @t2 = split(':', $dir{$b}); + return 1 if ($t1[2] == -1); # put inserted tables at the end + return -1 if ($t2[2] == -1); + return $t1[2] <=> $t2[2]; + } + +# support function for sorting by directory entry order +sub byindex { + $t1 = split(':', $dir{$a}, 1); + $t2 = split(':', $dir{$b}, 1); + return $t1 <=> $t2; + } + +# default table action: copies a table from input to output, recalculating +# the checksum (just to be absolutely sure). +sub copytab { + local(*INFILE, *OUTFILE, $len, $csum) = @_; + + while ($len > 0) + { + $count = ($len > 8192) ? 8192 : $len; # 8K buffering + read(INFILE, $buf, $count) == $count || die "Copying"; + $buf .= "\0" x (4 - ($count & 3)) if ($count & 3); # pad to long + print OUTFILE $buf; + $csum += unpack("%32N*", $buf); + if ($csum > 0xffffffff) { $csum -= 0xffffffff; $csum--; } + $len -= $count; + } + ($_[2], $csum); + } + +# test routine to copy file from input to output, no changes +package main; + +if ($test_package) + { + &ttfmod($ARGV[0], $ARGV[1], *dummy); + } +else + { 1; } diff --git a/src/librarian/font-optimizer/ext/Font-TTF/t/OFL.txt b/src/librarian/font-optimizer/ext/Font-TTF/t/OFL.txt new file mode 100644 index 0000000..0b4fe4b --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/t/OFL.txt @@ -0,0 +1,94 @@ +Copyright (c) 2005-2007, M. Hosken and SIL International, +with Reserved Font Name FontUtils Test + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/src/librarian/font-optimizer/ext/Font-TTF/t/tags.t b/src/librarian/font-optimizer/ext/Font-TTF/t/tags.t new file mode 100644 index 0000000..f50e521 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/t/tags.t @@ -0,0 +1,11 @@ +use strict; + +use Test::Simple tests => 3; +use Font::TTF::OTTags qw( %tttags %ttnames readtagsfile); + +ok($tttags{'SCRIPT'}{'Cypriot Syllabary'} eq 'cprt', 'tttags{SCRIPT}'); + +ok($ttnames{'LANGUAGE'}{'AFK '} eq 'Afrikaans', 'ttnames{LANGUAGE}'); + +ok($ttnames{'LANGUAGE'}{'DHV '} eq 'Dhivehi (OBSOLETE)' && $ttnames{'LANGUAGE'}{'DIV '} eq 'Dhivehi', 'ttnames{LANGUAGE} Dhivehi'); + diff --git a/src/librarian/font-optimizer/ext/Font-TTF/t/testfont.ttf b/src/librarian/font-optimizer/ext/Font-TTF/t/testfont.ttf new file mode 100644 index 0000000..d1bc3cf Binary files /dev/null and b/src/librarian/font-optimizer/ext/Font-TTF/t/testfont.ttf differ diff --git a/src/librarian/font-optimizer/ext/Font-TTF/t/ttfcopy.t b/src/librarian/font-optimizer/ext/Font-TTF/t/ttfcopy.t new file mode 100644 index 0000000..c8969b3 --- /dev/null +++ b/src/librarian/font-optimizer/ext/Font-TTF/t/ttfcopy.t @@ -0,0 +1,15 @@ +#!/usr/bin/perl + +use Test::Simple tests => 2; +use File::Compare; +use Font::TTF::Font; + +$f = Font::TTF::Font->open("t/testfont.ttf"); +ok($f); +$f->tables_do(sub { $_[0]->read; }); +$f->{'loca'}->glyphs_do(sub {$_[0]->read_dat; }); +$f->out("t/temp.ttf"); +$res = compare("t/temp.ttf", "t/testfont.ttf"); +ok(!$res); +unlink "t/temp.ttf" unless ($res); + diff --git a/src/librarian/font-optimizer/gen-tests.pl b/src/librarian/font-optimizer/gen-tests.pl new file mode 100644 index 0000000..63bb153 --- /dev/null +++ b/src/librarian/font-optimizer/gen-tests.pl @@ -0,0 +1,235 @@ +# This script generates various 'interesting' fonts, and outputs an HTML file +# containing the subsetted fonts and the original fonts. +# View the output in browsers (preferably multiple, on multiple platforms) to +# make sure the output looks the same as the original. + +use strict; +use warnings; + +use lib 'ext/Font-TTF/lib'; +use Font::Subsetter; +use Font::EOTWrapper; +use Encode; +use Clone; + +use utf8; + +# The following fonts need to exist in a directory called 'testfonts': +my @all = qw( + GenBasR.ttf + GenR102.TTF + LinLibertine_Re-4.1.8.ttf + DoulosSILR.ttf + DejaVuSans.ttf + DejaVuSerif.ttf + calibri.ttf + FedraSansPro-Demi.ttf +); + +my $index = $ARGV[0]; +die "Run '$0', or '$0 n' where n is the number of the test to rebuild\n" + if defined $index and $index !~ /^\d+$/; + +my @tests = ( + # These aren't proper tests (they drop features that affect the rendering) + # TODO: fix them so they are proper, and test that they're really dropping the + # unneeded glyphs etc +# [ [qw(DejaVuSans.ttf FedraSansPro-Demi.ttf)], ["fluffily لا f"], [20], [qw(aalt ccmp dlig fina hlig init liga locl medi rlig salt kern mark mkmk)] ], +# [ [qw(DejaVuSans.ttf FedraSansPro-Demi.ttf)], ["fluffily لا f"], [20], [qw(liga)] ], +# [ [qw(DejaVuSans.ttf FedraSansPro-Demi.ttf)], ["fluffily لا f"], [20], [qw(fina init rlig)] ], +# [ [qw(DejaVuSans.ttf FedraSansPro-Demi.ttf)], ["fluffily لا f"], [20], [] ], + + # Basic rendering + [ [@all], ["Hello world ABC abc 123"], [20] ], + + # Substitution and NFC issues + [ [qw(GenBasR.ttf DejaVuSans.ttf FedraSansPro-Demi.ttf)], [ + "i", + "\xec", + "i\x{0300}", + "i \x{0300}", + "ixixi", + "i\x{0300}", + ], [20, 8] ], + [ [qw(DejaVuSans.ttf FedraSansPro-Demi.ttf)], [ + "s\x{0323}\x{0307}", # s, combining dot below, combining dot above + "s\x{0307}\x{0323}", # s, combining dot above, combining dot below + "\x{1e61}\x{0323}", # s with dot above, combining dot below + "\x{1e63}\x{0307}", # s with dot below, combining dot above + "\x{212b}", # angstrom + ], [20, 8] ], + + # Ligature rendering + [ [qw(LinLibertine_Re-4.1.8.ttf DejaVuSans.ttf FedraSansPro-Demi.ttf)], [ + "fluffily", + "fluffily", + "fluffily", + ], [20, 8] ], + + # GPOS issues + [ [qw(DejaVuSans.ttf FedraSansPro-Demi.ttf calibri.ttf)], + ["|VAVAV|", "ToToT", "x//x"], [20], ['kern'] ], + + # Lots of stuff + [ [@all], ["VABC(123) fTo fluffiest ffi!\@#,. \x{00e2}\x{00eb}I\x{0303}o\x{0300}u\x{030a}\x{0305}\x{0303} i\x{0331}\x{0301} \x{0d23}\x{0d4d}\x{200d} παρακαλώ хэлло 你好 表示问候 やあ التلفون הלו"], [20, 8] ], + +); + +my $common_css = <preload($fn); + $font_cache{$fn} = $s; + } + return Clone::clone($font_cache{$fn}); +} + +my %std_fonts; +# if (0) { my $j = 0; +for my $j (0..$#all) { + my $fn = $all[$j]; + (my $eot_fn = $fn) =~ s/\.[ot]tf$/.eot/i; + if (not -e "testfonts/$eot_fn") { + Font::EOTWrapper::convert("testfonts/$fn", "testfonts/$eot_fn"); + } + $common_css .= <', 'testoutput/tests.html' or die $!; + binmode $out, ':utf8'; + + print $out < + +Font tests + +EOF +} + +my $i = -1; +for my $test (@tests) { + for my $fn (@{$test->[0]}) { + for my $text (@{$test->[1]}) { + ++$i; + next if defined $index and $index != $i; + + print encode('utf-8', "$fn -- $text\n"); + + (my $text_plain = $text) =~ s/<.*?>//g; + + my $features; + if ($test->[3]) { + $features = { DEFAULT => 0 }; + $features->{$_} = 1 for @{$test->[3]}; + } + + my $s = new_font("testfonts/$fn"); + $s->subset("testfonts/$fn", $text_plain, { features => $features }); + my $path = sprintf '%03d', $i; + $s->write("testoutput/$path.ttf"); + my $old_glyphs = $s->num_glyphs_old; + my $new_glyphs = $s->num_glyphs_new; + my @glyph_names = $s->glyph_names; + $s->release; + + Font::EOTWrapper::convert("testoutput/$path.ttf", "testoutput/$path.eot"); + + my $fragment = < +\@font-face { /* for IE */ + font-family: subsetted-$i; + src: url($path.eot); +} +\@font-face { + font-family: subsetted-$i; + src: url($path.ttf) format("truetype"); +} + +EOF + + for my $size (@{$test->[2]}) { + $fragment .= <$text +
    +$text

    +EOF + } + + print $out qq{\n\n$fragment#} if not defined $index; + + open my $html, '>', "testoutput/$path.html"; + binmode $html, ':utf8'; + print $html < + +Font test $path + +$fragment +EOF + print $html qq{

    }, (join '   ', map "$_", sort @glyph_names), qq{

    }; + print $html qq{
    }, dump_sizes("testoutput/$path.ttf"), qq{
    }; + } + print $out "
    \n" if not defined $index; + } +} + +sub dump_sizes { + my ($fn) = @_; + my $font = Font::TTF::Font->open($fn) or die "Failed to open $fn: $!"; + + my $s = 0; + my $out = ''; + for (sort keys %$font) { + next if /^ /; + my $l = $font->{$_}{' LENGTH'}; + $s += $l; + $out .= "$_: $l\n"; + } + $out .= "Total: $s\n"; + return $out; +} diff --git a/src/librarian/font-optimizer/list-features.pl b/src/librarian/font-optimizer/list-features.pl new file mode 100755 index 0000000..3264a48 --- /dev/null +++ b/src/librarian/font-optimizer/list-features.pl @@ -0,0 +1,52 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use lib 'ext/Font-TTF/lib'; +use Font::TTF::Font; + +use Getopt::Long; + +main(); + +sub help { + print <open($input_file) or die "Error opening $input_file: $!"; + + my %feats; + my @feats; + for my $table (grep defined, $font->{GPOS}, $font->{GSUB}) { + $table->read; + for my $feature (@{$table->{FEATURES}{FEAT_TAGS}}) { + $feature =~ /^(\w{4})( _\d+)?$/ or die "Unrecognised feature tag syntax '$feature'"; + my $tag = $1; + next if $feats{$tag}++; + push @feats, $tag; + } + } + print map "$_\n", @feats; + + $font->release; +} diff --git a/src/librarian/font-optimizer/modify-names.pl b/src/librarian/font-optimizer/modify-names.pl new file mode 100755 index 0000000..3198bee --- /dev/null +++ b/src/librarian/font-optimizer/modify-names.pl @@ -0,0 +1,209 @@ +#!/usr/bin/perl -CA + # use the -CA flag so @ARGV is interpreted as UTF-8 + +use strict; +use warnings; + +binmode STDOUT, ':utf8'; + +use lib 'ext/Font-TTF/lib'; +use Font::TTF::Font; + +my @name_strings = qw( + copyright + family + subfamily + unique-identifier + full-name + version + postscript + trademark + manufacturer + designer + description + vendor-url + designer-url + license + license-url + RESERVED + preferred-family + preferred-subfamily + compatible-full + sample-text + postscript-cid + wws-family + wws-subfamily +); +my %name_strings; +$name_strings{$name_strings[$_]} = $_ for 0..$#name_strings; + +main(); + +sub help { + print <{name}{strings}[$id]; + my $exists = 0; + for my $plat (0..$#$str) { + next unless $str->[$plat]; + for my $enc (0..$#{$str->[$plat]}) { + next unless $str->[$plat][$enc]; + for my $lang (keys %{$str->[$plat][$enc]}) { + next unless exists $str->[$plat][$enc]{$lang}; + my $val = $sub->($str->[$plat][$enc]{$lang}, $plat, $enc, $lang); + $str->[$plat][$enc]{$lang} = $val; + $exists = 1 + } + } + } + if (not $exists) { + warn "Can't find existing name string '$name_strings[$id]' ($id)\n"; + } +} + + +sub json_string { + my ($str) = @_; + $str =~ s/([\\"])/\\$1/g; + $str =~ s/\r/\\r/g; + $str =~ s/\n/\\n/g; + $str =~ s/\t/\\t/g; + $str =~ s/([\x00-\x1f])/sprintf '\u%04X', ord $1/eg; + return qq{"$str"}; +} + +sub print_names { + my ($font) = @_; + my @lines; + for my $nid (0..$#name_strings) { + my $name = $font->{name}->find_name($nid); + if (length $name) { + push @lines, json_string($name_strings[$nid]).': '.json_string($name); + } + } + + print "{\n"; + print join ",\n\n", @lines; + print "\n}\n"; +} + +sub parse_id { + my ($name) = @_; + if ($name =~ /^\d+$/ and $name < @name_strings) { + return int $name; + } + my $id = $name_strings{lc $name}; + return $id if defined $id; + warn "Invalid name string identifier '$name'\n\n"; + help(); +} + +sub main { + my $verbose = 0; + my $print = 0; + my @commands; + + my @args = @ARGV; + my @rest; + while (@args) { + $_ = shift @args; + if ($_ eq '-v' or $_ eq '--verbose') { + $verbose = 1; + } elsif ($_ eq '-p' or $_ eq '--print') { + $print = 1; + push @commands, [ 'print' ]; + } elsif ($_ eq '--set') { + @args >= 2 or help(); + my $id = parse_id(shift @args); + my $val = shift @args; + push @commands, [ 'set', $id, $val ]; + } elsif ($_ eq '--append') { + @args >= 2 or help(); + my $id = parse_id(shift @args); + my $val = shift @args; + push @commands, [ 'append', $id, $val ]; + } elsif ($_ eq '--subst') { + @args >= 3 or help(); + my $id = parse_id(shift @args); + my $val1 = shift @args; + my $val2 = shift @args; + push @commands, [ 'subst', $id, $val1, $val2 ]; + } else { + push @rest, $_; + } + } + + ($print and (@rest == 1 or @rest == 2)) or @rest == 2 or help(); + + my ($input_file, $output_file) = @rest; + + my $font = Font::TTF::Font->open($input_file) or die "Error opening $input_file: $!"; + + $font->{name}->read; + + for my $cmd (@commands) { + if ($cmd->[0] eq 'print') { + print_names($font); + } elsif ($cmd->[0] eq 'set') { + my $id = $cmd->[1]; + modify_name($font, $id, sub { + my ($val, $plat, $enc, $lang) = @_; + print "Setting string $id (platform=$plat encoding=$enc lang=$lang)\n" if $verbose; + return $cmd->[2]; + }); + } elsif ($cmd->[0] eq 'append') { + my $id = $cmd->[1]; + modify_name($font, $id, sub { + my ($val, $plat, $enc, $lang) = @_; + print "Appending to string $id (platform=$plat encoding=$enc lang=$lang)\n" if $verbose; + return $val . $cmd->[2]; + }); + } elsif ($cmd->[0] eq 'subst') { + my $id = $cmd->[1]; + modify_name($font, $id, sub { + my ($val, $plat, $enc, $lang) = @_; + my $pat = quotemeta($cmd->[2]); + my $n = ($val =~ s/$pat/$cmd->[3]/g) || 0; + print "Substituting string $id (platform=$plat encoding=$enc lang=$lang) - $n match(es)\n" if $verbose; + warn "No match found for substitution on string '$name_strings[$id]'\n" if not $n; + return $val; + }); + } else { + die; + } + } + + $font->out($output_file) if $output_file; + + $font->release; +} diff --git a/src/librarian/font-optimizer/obfuscate-font.pl b/src/librarian/font-optimizer/obfuscate-font.pl new file mode 100755 index 0000000..0850426 --- /dev/null +++ b/src/librarian/font-optimizer/obfuscate-font.pl @@ -0,0 +1,114 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use lib 'ext/Font-TTF/lib'; +use Font::TTF::Font; + +use Getopt::Long; + +main(); + +sub help { + print <{name}{strings}[$id]; + for my $plat (0..$#$str) { + next unless $str->[$plat]; + for my $enc (0..$#{$str->[$plat]}) { + next unless $str->[$plat][$enc]; + for my $lang (keys %{$str->[$plat][$enc]}) { + next unless exists $str->[$plat][$enc]{$lang}; + if ($verbose) { + print "Setting string $_ (plat $plat, enc $enc) to \"$val\"\n"; + } + $str->[$plat][$enc]{$lang} = $val; + } + } + } +} + +sub strip_names { + my ($font, $verbose) = @_; + + print "Stripping names\n" if $verbose; + + $font->{name}->read; + + for (16, 17, 18) { + if ($verbose and $font->{name}{strings}[$_]) { + print "Deleting string $_\n"; + } + $font->{name}{strings}[$_] = undef; + } + + for (1, 3, 5) { + set_name($font, $_, '', $verbose); + } + + for (4, 6) { + set_name($font, $_, '-', $verbose); + } +} + +sub strip_post { + my ($font, $verbose) = @_; + + print "Stripping post table\n" if $verbose; + + # Replace it with the minimum necessary to work in browsers + # (particularly Opera is a bit fussy) + my $data = pack NNnnNNNNN => 0x10000, 0, 0, 0, 0, 0, 0, 0, 0; + $font->{post} = new Font::TTF::Table(dat => $data); +} + +sub main { + my $verbose = 0; + my $all; + my $names; + my $post; + + my $result = GetOptions( + 'verbose' => \$verbose, + 'all' => \$all, + 'names' => \$names, + 'post' => \$post, + ) or help(); + + @ARGV == 2 or help(); + + if (not ($all or $names or $post)) { help(); } + + my ($input_file, $output_file) = @ARGV; + + my $font = Font::TTF::Font->open($input_file) or die "Error opening $input_file: $!"; + + strip_names($font, $verbose) if $all or $names; + strip_post($font, $verbose) if $all or $post; + + $font->out($output_file); + + $font->release; +} diff --git a/src/librarian/font-optimizer/subset.pl b/src/librarian/font-optimizer/subset.pl new file mode 100755 index 0000000..642fe3d --- /dev/null +++ b/src/librarian/font-optimizer/subset.pl @@ -0,0 +1,134 @@ +#!/usr/bin/perl + +# -CA flag is forbidden in #! line +use Encode qw(decode); + @ARGV = map { decode 'utf-8', $_ } @ARGV; + +use strict; +use warnings; + +use lib 'ext/Font-TTF/lib'; +use Font::Subsetter; + +use Getopt::Long; + +main(); + +sub help { + print < \$chars, + 'charsfile=s' => \$charsfile, + 'verbose' => \$verbose, + 'include=s' => \$include, + 'exclude=s' => \$exclude, + 'apply=s' => \$apply, + 'licensesubst=s' => \$license_desc_subst, + ) or help(); + + if (defined $chars and defined $charsfile) { + print "ERROR: Only one of '--chars' and --charsfile' can be specified\n\n"; + help(); + } elsif (defined $chars) { + # just use $chars + } elsif (defined $charsfile) { + open my $f, '<', $charsfile or die "Failed to open $charsfile: $!"; + binmode $f, ':utf8'; + local $/; + $chars = <$f>; + } else { + $chars = 'test'; + } + + @ARGV == 2 or help(); + + my ($input_file, $output_file) = @ARGV; + + + if ($verbose) { + dump_sizes($input_file); + print "Generating subsetted font...\n\n"; + } + + my $features; + if ($include) { + $features = { DEFAULT => 0 }; + $features->{$_} = 1 for split /,/, $include; + } elsif ($exclude) { + $features = { DEFAULT => 1 }; + $features->{$_} = 0 for split /,/, $exclude; + } + + my $fold_features; + if ($apply) { + $fold_features = [ split /,/, $apply ]; + } + + my $subsetter = new Font::Subsetter(); + $subsetter->subset($input_file, $chars, { + features => $features, + fold_features => $fold_features, + license_desc_subst => $license_desc_subst, + }); + $subsetter->write($output_file); + + if ($verbose) { + print "\n"; + print "Features:\n "; + print join ' ', $subsetter->feature_status(); + print "\n\n"; + print "Included glyphs:\n "; + print join ' ', $subsetter->glyph_names(); + print "\n\n"; + dump_sizes($output_file); + } + + $subsetter->release(); +} + +sub dump_sizes { + my ($filename) = @_; + my $font = Font::TTF::Font->open($filename) or die "Failed to open $filename: $!"; + print "TTF table sizes:\n"; + my $s = 0; + for (sort keys %$font) { + next if /^ /; + my $l = $font->{$_}{' LENGTH'}; + $s += $l; + print " $_: $l\n"; + } + print "Total size: $s bytes\n\n"; + $font->release(); +} diff --git a/src/librarian/font-optimizer/t/subsetter.pl b/src/librarian/font-optimizer/t/subsetter.pl new file mode 100644 index 0000000..5cb15df --- /dev/null +++ b/src/librarian/font-optimizer/t/subsetter.pl @@ -0,0 +1,47 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Test::More qw(no_plan); + +use lib 'ext/Font-TTF/lib'; +use Font::Subsetter; +use Unicode::Normalize; + +# Test that we include characters needed for strings converted to NFC +for my $str ( + "i", + "\xec", + "i\x{0300}", + "\x{0300}i", + "\x{03b9}\x{0308}\x{0301}", # iota, combining diaeresis, combining acute + "s\x{0323}\x{0307}", # s, combining dot below, combining dot above + "s\x{0307}\x{0323}", # s, combining dot above, combining dot below + "\x{1e61}\x{0323}", # s with dot above, combining dot below + "\x{1e63}\x{0307}", # s with dot below, combining dot above + "\x{212b}", # angstrom +) { + my $subsetter = new Font::Subsetter; + my %chars = $subsetter->expand_wanted_chars($str); + for (map ord, split //, $str) { + ok($chars{$_}, "char ".(sprintf '%04x', $_)." in string '".(join ' ', map { sprintf '%04x', $_ } unpack 'U*', $str)."'"); + } + for (map ord, split //, Unicode::Normalize::NFC($str)) { + ok($chars{$_}, "NFC char ".(sprintf '%04x', $_)." in string '".(join ' ', map { sprintf '%04x', $_ } unpack 'U*', $str)."'"); + } +} + +# Test that spurious characters aren't included +for my $str ( + "a\xec", +) { + my $subsetter = new Font::Subsetter; + my %chars = $subsetter->expand_wanted_chars($str); + my %exp; + $exp{$_} = 1 for map ord, split //, $str; + $exp{$_} = 1 for map ord, split //, Unicode::Normalize::NFC($str); + for (sort keys %chars) { + ok($exp{$_}, "expected char ".(sprintf '%04x', $_)." from string '".(join ' ', map { sprintf '%04x', $_ } unpack 'U*', $str)."'"); + } +} diff --git a/src/librarian/fonts/DejaVuSerif-Bold.ttf b/src/librarian/fonts/DejaVuSerif-Bold.ttf new file mode 100644 index 0000000..03e1f13 Binary files /dev/null and b/src/librarian/fonts/DejaVuSerif-Bold.ttf differ diff --git a/src/librarian/fonts/DejaVuSerif-BoldItalic.ttf b/src/librarian/fonts/DejaVuSerif-BoldItalic.ttf new file mode 100644 index 0000000..1a35350 Binary files /dev/null and b/src/librarian/fonts/DejaVuSerif-BoldItalic.ttf differ diff --git a/src/librarian/fonts/DejaVuSerif-Italic.ttf b/src/librarian/fonts/DejaVuSerif-Italic.ttf new file mode 100644 index 0000000..e26c4ac Binary files /dev/null and b/src/librarian/fonts/DejaVuSerif-Italic.ttf differ diff --git a/src/librarian/fonts/DejaVuSerif.ttf b/src/librarian/fonts/DejaVuSerif.ttf new file mode 100644 index 0000000..38d9aa0 Binary files /dev/null and b/src/librarian/fonts/DejaVuSerif.ttf differ diff --git a/src/librarian/fonts/JunicodeWL-Italic.ttf b/src/librarian/fonts/JunicodeWL-Italic.ttf new file mode 100644 index 0000000..f380498 Binary files /dev/null and b/src/librarian/fonts/JunicodeWL-Italic.ttf differ diff --git a/src/librarian/fonts/JunicodeWL-Regular.ttf b/src/librarian/fonts/JunicodeWL-Regular.ttf new file mode 100644 index 0000000..24afcdc Binary files /dev/null and b/src/librarian/fonts/JunicodeWL-Regular.ttf differ diff --git a/src/librarian/functions.py b/src/librarian/functions.py new file mode 100644 index 0000000..e5a47d6 --- /dev/null +++ b/src/librarian/functions.py @@ -0,0 +1,150 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import unicode_literals + +from lxml import etree +import re + +from librarian.dcparser import Person +from librarian import get_resource + + +def _register_function(f): + """ Register extension function with lxml """ + ns = etree.FunctionNamespace('http://wolnelektury.pl/functions') + ns[f.__name__] = f + + +def reg_substitute_entities(): + entity_substitutions = [ + (u'---', u'—'), + (u'--', u'–'), + (u'...', u'…'), + (u',,', u'„'), + (u'"', u'”'), + ] + + def substitute_entities(context, text): + """XPath extension function converting all entites in passed text.""" + if isinstance(text, list): + text = ''.join(text) + for entity, substitutution in entity_substitutions: + text = text.replace(entity, substitutution) + return text + + _register_function(substitute_entities) + + +def reg_strip(): + def strip(context, text): + """Remove unneeded whitespace from beginning and end""" + if isinstance(text, list): + text = ''.join(text) + return re.sub(r'\s+', ' ', text).strip() + _register_function(strip) + + +def reg_starts_white(): + def starts_white(context, text): + if isinstance(text, list): + text = ''.join(text) + if not text: + return False + return text[0].isspace() + _register_function(starts_white) + + +def reg_ends_white(): + def ends_white(context, text): + if isinstance(text, list): + text = ''.join(text) + if not text: + return False + return text[-1].isspace() + _register_function(ends_white) + + +def reg_wrap_words(): + def wrap_words(context, text, wrapping): + """XPath extension function automatically wrapping words in passed text""" + if isinstance(text, list): + text = ''.join(text) + if not wrapping: + return text + + words = re.split(r'\s', text) + + line_length = 0 + lines = [[]] + for word in words: + line_length += len(word) + 1 + if line_length > wrapping: + # Max line length was exceeded. We create new line + lines.append([]) + line_length = len(word) + lines[-1].append(word) + return '\n'.join(' '.join(line) for line in lines) + _register_function(wrap_words) + + +def reg_person_name(): + def person_name(context, text): + """ Converts "Name, Forename" to "Forename Name" """ + if isinstance(text, list): + text = ''.join(text) + return Person.from_text(text).readable() + _register_function(person_name) + + +def reg_texcommand(): + def texcommand(context, text): + """Remove non-letters""" + if isinstance(text, list): + text = ''.join(text) + return re.sub(r'[^a-zA-Z]', '', text).strip() + _register_function(texcommand) + + +def reg_lang_code_3to2(): + def lang_code_3to2(context, text): + """Convert 3-letter language code to 2-letter code""" + result = '' + text = ''.join(text) + with open(get_resource('res/ISO-639-2_8859-1.txt'), 'rb') as f: + for line in f.read().decode('latin1').split('\n'): + list = line.strip().split('|') + if list[0] == text: + result = list[2] + if result == '': + return text + else: + return result + _register_function(lang_code_3to2) + + +def mathml_latex(context, trees): + from librarian.embeds.mathml import MathML + text = MathML(trees[0]).to_latex().data + # Remove invisible multiplications, they produce unwanted spaces. + text = text.replace(u'\u2062', '') + return text + + +def reg_mathml_latex(): + _register_function(mathml_latex) + + +def reg_mathml_epub(zipf): + from librarian.embeds.mathml import MathML + + def mathml(context, trees): + data = MathML(trees[0]).to_latex().to_png().data + name = "math%d.png" % mathml.count + mathml.count += 1 + zipf.writestr('OPS/' + name, data) + return name + mathml.count = 0 + _register_function(mathml) diff --git a/src/librarian/html.py b/src/librarian/html.py new file mode 100644 index 0000000..f8e4a83 --- /dev/null +++ b/src/librarian/html.py @@ -0,0 +1,362 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import print_function, unicode_literals + +import os +import re +import copy + +from lxml import etree +from librarian import XHTMLNS, ParseError, OutputFile +from librarian import functions + +from lxml.etree import XMLSyntaxError, XSLTApplyError +import six + + +functions.reg_substitute_entities() +functions.reg_person_name() + +STYLESHEETS = { + 'legacy': 'xslt/book2html.xslt', + 'full': 'xslt/wl2html_full.xslt', + 'partial': 'xslt/wl2html_partial.xslt' +} + + +def get_stylesheet(name): + return os.path.join(os.path.dirname(__file__), STYLESHEETS[name]) + + +def html_has_content(text): + return etree.ETXPath('//p|//{%(ns)s}p|//h1|//{%(ns)s}h1' % {'ns': str(XHTMLNS)})(text) + + +def transform_abstrakt(abstrakt_element): + style_filename = get_stylesheet('legacy') + style = etree.parse(style_filename) + xml = etree.tostring(abstrakt_element, encoding='unicode') + document = etree.parse(six.StringIO(xml.replace('abstrakt', 'dlugi_cytat'))) # HACK + result = document.xslt(style) + html = re.sub('', '', etree.tostring(result, encoding='unicode')) + return re.sub(']*>', '', html) + + +def transform(wldoc, stylesheet='legacy', options=None, flags=None, css=None): + """Transforms the WL document to XHTML. + + If output_filename is None, returns an XML, + otherwise returns True if file has been written,False if it hasn't. + File won't be written if it has no content. + """ + # Parse XSLT + try: + style_filename = get_stylesheet(stylesheet) + style = etree.parse(style_filename) + + document = copy.deepcopy(wldoc) + del wldoc + document.swap_endlines() + + if flags: + for flag in flags: + document.edoc.getroot().set(flag, 'yes') + + document.clean_ed_note() + document.clean_ed_note('abstrakt') + + if not options: + options = {} + options.setdefault('gallery', "''") + + css = css or 'https://static.wolnelektury.pl/css/compressed/book_text.css' + css = "'%s'" % css + result = document.transform(style, css=css, **options) + del document # no longer needed large object :) + + if html_has_content(result): + add_anchors(result.getroot()) + add_table_of_themes(result.getroot()) + add_table_of_contents(result.getroot()) + + return OutputFile.from_bytes(etree.tostring( + result, method='html', xml_declaration=False, pretty_print=True, encoding='utf-8')) + else: + return None + except KeyError: + raise ValueError("'%s' is not a valid stylesheet.") + except (XMLSyntaxError, XSLTApplyError) as e: + raise ParseError(e) + + +@six.python_2_unicode_compatible +class Fragment(object): + def __init__(self, id, themes): + super(Fragment, self).__init__() + self.id = id + self.themes = themes + self.events = [] + + def append(self, event, element): + self.events.append((event, element)) + + def closed_events(self): + stack = [] + for event, element in self.events: + if event == 'start': + stack.append(('end', element)) + elif event == 'end': + try: + stack.pop() + except IndexError: + print('CLOSED NON-OPEN TAG:', element) + + stack.reverse() + return self.events + stack + + def to_string(self): + result = [] + for event, element in self.closed_events(): + if event == 'start': + result.append(u'<%s %s>' % ( + element.tag, ' '.join('%s="%s"' % (k, v) for k, v in element.attrib.items()))) + if element.text: + result.append(element.text) + elif event == 'end': + result.append(u'' % element.tag) + if element.tail: + result.append(element.tail) + else: + result.append(element) + + return ''.join(result) + + def __str__(self): + return self.to_string() + + +def extract_fragments(input_filename): + """Extracts theme fragments from input_filename.""" + open_fragments = {} + closed_fragments = {} + + # iterparse would die on a HTML document + parser = etree.HTMLParser(encoding='utf-8') + buf = six.BytesIO() + buf.write(etree.tostring(etree.parse(input_filename, parser).getroot()[0][0], encoding='utf-8')) + buf.seek(0) + + for event, element in etree.iterparse(buf, events=('start', 'end')): + # Process begin and end elements + if element.get('class', '') in ('theme-begin', 'theme-end'): + if not event == 'end': + continue # Process elements only once, on end event + + # Open new fragment + if element.get('class', '') == 'theme-begin': + fragment = Fragment(id=element.get('fid'), themes=element.text) + + # Append parents + parent = element.getparent() + parents = [] + while parent.get('id', None) != 'book-text': + cparent = copy.deepcopy(parent) + cparent.text = None + parents.append(cparent) + parent = parent.getparent() + + parents.reverse() + for parent in parents: + fragment.append('start', parent) + + open_fragments[fragment.id] = fragment + + # Close existing fragment + else: + try: + fragment = open_fragments[element.get('fid')] + except KeyError: + print('%s:closed not open fragment #%s' % (input_filename, element.get('fid'))) + else: + closed_fragments[fragment.id] = fragment + del open_fragments[fragment.id] + + # Append element tail to lost_text (we don't want to lose any text) + if element.tail: + for fragment_id in open_fragments: + open_fragments[fragment_id].append('text', element.tail) + + # Process all elements except begin and end + else: + # Omit annotation tags + if (len(element.get('name', '')) or + element.get('class', '') in ('annotation', 'anchor')): + if event == 'end' and element.tail: + for fragment_id in open_fragments: + open_fragments[fragment_id].append('text', element.tail) + else: + for fragment_id in open_fragments: + open_fragments[fragment_id].append(event, copy.copy(element)) + + return closed_fragments, open_fragments + + +def add_anchor(element, prefix, with_link=True, with_target=True, link_text=None): + parent = element.getparent() + index = parent.index(element) + + if with_link: + if link_text is None: + link_text = prefix + anchor = etree.Element('a', href='#%s' % prefix) + anchor.set('class', 'anchor') + anchor.text = six.text_type(link_text) + parent.insert(index, anchor) + + if with_target: + anchor_target = etree.Element('a', name='%s' % prefix) + anchor_target.set('class', 'target') + anchor_target.text = u' ' + parent.insert(index, anchor_target) + + +def any_ancestor(element, test): + for ancestor in element.iterancestors(): + if test(ancestor): + return True + return False + + +def add_anchors(root): + counter = 1 + for element in root.iterdescendants(): + def f(e): + return e.get('class') in ('note', 'motto', 'motto_podpis', 'dedication', 'frame') or \ + e.get('id') == 'nota_red' or e.tag == 'blockquote' + if any_ancestor(element, f): + continue + + if element.tag == 'div' and 'verse' in element.get('class', ''): + if counter == 1 or counter % 5 == 0: + add_anchor(element, "f%d" % counter, link_text=counter) + counter += 1 + elif 'paragraph' in element.get('class', ''): + add_anchor(element, "f%d" % counter, link_text=counter) + counter += 1 + + +def raw_printable_text(element): + working = copy.deepcopy(element) + for e in working.findall('a'): + if e.get('class') in ('annotation', 'theme-begin'): + e.text = '' + return etree.tostring(working, method='text', encoding='unicode').strip() + + +def add_table_of_contents(root): + sections = [] + counter = 1 + for element in root.iterdescendants(): + if element.tag in ('h2', 'h3'): + if any_ancestor(element, + lambda e: e.get('id') in ('footnotes', 'nota_red') or e.get('class') in ('person-list',)): + continue + + element_text = raw_printable_text(element) + if element.tag == 'h3' and len(sections) and sections[-1][1] == 'h2': + sections[-1][3].append((counter, element.tag, element_text, [])) + else: + sections.append((counter, element.tag, element_text, [])) + add_anchor(element, "s%d" % counter, with_link=False) + counter += 1 + + toc = etree.Element('div') + toc.set('id', 'toc') + toc_header = etree.SubElement(toc, 'h2') + toc_header.text = u'Spis treści' + toc_list = etree.SubElement(toc, 'ol') + + for n, section, text, subsections in sections: + section_element = etree.SubElement(toc_list, 'li') + add_anchor(section_element, "s%d" % n, with_target=False, link_text=text) + + if len(subsections): + subsection_list = etree.SubElement(section_element, 'ol') + for n1, subsection, subtext, _ in subsections: + subsection_element = etree.SubElement(subsection_list, 'li') + add_anchor(subsection_element, "s%d" % n1, with_target=False, link_text=subtext) + + root.insert(0, toc) + + +def add_table_of_themes(root): + try: + from sortify import sortify + except ImportError: + def sortify(x): + return x + + book_themes = {} + for fragment in root.findall('.//a[@class="theme-begin"]'): + if not fragment.text: + continue + theme_names = [s.strip() for s in fragment.text.split(',')] + for theme_name in theme_names: + book_themes.setdefault(theme_name, []).append(fragment.get('name')) + book_themes = list(book_themes.items()) + book_themes.sort(key=lambda s: sortify(s[0])) + themes_div = etree.Element('div', id="themes") + themes_ol = etree.SubElement(themes_div, 'ol') + for theme_name, fragments in book_themes: + themes_li = etree.SubElement(themes_ol, 'li') + themes_li.text = "%s: " % theme_name + for i, fragment in enumerate(fragments): + item = etree.SubElement(themes_li, 'a', href="#%s" % fragment) + item.text = str(i + 1) + item.tail = ' ' + root.insert(0, themes_div) + + +def extract_annotations(html_path): + """Extracts annotations from HTML for annotations dictionary. + + For each annotation, yields a tuple of: + anchor, footnote type, valid qualifiers, text, html. + + """ + from .fn_qualifiers import FN_QUALIFIERS + + parser = etree.HTMLParser(encoding='utf-8') + tree = etree.parse(html_path, parser) + footnotes = tree.find('//*[@id="footnotes"]') + re_qualifier = re.compile(r'[^\u2014]+\s+\(([^\)]+)\)\s+\u2014') + if footnotes is not None: + for footnote in footnotes.findall('div'): + fn_type = footnote.get('class').split('-')[1] + anchor = footnote.find('a[@class="annotation"]').get('href')[1:] + del footnote[:2] + footnote.text = None + if len(footnote) and footnote[-1].tail == '\n': + footnote[-1].tail = None + text_str = etree.tostring(footnote, method='text', encoding='unicode').strip() + html_str = etree.tostring(footnote, method='html', encoding='unicode').strip() + + match = re_qualifier.match(text_str) + if match: + qualifier_str = match.group(1) + qualifiers = [] + for candidate in re.split('[;,]', qualifier_str): + candidate = candidate.strip() + if candidate in FN_QUALIFIERS: + qualifiers.append(candidate) + elif candidate.startswith('z '): + subcandidate = candidate.split()[1] + if subcandidate in FN_QUALIFIERS: + qualifiers.append(subcandidate) + else: + qualifiers = [] + + yield anchor, fn_type, qualifiers, text_str, html_str diff --git a/src/librarian/hyphenator.py b/src/librarian/hyphenator.py new file mode 100644 index 0000000..aa5b4c3 --- /dev/null +++ b/src/librarian/hyphenator.py @@ -0,0 +1,240 @@ +""" + +This is a Pure Python module to hyphenate text. + +It is inspired by Ruby's Text::Hyphen, but currently reads standard *.dic files, +that must be installed separately. + +In the future it's maybe nice if dictionaries could be distributed together with +this module, in a slightly prepared form, like in Ruby's Text::Hyphen. + +Wilbert Berendsen, March 2008 +info@wilbertberendsen.nl + +License: LGPL. + +""" +from __future__ import print_function, unicode_literals + +import sys +import re + +__all__ = ("Hyphenator") + +# cache of per-file Hyph_dict objects +hdcache = {} + +# precompile some stuff +parse_hex = re.compile(r'\^{2}([0-9a-f]{2})').sub +parse = re.compile(r'(\d?)(\D?)').findall + +def hexrepl(matchObj): + return unichr(int(matchObj.group(1), 16)) + + +class parse_alt(object): + """ + Parse nonstandard hyphen pattern alternative. + The instance returns a special int with data about the current position + in the pattern when called with an odd value. + """ + def __init__(self, pat, alt): + alt = alt.split(',') + self.change = alt[0] + if len(alt) > 2: + self.index = int(alt[1]) + self.cut = int(alt[2]) + 1 + else: + self.index = 1 + self.cut = len(re.sub(r'[\d\.]', '', pat)) + 1 + if pat.startswith('.'): + self.index += 1 + + def __call__(self, val): + self.index -= 1 + val = int(val) + if val & 1: + return dint(val, (self.change, self.index, self.cut)) + else: + return val + + +class dint(int): + """ + Just an int some other data can be stuck to in a data attribute. + Call with ref=other to use the data from the other dint. + """ + def __new__(cls, value, data=None, ref=None): + obj = int.__new__(cls, value) + if ref and type(ref) == dint: + obj.data = ref.data + else: + obj.data = data + return obj + + +class Hyph_dict(object): + """ + Reads a hyph_*.dic file and stores the hyphenation patterns. + Parameters: + -filename : filename of hyph_*.dic to read + """ + def __init__(self, filename): + self.patterns = {} + f = open(filename) + charset = f.readline().strip() + if charset.startswith('charset '): + charset = charset[8:].strip() + + for pat in f: + pat = pat.decode(charset).strip() + if not pat or pat[0] == '%': continue + # replace ^^hh with the real character + pat = parse_hex(hexrepl, pat) + # read nonstandard hyphen alternatives + if '/' in pat: + pat, alt = pat.split('/', 1) + factory = parse_alt(pat, alt) + else: + factory = int + tag, value = zip(*[(s, factory(i or "0")) for i, s in parse(pat)]) + # if only zeros, skip this pattern + if max(value) == 0: continue + # chop zeros from beginning and end, and store start offset. + start, end = 0, len(value) + while not value[start]: start += 1 + while not value[end-1]: end -= 1 + self.patterns[''.join(tag)] = start, value[start:end] + f.close() + self.cache = {} + self.maxlen = max(map(len, self.patterns.keys())) + + def positions(self, word): + """ + Returns a list of positions where the word can be hyphenated. + E.g. for the dutch word 'lettergrepen' this method returns + the list [3, 6, 9]. + + Each position is a 'data int' (dint) with a data attribute. + If the data attribute is not None, it contains a tuple with + information about nonstandard hyphenation at that point: + (change, index, cut) + + change: is a string like 'ff=f', that describes how hyphenation + should take place. + index: where to substitute the change, counting from the current + point + cut: how many characters to remove while substituting the nonstandard + hyphenation + """ + word = word.lower() + points = self.cache.get(word) + if points is None: + prepWord = '.%s.' % word + res = [0] * (len(prepWord) + 1) + for i in range(len(prepWord) - 1): + for j in range(i + 1, min(i + self.maxlen, len(prepWord)) + 1): + p = self.patterns.get(prepWord[i:j]) + if p: + offset, value = p + s = slice(i + offset, i + offset + len(value)) + res[s] = map(max, value, res[s]) + + points = [dint(i - 1, ref=r) for i, r in enumerate(res) if r % 2] + self.cache[word] = points + return points + + +class Hyphenator(object): + """ + Reads a hyph_*.dic file and stores the hyphenation patterns. + Provides methods to hyphenate strings in various ways. + Parameters: + -filename : filename of hyph_*.dic to read + -left: make the first syllabe not shorter than this + -right: make the last syllabe not shorter than this + -cache: if true (default), use a cached copy of the dic file, if possible + + left and right may also later be changed: + h = Hyphenator(file) + h.left = 1 + """ + def __init__(self, filename, left=2, right=2, cache=True): + self.left = left + self.right = right + if not cache or filename not in hdcache: + hdcache[filename] = Hyph_dict(filename) + self.hd = hdcache[filename] + + def positions(self, word): + """ + Returns a list of positions where the word can be hyphenated. + See also Hyph_dict.positions. The points that are too far to + the left or right are removed. + """ + right = len(word) - self.right + return [i for i in self.hd.positions(word) if self.left <= i <= right] + + def iterate(self, word): + """ + Iterate over all hyphenation possibilities, the longest first. + """ + if isinstance(word, str): + word = word.decode('latin1') + for p in reversed(self.positions(word)): + if p.data: + # get the nonstandard hyphenation data + change, index, cut = p.data + if word.isupper(): + change = change.upper() + c1, c2 = change.split('=') + yield word[:p+index] + c1, c2 + word[p+index+cut:] + else: + yield word[:p], word[p:] + + def wrap(self, word, width, hyphen='-'): + """ + Return the longest possible first part and the last part of the + hyphenated word. The first part has the hyphen already attached. + Returns None, if there is no hyphenation point before width, or + if the word could not be hyphenated. + """ + width -= len(hyphen) + for w1, w2 in self.iterate(word): + if len(w1) <= width: + return w1 + hyphen, w2 + + def inserted(self, word, hyphen='-'): + """ + Returns the word as a string with all the possible hyphens inserted. + E.g. for the dutch word 'lettergrepen' this method returns + the string 'let-ter-gre-pen'. The hyphen string to use can be + given as the second parameter, that defaults to '-'. + """ + if isinstance(word, str): + word = word.decode('latin1') + l = list(word) + for p in reversed(self.positions(word)): + if p.data: + # get the nonstandard hyphenation data + change, index, cut = p.data + if word.isupper(): + change = change.upper() + l[p + index : p + index + cut] = change.replace('=', hyphen) + else: + l.insert(p, hyphen) + return ''.join(l) + + __call__ = iterate + + +if __name__ == "__main__": + + dict_file = sys.argv[1] + word = sys.argv[2].decode('latin1') + + h = Hyphenator(dict_file, left=1, right=1) + + for i in h(word): + print(i) + diff --git a/src/librarian/mobi.py b/src/librarian/mobi.py new file mode 100644 index 0000000..6f1f5d6 --- /dev/null +++ b/src/librarian/mobi.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import unicode_literals + +from copy import deepcopy +import os +import subprocess +from tempfile import NamedTemporaryFile + +from librarian import OutputFile + + +def transform(wldoc, verbose=False, sample=None, cover=None, + use_kindlegen=False, flags=None, hyphenate=True, ilustr_path='', + converter_path=None): + """ produces a MOBI file + + wldoc: a WLDocument + sample=n: generate sample e-book (with at least n paragraphs) + cover: a cover.Cover factory overriding default + flags: less-advertising, + converter_path: override path to MOBI converter, + either ebook-convert or kindlegen + """ + + document = deepcopy(wldoc) + del wldoc + + epub = document.as_epub(verbose=verbose, sample=sample, + html_toc=True, cover=cover or True, flags=flags, + hyphenate=hyphenate, ilustr_path=ilustr_path, output_type='mobi') + if verbose: + kwargs = {} + else: + devnull = open("/dev/null", 'w') + kwargs = {"stdout": devnull, "stderr": devnull} + + output_file = NamedTemporaryFile(prefix='librarian', suffix='.mobi', + delete=False) + output_file.close() + + if use_kindlegen: + output_file_basename = os.path.basename(output_file.name) + subprocess.check_call([converter_path or 'kindlegen', + '-c2', epub.get_filename(), + '-o', output_file_basename], **kwargs) + else: + subprocess.check_call([converter_path or 'ebook-convert', + epub.get_filename(), + output_file.name, '--no-inline-toc', + '--mobi-file-type=both', + '--mobi-ignore-margins'], **kwargs) + return OutputFile.from_filename(output_file.name) diff --git a/src/librarian/packagers.py b/src/librarian/packagers.py new file mode 100644 index 0000000..b3f5548 --- /dev/null +++ b/src/librarian/packagers.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import print_function, unicode_literals + +import os +from librarian import pdf, epub, mobi, DirDocProvider, ParseError +from librarian.parser import WLDocument + +from .util import makedirs + + +class Packager(object): + cover = None + flags = None + + @classmethod + def transform(cls, *args, **kwargs): + return cls.converter.transform(*args, **kwargs) + + @classmethod + def prepare_file(cls, main_input, output_dir, verbose=False, overwrite=False): + path, fname = os.path.realpath(main_input).rsplit('/', 1) + provider = DirDocProvider(path) + slug, ext = os.path.splitext(fname) + + if output_dir != '': + makedirs(output_dir) + outfile = os.path.join(output_dir, slug + '.' + cls.ext) + if os.path.exists(outfile) and not overwrite: + return + + doc = WLDocument.from_file(main_input, provider=provider) + output_file = cls.transform(doc, cover=cls.cover, flags=cls.flags) + doc.save_output_file(output_file, output_path=outfile) + + @classmethod + def prepare(cls, input_filenames, output_dir='', verbose=False, overwrite=False): + try: + for main_input in input_filenames: + if verbose: + print(main_input) + cls.prepare_file(main_input, output_dir, verbose, overwrite) + except ParseError as e: + print('%(file)s:%(name)s:%(message)s' % { + 'file': main_input, + 'name': e.__class__.__name__, + 'message': e.message + }) + + +class EpubPackager(Packager): + converter = epub + ext = 'epub' + + +class MobiPackager(Packager): + converter = mobi + ext = 'mobi' + + +class PdfPackager(Packager): + converter = pdf + ext = 'pdf' + + @classmethod + def transform(cls, *args, **kwargs): + return cls.converter.transform(*args, morefloats='new', **kwargs) diff --git a/src/librarian/parser.py b/src/librarian/parser.py new file mode 100644 index 0000000..efe6e95 --- /dev/null +++ b/src/librarian/parser.py @@ -0,0 +1,232 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import unicode_literals + +from librarian import ValidationError, NoDublinCore, ParseError, NoProvider +from librarian import RDFNS +from librarian.cover import make_cover +from librarian import dcparser + +from xml.parsers.expat import ExpatError +from lxml import etree +from lxml.etree import XMLSyntaxError, XSLTApplyError + +import os +import re +import six + + +class WLDocument(object): + LINE_SWAP_EXPR = re.compile(r'/\s', re.MULTILINE | re.UNICODE) + provider = None + + def __init__(self, edoc, parse_dublincore=True, provider=None, + strict=False, meta_fallbacks=None): + self.edoc = edoc + self.provider = provider + + root_elem = edoc.getroot() + + dc_path = './/' + RDFNS('RDF') + + if root_elem.tag != 'utwor': + raise ValidationError("Invalid root element. Found '%s', should be 'utwor'" % root_elem.tag) + + if parse_dublincore: + self.rdf_elem = root_elem.find(dc_path) + + if self.rdf_elem is None: + raise NoDublinCore("Document must have a '%s' element." % RDFNS('RDF')) + + self.book_info = dcparser.BookInfo.from_element( + self.rdf_elem, fallbacks=meta_fallbacks, strict=strict) + else: + self.book_info = None + + @classmethod + def from_bytes(cls, xml, *args, **kwargs): + return cls.from_file(six.BytesIO(xml), *args, **kwargs) + + @classmethod + def from_file(cls, xmlfile, *args, **kwargs): + + # first, prepare for parsing + if isinstance(xmlfile, six.text_type): + file = open(xmlfile, 'rb') + try: + data = file.read() + finally: + file.close() + else: + data = xmlfile.read() + + if not isinstance(data, six.text_type): + data = data.decode('utf-8') + + data = data.replace(u'\ufeff', '') + + try: + parser = etree.XMLParser(remove_blank_text=False) + tree = etree.parse(six.BytesIO(data.encode('utf-8')), parser) + + return cls(tree, *args, **kwargs) + except (ExpatError, XMLSyntaxError, XSLTApplyError) as e: + raise ParseError(e) + + def swap_endlines(self): + """Converts line breaks in stanzas into
    tags.""" + # only swap inside stanzas + for elem in self.edoc.iter('strofa'): + for child in list(elem): + if child.tail: + chunks = self.LINE_SWAP_EXPR.split(child.tail) + ins_index = elem.index(child) + 1 + while len(chunks) > 1: + ins = etree.Element('br') + ins.tail = chunks.pop() + elem.insert(ins_index, ins) + child.tail = chunks.pop(0) + if elem.text: + chunks = self.LINE_SWAP_EXPR.split(elem.text) + while len(chunks) > 1: + ins = etree.Element('br') + ins.tail = chunks.pop() + elem.insert(0, ins) + elem.text = chunks.pop(0) + + def parts(self): + if self.provider is None: + raise NoProvider('No document provider supplied.') + if self.book_info is None: + raise NoDublinCore('No Dublin Core in document.') + for part_uri in self.book_info.parts: + yield self.from_file(self.provider.by_uri(part_uri), provider=self.provider) + + def chunk(self, path): + # convert the path to XPath + expr = self.path_to_xpath(path) + elems = self.edoc.xpath(expr) + + if len(elems) == 0: + return None + else: + return elems[0] + + def path_to_xpath(self, path): + parts = [] + + for part in path.split('/'): + match = re.match(r'([^\[]+)\[(\d+)\]', part) + if not match: + parts.append(part) + else: + tag, n = match.groups() + parts.append("*[%d][name() = '%s']" % (int(n)+1, tag)) + + if parts[0] == '.': + parts[0] = '' + + return '/'.join(parts) + + def transform(self, stylesheet, **options): + return self.edoc.xslt(stylesheet, **options) + + def update_dc(self): + if self.book_info: + parent = self.rdf_elem.getparent() + parent.replace(self.rdf_elem, self.book_info.to_etree(parent)) + + def serialize(self): + self.update_dc() + return etree.tostring(self.edoc, encoding='unicode', pretty_print=True) + + def merge_chunks(self, chunk_dict): + unmerged = [] + + for key, data in chunk_dict.iteritems(): + try: + xpath = self.path_to_xpath(key) + node = self.edoc.xpath(xpath)[0] + repl = etree.fromstring(u"<%s>%s" % (node.tag, data, node.tag)) + node.getparent().replace(node, repl) + except Exception as e: + unmerged.append(repr((key, xpath, e))) + + return unmerged + + def clean_ed_note(self, note_tag='nota_red'): + """ deletes forbidden tags from nota_red """ + + for node in self.edoc.xpath('|'.join('//%s//%s' % (note_tag, tag) for tag in + ('pa', 'pe', 'pr', 'pt', 'begin', 'end', 'motyw'))): + tail = node.tail + node.clear() + node.tag = 'span' + node.tail = tail + + def editors(self): + """Returns a set of all editors for book and its children. + + :returns: set of dcparser.Person objects + """ + if self.book_info is None: + raise NoDublinCore('No Dublin Core in document.') + persons = set(self.book_info.editors + self.book_info.technical_editors) + for child in self.parts(): + persons.update(child.editors()) + if None in persons: + persons.remove(None) + return persons + + # Converters + + def as_html(self, *args, **kwargs): + from librarian import html + return html.transform(self, *args, **kwargs) + + def as_text(self, *args, **kwargs): + from librarian import text + return text.transform(self, *args, **kwargs) + + def as_epub(self, *args, **kwargs): + from librarian import epub + return epub.transform(self, *args, **kwargs) + + def as_pdf(self, *args, **kwargs): + from librarian import pdf + return pdf.transform(self, *args, **kwargs) + + def as_mobi(self, *args, **kwargs): + from librarian import mobi + return mobi.transform(self, *args, **kwargs) + + def as_fb2(self, *args, **kwargs): + from librarian import fb2 + return fb2.transform(self, *args, **kwargs) + + def as_cover(self, cover_class=None, *args, **kwargs): + if cover_class is None: + cover_class = make_cover + return cover_class(self.book_info, *args, **kwargs).output_file() + + # for debugging only + def latex_dir(self, *args, **kwargs): + kwargs['latex_dir'] = True + from librarian import pdf + return pdf.transform(self, *args, **kwargs) + + def save_output_file(self, output_file, output_path=None, output_dir_path=None, make_author_dir=False, ext=None): + if output_dir_path: + save_path = output_dir_path + if make_author_dir: + save_path = os.path.join(save_path, six.text_type(self.book_info.author).encode('utf-8')) + save_path = os.path.join(save_path, self.book_info.url.slug) + if ext: + save_path += '.%s' % ext + else: + save_path = output_path + + output_file.save_as(save_path) diff --git a/src/librarian/partners.py b/src/librarian/partners.py new file mode 100644 index 0000000..671cf4d --- /dev/null +++ b/src/librarian/partners.py @@ -0,0 +1,123 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# + +""" +Classes for packaging ebooks for some old partners. +These should be removed from librarian to separate package, +along with custom cover images etc. + +New partners shouldn't be added here, but in the partners repository. +""" +from __future__ import print_function, unicode_literals + +from librarian import packagers, cover +from .util import makedirs + + +class GandalfEpub(packagers.EpubPackager): + cover = cover.GandalfCover + + +class GandalfPdf(packagers.PdfPackager): + cover = cover.GandalfCover + + +class BookotekaEpub(packagers.EpubPackager): + cover = cover.BookotekaCover + + +class PrestigioEpub(packagers.EpubPackager): + cover = cover.PrestigioCover + flags = ('less-advertising',) + + +class PrestigioPdf(packagers.PdfPackager): + cover = cover.PrestigioCover + flags = ('less-advertising',) + + +class Virtualo(packagers.Packager): + @staticmethod + def utf_trunc(text, limit): + """ truncates text to at most `limit' bytes in utf-8 """ + if text is None: + return text + if len(text.encode('utf-8')) > limit: + newlimit = limit - 3 + while len(text.encode('utf-8')) > newlimit: + text = text[:(newlimit - len(text.encode('utf-8'))) / 4] + text += '...' + return text + + @classmethod + def prepare(cls, input_filenames, output_dir='', verbose=False): + from lxml import etree + from librarian import DirDocProvider, ParseError + from librarian.parser import WLDocument + from copy import deepcopy + import os.path + + xml = etree.fromstring(""" + """) + product = etree.fromstring(""" + + + + + + + Jan + Kowalski + + + 0.0 + PL + """) + + try: + for main_input in input_filenames: + if verbose: + print(main_input) + path, fname = os.path.realpath(main_input).rsplit('/', 1) + provider = DirDocProvider(path) + slug, ext = os.path.splitext(fname) + + outfile_dir = os.path.join(output_dir, slug) + makedirs(os.path.join(output_dir, slug)) + + doc = WLDocument.from_file(main_input, provider=provider) + info = doc.book_info + + product_elem = deepcopy(product) + product_elem[0].text = cls.utf_trunc(slug, 100) + product_elem[1].text = cls.utf_trunc(info.title, 255) + product_elem[2].text = cls.utf_trunc(info.description, 255) + product_elem[3].text = cls.utf_trunc(info.source_name, 3000) + product_elem[4][0][0].text = cls.utf_trunc(u' '.join(info.author.first_names), 100) + product_elem[4][0][1].text = cls.utf_trunc(info.author.last_name, 100) + xml.append(product_elem) + + cover.VirtualoCover(info).save(os.path.join(outfile_dir, slug+'.jpg')) + outfile = os.path.join(outfile_dir, '1.epub') + outfile_sample = os.path.join(outfile_dir, '1.sample.epub') + doc.save_output_file(doc.as_epub(), output_path=outfile) + doc.save_output_file(doc.as_epub(doc, sample=25), output_path=outfile_sample) + outfile = os.path.join(outfile_dir, '1.mobi') + outfile_sample = os.path.join(outfile_dir, '1.sample.mobi') + doc.save_output_file(doc.as_mobi(cover=cover.VirtualoCover), output_path=outfile) + doc.save_output_file( + doc.as_mobi(doc, cover=cover.VirtualoCover, sample=25), + output_path=outfile_sample) + except ParseError as e: + print('%(file)s:%(name)s:%(message)s' % { + 'file': main_input, + 'name': e.__class__.__name__, + 'message': e.message + }) + + xml_file = open(os.path.join(output_dir, 'import_products.xml'), 'w') + xml_file.write(etree.tostring(xml, pretty_print=True, encoding='unicode').encode('utf-8')) + xml_file.close() diff --git a/src/librarian/pdf.py b/src/librarian/pdf.py new file mode 100644 index 0000000..e6d897d --- /dev/null +++ b/src/librarian/pdf.py @@ -0,0 +1,378 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +"""PDF creation library. + +Creates one big XML from the book and its children, converts it to LaTeX +with TeXML, then runs it by XeLaTeX. + +""" +from __future__ import print_function, unicode_literals + +import os +import os.path +import shutil +from tempfile import mkdtemp, NamedTemporaryFile +import re +from copy import deepcopy +from subprocess import call, PIPE +from itertools import chain + +from Texml.processor import process +from lxml import etree +from lxml.etree import XMLSyntaxError, XSLTApplyError +import six + +from librarian.dcparser import Person +from librarian.parser import WLDocument +from librarian import ParseError, DCNS, get_resource, OutputFile, RDFNS +from librarian import functions +from librarian.cover import make_cover +from .sponsor import sponsor_logo + + +functions.reg_substitute_entities() +functions.reg_strip() +functions.reg_starts_white() +functions.reg_ends_white() +functions.reg_texcommand() + +STYLESHEETS = { + 'wl2tex': 'pdf/wl2tex.xslt', +} + +# CUSTOMIZATIONS = [ +# 'nofootnotes', +# 'nothemes', +# 'defaultleading', +# 'onehalfleading', +# 'doubleleading', +# 'nowlfont', +# ] + + +def insert_tags(doc, split_re, tagname, exclude=None): + """ inserts for every occurence of `split_re' in text nodes in the `doc' tree + + >>> t = etree.fromstring('
    A-B-CX-Y-Z') + >>> insert_tags(t, re.compile('-'), 'd') + >>> print(etree.tostring(t, encoding='unicode')) + ABCXYZ + """ + + for elem in doc.iter(tag=etree.Element): + if exclude and elem.tag in exclude: + continue + if elem.text: + chunks = split_re.split(elem.text) + while len(chunks) > 1: + ins = etree.Element(tagname) + ins.tail = chunks.pop() + elem.insert(0, ins) + elem.text = chunks.pop(0) + if elem.tail: + chunks = split_re.split(elem.tail) + parent = elem.getparent() + ins_index = parent.index(elem) + 1 + while len(chunks) > 1: + ins = etree.Element(tagname) + ins.tail = chunks.pop() + parent.insert(ins_index, ins) + elem.tail = chunks.pop(0) + + +def substitute_hyphens(doc): + insert_tags(doc, + re.compile("(?<=[^-\s])-(?=[^-\s])"), + "dywiz", + exclude=[DCNS("identifier.url"), DCNS("rights.license"), "meta"] + ) + + +def fix_hanging(doc): + insert_tags(doc, + re.compile("(?<=\s\w)\s+"), + "nbsp", + exclude=[DCNS("identifier.url"), DCNS("rights.license")] + ) + + +def fix_tables(doc): + for kol in doc.iter(tag='kol'): + if kol.tail is not None: + if not kol.tail.strip(): + kol.tail = None + for table in chain(doc.iter(tag='tabela'), doc.iter(tag='tabelka')): + if table.get('ramka') == '1' or table.get('ramki') == '1': + table.set('_format', '|' + 'X|' * len(table[0])) + else: + table.set('_format', 'X' * len(table[0])) + + +def mark_subauthors(doc): + root_author = ', '.join(elem.text for elem in doc.findall('./' + RDFNS('RDF') + '//' + DCNS('creator_parsed'))) + last_author = None + # jeśli autor jest inny niż autor całości i niż poprzedni autor + # to wstawiamy jakiś znacznik w rdf? + for subutwor in doc.xpath('/utwor/utwor'): + author = ', '.join(elem.text for elem in subutwor.findall('.//' + DCNS('creator_parsed'))) + if author not in (last_author, root_author): + subutwor.find('.//' + RDFNS('RDF')).append(etree.Element('use_subauthor')) + last_author = author + + +def move_motifs_inside(doc): + """ moves motifs to be into block elements """ + for master in doc.xpath('//powiesc|//opowiadanie|//liryka_l|//liryka_lp|' + '//dramat_wierszowany_l|//dramat_wierszowany_lp|//dramat_wspolczesny'): + for motif in master.xpath('motyw'): + for sib in motif.itersiblings(): + if sib.tag not in ('sekcja_swiatlo', 'sekcja_asterysk', 'separator_linia', + 'begin', 'end', 'motyw', 'extra', 'uwaga'): + # motif shouldn't have a tail - it would be untagged text + motif.tail = None + motif.getparent().remove(motif) + sib.insert(0, motif) + break + + +def hack_motifs(doc): + """ dirty hack for the marginpar-creates-orphans LaTeX problem + see http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/2304 + + moves motifs in stanzas from first verse to second + and from next to last to last, then inserts negative vspace before them + """ + for motif in doc.findall('//strofa//motyw'): + # find relevant verse-level tag + verse, stanza = motif, motif.getparent() + while stanza is not None and stanza.tag != 'strofa': + verse, stanza = stanza, stanza.getparent() + breaks_before = sum(1 for i in verse.itersiblings('br', preceding=True)) + breaks_after = sum(1 for i in verse.itersiblings('br')) + if (breaks_before == 0 and breaks_after > 0) or breaks_after == 1: + move_by = 1 + if breaks_after == 2: + move_by += 1 + moved_motif = deepcopy(motif) + motif.tag = 'span' + motif.text = None + moved_motif.tail = None + moved_motif.set('moved', str(move_by)) + + for br in verse.itersiblings('br'): + if move_by > 1: + move_by -= 1 + continue + br.addnext(moved_motif) + break + + +def parse_creator(doc): + """Generates readable versions of creator and translator tags. + + Finds all dc:creator and dc.contributor.translator tags + and adds *_parsed versions with forenames first. + """ + for person in doc.xpath("|".join('//dc:' + tag for tag in ('creator', 'contributor.translator')), + namespaces={'dc': str(DCNS)})[::-1]: + if not person.text: + continue + p = Person.from_text(person.text) + person_parsed = deepcopy(person) + person_parsed.tag = person.tag + '_parsed' + person_parsed.set('sortkey', person.text) + person_parsed.text = p.readable() + person.getparent().insert(0, person_parsed) + + +def get_stylesheet(name): + return get_resource(STYLESHEETS[name]) + + +def package_available(package, args='', verbose=False): + """ check if a verion of a latex package accepting given args is available """ + tempdir = mkdtemp('-wl2pdf-test') + fpath = os.path.join(tempdir, 'test.tex') + f = open(fpath, 'w') + f.write(""" + \\documentclass{wl} + \\usepackage[%s]{%s} + \\begin{document} + \\end{document} + """ % (args, package)) + f.close() + if verbose: + p = call(['xelatex', '-output-directory', tempdir, fpath]) + else: + p = call(['xelatex', '-interaction=batchmode', '-output-directory', tempdir, fpath], stdout=PIPE, stderr=PIPE) + shutil.rmtree(tempdir) + return p == 0 + + +def transform(wldoc, verbose=False, save_tex=None, morefloats=None, + cover=None, flags=None, customizations=None, ilustr_path='', latex_dir=False): + """ produces a PDF file with XeLaTeX + + wldoc: a WLDocument + verbose: prints all output from LaTeX + save_tex: path to save the intermediary LaTeX file to + morefloats (old/new/none): force specific morefloats + cover: a cover.Cover factory or True for default + flags: less-advertising, + customizations: user requested customizations regarding various formatting parameters (passed to wl LaTeX class) + """ + + # Parse XSLT + try: + book_info = wldoc.book_info + document = load_including_children(wldoc) + root = document.edoc.getroot() + + if cover: + if cover is True: + cover = make_cover + bound_cover = cover(book_info, width=1200) + root.set('data-cover-width', str(bound_cover.width)) + root.set('data-cover-height', str(bound_cover.height)) + if bound_cover.uses_dc_cover: + if book_info.cover_by: + root.set('data-cover-by', book_info.cover_by) + if book_info.cover_source: + root.set('data-cover-source', book_info.cover_source) + if flags: + for flag in flags: + root.set('flag-' + flag, 'yes') + + # check for LaTeX packages + if morefloats: + root.set('morefloats', morefloats.lower()) + elif package_available('morefloats', 'maxfloats=19'): + root.set('morefloats', 'new') + + # add customizations + if customizations is not None: + root.set('customizations', u','.join(customizations)) + + # add editors info + editors = document.editors() + if editors: + root.set('editors', u', '.join(sorted( + editor.readable() for editor in editors))) + if document.book_info.funders: + root.set('funders', u', '.join(document.book_info.funders)) + if document.book_info.thanks: + root.set('thanks', document.book_info.thanks) + + # hack the tree + move_motifs_inside(document.edoc) + hack_motifs(document.edoc) + parse_creator(document.edoc) + substitute_hyphens(document.edoc) + fix_hanging(document.edoc) + fix_tables(document.edoc) + mark_subauthors(document.edoc) + + # wl -> TeXML + style_filename = get_stylesheet("wl2tex") + style = etree.parse(style_filename) + functions.reg_mathml_latex() + + # TeXML -> LaTeX + temp = mkdtemp('-wl2pdf') + + for ilustr in document.edoc.findall("//ilustr"): + shutil.copy(os.path.join(ilustr_path, ilustr.get("src")), temp) + + for sponsor in book_info.sponsors: + ins = etree.Element("data-sponsor", name=sponsor) + logo = sponsor_logo(sponsor) + if logo: + fname = 'sponsor-%s' % os.path.basename(logo) + shutil.copy(logo, os.path.join(temp, fname)) + ins.set('src', fname) + root.insert(0, ins) + + if book_info.sponsor_note: + root.set("sponsor-note", book_info.sponsor_note) + + texml = document.transform(style) + + if cover: + with open(os.path.join(temp, 'cover.png'), 'w') as f: + bound_cover.save(f, quality=80) + + del document # no longer needed large object :) + + tex_path = os.path.join(temp, 'doc.tex') + fout = open(tex_path, 'wb') + process(six.BytesIO(texml), fout, 'utf-8') + fout.close() + del texml + + if save_tex: + shutil.copy(tex_path, save_tex) + + # LaTeX -> PDF + shutil.copy(get_resource('pdf/wl.cls'), temp) + shutil.copy(get_resource('res/wl-logo.png'), temp) + + if latex_dir: + return temp + + try: + cwd = os.getcwd() + except OSError: + cwd = None + os.chdir(temp) + + # some things work better when compiled twice + # (table of contents, [line numbers - disabled]) + for run in range(2): + if verbose: + p = call(['xelatex', tex_path]) + else: + p = call(['xelatex', '-interaction=batchmode', tex_path], stdout=PIPE, stderr=PIPE) + if p: + raise ParseError("Error parsing .tex file") + + if cwd is not None: + os.chdir(cwd) + + output_file = NamedTemporaryFile(prefix='librarian', suffix='.pdf', delete=False) + pdf_path = os.path.join(temp, 'doc.pdf') + shutil.move(pdf_path, output_file.name) + shutil.rmtree(temp) + return OutputFile.from_filename(output_file.name) + + except (XMLSyntaxError, XSLTApplyError) as e: + raise ParseError(e) + + +def load_including_children(wldoc=None, provider=None, uri=None): + """ Makes one big xml file with children inserted at end. + + Either wldoc or provider and URI must be provided. + """ + + if uri and provider: + f = provider.by_uri(uri) + text = f.read().decode('utf-8') + f.close() + elif wldoc is not None: + text = etree.tostring(wldoc.edoc, encoding='unicode') + provider = wldoc.provider + else: + raise ValueError('Neither a WLDocument, nor provider and URI were provided.') + + text = re.sub(r"([\u0400-\u04ff]+)", r"\1", text) + + document = WLDocument.from_bytes(text.encode('utf-8'), parse_dublincore=True, provider=provider) + document.swap_endlines() + + for child_uri in document.book_info.parts: + child = load_including_children(provider=provider, uri=child_uri) + document.edoc.getroot().append(child.edoc.getroot()) + return document diff --git a/src/librarian/pdf/wl.cls b/src/librarian/pdf/wl.cls new file mode 100644 index 0000000..f8b7731 --- /dev/null +++ b/src/librarian/pdf/wl.cls @@ -0,0 +1,826 @@ +% -*- coding: utf-8 -*- +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{wl}[2011/11/28 wolnelektury.pl book style] + +% PDF customizations +% +% nofootnotes - disable generation of footnotes +% nothemes - disable generation of themes +% defaultleading - default leading +% onehalfleading - leading of 1.5 (interlinia) +% doubleleading - double leading (interlinia) +% a4paper,... - paper size as required by LaTeX +% nowlfont - don't use customized WL font + +\RequirePackage{fixltx2e} +\RequirePackage{setspace} +\RequirePackage{type1cm} +\DeclareOption{13pt}{% +\AtEndOfClass{% +% font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/ +\renewcommand\normalsize{% + \@setfontsize\normalsize{13pt}{14.5pt}% + \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ + \belowdisplayskip \abovedisplayskip + \let\@listi\@listI}\normalsize% +\renewcommand\footnotesize{% + \@setfontsize\footnotesize\@xpt\@xiipt + \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 6\p@ \@plus2\p@ \@minus2\p@ + \parsep 3\p@ \@plus2\p@ \@minus\p@ + \itemsep \parsep}% + \belowdisplayskip \abovedisplayskip +}% +}% +} +\DeclareOption{16pt}{% +\AtEndOfClass{% +% font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/ +\renewcommand\normalsize{% + \@setfontsize\normalsize{16pt}{18pt}% + \abovedisplayskip 15\p@ \@plus3\p@ \@minus7\p@ + \abovedisplayshortskip \z@ \@plus3.5\p@ + \belowdisplayshortskip 8\p@ \@plus4\p@ \@minus3\p@ + \belowdisplayskip \abovedisplayskip + \let\@listi\@listI}\normalsize% +\renewcommand\footnotesize{% + \@setfontsize\footnotesize\@xpt\@xiipt + \abovedisplayskip 12\p@ \@plus2\p@ \@minus5\p@ + \abovedisplayshortskip \z@ \@plus3.5\p@ + \belowdisplayshortskip 7\p@ \@plus3.5\p@ \@minus3\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 7\p@ \@plus2.5\p@ \@minus2.5\p@ + \parsep 3.5\p@ \@plus2.5\p@ \@minus\p@ + \itemsep \parsep}% + \belowdisplayskip \abovedisplayskip +}% +}% +} + +\newif\iflargefont +\largefontfalse + +\DeclareOption{26pt}{% +\largefonttrue +\AtEndOfClass{% +% font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/ +\renewcommand\normalsize{% + \@setfontsize\normalsize{26pt}{31pt}% + \abovedisplayskip 14\p@ \@plus6\p@ \@minus14\p@ + \abovedisplayshortskip \z@ \@plus6\p@ + \belowdisplayshortskip 13\p@ \@plus7\p@ \@minus6\p@ + \belowdisplayskip \abovedisplayskip + \let\@listi\@listI}\normalsize% + \setlength{\parindent}{1.5em}% +\renewcommand\footnotesize{% + \@setfontsize\footnotesize{15pt}{20pt} + \abovedisplayskip 20\p@ \@plus4\p@ \@minus10\p@ + \abovedisplayshortskip \z@ \@plus6\p@ + \belowdisplayshortskip 12\p@ \@plus6\p@ \@minus6\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 12\p@ \@plus4\p@ \@minus4\p@ + \parsep 6\p@ \@plus4\p@ \@minus\p@ + \itemsep \parsep}% + \belowdisplayskip \abovedisplayskip +}% +\renewcommand\LARGE{\@setfontsize\LARGE{41pt}{50pt}}% +\renewcommand\huge{\@setfontsize\huge{49pt}{60pt}}% +}% +} + +% not supported on texlive version on jessie, and has weird side effects in some readers +%% \XeTeXgenerateactualtext=1 + +%% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}} + +\DeclareOption{defaultleading}{} +\DeclareOption{doubleleading}{\AtBeginDocument{\doublespacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}} +\DeclareOption{onehalfleading}{\AtBeginDocument{\onehalfspacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}} + +%% This does not really work, since dvipdfm(x) will use it's configuration in /etc/texmf/dvipdfm(x) and force a global paper size setting. +\DeclareOption{a5paper}{% + \setlength{\paperheight}{210mm}% + \setlength{\paperwidth}{148mm}} + + +\newif\ifshowfootnotes \showfootnotestrue +\DeclareOption{nofootnotes}{\showfootnotesfalse} + +\newif\ifshowthemes \showthemestrue +\DeclareOption{nothemes}{\showthemesfalse} + +\newif\ifenablewlfont \enablewlfonttrue +\DeclareOption{nowlfont}{\enablewlfontfalse} + +\newif\ifshowtoc \showtoctrue +\DeclareOption{notoc}{\showtocfalse} + +%\newif\ifsansfont \sansfontfalse +%\DeclareOption{sansfont}{\sansfonttrue} + +\newif\ifmargins \marginstrue +\DeclareOption{nomargins}{\marginsfalse} + +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} +\ProcessOptions\relax +\LoadClass[a4paper,oneside]{book} + + +\usepackage{trace} + +\usepackage[MeX]{polski} + +\usepackage[xetex]{graphicx} +\usepackage{fontspec} +\usepackage{xunicode} +\usepackage{xltxtra} + +\usepackage{longtable} +\usepackage{tabu} +\usepackage{unicode-math} +\setmathfont{Latin Modern Math} + +\usepackage[overload]{textcase} +\usepackage{scalefnt} +\usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref} + +%\ifsansfont +%\renewcommand{\familydefault}{\sfdefault} +%\fi + +\newfontfamily\alien[ +SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}}, +Numbers=OldStyle, +Scale=0.85, +LetterSpace=-1.0 +] {DejaVu Serif} + +\ifenablewlfont +\setmainfont [ +%ExternalLocation, +UprightFont = JunicodeWL-Regular, +ItalicFont = JunicodeWL-Italic, +BoldFont = JunicodeWL-Regular, +BoldItalicFont = JunicodeWL-Italic, +SmallCapsFont = JunicodeWL-Regular, +SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}}, +Numbers=OldStyle, +Scale=1.04, +LetterSpace=-1.0 +] {JunicodeWL} + +%\setmainfont [ +%UprightFont = NotoSerif-Regular, +%ItalicFont = NotoSerif-Italic, +%BoldFont = NotoSerif-Regular, +%BoldItalicFont = NotoSerif-Italic, +%SmallCapsFont = NotoSerif-Regular, +%SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}}, +%Scale=1.04, +%LetterSpace=-1.0 +%] {NotoSerif} + +%\setsansfont [ +%UprightFont = NotoSansDisplay-Regular, +%ItalicFont = NotoSansDisplay-Italic, +%BoldFont = NotoSansDisplay-Regular, +%BoldItalicFont = NotoSansDisplay-Italic, +%SmallCapsFont = NotoSansDisplay-Regular, +%SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}}, +%Scale=1.04, +%LetterSpace=-1.0 +%] {NotoSansDisplay} + +\defaultfontfeatures{ +SizeFeatures={ + {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 }, + {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 }, + {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 } +} +} + +\renewcommand{\textsc}[1]{% +{\addfontfeature{ +SizeFeatures={ + {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 }, + {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 }, + {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 } +}, +Letters={SmallCaps,UppercaseSmallCaps} +} +#1} +} +\fi% enablewlfont + +%{\Itshape JunicodeWL-Italic.ttf } +%{\bfseries Junicode-Bold.ttf } +%{\bfseries\itshape Junicode-BoldItalic.ttf } + +\pagestyle{plain} +\usepackage{fancyhdr} +\usepackage{marginnote} + + +\makeatletter + +% bottom figure below footnotes +\usepackage{fnpos} +\makeFNabove + +\usepackage{color} +\definecolor{theme}{gray}{.3} + +\ifmargins +\setlength{\marginparsep}{2em} +\setlength{\marginparwidth}{8.5em} +\setlength{\oddsidemargin}{0pt} +\setlength{\voffset}{0pt} +\setlength{\topmargin}{0pt} +\setlength{\headheight}{0pt} +\setlength{\headsep}{0pt} +\setlength{\textheight}{24cm} +\else +\addtolength{\oddsidemargin}{-.875in} +\addtolength{\evensidemargin}{-.875in} +\addtolength{\textwidth}{1.75in} + +\addtolength{\topmargin}{-.875in} +\addtolength{\textheight}{1.5in} +\fi + +\pagestyle{fancy} +\fancyhf{} +\renewcommand{\headrulewidth}{0pt} +\renewcommand{\footrulewidth}{0pt} +\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}} +\cfoot{} +\rfoot{{\footnotesize \thepage}} + +\clubpenalty=100000 +\widowpenalty=100000 + + +% see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html +\newsavebox{\ximagebox}\newlength{\ximageheight} +\newsavebox{\xglyphbox}\newlength{\xglyphheight} +\newcommand{\xbox}[1] +{\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}% +\savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}% +\raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{% +\makebox[0pt][l]{\usebox{\xglyphbox}}}%}% +\usebox{\ximagebox}% +\raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}} + +\newcommand{\makecover}[2]{ + \pdfpagewidth=#1 + \pdfpageheight=#2 + + \thispagestyle{empty} + \newlength{\PictHOffset} + \newlength{\PictVOffset} + \setlength{\PictHOffset}{1in} + \addtolength{\PictHOffset}{\hoffset} + \addtolength{\PictHOffset}{\oddsidemargin} + + \setlength{\PictVOffset}{1in} + \addtolength{\PictVOffset}{\voffset} + \addtolength{\PictVOffset}{\topmargin} + \addtolength{\PictVOffset}{\headheight} + \addtolength{\PictVOffset}{\headsep} + \addtolength{\PictVOffset}{\topskip} + \addtolength{\PictVOffset}{-\pdfpageheight} + + \noindent\hspace*{-\PictHOffset}% + \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{% + \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}} + \clearpage + + \setlength{\pdfpagewidth}{210mm} + \setlength{\pdfpageheight}{297mm} +} + + +\renewcommand{\maketitle}{ + { + \thispagestyle{empty} + \footnotesize + \color{theme} + + \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt} + \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}} + \end{minipage} + \begin{minipage}[t]{.65\textwidth}\vspace{0pt} + + \ifflaglessadvertising + \else + \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie + \href{http://www.wolnelektury.pl/}{wolnelektury.pl}. + \vspace{.5em} + \fi + + \ifdefined\thanknote + \thanknote + \vspace{.5em} + \fi + + Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury} + przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}. + + \end{minipage} + \noindent \rule{\linewidth}{0.4pt} + + \vspace{.6em} + \color{black} + } +} + +\newcommand{\editorialsection}{ + \begin{figure}[b!] + { + \footnotesize + \color{theme} + \noindent \rule{\linewidth}{0.4pt} + + \ifdefined\sponsors + \marginnote{% + \centering% + \sponsors% + } + \fi + + \rightsinfo + \vspace{.6em} + + Źródło: \href{\bookurl}{\bookurl} + + \vspace{.6em} + \sourceinfo + + \publisherinfo + + \description + \vspace{.6em} + + \editors + + \ifdefined\funders + \vspace{.6em} + \funders + \fi + + \ifdefined\coverby + \vspace{.6em} + \coverby + \fi + + \ifdefined\isbn + \vspace{.6em} + \isbn + \fi + + \vspace{.6em} + \emph{Wesprzyj Wolne Lektury!} + + Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji + pożytku publicznego działającej na rzecz wolności korzystania + z dóbr kultury. + + Co roku do domeny publicznej przechodzi twórczość kolejnych autorów. + Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie. + + \vspace{.6em} + \emph{Jak możesz pomóc?} + + Przekaż 1\% podatku na rozwój Wolnych Lektur: + Fundacja Nowoczesna Polska, KRS 0000070056. + + Dołącz do \href{https://wolnelektury.pl/towarzystwo/}{Towarzystwa Przyjaciół Wolnych Lektur} i pomóż nam rozwijać bibliotekę. + + Przekaż darowiznę na konto: + \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}. + + \color{black} + } + \end{figure} +} + + +\newcommand{\typosubsubsection}[1]{% +\iflargefont +{\textsc{\scalefont{2}#1}} +\else +{\textsc{#1}} +\fi +} + +\newcommand{\typosubsection}[1]{% +{\addfontfeature{ +SizeFeatures={ + {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 }, + {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 }, + {Size={12-}, FakeStretch=2.0, LetterSpace=8.0 } +}, +Letters={Uppercase} +} +\iflargefont +\MakeUppercase{\scalefont{2}#1} +\else +\MakeUppercase{#1} +\fi} +} + +\newcommand{\typosection}[1]{% +\iflargefont +{\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{4}#1}} +\else +{\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}} +\fi +%{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}} +} + + +\DeclareRobustCommand\authortoctext[1]{% +{\addvspace{10pt}\nopagebreak\leftskip0em\relax +\rightskip \@tocrmarg\relax +\noindent\itshape#1\par}} + +\newcommand\authortoc[1]{% + \gdef\chapterauthor{#1}% + \addtocontents{toc}{\authortoctext{#1}}} + + +\newcommand{\tytul}[1]{% +#1% +\vspace{1em}% +} + +\newcommand{\nazwapodutworu}[2]{% +\vspace{5ex}% +\section*{\typosection{#1}}% +\addcontentsline{toc}{section}{#2}% +} + +\newcommand{\nazwanadpodutworu}[2]{% +\authortoc{}% +\nazwapodutworu{#1}{#2}% +\authortoc{}% +} + +\newcommand{\autorutworu}[1]{% +\subsection*{\typosubsection{#1}}% +} + +\newcommand{\autorpodutworu}[1]{% +\vspace{5ex}% +\subsection*{\typosubsection{#1}}% +\authortoc{#1}% +} + +\newcommand{\dzielonadrzedne}[1]{% +\subsection*{\typosubsubsection{#1}}% +} + +\newcommand{\nazwautworu}[1]{% +\vspace{5ex}% +\section*{\typosection{#1}}% +} + +\newcommand{\podtytul}[1]{% +\subsection*{\typosubsubsection{#1}}% +} + +\newcommand{\translator}[1]{% +\subsection*{\typosubsubsection{tłum. #1}}% +} + + +\newcommand{\powiesc}[1]{#1} +\newcommand{\opowiadanie}[1]{#1} +\newcommand{\lirykal}[1]{#1} +\newcommand{\lirykalp}[1]{#1} +\newcommand{\dramatwierszowanyl}[1]{#1} +\newcommand{\dramatwierszowanylp}[1]{#1} +\newcommand{\dramatwspolczesny}[1]{#1} + +\newcommand{\nota}[1]{% +\par{\raggedleft \emph{#1}}% +\vspace{5ex}% +} + +\newcommand{\dedykacja}[1]{% +\begin{em}% +\begin{flushright}% +#1% +\end{flushright}% +\end{em}% +} + +\newlength{\fboxhsep} +\newlength{\fboxvsep} + +\newlength{\fboxtoprule} +\newlength{\fboxbottomrule} +\newlength{\fboxleftrule} +\newlength{\fboxrightrule} + +\ifshowthemes +\setlength{\fboxhsep}{5\fboxsep} +\setlength{\fboxvsep}{20\fboxsep} +\fi + +\setlength{\fboxtoprule}{\fboxrule} +\setlength{\fboxleftrule}{\fboxrule} +\setlength{\fboxrightrule}{\fboxrule} +\setlength{\fboxbottomrule}{\fboxrule} + + + +\def\@frameb@xother#1{% + \@tempdima\fboxtoprule + \advance\@tempdima\fboxvsep + \advance\@tempdima\dp\@tempboxa + \hbox{% + \lower\@tempdima\hbox{% + \vbox{% + \hrule\@height\fboxtoprule + \hbox{% + \vrule\@width\fboxleftrule + #1% + \vbox{% + \vskip\fboxvsep + \box\@tempboxa + \vskip\fboxvsep}% + #1% + \vrule\@width\fboxrightrule}% + \hrule\@height\fboxbottomrule}% + }% + }% +} + + +\long\def\fboxother#1{% + \leavevmode + \setbox\@tempboxa\hbox{% + \color@begingroup + \kern\fboxhsep{#1}\kern\fboxhsep + \color@endgroup}% + \@frameb@xother\relax} + +\newcommand{\myfbox}[3]{% + \begingroup + \setlength{\fboxhsep}{#1} + \setlength{\fboxvsep}{#2} + \fboxother{#3} + + \endgroup +} + +\newcommand{\ramka}[1]{% +\par\vspace{1em}% +\edef\myindent{\the\parindent}% +\noindent\myfbox{1em}{1em}{% +\parbox{\dimexpr \textwidth - 2\fboxhsep - 2\fboxrule\relax}{% +\setlength{\parindent}{\myindent}% +#1% +}}% +\vspace{1em}% +} + +\newcommand{\dlugicytat}[1]{% +\begin{quotation}% +#1% +\end{quotation}% +} + +\newcommand{\poezjacyt}[1]{% +\begin{verse}% +#1% +\end{verse}% +} +\newcommand{\motto}[1]{% +\begin{em}% +#1% +\end{em}% +} +\newcommand{\listaosob}[2]{% +\par{#1}% +\begin{itemize}% +#2% +\end{itemize}% +} + +\newcommand{\nagloweklisty}[1]{% +\typosubsubsection{#1}% +} + +\newcommand{\listaosoba}[1]{% +\item[]{#1}% +} + +\newcommand{\kwestia}[1]{% +\par{#1}% +} + +\newcommand{\naglowekakt}[2]{% +\pagebreak +\subsection*{\typosubsection{\huge #1}}% +\addcontentsline{toc}{subsection}{#2}% +\vspace{5ex}% +} + +\newcommand{\podtytulakt}[1]{% +\par{\typosubsubsection{\LARGE #1}}% +\vspace{5ex}% +} + +\newcommand{\naglowekczesc}[2]{% +\pagebreak +\subsection*{\typosubsection{\huge #1}}% +\addcontentsline{toc}{subsection}{#2}% +\vspace{5ex}% +} + +\newcommand{\podtytulczesc}[1]{% +\par{\typosubsubsection{\LARGE #1}}% +\vspace{5ex}% +} + +\newcommand{\srodtytul}[1]{% +\subsection*{\typosubsection{#1}}% +} + +\newcommand{\naglowekscena}[2]{% +\subsubsection*{\typosubsubsection{\LARGE #1}}% +\addcontentsline{toc}{subsubsection}{#2}% +\vspace{5ex}% +} + +\newcommand{\podtytulscena}[1]{% +\par{\large #1}% +\vspace{5ex}% +} + +\newcommand{\naglowekrozdzial}[2]{% +\subsubsection*{\typosubsubsection{\LARGE #1}}% +\addcontentsline{toc}{subsubsection}{#2}% +\vspace{5ex}% +} + +\newcommand{\podtytulrozdzial}[1]{% +\par{\large #1}% +\vspace{5ex}% +} + +\newcommand{\naglowekosoba}[1]{% +\medskip% +\par{\textsc{\MakeLowercase{#1}}}\nopagebreak% +} +\newcommand{\naglowekpodrozdzial}[1]{% +\vspace{5ex}\par{#1}\nopagebreak% +} + +\newcommand{\podtytulpodrozdzial}[1]{% +\par{#1}\nopagebreak% +} + +\newcommand{\miejsceczas}[1]{% +\par{\emph{#1}}% +} +\newcommand{\didaskalia}[1]{% +\par{\emph{#1}}% +} + +\usepackage{intcalc} +\usepackage{color} +\definecolor{gray}{RGB}{200,200,200} +%\newcounter{parnum} +\newlength{\parnumwidth} +\setlength{\parnumwidth}{3em} +\newcommand{\N}{% + \leavevmode\refstepcounter{parnum}\reversemarginpar% + \marginnote{\textcolor{gray}{\small{\theparnum}}}% + \reversemarginpar} +\newcommand{\Nw}{% + \leavevmode\refstepcounter{parnum}\reversemarginpar% + \ifnum\intcalcMod{\value{parnum}}{5}=0% + \marginnote{\textcolor{gray}{\small{\theparnum}}}% + \fi\reversemarginpar} +\renewcommand{\N}{} +\renewcommand{\Nw}{} + +\newcommand{\akap}[1]{% +\par{\N#1}% +} +\newcommand{\akapdialog}[1]{% +\par{\N#1}% +} +\newcommand{\akapcd}[1]{% +\par{\N#1}% +} + +\newcommand{\mottopodpis}[1]{% +\begin{em}% +\begin{flushright}% +#1% +\end{flushright}% +\end{em}% +} + +\newcommand{\strofa}[1]{% +\par{\noindent{\ignorespaces#1\vspace{1em}}}% +} + +\newcommand{\wers}[1]{\Nw#1} + +\newcommand{\wersakap}[1]{% +\Nw\hspace*{1em}#1% +} +\newcommand{\werscd}[1]{% +\Nw\hspace*{8em}#1% +} +\newcommand{\werswciety}[2][1em]{% +\Nw\hspace*{#1}#2% +} +\newcommand{\wersdoprawej}[1]{% +\Nw\hspace*{\fill}#1% +} + +\ifshowfootnotes + \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}} + \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1 [przypis edytorski]}}} + \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1 [przypis redakcyjny]}}} + \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1 [przypis tłumacza]}}} +\else + \newcommand{\pa}[1]{} + \newcommand{\pe}[1]{} + \newcommand{\pr}[1]{} + \newcommand{\pt}[1]{} +\fi + +\newcommand{\mat}[1]{$#1$} + +\newcommand{\didasktekst}[1]{% +\emph{#1}% +} +\newcommand{\slowoobce}[1]{% +\emph{#1}% +} +\newcommand{\tytuldziela}[1]{% +\emph{#1}% +} +\newcommand{\wyroznienie}[1]{% +\emph{#1}% +} +\newcommand{\indeksdolny}[1]{% +\textsubscript{#1}% +} +\newcommand{\wiekszeodstepy}[1]{% +\spaceskip 3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font \relax% +#1% +\spaceskip \fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font \relax% +} + +\newcommand{\osoba}[1]{% +{\scshape \MakeLowercase{#1}}% +} + +\newcommand{\sekcjaswiatlo}{% +\vspace{30pt}% +} + +\newcommand{\sekcjaasterysk}{% +\vspace{10pt}% +\begin{center}% +\par{*}% +\end{center}% +} + +\newcommand{\separatorlinia}{% +\vspace{10pt}% +\hrule{}% +\vspace{10pt}% +} + +\newcommand{\motyw}[2][0]{% +\ifshowthemes +\mbox{}% +\marginpar{% +\vspace{-8pt}% +\vspace{-#1\baselineskip}% +\raggedright{\hspace{0pt}% +\footnotesize{\color{theme}{#2}}}% +\vspace{\baselineskip}% +}% +\fi +} + +\newcommand{\ilustr}[2]{% +\vspace{1em}% +\par{\noindent\includegraphics[width=\linewidth]{#1}}% +\vspace{1em} +} diff --git a/src/librarian/pdf/wl2tex.xslt b/src/librarian/pdf/wl2tex.xslt new file mode 100644 index 0000000..43a3274 --- /dev/null +++ b/src/librarian/pdf/wl2tex.xslt @@ -0,0 +1,643 @@ + + + + + + + + + + \documentclass[]{wl} + + + + \newif\ifflaglessadvertising + + + true + + + + + + \def\{} + + + + + + + + \usepackage[maxfloats=53]{morefloats} + + + + + \usepackage{morefloats} + + + + + + \IfFileExists{morefloats.sty}{ + \usepackage{morefloats} + }{} + + + + + + + + + + + 210mm + mm + + + + + \def\thanknote{} + + + + + + + + + + + + + + + + + + + + + + + + + + tocdepth + 3 + + + + + + + + + + + \def\coverby{Okładka na podstawie: + + + \href{\datacoversource}{\datacoverby} + + + \datacoverby{} + + + } + + \def\editors{} + + \def\funders{Publikację wsparli i wsparły: + .} + + + + \def\sponsors{ + \scriptsize + + + + + + Sfinansowano ze~środków: + + + + \vspace{1em} + + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \def\authors{} + \author{\authors} + \title{} + \def\translatorsline{} + + \def\bookurl{} + + \def\rightsinfo{Ten utwór nie jest objęty majątkowym prawem autorskim i~znajduje się w~domenie + publicznej, co oznacza że możesz go swobodnie wykorzystywać, publikować + i~rozpowszechniać. Jeśli utwór opatrzony jest dodatkowymi materiałami + (przypisy, motywy literackie etc.), które podlegają prawu autorskiemu, to + te dodatkowe materiały udostępnione są na licencji + \href{http://creativecommons.org/licenses/by-sa/3.0/}{Creative Commons + Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL}.} + + \def\rightsinfo{Ten utwór jest udostępniony na licencji + \href{}{}.} + + + \def\sourceinfo{ + + Tekst opracowany na podstawie: + \vspace{.6em} + } + \def\publisherinfo{ + + Wydawca: + + + + , + + + \vspace{.6em} + } + \def\description{} + + + \def\isbn{ISBN } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + + + + + + + + + + + + + + + \\{} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + wers + + + + em + + + + + + + + + + + + + + + + + + + + + + + + „” + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + + + + + + + , + + + + + + + Opracowanie redakcyjne i przypisy: + + . + + + + + + + + , + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + \includegraphics[height=0.25\textwidth,width=0.25\textwidth,keepaspectratio]{} + + + + + + + + + + + $ + + $ + + + + + + $$ + + $$ + + + + + + 1em + + + + + longtabu + tabu + + to \textwidth + + + + + + + + + + + + + + 1em + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/librarian/picture.py b/src/librarian/picture.py new file mode 100644 index 0000000..10d2ae7 --- /dev/null +++ b/src/librarian/picture.py @@ -0,0 +1,213 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from operator import and_ + +from .dcparser import Field, WorkInfo, DCNS +from librarian import (RDFNS, ValidationError, NoDublinCore, ParseError, WLURI) +from xml.parsers.expat import ExpatError +from os import path +from lxml import etree +from lxml.etree import (XMLSyntaxError, XSLTApplyError, Element) +import re +import six + + +class WLPictureURI(WLURI): + _re_wl_uri = re.compile('http://wolnelektury.pl/katalog/obraz/(?P[-a-z0-9]+)/?$') + + @classmethod + def from_slug(cls, slug): + uri = 'http://wolnelektury.pl/katalog/obraz/%s/' % slug + return cls(uri) + + +def as_wlpictureuri_strict(text): + return WLPictureURI.strict(text) + + +class PictureInfo(WorkInfo): + """ + Dublin core metadata for a picture + """ + FIELDS = ( + Field(DCNS('language'), 'language', required=False), + Field(DCNS('subject.period'), 'epochs', salias='epoch', multiple=True), + Field(DCNS('subject.type'), 'kinds', salias='kind', multiple=True), + Field(DCNS('subject.genre'), 'genres', salias='genre', multiple=True, required=False), + Field(DCNS('subject.style'), 'styles', salias='style', multiple=True, required=False), + + Field(DCNS('format.dimensions'), 'dimensions', required=False), + Field(DCNS('format.checksum.sha1'), 'sha1', required=True), + Field(DCNS('description.medium'), 'medium', required=False), + Field(DCNS('description.dimensions'), 'original_dimensions', required=False), + Field(DCNS('format'), 'mime_type', required=False), + Field(DCNS('identifier.url'), 'url', WLPictureURI, strict=as_wlpictureuri_strict) + ) + + +class ImageStore(object): + EXT = ['gif', 'jpeg', 'png', 'swf', 'psd', 'bmp' + 'tiff', 'tiff', 'jpc', 'jp2', 'jpf', 'jb2', 'swc', + 'aiff', 'wbmp', 'xbm'] + MIME = ['image/gif', 'image/jpeg', 'image/png', + 'application/x-shockwave-flash', 'image/psd', 'image/bmp', + 'image/tiff', 'image/tiff', 'application/octet-stream', + 'image/jp2', 'application/octet-stream', 'application/octet-stream', + 'application/x-shockwave-flash', 'image/iff', 'image/vnd.wap.wbmp', 'image/xbm'] + + def __init__(self, dir_): + super(ImageStore, self).__init__() + self.dir = dir_ + + def path(self, slug, mime_type): + """ + Finds file by slug and mime type in our iamge store. + Returns a file objects (perhaps should return a filename?) + """ + try: + i = self.MIME.index(mime_type) + except ValueError: + err = ValueError("Picture %s has unknown mime type: %s" % (slug, mime_type)) + err.slug = slug + err.mime_type = mime_type + raise err + ext = self.EXT[i] + # add some common extensions tiff->tif, jpeg->jpg + return path.join(self.dir, slug + '.' + ext) + + +class WLPicture(object): + def __init__(self, edoc, parse_dublincore=True, image_store=None): + self.edoc = edoc + self.image_store = image_store + + root_elem = edoc.getroot() + + dc_path = './/' + RDFNS('RDF') + + if root_elem.tag != 'picture': + raise ValidationError("Invalid root element. Found '%s', should be 'picture'" % root_elem.tag) + + if parse_dublincore: + self.rdf_elem = root_elem.find(dc_path) + + if self.rdf_elem is None: + raise NoDublinCore('Document has no DublinCore - which is required.') + + self.picture_info = PictureInfo.from_element(self.rdf_elem) + else: + self.picture_info = None + self.frame = None + + @classmethod + def from_bytes(cls, xml, *args, **kwargs): + return cls.from_file(six.BytesIO(xml), *args, **kwargs) + + @classmethod + def from_file(cls, xmlfile, parse_dublincore=True, image_store=None): + + # first, prepare for parsing + if isinstance(xmlfile, six.text_type): + file = open(xmlfile, 'rb') + try: + data = file.read() + finally: + file.close() + else: + data = xmlfile.read() + + if not isinstance(data, six.text_type): + data = data.decode('utf-8') + + data = data.replace(u'\ufeff', '') + + # assume images are in the same directory + if image_store is None and getattr(xmlfile, 'name', None): + image_store = ImageStore(path.dirname(xmlfile.name)) + + try: + parser = etree.XMLParser(remove_blank_text=False) + tree = etree.parse(six.BytesIO(data.encode('utf-8')), parser) + + me = cls(tree, parse_dublincore=parse_dublincore, image_store=image_store) + me.load_frame_info() + return me + except (ExpatError, XMLSyntaxError, XSLTApplyError) as e: + raise ParseError(e) + + @property + def mime_type(self): + if self.picture_info is None: + raise ValueError('DC is not loaded, hence we don\'t know the image type') + return self.picture_info.mime_type + + @property + def slug(self): + return self.picture_info.url.slug + + @property + def image_path(self): + if self.image_store is None: + raise ValueError("No image store associated with whis WLPicture.") + + return self.image_store.path(self.slug, self.mime_type) + + def image_file(self, *args, **kwargs): + return open(self.image_path, 'rb', *args, **kwargs) + + def get_sem_coords(self, sem): + area = sem.find("div[@type='rect']") + if area is None: + area = sem.find("div[@type='whole']") + return [[0, 0], [-1, -1]] + + def has_all_props(node, props): + return reduce(and_, map(lambda prop: prop in node.attrib, props)) + + if not has_all_props(area, ['x1', 'x2', 'y1', 'y2']): + return None + + def n(prop): return int(area.get(prop)) + return [[n('x1'), n('y1')], [n('x2'), n('y2')]] + + def partiter(self): + """ + Iterates the parts of this picture and returns them and their metadata + """ + # omg no support for //sem[(@type='theme') or (@type='object')] ? + for part in list(self.edoc.iterfind("//sem[@type='theme']")) +\ + list(self.edoc.iterfind("//sem[@type='object']")): + pd = {'type': part.get('type')} + + coords = self.get_sem_coords(part) + if coords is None: + continue + pd['coords'] = coords + + def want_unicode(x): + if not isinstance(x, six.text_type): + return x.decode('utf-8') + else: + return x + pd['object'] = part.attrib['type'] == 'object' and want_unicode(part.attrib.get('object', u'')) or None + pd['themes'] = part.attrib['type'] == 'theme' and [part.attrib.get('theme', u'')] or [] + yield pd + + def load_frame_info(self): + k = self.edoc.find("//sem[@object='kadr']") + + if k is not None: + clip = self.get_sem_coords(k) + self.frame = clip + frm = Element("sem", {"type": "frame"}) + frm.append(k.iter("div").next()) + self.edoc.getroot().append(frm) + k.getparent().remove(k) + else: + frm = self.edoc.find("//sem[@type='frame']") + if frm: + self.frame = self.get_sem_coords(frm) + else: + self.frame = None + return self diff --git a/src/librarian/res/ISO-639-2_8859-1.txt b/src/librarian/res/ISO-639-2_8859-1.txt new file mode 100644 index 0000000..65b549e --- /dev/null +++ b/src/librarian/res/ISO-639-2_8859-1.txt @@ -0,0 +1,486 @@ +aar||aa|Afar|afar +abk||ab|Abkhazian|abkhaze +ace|||Achinese|aceh +ach|||Acoli|acoli +ada|||Adangme|adangme +ady|||Adyghe; Adygei|adyghé +afa|||Afro-Asiatic languages|afro-asiatiques, langues +afh|||Afrihili|afrihili +afr||af|Afrikaans|afrikaans +ain|||Ainu|aïnou +aka||ak|Akan|akan +akk|||Akkadian|akkadien +alb|sqi|sq|Albanian|albanais +ale|||Aleut|aléoute +alg|||Algonquian languages|algonquines, langues +alt|||Southern Altai|altai du Sud +amh||am|Amharic|amharique +ang|||English, Old (ca.450-1100)|anglo-saxon (ca.450-1100) +anp|||Angika|angika +apa|||Apache languages|apache, langues +ara||ar|Arabic|arabe +arc|||Official Aramaic (700-300 BCE); Imperial Aramaic (700-300 BCE)|araméen d'empire (700-300 BCE) +arg||an|Aragonese|aragonais +arm|hye|hy|Armenian|arménien +arn|||Mapudungun; Mapuche|mapudungun; mapuche; mapuce +arp|||Arapaho|arapaho +art|||Artificial languages|artificielles, langues +arw|||Arawak|arawak +asm||as|Assamese|assamais +ast|||Asturian; Bable; Leonese; Asturleonese|asturien; bable; léonais; asturoléonais +ath|||Athapascan languages|athapascanes, langues +aus|||Australian languages|australiennes, langues +ava||av|Avaric|avar +ave||ae|Avestan|avestique +awa|||Awadhi|awadhi +aym||ay|Aymara|aymara +aze||az|Azerbaijani|azéri +bad|||Banda languages|banda, langues +bai|||Bamileke languages|bamiléké, langues +bak||ba|Bashkir|bachkir +bal|||Baluchi|baloutchi +bam||bm|Bambara|bambara +ban|||Balinese|balinais +baq|eus|eu|Basque|basque +bas|||Basa|basa +bat|||Baltic languages|baltes, langues +bej|||Beja; Bedawiyet|bedja +bel||be|Belarusian|biélorusse +bem|||Bemba|bemba +ben||bn|Bengali|bengali +ber|||Berber languages|berbères, langues +bho|||Bhojpuri|bhojpuri +bih||bh|Bihari languages|langues bihari +bik|||Bikol|bikol +bin|||Bini; Edo|bini; edo +bis||bi|Bislama|bichlamar +bla|||Siksika|blackfoot +bnt|||Bantu languages|bantou, langues +bos||bs|Bosnian|bosniaque +bra|||Braj|braj +bre||br|Breton|breton +btk|||Batak languages|batak, langues +bua|||Buriat|bouriate +bug|||Buginese|bugi +bul||bg|Bulgarian|bulgare +bur|mya|my|Burmese|birman +byn|||Blin; Bilin|blin; bilen +cad|||Caddo|caddo +cai|||Central American Indian languages|amérindiennes de l'Amérique centrale, langues +car|||Galibi Carib|karib; galibi; carib +cat||ca|Catalan; Valencian|catalan; valencien +cau|||Caucasian languages|caucasiennes, langues +ceb|||Cebuano|cebuano +cel|||Celtic languages|celtiques, langues; celtes, langues +cha||ch|Chamorro|chamorro +chb|||Chibcha|chibcha +che||ce|Chechen|tchétchène +chg|||Chagatai|djaghataï +chi|zho|zh|Chinese|chinois +chk|||Chuukese|chuuk +chm|||Mari|mari +chn|||Chinook jargon|chinook, jargon +cho|||Choctaw|choctaw +chp|||Chipewyan; Dene Suline|chipewyan +chr|||Cherokee|cherokee +chu||cu|Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic|slavon d'église; vieux slave; slavon liturgique; vieux bulgare +chv||cv|Chuvash|tchouvache +chy|||Cheyenne|cheyenne +cmc|||Chamic languages|chames, langues +cop|||Coptic|copte +cor||kw|Cornish|cornique +cos||co|Corsican|corse +cpe|||Creoles and pidgins, English based|créoles et pidgins basés sur l'anglais +cpf|||Creoles and pidgins, French-based|créoles et pidgins basés sur le français +cpp|||Creoles and pidgins, Portuguese-based|créoles et pidgins basés sur le portugais +cre||cr|Cree|cree +crh|||Crimean Tatar; Crimean Turkish|tatar de Crimé +crp|||Creoles and pidgins|créoles et pidgins +csb|||Kashubian|kachoube +cus|||Cushitic languages|couchitiques, langues +cze|ces|cs|Czech|tchèque +dak|||Dakota|dakota +dan||da|Danish|danois +dar|||Dargwa|dargwa +day|||Land Dayak languages|dayak, langues +del|||Delaware|delaware +den|||Slave (Athapascan)|esclave (athapascan) +dgr|||Dogrib|dogrib +din|||Dinka|dinka +div||dv|Divehi; Dhivehi; Maldivian|maldivien +doi|||Dogri|dogri +dra|||Dravidian languages|dravidiennes, langues +dsb|||Lower Sorbian|bas-sorabe +dua|||Duala|douala +dum|||Dutch, Middle (ca.1050-1350)|néerlandais moyen (ca. 1050-1350) +dut|nld|nl|Dutch; Flemish|néerlandais; flamand +dyu|||Dyula|dioula +dzo||dz|Dzongkha|dzongkha +efi|||Efik|efik +egy|||Egyptian (Ancient)|égyptien +eka|||Ekajuk|ekajuk +elx|||Elamite|élamite +eng||en|English|anglais +enm|||English, Middle (1100-1500)|anglais moyen (1100-1500) +epo||eo|Esperanto|espéranto +est||et|Estonian|estonien +ewe||ee|Ewe|éwé +ewo|||Ewondo|éwondo +fan|||Fang|fang +fao||fo|Faroese|féroïen +fat|||Fanti|fanti +fij||fj|Fijian|fidjien +fil|||Filipino; Pilipino|filipino; pilipino +fin||fi|Finnish|finnois +fiu|||Finno-Ugrian languages|finno-ougriennes, langues +fon|||Fon|fon +fre|fra|fr|French|français +frm|||French, Middle (ca.1400-1600)|français moyen (1400-1600) +fro|||French, Old (842-ca.1400)|français ancien (842-ca.1400) +frr|||Northern Frisian|frison septentrional +frs|||Eastern Frisian|frison oriental +fry||fy|Western Frisian|frison occidental +ful||ff|Fulah|peul +fur|||Friulian|frioulan +gaa|||Ga|ga +gay|||Gayo|gayo +gba|||Gbaya|gbaya +gem|||Germanic languages|germaniques, langues +geo|kat|ka|Georgian|géorgien +ger|deu|de|German|allemand +gez|||Geez|guèze +gil|||Gilbertese|kiribati +gla||gd|Gaelic; Scottish Gaelic|gaélique; gaélique écossais +gle||ga|Irish|irlandais +glg||gl|Galician|galicien +glv||gv|Manx|manx; mannois +gmh|||German, Middle High (ca.1050-1500)|allemand, moyen haut (ca. 1050-1500) +goh|||German, Old High (ca.750-1050)|allemand, vieux haut (ca. 750-1050) +gon|||Gondi|gond +gor|||Gorontalo|gorontalo +got|||Gothic|gothique +grb|||Grebo|grebo +grc|||Greek, Ancient (to 1453)|grec ancien (jusqu'à 1453) +gre|ell|el|Greek, Modern (1453-)|grec moderne (après 1453) +grn||gn|Guarani|guarani +gsw|||Swiss German; Alemannic; Alsatian|suisse alémanique; alémanique; alsacien +guj||gu|Gujarati|goudjrati +gwi|||Gwich'in|gwich'in +hai|||Haida|haida +hat||ht|Haitian; Haitian Creole|haïtien; créole haïtien +hau||ha|Hausa|haoussa +haw|||Hawaiian|hawaïen +heb||he|Hebrew|hébreu +her||hz|Herero|herero +hil|||Hiligaynon|hiligaynon +him|||Himachali languages; Western Pahari languages|langues himachalis; langues paharis occidentales +hin||hi|Hindi|hindi +hit|||Hittite|hittite +hmn|||Hmong; Mong|hmong +hmo||ho|Hiri Motu|hiri motu +hrv||hr|Croatian|croate +hsb|||Upper Sorbian|haut-sorabe +hun||hu|Hungarian|hongrois +hup|||Hupa|hupa +iba|||Iban|iban +ibo||ig|Igbo|igbo +ice|isl|is|Icelandic|islandais +ido||io|Ido|ido +iii||ii|Sichuan Yi; Nuosu|yi de Sichuan +ijo|||Ijo languages|ijo, langues +iku||iu|Inuktitut|inuktitut +ile||ie|Interlingue; Occidental|interlingue +ilo|||Iloko|ilocano +ina||ia|Interlingua (International Auxiliary Language Association)|interlingua (langue auxiliaire internationale) +inc|||Indic languages|indo-aryennes, langues +ind||id|Indonesian|indonésien +ine|||Indo-European languages|indo-européennes, langues +inh|||Ingush|ingouche +ipk||ik|Inupiaq|inupiaq +ira|||Iranian languages|iraniennes, langues +iro|||Iroquoian languages|iroquoises, langues +ita||it|Italian|italien +jav||jv|Javanese|javanais +jbo|||Lojban|lojban +jpn||ja|Japanese|japonais +jpr|||Judeo-Persian|judéo-persan +jrb|||Judeo-Arabic|judéo-arabe +kaa|||Kara-Kalpak|karakalpak +kab|||Kabyle|kabyle +kac|||Kachin; Jingpho|kachin; jingpho +kal||kl|Kalaallisut; Greenlandic|groenlandais +kam|||Kamba|kamba +kan||kn|Kannada|kannada +kar|||Karen languages|karen, langues +kas||ks|Kashmiri|kashmiri +kau||kr|Kanuri|kanouri +kaw|||Kawi|kawi +kaz||kk|Kazakh|kazakh +kbd|||Kabardian|kabardien +kha|||Khasi|khasi +khi|||Khoisan languages|khoïsan, langues +khm||km|Central Khmer|khmer central +kho|||Khotanese; Sakan|khotanais; sakan +kik||ki|Kikuyu; Gikuyu|kikuyu +kin||rw|Kinyarwanda|rwanda +kir||ky|Kirghiz; Kyrgyz|kirghiz +kmb|||Kimbundu|kimbundu +kok|||Konkani|konkani +kom||kv|Komi|kom +kon||kg|Kongo|kongo +kor||ko|Korean|coréen +kos|||Kosraean|kosrae +kpe|||Kpelle|kpellé +krc|||Karachay-Balkar|karatchai balkar +krl|||Karelian|carélien +kro|||Kru languages|krou, langues +kru|||Kurukh|kurukh +kua||kj|Kuanyama; Kwanyama|kuanyama; kwanyama +kum|||Kumyk|koumyk +kur||ku|Kurdish|kurde +kut|||Kutenai|kutenai +lad|||Ladino|judéo-espagnol +lah|||Lahnda|lahnda +lam|||Lamba|lamba +lao||lo|Lao|lao +lat||la|Latin|latin +lav||lv|Latvian|letton +lez|||Lezghian|lezghien +lim||li|Limburgan; Limburger; Limburgish|limbourgeois +lin||ln|Lingala|lingala +lit||lt|Lithuanian|lituanien +lol|||Mongo|mongo +loz|||Lozi|lozi +ltz||lb|Luxembourgish; Letzeburgesch|luxembourgeois +lua|||Luba-Lulua|luba-lulua +lub||lu|Luba-Katanga|luba-katanga +lug||lg|Ganda|ganda +lui|||Luiseno|luiseno +lun|||Lunda|lunda +luo|||Luo (Kenya and Tanzania)|luo (Kenya et Tanzanie) +lus|||Lushai|lushai +mac|mkd|mk|Macedonian|macédonien +mad|||Madurese|madourais +mag|||Magahi|magahi +mah||mh|Marshallese|marshall +mai|||Maithili|maithili +mak|||Makasar|makassar +mal||ml|Malayalam|malayalam +man|||Mandingo|mandingue +mao|mri|mi|Maori|maori +map|||Austronesian languages|austronésiennes, langues +mar||mr|Marathi|marathe +mas|||Masai|massaï +may|msa|ms|Malay|malais +mdf|||Moksha|moksa +mdr|||Mandar|mandar +men|||Mende|mendé +mga|||Irish, Middle (900-1200)|irlandais moyen (900-1200) +mic|||Mi'kmaq; Micmac|mi'kmaq; micmac +min|||Minangkabau|minangkabau +mis|||Uncoded languages|langues non codées +mkh|||Mon-Khmer languages|môn-khmer, langues +mlg||mg|Malagasy|malgache +mlt||mt|Maltese|maltais +mnc|||Manchu|mandchou +mni|||Manipuri|manipuri +mno|||Manobo languages|manobo, langues +moh|||Mohawk|mohawk +mon||mn|Mongolian|mongol +mos|||Mossi|moré +mul|||Multiple languages|multilingue +mun|||Munda languages|mounda, langues +mus|||Creek|muskogee +mwl|||Mirandese|mirandais +mwr|||Marwari|marvari +myn|||Mayan languages|maya, langues +myv|||Erzya|erza +nah|||Nahuatl languages|nahuatl, langues +nai|||North American Indian languages|nord-amérindiennes, langues +nap|||Neapolitan|napolitain +nau||na|Nauru|nauruan +nav||nv|Navajo; Navaho|navaho +nbl||nr|Ndebele, South; South Ndebele|ndébélé du Sud +nde||nd|Ndebele, North; North Ndebele|ndébélé du Nord +ndo||ng|Ndonga|ndonga +nds|||Low German; Low Saxon; German, Low; Saxon, Low|bas allemand; bas saxon; allemand, bas; saxon, bas +nep||ne|Nepali|népalais +new|||Nepal Bhasa; Newari|nepal bhasa; newari +nia|||Nias|nias +nic|||Niger-Kordofanian languages|nigéro-kordofaniennes, langues +niu|||Niuean|niué +nno||nn|Norwegian Nynorsk; Nynorsk, Norwegian|norvégien nynorsk; nynorsk, norvégien +nob||nb|Bokmål, Norwegian; Norwegian Bokmål|norvégien bokmål +nog|||Nogai|nogaï; nogay +non|||Norse, Old|norrois, vieux +nor||no|Norwegian|norvégien +nqo|||N'Ko|n'ko +nso|||Pedi; Sepedi; Northern Sotho|pedi; sepedi; sotho du Nord +nub|||Nubian languages|nubiennes, langues +nwc|||Classical Newari; Old Newari; Classical Nepal Bhasa|newari classique +nya||ny|Chichewa; Chewa; Nyanja|chichewa; chewa; nyanja +nym|||Nyamwezi|nyamwezi +nyn|||Nyankole|nyankolé +nyo|||Nyoro|nyoro +nzi|||Nzima|nzema +oci||oc|Occitan (post 1500)|occitan (après 1500) +oji||oj|Ojibwa|ojibwa +ori||or|Oriya|oriya +orm||om|Oromo|galla +osa|||Osage|osage +oss||os|Ossetian; Ossetic|ossète +ota|||Turkish, Ottoman (1500-1928)|turc ottoman (1500-1928) +oto|||Otomian languages|otomi, langues +paa|||Papuan languages|papoues, langues +pag|||Pangasinan|pangasinan +pal|||Pahlavi|pahlavi +pam|||Pampanga; Kapampangan|pampangan +pan||pa|Panjabi; Punjabi|pendjabi +pap|||Papiamento|papiamento +pau|||Palauan|palau +peo|||Persian, Old (ca.600-400 B.C.)|perse, vieux (ca. 600-400 av. J.-C.) +per|fas|fa|Persian|persan +phi|||Philippine languages|philippines, langues +phn|||Phoenician|phénicien +pli||pi|Pali|pali +pol||pl|Polish|polonais +pon|||Pohnpeian|pohnpei +por||pt|Portuguese|portugais +pra|||Prakrit languages|prâkrit, langues +pro|||Provençal, Old (to 1500); Occitan, Old (to 1500)|provençal ancien (jusqu'à 1500); occitan ancien (jusqu'à 1500) +pus||ps|Pushto; Pashto|pachto +qaa-qtz|||Reserved for local use|réservée à l'usage local +que||qu|Quechua|quechua +raj|||Rajasthani|rajasthani +rap|||Rapanui|rapanui +rar|||Rarotongan; Cook Islands Maori|rarotonga; maori des îles Cook +roa|||Romance languages|romanes, langues +roh||rm|Romansh|romanche +rom|||Romany|tsigane +rum|ron|ro|Romanian|roumain +run||rn|Rundi|rundi +rup|||Aromanian; Arumanian; Macedo-Romanian|aroumain; macédo-roumain +rus||ru|Russian|russe +sad|||Sandawe|sandawe +sag||sg|Sango|sango +sah|||Yakut|iakoute +sai|||South American Indian languages|sud-amérindiennes, langues +sal|||Salishan languages|salishennes, langues +sam|||Samaritan Aramaic|samaritain +san||sa|Sanskrit|sanskrit +sas|||Sasak|sasak +sat|||Santali|santal +scn|||Sicilian|sicilien +sco|||Scots|écossais +sel|||Selkup|selkoupe +sem|||Semitic languages|sémitiques, langues +sga|||Irish, Old (to 900)|irlandais ancien (jusqu'à 900) +sgn|||Sign Languages|langues des signes +shn|||Shan|chan +sid|||Sidamo|sidamo +sin||si|Sinhala; Sinhalese|singhalais +sio|||Siouan languages|sioux, langues +sit|||Sino-Tibetan languages|sino-tibétaines, langues +sla|||Slavic languages|slaves, langues +slo|slk|sk|Slovak|slovaque +slv||sl|Slovenian|slovène +sma|||Southern Sami|sami du Sud +sme||se|Northern Sami|sami du Nord +smi|||Sami languages|sames, langues +smj|||Lule Sami|sami de Lule +smn|||Inari Sami|sami d'Inari +smo||sm|Samoan|samoan +sms|||Skolt Sami|sami skolt +sna||sn|Shona|shona +snd||sd|Sindhi|sindhi +snk|||Soninke|soninké +sog|||Sogdian|sogdien +som||so|Somali|somali +son|||Songhai languages|songhai, langues +sot||st|Sotho, Southern|sotho du Sud +spa||es|Spanish; Castilian|espagnol; castillan +srd||sc|Sardinian|sarde +srn|||Sranan Tongo|sranan tongo +srp||sr|Serbian|serbe +srr|||Serer|sérère +ssa|||Nilo-Saharan languages|nilo-sahariennes, langues +ssw||ss|Swati|swati +suk|||Sukuma|sukuma +sun||su|Sundanese|soundanais +sus|||Susu|soussou +sux|||Sumerian|sumérien +swa||sw|Swahili|swahili +swe||sv|Swedish|suédois +syc|||Classical Syriac|syriaque classique +syr|||Syriac|syriaque +tah||ty|Tahitian|tahitien +tai|||Tai languages|tai, langues +tam||ta|Tamil|tamoul +tat||tt|Tatar|tatar +tel||te|Telugu|télougou +tem|||Timne|temne +ter|||Tereno|tereno +tet|||Tetum|tetum +tgk||tg|Tajik|tadjik +tgl||tl|Tagalog|tagalog +tha||th|Thai|thaï +tib|bod|bo|Tibetan|tibétain +tig|||Tigre|tigré +tir||ti|Tigrinya|tigrigna +tiv|||Tiv|tiv +tkl|||Tokelau|tokelau +tlh|||Klingon; tlhIngan-Hol|klingon +tli|||Tlingit|tlingit +tmh|||Tamashek|tamacheq +tog|||Tonga (Nyasa)|tonga (Nyasa) +ton||to|Tonga (Tonga Islands)|tongan (Îles Tonga) +tpi|||Tok Pisin|tok pisin +tsi|||Tsimshian|tsimshian +tsn||tn|Tswana|tswana +tso||ts|Tsonga|tsonga +tuk||tk|Turkmen|turkmène +tum|||Tumbuka|tumbuka +tup|||Tupi languages|tupi, langues +tur||tr|Turkish|turc +tut|||Altaic languages|altaïques, langues +tvl|||Tuvalu|tuvalu +twi||tw|Twi|twi +tyv|||Tuvinian|touva +udm|||Udmurt|oudmourte +uga|||Ugaritic|ougaritique +uig||ug|Uighur; Uyghur|ouïgour +ukr||uk|Ukrainian|ukrainien +umb|||Umbundu|umbundu +und|||Undetermined|indéterminée +urd||ur|Urdu|ourdou +uzb||uz|Uzbek|ouszbek +vai|||Vai|vaï +ven||ve|Venda|venda +vie||vi|Vietnamese|vietnamien +vol||vo|Volapük|volapük +vot|||Votic|vote +wak|||Wakashan languages|wakashanes, langues +wal|||Wolaitta; Wolaytta|wolaitta; wolaytta +war|||Waray|waray +was|||Washo|washo +wel|cym|cy|Welsh|gallois +wen|||Sorbian languages|sorabes, langues +wln||wa|Walloon|wallon +wol||wo|Wolof|wolof +xal|||Kalmyk; Oirat|kalmouk; oïrat +xho||xh|Xhosa|xhosa +yao|||Yao|yao +yap|||Yapese|yapois +yid||yi|Yiddish|yiddish +yor||yo|Yoruba|yoruba +ypk|||Yupik languages|yupik, langues +zap|||Zapotec|zapotèque +zbl|||Blissymbols; Blissymbolics; Bliss|symboles Bliss; Bliss +zen|||Zenaga|zenaga +zgh|||Standard Moroccan Tamazight|amazighe standard marocain +zha||za|Zhuang; Chuang|zhuang; chuang +znd|||Zande languages|zandé, langues +zul||zu|Zulu|zoulou +zun|||Zuni|zuni +zxx|||No linguistic content; Not applicable|pas de contenu linguistique; non applicable +zza|||Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki|zaza; dimili; dimli; kirdki; kirmanjki; zazaki \ No newline at end of file diff --git a/src/librarian/res/atrium-logo.png b/src/librarian/res/atrium-logo.png new file mode 100644 index 0000000..35af904 Binary files /dev/null and b/src/librarian/res/atrium-logo.png differ diff --git a/src/librarian/res/cover-bookoteka.png b/src/librarian/res/cover-bookoteka.png new file mode 100644 index 0000000..7196bcf Binary files /dev/null and b/src/librarian/res/cover-bookoteka.png differ diff --git a/src/librarian/res/cover-gandalf.png b/src/librarian/res/cover-gandalf.png new file mode 100644 index 0000000..a5c8f50 Binary files /dev/null and b/src/librarian/res/cover-gandalf.png differ diff --git a/src/librarian/res/cover-prestigio.png b/src/librarian/res/cover-prestigio.png new file mode 100644 index 0000000..b56843f Binary files /dev/null and b/src/librarian/res/cover-prestigio.png differ diff --git a/src/librarian/res/cover.png b/src/librarian/res/cover.png new file mode 100644 index 0000000..0a1511e Binary files /dev/null and b/src/librarian/res/cover.png differ diff --git a/src/librarian/res/ebookpoint-logo-white.png b/src/librarian/res/ebookpoint-logo-white.png new file mode 100644 index 0000000..7a2eb8e Binary files /dev/null and b/src/librarian/res/ebookpoint-logo-white.png differ diff --git a/src/librarian/res/embeds/latex/template.tex b/src/librarian/res/embeds/latex/template.tex new file mode 100644 index 0000000..8e4b807 --- /dev/null +++ b/src/librarian/res/embeds/latex/template.tex @@ -0,0 +1,9 @@ +\documentclass{article} +\usepackage{unicode-math} +\setmathfont{Latin Modern Math} +\pagestyle{empty} +\begin{document} + +$%(code)s$ + +\end{document} diff --git a/src/librarian/res/embeds/mathml/mathml2latex.xslt b/src/librarian/res/embeds/mathml/mathml2latex.xslt new file mode 100644 index 0000000..92f60fc --- /dev/null +++ b/src/librarian/res/embeds/mathml/mathml2latex.xslt @@ -0,0 +1,66 @@ + + + + + + \textrm{ + + } + + + + + + + + + + + + + + + + { + + }^{ + + } + + + + { + + }_{ + + } + + + + { + + } + + + + ( + + ) + + + + \frac{ + + }{ + + } + + + + \varepsilon + + + diff --git a/src/librarian/res/fnp-logo-white.png b/src/librarian/res/fnp-logo-white.png new file mode 100644 index 0000000..c771f05 Binary files /dev/null and b/src/librarian/res/fnp-logo-white.png differ diff --git a/src/librarian/res/hyph-dictionaries/README_hyph_de.txt b/src/librarian/res/hyph-dictionaries/README_hyph_de.txt new file mode 100644 index 0000000..b27906a --- /dev/null +++ b/src/librarian/res/hyph-dictionaries/README_hyph_de.txt @@ -0,0 +1,41 @@ +Hyphenation dictionary "hyph_de_DE.dic" +--------------------------------------- + +Language: German (de DE) + according to the reform of 2006-08-01 (i.e. reformed or new spelling) + +Version: 2013-12-06 + Enhanced blacklist to improve the hyphenation module by Karl Zeiler + +Origin: Based on the TeX hyphenation tables "dehyphn.tex", revision level 31. + http://www.ctan.org/tex-archive/language/hyphenation/dehyphn.tex + The TeX hyphenation tables are released under the LaTeX Project + Public License (LPPL) + +License: OpenOffice.org Adaptions of this package are licensed under the + GNU Lesser General Public License (LGPL 2 or later) and are under + Copyright by + +Author: conversion author: Marco Huggenberger + revised conversion and extensions: Daniel Naber + improvements: Karl Zeiler + +Note: This dictionary is based on syllable matching patterns + and thus should be suitable under other variations of German: + HYPH de AT hyph_de_AT + HYPH de CH hyph_de_CH + + +Trennmuster (hyph_de_DE.dic) +---------------------------- + +Die Trennmuster (hyph_de_DE.dic) basieren auf den TeX Trennmustern +"dehyphn.tex", revision level 31. +Lizenz der Trennmuster: LPPL. Die Anpassung der Trennmuster an +den in OpenOffice.org benutzten "ALTLinux LibHnj Hyphenator" wurde +mit dem Script substrings.pl durchgeführt, das unter +http://lingucomponent.openoffice.org/hyphenator.html als Teil der +Datei altlinux_Hyph.zip heruntergeladen werden kann. +Die Original-Trennmuster können hier heruntergeladen werden: +http://www.ctan.org/tex-archive/language/hyphenation/dehyphn.tex + diff --git a/src/librarian/res/hyph-dictionaries/README_hyph_fr.txt b/src/librarian/res/hyph-dictionaries/README_hyph_fr.txt new file mode 100644 index 0000000..dbb7210 --- /dev/null +++ b/src/librarian/res/hyph-dictionaries/README_hyph_fr.txt @@ -0,0 +1,70 @@ +_____________________________________________________________________________ + + Motifs de division des mots pour le français (fr) + Version 3.0 + + Licence : GNU LGPL. + + Origine : Basé sur les motifs de division de TeX *hyph-fr.tex*, + version renommée (juin 2008) du fichier *frhyph.tex* (V2.12, 2002/12/11) + pour la cohérence avec d'autres fichiers de motifs de division + de la collection hyph-utf8. Voir http://tug.org/tex-hyphen + pour plus d'informations. + Les motifs de division de TeX sont publiés sous la licence LaTeX + Project Public License (LPPL) -- http://www.latex-project.org/lppl.txt + + Licence : Les adaptations pour OpenOffice.org sont publiées sous la licence + GNU Lesser General Public License (LGPL) + version 2.1 ou supérieure -- http://www.gnu.org/licenses/ + + Auteurs : + 3.0 Marc Lodewijck + 2.0 Paul Pichaureau + 1.0 Blaise Drayer + + Journal : + 3.0 Nouvelle version révisée et augmentée : + + Conversion au format de codage Unicode UTF-8 + + Traitement des noms composés à trait d'union + + Redressement de motifs altérés + 2.0 Traitement des mots avec apostrophe + 1.0 Première conversion + + Ce dictionnaire devrait être conforme à toutes les variantes régionales du + français. + +_____________________________________________________________________ + + French word hyphenation patterns + Version 3.0 + + Language: French (fr). + + License: GNU LGPL. + + Origin: Based on the TeX hyphenation tables *hyph-fr.tex*, + renamed (June 2008) from *frhyph.tex* (V2.12, 2002/12/11) + for consistency with other files with hyphenation patterns + in hyph-utf8 package. See http://tug.org/tex-hyphen for more details. + The TeX hyphenation tables are released under the LaTeX Project + Public License (LPPL) -- http://www.latex-project.org/lppl.txt + + License: OpenOffice.org adaptions of this package are licensed under the + GNU Lesser General Public License (LGPL) + version 2.1 or higher -- http://www.gnu.org/licenses/ + + Authors: + 3.0 Marc Lodewijck + 2.0 Paul Pichaureau + 1.0 Blaise Drayer + + Log: + 3.0 New revised and expanded version: + + Conversion to UTF-8 Unicode encoding + + Processing of hyphenated compounds + + Correction of altered patterns + 2.0 Fix for words with apostrophe + 1.0 First conversion + + This dictionary is based on syllable matching patterns and therefore should + be usable under other variations of French. diff --git a/src/librarian/res/hyph-dictionaries/README_hyph_lt.txt b/src/librarian/res/hyph-dictionaries/README_hyph_lt.txt new file mode 100644 index 0000000..5b0ea68 --- /dev/null +++ b/src/librarian/res/hyph-dictionaries/README_hyph_lt.txt @@ -0,0 +1,19 @@ +Hyphenation dictionary for Lithuanian +===================================== + +You're looking at the hyphenation tables for OpenOffice for +Lithuanian. + +Language: Lithuanian (lt_LT) +Origin: TeX hyphenation tables by Sigitas Tolusis and Vytas + Statulevicius. The original tables can be found at + http://www.vtex.lt/tex/download/zip/texmf.zip as lthyphen.tex. +Author: Converted to OOo format by Albertas Agejevas +License: LaTeX Project Public Licence + +To enable hyphenation for Lithuanian in OpenOffice, go to +Tools->Options->Language settings->Writing Aids and maybe set +Tools->Options->Language settings->Languages->Western->Lithuanian. + +Then, enable hyphenation in chosen paragraphs by checking +Format->Paragraph->Text Flow->Hyphenation->Automatically. diff --git a/src/librarian/res/hyph-dictionaries/README_hyph_pl.txt b/src/librarian/res/hyph-dictionaries/README_hyph_pl.txt new file mode 100755 index 0000000..23758e8 --- /dev/null +++ b/src/librarian/res/hyph-dictionaries/README_hyph_pl.txt @@ -0,0 +1,37 @@ +Hyphenation dictionary +---------------------- + +Language: Polish (pl PL). +Origin: Based on the TeX hyphenation patterns plhyph.tex, +version 3.0a, Wednesday, May 17th, 1995 + +The first version of the patterns was developed +by Hanna Ko³odziejska (1987). + +The adaptation to the LeX format (see below) and extensive modification +were done by Bogus³aw Jackowski & Marek Ryæko (1987--1989). + +The hyphenation rules were further improved and adapted to the +TeX 3.x requirements by Hanna Ko³odziejska (1991). + +Lone-standing version (3.0a) of patterns was prepared (under pressure +from LaTeX users) by Bogus³aw Jackowski and Marek Ryæko, following +Mariusz Olko's suggestions, 1995. + +The LeX format mentioned above was the first version of the adaptation +of TeX to the Polish language. The next version is called MeX. + +The original macro file plhyph.tex belongs to the public domain +under the conditions specified by the author of TeX: + + ``Macro files like PLAIN.TEX should not be changed in any way, + except with respect to preloaded fonts, + unless the changes are authorized by the authors of the macros.'' + + Donald E. Knuth + +Current license: GNU LGPL license. +Author: conversion and corrects author is + Artur Polaczyñski + +HYPH pl PL hyph_pl_PL \ No newline at end of file diff --git a/src/librarian/res/hyph-dictionaries/hyph_de.dic b/src/librarian/res/hyph-dictionaries/hyph_de.dic new file mode 100644 index 0000000..aefa716 --- /dev/null +++ b/src/librarian/res/hyph-dictionaries/hyph_de.dic @@ -0,0 +1,7760 @@ +ISO8859-1 +#################################################################################### +# This is the hyphenation file "hyph_de_DE.dic" of the German dictionary # +# according to the reform of 2006-08-01 (i.e. reformed or new spelling) # +# # +# Language: German (de DE) # +# # +# Version: 2013-12-06 # +# Enhanced blacklist to improve the hyphenation module by Karl Zeiler # +# # +# Origin: Based on the TeX hyphenation tables "dehyphn.tex", revision level 31. # +# http://www.ctan.org/tex-archive/language/hyphenation/dehyphn.tex # +# The TeX hyphenation tables are released under the LaTeX Project # +# Public License (LPPL) # +# # +# License: OpenOffice.org Adaptions of this package are licensed under the # +# GNU Lesser General Public License (LGPL 2 or later) and are under # +# Copyright by # +# # +# Authors: conversion author: Marco Huggenberger # +# revised conversion and extensions: Daniel Naber # +# improvements: Karl Zeiler # +# # +# Please note, this dictionary is based on syllable matching patterns # +# and thus should be suitable under other variations of German # +# # +# HYPH de DE hyph_de_DE # +# HYPH de AT hyph_de_AT # +# HYPH de CH hyph_de_CH # +#################################################################################### + +.aa6l +.6a1ba +.ab3a4s +.a1be +.ab3ei +.a1bi2 +.ab3it +.a1b1l8 +.a1b1r +.a1b3u +.a1d +.a1do +.ad3o4r +.a2l1t +.alti6 +.a3na3c +.an5a2l1g +.a1n1e +.an2gs +.ang8s2t1 +.a6n1s +.ap1p +.a2r1s +.ar6sc +.a2r1t +.ar6ta +.8ar6tei +.as2z +.au2f1 +.au2s3 +.1be +.be5er1b +.be3na +.be2r1t +.ber6t5r6 +.1bi +.b6ie +.bie6r5 +.bi2ms +.bim6s5t +.1br +.brot3 +.br6u6s +.c8h6 +.1che6f5 +.1da8c +.da2r +.d2a1ri +.dar5in +.da1r5u +.1de +.den6ka +.de1re +.de5r6en +.de1sp2 +.des6pe +.de8s2p2o +.de3s1z +.1di +.dia3s4 +.dien4 +.dy2s1 +.e6hr +.eh1re +.ehre6n5 +.ei1ne6 +.ei6n5eh +.ei8nen +.ei6ns +.ein5sa +.e2n1d +.en1de +.en6der +.en6d5r4 +.en3k4 +.en8ta8 +.en1te +.en8tei +.en4t3r6 +.e1p2o1 +.er1b +.er1ba +.er6ban +.er1be +.er6b5ei +.erbl8 +.er6bla +.e8rd +.er1du +.er6d5um +.e1re +.2er3ei +.e1r5er +.2e1ri +.er3in +.er3o4b +.er1w +.erwi5s +.e1s1p2 +.e2s8t1l +.es8t1n +.ex1a2 +.ex3em +.fa2ls +.fal6sc +.1fe +.fe6s1t5a +.flu4g3 +.1fu +.furc8h8 +.1ga +.ga1ne +.ga6ner +.1ge +.ge3n4a +.ge5rö8 +.ge1s6 +.ha2lb5 +.hal1be6 +.hal6br +.haup4 +.hau4t +.hei1ma6 +.he4r3e +.her6za +.he5x +.hin3 +.hi2r1s +.hir8sc +.ho4c +.hu3sa +.hy5o +.i1be5 +.i1ma +.ima6ge +.in1 +.i1ni6 +.isc8h +.i1s5chi +.ja6gd5 +.1ka +.ka6l1k +.kal6k5o +.ka6ph +.ki4e +.1k2o +.kop6f3 +.1kr8 +.kraf6 +.1kü +.kü5ra +.la2b1b +.lab6br +.1li +.l8i1i +.liie6 +.lo6s5k2 +.1lös +.lö4s3t +.1ma +.ma5d2 +.1mi +.mi2t1 +.no6th +.no1to +.no6top +.o1be +.ob2e8ri +.o1b1l8 +.o8bs2 +.ob6s1t5e +.or3c +.o2r1t +.or2ts +.ort6s5e +.o1st3a +.os1te +.oste8r +.1pe +.p8er +.pe4re6 +.pe3t2s +.1ph6 +.1p2o +.po8str6 +.r6au4m3 +.re5an +.ro8q +.ru5the +.rü5b6e2 +.sc8h8 +.1se +.se6e +.se5n6h +.se5ra +.1si +.si2e +.sp2 +.1spi +.spi1k +.spi6ke +.st4 +.1sy +.sy2n1 +.1tag +.ta1ge +.tage4s5 +.tan6kl8 +.ta8th +.te6e +.te8str6 +.to1d +.to1de4 +.to6der +.t8o1ni +.to8nin +.to6we +.um1 +.u2mp +.umpf4 +.un1 +.u1ne6 +.un1ge +.ung8e5n +.ur1c +.u1re +.ur5en +.1ve +.ver1 +.v2e1ri +.ve6rin +.v2or1 +.vora8 +.1wah +.wah6l5 +.1weg +.we1ge +.we8ge1s +.we8s2t +.wes3te +.wo6r +.wor3a +.wu6n4s +.1zi +.zi4e +.1zu +.z2uc +.zuc8h8 +.ä2n1d +.än1de +.ände8re +.öc8h8 +aa1c +aa2gr4 +aa1l5e +aa6r5a +aa2r1t +a5arti +aa2s1t +aa2t2s +6a1ba +ab3a2r1t +a2b1d +1abdr4 +a1be +6ab8el +abe2n1d +aben6dr4 +ab5e6rk +ab5e2r1r +ab5e2s1se +1a2b1f8 +1a2b1g2 +a2b1h +1abhä +a1bi +ab1ir +a2b1k2 +1ab1k2o +a1bl8 +ab1la +5a6blag +a6bl8aß +ab4ler +a1b1lu +a8blä +5a6blö +a2b1m +ab1ma +abma5c +1a2b1n +a1br +ab1ra +ab1re +5a6brec +ab1ro +a8b1s +ab8s1k2 +abs2z +a2b1t +3abtei +a1bu +ab1ur +1a2b1w +a8b1z +5ab1ze +5ab1zu +a1bä +ab1än +abäu8 +a1ce +a4ce. +ac8h +a5chal +ach5a2r1t +ach5au +a1che +a8chent +ach6er. +a6ch5er1f +a1chi +ach1l6 +a6ch3m +a2ch5n6 +a1cho +ac6hr +ach3re +a1chu +a8ch1w +a1chy +ach5äf +ac2k +ac1k2o +a2c2ks +acks6t8 +ack5sta +a1d +8ad. +a6d5ac +ad3ant +ad8ar +a2d1d +5ad1di +a1de +a8dein +ade5o8 +a1di +adi5en +1ad1j +a2d1l +1adle +a1do +ad1op +adr4 +a2dre +3adres +a2dt1 +1a2d1v +a6dä +a1e2d +ae1r +a1er. +1aero +8afa +a3fal +af1an +a5far +a5fat +af1au +a1fe +a6fen2t1l +a2f1ex1 +a2ff +af1fr6 +afr6 +af5rau +af1re +1afri +a2ft +af1te +af6tent +af1tr6 +af6tra +aft5re +a1fu +a6f5um +8a1fä +a1ga +ag5a1be +a1ge +5a4gent +ag8er +age1s +age1s5e +a2g1g +1ag1gr4 +a1g5las +ag1lo +a1gn8 +ag2ne +a1go +1a2g8o1g +a1gu +a6g5u2n1d +a1ha +a1he +a2h5ein +a4h3er1h8 +a1hi +ahl1a +ah1le +ah1ma +ah4m3ar +ahn1a +a5ho +a6hr +ahra6 +ahr5ab +ah1re +ah8rei +ahre6n8s +ahre4s3 +ah2r1t +ahr8ti +ah1ru +a1hu +ah8ö +ai1d +ai3d2s +ai1e +a2if6 +ai6ns +a3in1se +ai1re +ai4re. +aisc8h +a5i8s2ch. +ai1s8e +ai2s1m +a3ismu +ais6n +ai1so6 +a1j +a1ka +1aka1d +a4ka1de +a1ke +a1ki +a2k1k2 +1ak1k2o +a1kr8 +5akro1 +a5lal +al5a6ns +3al8a6r1m +a2lb +al1be +al8be1b +al8ber1w +albl8 +alb5la +al1bu +3album +a8l1c +a1le +ale1b +a6l5e6be +a4l3ein +a8lel +a1ler +a8ler1b +a8ler1h8 +a6le2r1t +5a6l5eth +a2l1g +1al1gi +al4g1li +a1li +a2l3int +a6ll +al1la +al4lab +al8lan +al4l3ar +al1le +alle3g +a1lo +a4l5ob +a2ls +al1sc +alsc8h +al6s6ch2m +a2l1t +al4the +altr6 +al4t3re +8a1lu +al6u5i +a6lur +alu3ta +a1lä +a1ma +a6ma1te +a1me +8ame. +5a6mei1se +a2m1m +am1me +am6m5ei +am6mum +am2n8 +a2mp +ampf3a6 +a2ms +am1sc +amsc8h +am6s8chw +a2m1t +am2ta +a1mu +a1mä +a3na2c +a1na1d +ana1di +anadi5e +an3a1k2o +an3a6l1p +3a8na1ly +an3a1me +an3a2ra +a1nas +an5as1ti +a1nat +ana2t5s +a2n1d +an1de +an8dent +ande4s3 +a1ne +a2n1ec +a8n5eis +an1e2k +4aner. +a6n5e8rd +a8ner1f +ane6rk +a6n5er1ke +an1f +1anfa +an1fe +5anfe2r1t +1an1fä +an1ga +3angab +an1ge +ange1b +5ange1bo +an3g1li +ang6lis +an2gn8 +an1gr4 +3angri +an2g5t6 +an1h +5anhä +a1ni +ani5g +an6i1k +ani4ka +an2io +an5i8on +an1kl8 +an1k2n8 +an6kno +an1kr8 +an4kro +1an5l6 +an1m +an1ma +anma5c +anmar4 +an1na +3an1n2ah +an1ne +anne4s3 +a1no +5a6n1o2d +5a6n3o1ma +5a6no8rd +1an1r +a6ns +an1sa +an1sc +ansc8h +5anschl6 +an1so +an4so1z +an1st +an1sta +5anstal +an1s2z +an1te +5antenn +an1th +a8n1w +5anwä +a5ny +an1ze +an4z3e1d +5anzeig +an1zi +5anzieh +an1zu +3anzug +an1ä +5anäs +a1nö +anö8d +a1os +a1pa +ap1fe +3apfel +a1ph +a2ph1t2 +aph5ä6 +a1pi +8apl8 +a1p2o +apo1c +apo1s +a6pos2t +a6po1th +1ap1pa +ap1pr6 +a1pr6 +a5pä +a3pü +a1ra +a4r3af +a2r3a6ll +ar1b +ar1be +3arbei +2ar2b1t +ar1c +2a1re +ar3ein +a8r1g +ar2gl +2a1ri +ar2ie +ari5es +a6rk +ar1ke +ar8ke2r1s +ar1l +ar6les +a2rn +ar1na +ar4nan +ar5o6c8h +ar1o2d +a1rol +ar2on +ar3ony +a8ror +a3ros +ar5ox +a2r1s +arsc8h +ar6schl6 +a2r1t +8ar5tei +artr6 +ar6t5ri +a1ru +a1ry +1ar2z1t +arz1w8 +ar8zä +arä8m +arö6 +ar5öm +ar1ü2 +a1sa +asc8h +a1sche +a6schec +asch5l6 +as6ch3m +a6s2chn6 +as1h +a3s4hi +asp2 +as1pa +asp5l8 +as1te +as5te1v +1a2sth +a1str6 +ast3re +8a1ta +ata5c +ata3la +a6tapf +at8a5pl8 +a1te +a6te1li +aten5a +ate5ran +6a2t1f2 +6a2t1g2 +a1th +ath6a +at3hal +1a2th1l +2a1ti +a2t1l +atl8a +5atlant +3atlas +a2t1m8 +8atmus +6a2t1n +a1to +a6t5ops +ato6ra +ato2r1t +a6t5ort. +4a1tr6 +a6t5ru +a2t1t +at2t1h +at5t6hä +6a1tu +a2tz +atz1w8 +a1tä +a1tü +au1a +au1br +au6bre +a2uc +auc8h +auch3a +au1e +aue4l +au1fe +5au4f3ent +au2ff +3auf1fü +au2f1g2 +3auf1ga +1au2f1n +au2f1t +3auf1tr6 +1au2f1w +au1ge +3auge. +a6uk +au1kl8 +au4kle +au1le +aule8s +6aum +au1ma +au8mar +au2m5p +1au2s1b2 +3au2s1d +1au2s1f2 +1au2s3g2 +au1si +au8sin +au4sta +1au2s1w +1aus1z +au1te +aut5eng +au1th +1au1to +au1ße8 +a1v +a1ve +aver1 +ave5r6a +av2e1r6i +a1w +a6wes +a1x +a1xi +a2xia +a6x2io +a1ya +a1z +a1zi +azi5er. +8aß +1ba +ba1d +ba1de +8ba8del +ba1la +ba1na +ban6k5r8 +ba5ot +ba8rd +bar1di +bardi6n +ba1ro +bas1te +basten6 +bau3sp2 +2b1b +bbl8 +bb6le +b2b1li +2b1c +2b1d +1be +be1a +be8at. +be1c8h +8be2cht +bec2k +8be1cke. +be5el +be1en +bee3r4e +be2e8rei +be5e1ta +be1f2 +8be2ff +be1g2 +be1hö8 +bei1s +bei1se +6b5eisen +bei3tr6 +b8el +b4e1l8o +be1lu +belu3t2 +be3na2c +be2n1d +ben1d6o +be1ne +be6n5e2r1s +be6n5er1w +be1no +be4nor +be6ns +ben4se6 +bens5el +be1nä +be1nü +be1o2 +b8er. +be1ra +be8rac +be8r1g +ber1ga +ber8gab. +be2r1r +be1rü +be1s8c +be1se +bes5er1h8 +be1s2p2 +be5th6a +be2ts +bet5sc +be1un +be1ur +8bex +be1z +bezw8 +be6zwec +2b1f8 +2b1g2 +b1ga +bga2s5 +b1ge1 +2b1h +bho1le6 +1bi +bi1bl8 +b6ie +bi1el +b2il +bi1la +bi1lä5 +bi1na +bi1no +bi4no1k +bi6stu +bi5tr6 +bi2t1t +bit4t5r6 +b1j +2b1k2 +b1kü6 +bl8 +b6la. +6b1la1d +6blag +8blam +1blat +b8la2t1t +3blau. +b6la1v +3ble. +b1le1b +b1le1d +8b1leg +8b1leh +8blei1d +8bleih +6b3lein +bl4e4m3o2 +b1li +4blic8h +b4li2n1d +8bling +b2l2io +5blit +b4li2tz +b1loh +8b1los +1blu +5blum +2b1lun +blut3a +blu2ts +blut5sc +3blä +blä6s5c +5blö +3blü +blü8sc +2b1m +2b1n +1bo +bo1c8h +bo1d +bo5d6s +boe5 +8bo2ff +8bon1k +bo1ra +b1o2r1t +2b1p2 +b1q +1br +bra2il6 +brast8 +bre4a +b5re1d +8bre1f +br2ie +8b5riem +b1r2ig +b6ri1ga +bro1s +b1rup +b2ruz +8bröh +brö2s5c +8bs +b1sa +b8sang +b2s1ar +b1sc +b1se +bs3er1l +bs3erz +b1so +b8sof +b1s2p2 +b2st1h +bstr6 +b3stru +b5stä +b1su +b6sun +2b1t +b2t1h +1bu +b6ui +bu1ie +bu6l6k +b8u1re +bu1si +bu6sin +6b1v +2b1w +1by1 +by1t +by6te. +8b1z +1bä +b5ä6s5 +1bü +bü1b6e2 +b3ü4ber1 +b6ü5be1re +bü1ge6 +büge1l5e +bü2r1s +bür6sc +1ca +cag6 +ca5la +c2a6re +ca5y +c1c +1ce +ce1li +celi4c +celic8h5 +ce1ro +c8h +2ch. +1c8hae +ch1ah +ch3a2k1t +cha1me +cha6mer +8c6hanz +5cha1ra +3ch2a1ri +5cha1to +6ch1b2 +1che1f +6chei +ch3e2il +ch3eis +che6rk +6cher1kl8 +6ch1f2 +4ch1h +5chia1d +5chias +6chi6ns +8ch1j +chl6 +5ch4lor +6ch2m +2chn6 +ch1ni +ch8n6ie +5cho. +8chob +c2hoi +choi8d +6ch1p +c6hr +ch3ren +ch6res +ch3rü +2chs +2cht +cht5h6a +cht3hi +5chth2on +ch1ti +ch6tin +6chuh +chu4la +6ch3unt +chu2t6t +8chw +1ci +ci5tr6 +c2k +2ck. +ck1ei +4c2k1h +ck3l8 +ck3n8 +c1k2o +ck5o8f +c1k1r8 +2c2ks +ckst8 +ckstr6 +ck5stra +ck6s5u +c2l +1c8o +con6ne +8cor1b +cos6t +c3q +1c6r +8c1t +1cu +1cy +5cä1 +cö5 +1da. +8daas +2d1a2b1g2 +8da1br +6da2b1t +6d1a2b1w +1dac +da2gr4 +6d5a6l1k +8d5a2m1t +dan1c +dan1ce +dan6ce. +da1ni +dan6ie +dani5er +dan1ke +dan8ker +2d1an5l6 +danla6 +6da6ns +8dan1zi +6dan1zu +d1ap +da2r1a8 +2d1ar1b +d3ar1c +da6r1m +dar1me +dar6men +4d3a2r1t +8darz +1dat +8da2t1m8 +2d1auf +2d1aus +2d1b +2d1c +2d1d +d5de +d3d2h +d1dä +ddä2m1m +ddäm1me8 +1de +2deal +de5an +dec8h +de3cha +de1e +de1f +de1fe6 +6de2ff +2d1e6hr +5d4eic +de5isc +de1la +de8lar +de2ls +del6s5e +del1sp2 +del6spr6 +de1ma +de4mag +de1mu +de8mun +de1ne +de8nep +dene6r +den1ge +8denge. +8deng8en +de5o6d +2deol +de5ram +de8rd +8der2d1b +de1re +d2erei +der5ein +de1ro +de2r1r +d8e2r1s +d2e1ru +der5um +de1sa +de4s3am +de4s3an +de4sau +de1si +de6s2il +de4sin +de1so +de8sor +de1sp2 +de4spr6 +de2su +8deul +de5us. +2d1f +df2l +2d1g +2d1h +1di +dia5c +di5a1ra +di1ce5 +dic8h +di3c6hr +di5ena +di1gn8 +d2il +di1la +di2l8s +di1na +8di2n1d +6din1f +4d3in1h +2d1i6ns +d2io +di5o6d +d2ip +di3p4t +di1se +di8sen +dis1p2 +dis1pe +di5s8p8er +di6s5to +dis3tr6 +di1ta +di8tan +di1ti +di8tin +d1j +6dje +2dju +2d1k +2d1l +2d1m +2d1n6 +d1ni6 +dn1j +dnje6 +1do +6d5o1be +do6ber1f +6d5ony +do3ran +6do8rd +2d1o8r1g +do2r1t +dor4t3h +6do1th +do2t1t +dott8e +2d1p +d5q +dr4 +1drah +8drak +d5r6a2n1d +6d1re. +4drec8h +d6rec2k +4d3reg +8d3reic +dre2if +d5rei1fe +8drem +8d1ren +2d1rer +8dres. +6d5r1h8 +1dria +d1ric +8dri2n1d +droi6 +dro5x +1dru +8drut +drö2s5c +1drü +drü5b +drü8sc +2ds +d1sa +d6san +d1sat6 +d1sc +dsc8h +5d6scha. +d1schi +5dschi1k +d1se +dse8e +d8se8r1g +8ds1l +d1sp2 +d4s1pak +ds2p2o +d8spä +d1st +d1sü +2dt +d1ta +d1te +d1ti +d1to +d2t1s6 +d1tu +d5tä +1du +du5a2ls +du1b6 +du1e +du2ft +duf4t3r6 +4d3uh +d6ui +du5ie +8du2m1l +8du2m1w +2d1u2n1d +du8ni +6d5unt +dur2c +durc8h3 +6dur1l +du2r1s +6dursa +8du2r1t +dus1t +dusc8h +du8sc6hr +2d1v +2d1w +dwa8l +2d1z +1dä +6däh +8dä2n1d +dä6r +dö1b +dö8bl8 +d5öl +dör1f +dör6fl +dö8sc +d5ö4st +1dü +ea1be +ea4ben +e1ac +e1ah +e1a2k1t +e1al. +e5al1f +e1a2l1g +ea1li +e5a8lin +e1a6l1k +e1a6ll +e5a6l1p +e1a2l1t +e5a2l1w +e1am +e1a2n1d +ea1ni +ea6nim +e1ar. +e5ar1f +e1a6rk +e5a6r1m +e3a2r1t +e5at. +e6a1te +e6a5t6l +e8a2ts +e5a2t1t +e6au. +e1aus +e1b +e1ba +e6b5am +e1be +ebe6ns +eben4s5e6 +ebl8 +eb1li +eb4lie +e8bs +eb1se +eb4ser +eb1si +eb4s3in +ec8h +e1che +e8cherz +e1chi +e6ch3m +8e2ch3n6 +ec6h1r +e2chs +ech1se +ech8se2n1d +ech4su +e1chu +ec2k +ec1ka +eck5an +e5c2l +e1d +ee5a +ee3e +ee5g +e1ei +ee5isc +eei4s3t +ee1le +ee6le2n1d +e1e6ll +ee5lö +e1e8rd +ee3r4e +ee8reng +eere6s5 +ee5rä +ee1ta +ee6tat +e1ex +e1f +e6fau +e1fe +e8fe8b +e2ff +ef5fe +3effek +efr6 +ef3rom +e1ge +ege6ra +eg1los +eglo6si +1egy +e1ha +e6h5ac8h +eh5a6ns +e6hap +eh5auf +e1he +e1hi +ehl3a +eh1le +eh3l5ein +eh1mu +eh1ne +eh2n5ec +e1ho +e6hr +ehr1a +eh1re +ehre6n +eh1ri +eh1ru +eh6r5um +e1hu +eh1w +e1hy +e1hä +e1hö +e3hüt +ei1a +eia6s +ei1ba +ei6bar +eic8h +eich3a +eic6h5r +ei1d +ei4dar +ei1de +ei6d5ei +ei8der1f +ei2ds +ei3d4sc +ei1e +e2if +ei1fe +8eifen +eifr6 +3eifri +1eign8 +e2il +ei6l1d +ei1ma +ei6mab +ei8mag +ein1a4 +ei8nat +ei1ne +ei8ner1h8 +ei8ness +ei6ne1te +ein1g +e8i1ni +ein1k +ei1no +ei6n5o1d +ei8no1k +ei4nor +ei6ns +e3in1sä +e2i1o +e1i2rr +ei5ru +ei1sa +ei8sab +eisc8h +ei5s2chn6 +ei1se +ei6s5ent +ei1so +ei8sol +ei1ta +ei4t3al +eit3ar +eit1h +ei6thi +ei8tho +ei2ts +eit1sam +eit8sa2m1t +ei1tu +ei6t5um +e1j +1e4k1d +e1ke +e1ki +e1k2l8 +e1kn8 +ek2ni4 +e1la +e2l1al +6elan +e6lan1f +e8l1an5l6 +e6l5a6ns +el3ar1b +el3a6r1m +e6l3a2r1t +5e6las1ti +e6lau1ge +e2lb +el8bs +elb1st5a +e1le +6ele1f +ele6h +e6l5e1he +e8le2if +e6l5ein1h +1elek +e8lel +3ele1me +e6lemen +e6len1te +e6l5e1pi +e1ler +e4l3e2rr +ele2r1s +e6l5ersc +el1f +elf2l +e2l1g2 +e1li +e6l5i6ns +e6ll +el1le +el1l8er +4e1lo +e4l3o1fe +e2ls +el1so +el8soh +e2l1t +el5ten +el8tent +5elte2rn +e1lu +elut2 +e1lä +e1lü +e2m1d +em1de +em8dei +e2m1m +em1me +em8meis +4e1mo +emo5s +e2mp +1emp1f +1emp1t +e2m1t +1emto +e1mu +emu6rk4 +emur2ks5 +e1mä +ena1be +en5a6ben +ena2c +enac8h +en5a2chs +en5ac2k +e1na1d +en5af +en5a6ll +en3a2l1t +en1am +en3an. +en3ant +en3anz +en1a6p +en1ar +en1a6s +6e1nat +e4n3auf +en3aus +en1c +en2ce +e2n1d +enda6l +en1de +end5er1f +end5e8r1g +en8dess +e1ne +4ene. +e2nec +en5ec2k +ene1f +e8ne2ff +e6n5e6hr +e6n5eim +e8n3eis +6enem. +6enen +e4nent +4ener. +e8ne8rd +e6n3er1f +e4ne8r1g +5ener1gi +ener1l +e6n5erla +en5e2r1s +e6nerst +en5er1w +6enes +e6n5ess +e2nex +en3glo +2e1ni +en1ni +enn6i6s5 +en1no +enn6os4 +en6ns8 +e1no +eno1be +e6nober +eno8f +e6n5opf +e4n3o8rd +e6ns +en1se +en8se2r1s +ens1k2 +ens8kl8 +en1sp2 +ens1p2o +ens6por +en1ta +en5t6ag +en4t3a5go +en1te +enter1b +en8ter1bu +en1ti +en6ti1d +en2t1l +3entl8a +en1tr6 +ent5ric +en2t1w +5entwic +5entwu +1en2t1z +e1nu +en6u5i +e3ny +en1za +en8zan +en1öf +e1nös +e1nüg +eo1c +e5o6fe +eo1k +e5o2k1k2 +e1on. +e3on1f +e5on1k +e5on5l6 +e5on1r +e5opf +e5ops +e5or. +e1o8rd +e1o8r1g +eo5r6h8 +eo1t +e1pa +e1pe +e8pee +e6p5e6g +ep5ent +e1p2f +e1pi +5epi1d +epi1de +e6pidem +e1pl8 +e1p2o +5epos +e6pos. +ep4p3a +e1pr6 +e1pä +e1q +e1ra. +er5aal +8er6a1ba +era1be +e5r6ab8el +er5a6ben +e5ra1bi +er3a8b1s +er3ac8h +era5e +era5k6l8 +e2r3a6ll +er3a2m1t +e3r6a2n1d +e3ra1ne +er3a6ns +e5r8anz. +e1rap +er3ar1c +e3r2a1ri +er3a6si +e1rat +era2t3s +er3auf +e3r6aum +er1b +er8bs +3erb1se +er1c +e1re +4e5re. +er3ec2k +er5e2g1g +e2r5e2h +2erei +e3r4ei. +e8rei1ne +e6r5ein1r +6eren. +e4r3en1m +e1rer +4erer. +e6r5e6r1m +er5er5o +ere2r1s +er5erst +e4r3erz +e2r3ess +er1f +er1fü +5erfül +e8r1g +er1ga +er8gan. +er1ge +erge1b +5erge2b1n +er2g5h +er1gä +5ergänz +er1h8 +5erhö1hu +2e1ri +eri5ak +e6r5iat +e4r3i2n1d +e6r5i6n5i6 +er5i6ns +e6r5int +er2it +eri1ti +er5it2io +e6rk +er1kl8 +3er1klä +er1l +er1lös +5erlös. +e6r1m +er1me +erme6n6s +e2rn +er1na +er6nab +er6ns +3ernst +6e1ro. +e1ro1d +er1o2f +e1r8o1g +6e3roi +ero5i1d +ero8i1de +e3rol +e1rom +e1r2on +e3rop8 +e2r1or +e1ros +e1rot +er5ox +e2r1s +ersc8h4 +er1sta +5erstat +e2r1t +er5tei +er6t5ein +er2t1h +er5t6her +2e1ru +e1r4uf +eru2f4s3 +e4r3u6hr +e2r3u2ms +e5r6us +er1w +5erwer1b +e1ry +erzw8 +er5zwa +er3zwu +erä8m +er5äs +erö8 +e3rös. +e6r1ü2b +e1sa +esa8b +e8s1ap +e6s5a6v +e1sc +esc8h +esch4l6 +e1se +ese1a +ese1b +es5e1be +eser1v +eser1ve5 +e8s1h +e1si +es2il +es5i6ll +es3int +es1k2 +es1k2o +es4kop +e2s1l +e1so +eso8b +e1sp2 +es1pe +es4pei6s5 +es2p2o +es2pu +e2s1se +5essenz +e1sta +e6s4ta8b1s +e6staf +e6st5ak +est3ar +e1sto +e8stob +e1str6 +e6st5res +e1su +es3ur +e2s1z +e1sü +e1ta +e1t8ag +e1t2a1ri +etar2i5e +et8a8ta +e1te +eten6te +eth6a +et5hal +e5thel +e1ti +1e2t1n +e1to +e1tr6 +e2t3rec +e2ts +etsc8h +e8tscha +et8se +e2t1t +et6tei +et2th +et2t1r6 +e1tu +etu1s +e2tz +et1ze +et8zent +et8zw8 +e1tä +e1tö +e1tü +eu1a2 +eu1e +eu1er +eue1re +eu2e8rei +eu5fe +e6ui +euin5 +e6uk2 +e1um. +eu1ni +eu6n2io +eun1te +e5unter +eu1o6 +eu5p +eu1ro +3europ +eu1sp2 +eu5str6 +eu8zo +e1v +eva2l6s +e1ve +ever1 +eve2re2 +eve5r6en +ev2e1r4i +e1w +e2wig +e1xo +ex1or +1e8x3p2 +e8x1t +1extr6 +ey3er. +e1z +e1ä2 +e5ö8 +e1ü +e1ße +e8ßes +fac8h +fa6ch5i +fa1d +fa1de8 +fa6del +fa5el. +fa6ll +fal6lo +fa2l1t +falt8e +fa1na +fan4gr4 +6f1an5l6 +6fap +far1b +far6ba +far4bl8 +fa2rr +far6r5a +2f1a2r1t +fa1sc +fau8str6 +fa3y +2f1b2 +6f1c +2f1d +1fe +2f1ec2k +fe1d +fe6dr4 +feh1le +feh6lei +f6eim +8fei6ns +f5eis +fe1le +fel5en +fe2l1t +8f5elte2rn +8fe2mp +fe5rant +fe8rd +4ferd. +fe2rr +fer1ri8 +fe1sto +fe8stof +fe6str6 +fe1stu +fe6stum +fe1ta +fe8t8ag +fe2t1t +fet6ta +fex1 +2ff +f1fa +f6f5a6r1m +f5fe +ffe5in +ffe6la +ffe1le +ffe8ler +2f2f1f +f1fla +ffl8e +ff3lei +ff1li +ff4lie +f2fs +ff8sa +ff6s5ta +2f1g2 +f1ge +fge1w +fgewen6 +4f1h +1fi +fi1d4 +fi3ds +fie1b4 +f2il +fi1la +fi1le +fi8lei +fi2l1m +fil4m5a +f8in. +fi1na +8fin1f +fisc8h +fi8scho +fi6u +6f1j +2f1k2 +f8lanz +fl8e +4f3lein +f1li +8flib +4fling +f2lix +6f3l2on +5flop +1flor +5f8läc +3flöt +2f1m +2f1n +1fo +foh1 +f2on +fo6na +2f1op +fo5ra +fo6r1m +for1me +for8mei +fo2r1s +for8str6 +fo2r1t +for8th +for6t5r6 +fo5ru +fo2t1t +6f5otte +2f1p8 +f1q +fr6 +f5ram +1f8ran +f8r8aß +f8re. +frei1 +5fr4ei. +f3reic +f3rest +f1rib +8f1ric +6f1r2ig +1fr2is +fr2on +fro8na +fräs5t +2fs +f1sc +f1se +f2s1er +f5str6 +f1stä +fs3tät +2ft +f1tak +f1te +ft5e6h +fte1re6 +ft1h +f1ti +f5to +f1tr6 +ft5ra1d +f2ts +ft1sc +ft2so +f1tu +f2t1w +ft1wi3d4 +f2t1z +1fu +6f5u2ms +6fun1f +fun4ka +fu1ße +fuße6n +fu8ße2n1d +6f1v +2f1w +2f1z +1fä +fä1c +8fä6r1m +6f1äug +fä8ß +fö1de3 +8föf +3för +1fü +fün1f +fün4f3u +1ga +ga6bl8 +6g1a2b1w +8ga8b1z +ga1d +ga1de +g3a4der +ga8ho +ga5isc +4gak +ga1la +6g5a2m1t +ga1na +ga1ne +gan5er1b +1gan6g5a +ga5n1j +6g1an5l6 +ga6ns +8gan1sc +6gar1b +2g1ar1c +2g1a6r1m +ga5ro +ga2r1t +6g3arti +ga8sa +ga8sc +ga1str6 +ga6st3re +2g1a2t1m8 +6g5auf +gau5fr6 +g5aus +2g1b +g5c +6gd +g1da +1ge +ge1a2 +ge6an +ge8at. +ge1e2 +ge6es +ge1f2 +8ge2ff +ge1g2l +ge1im +4g3ei1se +geist5r6 +ge2lb +gel1br +gel8bra +ge2l1t +gel2t8s +ge5lö +g2e1ni +ge8nin +gen3k +6g5en2t1f2 +ge3nä +ge1or +ge1ra +ge6rab +ger8au +ger1h8 +8gerhö +g2e1ri +ger8i6ns +ge1ro +6g5erz. +ge1rä +ge1rü +ge1s +ge1s2p2 +ges1te +ge2s7te. +ge2s7ten +ge2s7ter +ges1ti +ge2s7ti1k +ge5unt +4g3ex3 +2g1f8 +2g1g +g1ha +6g1hei +5ghel. +g5henn +6g1hi +g1ho +1g6hr +g1hö +1gi +g2il +gi5la +gi1me +gi8me. +gi1na +4g3i6ns +gis1tr6 +g1j +2g1k +8gl. +1gla1d +g5lag +glan4z3 +1glas +6glass +5glaub +g3lauf +1gle. +g5le1b +3gleic +g3lein +5gleis +1glem +2g1ler +8g3leu +g1li +gli8a +g2lie +3glie1d +1g2li1k +1g2lim +g6l2io +1gloa +5glom +1gl2on +1glop +g1los +g4loss +g5luf +1g2ly +1glü +2g1m +gn8 +6gn. +1gna +gna2c +8gnac8h +2g1n2ah +g1nas +g1ne +g8neu +g1ni +g2n6ie +g3n6is +1gno +8gnot +1go +goe1 +8gof +2g8o1g +5go1gr4 +6g5oh +g8o1ni +gon6i5e +gon6is +6gonist +go1ra +8go8rd +2g1p2 +g1q +1gr4 +g5rahm +gra8m +gra4s3t +6g1rec +gre6ge +4g3reic +g5reit +8grenn +gr2i4e +g5riem +5gr2if +2g1r2ig +g5ring +6groh +2grot +gro6ß +4grut +2gs +gs1ab +g5sah +gs1ak +gs1an +g1s8a2n1d +gs1ar +gs1au +g1sc +g1se +gs1e1f +g5s8e2il +gs5ein +g2s1er +g1si +gs1in +g2s1o +gso2r +gsp2 +gs1pr6 +g2s1u +2g1t +g3te +g2t1h +1gu +gu5as +gu2e +2gue. +6gue1d +4g3uh +8gu2ms +6g5unt +gut3h +gu2tu +4g1v +2g1w +gy1n +g1z +1gä +8gä8m +6gä6r1m +1gö +1gü +6güb +1haa +ha1b8r +ha1d +ha1de +ha8del +hade4n +8hae +ha5el. +ha2ft +haf6tr6 +2hal. +ha1la +ha2lb +hal4b5a +6ha1le +8han. +ha1na +ha2n1d +han6dr4 +han1ge +han6ge. +2ha1ni +h5an1th +6hanz +6har1b +h3ar1be +ha6r1m +h3ar1me +ha5ro +ha2t1h +h1a2t1m8 +hau1sa +hau6san +h8a8ß +h1b2 +h1c +h1d +he1b +he2bl8 +hec8h +he3cho +h3e2cht +he1d +he5d6s +he1f +5he2ft +he1he +h5e6he. +hei1d +hei8ds +h1e2if +2hein +he3i2s1m +he5i2st. +hei2t8s3 +he2k1t +hek6ta +he6ll +hel1la +hel8lau +8he2l1t +he1me +he6mer +1he2m1m +6h1e2mp +he1ne +h6enen +hen5e2n1d +henkl8 +hen5klo +hen1tr6 +hen6tri +he2nu +8heo +he8q +her3ab +he5rak +her3an +4he1rap +her3au +her1b +h3er1bi +he1ro +he8ro8b +h2e1ru +he4r3um +her1ze +her6z5er +he1sp2 +he4s1pe +he1st +he1ta6 +het5am +he5th +heu3sc +he1xa +hey5e +h1f2 +h1g +h1go +hgol8 +h1h +h1iat +hi2e6r5i +hi1k +hi5k1t +h2il +hil1a2 +hil1f +hil4fr6 +hi5nak +hin4ta +hi2nu +h2io +hi5ob +hi2rn +hir5n5e +hir6ner +hi1sp2 +hi1th +hi5tr6 +5hi2tz +h1j +h6jo +h1k2 +hla2b1b4 +hla4ga +hla6gr4 +h5lai +hl8am +h1las +h1l8aß +h8l1c +h1le1d +h3lein +h1ler +h5l6er. +h1li +h2l2if +h2lim +h8lin1f +h2l5int +h2l2ip +h2lit +h4lor +h3l6o1se +h1läs +h1me +hme5e +h1ne +h2nee +h2nei +hn3eig +h2nel +hne8n +hne4p3f +h2n8erz +h6ne2tz +h1ni +h2n2ip +h2nit +h1nol +h6ns +hn5sp2 +h1nu +h2n2uc +h2nu1d +h2nul +hoc8h1 +1hoh +hoh1le +hoh8lei +2hoi +ho1la +ho4l3ar +1holz +h2on +ho1ra +6ho8r1g +ho2rn +5horn. +ho3s1l +hos1p2 +ho4spi +h1p +hpi6 +h1q +6hr +h1rai +h8rank +h5r6aum +hr1c +hr1c6r +hrcre8 +h1re1d +h3reg +h8r4ei. +h1rer +h4r3er1b +h8re2r1t +h8r1g2 +h1ric +hr5i6ns +h2rom +h2r1t +hr6t5er1l +hr2t1h +hrtr6 +hr6t5ra +hr8tri +h6rum +hr1z +hs3ac8h +h1sam +h6s5a2m1t +h1sc +h1se +h6s5ec +h6s5er1l +hs8erle +h1so +h4sob +h1sp2 +h8sp8aß +hs1pe +h8spel +hs6p2o +hs1pu +h4spun +h1str6 +h1stu +h4s3tum +h1su +hs3u2n1d +h1sü +h5ta. +h5tab +ht3ac +ht1ak +ht3ang +h5tanz +ht1ar +ht1at +h5taub +h1te +h2t1ec +hte1f +h4t3e2ff +h2t3e1he +h4t3e2if +h8teim +h4t3ein +h4t3eis +h6te2mp +h8ten2t1f2 +hte1re +hte8ren +hter1f4 +h6ter1fü +hte8r1g +h8ter1gr4 +h4t3er1h8 +hte2r1s +h6t5ersc +h8terst +h8te1se +h8tess +h2t1eu +h4t3ex +ht1he +ht5hu +h1ti +htr6 +ht5rak +h2ts +hts3ah +ht1sc +ht1se +ht6sex +ht8s1k2 +ht8so +h1tu +h2tz8 +h5tüm +hub5l8 +hu6b5r +huh1l +hu6hr +h5uhr. +hu6ld +huld5a6 +hu1le +hu8lent +hu8lä +h5up. +h1v +h5weib +h3weis +h1z +hä1k +hä8kl8 +hä2l8s +hä1ma +häm6a8tu8 +häsc8h +hä1sche +hä8sche. +hä2t1s +häu4s3c +2hö. +2höe +8höi +hö6s +hös5c +hüh1ne6 +hü2ls +hül4s3t +hü2t1t +hütte8re +ia1d +i5a2d1n6 +i1af +i5ak. +i1al. +i1al1a +i1a2lb +i1a6ld +ia1le +i5alei +i1al1f +i1a2l1g +i3a6l1h +i1a6l1k +i1a6ll +i1a6l1p +i1a8l1r +i1a2ls +i1a2l1t +i1al1v +i5a2l1w +i3alz +i1an. +ia5na +i3a2n1d +ia1n8e +ia8ne8b +i1ang +i3ank +i5ann +i1ant +i1anz +i6a1p2o +i1ar. +ia1ra +ia6rab +i5a2rr +i1as. +i1a2s1m +i1ass +i5a2st. +i1at. +i5a2ts +i1au +ia1z +i5a2z1z +i1be +i6b5eig +i6b5ei1s +ibl8 +ib2le +ib1li +i4blis +i1br +i6b1r2ig +i1bu +i6b5unt +i1bü +i6büb +ic8h +i1che +i6ch5ei +i6cher1b +i1chi +i6ch5i6ns +ich1l6 +i6ch3m +i2ch1n6 +i1cho +i2cht +icht5an +icht3r6 +i1chu +i8ch1w +ic2k +i2c2ks +ickst8 +ick6s5te +ic5l +i1d +id3a6r1m +i1de +3i2deal +ide8na +3i2deol +ide5rö8 +i1di +id2io +i6diot +idr4 +id5rec +i2d1t +ie1a +ie1b +ie1ba +ie6b5ar +ie1be +iebe4s3 +ie2bl8 +ie1b1r +ie8bra +ie4bre +ie8bä +ie1d +ie2dr4 +ie1e8 +ie1f +ie6f5a1d +ie2f5f +ie2f1l +iefr6 +ie4fro +ie2f1t +i1ei +ie1le +ie4l3ec +ie8lei +i1e4lek +i3e6ll +i1en. +i1e2n1d +ie1n6e +i3en1f +i5enn +ien1ne +ien6ne. +i1en1p2 +i1en1r +ie6ns +i5ensa +ien1sta +ien8stal +i5en1v +i1enz +ie5o +ier3a4b +ie4rap +i2e1re +ie4rec +i2erei +ie6r5ein +ie6r5eis +ie1r8er +ie2rn +i3ern. +i2e1ru +ie8rum +ie8ru2n1d +ie1sc +iesc8h +ie6s5che +ie1ta +ie6tau +ie1te +ie8te2r1t +ie5the +ie1tr6 +ie6t5ri +i1e2t1t +ie5un +iex5 +2if +i1fa +if5ang +i6fau +i2ff +if1fr6 +if5lac +if1li +i5f6lie +ifr6 +i1fre +i2ft +ift5a +if6t5r6 +i1ga +ig3a2r1t +2i1ge +ige1s +i8gess +ig5he +i5gla +ign8 +ig2ni +i5go +i1gr4 +i2g3rot +i2gs +ig3s2p2 +i1ha +i8ham +i8ha6ns +i1he +i1hi +ih1n +i6h1r +i1hu +i8hum +ih1w +8i1i +ii2s +ii2t +i1j +i1k +i1ka +i6kak +i8kerz +i6kes +ikl8 +ik4ler +i1ku +i6k5unt +2il +i5lac +i1lag +il3a6ns +i5las +i1lau +il6auf +i1le +ile8h +i8lel +il1f +il2fl +i1li +il2ip +i4l3ipp +i6ll +il1le +il6l5enn +i1lo +i2l1t +ilt8e +i1lu +i1lä +i1ma +i8ma2r1t +i2m1b2 +i1me +i8me1le +i1mi +i8mi1d +i2m1m +im1me +imme6l5a +i1mu +i1mä +i5mö +i1n2ah +ina5he +i1nat +in1au +inau8s +i2n1d +8ind. +in4d3an +in1de +5index +ind2r4 +in1du +3indus +i1ne +i5nec +i2n1ei +i8ner1w +in1f +in1fe +3infek +1in1fo +in1ge +ing8en +5ing2e1ni +in2gs +ing5s6o +in1h +5inhab +i1ni +in6ie +ini5er. +5in1j +in1kä +in8kät +in1na +in8nan +i1no +inoi8d +ino1k +in3o4ku +i6ns +in5sau +in1sp2 +5in1s2pe +ins1ti +5instit +in1str6 +5instru +ins1z +ins4ze +in1te +5inte1re +5inter1v +in3the +in5t2r6 +i5ny +inä2 +i1när +in1äs +inö8 +in5öd +i1nös +2io +io1a8 +io1c +io1d +io1de4 +io2di +ioi8 +i1ol. +i1om. +i1on. +i5on1b2 +i1o6n2s1 +i1ont +i5ops +i5o8p1t +i1or. +i3oral +io3rat +i5orc +i1os. +i1ot. +i1o8x +2ip +i1pa +i1pi +i1p2l8 +i1pr6 +i1q +i1ra +ir1b +ir6bl8 +i1re +i1ri +i6r1m +ir1me +ir8me8d +ir2m1o2 +i2rn +ir1na +ir8nak +i1ro +i2rr +irr1h8 +ir5rho +i2r1s +irsc8h +ir6schl6 +ir6sc6h5r +i5r6us +i5ry +i5rä +i1sa +i1sam +i8sa2m1t +i6sar +i2s1au +isc8h +i1sche +i8scheh +i8s6chei +is6ch5m +isc6h3r +ischä8 +i1se +is8e1le +ise3ra +i4s3er1h8 +is3e2rr +i1si +isi1d +isi6de +i8si2n1d +is1k2 +is1k2o +is4kop +i1so +is2on +iso1n5e +isp2 +is1p2o +is6por +i1stu +i8s5tum +i5s1ty1 +i5sö +i1ta +i4t5ab. +i2t1a2m +i8ta1x +i1te +ite2r1s +i8tersc +i1thi +i1tho +i5t6hr6 +i4t8hä +i1ti +i8ti8d +iti1k +iti6kl8 +i2t1m8 +it1me +itmen4 +i1to +i8tof +itr6 +it3ran +it3rau +i1tri +itr2i5o +i2ts +it1sc +it2se +itsp2 +it5spa +i2t1t +ittr6 +it8tru +i1tu +i2tz +it1ze +it6z5e8r1g +it6z1w8 +i1tä +itä6r5e8 +ität2 +itä2ts5 +i1tü +i1u +iu6r +2i1v +i6va1d +iv2a1ti +iva8tin +i1ve +i8vei +i6v5e1ne +iver1 +i8ver1h8 +i2vob +i8vur +i1w +iwi2 +i5xa +i1xe +i1z +i1ze +ize8n +i1zi +i8zir +i6z5w8 +iä8m +i1ä6r +i5ät. +i5äv +i1ö8 +iü8 +i1ße +i6ß5e2r1s +ja5la +je2t3r6 +6jm +5jo +jo5as +jo1ra +jou6l +j2uc +juc8h +ju5cha +ju1ge +jugen4 +juge2n1d5 +jun2g5s6 +3jä +1ka +kac8h +8ka2chs +8ka2k1z +ka1la +ka6l5d +ka2m5t +ka1na +2k1an5l6 +8kapf +k8a6pl8 +ka5r6a +kar1b +6k3ar1be +ka1ro +kar1p +kar6p5f +ka2r1t +4k3arti +8karz +ka1rä +ka1si +kasi5e +ka1te +ka6te1b +ka2t1t +kat8ta +kau2f6s +kau3t2 +2k1b +2k1c +4k1d +ke6hr +keh2r6s +kehrs5a +8keic +2k1eig +6k5ein +6k5eis +ke1la +ke6lar +ke1le +ke8leis +k4e8lo +8ke2mp +ken1te +k5ente. +k3en2t1f2 +8k5en2t1s +6k1en2t1z +ke1ra +ker1l +k5erlau +2k1f8 +2k1g +2k1h +k2if +ki5fl +8ki1k +kin2g6s5 +6kin1h +k2io +ki5os +ki5sp2 +ki5th +8ki8ö8 +2k1k2 +kl8 +1kla +8klac +kla1ge +k5lag8er +kle1b +kle4br +k3leib +3klei1d +kle5isc +4k3leit +k3lek +k1ler +6k5l6er. +5klet +k1li +2klic +8k3lig +k2lim +k2lin +5kl2ip +5klop +k3lor +1klä +2k1m +k1ma +k3man +kma1ni +kman6i5e +kn8 +k1ne +6kner +k2ni +knä8 +1k2o +ko1a2 +ko1d +ko1de +ko6de. +ko1i +koi8t +ko1mi +ko6min +ko1op +ko1or +ko1ph +ko6pht2 +ko3ra +ko8rd +kor1de +kor6d5er +ko5ru +ko2ts +ko5t6sc +k3ou +3kow +6k5ox +2k1p2 +k1q +1kr8 +4k3ra1d +2k1rec +4k3reic +kre5i1e +2krib +6k1r2ig +2kr2ip +6kro1ba +2ks +k1sa +k6sab +k1sal +ksa2l8s +k1sam +k8sa2m1t +k6san +k1sc +k1se +k2s1ex +ksp2 +k5spat +k5s1pe +k1spi +k8sp2il +ks1p2o +ks6por +k1spr6 +kst8 +k1su +k2s1uf +2k1t +kta8l +kt5a6re +k8tein +kte8re +k2t1h +k8tin1f +ktr6 +k2t3rec +k2t1s +1ku +k2uc +ku1c8h +kuc2k8 +k3u6hr +k6ui +ku5ie +ku2m2s1 +kun1f +kun2ft +kunf2ts5 +ku6n2s +kunst3 +ku1ra +ku8rau +ku4ro +kurz1 +4kus1ti +ku1ta +ku8ß +6k1v +2k1w +ky5n +2k1z +1kä +kä4m +4k3ä1mi +kä1se5 +1kö +kö1c +kö1s +1kü +kü1c +kü2r1s +kür6sc +1la. +8l1a2b1f8 +8la2b1h +la1b2r +2l1a8b1s +lac8h +lac6h3r +la1d +la8dr4 +5la1du +8l1a2d1v +6la2ff +la2f5t +la2gn8 +la1ke +5laken +8la2m1b +la1me +la6mer +la2mp +lam1pe +5lampe. +2l1a2m1t +la1na +1la2n1d +lan4d3a +lan4d3r4 +lan4gr4 +lan1m +8lan1me +6lann +8la8n1w +6lan1ä +8l1ap1pa +lap8p1l8 +lap6pr6 +l8ar. +la5ra +la4r4af +la8rag +la8ran +la6r5a6s +lar1b +l3ar1be +l2a1re +la8rei +la6r1m +6larm. +la8sa +la1sc +la8sta +l2a1t8i +6l5a2t1m8 +4laus3s4 +4l1au1to +1la1w +2lb +l1ba +l8bab +l8bauf +l1be +lbe1d +l8be1de +l1bi +l4b3i6ns +lbl8 +l5blo +l8bs +lb1sta +lbst5an +lbs1t3e +8lc +lc8h +l1che +l8che2r1t +l1chi +l6ch3m +l5cho +l8ch5w +6ld +l1de +l4d3ei +ldr4 +ld1re +l1dü +l6düb +le1b +le2bl8 +le1br +le8bre +lec8h +le2cht +lech2t6s5 +le1d +led2r4 +le1f +6le2ff +le1ga +le4gas +1le6hr +lei6br +le8in1f +8leinn +5lei1stu +le2k1t +4lektr6 +le1le +le1ler +le6l5e2r1s +l4e1mo2 +8le2mp +l8en. +le2n1d +8len2ds +len1du +6lendun +le1ne +l6enen +le8ne2n1d +len8er1w +6l5en2t1s +4l3en2t1w +4l1en2t1z +8len1zy +8leo1z +6le1pi +le6p2ip +8le1p2o +1ler +l6er. +ler1b +8ler8bs +le8rd +6l5er1de +le1re +l2erei +le8reis +le8re2n1d +le4r3er +4l3e8r1g +l8er1gr4 +le6rk +6ler1kl8 +ler1zi +6l5erzie +8lerö8 +le1se +8lesel +le1si +lesi5e +les1k2 +le3s1k2o +le3th6a +le2t1s +5le2uc +4leu1ro +leu4s3t +le5xe +6l1e8x3p2 +l1f +2l1g +l1ge +lge2n1d8 +l8gh +lg1li +lg2lie3 +l3glie1d6 +6l1h +1li +li1ar +li1as +2lic2k +li1d +li8dr4 +li1en +li5en6n +li8e2r1s +li8e2r1t +2ließ +3lig +li1ga +li8ga8b +li1g6n8 +l2il +li1l8a +8li2m1b2 +li1na +li2n1d +4l3in1du +lin2gs5 +4l3in1h +6l5in1j +lin2k4s3 +4lin2k1t +2lint +8lin1v +l2ip +4lipp +5lip1t +li1sa +4li1sam +l2i1v +livi5e +6l1j +6l1k +l8keim +l8kj +lk2l8 +l1k2o +lko8f +lkor8 +l2ks +lk2sa +lk2se +6ll +l1la +ll3a4be +l8la2b1t +ll8an5l6 +l2l1b +l8l1c +l6l1d6 +l1le +l4l3eim +l6l5ei1se +l1ler +ller3a +l4le1ti +l1li +l5l2ip +l1lo +l4l3o2r1t +ll5o1v +l2ls +ll1sp2 +ll6spr6 +l2l1t +llte8 +l1lu +l4l3u8r1g +l1lä +l5lü +l6lüb +2l1m +l1mo +l6m5o6d +6ln +l1na +l1no +8lo1bl8 +lo6br +loc8h +3lo2ch. +lo1fe +l5o4fen +l8o1g +lo1ge +5loge. +5lohn +4l3o6hr +1lo1k +l2on +lo1pe +4l3o4p8er +lo1ra +2l1o8rd +6lo8r1g +4lo2r1t +lo1ru +1los. +l6o1se +lo8sei +lo1si +3losig +lo1v +lo6ve +lo1wi5 +6l1p +lp2f +l1ph +l8pho +l8p1n +l2pst +lp4s3te +l2p1t +l1q +8l1r +2ls +l1sa +l6s1a6r1m +l1sc +l1se +l8sec +l6s5e8r1g +l4s3e2r1s +l8s1h +ls1l +l5s6la +l1sp2 +ls1p2o +ls4por +ls2pu +l1str6 +l1su +l8su1ni +l1sü +2l1t +l6t5a2mp +l4t3ein +l5ten +l6t5eng +l6t5er1p +l4t3hei +lt3her +l2t1ho +l6t5i6b +lt2i1l +ltr6 +l8trö +l2ts +lt1sc +lt1se +lt6s1er +lt4s3o +l1t5u2ms +lu8br +lu1d +lu2dr4 +lu1en8 +8lu8fe +lu2ft +luft3a +luf8tr6 +lu6g5r4 +2luh +l1u6hr +l6ui +lu5it +5l6uk +2l1u2m1f6 +2l1u2m1w +1lun +lu1ni +6l5u6n2io +4l3un1te +lu5ol +4lu8r1g +6lu2r1s +l3u2r1t +lu4sto +lus1tr6 +lu6st5re +lu8su +lu6tal +lu1te +lu6t5e6g +lu8te8r1g +lu3the +lu1to +lu6t5or +lu2t1r6 +lu6ß5 +l1v +l1ve +lver1 +lv2e5r6u8 +2l1w +1ly +lya6 +6ly2m1p2 +ly1no +l1ze +l8zess +l1zo +l8zo8f +lzw8 +l3zwei +lz5wu +3lä2n1d +lä5on +lä6sc +lä2t1s +5läuf +2l1äug +läu6s5c +lä5v +l1öl +1lös +lö1ß6t +6l1ü1b6e2 +1ma +8m1a2b1g2 +mac8h +ma5chan +ma1d2 +ma5el +4ma2g1g +ma1g8n8 +ma1la +ma8lau +ma6l5d +8mal1de +ma1li +mali5e +m8a1lu8 +ma8lut +2m1a2mp +3man +ma2n1d2 +man3ds +8man1gr4 +ma1ni +man2i5o +ma6ns +8m5an1st +6m1ap1pa +mar1b +4m3ar1be +ma6rk +mar8kr8 +ma1r4o +ma2r1s +marsc8h +mar8s6ch2m +3mas +ma1sc +ma1tö +4m5auf +ma5yo +2m1b +m1b6r +2m1c +2m1d +m2ds +md6sä +1me +me1c8h +me5isc +5me6ld +me2ls +mel8sa +8me2mp +me5nal +me2n1d +men4dr4 +me6ns +men1sc +mensc8h +men8schl6 +men8s8chw +men2t1s +8mentsp2 +me1ra +me8r1g +mer4gl +me1ro +3mes +me1se +me6s5ei +me1th +me8ß +2m1f6 +2m1g +2m1h +1mi +mi1a +mi6a1le +m2il +mi1la +2m1i2m1m +mi1na +mi5nü +mi1sa +mi4s3an +mit1h +mitr6 +mi5t6ra +3mi2t1t +mitta8 +mi6ß5 +6mj +2m1k8 +2m1l +2m1m +m1ma +m6ma1d2 +m6m5ak +m1me +m8menth +m8men2t1w +mme6ra +m2m1n8 +m2ms +mm5sp2 +mm5u2ms +mmu2t5s +m8män +m1n8 +m5ni +1mo +mo5ar +mo1d +mo4dr4 +8mof +m8o1g +mo1ga +mo8gal +mo1k +mok2l8 +mo4kla +mo6l5d +m2on +mo2n1d +mon8do +mo1no +mo4n3o1d +m1o6ns +mon2s1tr6 +mon1t8a +6m5ony +mo1pa6 +mo1ra +mo8rd +mor8d5a +mo1sc +mo1sp2 +5mot +moy5 +2mp +m1pa +mpfa6 +mpf3l +m1ph +mphe6 +m1pi +mpin6 +m1pl8 +mp2li +m2plu +m1p2o +mpo8s1te +m1pr6 +mprä5 +mp1t +mp8th +m1pu +mput6 +mpu5ts +m1pö +8m1q +2m1r +2ms +ms5au +m1sc +msc8h +msch4l6 +msp2 +ms6p2o +mspr6 +m3spri +m1str6 +2m1t +mt1ar +m8tein +m2t1h +m2ts +mt6se +mt8sä +mu5e +6m5uh +mu1mi1 +1mun +mu2n1d +mun6dr4 +mu1se +muse5e +mu1ta +2m1v +mvol2 +mvo6ll3 +2m1w +1my +2m1z +mä1k +mä6kl8 +1män +mä1s +mä5tr6 +mäu4s3c +3mäß +mö1b2 +6möl +1mü +5mün +3müt +1na. +n5ab. +8n1a2b1n +n1a8b1s +n1a8b1z +na6bä +na2c +nac8h +na1ch3e +3na2cht +1nae +na5el +n1afr6 +1nag +1n2ah +na8ha +na8ho +1nai +6nair +na1k2o +na4kol +n1a2k1t +nal1a +8na1ly +1na1ma +na1me +na4mer +na1m2n8 +n1a2mp +8n1a2m1t +5nan1c +nan6ce +n1a2n1d +n6and. +2n1ang +1na1ni +1nann +n1a6ns +8na8n1w +5napf. +1n2ar. +na2ra +2n1ar1c +n8a8rd +1n2a1ri +n8a6rk +6n1a6r1m +5n6a2r1s +2n1a2r1t +n8ar1v +6na2t1m8 +na2ts +nat6s5e +1nau1e +4nauf +n3aug +5na6ui +n5a6uk +n6a5um +6n1au2s1b2 +6n1au1to +1na1v +2na1x +3na1z +1n8aß +n1b2 +n1ba +nbau5s +n1c +nc8h +nche5e +n6ch5m +2n1d +nda8d +n2d1ak +n6d5a6ns +n1de +n2d1ei +nde1la +nde8lac +nde2ls +ndel6sa +nder1h8 +n8derhi +nde4se +nde1sta +nde8stal +n2d1j +n2d1n6 +nd1ni6 +ndn6is5 +n1do +n6d5o2r6t +ndr4 +nd3rec +nd3rot +n2ds +nd1sa +nd1sam +nd8sa2m1t +nd6sau +n2dt +ndt1h +n1du +n8du2m1d +1ne +ne5as +ne1b +ne2bl8 +6n5e2b1n +2nec +5ne1ei +ne5en +ne1g4l +2n1egy +4n1ein +8neis +ne1le +4n3e4lem +8ne2m1b +2n1e2mp +nen1a +1ne1ne +6n5e4ne8r1g +nen3k +8nen2t1b2 +4n3en3th +8nen2t1l +8n5en2t1n +8n5en2t1s +ne1ra +ne5r8al +ne8ras +ner1b +8ner1bi +ne8rd +ner1de +6n5erde. +ne1re +n2erei +nere5i6d +ner1f +ner1fo +nerfor6 +ner1h8 +6n5erhö +ner1l +8nerlö +2n1e2rr +ne2r1s +n8ers. +ne2r1t +nertr6 +6n5ertra +2n1erz +ne1si +nesi3e +net1h +neu4ra +neu5sc +8neuß +n1f +n2f5f +nf2l +nfl8e +nflei8 +nf1li +nf5lin +n2ft +nf2ts +nft8st +n1ga +n8g5ac +n6g5d +n1ge +ng8en +nge1ra +nge8ram +n2g1g2 +ng1h +ng1li +n6glic +n1gr4 +ng3r2ip +ng8ru +n2gs +ng2se4 +ng2si +n1gu +n2g1um +n1gy +n1gä +n8gäl +n1h +nhe6r5e +1ni +ni1bl8 +nic8h +ni5chä +ni1d +ni1de +ni8de1e +n6ie +ni1en +nie6s5te +niet5h +ni8e2t1n +n2i1ge +4n3i6gel +n6i1k +n2il +ni1la +2n1i2mp +ni5na +2n1i2n1d +8nin1f +6n5in1h +1ni1ni +ni8nit +6n5inn +2n1i6ns +4n1int +n6is +nis1tr6 +ni1th +ni1tr6 +n1j +n6ji +n1ka +n8ka1d +nk5a6ns +n1ke +nker1l +n8kerla +n1ki +n6k5in1h +nkl8 +n5klö +n1k2n8 +n8k5not +n1kr8 +nk3rot +n8krü +n2ks +nksp2 +nk5s1p2o +n2k1t +nk6t5r6 +n1ku +n8kuh +n1kü +n6küb +n5l6 +n1li +nli4mi +n1m +n1me +nme6n4s +n1na +n1ne +n8ne8r1g +n1ni +nn2i5o +n1no +nn1ta +nn4t3ak +nnt1h +n1nu +nnu1e +n1ny +n1nä +n1nö +n1nü +no5a +no1bl8 +no4b3la +4n3o8bs +2no2b1t +noc8h +no1che8 +no1d +no1di +no6die +no4dis +no8ia +no5isc +no1le +6n5o6le3u +no1ma +no4mal +n8o1ni +non6ie +noni6er +2n1on1k +n1ony +no1pe +4n3o4p8er +6nopf +nop1t +6n1opti +no3ra +n1o4ram +no8rd +nor6da +4n1o8r1g +2n1o2r1t +n6os +no1st +8no2st. +no1ta +no8tan +no1te +no8ter +no1ty1 +noty6pe +6n5ox +n1p2 +n1q +n1r +nrös3 +6ns +n1sac +ns3ang +n1sc +n1se +n8sel1f +n8s5er1f +n8se8r1g +n6se6rk +ns5er1w +n1si +n8sint +nsp2 +n1s2pe +n1spr6 +n1sta +n6s5tat. +n1sto +n6stob +n1str6 +n1ta +n1tag +n4t3a4go +nt5an1h +n2t3a6rk +n2t3a2r1t +n1te +n4t3eis +nte5n6ar +nte1ne +nte8nei +nter3a +nte1re +nt2e6rei +nt1h6a +nt6har +n3ther +nt5hie +n3thus +n1ti +nti1c +n8tin1h +nti1t +n2t1l +ntlo6b +n2t1m8 +nt1me +ntmen8 +n1to +n2t3o4ti +n1tr6 +ntra5f +ntra5ut +nt8rea +n2t3rec +nt8rep +n4t3rin +nt8rop +n4t3rot +n4trü +n2t1s +nts6an +nt2s1k2 +n1tu +n2t1z +n1tä +n1tö +n8töl +n1tü +1nu +nu1a +nu5el +nu5en +4n1u6hr +n6ui +nu5ie +8nu2m1l +6n5u2ms +6n5u2m1w +2n1u2n1d +6nu1ni +6n5un1r +2n1unt +2nup +2nu6r +n5u1ri +nus1k2 +nu3s1kr8 +nu5ta +n1v +8n1w +1nys +n1za +n6z5a6b +n2z1ar +n6zaus +n1zi +nzi4ga +n1zo +n8zof +n1zu +n6z5unt +n1zw8 +n1zwi +n6zwir +1näc +5nä1e +5n6äi +n8äl +nä6m +nä6re +n5ärz +5näus +n1öl +1nöt +n5ö2z +5nü. +6n1ü2b +5nüß +o5ab. +oa2l +o8ala +o1a2m +o1an +o1ba +ob1ac +o1be +obe4ra +o6ber1h8 +5o4be2r1s +o4b2e1ru +obe1se +obe6ser +1ob1j +o1bl8 +o2b1li +o8bs +ob5s1k2 +3ob2st. +ob8sta +obstr6 +obst5re +ob5s1z +oc8h +o1che +oche8b +o8chec +o3chi +och1l6 +o6ch3m +ocho8f +oc6hr +o3chro +o2cht +och3to +o3chu +o8ch1w +o1d +o2d1ag +o2d1d +od2dr4 +o1de +ode5i +ode6n5e +o2dt +od1tr6 +o5e6b +oe1d +oe1de +o5e6der. +oe8du +o1e1f +o1e2l +o1e2p +o1er. +o5e8x +o1fa +o2ff +of1fa +of8fan +1of1fi +of8fin +of6f5la +o5fla +o1fr6 +8o1g +og2n8 +o1ha +o1he +o6h5eis +o1hi +ohl1a +oh1le +oh4l3er +5ohm. +oh2ni +o1ho +o6hr +oh1re +oh1ru +o1hu +oh1w +o1hy +o1hä +o5ia +oi1d +o1id. +o8i1di +oi8dr4 +o5i2ds +oisc8h +o5i8s2ch. +oi1se +oiset6 +o1i2s1m +o3i2st. +o5i6tu +o1j +o1k +ok2l8 +o1kla +ok3lau +o8klä +o2k1t +1okta +o1la +o6ld +old5am +old5r4 +o1le +ole5in +o1le1r +ole3u +o2l1g +ol6gl +o6l1k +ol2k2l8 +ol2k4s1 +o6ll +ol1la +ol8lak +ol8lauf. +ol1le +ol6lel +ol8less +o1lo +o2l1s +ols1te +ol2ster +ol6s1k2 +o1lu +o1ly +oly1e2 +5olym +o1ma +o2mab +o3m6an +o8mau +o2m1b +om1be4 +o1me +o8merz +o2ms +om5sp2 +o1mu +o1mun +o8munt +o1mä +o1mö +o1na +ona8m +o2n1a1x +o1ne +on8ent +o6n5er1b +8o1ni +on6ie +oni5er. +on1k +on1na +on6n5a6b +o1no +ono1c +ono1k +o4no2k1t +1o6ns +on2t1s8 +o1nä +oo8f +1o8o1g +oo2pe +oo2sa +o1pa +o1pe +op8er +3o4pe1ra +opf2l +o3pf1li +opf3lo +opf3r6 +o1pi +o1pl8 +o2p1li +o5p6n +op8pa +op6p1l8 +o1pr6 +op1t +o3p4ter +1opti +o1pä +o5pö +o1q +o1ra. +o3ra1d +o8ra2d1d +1oram +o6rang +o5ras +o8rauf +orc8h +or5cha +o8rd +or1da +or4d3a4m +or1de +or8dei +or8deu +1or2d1n6 +or1do +or4dos +o1re +o5re. +o2re2h +o8r5ein +ore5isc +or6enn +or1f +or8fla +or8f1li +o8r1g +1or1ga +or1ge +5orgel. +or2gl +o1ri +or2ie +ori1en +5o6rient +o2rn +or1na +or8nan +or8nä +o1ro +o2rr +or1r2h8 +o2r1t +or6t5an +or8tau +or8te1re +o1r6us +o1ry +o1rä +or1ü2 +o1sa +o1sa3i +6o1se +o8se6rk +o1s1k2 +o6ske +o6ski +os2kl8 +os2k2o +os2kr8 +os1n +os1ni +osn6i5e +o1so +o2s1o2d +osp2 +os1pe +o3s4p8er +o1sta +o4stam +o6stau +ostr6 +o3stra +ost3re +o1su6 +o6s5ur +os1z +o5s6ze +o1ta +ot3auf +o6taus +o1te +o6ter1w +o1th +othe5u +o2t6h1r6 +o1ti +o1to +oto1a +otr6 +ot1re +o1tri +o1tro +o2ts +ot1sc +o3t1su +o2t1t +ot6t5e8r1g +ot2t3h +ot2t5r6 +ot8tö +o1tu +ou3e +ouf1 +ou5f6l +o5u6gr4 +o6ui +ou5ie +ou1ra +ou6rar +ou1t6a +o1v +o1wa +o1we +o6wer. +o1wi +o1wi1d6 +o1wo +o5wu +o1xe +oy5al. +oy1e +oy1i +o5yo +o1z +oza2r +o1ze +1o2zea +o1zo +ozo3is +oö8 +o1ße +oß5e2l1t +oß1t +3paa +pa6ce +5pa1d +pag2 +1pak +pa1la +pa8na8t +pa1ni +pan6ie +pani5el +pa1no +pa4nor +pa6n1s2 +1pap +pap8s +p2a1re +pa8rei +pa6rk +par8kr8 +par2o8n +par5o6ti +pa2r1t +part8e +5p8ar5tei +3par2t1n +pa2s1se +pas6sep +pa1th +pa4th6a +1pau +6paug +pau3sc +p1b +8p5c +4p1d +1pe +4peic +pe5isc +2pek +pen3k +pen8to8 +p8er +pe1ra +pe1re6 +per5ea +per5e1b +pe4rem +2pe2rr +per1ra +per8ran +3pe2r1s +4per1si +pe3rü +pe4sta +pe2t2s +p1fe +p2f1ec +p4fei +p2f1f +pf2l +5pf8lanz +pfl8e +pf8leg +pf3lei +2p2ft +pf3ta +p1g +1ph +2ph. +2p1haf +6ph1b2 +8ph1d +6p5heit +ph5e1me +6ph1g +phi6e +8ph1k2 +6phn +p5ho6ll +pht2 +ph3th6a +4ph3t1he +phu6 +6ph1z +pi1en +pi5e2rr +p2il +pi1la +pi1na +pi6ns +5pin1se +p2io +pi8o1ni +pion6i8e +1pis +pi1s2k2 +pi1th +p1k +pl8 +5pla +p2lau +4plei +p3lein +2p1ler +6p5les +p1li +2p3lig +p6li1k +6p5ling +p2li1z +plo1mi +plo8min +6p1m +p1n +1p2o +8poh +5pol +po1la +po8lan +po1ly1 +po3ny +po1ra +2po2rn +po2r1t +por4t3h +po5rö +5po1ti +p1pa +p1pe +p6p5ei +ppe6la +pp5f +p2p1h +p1pi +pp1l8 +ppp6 +ppr6 +pp5ren +pp1s +p2pst +pp2s1te +p5pö +pr6 +3preis +1pres +2p3r2ig +5prinz +1prob +1pro1d +5pr8o1g +pro8p1t +pro6t5a +pro1te +prote5i +8proß +prä3l +1präs +prä1te4 +1prüf +psc8h +p5schl6 +2pst +1p2sy +p1t +p8to8d +p2t1s +5p6ty1 +1pu +pu1b2 +2p2uc +pu1d +pu2dr4 +pu2ff +puf8fr6 +6p5uh +pu6n8s +pu1re +pu8rei +pu5s6h +pu1ta +p1v +p3w +5py +py5l +p1z +pä1de +pä6der +p5ä6m +pä8nu +8pär +pät5h +pä2t1s +qu6 +1q6ui +8ra2b1k2 +ra1bl8 +ra6b1la +3rable +ra2br +r1a2b1t +6ra8b1z +ra1d +ra4dan +ra2dr4 +r8afa +5ra3fal +ra1fe +ra4f3er +ra5gla +ra2g3n8 +6ra1ha +ral5am +5ra6ld +4ra2l1g +ra1li +ra8li6ns +2ra6ll +ra2l5t +ra1me +8ramei +r3anal +r6a2n1d +ran1de +ran8der +ran4dr4 +8ran1f +6ran1ga +5ran1gi +ran8g1li +r3an1gr4 +ra6ns +ransp2 +rans5pa +8ra8n1w +r8anz. +ra5or +6rapf +r8a5pl8 +rap1se +rap6s5er +2r1ar1b +1rar1h8 +r1a6r1m +ra5ro +2r1a2r1t +6r1arz +ra1te +ra8tei +ra1th +ra6t5he +6ra2t1l +r4a1tr6 +ra4t3ro +ra2t1t +r5atta +rau1e +raue4n +6raus. +r5au4sta +rau1te +rau8tel +rau2t5s +ray1 +r1b +rbl8 +rb5lass +r6b1ler +rb1li +rb4lie +r1bo +rbon6n +r1br +rbrec8h +r8bre2cht +r8bs +rb6s5tä +r1ce +r8ces +rc8h +r1che +rch1l6 +r6ch3m +rc6hr +rch3re +r2cht +rch3tr6 +r8ch1w +8rd +r1da +r1dac +rdac8h +r8da2chs +r8d1ap +rda5ro +r1de +rde5i6ns +r1di +rd2io5 +r8dir +r1do +rd3ost +r1dr4 +r8drau +1re. +re1ak +3re1a2k1t +re3a2ls +re1am +re6am. +re1as +re1b +re1be +4reben +re6bl8 +rec8h +rech5a +re1d +r8e1di +re3er +re1f +8re2ff +3refl +2reh +5re1ha +r4ei. +reic8h +rei2ch6s5 +rei1e +8reier +6r1eign8 +re5i2mp +4r3ein1a4 +6r3ein1b2 +6rein1g +6r5einn +6rein1r +4r3ei6ns +r3eint +re1li +reli3e +8r5e2l1t +re2mp +6r1emp1f +2re2m1t +ren5a6b +ren8gl +r3en1ni +1re1no +5ren1te +4r3enth +8ren2t1l +4r3en2t1w +8r1en2t1z +ren4zw8 +re1on +re1q +requ6 +re1q6ui5 +1rer +rer1b +rer4bl8 +6rer8bs +4r3e8rd +rer1h8 +8rerhö +re6rk +8rer1kl8 +rer1l +4r3erla +8rerlö +re2rn +4r3er6ns +6r5er1nä +rer5o +re2rr +rer1re +6r5erreg +re2r1t +r5ertr6 +rer1w +r5erwec +r5erö8 +re2sa +re1sc +resc8h +re8s6ch2m +2ress +re5u8ni +re1w +6rewo +2r1ex +r1f +r1fe +r8fe8rd +rf1li +rf4lie +8r1g +r1ga +r8gah +r1ge +rge1b +rge4bl8 +rge5na +rge1s +rgest4 +rgn8 +rg6ne +r2g1ni2 +r1go +r8gob +r1gr4 +r4g3ret +r2gs +rg1se +rg8sel +r1h8 +r2hy +5rhy1t +ri1ar +ric8h +ri5cha +ri1d +ri2d2g +r2ie +rie2g4s5 +ri8ei +ri1el +ri6e1le +ri1en +ri3er. +rie2r1s +ri5ers. +r2if +ri1fa +ri6fan +ri1fe +ri8fer +ri8fr6 +1r2ig +ri1k +ri8kn8 +r2il +ri5la +ri1mä8 +ri1na +ri2n1d +r8in1de +rin4ga +rin6gr4 +1rinn +rin1ne +6rinner +ri1no1 +ri6ns +r8in1sp2 +4rinst +ri1nä2 +r2io +rio1c +ri5o6c8h +ri1o2d +ri3o6st +2r1ir +r2is +ris1k2 +ri3s1k2o +risp2 +ri8spr6 +ri5s1v +r2it +ri1ta +6r5i6tal +ri5tr6 +r2i1v +ri1ve +ri6ve. +8r1j +6rk +r1ke +rke6hr +rkeh2r6s5 +r1ki +rkl8 +rk1li +r3k2lin +r1k2n8 +r2ks +rkst8 +rk3str6 +r2k1t +rk4t3an +rk6to +r1ku +r6kuh +r1kä +rkä4s3t +r1l +r5li +rli1ne +rline5a +6r1m +r1ma +r3man +r6m1an5l6 +rma4p +r4m3a1ph +r1mi +r8min1f +r1mo +r8mob +r2ms +rm5sa +2rn +r1na +rna8be +r5ne +rn2ei +r6ne2if +r6nex +r6n1h +rn1k +r1no +r6n5oc +r6ns +rn1sp2 +r1nä +r1nü +ro1be +ro6be2rn +6ro8bs +ro1c8h +roc2k +3ro2ck. +ro1d +ro5de +ro1e +4ro1fe +ro1he +ro8he2r1t +1ro6hr +ro5i1d +ro1in +ro5isc +ro1ly +6r5olym +r2on +6r1o8o1g +ro1ph +ro6phan +r3o2r1t +ro1s2p2 +ro5s6w +ro1ta +ro4tau +ro1tr6 +ro6ts +5rout +r1p +r1pe +rp8er +rpe8re6 +rp2f +r2ps +r2p1t +r1q +2rr +r1ra +r1re +r1rer6 +rr1h8 +rr6hos +r5rhö +r1ri +r1ro +rro8f +rr8or +rror5a +r1ru +r3ry +r1rä +r1rö +r1rü +2r1s +r2s1te +r2s1ti +r6sab +r4san1f +r1se +rse6e +rse5na +r2s1h +rs1k2 +r6s1ka +r6ski +rs2kl8 +r8s1k2o +r2s1l +rs2p2 +r1sta +r6stauf +r8ster1w +rstr6 +r8stran +r2s1w +rs1wi3d4 +r2s1z +2r1t +2r2t3a2r1t +r8taut +r5tei +rt5e2i1ge +r8te1pe +r4t3er1h8 +rter1l +r8terla +r4t3hei +r5t6hu +r4t3int +rtr6 +r4t5re2if +r2ts +rt1sc +rt1se +rt6s1er +rt6s5o +rt6s5u +r6t5u2n1d +2r8tu2r1t +ru1be6 +ru1en +1r4uf +ru2fs +ruf4st +r6ui +ru1ie +2r1u2m1g +2r1u2m1l +2ru2ms +ru2n1d +run1de +run8der +run4d5r4 +6run2d1z +6run1f +8ru6ns +2r1unt +2r1ur +r6us +ru6sta +rus1tr6 +ru6tr6 +1ru2ts +r1v +r1ve +rven1 +rvi2c +r1w +r1x +r1za +rz5ac +r6z5al +r8z1ar +r1ze +r8ze8rd +r6z5er1f +rz8er1h8 +r2z1t +rz4t3h +r1zu +r8zum +rä4s1te +räu8sc +r1öf +5rö6hr +rö5le +3rö6ll +rö1mi +5römis +r1ör +rö2sc +3rü2mp +1sa. +1saa +sa1be +s3a4ben +sa2bl8 +2s1a8b1s +6s1a2b1t +6s1a2b1w +sac2k +3sa2ck. +sa1d +sa1de +6s3a4der +1saf +s8a1fa +4s1a2ff +sa5fr6 +1sag +1sai +sa1i2k1 +4s1a2k1t +1sal +sa1la +sa6l1p +4s3alpi +sa2l1t +6salter +salz3a +1sam +s5an1b2 +san2c +1sa2n1d +san1ge +s5angeh +6s1an5l6 +2s1a6ns +6s3an1tr6 +8s1a8n1w +s1ap +s6a1ph +8sa1p2o +sap5p6 +s8ar. +2s1ar1b +3sa8r1g +s1a6r1m +sa5ro +2s1a2r1t +6s1arz +1sas +1sat +s8a1t8a +2s1a2t1l +sa1to +sa8tom +3s8au1e +s5au2ff +sa6u5i +s6aur +2s1aus +5s6au1se +2s1b2 +2s1ca +s4ce +sc8h +8s2ch. +3scha. +scha1d +5scha1de +3schaf +3schal +sch5a1me +8schan1c +8s6ch1b2 +1sche +6s1che1f +8schex +2s6ch1f2 +2sch1g +2s4ch1h +1schi +2sch1k2 +schl6 +5schlag +5schlu +s6ch2m +6sch3mäß +s2chn6 +6sch1n8aß +1scho +6scho8rd +6s6ch1p +sc6hr +3schri +8sch1ric +8sch1r2ig +8schrou +6s2chs +2s2cht +sch3ta +sch3tr6 +1schu +8s6ch3unt +6sch1v +2sch1z +5schö +5schü +2s1c8o +s1c6r +scre6 +6s1cu +2s1d +1se +se5an +se1ap +se1b +se1be +se6ben +se5ec +se1ei +see5i6g +se3er1l +se1f +8se2ff +se1ha +se6han +se8hi +se8hö +sei1d +6s5eid. +2s1eig +s8e2il +5sein. +sei5n6e +6s5ein1h +3s8eit +3sel. +se1la +se4lar +se2lb4 +se1le +6s3e4lem +se1ler +se8ler1l +2s1e2mp +sen3a2c +se1ne +se5nec +6s5en2t1s +4s1en2t1z +s8er. +se1re +s2erei +se8reim +s2e1ri +se1r5inn +se6r1m +8sermä +8s5er1zi +serö8 +6ser1öf +se1um +8sexa +6s1e8x3p2 +2s1f2 +sfa6ll +sfal1le +sfal8ler +2s3g2 +s1ge +sge5b2 +s1h +s8he1w +5s6h2ip +5s4hop +1si +2siat +si1b +sic8h +si2cht +sich2t6s +si1d +si1de +6s5i6de1e +sie1ge +siege6s5 +si1en +si5e2rr +s2i1f2 +si1g2n8 +si6g5r4 +si1k +si1ka +si8kau +sik1i +si4kin +si2kl8 +si8kü +s2il +si1la +si2lb +sil6br +si1na +2s1in1f +sin5g1h +2s1in1h +sin1ne +sinne6s5 +2s1i6ns +si5ru +si5str6 +4s1j +s1k2 +6sk. +s1ka +2skau +ske8l6c +skelc8h5 +s6ke1le +1s2ki. +3s4kin. +s6ki1z +s8kj +6skn8 +s1k2o +2s3kow +s1kr8 +3s2krib +3s2kr2ip +2s1ku +8s1kü +s1l +s8lal +slei3t +s4low +2s1m +s1n +6sna +6snot +1so +so1c8h +so1d +2s1o1do +so4dor +so1fe +6s5o4fen +so1lo3 +s2on +so5o8f +4so1pe +so1ra +2s1o8rd +so8r1g +4s1or1ga +so2u5c +so3un +4s3ox +sp2 +8s3paa +5spal +1span +2s1pap +s1pe +s2pec +s4peis +1s2pek +sp8er +s6pe8r1g +4s3pe2r1s +s6pes +2s1pf +s1ph +8sphi +1s2phä +1spi +spi4e +6s5pig +spi6ns +6s5pin1se +2s1pis +spl8 +2s5pla +s1p2o +2s5pol +5s6pom +6s5pos +6s5po1ti +spr6 +1spra +3s8prec +6s3preis +5spring +6s1prob +1spru +s1pu +s2pul +1s2pur +6s5py +5spän +1spü +s1q +2s1r +2ssa +2s1se +2s1si +2s1so +2s1sä +2ssö +2ssü +2s1sc8h +sse8nu +ssi1ni +ssin6i6s +ssoi6r +2st. +1sta +4s1ta1fe4 +2s1tag +sta3la +6s1ta1le +4s2ta2l1g +8sta6l1k +8s2t1a2m1t +6st5an1f +4st3a6ns +6st5a8n1w +6star1b +sta4te +6staus +2s2t1b2 +6s2t1c +6s2t1d +s1te +4s1te2il +3s2tep +6s5tep1pi +8ste2s1se +6s2t1f2 +2s2t1g2 +2sth +st1h6a +st3hei +s8t1hi +st1ho +st5hu +s1ti +s2ti4el +4s2ti2g1m +6s2t1i2n1d +4s2tin1f +s2ti8r +2s2t1k2 +2s2t1l +2s2t1m8 +1sto +sto6ll +6s5toll. +4st3o1pe +6s5topf. +6sto8rd +6s2t1p2 +str6 +4s1trai +s3tral +6s5tr6aum +3str8aß +3s2trec +6s3tre1f +8s3treib +5s4tre2if +6st1re1no +6stres +6st3re1v +2s2t5r2ig +8s2t1r2is +s8tro1ma +st5r6o1se +4st1r4uf +3strum +6s1träg +2s2t1s6 +2s2t1t +1stu +stu5a +4s1t2uc +2s1tu1e +8stun. +2s2t1v +2s2t1w +s1ty1 +s2tyl +6s2tz +1stä +8s5täg +1stö +1stü +8s5tüc8h +4s1tür. +1su +su2b1 +3s2uc +su1e +su2fe +su1ma +su8mar +su2m1f6 +6sumfa +8su2m1k8 +2s1unt +sup1p2 +su1ra +6s5u6ran +su2r1t +6surte +2s1v +2s1w +1sy +8syl. +sy5la +syn1 +sy2na +sy1ne4 +s1z +s1ze +s4ze2n1d +sze1ne +5s6z4ene. +8s1zu +1sä +6s5ä2n1d +s1äug +6säu1gi +6s1äuß +5söm +2s1ü2b +1süc +sü8di +1sün +5süß +taa2t2s3 +4tab. +t6a1ba +taba6k +ta8ban +ta1b2l8 +ta1br +ta6b1re +4ta8b1s +t3ab1sc +8ta8b1z +tac8h +6t3a2cht +ta1d +ta1de +ta6der +6tadr4 +ta2d6s +ta2d2t1 +1ta1fe4 +1tag +ta6ga6 +ta1ge +ta8gei +tage4s +ta2gs +tag6s5t +tah8 +tahl3 +tai1ne +tai6ne. +ta5ir. +ta2k1t +tak8ta +tal3au +1ta1le +ta8leng +ta1ler +ta6l5e2r1t +ta1me +6t5a6mer +6ta2mp +tam1pe6 +2t1a2m1t +ta2n1d +tan5d6a +tan8dr4 +tan2ds +tand1s5a +ta1ni +tan6i5e +6t1an5l6 +2t1an1r +t3a6ns +8t5an1tr6 +ta1nu6 +t5a8n1w +8tanwa +tan8zw8 +ta1ra +ta8rau +tar1b +6tar1be +1t2a1ri +2ta6rk +2t1a6r1m +ta1ro +2ta2r1t +t3arti +6tarz +ta1sc +ta1si +ta6si1en +tas1te +ta8stem +ta8s1to +t5au2f1b2 +4t1au2f1n +8taus. +5tau1se +8t1au2s1f2 +6t1au2s3g2 +t5au8s1l +2t1b2 +2t1c +tc8h +t6chu +2t1d +te2am +tea4s +te1b +te1be +te8ben +tec8h +5t8e2ch3n6 +te1f +4te2ff +te1gr4 +te4g3re +te1ha +te6hau +2te1he +te4hel +2t1e6hr +tei1d +te5id. +teig5l +6t1eign8 +tei8gr4 +1te2il +4tein1h +t5einhe +4teis +tei1se +t5eisen +8tei1w +te1la +te8lam +te4lar +te1le +4t1elek +8telem +te1ma +te6man +te6n5ag +te1ne +ten8er1w +ten5k +te6ns +ten1s4p2 +ten1tr6 +ten8tro +4t3en2t1w +8t1en2t1z +te1pl8 +te6p1li +5tep1pi +ter5a6b +te3ral +ter5au +ter1b +ter1ba +8terbar +ter1be +t5erbe. +6terben +8ter8bs +4t3er2b1t +te8rd +ter1de +t5erde. +te1re +tere1b +ter5e1be +t2erei +ter5ein +te1rer +te8re2r1s +ter1f4 +ter1h8 +8terhö +te6rk +ter1kl8 +6t3er1klä +te2rn +ter1no +ter8nor +te2rr +ter1re +ter6re. +te2r1s +tersc8h4 +t8erscha +te1se +t5e6sel +te2s1ta +te8stau +t3eu1ro +te1xa +tex3e +8t1e8x3p2 +te8x1t +tex6ta +2t1f2 +2t1g2 +2th. +th6a +5tha. +2t1haa +6t1hab +6t5haf +t5hah +8thak +3t2hal. +6tha2ls +6t3ha2n1d +2t1hau +1the. +3t4hea +t1he1b +t5he2il +t3heit +t3hel1f +1t8heo +5t4he1rap +5ther1f +6t5herz +1thes +1thet +5thi. +2t1h2il +t3him +8thir +3this +t5h1j +2th1l +2th1m +th1n +t5hob +t5hof +4t1holz +thop1t +6th1opti +1t6hr6 +4ths +t1hum +1thy +4t1hä +2t1hö +t1hü +ti1a2m +ti1b +tie1f +tie1fe +tie6fer +ti1en +t2i1ge +ti8gerz +tig3l +ti1k +ti8kin +t2il +ti5lat +1ti2l1g +t1i2n1d +tin4k3l8 +tisp2 +ti3spa +ti5str6 +5ti1te +ti5tr6 +t2i1v +ti1ve +ti8vel +ti8vr +2t1j +2t1k2 +2t1l +tl8a +2t1m8 +2t1n +3to1be +8t1ob1j +toc8h +to3cha +5to2cht +8toc2k +to1d +to1de4 +to8del +to8du +to1e +to1fe +6t5o6fen +to1in +toi6r +to6ll +5toll. +to1me +to8me1ne +t2o6ns +2t1ony +to1pe +to4p8er +5topf. +6top1t +to1ra +to1s +to2s1te +to1s1k2 +to6s1ka +tos2l +2to1ti +to1tr6 +t8ou +2t1p2 +6t1q +tr6 +trac8h +tra5cha +tr8afa +tra8far +tra2f5t +1trag +tra6gl +tra6gr4 +t3rahm +1trai +t6ra6ns +tra3sc +tra6st +3trau1e +t4re. +2trec +t3rec8h +t8rec2k +6t1re1d +t8ree +4t1reg +3treib +4tre2if +8t3reis +8tre1p2o +tr6e6t5r6 +t3re1v +4t3re1z +1trib +t6ric2k +tr2ie +tri6er +2t1r2ig +t8rink +tr2io +tri6o5d +tri1z +tri1zi5 +tro1a +3troc +troc2k +trocke6 +tro5i8d +tro1ma +tro3m6an +tro8man. +tr2on +tro3ny +5tropf +6t5ro1sa +t5roß +5trub +5trup +trut5 +1träg +6t1röh +5trüb +tr5ü3bu +t1rüc +t1rüs +2ts +ts1ab +t1sac +tsa8d +ts1ak +t1sal +t6s5a2l1t +ts1an +ts1ar +ts3auf +tsc8h +t3sc6hr +t5schä +t1se +tse6e +tse1e5i +tsei6n6s +ts3ent +ts1er +t8ser1f +t4se6rk +t8s1h +t1si +5t6si1k +t4s3int +t1so +tso2r1t +ts5ort. +tsp2 +ts1p2o +t5s6por +tspr6 +t6sprei +t1st +t2s1te +t1sta +t6s5tanz +t2s1th +ts1ti +t6stit +t1sto +t4s3tor +t1su +1t2sua +t2s1uf +t8sum. +t2s1u8n +t2s1ur +2t1t +tt5e2if +tte6sa +tt1h6a +ttr6 +tt8ret +t2ts +tt1sc +tt1se +tt8s1er +tt5s6z +1t2uc +tuc8h +tuch5a +1tu1e +6tuh +t5u6hr +t6u1i +tu6it +1tu2m1h +6t5u2m1r +1tu2ms +8tu2m1t +6tu2n1d +6tun1f +2t1unt +tu5ra +tu6rau +tu1re +tu6re. +tu4r3er +2t1v +2t1w +1ty1 +ty6a +ty8la +8tym +6ty6o +2tz +tz5al +tz1an +tz1ar +t1ze +t8zec +tzeh6 +tzehn5 +t6z5ei. +t1zo +t6zor +t1zu +t4z3um +t1zä +t6zäu +5täg +6täh +t5ä2l1t +t8än +tä1re8 +8tä8st +6t1äuß +tö2ff +töf5fe +t5öffen +8tö8k +1tön +4tüb +tü1b6e2 +t3ü4ber1 +t6ü5b8er. +5tüc8h +1tür. +u3al. +u5a2lb +u5al1f +u3a6l1h +u5a6l1k +u3a6l1p +u3an. +ua5na +u3a2n1d +u5a6ns +u5ar. +ua6th +u1au +ua1y +u1ba +u2bab +u1bi +ub6ie +ubi5er. +u1br +u6b5r2it +u8bs +ubs2k2 +u5bö +u1bü +u8büb +2uc +uc8h +u1che +u6ch5ec +u1chi +uch1l6 +u6ch3m +u2ch5n6 +uc6h1r +u2cht +uch5to +uchtr6 +ucht5re +u1chu +u8ch1w +uc2k +uc1k1a +uck5in +u1d +ud4a +u1ei +u6e1la +ue1ne8 +u6ep +u1er +uer1a +ue1re +ue1rer +ue8rer1l +uer5o +u8e1sc +u2est +u8e1v +u1fa +u1fe +u2f1ei +u4f3ent +u8fer1h8 +u2ff +uf1fr6 +uf1l +ufr6 +uf1ra +uf1re +uf1rä +uf1rü +u2fs +uf1s2p2 +uf1st +u2ft +uf2t1s +u1ga +u8ga2b1t +u8ga1d +u6gap +u1ge +uge1b8 +u8gn8 +u1go +ugo3s4 +u1ha +u1he +u1hi +uh1le +u1ho +u6hr +uh1re +u1hu +uh1w +u1hä +u1hö +6ui +ui5en +u1ig +u3i6ns +uin1te +uin8tes +uisc8h +u5i8s2ch. +u1j +6uk +u1ke +u1ki +u1kl8 +u8klu +u1k6n8 +u5ky +u1la +u6ld +ul2ds +uld8se +u1le +u6ll +ul1la +ul8lac +ul6lau +ul1le +ul6le6l +ul6lo +u6ln +ul1ni8 +u1lo +ulo6i +u2l1t +ult6a +ult8e +u1lu +ul1v +ul2vr +u1lä +u1lö +u2m1f6 +3umfan +u2m1l +5umlau +u1mo +u8mo8f +u2mp +um1ph +um8pho +u1mu +umu8s +u5mö +u1n1a +un2al +un6at +unau2 +u2n1d +6und. +un1de +un2d1ei +5undein +un1du +un4d3um +un2d1z +3undzw8 +un1dü8 +un8düb +u1ne +une2b +u2n1ec +une2h +u8n3eis +un1f +3unfal +1un1fä +un1ge +5unge1a2 +3un1glü +un2g2s1 +un8gä +u1ni +1u2n2if +un4it +un1kr8 +un8kro +un2k5s +u1no +un1p2 +unpa2 +u6ns +uns2p2 +un1v +unvol4 +unvo6ll5 +u5os. +u1pa +u1pi +u1p2l8 +u1pr6 +u2p4s3t +up1t +up2t1a +u1q +u1ra +ur5a8b1s +ura8d +ur5ah +u6rak +ur3a2l5t +u6rana +u6r5a6ns +u8rap +ur5a6ri +u8ra2t1t +u1re +ur3eig +u8r1g +ur1gr4 +ur8gri +u1ri +ur5i6ns +ur1l +3urlau +u6r1m +ur1me +urmen6 +u2rn +ur1na +ur8nan +u1ro +u2r1s +3ursac +ur8sau +ur1se +ur8sei +ur4s1k2 +u2r1t +3ur5tei +u1ru +ur6u5i6 +u2r1u6r +u1ry +ur2za +ur6zä +ur5ä6m +u5rö +u1rü +urü8c2k3 +u1sa +u1sag +usa4gi +u2s1ar +u2s1au +usc8h +u1sche +u8schec +us8chw +usch5wi +u1se +u2s1ei +use1ke +use8kel +u8s1l +u1sta +u4st3a4b +us3tau +u1su +u2s1uf +u8su2rn +ut1ac +u1tal +uta8m +u1tan +ut1ar +u1tas +ut1au +u1te +u8teic +u4tent +u8ter1f4 +ut2e1ri +u6terin +u4t3hei +ut5ho +ut1hu +u1ti +uti1ne5 +uti6q +u1to +uto5c +u1tr6 +u2ts +ut1sa +ut1s6p2 +ut1st +utstr6 +ut6stro +u1tu +u2tz +utz5w8 +u1u +u1v +u1ve +uve5n +uver1 +uve3r4ä +u1w +u1xe +u5ya +uy5e6 +u1yi +u1ze +u2z1eh +u8zer1h8 +u5ö +u1ße +uße6n +uße1n5e +8van1b2 +6vang +6var1b +va8r8d +v8a6t5a +va1te +va8tei +v4a2t1r6 +2v1b +6v5c +6vd +1ve +6ve5g6 +ver1 +ver5b +verb8l8 +ve2re2 +ve8r1g8 +v2e2ru8 +ve1s +ve2s3p2 +ve3xe +2v1f +2v1g +6v5h +vi6el +vie6w5 +vi1g4 +v2il +vi1le +vi8le8h +vi6ll +vil1le +vil6le. +8vint +vi1ru +vi1tr6 +2v1k +2v1l +2v1m +4v5n +8vo8f +vo2il +voi6le +vo6ll +vol1le +vol8le2n1d +vol8li +v2or1 +vo2re +vo1ri +vo8rin +vo2ro +2v1p +8vra +v6re +2v2s +2v1t +2v1v +4v3w +2v1z +wa2ff +waf5fe8 +wa6g5n8 +1wah +wah8n +wa5la +wa6ld +wal1di +wal8din +wa2l1t +wal6ta +wa2n1d +wan4dr4 +5w2a1re +wa8ru +war4za +1was +w5c +w1d +5wec8h +we1f +we6fl +1weg +we1ge +we8geng +weg5h +weg3l +we2g1r4 +we6hr +weh1re +weh6r5er +5wei1se +weit3r6 +we2l2t +welt3r6 +we6rat +8wer1c +we8rd +5wer1du +wer1f +wer4fl +we6rk +5werk. +wer4ka +wer8ku +we2r1t +wer4ta +wer8te6r1m +we2sp2 +wes1te +we8s4te2n1d +we8str6 +we8stö +we2t1t +wet8ta +wic8h +wi2chs +wich6s5t +1wi1d +wi2dr4 +wie1d +wie1de4 +wieder5 +wi1k6 +wi2m1m +wim6ma +wi2n1d +win4d3r4 +5wi2r1t +wisc8h +wisch5l6 +1wj +6wk +2w1l +8w1n +wo1c +woc8h +wo1che6 +wol6f +wo2r1t +wor6t5r6 +6ws2 +w1s1k2 +6w5t +wu2n1d +wun1de +5wunde. +wun6gr4 +wu1sc +wu2t1 +6w5w +wy5a +wä6r1m +wär1me5 +wä1sc +1xag +x1ak +xa1me +x3a4men +8xa2m1t +x1an +8x1b +x1c +1xe. +x3e4g +1xen +xe1ro +x1erz +1xes +8xf +x1g +8x1h +1xi +8xi1d +xi8so +4xis1te +x1k +6x1l +x1m +8xn +1xo +8x5o6d +8x3p2 +x1r +x1s6 +8x1t +x6tak +x8ter1f4 +x2t1h +1xu +xu1e +x5ul +6x3w +x1z +5ya. +y5an. +y5ank +y1b +y1c +yc8h +y6cha +y4chia +y1d +yen6n +y5e2rn +y1g +y5h +y5in +y1j +y1k2 +y1lak +yl1al +yla8m +y5la1x +y1le +y1lo +y5lu +y8m1n8 +y2m1p2 +y3mu +y1na +yno2d +yn1t +y1on. +y1o4p +y5ou +y1p2o1 +y1pr6 +y8ps +y1r +yr2i3e +y2r1r2 +y1si +y2s5iat +ys8ty1 +y1t +y3w +y1z +yä8m +z5a6b +za1b5l8 +8za6d +1zah +za5is +4z3ak +6z1am +zan1ge +5zange. +8z1an5l6 +2z1a1ra +6z5as +z5auf +3zaun +2z1b +6z1c +6z1d +1ze +ze1d +ze1di +ze4di1k +ze1f +4z3e2ff +8zein +zei4ta +zei1te +zei8te2r1s +ze6la +ze1le +ze8lec +ze2l1t +zel8th +4ze2mp +zen1ge +6z5engel +zen1zi +zen8zin +ze8r1g +8zer1gä +z2e1r8i +ze1ro +ze2r1s8 +ze2r1t +zerta8 +zer8tab +zer8tag +8zerz +ze8s1te +zeu6gr4 +2z1ex +2z1f8 +z1g +4z1h +1zi +zi1en +zi5es. +4z3i2mp +zi1na +6z5in1f +6z5in1ni +zi6ns +zin1se +zin6s5er +zin1su +8zinsuf +zist5r6 +zi5th +zi1tr6 +6z1j +2z1k +2z1l +2z1m +6z1n +1zo +z8o1g +zo6gl +4z3oh +zo1on +zo2rn +zor6na8 +4z1p +z5q +6z1r +2z1s8 +2z1t +z4t3e2n1d +z4t3hei +z8thi +1zu +zu3al +zu1b4 +zu1f2 +6z5u6hr +zu1n2a +zu1ne +8zunem +zun1f8 +8zungl +zu1o +zup8fi +zu1s8 +zu1z +2z1v +zw8 +z1wal +5zwec2k +zwei3s +z1wel +z1wer +z6we8r1g +8z5wes +1zwi +zwi1s +6z1wo +1zy +2z1z +zz8a +z1zi +zzi1s +1zä +1zö +6z1öl. +zö1le +1zü +2z1ü2b +ä1a6 +äb1l8 +äc8h +ä1che +ä3chi +ä2chs +äch8sc +äch8sp2 +ä5chu +äc2k +äc1k5a +äd1a +ä1de +äd5era +ä1di +ä6d5ia +ä1e +ä5fa +äf1l +ä2ft +äf2t6s +äg1h +äg3le +ägn8 +ä1gna +ä6g5nan +ä2gs +äg5str6 +ä1he +ä1hi +äh1le +äh5ne +1ähn5l6 +ä6hr +äh1re +äh5ri +äh1ru +ä1hu +äh1w +6äi +ä1isc +äisc8h +ä6i1sche +ä5i2s1m +ä5j +ä1k +ä8l1c +ä1le +ä8lei +ä2ls +äl1sc +älsc8h +äl6schl6 +ä1mi +ämi1e +äm8n8 +ä2m8s +ä5na +ä2n1d +än1de +5änd2e1ru +ä1ne +äne5i8 +äng3l +änk5l8 +ä1no +ä6ns +än6s5c +ä1pa +äp6s5c +3äq +är1c +ä1re +äre8m +ä8r1g +är1ge +5ärge2rn +är6gl +ä1ri +ä6r1m +är1me +3ärmel +ä1ro +ä2r1t +är2t6s5 +ä1ru +är2z1t +3ärz2t1l +ä5rö +äsc8h +ä1sche +ä6s5chen +ä1se +äse6n8s +ä2s1th +äta8b +ä1te +ät2e1ri4 +äter5it +ä6thy +ä1ti +3ä2t1k2 +ä1to +ä2ts +ätsc8h +ät8schl6 +äts1p2 +ä5tu +äub1l8 +äu1e +1äug +äu8ga +ä6u5i +ä1um. +ä1us. +1äuß +ä1z +ö1b +öc8h +ö1che +ö5chi +ö2chs +öchs1te +öch8s2tei +öch8str6 +ö2cht6 +ö1de +5ö6dem +ö2ff +5öf2f1n +ö1he +öh1l8 +ö6hr +öh1re +ö1hu +ö1is +ö1ke +1ö2k2o +1öl. +ö6l1k +öl6k5l8 +ö6l1p +öl8pl8 +ö1mu +ö5na +ö1ni +öni2g6s3 +ö1no +ö5o6t +öpf3l +öp6s5c +ö1re +ö8r1g +ör8g1li +ö1ri +ö2r1t +ör8tr6 +ö1ru +ös1te +5öste2rr +ö1te +ö5th +ö1ti +ö1tu +ö1v +ö1w +öwe8 +ö2z +ü1b6e2 +3ü4ber1 +üb1l8 +ü1b1r +5ü2bu +üc8h +ü1che +ü1chi +ü8ch3l6 +ü2chs +üch6s5c +ü8c2k +üc1k1a +ück5e2r1s +üd1a2 +ü1de +ü6deu +ü1di +üdi8t +ü2d1o4 +ü2d5s6 +ü1ge +üge4l5a +üg1l +üh5a +ü1he +ü8heh +ü6h5e6rk +üh1le +ü6hr +üh1re +üh1ru +ü1hu +üh1w +ü3k +ü1le +ü6ll +ül4l5a +ül8lo +ü6l1p +ül4ps +ü2ls +ül6s5c +ü1lu +ü2n1d +ün8da +ün1f +ün1fe +ün8fei +ünk5l8 +ün8za +ün6zw8 +ü5pi +ü1re +ü8rei +ür1f +ür8fl +ür8fr6 +ü8r1g +ür1ge +ür8geng +ü1ri +ü1ro +ü2r1s +ür8sta +ü1ru +ü1se +üse8n +ü8sta +üs1te +ü8stes +ü3ta +ü1te +ü1ti +ü2t1t +üt8tr6 +ü1tu +ü2tz +üt1ze +üt8zei +ü1v +ß1a8 +5ßa. +ß8as +ß1b8 +ß1c +ß1d +1ße +ß5ec +8ße8g +8ße8h +2ß1ei +8ßem +ß1f8 +ß1g +ß1h +1ßi +ß1k +ß1l +ß1m +ß1n +ß1o +ß1p8 +ß5q +ß1r +ß1s2 +ßst8 +ß1ta +ß1te +ßt3hei +ß1ti +ß5to +ß1tr6 +1ßu8 +6ß5um +ß1v +ß1w +ß1z +2s1ta. +i1sta +i2s1tal +2s1ta1ni +2s1tan. +fe2s1ta +nd1st +nd2s1te +ve2s1te +3s2tec +stec8h +4s5t8e2ch3n6 +3s2teg +3s2teh +3s2tein +3s2teig +3s2te2if +3s2te6ll +3s2telz +a4s3tel +3s2te2m1m +3s2te2mp +ss1te +s3s2ter +t3s2te2rn +3s2teu1e +6s4t3eu1ro +bs2ti +te2s3ti +ve2s1ti +3s2tic +3s2tie1b +3s2tieg +3s2t2if +3s2t2il +3s2tim +3s2tink +3s2ti1tu +a2s1to +gu2s1to +ku2s1to +i1sto +i2s1tol +i2s1tor +ve2s1to +2s1tung +2s7tus +o1stu +o2s1tul +aus3s4 +ens3s4 +gs3s4 +.mis2s1 +s2s1b8 +s1sche +s2s3chen +s2s3d +s2s5ec +2s2s1ei +s2s3f2 +s2s3g2 +s2s3h +s2s3k2 +s2s3l +s2s3m +s2s3n +s2s3p8 +s2s5q +s2s3r +s2s3s2 +sss2t8 +as2s3te +is2s3te +us2s3te +üs2s3te +s2sth +s2st3hei +s2s3ti +s2s1to +s2s1tr6 +s1su +6ss5um +s2s3v +s2s3w +s2s3z +1cker. +1cke2r1t +c1ka +1cka1d +1cke. +1ckel +1cken +4ck1ent +1cke1re +1cke2rn +1ck2e1ru +1ckie +1ckig +c1ku +1ckun +ta8s7ta7tur +ta1sta +tast6a1tu +.fli7ck8en7tep7pic8h +.f1li +.f2lic2k +.fli1cken +.fli4ck1ent +.flicken1te +.flicken5tep1pi +.mitt7wo8ch7a8be2n1d +.3mi2t1t +.mit2t1w +.mittwo1c +.mittwoc8h +.mittwocha1be +.ja7cken. +.jac2k +.ja1cken +.ja7cken7ta7sche. +.ja4ck1ent +.jacken1ta +.jackenta1sc +.jackentasc8h +.jackenta1sche +.let7s8cho. +.le2t1s +.letsc8h +.let1scho +.men8s7tru7a7ti7on +.1me +.me6ns +.men1str6 +.menstru2a1ti +.menstruat2io +ni7ve8au7st8a7bi7li7tät. +n2i1v +ni1ve +nive1aus +niveau4sta +niveau4st3a4b +niveausta1bi +niveaustab2il +niveaustabi1li +niveaustabili1tä +niveaustabilität2 +.ur7in8stin2k1t +.u1ri +.ur5i6ns +.u4rinst +.urins1ti +.urin3s2tink +.wach8s8tu7be +.wac8h +.wa2chs +.wach1stu +.stau8be1cken +.1sta +.stau1be +.staubec2k +.stau8b7ent7wick7lung +.stauben2t1w +.staub5entwic +.staubentwic2k +.staubentwick3l8 +.staubentwick1lun +en6d5an +en6d5ab +eben7d6a +ebe2n1d +pen7d8an +pe2n1d +ten7d8an +te2n1d +gram4m5a2 +gra2m1m +gram5m6a3t +de1h6a +jek2t3o +je2k1t +ojek3t4o +oje2k1t +ol2l1ernt +ol1ler +olle2rn +berg7a8n7sicht +berg7a8n7sich7ten +bi7lan8z7er7stel7lung +bi7lan8z7er7stel7lun7gen +bi7lan8z7auf7stel7lung +bi7lan8z7auf7stel7lun7gen +Bun7de8s7ar7chiv +Bun7de8s7ar7chi7ve +Bun7de8s7ar7chi7ven +Bun7de8s7ar7chivs +du7el8l7op7fer +du7el8l7op7fern +du7el8l7op7fers +farb7a8n7sicht +farb7a8n7sich7ten +fas8s7an7stich +fas8s7an7stichs +fet8t7ab7sau7gung +fet8t7ab7sau7gun7gen +fi7n8anz7amt +fi7n8anz7amts +fi7n8anz7äm7ter +fi7n8anz7äm7tern +fi7n8anz7aus7stat7tung +fi7n8anz7aus7stat7tun7gen +fi7n8an7zie7rungs7a8spekt +fi7n8an7zie7rungs7a8spek7te +fi7n8an7zie7rungs7a8spek7ten +fi7n8an7zie7rungs7a8spek7tes +fi7n8an7zie7rungs7a8spekts +fin7ge8r7an7satz +fin7ge8r7an7sat7zes +fin7ge8r7an7sät7ze +fin7ge8r7an7sät7zen +glei8s7an7bau +glei8s7an7baus +glei8s7an7bau7ten +gra7fi8k7an7for7de7rung +gra7fi8k7an7for7de7run7gen +gra7fi8k7an7zei7ge +gra7fi8k7an7zei7gen +gra7fi8k7aus7stel7lung +gra7fi8k7aus7stel7lun7gen +gra7fi8k7aus7stat7tung +gra7fi8k7aus7stat7tun7gen +gra7fi8k7ent7wurf +gra7fi8k7ent7wurfs +gra7fi8k7ent7wür7fe +gra7fi8k7ent7wür7fen +gra7phi8k7an7for7de7rung +gra7phi8k7an7for7de7run7gen +gra7phi8k7an7zei7ge +gra7phi8k7an7zei7gen +gra7phi8k7aus7stel7lung +gra7phi8k7aus7stel7lun7gen +gra7phi8k7ent7wurf +gra7phi8k7ent7wurfs +gra7phi8k7ent7wür7fe +gra7phi8k7ent7wür7fen +gym7nas7ti8k7übung +gym7nas7ti8k7übun7gen +hau8s7in7ter7na +hau8s7in7tern +hau8s7in7ter7ne +hau8s7in7ter7nem +hau8s7in7ter7nen +hau8s7in7ter7ner +in7sol7ven8z7an7trag +in7sol7ven8z7an7trags +in7sol7ven8z7an7trä7ge +in7sol7ven8z7an7trä7gen +in7sol7ven8z7er7öff7nung +in7sol7ven8z7er7öff7nun7gen +jo7se8phs7stadt +kom7pe7ten8z7er7war7tung +kom7pe7ten8z7er7war7tun7gen +krei8s7amt +krei8s7amts +krei8s7äm7ter +krei8s7äm7tern +krei8s7amt7mann +krei8s7amt7man7nes +krei8s7amt7manns +krei8s7amt7män7ner +krei8s7amt7män7nern +krei8s7an7zei7ger +krei8s7an7zei7gers +krei8s7an7zei7gern +krei8s7ar7chiv +krei8s7ar7chi7ve +krei8s7ar7chi7ven +krei8s7ar7chivs +krei8s7ar7chi7var +krei8s7ar7chi7vars +krei8s7ar7chi7va7re +krei8s7ar7chi7va7ren +krei8s7au +krei8s7auer +krei8s7in7tern +krei8s7in7ter7ne +krei8s7in7ter7nem +krei8s7in7ter7nen +krei8s7in7ter7ner +krei8s7in7ter7nes +kri7ti8k7an7satz +kri7ti8k7an7sat7zes +kri7ti8k7an7sät7ze +ku7lan8z7an7trag +ku7lan8z7an7trags +ku7lan8z7an7träge +ku7lan8z7an7trä7gen +lack7an7strich +lack7an7strichs +lack7an7stri7che +la7ge8r7ei7gen +la7ge8r7ei7ge7ne +la7ge8r7ei7ge7nen +la7ge8r7ei7ge7ner +la7ge8r7ei7ge7nes +la7ge8r7in7tern +la7ge8r7in7ter7ne +la7ge8r7in7ter7nen +la7ge8r7in7ter7ner +la7ge8r7in7ter7nes +lo7gi8k7an7satz +lo7gi8k7an7sat7zes +lo7gi8k7an7sät7ze +lo7gi8k7an7sät7zen +lo7gis7ti8k7auf7wand +lo7gis7ti8k7auf7wands +me7cha7ni8k7an7teil +me7cha7ni8k7an7tei7le +me7cha7ni8k7an7tei7len +me7cha7ni8k7an7teils +me7cha7ni8k7an7trieb +me7cha7ni8k7an7trie7be +me7cha7ni8k7an7trie7ben +me7cha7ni8k7an7triebs +me7di7e8n7er7zie7hung +me7di7e8n7in7ves7tor +me7di7e8n7in7ves7tors +me7di7e8n7in7ves7to7ren +me7tho7di8k7an7satz +me7tho7di8k7an7sat7zes +me7tho7di8k7an7sät7ze +me7tho7di8k7an7sät7zen +me7tho7di8k7ent7wurf +me7tho7di8k7ent7wurfs +me7tho7di8k7ent7wür7fe +me7tho7di8k7ent7wür7fen +mu7si8k7in7dus7trie +mu7si8k7in7sti7tut +mu7si8k7in7sti7tu7te +mu7si8k7in7sti7tu7ten +mu7si8k7in7sti7tuts +phy7si8k7aus7stel7lung +phy7si8k7aus7stel7lun7gen +phy7si8k7in7sti7tut +phy7si8k7in7sti7tu7te +phy7si8k7in7sti7tu7ten +phy7si8k7in7sti7tuts +pla7sti8k7ab7fall +plas7ti8k7ab7falls +plas7ti8k7ab7fäl7le +plas7ti8k7ab7fäl7len +plas7ti8k7aus7stel7lung +plas7ti8k7aus7stel7lun7gen +plas7ti8k7aus7weis +plas7ti8k7aus7wei7se +plas7ti8k7aus7wei7sen +plas7ti8k7aus7wei7ses +plas7ti8k7ei7mer +plas7ti8k7ei7mern +plas7ti8k7ei7mers +plas7ti8k7ent7wurf +plas7ti8k7ent7wurfs +plas7ti8k7ent7wür7fe +plas7ti8k7ent7wür7fen +po7li7ti8k7an7satz +po7li7ti8k7an7sat7zes +po7li7ti8k7an7sät7ze +po7li7ti8k7an7sät7zen +prin8t7auf7la7ge +prin8t7auf7la7gen +pro7gram8m7ab7lauf +pro7gram8m7ab7laufs +pro7gram8m7ab7läu7fe +pro7gram8m7ab7läu7fen +pro7gram8m7ab7bruch +pro7gram8m7ab7bruchs +pro7gram8m7ab7brü7che +pro7gram8m7ab7brü7chen +pro7gram8m7ab7schal7tung +pro7gram8m7ab7schal7tun7gen +so7w7je8t7uni7on +ver7kauf8s7auf7la7ge +ver7kauf8s7auf7la7gen +max-planc8k-in7sti7tut +max-planc8k-in7sti7tuts +max-planc8k-in7sti7tu7te +max-planc8k-in7sti7tu7ten +prä7g8nant +prä7g8nan7te +prä7g8nant7tem +prä7g8nant7ten +prä7g8nant7ter +prä7g8nant7tes +prä7g8nanz +rest7al7ko7hol +rest7al7ko7ho7le +rest7al7ko7hols diff --git a/src/librarian/res/hyph-dictionaries/hyph_fr.dic b/src/librarian/res/hyph-dictionaries/hyph_fr.dic new file mode 100644 index 0000000..e260b9f --- /dev/null +++ b/src/librarian/res/hyph-dictionaries/hyph_fr.dic @@ -0,0 +1,2848 @@ +UTF-8 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +LEFTHYPHENMIN 2 +RIGHTHYPHENMIN 2 +COUMPOUNDLEFTHYPHENMIN 2 +COUMPOUNDRIGHTHYPHENMIN 2 +%%% Do not remove the following line %%% +NEXTLEVEL +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +2'2 +.a4 +'a4 +.â4 +'â4 +ab2h +a1bî +abî1me +abî2ment. +.a1b2r +'a1b2r +.ab1ré +'ab1ré +.ab3réa +'ab3réa +ab1se +ab3sent. +abs1ti +absti1ne +absti3nent. +ac1ce +ac3cent. +ac1q +acquies1ce +acquies4cent. +ad2h +aè1d2r +a1è2d1re +.ae3s4c2h +'ae3s4c2h +a1g2n +.a1g2n +'a1g2n +.ag1na +'ag1na +.a2g3nat +'a2g3nat +ag1no +a2g3nos +ai1me +ai2ment. +a1la +a2l1al1gi +al1co +1alcool +a1ma +amal1ga +amalga1me +amalga2ment. +â1me +â2ment. +.a1mi +'a1mi +.ami1no +'ami1no +.amino1a2c +'amino1a2c +.a1na +'a1na +.ana3s4t2r +'ana3s4t2r +a1ne +anes1t2h +anest1hé +1a2nesthé1si +a1ni +ani1me +ani2ment. +an1ti +.an1ti +'an1ti +.anti1a2 +'anti1a2 +.anti1e2 +'anti1e2 +.anti1é2 +'anti1é2 +.anti2en1ne +'anti2en1ne +anti1fe +antifer1me +antifer3ment. +.anti1s2 +'anti1s2 +a1po +.a1po +'a1po +.apo2s3ta +'apo2s3ta +apo2s3t2r +ap1pa +appa1re +appa3rent. +ar1c2h +arc1hi +archié1pi +archi1é2pis +.ar1de +.ar3dent. +.ar1ge +'ar1ge +.ar3gent. +'ar3gent. +ar1me +ar2ment. +ar1mi +armil5l +.ar1pe +'ar1pe +.ar3pent. +'ar3pent. +as1me +as2ment. +.as2ta +'as2ta +as1t2r +a2s3t1ro +au1me +au2ment. +a1vi +avil4l +1ba +.1ba +1bâ +.bai1se +.baise1ma +.bai2se3main +1be +1bé +1bè +1bê +4be. +2bent. +4bes. +1bi +.1bi +1bî +.bi1a2c +.bi1a2t +.bi1au +.bio1a2 +.bi2s1a2 +.bi1u2 +1b2l +b1le +4b4le. +2b2lent. +4b4les. +1bo +1bô +bou1me +bou2ment. +bou1ti +boutil3l +1b2r +b1re +4b4re. +2b2rent. +4b4res. +b1ru +bru1me +bru2ment. +1bu +1bû +1by +1ç +1ca +1câ +ca3ou3t2 +ca1pi +capil3l +ca1rê +carê1me +carê2ment. +c1ci +cci1de +cci3dent. +1ce +1cé +1cè +1cê +4ce. +2cent. +4ces. +1c2h +.1c2h4 +4ch. +2chb +c1he +.c1hè +4c4he. +2chent. +4c4hes. +che1vi +chevil4l +.chè1v2r +.chèv1re +.chèvre1fe +.chèvrefeuil2l +.chè2vre3feuil1le +2chg +c1hi +chien1de +chien3dent. +ch2l +ch1le +4ch4le. +4ch4les. +ch1lo +chlo1ra +chlo2r3a2c +chlo1ré +chlo2r3é2t +2chm +2chn +2chp +ch2r +ch1re +4ch4re. +4ch4res. +ch1ro +chro1me +chro2ment. +2chs +2cht +2chw +1ci +.1ci +1cî +cil3l +.ci1sa +.ci2s1alp +1c2k +4ck. +2ckb +c1ke +4c4ke. +2c2kent. +4c4kes. +2ckf +2ckg +2c1k3h +2ckp +2cks +2ckt +1c2l +c1la +cla1me +cla2ment. +c1le +4c4le. +2c2lent. +4c4les. +1co +.1co +1cô +co1acc +co1ac1q +co1a2d +co1ap +co1ar +coas1so +co1assoc +coas1su +co1assur +co1au +co1ax +1cœ +co1é2 +co1ef +co1en +co1ex +co1g2n +cog1ni +co2g3ni1ti +.com1me +.com3ment. +com1pé +compé1te +compé3tent. +.con4 +con1fi +confi1de +confi3dent. +con1ni +conni1ve +conni3vent. +.cons4 +con1ti +conti1ne +conti3nent. +contin1ge +contin3gent. +.con1t2r +.cont1re +.contre1ma +.contremaî1t2r +.cont1re3maît1re +.contre1s2c +co1nu +co2nurb +.co1o2 +.coo1li +.co2o3lie +cor1pu +corpu1le +corpu3lent. +1c2r +c1re +4c4re. +2c2rent. +4c4res. +1cu +.1cu +1cû +.cul4 +cur1re +cur3rent. +1cy +cy1ri +cyril3l +1d2'2 +1da +.1da +1dâ +.da1c2r +.dac1ry +.dacryo1a2 +da1me +da2ment. +d1d2h +1de +1dé +.1dé +1dè +1dê +4de. +.dé1a2 +dé1ca +déca1de +déca3dent. +.dé1io +2dent. +.dé1o2 +.dé2s +4des. +.dé1sa +.dé3s2a3c2r +.dés2a3m +.dé3s2as1t2r +.désa1te +.dé3s2a3tell +.dé3s2c +.dé1se +.dé2s1é2 +.dé3s2é3g2r +.désen1si +.dé3s2ensib +.dé3s2ert +.dé3s2exu +.dé2s1i2 +.dé3s2i3d +.dé3s2i3g2n +.dé3s2i3li +.dési1ne +.dé3s2i3nen +.dé3s2in1vo +.dé3s2i3r +.dé3s2ist +.dé1so +.1dé3s2o3dé +.dé2s1œ +.dé3s2o3l +.déso1pi +.dé3s2o3pil +.dé3s2orm +.dé3s2orp +.dé3s2ou1f2r +.dé3s2p +.dé3s2t +.dé1su +.dé2s1u2n +dé1t2r +dét1ri +détri1me +détri3ment. +d1ha +3d2hal +d1ho +3d2houd +1di +.1di +1dî +.di1a2cé +.dia1ci +.di1a2cid +.di1ald +.di1a2mi +dia1p2h +diaph2r +diaph1ra +diaphrag1me +diaphrag2ment. +.dia1to +.di1a2tom +.di1e2n +di1li +dili1ge +dili3gent. +dis1co +di2s3cop +.di2s3h +dis1si +dissi1de +dissi3dent. +dis1ti +distil3l +d1le +2d2lent. +1do +.1do +1dô +.do1le +.do3lent. +1d2r +d1re +4d4re. +2d2rent. +4d4res. +d1s2 +1du +1dû +1dy +.1dy +.dy2s3 +.dy2s1a2 +.dy2s1i2 +.dy2s1o2 +.dy2s1u2 +.e4 +'e4 +.é4 +'é4 +.è4 +'è4 +.ê4 +'ê4 +é1ce +é3cent. +é1ci +éci1me +éci2ment. +é1cu +écu1me +écu2ment. +é1de +é3dent. +éd2hi +é1d2r +éd1ri +1é2drie +édri1q +1é2drique +é1le +é1lé +1é2lec1t2r +élé1me +1é2lément +é1li +éli1me +éli2ment. +é1lo +élo1q +élo3quent. +è1me +è2ment. +é1mi +.é1mi +émil4l +.émi1ne +.émi3nent. +.e1n1a2 +'e1n1a2 +é1ne +1é2nerg +e1ni +é1ni +éni1te +éni3tent. +e2n1i2v2r +.e1n1o2 +'e1n1o2 +en1t2r +ent1re +entre1ge +entre3gent. +é1pi +épis1co +épi2s3cop +épi3s4co1pe +é1q +é3quent. +équi1po +équipo1te +équipo3tent. +équi1va +équiva1le +équiva4lent. +é1re +é3rent. +er1me +er2ment. +es1ce +es3cent. +e2s3c2h +es1co +e2s3cop +es1ti +esti1me +esti2ment. +.eu2r1a2 +'eu2r1a2 +eus1ta +eu1s2tat +ex1t2r +ext1ra1 +extra2c +extra2i +1fa +1fâ +fa1me +fa2ment. +1fe +1fé +1fè +1fê +4fe. +fé1cu +fécu1le +fécu3lent. +2fent. +4fes. +1fi +1fî +fi1c2h +fic1hu +fichu1me +fichu3ment. +fir1me +fir2ment. +1f2l +f1la +flam1me +flam2ment. +f1le +4f4le. +2f2lent. +4f4les. +1fo +1fô +1f2r +f1re +4f4re. +2f2rent. +4f4res. +f1ri +fri1ti +fritil3l +f1s2 +1fu +1fû +fu1me +fu2ment. +1fy +1ga +1gâ +1ge +.1ge +1gé +1gè +1gê +4ge. +.gem1me +.gem2ment. +2gent. +4ges. +1g2ha +1g2he +1g2hi +1g2ho +1g2hy +1gi +1gî +gil3l +1g2l +g1le +4g4le. +2g2lent. +4g4les. +1g2n +g1ne +4g4ne. +2g2nent. +4g4nes. +1go +1gô +1g2r +g1ra +gram1me +gram2ment. +gran1di +grandi1lo +grandilo1q +grandilo3quent. +g1re +4g4re. +2g2rent. +4g4res. +g1s2 +1gu +1gû +4gue. +2guent. +4gues. +1gy +1ha +1hâ +1he +1hé +1hè +1hê +4he. +hé1mi +hémi1é +hé1mo +hémo1p2t +4hes. +1hi +1hî +hil3l +1ho +1hô +1hu +1hû +hu1me +hu2ment. +1hy +hy1pe +hype4r1 +hype1ra2 +hype1re2 +hype1ré2 +hype1ri2 +hype1ro2 +hypers2 +hype1ru2 +hy1po +hypo1a2 +hypo1e2 +hypo1é2 +hypo1i2 +hypo1o2 +hypo1s2 +hypo1u2 +.i4 +'i4 +.î4 +'î4 +i1al1gi +iar1t2h +i1arth2r +i1b2r +ib1ri +ibril3l +iè1d2r +i1è2d1re +.i1g2n +'i1g2n +.i2g3né +'i2g3né +.i2g3ni +'i2g3ni +il2l +im1ma +imma1ne +imma3nent. +im1mi +immi1ne +immi3nent. +immis1ce +immis4cent. +im1po +impo1te +impo3tent. +im1pu +impu1de +impu3dent. +.i1n1a2 +'i1n1a2 +.ina1ni +'ina1ni +.in2a3nit +'in2a3nit +.inau1gu +'inau1gu +.in2augur +'in2augur +in1ci +inci1de +inci3dent. +in1di +indi1ge +indi3gent. +in1do +indo1le +indo3lent. +in1du +indul1ge +indul3gent. +.i1n1e2 +'i1n1e2 +.i1n1é2 +'i1n1é2 +.inef1fa +'inef1fa +.in2effab +'in2effab +.iné1lu +'iné1lu +.in2é3luc1ta +'in2é3luc1ta +.iné1na +'iné1na +.in2é3nar1ra +'in2é3nar1ra +.in2ept +'in2ept +.in2er +'in2er +.in2exo1ra +'in2exo1ra +in1fo +infor1ma +1informat +.i1n1i2 +'i1n1i2 +.ini1mi +'ini1mi +.in2i3mi1ti +'in2i3mi1ti +.in2i3q +'in2i3q +.in2i3t +'in2i3t +in1no +inno1ce +inno3cent. +.i1n1o2 +'i1n1o2 +.ino1cu +'ino1cu +.in2o3cul +'in2o3cul +.in2ond +'in2ond +in1so +inso1le +inso3lent. +.ins1ta +'ins1ta +.in1s2tab +'in1s2tab +ins1ti +instil3l +in1te +.in1te +'in1te +intel1li +intelli1ge +intelli3gent. +.inte4r3 +'inte4r3 +.inte1ra2 +'inte1ra2 +.inte1re2 +'inte1re2 +.inte1ré2 +'inte1ré2 +.inte1ri2 +'inte1ri2 +.inte1ro2 +'inte1ro2 +.inters2 +'inters2 +.inte1ru2 +'inte1ru2 +in1ti +inti1me +inti2ment. +.i1n1u2 +'i1n1u2 +.in2uit +'in2uit +.in2u3l +'in2u3l +io1a2ct +i1oxy +is1ce +is3cent. +i1s2c2h +i2s3c1hé +isc1hi +i2s3chia +i2s3chio +is1ta +i1s2tat +i1va +iva1le +iva3lent. +1j +ja1ce +ja3cent. +4je. +2jent. +4jes. +2jk +1ka +1kâ +1ke +1ké +1kè +1kê +4ke. +2kent. +4kes. +1k2h +.1k2h4 +4kh. +1ki +1kî +1ko +1kô +1k2r +1ku +1kû +1ky +1la +.1la +1là +1lâ +.la1te +.la3tent. +la1w2r +la2w3re +1le +1lé +1lè +1lê +4le. +2lent. +4les. +1li +1lî +lil3l +l1li +l3lion +l1lu +llu1me +llu2ment. +l1me +l2ment. +1lo +1lô +l1s2t +1lu +1lû +1ly +1ma +.1ma +1mâ +.ma2c3k +.ma1c2r +.mac1ro +.macro1s2c +.ma1g2n +.mag1ni +.magni1ci +.ma2g3nici1de +.magni1fi +.magnifi1ca +.ma2g3nificat +.mag1nu +.ma2g3num +.ma1la +.mala1d2r +.malad1re +.ma2l1a2dres +.ma2l1a2d1ro +.ma2l1ai1sé +.ma2l1ap +.ma2l1a2v +.ma1le +.ma2l1en +.ma1li +.ma2l1int +.ma1lo +.ma2l1oc +.ma2l1o2d +.ma2r1x +1me +1mé +.1mé +1mè +1mê +4me. +mé1co +mécon1te +mécon3tent. +.mé1go +.mé2g1oh +4mes. +.mé2sa +.mé3san +.mé1se +.mé2s1es +.mé2s1i +.mé1su +.mé2s1u2s +.mé1ta +.mé1ta1s2ta +1mi +.1mi +1mî +mil3l +.mil3l +mil1le +mil4let +.mil1li +.milli1am +mi1me +mi2ment. +mit1te +mit3tent. +m1né +m1nè +1m2né1mo +1m2nès +1m2né1si +1mo +.1mo +1mô +1mœ +mo1no +.mo1no +.mono1a2 +.mono1e2 +.mono1é2 +.mono1i2 +.mono1ï2dé +.mono1o2 +.mono1s2 +.mono1u2 +mono1va +monova1le +monova3lent. +mon1t2r +mont1ré +mon2t3réal +moye1nâ +moye2n1â2g +m1s2 +1mu +1mû +mu1ni +muni1fi +munifi1ce +munifi3cent. +1my +1na +1nâ +1ne +1né +1nè +1nê +4ne. +2nent. +4nes. +1ni +1nî +1no +.1no +1nô +1nœ +.no1no +.no2n1obs +n1sa +n3s2at. +n3s2ats. +1nu +1nû +nu1t2r +nut1ri +nutri1me +nutri3ment. +n1x +1ny +.o4 +'o4 +.ô4 +'ô4 +o1b2l +ob1lo +o2b3long +oc1te +1octet +o1d2l +oè1d2r +o1è2d1re +o1g2n +og1no +ogno1mo +o2g3nomo1ni +o2g3no1si +o1io1ni +om1bu +ombud2s3 +ô1me +ô2ment. +om1me +om2ment. +om1ni +omni1po +omnipo1te +omnipo3tent. +omni1s2 +.on1gu +'on1gu +.on3guent. +'on3guent. +o1pu +opu1le +opu3lent. +or1me +or2ment. +os1ta +o1s2tas +o1s2tat +os1té +o1s2té1ro +os1ti +o1s2tim +os1to +o1s2tom +os1t2r +ost1ra +o1s2trad +o1s2tra1tu +ost1ri +ostric1ti +o1s2triction +.oua1ou +'oua1ou +.o1vi +'o1vi +.ovi1s2c +'ovi1s2c +oxy1a2 +1pa +.1pa +1pâ +pa1lé +paléo1é2 +.pa1na +.pa2n1a2f +.pa2n1a2mé +.pa2n1a2ra +.pa1ni +.pa2n1is +.pa1no +.pa2n1o2p2h +.pa2n1opt +pa1pi +papil2l +papil3la +papil3le +papil3li +papil1lo +papil3lom +.pa1ra +.para1c2h +.pa2r1a2c1he +.pa2r1a2c1hè +.para1s2 +.pa1re +.pa3rent. +.pa1r2h +.pa2r3hé +.pa1te +.pa3tent. +1pe +.1pe +1pé +.1pé +1pè +1pê +4pe. +2pent. +.pen2ta +pé1nu +pé2nul +.pe4r +.pe1r1a2 +pé1ré +.pe1r1e2 +.pe1r1é2 +pé1r2é2q +pe1r3h +.pé1ri +.pe1r1i2 +.péri1os +.péri1s2 +.péri2s3s +.péri2s3ta +.péri1u2 +per1ma +perma1ne +perma3nent. +.pe1r1o2 +per1ti +perti1ne +perti3nent. +.pe1r1u2 +4pes. +1p2h +.1p2h4 +4ph. +.p1ha +.pha1la +.phalan3s2t +p1he +4p4he. +2phent. +4p4hes. +ph2l +ph1le +4ph4le. +4ph4les. +2phn +p1ho +pho1to +photo1s2 +ph2r +ph1re +4ph4re. +4ph4res. +2phs +2pht +ph1ta +3ph2ta1lé +ph1ti +3ph2tis +1pi +1pî +pi1ri +piril3l +1p2l +.1p2l +p1le +4p4le. +2p2lent. +4p4les. +p1lu +.p1lu +plu1me +plu2ment. +.plu1ri +.pluri1a +p1ne +1p2né +1p2neu +1po +.1po +1pô +poas1t2r +po1ast1re +po1ly +poly1a2 +poly1e2 +poly1é2 +poly1è2 +poly1i2 +poly1o2 +poly1s2 +poly1u2 +poly1va +polyva1le +polyva3lent. +.pon1te +.pon2tet +.pos2t3h +.pos1ti +.pos2t1in +.pos2t1o2 +.pos2t3r +.post1s2 +1p2r +.1p2r +p1re +p1ré +.p1ré +4p4re. +.pré1a2 +.pré2a3la +.pré2au +.pré1e2 +.pré1é2 +préé1mi +préémi1ne +préémi3nent. +.pré1i2 +2p2rent. +.pré1o2 +.pré1s2 +4p4res. +pré1se +pré3sent. +.pré1u2 +p1ri +pri1va +privat1do +privatdo1ce +privatdo3cent. +privatdo1ze +privatdo3zent. +p1ro +.p1ro +.pro1é2 +proé1mi +proémi1ne +proémi3nent. +.pro1g2n +.prog1na +.pro2g3na1t2h +.pro1s2cé +pros1ta +pro2s3tat +.prou3d2h +p1ru +pru1de +pru3dent. +p1sy +.p1sy +1p2sy1c2h +.1p2sy1c2h +.psyc1ho +.psycho1a2n +p1té +p1tè +1p2tér +1p2tèr +1pu +.1pu +1pû +.pud1d2l +pu1g2n +pug1na +pugna1b2l +pu2g3nab1le +pu2g3nac +pu1pi +pupil3l +pu1si +pusil3l +1py +1q +qua1me +qua2ment. +4que. +2quent. +4ques. +1ra +1râ +ra1di +radio1a2 +rai1me +rai3ment. +ra1me +ra2ment. +r1ci +rcil4l +1re +.1re +1ré +.1ré +1rè +1rê +4re. +.ré1a2 +.ré2a3le +.réa1li +.ré2a3lis +.ré2a3lit +.ré2aux +.ré1e2 +.ré1é2 +.ré2el +.ré2er +.ré2èr +ré1ge +ré3gent. +.ré1i2 +.ré2i3fi +re1le +re3lent. +re1li +reli1me +reli2ment. +ré1ma +réma1ne +réma3nent. +2rent. +.ré1o2 +re1pe +re3pent. +.re1s2 +4res. +.res1ca +.re2s3cap +.res1ci +.re2s3ci1si +.re2s3ci1so +.res1co +.re2s3cou +.res1c2r +.re2s3c1ri +.res1pe +.re2s3pect +.res1pi +.re2s3pir +.res1p2l +.resp1le +.re2s3plend +.res1po +.re2s3pons +.res1q +.re2s3quil +.re2s3s +.res1se +.res3sent. +.re2s3t +.res1ta +.re3s4tab +.re3s4tag +.re3s4tand +.re3s4tat +.res1té +.re3s4tén +.re3s4tér +.res1ti +.re3s4tim +.re3s4tip +.res1to +.re3s4toc +.re3s4top +.re3s4t2r +.rest1re +.re4s5trein +.rest1ri +.re4s5trict +.re4s5trin +.re3s4tu +.re3s4ty +ré1su +résur1ge +résur3gent. +ré1ti +réti1ce +réti3cent. +.ré1t2r +.rét1ro +.rétro1a2 +.réu2 +.ré2uss +1r2h +r1he +4r4he. +4r4hes. +2r3heur +r1hy +2r3hy1d2r +1ri +1rî +ri1me +ri2ment. +rin1ge +rin3gent. +r1mi +rmil4l +1ro +1rô +1ru +1rû +ru1le +ru3lent. +1ry +ry1t2h +ry2thm +ryth1me +ryth2ment. +1sa +.1sa +1sâ +.sar1me +.sar3ment. +s1ca +1s2ca1p2h +1s2c2h +.1s2c2h4 +4s4ch. +sc1he +4s4c4he. +4s4c4hes. +2s2chs +s1c2l +sc1lé +1s2clér +s1co +1s2cop +1se +.1se +1sé +1sè +1sê +4se. +se1mi +semil4l +2sent. +ser1ge +ser3gent. +.ser1me +.ser3ment. +ser1pe +ser3pent. +4ses. +ses1q +sesqui1a2 +.seu2le +1s2h +.1s2h4 +4sh. +s1he +4s4he. +2shent. +4s4hes. +2shm +s1ho +2s3hom +2shr +2shs +1si +1sî +s1la +sla1lo +slalo1me +slalo2ment. +1s2lav +s1lo +1s2lov +1so +.1so +1sô +1sœ +.sou1ve +.sou3vent. +s1pa +spa1ti +1s2patia +s1pe +1s2perm +s1p2h +sp1hé +sp1hè +1s2phér +1s2phèr +s1pi +1s2piel +spi1ro +1s2piros +s1po +1s2por +spo1ru +sporu1le +sporu4lent. +s1ta +.s1ta +.sta2g3n +stan1da +1s2tandard +s1te +s1té +1s2tein +sté1ré +stéréo1s2 +s1ti +.s1ti +1s2tigm +.stil3l +s1to +1s2to1c2k +sto1mo +1s2tomos +s1t2r +st1ro +1s2tro1p2h +st1ru +1s2truc1tu +s1ty +1s2ty1le +1su +.1su +1sû +.su2b1a2 +.su3b2alt +.su2b1é2 +.su3b2é3r +.su1bi +.su2b1in +su1b2l +.su1b2l +sub1li +.sub1li +subli1me +subli2ment. +.subli1mi +.su2b3limin +.su2b3lin +.su2b3lu +sub1s2 +.su1bu +.su2b1ur +suc1cu +succu1le +succu3lent. +su1me +su2ment. +su1pe +supe4r1 +supe1ro2 +supers2 +su1ra +.su2r1a2 +su3r2ah +.su3r2a3t +su1ré +.su2r1e2 +.su2r1é2 +.su3r2eau +.su3r2ell +suré1mi +surémi1ne +surémi3nent. +.su3r2et +.su2r3h +.su1ri +.su2r1i2m +.su2r1inf +.su2r1int +.su1ro +.su2r1of +.su2r1ox +1sy +.1sy +.syn1g2n +.syng1na +.syn2g3na1t2h +1ta +.1ta +1tà +1tâ +ta1c2h +tac1hy +tachy1a2 +.ta1le +.ta3lent. +ta1me +ta2ment. +tan1ge +tan3gent. +t1c2h +tc1hi +tchin3t2 +1te +1té +1tè +1tê +4te. +té1lé +télé1e2 +télé1i2 +télé1o2b +télé1o2p +télé1s2 +tem1pé +tempé1ra +tempéra1me +tempéra3ment. +2tent. +ter1ge +ter3gent. +4tes. +tes1ta +testa1me +testa3ment. +1t2h +.1t2h4 +4th. +t1he +4t4he. +ther1mo +thermo1s2 +4t4hes. +2t3heur +2thl +2thm +2thn +th2r +th1re +4th4re. +4th4res. +th1ri +thril3l +2ths +1ti +1tî +1to +1tô +to1me +to2ment. +tor1re +tor3rent. +1t2r +.1t2r +t1ra +tran2s1a2 +tran3s2act +tran3s2ats +tran2s3h +tran2s1o2 +tran2s3p +trans1pa +transpa1re +transpa3rent. +tran2s1u2 +t1re +4t4re. +2t2rent. +4t4res. +t1ri +.t1ri +.tri1a2c +.tri1a2n +.tri1a2t +tri1de +tri3dent. +.tri1o2n +t1ru +tru1cu +trucu1le +trucu3lent. +t1t2l +1tu +1tû +tu1me +tu2ment. +tung2s3 +tur1bu +turbu1le +turbu3lent. +1ty +.u4 +'u4 +.û4 +'û4 +u1ci +ucil4l +ue1vi +uevil4l +u1ni +uni1a2x +uni1o2v +u2s3t2r +u1vi +uvil4l +1va +1vâ +va1ci +vacil4l +va1ni +vanil2l +vanil1li +vanil3lin +vanil3lis +1ve +1vé +1vè +1vê +4ve. +vé1lo +vélo1s2ki +ve1ni +veni1me +veni2ment. +2vent. +ven1t2r +vent1ri +ventri1po +ventripo1te +ventripo3tent. +4ves. +1vi +1vî +vi1di +vidi1me +vidi2ment. +vil3l +1vo +1vô +vol1ta +vol2t1amp +1v2r +v1re +4v4re. +2v2rent. +4v4res. +1vu +1vû +1vy +1wa +wa2g3n +1we +4we. +2went. +4wes. +1wi +1wo +1w2r +1wu +2xent. +xil3l +.y4 +'y4 +y1al1gi +y1as1t2h +ys1to +y1s2tom +1za +1ze +1zé +1zè +4ze. +2zent. +4zes. +1zi +1zo +1zu +1zy +% +% Additional patterns start here: +% +2’2 +’a4 +4a- +.á4 +'á4 +’á4 +4á- +.à4 +'à4 +’à4 +4à- +’â4 +4â- +.Ã¥4 +'Ã¥4 +’å4 +4Ã¥- +.ä4 +'ä4 +’ä4 +4ä- +.ã4 +'ã4 +’ã4 +4ã- +-5a4 +-5á4 +-5à4 +-5â4 +-5Ã¥4 +-5ä4 +-5ã4 +abî2ment- +’a1b2r +-5a1b2r +’ab1ré +-5ab1ré +’ab3réa +-5ab3réa +ab3sent- +absti3nent- +ac3cent- +acquies4cent- +.æ4 +'æ4 +’æ4 +4æ- +-5æ4 +’ae3s4c2h +-5ae3s4c2h +’a1g2n +-5a1g2n +’ag1na +-5ag1na +’a2g3nat +-5a2g3nat +ai2ment- +amalga2ment- +â2ment- +’a1mi +-5a1mi +’ami1no +-5ami1no +’amino1a2c +-5amino1a2c +’a1na +-5a1na +’ana3s4t2r +-5ana3s4t2r +ani2ment- +’an1ti +-5an1ti +’anti1a2 +-5anti1a2 +’anti1e2 +’anti1é2 +-5anti1e2 +-5anti1é2 +’anti2en1ne +-5anti2en1ne +antifer3ment- +’anti1s2 +-5anti1s2 +’a1po +-5a1po +’apo2s3ta +-5apo2s3ta +appa3rent- +-5ar1de +-ar3dent- +.ar3dent- +-5ar3dent. +’ar1ge +-5ar1ge +-ar3gent- +.ar3gent- +'ar3gent- +’ar3gent- +’ar3gent. +-5ar3gent. +ar2ment- +’ar1pe +-5ar1pe +-ar3pent- +.ar3pent- +'ar3pent- +’ar3pent- +’ar3pent. +-5ar3pent. +as2ment- +’as2ta +-5as2ta +au2ment- +.b4 +'b4 +’b4 +4b- +-5b4 +-5bai1se +-5baise1ma +-5bai2se3main +4be- +2bent- +4bes- +-5bi1a2c +-5bi1a2t +-5bi1au +-5bio1a2 +-5bi2s1a2 +-5bi1u2 +4b4le- +2b2lent- +4b4les- +bou2ment- +4b4re- +2b2rent- +4b4res- +bru2ment- +.c4 +'c4 +’c4 +4c- +.ç4 +'ç4 +’ç4 +4ç- +-5c4 +-5ç4 +carê2ment- +cci3dent- +4ce- +2cent- +4ces- +4ch- +4c4he- +-5c1hè +2chent- +4c4hes- +-5chè1v2r +-5chèv1re +-5chèvre1fe +-5chèvrefeuil2l +-5chè2vre3feuil1le +chien3dent- +4ch4le- +4ch4les- +4ch4re- +4ch4res- +chro2ment- +-5ci1sa +-5ci2s1alp +4ck- +4c4ke- +2c2kent- +4c4kes- +cla2ment- +4c4le- +2c2lent- +4c4les- +-5com1me +-com3ment- +.com3ment- +-5com3ment. +compé3tent- +-5con4 +confi3dent- +conni3vent- +-5cons4 +conti3nent- +contin3gent- +-5con1t2r +-5cont1re +-5contre1ma +-5contremaî1t2r +-5cont1re3maît1re +-5contre1s2c +-5co1o2 +-5coo1li +-5co2o3lie +corpu3lent- +4c4re- +2c2rent- +4c4res- +-5cul4 +cur3rent- +1d2’2 +.d4 +'d4 +’d4 +4d- +.ð4 +'ð4 +’ð4 +4ð- +-5d4 +-5ð4 +-5da1c2r +-5dac1ry +-5dacryo1a2 +da2ment- +4de- +-5dé1a2 +déca3dent- +-5dé1io +2dent- +-5dé1o2 +4des- +-5dé2s +-5dé1sa +-5dé3s2a3c2r +-5dés2a3m +-5dé3s2as1t2r +-5désa1te +-5dé3s2a3tell +-5dé3s2c +-5dé1se +-5dé2s1é2 +-5dé3s2é3g2r +-5désen1si +-5dé3s2ensib +-5dé3s2ert +-5dé3s2exu +-5dé2s1i2 +-5dé3s2i3d +-5dé3s2i3g2n +-5dé3s2i3li +-5dési1ne +-5dé3s2i3nen +-5dé3s2in1vo +-5dé3s2i3r +-5dé3s2ist +-5dé1so +-5dé2s1œ +-5dé3s2o3l +-5déso1pi +-5dé3s2o3pil +-5dé3s2orm +-5dé3s2orp +-5dé3s2ou1f2r +-5dé3s2p +-5dé3s2t +-5dé1su +-5dé2s1u2n +détri3ment- +-5di1a2cé +-5dia1ci +-5di1a2cid +-5di1ald +-5di1a2mi +diaphrag2ment- +-5dia1to +-5di1a2tom +-5di1e2n +dili3gent- +-5di2s3h +dissi3dent- +2d2lent- +-5do1le +-do3lent- +.do3lent- +-5do3lent. +4d4re- +2d2rent- +4d4res- +-5dy2s3 +-5dy2s1a2 +-5dy2s1i2 +-5dy2s1o2 +-5dy2s1u2 +’e4 +4e- +’é4 +4é- +’è4 +4è- +’ê4 +4ê- +.ë4 +'ë4 +’ë4 +4ë- +-5e4 +-5é4 +-5è4 +-5ê4 +-5ë4 +é3cent- +éci2ment- +écu2ment- +é3dent- +éli2ment- +élo3quent- +è2ment- +-5é1mi +-5émi1ne +-émi3nent- +.émi3nent- +-5émi3nent. +’e1n1a2 +-5e1n1a2 +éni3tent- +’e1n1o2 +-5e1n1o2 +entre3gent- +é3quent- +équipo3tent- +équiva4lent- +é3rent- +er2ment- +es3cent- +esti2ment- +’eu2r1a2 +-5eu2r1a2 +.f4 +'f4 +’f4 +4f- +-5f4 +fa2ment- +4fe- +fécu3lent- +2fent- +4fes- +fichu3ment- +fir2ment- +flam2ment- +4f4le- +2f2lent- +4f4les- +4f4re- +2f2rent- +4f4res- +fu2ment- +.g4 +'g4 +’g4 +4g- +-5g4 +4ge- +-5gem1me +-gem2ment- +.gem2ment- +-5gem2ment. +2gent- +4ges- +4g4le- +2g2lent- +4g4les- +4g4ne- +2g2nent- +4g4nes- +gram2ment- +grandilo3quent- +4g4re- +2g2rent- +4g4res- +4gue- +2guent- +4gues- +.h4 +'h4 +’h4 +4h- +-5h4 +4he- +4hes- +hu2ment- +’i4 +4i- +.í4 +'í4 +’í4 +4í- +.ì4 +'ì4 +’ì4 +4ì- +’î4 +4î- +.ï4 +'ï4 +’ï4 +4ï- +-5i4 +-5í4 +-5ì4 +-5î4 +-5ï4 +’i1g2n +-5i1g2n +’i2g3né +-5i2g3né +’i2g3ni +-5i2g3ni +imma3nent- +immi3nent- +immis4cent- +impo3tent- +impu3dent- +’i1n1a2 +-5i1n1a2 +’ina1ni +-5ina1ni +’in2a3nit +-5in2a3nit +’inau1gu +-5inau1gu +’in2augur +-5in2augur +inci3dent- +indi3gent- +indo3lent- +indul3gent- +’i1n1e2 +’i1n1é2 +-5i1n1e2 +-5i1n1é2 +’inef1fa +-5inef1fa +’in2effab +-5in2effab +’iné1lu +-5iné1lu +’in2é3luc1ta +-5in2é3luc1ta +’iné1na +-5iné1na +’in2é3nar1ra +-5in2é3nar1ra +’in2ept +-5in2ept +’in2er +-5in2er +’in2exo1ra +-5in2exo1ra +’i1n1i2 +-5i1n1i2 +’ini1mi +-5ini1mi +’in2i3mi1ti +-5in2i3mi1ti +’in2i3q +-5in2i3q +’in2i3t +-5in2i3t +inno3cent- +’i1n1o2 +-5i1n1o2 +’ino1cu +-5ino1cu +’in2o3cul +-5in2o3cul +’in2ond +-5in2ond +inso3lent- +’ins1ta +-5ins1ta +’in1s2tab +-5in1s2tab +’in1te +-5in1te +intelli3gent- +’inte4r3 +-5inte4r3 +’inte1ra2 +-5inte1ra2 +’inte1re2 +’inte1ré2 +-5inte1re2 +-5inte1ré2 +’inte1ri2 +-5inte1ri2 +’inte1ro2 +-5inte1ro2 +’inters2 +-5inters2 +’inte1ru2 +-5inte1ru2 +inti2ment- +’i1n1u2 +-5i1n1u2 +’in2uit +-5in2uit +’in2u3l +-5in2u3l +is3cent- +iva3lent- +.j4 +'j4 +’j4 +4j- +-5j4 +ja3cent- +4je- +2jent- +4jes- +.k4 +'k4 +’k4 +4k- +-5k4 +4ke- +2kent- +4kes- +4kh- +.l4 +'l4 +’l4 +4l- +-5l4 +-5la1te +-la3tent- +.la3tent- +-5la3tent. +4le- +2lent- +4les- +llu2ment- +l2ment- +.m4 +'m4 +’m4 +4m- +-5m4 +-5ma2c3k +-5ma1c2r +-5mac1ro +-5macro1s2c +-5ma1g2n +-5mag1ni +-5magni1ci +-5ma2g3nici1de +-5magni1fi +-5magnifi1ca +-5ma2g3nificat +-5mag1nu +-5ma2g3num +-5ma1la +-5mala1d2r +-5malad1re +-5ma2l1a2dres +-5ma2l1a2d1ro +-5ma2l1ai1sé +-5ma2l1ap +-5ma2l1a2v +-5ma1le +-5ma2l1en +-5ma1li +-5ma2l1int +-5ma1lo +-5ma2l1oc +-5ma2l1o2d +-5ma2r1x +4me- +mécon3tent- +-5mé1go +-5mé2g1oh +4mes- +-5mé2sa +-5mé3san +-5mé1se +-5mé2s1es +-5mé2s1i +-5mé1su +-5mé2s1u2s +-5mé1ta +-5mé1ta1s2ta +-5mil3l +-5mil1li +-5milli1am +mi2ment- +mit3tent- +-5mo1no +-5mono1a2 +-5mono1e2 +-5mono1é2 +-5mono1i2 +-5mono1ï2dé +-5mono1o2 +-5mono1s2 +-5mono1u2 +monova3lent- +munifi3cent- +.n4 +'n4 +’n4 +4n- +.ñ4 +'ñ4 +’ñ4 +4ñ- +-5n4 +-5ñ4 +4ne- +2nent- +4nes- +-5no1no +-5no2n1obs +n3s2at- +n3s2ats- +nutri3ment- +’o4 +4o- +.ó4 +'ó4 +’ó4 +4ó- +.ò4 +'ò4 +’ò4 +4ò- +’ô4 +4ô- +.õ4 +'õ4 +’õ4 +4õ- +.ø4 +'ø4 +’ø4 +4ø- +-5o4 +-5ó4 +-5ò4 +-5ô4 +-5õ4 +-5ø4 +.œ4 +'œ4 +’œ4 +4œ- +-5œ4 +ô2ment- +om2ment- +omnipo3tent- +’on1gu +-5on1gu +-on3guent- +.on3guent- +'on3guent- +’on3guent- +’on3guent. +-5on3guent. +opu3lent- +or2ment- +’oua1ou +-5oua1ou +’o1vi +-5o1vi +’ovi1s2c +-5ovi1s2c +.p4 +'p4 +’p4 +4p- +-5p4 +-5pa1na +-5pa2n1a2f +-5pa2n1a2mé +-5pa2n1a2ra +-5pa1ni +-5pa2n1is +-5pa1no +-5pa2n1o2p2h +-5pa2n1opt +-5pa1ra +-5para1c2h +-5pa2r1a2c1he +-5pa2r1a2c1hè +-5para1s2 +-5pa1re +-pa3rent- +.pa3rent- +-5pa3rent. +-5pa1r2h +-5pa2r3hé +-5pa1te +-pa3tent- +.pa3tent- +-5pa3tent. +4pe- +2pent- +-5pen2ta +-5pe4r +-5pe1r1a2 +-5pe1r1e2 +-5pe1r1é2 +-5pé1ri +-5pe1r1i2 +-5péri1os +-5péri1s2 +-5péri2s3s +-5péri2s3ta +-5péri1u2 +perma3nent- +-5pe1r1o2 +perti3nent- +-5pe1r1u2 +4pes- +4ph- +-5p1ha +-5pha1la +-5phalan3s2t +4p4he- +2phent- +4p4hes- +4ph4le- +4ph4les- +4ph4re- +4ph4res- +4p4le- +2p2lent- +4p4les- +-5p1lu +plu2ment- +-5plu1ri +-5pluri1a +polyva3lent- +-5pon1te +-5pon2tet +-5pos2t3h +-5pos1ti +-5pos2t1in +-5pos2t1o2 +-5pos2t3r +-5post1s2 +4p4re- +-5p1ré +-5pré1a2 +-5pré2a3la +-5pré2au +-5pré1e2 +-5pré1é2 +préémi3nent- +-5pré1i2 +2p2rent- +-5pré1o2 +4p4res- +-5pré1s2 +pré3sent- +-5pré1u2 +privatdo3cent- +privatdo3zent- +-5p1ro +-5pro1é2 +proémi3nent- +-5pro1g2n +-5prog1na +-5pro2g3na1t2h +-5pro1s2cé +-5prou3d2h +pru3dent- +-5p1sy +-5psyc1ho +-5psycho1a2n +-5pud1d2l +.q4 +'q4 +’q4 +4q- +-5q4 +qua2ment- +4que- +2quent- +4ques- +.r4 +'r4 +’r4 +4r- +-5r4 +rai3ment- +ra2ment- +4re- +-5ré1a2 +-5ré2a3le +-5réa1li +-5ré2a3lis +-5ré2a3lit +-5ré2aux +-5ré1e2 +-5ré1é2 +-5ré2el +-5ré2er +-5ré2èr +ré3gent- +-5ré1i2 +-5ré2i3fi +re3lent- +reli2ment- +réma3nent- +2rent- +-5ré1o2 +re3pent- +4res- +-5re1s2 +-5res1ca +-5re2s3cap +-5res1ci +-5re2s3ci1si +-5re2s3ci1so +-5res1co +-5re2s3cou +-5res1c2r +-5re2s3c1ri +-5res1pe +-5re2s3pect +-5res1pi +-5re2s3pir +-5res1p2l +-5resp1le +-5re2s3plend +-5res1po +-5re2s3pons +-5res1q +-5re2s3quil +-5re2s3s +-5res1se +-res3sent- +.res3sent- +-5res3sent. +-5re2s3t +-5res1ta +-5re3s4tab +-5re3s4tag +-5re3s4tand +-5re3s4tat +-5res1té +-5re3s4tén +-5re3s4tér +-5res1ti +-5re3s4tim +-5re3s4tip +-5res1to +-5re3s4toc +-5re3s4top +-5re3s4t2r +-5rest1re +-5re4s5trein +-5rest1ri +-5re4s5trict +-5re4s5trin +-5re3s4tu +-5re3s4ty +résur3gent- +réti3cent- +-5ré1t2r +-5rét1ro +-5rétro1a2 +-5réu2 +-5ré2uss +4r4he- +4r4hes- +ri2ment- +rin3gent- +ru3lent- +ryth2ment- +.s4 +'s4 +’s4 +4s- +.Å¡4 +'Å¡4 +’š4 +4Å¡- +-5s4 +-5Å¡4 +-5sar1me +-sar3ment- +.sar3ment- +-5sar3ment. +4s4ch- +4s4c4he- +4s4c4hes- +4se- +2sent- +ser3gent- +-5ser1me +-ser3ment- +.ser3ment- +-5ser3ment. +ser3pent- +4ses- +-5seu2le +4sh- +4s4he- +2shent- +4s4hes- +slalo2ment- +-5sou1ve +-sou3vent- +.sou3vent- +-5sou3vent. +sporu4lent- +-5s1ta +-5sta2g3n +-5s1ti +-5stil3l +-5su2b1a2 +-5su3b2alt +-5su2b1é2 +-5su3b2é3r +-5su1bi +-5su2b1in +-5su1b2l +-5sub1li +subli2ment- +-5subli1mi +-5su2b3limin +-5su2b3lin +-5su2b3lu +-5su1bu +-5su2b1ur +succu3lent- +su2ment- +-5su2r1a2 +-5su3r2a3t +-5su2r1e2 +-5su2r1é2 +-5su3r2eau +-5su3r2ell +surémi3nent- +-5su3r2et +-5su2r3h +-5su1ri +-5su2r1i2m +-5su2r1inf +-5su2r1int +-5su1ro +-5su2r1of +-5su2r1ox +-5syn1g2n +-5syng1na +-5syn2g3na1t2h +.t4 +'t4 +’t4 +4t- +-5t4 +-5ta1le +-ta3lent- +.ta3lent- +-5ta3lent. +ta2ment- +tan3gent- +4te- +tempéra3ment- +2tent- +ter3gent- +4tes- +testa3ment- +4th- +.þ4 +'þ4 +’þ4 +4þ- +-5þ4 +4t4he- +4t4hes- +4th4re- +4th4res- +to2ment- +tor3rent- +transpa3rent- +4t4re- +2t2rent- +4t4res- +-5t1ri +-5tri1a2c +-5tri1a2n +-5tri1a2t +tri3dent- +-5tri1o2n +trucu3lent- +tu2ment- +turbu3lent- +’u4 +4u- +.ú4 +'ú4 +’ú4 +4ú- +.ù4 +'ù4 +’ù4 +4ù- +’û4 +4û- +.ü4 +'ü4 +’ü4 +4ü- +-5u4 +-5ú4 +-5ù4 +-5û4 +-5ü4 +.v4 +'v4 +’v4 +4v- +-5v4 +4ve- +veni2ment- +2vent- +ventripo3tent- +4ves- +vidi2ment- +4v4re- +2v2rent- +4v4res- +.w4 +'w4 +’w4 +4w- +-5w4 +4we- +2went- +4wes- +.x4 +'x4 +’x4 +4x- +-5x4 +2xent- +’y4 +4y- +.ý4 +'ý4 +’ý4 +4ý- +.ÿ4 +'ÿ4 +’ÿ4 +4ÿ- +-5y4 +-5ý4 +-5ÿ4 +.z4 +'z4 +’z4 +4z- +.ž4 +'ž4 +’ž4 +4ž- +-5z4 +-5ž4 +4ze- +2zent- +4zes- diff --git a/src/librarian/res/hyph-dictionaries/hyph_lt.dic b/src/librarian/res/hyph-dictionaries/hyph_lt.dic new file mode 100644 index 0000000..f69c258 --- /dev/null +++ b/src/librarian/res/hyph-dictionaries/hyph_lt.dic @@ -0,0 +1,1547 @@ +ISO8859-13 +.ap1 +.api1 +.ap3r +.arbi1 +.arti1 +.as3p +.at1 +.ata1 +.at3r +.að3v +.dina1 +.ek3r +.i2ð3 +.iði2 +.kirti1 +.nu1 +.nusi1 +.pie2è +.sam1 +.sida1 +.sk4 +.st4 +.su5kr +.te3s2 +.uk3 +.u2ð3 +.uþ1 +.ás4 +.ðven1 +a1a2 +a1b +a1c +a2ch +a1d +a4dra +a1e +ae2l +a1f +2a1g +a4gr +ag3ra +a5grio +a5gro +a1h +a5inf +ai4sk +ai4tr +a1j +a1k +ak2l +ak2vi +a2kët +a1l +a3li +a5lo1 +a3ly +a3lë +a3lû +a1m +a1n +an3k2l +an4sk +an4tr +a2o +a1p +ap1a4k +ap3ei +ap3i2m +ap3l +a3pr +ap3s2 +a1r +ar1eit +a4rg +ari4s +a1s +asi1 +asi5s +a4sk +as3kl +a3sl +as2mi +as2mu +a5s4n +a4stu +a1t +at3aug +ate5ist +at3i2m +ato1 +atp4 +a4tru +at1ë2 +atû2þ +a4u +au4kl +au4sk +au4sl +au4t3r +a1v +a1w +a1y +a1z +a1à +2a1è +a1æ +a1ë2 +a1á +a1ð +a3ðn +að4tr +að2v +a1ø +a1û2 +a1þ +aþ2l +ba3c +balta1 +ba4sl +2b1b +2b1c +4b3d +bep4 +be3s2 +besi1 +be3t2 +2b1f +2b1g +2b1h +b1j +2b1k +2b1l +b2la +b2liz +3b2lo +b2lu +2b1m +2b1n +2b1p +2b2r +b3ri +2b1s +2b3t +bu4k +2b1v +2b1w +2b1z +2b1è +2b1ð +2b1þ +car4 +2c1b +2c1c +2c1d +2c1f +2c1g +3chi +2c1k +2c1l +2c1m +2c1n +2c1p +2c1r +2c1s +2c1t +cu4 +cuk5 +2c1v +2c1w +2c1z +2c1è +2c1ð +2c1þ +da3b4 +2d1b +2d1c +2d1d +de4k +dema1 +de4pr +de4sp +2d1f +2d1g +2d1h +di4p +di4s +dis5k +2d1j +2d3k +4d3l +2d1m +2d1n +do3ri +2d1p +2d1r +dro1 +dro2b +d2rë +4drø +2d1s +2d1t +du2a +du4k +du5ka +du4sl +2d1v +d3va +dvi3a +2d1w +d4z +2d1è +2d1ð +d4þ +dþio1 +e1a2 +e2a3l +eapi1 +eat1 +e1b2 +ebe1 +e3bl +eb3r +e1c +e2ch +e3d2 +ed3ri +e4dro +ed3rë +e1e +e1f +e1g +eg3ra +e1h +e1ie +ei4k3l +1ein +ei4sk +ei4sl +2eis3t +eist2ra +ei2ð1 +e1j +e1k +e3kr +e1l +e1m +ema5s4 +2e1n +en3k2l +enk4la +eno1 +ens4 +4enta +enu1 +e2o +e3or +e3o2ð +e3p +ep4li +ep4r +epra1 +epri1 +e1r +ere3a4 +eri4s +ero1 +erë2 +e1s +esi5s +es4k +eska1 +e5sko +e3s2v +e1t +e1u4 +euþ3 +e1v +e3vi +e1w +e1y +e1z +e1à +e1è +e1æ +e1ë +e1á4 +eáp3 +eás3k +eát3r +e1ð +e3ðn +eð2v +eðë3 +e1ø +e1û +e1þ +2f1b +2f1c +2f1d +2f1f +2f1g +2f1h +fi4s5 +2f1k +2f1l +2f1m +2f1n +2f1p +2f1r +fri1 +2f1s +2f1t +2f1v +2f1w +2f1z +2f1è +2f1ð +2f1þ +gað3 +2g1b +2g1c +2g1d +ge4o1 +2g1f +2g1g +2g1h +2g1k +2g1l +g2le +g2lo +2g1m +2g1n +3g2nø +2g1p2 +3g2r +grai2 +g3ran +5g3re +g4rei +g3ri +4g4rio +g3ro. +g4rà +5grá +4grø +2g1s +4g1t +3gu +2g1v +2g1w +gyva1 +2g1z +2g1è +2g1ð +2g1þ +2h1b +2h1c +2h1d +2h1f +2h1g +2h1h +hi4b +2h1k +2h2l +2h1m +h2me +2h1n +2h1p +2h1r +2h1s +2h1t +2h1v +2h1w +2h1z +2h1è +2h1ð +2h1þ +i2a +ia5g4 +i3aið +ia3k +i3antæ +i3antë +iap4 +i3ar +i3b2 +i1c +ice1 +i1d +id2r +id3rë +i2dëm +i2e +ie4d3r +ie3g +i3ei +ie3kl +i3ent +ie4p5r +ie4sk +i1f +2i1g +i3g2l +ig3ru +2i1h +i1i2 +i1j +i1k +i3k2n +ik3r +i1l +ilo1 +i1m +1imd +4i1n +in4kl +5inv +i2o +io4g3r +iok2 +io4pl +i3or +i1p +i2p1j +ip3ru +i1r +ira3s2 +i3ri +4i1s +i5sa +i5si +is4k +i3sl +is4li +i5s4n +i4ste +isto1 +2i3t2 +i2u +i1v +i1w +i1y +i1z +i2à +i1è +i1æ +i1ë2 +i1á +i1ð +i3ðn +ið5t +i4ðv +iðë2 +1iðð +i2ø +i2û +i3þ +3ja. +jauna1 +2j1b +2j1c +2j1d +2j1f +2j1g +2j1h +2j1j +2j1k +2j1l +2j1m +2j1n +jot3 +jo4tv +2j1p +2j1r +2j1s +2j1t +1ju +2j1v +2j1w +2j1z +2j1è +2j1ð +1jû +2j1þ +3ka. +5ka3d +kak3 +ka4kl +ka4pr +3kar +3kas +3kati +5kav +kavar1 +ka3z2 +2k1b +2k1c +2k1d +3ke +ke4b3 +keren1 +2k1f +2k1g +2k1h +k4i +5ki. +5kia +3kib +3kil +5kit +2k1k +2k1l +3k2la +k4lan +4kle. +k2lel +4klo. +4klu. +k2ly +4klà +4klø +2k1m +2k1n +3ko +2k1p +2k2r +k4rau +kris2 +kri5st +k3ro +k4rov +4k3ru +5krun +k4ry +k5rà +2k1s +k4sk +ks3l +k4s3p +4k1t +k3ta +3ku +4kub +ku4k +ku4pr +2k1v +k2va +k3vo +k2vë +2k1w +3kyt +2k1z +5kà +2k1è +2k1ð +kð2ly +kðë3 +2k1þ +3la. +lap4s3to +2l1b +lb3r +2l1c +2l1d +3le. +le3c +le4gr +4leè +2l1f +2l1g +lg3s2t +2l1h +3li. +li4a +5li4o +3liø +2l1j +2l1k +lko1 +2l1l +2l1m +2l1n +3lo. +log4 +4lop +4l1p +lpna1 +2l1r +4l1s +l4sk +l4s3p +4l3t +3lu. +2lup +4l1v +2l1w +3lyè +2l1z +3là +2l1è +3læs +3lëm +3lës +2lëè +3lá4 +4l1ð +3lø +2l1þ +m2a +2m3aid +3mas +mas3ki +2m1b +mb3r +2m1c +2m1d +me3c +meis1 +2m1f +2m1g +2m1h +mi4gl +mi4gr +min4s +mi4tr +2m1k +2m1l +2m1m +2m1n +m2o +2mod +2m1p +m4pl +m3pr +2m1r +4m1s +2m1t +m3ta +3muo +2m1v +2m1w +2m1z +2m1è +2m1ð +2m1þ +na3s2 +na3t2 +2n1b +2n1c +ncen1 +2n1d +n3drë +ne1 +neg4 +nei2m +ne4o3 +neor2 +nerë3 +nesi1 +ne3sl +ne3s2t +ne3t2 +neás3t +2n1f +4n1g +ng3l +ng4r +2n1h +ni4s +2n1j +2n1k +nk3la +nk3r +n3kry +2n1l +2n1m +2n1n +5no +2n1p +2n1r +4n1s +ns4ku +ns3l +n4s3p +nst3r +4n1t +n3ta +nt4pl +n3tru +nt2ruo +nua4 +nu3b2 +nu3g +nu1i +nuk2 +nu4o3 +nuos2 +nu5s4 +2n1v +2n1w +2n1z +4n1è +2n1ð +2n1þ +o1a +o1b +o1c +o1d +o3dr +o1e +o2et +o1f +o1g +o1h +o1i +o1j +o1k +o3kr +o1l +olen1 +o1m +om4pr +o1n +ono1 +o1o2 +o1p +o1r +o2rie +ori4s +or4tr +o2ræ +o1s +o3sl +os3le +os4lo +o3s2v +o3t2 +oto1 +o1v +o1w +o1y +o1z +o1à +o1è +o1æ +o1ë +o1á +o1ð +oð2v +o1ø +o1û +o1þ +pa3 +pad2 +pai2l +pai2m +pai2r +3pan +pap4 +p2ar +parsi1 +pa4r1ë2 +pas2 +pa5sr +p2at2 +2p1b +4p1c +4p3d2 +p2e +per1 +pe2re +pe2r3im +per3s +pe2rë +2p1f +2p1g +2p1h +p2i +p3ieð +2p3k2 +3p2l +p3le +p3li +4plio +p4liu +p3lo +p4loj +p4lu +p4ly +2p1m +4p1n +3po +po4g +poli1 +2p1p +2p2r +p3rai +prau2si +p3rað +p3ri +pris2 +p5ro. +p3rom +p3ry +4prà +p3rë +p3rû +4p1s +psi1 +p5s4k +p4s3ty +p3s2v +4p3t2 +3p4u +pusiau1 +pu4sk +pu4sl +pu4tr +2p1v +2p1w +p2y +2p1z +2p1è +p2ë +4p3ð2 +4p3þ +r2a +3ra. +ra3b +3rac +ra1im +rai4tá +ra3kr +3ral +3ram +ras4l +ra3sm +rau4ka. +3rav +2r1b +rbo1 +r3b4r +2r1c +4r1d +2reb +4rein +4reit +3rel +re4p5 +5res +res3l +3ret +2r1f +2r1g +2r1h +r2i +3ri. +ri3d +3rij +ri3kr +2ril +ri2ma. +2r3imt +3rio +ri3p +risi1 +ri3st +rivin1 +3rià +3riø +2riû +4r1k +rk3ly +r3k4r +4r1l +2r1m +4r1n +r2o +3rod2 +ro4gr +3roj +3rok +3ron +3rop +2r3org +5ros +2r1p +r3p4r +2r1r +4r1s +rs4ko. +rs4p +4r1t +rti5k4 +rti3s2 +r3t2r +r3t2v +r2u +2ruk +3rul +4run +3ruos +2rup +3rus +ru4sk +4ruto +4r1v +2r1w +2r1z +3rà +4ràs +4r1è +4r1ð +r3ð2l +r3ð2m +5rø +2r1þ +sala1 +2s1amþ +san5t +sarka1 +2s3b +2s1c +2s3d +s2e +se4kr +senat4 +2s1f +2s1g +2s1h +si3auk +si3a2v +si3a2ð +si3d +si3k4 +si3p4 +si3s2 +si5ð2v +3s2k2 +4sk. +s5ka. +4ske +5s4ken +5ski +5s4kle +5sk4r +5skub +sk3va +sk3vi +5sky +4skà +5skæ +2s2l +3sle +s3li +s3lo +4s3lu +4s3lû +2s1m +4sme. +4smæ +4s3n +so4dr +3s2p +s3pe +4spn +4spu +4s1r +s3ri +2s1s +2s1t +s2tal +s2ten +4stin +s2tod +s2toj +3s2tov +st2rai +st2v +4stæ +4s3të +4stø +s2tû +su1 +su3bl +su3d2 +su3g2 +suk2l +su3s2 +susi1 +suþ4 +2s1v +s2ve +3s2vy +2s1w +2s1z +sà3 +4s3è +5së +2s1ð +2s1þ +t2a +2tab +ta3kr +ta5s +2tat +taura1 +2taè +2t1b +2t1c +2t1d +2teb +3tem +te4o +te3t2 +2t1f +4t3g +2t1h +t2i +ti4gr +ti4k3l +3tin +2tip +4t3j +4t3k +t4kl +4t3l +4t3m +2t1n +t2o +3toje +2tolá +to3s2 +2tow +2t3p +t4pj +tp3lû +tp4r +2t1r +4trio +t2rið +4tro +4trà +4trø +4t3s4 +tsi1 +tskri1 +4t1t +tua4 +3tur +2t1v +t2vo +4tvëj +2t1w +3tyd +2t1z +2t1è +3tæ +t2ëm +t3ëmu +t3ëmæ +t3ëmë +2t3ð2 +2t3þ +u1a2 +u3ai +u1b +u2bj +u1c +u1d +u1e2 +u1f +u1g +ug4r +ug5rio +u1h +u1i2m +u5in +ui2r +u1j +u1k +u3kl +uk2le +u3kr +u3kv +u5kø +u1l +u1m +u1n +u2o +u3or +uo4sl +u3p +up4l +up3ro +u1r +urk2 +ur3kl +u5ro1 +ur3s2 +u1s +u2s1al +u3sl +us3la +us3le +usva1 +us3ve +u3t2 +uto1 +2utr +u1u +u1v +u1w +u1y +u1z +u1à +u1è +u1æ +u1ë2 +u1á +u1ð +u3ð2l +u3ð2n +uð2v +u1ø +u1û2 +u1þ +uþi2m +u3þl +uþ3v +uþ1ë2 +3va. +vap4 +va3t +2v1b +2v1c +2v1d +v2e +2vep +3ves +2v1f +2v1g +2v1h +viesia1 +vi4s5k +vi4t3r +2v1j +2v1k +2v1l +2v1m +2v1n +2v1p +2v1r +2v4s +2v1t +2v1v +2v1w +2vydau +2v1z +3và +2v1è +3vë +4vëp +2v1ð +2v1þ +2w1b +2w1c +2w1d +2w1f +2w1g +2w1h +2w1k +2w1l +2w1m +2w1n +2w1p +2w1r +2w1s +2w1t +2w1v +2w1w +2w1z +2w1è +2w1ð +2w1þ +y1a +y1b +y1c +y1d +y1e +y1f +y1g +ygia1 +y1h +y1i +y1j +y1k +y4k3l +y1l +y1m +y1n +y1o +y1p +y3r +y1s +y4sk +y1t +y1u +y1v +y1w +y1y +y1z +y1à +y1è +y1æ +y1ë +y1á +y1ð +y1ø +y1û +y1þ +2z1b +2z1c +2z1d +2z1f +2z1g +2z1h +2z1k +2z1l +2z1m +2z1n +2z1p +2z1r +2z1s +2z1t +2z1v +2z1w +2z1z +2z1è +2z1ð +2z1þ +à1a +à1b +à1c +à1d +à1e +à1f +à1g +à1h +à1i +à1j +à1k +à1l +à1m +à1n +à1o +à1p +à1r +à1s +à1t +à1u +à1v +à1w +à1y +à1z +à1à +à1è +à1æ +à1ë +à1á +à1ð +à1ø +à1û +à1þ +2è1b +2è1c +2è1d +èeko1 +2è1f +2è1g +2è1h +èin1 +2è1k +2è1l +2è1m +2è1n +2è1p +2è1r +2è1s +2è1t +2è1v +2è1w +2è1z +2è1è +2è1ð +2è1þ +æ1a +æ1b +æ1c +æ1d +æ1e +æ1f +æ1g +æ1h +æ1i +æ1j +æ1k +æ1l +æ1m +æ1n +æ1o +æ1p +æ1r +æ1s +æ1t +æ1u +æ1v +æ1w +æ1y +æ1z +æ1à +æ1è +æ1æ +æ1ë +æ1á +æ1ð +æ1ø +æ1û +æ1þ +ë1a +ë1b +ë1c +ë1d +ë1e +ë1f +ë1g +ë1h +ë1i +ë1j +ë1k +ë4k3l +2ë3l +ë1m +ë3me +ë1n +ë1o +ë1p +ë1r +2ë1s +ës3l +2ë3t +ë4tr +ë1u +ë1v +ë1w +ë1y +ë1z +ë1à +ë1è +ë1æ +ë1ë +ë1á +ë1ð +ë1ø +ë1û +ë1þ +á1a +á1b +á1c +á1d2 +á2e +á1f +á4g +á1h +á1i +á1j +á2k4 +á2l +á2m +á1n +á1o +á4p +á2r +á1s +ási1 +ás3l +ás2m +ás2r +ást2 +á2t2 +á1u +á2v +á1w +á1y +á1z +á1à +á1è +á1æ +á1ë2 +á1á +á1ð +á1ø +á1û +á1þ +2ð1b2 +2ð1c +2ð3d2 +ð1ei +ðe2v +2ð1f +2ð1g4 +2ð1h +2ð5ist +ðiuk1 +2ð1k2 +2ð1l +ð2lij +ð2lu +3ðly +2ð1m +2ð1n +ð2ne +ðno1 +ðo2r +2ð1p4 +2ð1r +2ð3s4 +ðsi1 +ðsikap1 +4ð3t2 +ðu4ð +3ð1v +ð2vi +ð4vyd +2ð1w +2ð1z +4ð3è +ðë2j +2ð1ð +2ð1þ +ø1a +ø1b +ø1c +ø1d +ø1e +ø1f +ø1g +ø1h +ø1i +ø1j +ø1k +ø1l +ø1m +ø1n +ø1o +ø1p +ø1r +ø1s +ø1t +ø1u +ø1v +ø1w +ø1y +ø1z +ø1à +ø1è +ø1æ +ø1ë +ø1á +ø1ð +ø1ø +ø1û +ø1þ +û1a +û1b +û1c +û1d +û1e +û1f +û1g +û1h +û1i +û1j +û1k +û4k3l +û1l +û1m +û1n +û1o +û1p +û1r +û1s +û4s3k +ûs3l +ûs3t +û1t +û1u +û1v +û1w +û1y +û1z +û1à +û1è +û1æ +û1ë +û1á +û1ð +û1ø +û1û +û1þ +þant4 +þants5 +2þ3b2 +2þ1c +2þ3d2 +þen1 +2þ3f4 +2þ3g +2þ1h +þi3mu +þio3 +þ1j +2þ3k2 +2þ1l +þ2lu +4þ1m +2þ1n +2þ3p +2þ1r +2þ1s +þsi1 +þ4sk +þ4s5l +þs3t +4þ3t2 +þ2u +þu3s2 +3þ2v +þ4vi +þ3vo +2þ1w +2þ1z +2þ1è +þás3 +2þ1ð +2þ1þ diff --git a/src/librarian/res/hyph-dictionaries/hyph_pl.dic b/src/librarian/res/hyph-dictionaries/hyph_pl.dic new file mode 100644 index 0000000..6d5aeb5 --- /dev/null +++ b/src/librarian/res/hyph-dictionaries/hyph_pl.dic @@ -0,0 +1,4824 @@ +ISO8859-2 +.a1 +.a2b1s +.a2b2s3t +.a2d3 +.a1d4a1 +.ad4e1 +.ad4i1 +.ad4o1 +.ad4u1 +.ad4y1 +.ad5a2p1t +.ad5i2u1 +.ad5op +.ad5or +.ae2 +.ae3ro1 +.a1eroa2 +.ae1roe2 +.aeroi2 +.aero1o2 +.aerou2 +.a2n1t +.anty1 +.a1ntya2 +.antye2 +.antyi2 +.antyo2 +.antyu2 +.a2r1c +.arcy1 +.arcy3b2 +.arcy3b1z2 +.arcy3k2 +.arcy3³2 +.arcy3m2 +.a1rcya2 +.arcye2 +.arcyi2 +.arcyo2 +.arcyu2 +.a2u1 +.au3g2 +.au3k2 +.au3t2 +.auto1 +.auto3c4h2 +.a1utoa2 +.autoe2 +.autoi2 +.auto1o2 +.a1utotra1 +.autotra2n2s3 +.au1tou2 +.b8 +.4b3b8 +.2b1c8 +.2b1æ8 +.2b1d8 +.be1 +.be2z3 +.beza1 +.be3z4an +.be1ze1 +.be3z4ec +.bezi1 +.be3z4ik +.be2z1c +.bezc4h2 +.bezm2 +.bezo2 +.bezo2b1j +.bezw2 +.be4z3z +.bezzw2 +.2b1f8 +.2b1g8 +.bh8 +.bj8 +.2b1k8 +.bl8 +.b³8 +.2b1m8 +.2b1n8 +.2b1ñ8 +.2b1p8 +.br8 +.br4z8 +.2b1s8 +.2b1¶8 +.2b1t8 +.bv8 +.bw8 +.bx8 +.2b1z8 +.2b1¼8 +.2b1¿8 +.c8 +.ca1 +.ca³o1 +.ca³o3k2 +.ca³o3¶2 +.2c1b8 +.4c3c8 +.2c1æ8 +.2c1d8 +.2c1f8 +.2c1g8 +.c4h8 +.c2h2r +.chr4z8 +.ci1 +.ci2e1 +.cie2n1k +.cienko1 +.cienko3w2 +.ciep³o1 +.ciep³o3kr2 +.cj8 +.2c1k8 +.2c1l8 +.c³8 +.2c1m8 +.2c1n8 +.2c1ñ8 +.2c1p8 +.cr8 +.2c1s8 +.2c1¶8 +.2c1t8 +.cv8 +.cw8 +.cx8 +.c4z8 +.cza1 +.cza2r1n +.czarno1 +.czarno3k2 +.2c2z1k8 +.2c2z1t +.czte1 +.czte1re1 +.cztere2c4h3 +.cztere2c2h1s +.czte1re1chse1 +.czterechse2t3 +.cztero1 +.cztero3¶2 +.czwó1 +.czwó2r3 +.czwó3r4a1 +.czwó3r4±1 +.czwó3r4e1 +.czwó3r4ê1 +.czwó3r4o1 +.2c1¼8 +.2c1¿8 +.æ8 +.2æ1b8 +.2æ1c8 +.4æ3æ8 +.2æ1d8 +.2æ1f8 +.2æ1g8 +.æh8 +.æj8 +.2æ1k8 +.æl8 +.æ³8 +.2æ1m8 +.2æ1n8 +.2æ1ñ8 +.2æ1p8 +.ær8 +.2æ1s8 +.2æ1¶8 +.2æ1t8 +.æv8 +.æw8 +.æwi1 +.æwi2e1 +.æwie2r2æ3 +.æx8 +.2æ1z8 +.2æ1¼8 +.2æ1¿8 +.d8 +.da1 +.dale1 +.daleko1 +.daleko3w2 +.2d1b8 +.2d1c8 +.2d1æ8 +.4d3d8 +.de1 +.de2z3 +.deza2 +.dezabi1 +.de3z4a3bil +.de3z4a3wu1 +.de1ze1 +.de3z4el +.de3z4er +.de3z4y1 +.dezo2 +.2d1f8 +.2d1g8 +.dh8 +.dj8 +.2d1k8 +.dl8 +.d³8 +.d³u1 +.d³ugo1 +.d³ugo3tr2 +.d³ugo3w2 +.2d1m8 +.2d1n8 +.2d1ñ8 +.do1 +.do3b2 +.do3c2 +.do3æ2 +.do3d2 +.do3f2 +.do3g2 +.do3h2 +.do3k2 +.do3l2 +.do3³2 +.do3m2 +.do3p2 +.do3r2 +.do3s2 +.do3¶2 +.do3t2 +.do3w2 +.do3z2 +.do3¼2 +.do3¿2 +.do4k3t +.do4l3n +.do4³3k +.do4m3k +.do4r3s +.do4w3c +.do5m4k2n +.dobr2 +.dobr4z2 +.doc4h2 +.doc4z2 +.dod4z2 +.dod4¼2 +.dod4¿2 +.dogr4z2 +.do2p1c +.dopc4h2 +.dopr4z2 +.dor4z2 +.do2r1¿2 +.dosc4h2 +.dosm2 +.dos4z2 +.do2t1k2 +.dotr2 +.2d1p8 +.dr8 +.dro1 +.dro1go1 +.drogo3w2 +.dr4z8 +.2d1s8 +.2d1¶8 +.2d1t8 +.dv8 +.dw8 +.dwó1 +.dwó2j3 +.dwó3j4a1 +.dwó3j4±1 +.dwó3j4e1 +.dwó3j4ê1 +.dwó3j4o1 +.dx8 +.dy1 +.dy2s3 +.dy2z3 +.dy3s4e1 +.dy3s4o1 +.dy3s4ta1 +.dy3s4y1 +.dy3s4z +.dy3z4e1 +.dyzu2 +.d4z8 +.dzi1 +.dzi2e1 +.dzi1esi1 +.dziesi2ê1 +.dzi1esi1êci1 +.dziesiêci2o1 +.dziesiêcio3¶2 +.dzi1ewi1 +.dziewi2ê1 +.dziewiê2æ3 +.dzi1ewi1êci1 +.dziewiêci2o1 +.dziewiêcio3¶2 +.dziewiê2æ1s +.dzie1wiêæse1 +.dziewiêæse2t3 +.d4¼8 +.d4¿8 +.e1 +.e2k2s3 +.e1me1 +.emes4z +.e1me1sze1 +.e2m3e2s5ze2t +.e1se1 +.e2s1e2s1ma1 +.e2s1ha1 +.e2s1t +.ego1 +.egoa2 +.e1goe2 +.egoi2 +.ego1o2 +.egou2 +.eks4y1 +.e1le1 +.ele2k1t +.elektro1 +.elektroa2 +.e1le1ktroe2 +.elektroi2 +.elektro1o2 +.elektrou2 +.f8 +.fb8 +.2f1c8 +.fæ8 +.fd8 +.4f3f8 +.fg8 +.fh8 +.fj8 +.2f1k8 +.fl8 +.f³8 +.2f1m8 +.2f1n8 +.fñ8 +.fp8 +.fr8 +.fs8 +.f¶8 +.ft8 +.fv8 +.fw8 +.fx8 +.fz8 +.f¼8 +.f¿8 +.g8 +.2g1b8 +.2g1c8 +.2g1æ8 +.2g1d8 +.ge1 +.ge2o3 +.2g1f8 +.4g3g8 +.gh8 +.gj8 +.2g1k8 +.gl8 +.g³8 +.2g1m8 +.gn8 +.2g1ñ8 +.go1 +.go2u3 +.2g1p8 +.gr8 +.gru1 +.grubo1 +.grubo3w2 +.gr4z8 +.2g1s8 +.2g1¶8 +.2g1t8 +.gv8 +.gw8 +.gx8 +.2g1z8 +.2g1¼8 +.2g1¿8 +.h8 +.2h1b8 +.2h1c8 +.2h1æ8 +.2h1d8 +.2h1f8 +.2h1g8 +.4h3h8 +.hi1 +.hipe1 +.hipe2r3 +.hipe3r4o1 +.hipera2 +.hipe1re2 +.2h1j8 +.2h1k8 +.2h1l8 +.2h1³8 +.2h1m8 +.2h1n8 +.2h1ñ8 +.2h1p8 +.2h1r8 +.2h1s8 +.2h1¶8 +.2h1t8 +.hv8 +.2h1w8 +.hx8 +.2h1z8 +.2h1¼8 +.2h1¿8 +.i1 +.i2n3 +.i2s3l +.i1ni1 +.i3n4ic +.i3n4o1 +.i3n4u1 +.i4n5o2k +.i2n1f +.infla1 +.in4f3lan +.ino3w2 +.izo1 +.izoa2 +.izoe2 +.i1zoi2 +.izo1o2 +.izou2 +.j8 +.ja1 +.jad³o1 +.jad³o3w2 +.2j1b8 +.2j1c8 +.2j1æ8 +.2j1d8 +.2j1f8 +.2j1g8 +.2j1h8 +.4j3j8 +.2j1k8 +.2j1l8 +.2j1³8 +.2j1m8 +.2j1n8 +.2j1ñ8 +.2j1p8 +.2j1r8 +.2j1s8 +.2j1¶8 +.2j1t8 +.jv8 +.2j1w8 +.jx8 +.2j1z8 +.2j1¼8 +.2j1¿8 +.k8 +.2k1b8 +.2k1c8 +.2k1æ8 +.2k1d8 +.2k1f8 +.2k1g8 +.kh8 +.ki1 +.ki2l1k +.kilku1 +.kilkuse1 +.kilkuse2t3 +.kilkuseto2 +.kj8 +.4k3k8 +.kl8 +.k³8 +.2k1m8 +.2k1n8 +.2k1ñ8 +.ko1 +.ko1³o1 +.ko³o3w2 +.ko2n1t +.kon2t2r3 +.kon3tr4a1 +.kon3tr4e1 +.ko1ntro2 +.kon3tr4o3l +.kon3tr4o3w +.kon3tr4y1 +.kon4tr5a2gi1 +.kon4tr5a2se1 +.kon4tr5a2sy1 +.kon4tr5a2ta1 +.kon4tr5a2d1m +.kon4tr5a2k1c +.kon4tr5a2l1t +.kon4tr5a2r1g +.kontru2 +.2k1p8 +.kr8 +.kro1 +.kro2æ3 +.kró1 +.kró2t1k +.krótko1 +.krótko3tr2 +.krótko3w2 +.kr4z8 +.2k1s8 +.2k1¶8 +.2k1t8 +.kv8 +.kw8 +.kx8 +.2k1z8 +.2k1¼8 +.2k1¿8 +.l8 +.2l1b8 +.2l1c8 +.2l1æ8 +.2l1d8 +.2l1f8 +.2l1g8 +.2l1h8 +.2l1j8 +.2l1k8 +.4l3l8 +.2l1³8 +.2l1m8 +.2l1n8 +.2l1ñ8 +.2l1p8 +.2l1r8 +.2l1s8 +.2l1¶8 +.2l1t8 +.lu1 +.ludo1 +.ludo3w2 +.lv8 +.2l1w8 +.lx8 +.2l1z8 +.2l1¼8 +.2l1¿8 +.³8 +.2³1b8 +.2³1c8 +.2³1æ8 +.2³1d8 +.2³1f8 +.2³1g8 +.2³1h8 +.2³1j8 +.2³1k8 +.2³1l8 +.4³3³8 +.2³1m8 +.2³1n8 +.2³1ñ8 +.2³1p8 +.2³1r8 +.2³1s8 +.2³1¶8 +.2³1t8 +.³v8 +.2³1w8 +.³x8 +.2³1z8 +.2³1¼8 +.2³1¿8 +.m8 +.2m1b8 +.2m1c8 +.2m1æ8 +.2m1d8 +.2m1f8 +.2m1g8 +.2m1h8 +.mi1 +.mi1li1 +.mili2a1 +.mili3a2m1p +.2m1j8 +.2m1k8 +.2m1l8 +.2m1³8 +.4m3m8 +.2m1n8 +.2m1ñ8 +.mo1 +.mo2¿1n +.mo1¿no1 +.mo¿no3w2 +.2m1p8 +.2m1r8 +.2m1s8 +.2m1¶8 +.2m1t8 +.mv8 +.2m1w8 +.mx8 +.2m1z8 +.2m1¼8 +.2m1¿8 +.n8 +.na1 +.na2d2 +.na2j +.na3b2 +.na3c2 +.na3æ2 +.nad3i2 +.na3d4ir +.nad3³2 +.nad³u1 +.na3d4³ub +.na2d3m2 +.nadmu1 +.na3d4muc4h +.nad3r2 +.na3d4r2w +.nadre1 +.nadre2p1c +.na3d4repc4z +.na3d4re2p1t +.nadrê1 +.na3d4rêc4z +.nadru1 +.na3d4ruk +.na3d4r4z +.nad3w2 +.nadwo1 +.na3d4wo2r1n +.na1da1 +.na3daj +.na3d±1 +.na3de1 +.na3dê1 +.na3do1 +.na3dy1 +.nad4z2 +.na3dzi1 +.na3d4¼2 +.na3f2 +.na3g2 +.na3h2 +.na1ja1 +.na3ja2z1d +.na3j±1 +.na3je1 +.na3jê1 +.na3k2 +.na3l2 +.na3³2 +.na3m2 +.na3p2 +.na3r2 +.na3s2 +.na3¶2 +.na3t2 +.na3u2 +.na3w2 +.na3z2 +.na3¼2 +.na3¿2 +.na4d3o2b2³ +.nado1bo1 +.nadobo2j1c +.na4d3o2bojc4z +.na4d3o2bowi1 +.nado1bro1 +.na4d3o2brot +.na4d3o2dr4z +.nadoki1 +.nadoki2e1 +.na4d3o2kien +.nado2l1b +.na4d3olbr4z +.na4d5rz±1 +.nadrze1 +.na4d5rzec4z +.na4d5rzê1 +.na4d5rzy1 +.nadzi2e1 +.na4d5ziem +.na4f3c +.na4f3t +.na4j3e2f +.na4j3e2g +.na4j3e2k2s +.na4j3e2ko1 +.na4j3e2n +.na4j3e2r +.na4j3e2s +.na4j3e2w +.na4j3e2m1f +.na4j3e2u1 +.na4r3c +.na4r3d +.na4r3k +.na4r3r +.na4r3t +.nabr4z2 +.nac4h2 +.nac4z2 +.na2d3b2 +.na2d3c2 +.na2d3æ2 +.na4d3d2 +.nade3t2 +.na1deta1 +.nad3e2tat +.na2d3f2 +.na2d3g2 +.nad3h2 +.nad3j2 +.na2d3k2 +.nad3l2 +.na2d3n2 +.na2d3p2 +.na2d3s2 +.na2d3¶2 +.na2d3t2 +.nad3u2 +.na2dz1m +.nadzmy1 +.nad5z2mys +.nad5zo1 +.nad5zó1 +.nadzwy1 +.nad5zwyc4z +.nad5¿2 +.nadc4h2 +.nadc4z2 +.nadd4¼2 +.nade3b2 +.nade3c2 +.nade3æ2 +.nade3d2 +.nade3f2 +.nade3g2 +.nade3h2 +.nade3k2 +.nade3l2 +.nade3³2 +.nade3m2 +.nade3p2 +.nade3r2 +.nade3s2 +.nade3¶2 +.nade3w2 +.nade3z2 +.nade3¼2 +.nade3¿2 +.nade4p3c +.nade4p3n +.nade4p3t +.nadec4h2 +.nadec4z2 +.naded4z2 +.naded4¼2 +.naded4¿2 +.nader4z2 +.nade2r1¿2 +.nades4z2 +.nads4z2 +.nad¶ro1 +.nad¶rod4z +.nad¶rodzi1 +.nad¶rodzi2e1 +.nad¶rod5ziem +.nadtr2 +.nagr4z2 +.naj3a2k1t +.naj3a2u1 +.na2j3b2 +.na2j3c2 +.na2j3æ2 +.na2j3d2 +.na2j3f2 +.na2j3g2 +.na2j3h2 +.naj3i2 +.na2j3k2 +.na2j3l2 +.na2j3³2 +.na2j3m2 +.naj3o2 +.naj3o2b2 +.naj3o2c2 +.naj3o2æ2 +.naj3o2d2 +.naj3o2f2 +.naj3o2g2 +.naj3o2h2 +.naj3o2k2 +.naj3o2l2 +.naj3o2³2 +.naj3o2m2 +.naj3o2p2 +.naj3o2r2 +.naj3o2s2 +.naj3o2¶2 +.naj3o2t2 +.naj3o2w2 +.naj3o2z2 +.naj3o2¼2 +.naj3o2¿2 +.na2j3p2 +.na2j3r2 +.najro1 +.naj3ro2z3 +.na2j3s2 +.na2j3¶2 +.na2j3t2 +.naj3u2 +.na2j3w2 +.na2j3z2 +.na2j3¼2 +.na2j3¿2 +.najbe1 +.najbe2z3 +.najbezw2 +.najc4h2 +.najc4z2 +.najdo1 +.najdo3b2 +.najdo3c2 +.najdo3æ2 +.najdo3d2 +.najdo3f2 +.najdo3g2 +.najdo3h2 +.najdo3k2 +.najdo3l2 +.najdo3³2 +.najdo3m2 +.najdo3p2 +.najdo3r2 +.najdo3s2 +.najdo3¶2 +.najdo3t2 +.najdo3w2 +.najdo3z2 +.najdo3¼2 +.najdo3¿2 +.najdoc4h2 +.najdoc4z2 +.najdod4z2 +.najdod4¼2 +.najdod4¿2 +.najdor4z2 +.najdos4z2 +.najdo2t1k2 +.najd4z2 +.najd4¼2 +.najd4¿2 +.najkr2 +.najo2b3c2 +.najo2b3æ2 +.najo2b3d2 +.najo2b3f2 +.najo2b3g2 +.najob3h2 +.najob3j2 +.najo2b3k2 +.najob3l2 +.najob3³2 +.najo2b3m2 +.najo2b3n2 +.najo2b3p2 +.najo2b3s2 +.najo2b3¶2 +.najo2b3t2 +.najob3w2 +.najo2b3¼2 +.najo2b3¿2 +.najobc4h2 +.najobc4z2 +.najobd4z2 +.najobd4¼2 +.najobd4¿2 +.najobr4z2 +.najobs4z2 +.najoc4h2 +.najoc4z2 +.najo2d3c2 +.najo2d3æ2 +.najo4d3d2 +.najo2d3f2 +.najo2d3g2 +.najod3h2 +.najod3j2 +.najo2d3k2 +.najod3l2 +.najo2d3m2 +.najo2d3n2 +.najo2d3p2 +.najo2d3s2 +.najo2d3¶2 +.najo2d3t2 +.najod3w2 +.najod5¿2 +.najodc4h2 +.najodc4z2 +.najodd4z2 +.najodd4¼2 +.najodd4¿2 +.najods4z2 +.najod4z2 +.najod4¼2 +.najor4z2 +.najos4z2 +.najro3z4u1 +.najr4z2 +.najsm2 +.najs4z2 +.naj2t1k2 +.naj2t1r2 +.najuc4z2 +.najzw2 +.nakr2 +.napo1 +.napo2d2 +.napo3b2 +.napo3c2 +.napo3æ2 +.napo3f2 +.napo3g2 +.napo3h2 +.napo3k2 +.napo3l2 +.napo3³2 +.napo3m2 +.napo3p2 +.napo3r2 +.napo3s2 +.napo3¶2 +.napo3t2 +.napo3w2 +.napo3z2 +.napo3¼2 +.napo3¿2 +.napo4m3p +.napoc4h2 +.napoc4z2 +.napo4d3d +.napod4¼2 +.napod4¿2 +.napo2m1k2 +.napor4z2 +.napos4z2 +.napr4z2 +.naro1 +.naro2z3 +.nar4z2 +.na2r1¿2 +.nasm2 +.nas4z2 +.na2t1c +.natc4h2 +.na2t1k2 +.naz3m2 +.nazw2 +.2n1b8 +.2n1c8 +.2n1æ8 +.2n1d8 +.ne1 +.ne2o3 +.2n1f8 +.2n1g8 +.2n1h8 +.ni1 +.ni2e1 +.nie3b2 +.nie3c2 +.nie3æ2 +.nie3d2 +.nie3f2 +.nie3g2 +.nie3h2 +.nie3k2 +.nie3l2 +.nie3³2 +.nie3m2 +.nie3p2 +.nie3r2 +.nie3s2 +.nie3¶2 +.nie3t2 +.nie3u2 +.nie3w2 +.nie3z2 +.nie3¼2 +.nie3¿2 +.nie4c3c +.nie4c3k +.nie4d4¼3 +.nie4m3c +.nie4m3k +.niec4h2 +.niec4z2 +.niedo1 +.niedo3b2 +.niedo3c2 +.niedo3æ2 +.niedo3d2 +.niedo3f2 +.niedo3g2 +.niedo3h2 +.niedo3k2 +.niedo3l2 +.niedo3³2 +.niedo3m2 +.niedo3p2 +.niedo3r2 +.niedo3s2 +.niedo3¶2 +.niedo3t2 +.niedo3w2 +.niedo3z2 +.niedo3¼2 +.niedo3¿2 +.niedobr4z2 +.niedoc4h2 +.niedoc4z2 +.niedod4z2 +.niedod4¼2 +.niedod4¿2 +.niedokr2 +.niedo2m1k2 +.niedo2p1c +.niedopc4h2 +.niedor4z2 +.niedos4z2 +.niedo2t1k2 +.nied4z2 +.nied4¿2 +.nieo2 +.nieob2 +.nieo2b3c2 +.nieo2b3æ2 +.nieo2b3d2 +.nieo2b3f2 +.nieo2b3g2 +.nieob3h2 +.nieob3j2 +.nieo2b3k2 +.nieo2b3m2 +.nieo2b3p2 +.nieo2b3s2 +.nieo2b3¶2 +.nieob3w2 +.nieo2b3¼2 +.nieo2b3¿2 +.nieobc4h2 +.nieobc4z2 +.nieobd4z2 +.nieobd4¼2 +.nieobd4¿2 +.nieobs4z2 +.nieoc2 +.nieoc4h2 +.nieoc4z2 +.nieoæ2 +.nieod2 +.nieo2d3c2 +.nieo2d3æ2 +.nieo4d3d2 +.nieo2d3f2 +.nieo2d3g2 +.nieod3h2 +.nieod3j2 +.nieo2d3k2 +.nieod3l2 +.nieod3³2 +.nieo2d3n2 +.nieo2d3p2 +.nieo2d3s2 +.nieo2d3¶2 +.nieo2d3t2 +.nieodw2 +.nieod3w1r +.nieod5¿2 +.nieodc4h2 +.nieodc4z2 +.nieodd4z2 +.nieodd4¼2 +.nieodd4¿2 +.nieods4z2 +.nieod4z2 +.nieod4¼2 +.nieof2 +.nieog2 +.nieoh2 +.nieok2 +.nieol2 +.nieo³2 +.nieom2 +.nieop2 +.nieor2 +.nieor4z2 +.nieos2 +.nieos4z2 +.nieo¶2 +.nieot2 +.nieow2 +.nieoz2 +.nieo¼2 +.nieo¿2 +.niepo1 +.niepo2d2 +.niepo3b2 +.niepo3c2 +.niepo3æ2 +.niepod3³2 +.niepo3d4³u1 +.niepo2d3m2 +.niepodmu1 +.niepo3d4muc4h +.niepod3r2 +.niepodra1 +.niepo3d4rap +.niepo3d4ra¿ +.nie1podre1 +.niepodre2p1c +.niepo3d4repc4z +.niepo3d4re2p1t +.niepodrê1 +.niepo3d4rêc4z +.niepod3w2 +.niepodwa1 +.niepo3d4waj +.niepo1dwo1 +.niepo3d4woj +.niepo3do1 +.niepo3du1 +.niepo3d4z2 +.niepo3d4¼2 +.niepo3f2 +.niepo3g2 +.niepo3h2 +.niepo3k2 +.niepo3l2 +.niepo3³2 +.niepo3m2 +.niepo3p2 +.niepo3r2 +.niepo3s2 +.niepo3¶2 +.niepo3t2 +.niepo3w2 +.niepo3z2 +.niepo3¼2 +.niepo3¿2 +.niepodoc4h +.niepo1do1cho1 +.niepo4d3o2choc +.niepo4d3o2str4z +.niepoc4h2 +.niepoc4z2 +.niepo2d3b2 +.niepo2d3c2 +.niepo2d3æ2 +.niepo4d3d2 +.niepo2d3f2 +.niepo2d3g2 +.niepod3h2 +.niepod3j2 +.niepo2d3k2 +.niepod3l2 +.niepo2d3n2 +.niepo2d3p2 +.niepo2d3s2 +.niepo2d3¶2 +.niepo2d3t2 +.niepod5¿ +.niepodc4h2 +.niepodc4z2 +.niepodd4¼2 +.niepodd4¿2 +.niepodsm2 +.niepods4z2 +.niepor4z2 +.nieposm2 +.niepos4z2 +.niepr4z +.nie1prze1 +.nieprze2d2 +.nieprze3b2 +.niepr4ze3br4z2 +.nieprze3c2 +.nieprze3æ2 +.nieprzed3³2 +.nieprzed³u1 +.nieprze3d4³u¿ +.nieprze2d3m2 +.nieprzedmu1 +.nieprze3d4muc4h +.nieprzed3r2 +.nieprzedra1 +.nieprzedra1ma1 +.nieprze3d4ramat +.nieprzedru1 +.nieprze3d4ruk +.nieprzedry1 +.nieprze3d4ryl +.niepr4ze3d4r4z2 +.nieprzed3u2 +.nieprze3d4um +.nieprze3dy1 +.nieprze3d4z2 +.nieprze3d4¼2 +.nie1prze1e2 +.nieprze3e2k2s3 +.nieprze3f2 +.nieprze3g2 +.nieprze3h2 +.nieprze3k2 +.nieprze3l2 +.nieprze3³2 +.nieprze3m2 +.nieprze3n2 +.nieprze3p2 +.nieprze3r2 +.nieprze3s2 +.nieprze3¶2 +.nieprze3t2 +.nieprze3w2 +.nieprze3z2 +.nieprze3¼2 +.nieprze3¿2 +.nieprzed³u¿y1 +.nieprze4d5³u¿yc +.nieprze4d5z2a1 +.nieprze4d5z1g2 +.ni1eprzedzi1 +.nieprze4d5zim +.nieprze4d5zj +.nieprze4d5z1l +.nieprze4d5z2w2r +.nieprzedzwo1 +.nieprze4d5zwoj +.nieprze4d5¿2 +.nieprzec4h2 +.nieprzec4z2 +.nieprze2d3c2 +.nieprze2d3æ2 +.nieprze4d3d2 +.nieprze2d3f2 +.nieprze2d3g2 +.nieprzed3h2 +.ni1eprzed3i2 +.nieprzed3j2 +.nieprze2d3k2 +.nieprzed3l2 +.nieprze2d3n2 +.nieprze2d3p2 +.nieprze2d3s2 +.nieprzed3s4z2 +.nieprze2d3¶2 +.nieprze2d3t2 +.nieprzed3w2 +.nieprzedc4h2 +.nieprzedc4z2 +.nieprzedd4z2 +.nieprzedd4¼2 +.nieprzedd4¿2 +.niepr4zegr4z2 +.nieprzekl2 +.nieprzekr2 +.nieprze2³1k2 +.nieprze2p1c +.nieprzepc4h2 +.niepr4zer4z2 +.nieprze2r1¿2 +.nieprzesc4h2 +.nieprzesm2 +.nieprzes4z2 +.nieprze2t1k2 +.nieprzetr2 +.niero1 +.niero2z3 +.nie1ro3z4e1 +.niero3z4u1 +.nierozbr4z2 +.nieroze3r2 +.nierozm2 +.niero2z1¶2 +.niero2z1t +.nieroztr2 +.nier4z2 +.niesu1 +.niesu2b3 +.ni1esubi1 +.ni2e1su3b4i2e1 +.nies4z2 +.nie2t1k2 +.nietr2 +.nieuc4z2 +.nieuw2 +.niewy1 +.niewy3b2 +.niewy3c2 +.niewy3æ2 +.niewy3d2 +.niewy3f2 +.niewy3g2 +.niewy3h2 +.niewy3k2 +.niewy3l2 +.niewy3³2 +.niewy3m2 +.niewy3p2 +.niewy3r2 +.niewy3s2 +.niewy3¶2 +.niewy3t2 +.niewy3w2 +.niewy3z2 +.niewy3¼2 +.niewy3¿2 +.niewybr4z2 +.niewyc4h2 +.niewyc4z2 +.niewyd4z2 +.niewyd4¼2 +.niewyd4¿2 +.niewyr4z2 +.niewys4z2 +.niewy2t1k2 +.niewytr2 +.niezw2 +.2n1j8 +.2n1k8 +.2n1l8 +.2n1³8 +.2n1m8 +.4n3n8 +.2n1ñ8 +.2n1p8 +.2n1r8 +.2n1s8 +.2n1¶8 +.2n1t8 +.nv8 +.2n1w8 +.nx8 +.2n1z8 +.2n1¼8 +.2n1¿8 +.ñ8 +.2ñ1b8 +.2ñ1c8 +.2ñ1æ8 +.2ñ1d8 +.2ñ1f8 +.2ñ1g8 +.2ñ1h8 +.2ñ1j8 +.2ñ1k8 +.2ñ1l8 +.2ñ1³8 +.2ñ1m8 +.2ñ1n8 +.2ñ1ñ8 +.2ñ1p8 +.2ñ1r8 +.2ñ1s8 +.2ñ1¶8 +.2ñ1t8 +.ñv8 +.2ñ1w8 +.ñx8 +.2ñ1z8 +.2ñ1¼8 +.2ñ1¿8 +.o1 +.o2b2 +.o2d2 +.ot2 +.o2t1c +.otc4h +.o2t3c2h2³ +.ob3l2 +.oblu1 +.o3b4luzg +.ob3³2 +.o3b4³±1 +.o3b4³ê1 +.o1b³o1 +.o3b4³oc +.ob3r +.obra1 +.o3b4raæ +.o3b4raso1 +.o1bro1 +.o3b4ron +.o3b4roñ +.obry1 +.o3b4ryz +.o3b4ry¼ +.o3b4r4z2 +.o3be1 +.o3bi1 +.od3i2 +.o3d4i2u1 +.od3r2 +.odra1 +.o3d4rap +.odrê1 +.o3d4rêt +.o1dro1 +.odrobi1 +.o3d4robin +.odru1 +.o3d4rut +.od2r1w +.o3d4rwi1 +.odr4z2 +.odrze1 +.o3d4rzeæ +.o3d4rz2w +.od5z2 +.odzi1 +.o3d6zi2a1 +.o3d6zi2e1 +.o3de1 +.o2l1¶ +.o3l2¶n +.o4b5³oc4z +.o4b5rz±1 +.obrze1 +.o4b5rzez +.obrzê1 +.o4b5rzêd +.obrzu1 +.o4b5rzuc +.o4b5rzut +.obrzy1 +.o4b5rzyn +.o4d7ziar +.o4d7ziem +.oa2 +.oa3z +.o2b3c2 +.o2b3æ2 +.o2b3d2 +.o2b3f2 +.o2b3g2 +.ob3h2 +.ob3j2 +.o2b3k2 +.o2b3m2 +.o2b3n2 +.o1bo1 +.ob3o2str4z +.o2b3p2 +.o2b3s2 +.o2b3¶2 +.o2b3t2 +.obu1 +.ob3u2m2 +.ob3w2 +.o2b3¼2 +.o2b3¿2 +.obc4h2 +.obc4z2 +.obd4z2 +.obd4¼2 +.obd4¿2 +.obe3b2 +.obe3c2 +.obe3æ2 +.obe3d2 +.obe3f2 +.obe3g2 +.obe3h2 +.obe3k2 +.obe3l2 +.obe3³2 +.obe3m2 +.obe3p2 +.obe3r2 +.obe3r3t +.obe3s2 +.obe3¶2 +.obe3t2 +.obe3w2 +.obe3z2 +.obe3¼2 +.obe3¿2 +.obe4c3n +.obe4z3w +.obec4h2 +.obec4z2 +.obed4z2 +.obed4¼2 +.obed4¿2 +.obe2r3m +.ober4z2 +.obe2r1¿2 +.obesc4h2 +.obes4z2 +.obe2t1k2 +.obi3b2 +.obs4z2 +.oc2 +.oc4h2 +.oc2h2r +.ochr4z2 +.oc4z2 +.oæ2 +.oda1 +.od3a2u1 +.o2d3b2 +.o2d3c2 +.o2d3æ2 +.o4d3d2 +.o2d3f2 +.o2d3g2 +.od3h2 +.o1d3i2zo1 +.od3j2 +.o2d3k2 +.od3l2 +.o2d3m2 +.o2d3n2 +.o1do1 +.od3o2s +.o2d3p2 +.o2d3s2 +.o2d3¶2 +.o2d3t2 +.odu1 +.od3u2c4z +.od3u2m2 +.od3w2 +.od5¿2 +.odbe1 +.odbe2z3 +.odc4h2 +.odc4z2 +.odd4z2 +.odd4¼2 +.odd4¿2 +.ode3b2 +.ode3c2 +.ode3æ2 +.ode3d2 +.ode3f2 +.ode3g2 +.ode3h2 +.ode3k2 +.ode3l2 +.ode3³2 +.ode3m2 +.ode3m1k2 +.ode3p2 +.ode3r2 +.ode3s2 +.ode3¶2 +.ode3t2 +.ode3w2 +.ode3z2 +.ode3¼2 +.ode3¿2 +.odec4h2 +.odec4z2 +.oded4z2 +.oded4¼2 +.oded4¿2 +.ode2p1c +.odepc4h2 +.oder4z2 +.ode2r1¿2 +.odes4z2 +.ode2t1c +.odetc4h2 +.ode2t1k2 +.odkr4z2 +.ods4z2 +.od4¼2 +.of2 +.og2 +.ogni1 +.o1gni2o1 +.ognio3tr2 +.ogó1 +.ogó2l1n +.o1gólno1 +.ogólno3k2 +.oh2 +.ok2 +.oka1 +.oka3m2 +.okr2 +.ole1 +.o1le2o3 +.om2 +.op2 +.o2p1c +.opc4h2 +.o2r1t +.or2tê1 +.or4z2 +.o2r2¿2 +.os2 +.osi1 +.osi2e1 +.osie2m3 +.osie2m1s +.osie1mse1 +.osiemse2t3 +.os4z2 +.o¶2 +.o¶mi1 +.o1¶mi2o1 +.o¶mio3¶2 +.ow2 +.oz2 +.o¼2 +.o¿2 +.p8 +.2p1b8 +.2p1c8 +.pc4h8 +.2p1æ8 +.2p1d8 +.pe1 +.pe2r3 +.pe3c2k +.pe3r4e1 +.pe3r4i1 +.pe3r4o1 +.pe3r4u1 +.pe3r4y1 +.pe4r5i2n +.pe1e2 +.pe1e1se1 +.pee2se2l +.pe2³1n +.pe³no1 +.pe³no3kr2 +.pe1pe1 +.pe1pe1e2 +.pepee2r +.pepee2s +.pe1ze1 +.peze2t1p +.pe1ze1tpe1 +.pe1ze1tpe1e2 +.peze2t1pee2r +.2p1f8 +.2p1g8 +.ph8 +.pi1 +.pi2e1 +.pie2r1w +.pierwo1 +.pierwo3w2 +.pi2ê1 +.piê2æ3 +.pi1êci1 +.piêci2o1 +.piêcio3¶2 +.piê2æ1s +.piêæse1 +.piêæse2t3 +.pi2o1 +.pio1no1 +.piono3w2 +.pj8 +.2p1k8 +.pl8 +.p³8 +.p³a1 +.p³asko1 +.p³asko3w2 +.2p1m8 +.2p1n8 +.2p1ñ8 +.po1 +.po2d2 +.po3b2 +.po3c2 +.po3æ2 +.pod3³2 +.po3d4³u1 +.po2d3m2 +.podmu1 +.po3d4muc4h +.po2d3n2 +.podna1 +.po3d4naw +.pod3r2 +.pod2r1w +.po3d4r2wi1 +.podra1 +.po3d4rap +.po3d4ra¿ +.podre1 +.podre2p1c +.po3d4repc4z +.po3d4re2p1t +.podrê1 +.po3d4rêc4z +.po3d4rêtw +.po1dro1 +.po3d4roba1 +.po3d4ro1bo1 +.po3d4robó1 +.po3d4roby1 +.po3d4roc4z +.po3d4ro¿ +.podró1 +.po3d4ró¿ +.podru1 +.po3d4ruzg +.podry1 +.po3d4ryg +.podr4z +.po3d4rze1 +.pod3w2 +.podwa1 +.po3d4waj +.po1dwo1 +.po3d4woi2 +.po3d4woj +.po3d4wor4z +.podwó1 +.po3d4wó2j1n +.po3d4wór +.po3da1 +.po3d±1 +.po3de1 +.po3dej +.po3dê1 +.podi1 +.po3di2u1 +.po3do1 +.po3du1 +.po3dy1 +.po3d4z2 +.po3d4¼2 +.poe2 +.po3e2k2s3 +.po3f2 +.po3g2 +.po3h2 +.po3k2 +.po3l2 +.po3³2 +.po3m2 +.po3p2 +.po3r2 +.po3r1¿ +.po3s2 +.po3¶2 +.po3t2 +.po3w2 +.po3z2 +.po3¼2 +.po3¿2 +.poc4z2 +.po4c2z3d +.po4c2z3t +.pode3k2 +.po4d3e4k2s3 +.podobi1 +.podobi2a1 +.po4d3o2biad +.po1do1bo1 +.podobo2j1c +.po4d3o2bojc4z +.podobó1 +.po4d3o2bóz +.podobra1 +.po4d3o2braz +.podoc4h +.po1do1cho1 +.po4d3o2choc +.po4d3o2d1m +.po4d3o2f +.po4d3o2g +.podoki1 +.podoki2e1 +.po4d3o2kien +.po4d3o2k1n +.podokre1 +.po4d3o2kres +.podokrê1 +.po4d3o2krêg +.podopi1 +.podopi2e1 +.po4d3o2piec4z +.podory1 +.po4d3o2ryw +.podosi1 +.podosi1ni1 +.podosini2a1 +.po4d3o2siniak +.po4d3o2str4z +.podo2b1s +.po4d3obs4z +.po4d3o4d3d +.podo2l1b +.po4d3olbr4z +.podó1 +.po4d3ów +.po4d3u2c4z +.po4d3u2d4z +.po4d3u2pa1 +.podura1 +.po4d3u2ral +.po4d3u2sta1 +.podus4z +.podu2s2z1c +.po4d3u2szc4z +.po4d5rê2cz1n +.podza1 +.po4d5zakr +.po4d5zam +.po4d5zast +.po2dz1b +.po4d5zbi1 +.po4d5ze1 +.podzi1 +.podzi2e1 +.podzie1le1 +.podzi1eleni1 +.po4d5zieleni2±1 +.po4d5zielenic +.po4d5zieleniæ +.podzi2e1le1ni2e1 +.po4d5zielenien +.po4d5zieleni2ê1 +.po4d5zielenil +.po4d5zieleni³ +.po4d5zielenim +.po4d5zieleni2o1 +.po4d5zielenis +.po4d5ziem +.po1dzi2o1 +.po4d5ziom +.po4d5z2w2r +.po4l3s +.po4m3p +.po4ñ3c +.po4r3c +.po4r3f +.po4r3n +.po4r3t +.po4s2t3d +.po4s2t3f +.po4s2t3g +.po4st3h +.po4st3i2 +.po4s2t3k +.po4st3l +.po4s2t3m +.po4s2t3p +.po1stro1 +.po4st3rom +.po4s2t3s +.poduszczy1 +.po5d4uszczyn +.po5r4tê1 +.pobr2 +.pobr4z2 +.poc4h2 +.poc2h2r +.pochr4z2 +.pod3a2l1p +.po2d3b2 +.po2d3c2 +.po2d3æ2 +.po4d3d2 +.po2d3f2 +.po2d3g2 +.pod3h2 +.pod3i2n +.pod3j2 +.po2d3k2 +.pod3l2 +.po2d3p2 +.po2d3s2 +.po2d3¶2 +.pod¶ró1 +.pod3¶ró2d5 +.po2d3t2 +.pod5¿2 +.podc4h2 +.podc4z2 +.podd4¼2 +.podd4¿2 +.pode3b2 +.pode3c2 +.pode3æ2 +.pode3d2 +.pode3f2 +.pode3g2 +.pode3h2 +.pode3l2 +.pode3³2 +.pode3m2 +.pode3p2 +.pode3r2 +.pode3s2 +.pode3¶2 +.pode3t2 +.pode3t1k2 +.pode3w2 +.pode3z2 +.pode3¼2 +.pode3¿2 +.podec4h2 +.podec4z2 +.poded4z2 +.poded4¼2 +.poded4¿2 +.pode2p1c +.podepc4h2 +.poder4z2 +.pode2r1¿2 +.podesc4h2 +.podes4z2 +.podro2z3 +.podsm2 +.pods4z2 +.pogr4z2 +.pokl2 +.pokr2 +.po2³1k2 +.pom4p1k +.po2m1k2 +.pona1 +.pona2d2 +.pona3b2 +.pona3c2 +.pona3c4z2 +.pona3æ2 +.po1na3do1 +.pona3d4¼2 +.pona3f2 +.pona3g2 +.pona3h2 +.pona3k2 +.pona3l2 +.pona3³2 +.pona3m2 +.pona3p2 +.pona3r2 +.pona3s2 +.pona3¶2 +.pona3t2 +.pona3w2 +.pona3z2 +.pona3¼2 +.pona3¿2 +.pona4f3t +.ponabr4z2 +.ponac4h2 +.pona2d3c2 +.ponad3c4h2 +.ponad3c4z2 +.pona2d3æ2 +.pona4d3d +.ponad3d4¼2 +.pona2d3f2 +.pona2d3g2 +.ponad3h2 +.ponad3j2 +.pona2d3k2 +.ponad3l2 +.pona2d3p2 +.pona2d3s2 +.pona2d3¶2 +.pona2d3t2 +.ponad4z2 +.ponar4z2 +.ponasm2 +.ponas4z2 +.ponaz3m2 +.ponazw2 +.poni1 +.poni2e1 +.ponie3k2 +.ponie3w2 +.po2p1c +.popc4h2 +.po1po1 +.popo3w2 +.popr4z2 +.por4t1w +.por4t1f +.por4t1m +.po1ro1 +.poro2z3 +.poro3z4u1 +.por4z2 +.posc4h2 +.posm2 +.pos4z2 +.po2t1k2 +.potr2 +.poz4m2 +.poza1 +.poza3u2 +.pozw2 +.pó1 +.pó2³3 +.pó3³4±1 +.pó³e1 +.pó3³4ec4z +.pó3³4ê1 +.pó3³4y1 +.pó2³1k2 +.pó³kr2 +.pó2³1m2 +.pó³o2 +.pó³ob3r +.pó³o2m2d +.pó2³1p +.pó³pr4z +.pó³przy1 +.pó³przy3m2k +.4p3p8 +.pr8 +.pra1 +.pra3s2 +.pra2w1n +.pra3w2nu1 +.pra3w2z +.pra1pra1 +.prapra2w1n +.prapra3w2nu1 +.pre1 +.predy1 +.predy2s3po1 +.pr4z8 +.prze1 +.prze2d2 +.prze3b2 +.prze3c2 +.prze3æ2 +.przed3³2 +.przed³u1 +.prze3d4³u¿ +.prze2d3m2 +.przedmu1 +.prze3d4muc4h +.przed3o2 +.prze3d4o3br +.prze3d4o3st +.prze3d4o3zo1 +.przed3r2 +.przedra1 +.przedra1ma1 +.prze3d4ramat +.przedru1 +.prze3d4ruk +.przedry1 +.prze3d4ryl +.pr4ze3d4r4z2 +.przed3u2 +.prze3d4um +.prze3d±1 +.prze3dê1 +.prze3dy1 +.prze3d4z2 +.prze3d4¼2 +.prze1e2 +.prze3e2k2s3 +.prze3f2 +.prze3g2 +.prze3h2 +.prze3k2 +.prze3l2 +.prze3³2 +.prze3m2 +.prze3n2 +.prze3p2 +.prze3r2 +.prze3s2 +.prze3¶2 +.prze3t2 +.prze3u2 +.prze3w2 +.prze3z2 +.prze3¼2 +.prze3¿2 +.przed³u¿y1 +.prze4d5³u¿yc +.przedosta1 +.prze4d5o4stat +.prze4d5za1 +.prze4d5z1g2 +.przedzi1 +.prze4d5zim +.prze4d5zj +.prze4d5z1l +.prze4d5z2w2r +.przedzwo1 +.prze4d5zwoj +.prze4d5¿2 +.przebr2 +.pr4zebr4z2 +.przec4h2 +.przec2h2r +.pr4zechr4z2 +.przeci1 +.przeci2w3 +.przeci1wi1 +.prze1ci3w4i2e1 +.przeciwa2 +.przeci4w3w2 +.przec4z2 +.przeda1 +.przedago1 +.przed3a2gon +.przed3a2k1c +.przed3a2l1p +.prze2d3b2 +.prze2d3c2 +.prze2d3æ2 +.prze4d3d2 +.prze1de1 +.przed3e2g1z +.prze1de1me1 +.przed3e2mer +.prze2d3f2 +.prze2d3g2 +.przed3h2 +.przed3i2 +.przed3j2 +.prze2d3k2 +.przed3l2 +.prze2d3n2 +.prze2d3p2 +.prze2d3s2 +.przedsi1 +.przedsi2ê1 +.przed3siê3w2 +.przed3s4z2 +.prze2d3¶2 +.prze2d3t2 +.przed3w2 +.przedc4h2 +.przedc4z2 +.przedd4z2 +.przedd4¼2 +.przedd4¿2 +.pr4zedgr4z2 +.przedy2s3ku1 +.pr4zegr4z2 +.przekl2 +.przekr2 +.prze2³1k2 +.prze2m1k2 +.prze2p1c +.przepc4h2 +.pr4zer4z2 +.prze2r1¿2 +.przesc4h2 +.przesm2 +.przes4z2 +.prze2t1k2 +.przetr2 +.przetra1 +.przetra2n2s3 +.przy1 +.przy3b2 +.przy3c2 +.przy3æ2 +.przy3d2 +.przy3f2 +.przy3g2 +.przy3h2 +.przy3k2 +.przy3l2 +.przy3³2 +.przy3m2 +.przy3p2 +.przy3r2 +.przy3s2 +.przy3¶2 +.przy3t2 +.przy3w2 +.przy3z2 +.przy3¼2 +.przy3¿2 +.przybr2 +.przyc4h2 +.przyc4z2 +.przyd4z2 +.przyd4¼2 +.przyd4¿2 +.pr4zygr4z2 +.przy2m1k2 +.przyo2 +.przyoz2 +.przy2p1c +.przypc4h2 +.pr4zyr4z2 +.przy2r1¿2 +.przysc4h2 +.przys4z2 +.przy2t1k2 +.2p1s8 +.2p1¶8 +.2p1t8 +.pv8 +.pw8 +.px8 +.2p1z8 +.2p1¼8 +.2p1¿8 +.r8 +.2r1b8 +.2r1c8 +.2r1æ8 +.2r1d8 +.re1 +.retra1 +.retra2n2s3 +.2r1f8 +.2r1g8 +.2r1h8 +.2r1j8 +.2r1k8 +.2r1l8 +.2r1³8 +.2r1m8 +.2r1n8 +.2r1ñ8 +.ro1 +.ro2z3 +.ro3z4a1 +.ro3z4e1 +.ro3z4e3b2 +.ro3z4e3c2 +.ro3z4e3æ2 +.ro3z4e3d2 +.ro3z4e3f2 +.ro3z4e3g2 +.ro3z4e3h2 +.ro3z4e3k2 +.ro3z4e3l2 +.ro3z4e3³2 +.ro3z4e3m2 +.ro3z4e3p2 +.ro3z4e3r2 +.ro3z4e3s2 +.ro3z4e3¶2 +.ro3z4e3t2 +.ro3z4e3w2 +.ro3z4e3z2 +.ro3z4e3¼2 +.ro3z4e3¿2 +.ro3z4ej +.ro3z4u1 +.ro4z5a2gi1 +.rozani1 +.ro4z5a2ni2e1 +.ro4z5e2mo1 +.ro4z5e4g3z +.ro4z5e4n3t +.rozbr4z2 +.ro2z1d2 +.rozec4h2 +.rozec4z2 +.rozed4z2 +.rozed4¼2 +.rozed4¿2 +.roze2p1c +.rozepc4h2 +.rozer4z2 +.roze2r1¿2 +.rozesc4h2 +.rozes4z2 +.rozi2 +.rozm2 +.ro1zo2 +.ro2z1p +.ro1zpo1 +.rozpo3w2 +.ro2z1¶2 +.ro2z1t2 +.roztr2 +.rozw2 +.2r1p8 +.4r3r8 +.2r1s8 +.2r1¶8 +.2r1t8 +.rv8 +.2r1w8 +.rx8 +.r4z8 +.2r1¼8 +.2r1¿8 +.s8 +.sa1 +.samo1 +.samo3c4h2 +.samo3k2 +.samo3p2 +.samo3w2 +.samo1ro1 +.samoro2z3 +.2s1b8 +.sc8 +.sc4h8 +.sæ8 +.2s1d8 +.2s1f8 +.2s1g8 +.sh8 +.si1 +.si2e1 +.sie1de1 +.siede2m3 +.siede2m1s +.sie1de1mse1 +.siedemse2t3 +.sie2d1m +.si1edmi1 +.siedmi2o1 +.siedmio3¶2 +.sj8 +.sk8 +.sk±1 +.sk±d4¿ +.sk±2d5¿e1 +.skl8 +.skr8 +.sl8 +.s³8 +.sm8 +.sn8 +.sñ8 +.so1 +.so1bo1 +.sobo3w2 +.sp8 +.spo1 +.spo2d2 +.spo3b2 +.spo3c2 +.spo3æ2 +.spo3d4z2 +.spo3f2 +.spo3g2 +.spo3h2 +.spo3k2 +.spo3l2 +.spo3³2 +.spo3m2 +.spo3p2 +.spo3r2 +.spo3s2 +.spo3¶2 +.spo3t2 +.spo3w2 +.spo3z2 +.spo3¼2 +.spo3¿2 +.spo4r3n +.spo4r3t +.spoc4h2 +.spoc4z2 +.spo4d3d +.spod4¼2 +.spod4¿2 +.spor4z2 +.spos4z2 +.spó1 +.spó2³3 +.sr8 +.2s1s8 +.s¶8 +.st8 +.ste1 +.ste1re1 +.stere2o3 +.stereoa2 +.ste1re1oe2 +.stereoi2 +.stereo1o2 +.stereou2 +.su1 +.su2b3 +.subi1 +.su3b4i2e1 +.subo1 +.su3b4o2t1n +.supe1 +.supe2r3 +.supera1 +.supe3r4at +.superi1 +.supe3r4i2o1 +.supe4r5a2tr +.super4z +.supe2r5z2b +.supe1re2 +.supero1 +.superodr4z +.su1perodrzu1 +.supero2d1rzut +.sv8 +.sw8 +.sx8 +.s4z8 +.sze1 +.sze2s3 +.sze4¶2æ3 +.sze¶1c +.sze1¶2ci1 +.sze¶ci2o1 +.sze¶cio3¶2 +.sze¶2æ1s +.sze1¶æse1 +.sze¶æse2t3 +.2s1¼8 +.2s1¿8 +.¶8 +.2¶1b8 +.¶1c8 +.¶æ8 +.2¶1d8 +.2¶1f8 +.2¶1g8 +.¶h8 +.¶j8 +.2¶1k8 +.¶l8 +.¶³8 +.¶m8 +.¶n8 +.¶ñ8 +.2¶1p8 +.¶r8 +.¶ró1 +.¶ró2d5 +.¶ródr2 +.2¶1s8 +.2¶1¶8 +.2¶1t8 +.¶v8 +.¶w8 +.¶wi1 +.¶wi2a1 +.¶wiat³o1 +.¶wiat³o3w2 +.¶x8 +.2¶1z8 +.2¶1¼8 +.2¶1¿8 +.t8 +.ta1 +.ta2o3 +.tar4z +.ta1rza1 +.ta2r7zan +.2t1b8 +.2t1c8 +.tc4h8 +.2t1æ8 +.2t1d8 +.te1 +.te2o3 +.2t1f8 +.2t1g8 +.th8 +.tj8 +.2t1k8 +.tl8 +.t³8 +.2t1m8 +.2t1n8 +.2t1ñ8 +.to1 +.toa3 +.2t1p8 +.tr8 +.tra1 +.tra2n2s3 +.tran3s4e1 +.transi1 +.tran3s4i2e1 +.tran3s4y1 +.tran3s4z +.tran4s5e2u1 +.tra1nsa2 +.transo2 +.tró1 +.tró2j3 +.tró3j4±1 +.tróje1 +.tró3j4ec4z +.tró3j4ê1 +.tr4z8 +.trze1 +.trze2c4h3 +.trze2c2h1s +.trze1chse1 +.trzechse2t3 +.2t1s8 +.2t1¶8 +.4t3t8 +.tv8 +.tw8 +.tx8 +.ty1 +.tysi1 +.tysi2±1 +.tysi±2c3 +.tysi±3c4a1 +.tysi±3c4e1 +.tysi±3c4z +.tysi±4c5z³ +.2t1z8 +.2t1¼8 +.2t1¿8 +.u1 +.u3b2 +.u3c2 +.u3d2 +.u3f2 +.u3g2 +.u3h2 +.u3k2 +.u3l2 +.u3³2 +.u3m2 +.u3n2 +.u3p2 +.u3r2 +.u3s2 +.u3t2 +.u3w2 +.u3z2 +.u3¼2 +.u3¿2 +.u4d3k +.u4f3n +.ukle1 +.u4k3lej +.u4l3s +.u4l3t +.u2m1b +.u4m3br +.u4n3c +.u4n3d +.u4p3p +.u4p3p2s +.u4r3s +.u4s2t3n +.u4s2t1c +.u4s2t1k +.u4z3be1 +.ube1 +.ube2z3 +.ubezw2 +.ubr2 +.uc4h2 +.uc4z2 +.uæ2 +.ud4z2 +.ud4¼2 +.ud4¿2 +.ukr2 +.u2m1k2 +.u2p1c +.upc4h2 +.upo1 +.upo2d2 +.upo3b2 +.upo3c2 +.upo3æ2 +.upo3da1 +.upo3f2 +.upo3g2 +.upo3h2 +.upo3k2 +.upo3l2 +.upo3³2 +.upo3m2 +.upo3p2 +.upo3r2 +.upo3s2 +.upo3¶2 +.upo3t2 +.upo3w2 +.upo3z2 +.upo3¼2 +.upo3¿2 +.upoc4h2 +.upoc4z2 +.upo4d3d +.upod4¼2 +.upod4¿2 +.upor4z2 +.upos4z2 +.uro1 +.uro2z3 +.ur4z2 +.u2r1¿2 +.usc4h2 +.us4z2 +.u¶2 +.u2t1k2 +.utr2 +.uze1 +.uze3w2 +.v8 +.vb8 +.vc8 +.væ8 +.vd8 +.vf8 +.vg8 +.vh8 +.vj8 +.vk8 +.vl8 +.v³8 +.vm8 +.vn8 +.vñ8 +.vp8 +.vr8 +.vs8 +.v¶8 +.vt8 +.vv8 +.vw8 +.vx8 +.vz8 +.v¼8 +.v¿8 +.w8 +.2w1b8 +.2w1c8 +.2w1æ8 +.2w1d8 +.we1 +.we3b2 +.we3c2 +.we3æ2 +.we3d2 +.we3f2 +.we3g2 +.we3h2 +.we3k2 +.we3l2 +.we3³2 +.we3m2 +.we3n2 +.we3p2 +.we3r2 +.we3s2 +.we3¶2 +.we3t2 +.we3w2 +.we3z2 +.we3¿2 +.we4k3t +.we4l3w +.we4³3n +.we4n3d +.we4n3t +.we4r3b +.we4r3d +.we4r3n +.we4r3s +.we4r3t +.we4s3pr4z +.wes2t1c +.we4s3tc4h2 +.we4z3br +.we4z3g³ +.wec4h2 +.wec4z2 +.wed4z2 +.wed4¼2 +.wed4¿2 +.we2m1k2 +.we2p1c +.wepc4h2 +.wer4z2 +.wes4z2 +.we2t1k2 +.we2w1n +.wewn±1 +.wewn±2tr4z3 +.2w1f8 +.2w1g8 +.wh8 +.wi1 +.wi2e1 +.wielo1 +.wielo3d2 +.wielo3k2 +.wielo3¶2 +.wielu1 +.wie1luse1 +.wieluse2t3 +.wi2l1c +.wilc4z +.wilczo1 +.wilczo3m2 +.2w1j8 +.2w1k8 +.2w1l8 +.2w1³8 +.2w1m8 +.2w1n8 +.wni1 +.wni2e1 +.wniebo1 +.wniebo3w2 +.2w1ñ8 +.wo1 +.wo1do1 +.wodo3w2 +.2w1p8 +.2w1r8 +.2w1s8 +.wspó1 +.wspó2³3 +.wspó³i2 +.wspó³o1 +.wspó³o2b3w +.wspó³u2 +.wspó2³1w2 +.ws4z +.wsze1 +.wsze2c4h3 +.wszecho2 +.wszec2h2w2 +.2w1¶8 +.2w1t8 +.wv8 +.4w3w8 +.wx8 +.wy1 +.wy3b2 +.wy3c2 +.wy3æ2 +.wy3d2 +.wy3f2 +.wy3g2 +.wy3h2 +.wy3k2 +.wy3l2 +.wy3³2 +.wy3m2 +.wyo2 +.wy3o2d3r +.wy3p2 +.wy3r2 +.wy3s2 +.wy3¶2 +.wy3t2 +.wy3w2 +.wy3z2 +.wy3¼2 +.wy3¿2 +.wyc4z2 +.wy4cz3ha1 +.wy2¿1s +.wy4¿3s4z +.wybr2 +.wybr4z2 +.wyc4h2 +.wydr2 +.wyd4z2 +.wyd4¼2 +.wyd4¿2 +.wye2 +.wye2k2s3 +.wygr4z2 +.wyi2 +.wyi2zo1 +.wykl2 +.wykr2 +.wykr4z2 +.wy2m1k2 +.wy2p1c +.wypc4h2 +.wypr4z2 +.wyr4z2 +.wy2r1¿2 +.wysc4h2 +.wysm2 +.wys4z2 +.wy2t1c +.wytc4h2 +.wy2t1k2 +.wytr2 +.2w1z8 +.2w1¼8 +.2w1¿8 +.x8 +.xb8 +.xc8 +.xæ8 +.xd8 +.xf8 +.xg8 +.xh8 +.xj8 +.xk8 +.xl8 +.x³8 +.xm8 +.xn8 +.xñ8 +.xp8 +.xr8 +.xs8 +.x¶8 +.xt8 +.xv8 +.xw8 +.xx8 +.xz8 +.x¼8 +.x¿8 +.z8 +.za1 +.za3b2 +.za3c2 +.za3æ2 +.za3d2 +.za3f2 +.za3g2 +.za3h2 +.za3k2 +.za3l2 +.za3³2 +.za3m2 +.zao2 +.za3o2b3r +.za3o2b3s +.za3p2 +.za3r2 +.za3s2 +.za3¶2 +.za3t2 +.za3u2 +.za3w2 +.za3z2 +.za3¼2 +.za3¿2 +.za4k3t +.za4l3g +.za4l3k +.za4l3t +.za4m3k +.za2r1c +.za4r3c4h +.za4uto1 +.za5m4k2n +.zabr2 +.zabr4z2 +.zac4h2 +.zac4z2 +.zado1 +.zado2¶æ3 +.zado¶æu4 +.zadr2 +.zady1 +.zady2s3po1 +.zad4z2 +.zad4¼2 +.zad4¿2 +.zagr4z2 +.zai2 +.zai2n3 +.zai2zo1 +.zai1ni1 +.zain4ic +.zakl2 +.zakr2 +.zakr4z2 +.zani1 +.zani2e1 +.zanie3d2 +.zar4z2 +.za2r1¿2 +.zasc4h2 +.zasm2 +.zas4z2 +.za2t1k2 +.zatr2 +.zb8 +.2z1c8 +.2z1æ8 +.2z1d8 +.zde1 +.zde2z3 +.zdeza1 +.zde3z4awu1 +.zde1ze1 +.zde3z4el +.zde3z4er +.zde3z4y1 +.zdy1 +.zdysko1 +.zdy2s3ko2n1t +.zdyskre1 +.zdy2s3kred +.zdyskwa1 +.zdy2s3kwal +.ze1 +.ze3b2 +.ze3c2 +.ze3æ2 +.ze3d2 +.ze3f2 +.ze3g2 +.ze3h2 +.ze3k2 +.ze3l2 +.ze3³2 +.ze3m2 +.ze3p2 +.ze3r2 +.ze3s2 +.ze3¶2 +.ze3t2 +.ze3t1k2 +.ze3w2 +.ze3z2 +.ze3¼2 +.ze3¿2 +.ze4r3k +.ze1te1 +.ze1te1me1 +.ze4t3e2m1e2s +.ze1te1se1 +.ze4t3e2s1e2l +.ze4t3e2m1p +.zetha1 +.ze4t3hap +.zec4h2 +.zec4z2 +.zed4z2 +.zed4¼2 +.zed4¿2 +.zekl2 +.ze2p1c +.zepc4h2 +.zer4z2 +.ze2r1¿2 +.zesc4h2 +.zesm4 +.zes4z2 +.2z1f8 +.zg8 +.zh8 +.zi1 +.zi2m1n +.zimno1 +.zimno3kr2 +.zj8 +.2z1k8 +.zl8 +.z³8 +.z³o1 +.z³o3w2 +.zm8 +.zma1 +.zma2r1t +.zmartwy1 +.zmartwy2c4h3 +.zmartwyc2h2w2 +.zn8 +.zni1 +.zni2e1 +.znie3b2 +.znie3c2 +.znie3æ2 +.znie3d2 +.znie3f2 +.znie3g2 +.znie3h2 +.znie3k2 +.znie3l2 +.znie3³2 +.znie3m2 +.znie3n2 +.znie3ñ2 +.znie3p2 +.znie3r2 +.znie3s2 +.znie3¶2 +.znie3t2 +.znie3w2 +.znie3z2 +.znie3¼2 +.znie3¿2 +.znie4d4¼3 +.znie4m3c +.zniec4h2 +.zniec4z2 +.znied4z2 +.znied4¿2 +.znier4z2 +.znies4z2 +.zñ8 +.zo1 +.zo2o3 +.2z1p8 +.zr8 +.zro1 +.zro2z3 +.zro3z4u1 +.2z1s8 +.2z1¶8 +.2z1t8 +.zv8 +.zw8 +.zx8 +.4z3z8 +.z¼8 +.z¿8 +.¼8 +.2¼1b8 +.2¼1c8 +.2¼1æ8 +.2¼1d8 +.¼2d4¼8 +.2¼1f8 +.2¼1g8 +.¼h8 +.¼j8 +.2¼1k8 +.2¼1l8 +.¼³8 +.2¼1m8 +.2¼1n8 +.¼ñ8 +.2¼1p8 +.¼r8 +.2¼1s8 +.2¼1¶8 +.2¼1t8 +.¼v8 +.2¼1w8 +.¼x8 +.2¼1z8 +.4¼3¼8 +.2¼1¿8 +.¿8 +.2¿1b8 +.2¿1c8 +.2¿1æ8 +.2¿1d8 +.2¿1f8 +.2¿1g8 +.¿h8 +.2¿1j8 +.2¿1k8 +.2¿1l8 +.2¿1³8 +.2¿1m8 +.2¿1n8 +.2¿1ñ8 +.2¿1p8 +.2¿1r8 +.2¿1s8 +.2¿1¶8 +.2¿1t8 +.¿v8 +.2¿1w8 +.¿x8 +.2¿1z8 +.2¿1¼8 +.4¿3¿8 +¶1c +1¶2ci1 +2b1c +2b1æ +2b1d +2b1f +2b1g +2b1k +2b1m +2b1n +2b1ñ +2b1p +2b1s +2b1¶ +2b1t +2b1z +2b1¼ +2b1¿ +2b2³1k +2b2r1n +2c1b +2c1æ +2c1d +2c1f +2c1g +2c1k +2c1l +2c1m +2c1n +2c1ñ +2c1p +2c1s +2c1¶ +2c1t +2c1¼ +2c1¿ +c4h +2c2h1b +2c2h1c +2c2h1æ +2c2h1d +2c2h1f +2c2h1g +2c2h1k +2c2h1m +2c2h1n +2c2h1ñ +2c2h1p +2c2h1s +2c2h1¶ +2c2h1t +2c2h1z +2c2h1¼ +2c2h1¿ +c4z +2cz1b +2c2z1c +2c2z1æ +2c2z1d +2c2z1f +2cz1g +2c2z1k +2cz1l +2cz1m +2cz1n +2cz1ñ +2c2z1p +2c2z1s +2c2z1¶ +2c2z1t +2c4z3z +2cz1¼ +2cz1¿ +2æ1b +2æ1c +2æ1d +2æ1f +2æ1g +2æ1k +2æ1m +2æ1n +2æ1ñ +2æ1p +2æ1s +2æ1¶ +2æ1t +2æ1z +2æ1¼ +2æ1¿ +2d1b +2d1c +2d1æ +2d1f +2d1g +2d1k +2d1m +2d1n +2d1ñ +2d1p +2d1s +2d1¶ +2d1t +2d2³1b +d2³1s +2d³s4z +2d2r1n +d4z +2dz1b +2d2z1c +2d2z1æ +2d2z1d +2d2z1f +2dz1g +2d2z1k +2dz1l +2dz1m +2dz1n +2dz1ñ +2d2z1p +2d2z1s +2d2z1¶ +2d2z1t +2d4z3z +2dz1¼ +2dz1¿ +d4¼ +2d2¼1b +2d2¼1c +2d2¼1æ +2d2¼1d +2d2¼1f +2d2¼1g +2d2¼1k +2d2¼1m +2d2¼1n +2d¼1ñ +2d2¼1p +2d2¼1s +2d2¼1¶ +2d2¼1t +2d2¼1z +2d4¼3¼ +2d2¼1¿ +d4¿ +2d2¿1b +2d2¿1c +2d2¿1æ +2d2¿1d +2d2¿1f +2d2¿1g +2d2¿1k +2d2¿1m +2d2¿1n +2d2¿1ñ +2d2¿1p +2d2¿1s +2d2¿1¶ +2d2¿1t +2d2¿1z +2d2¿1¼ +2d4¿3¿ +2f1c +2f1k +2f1m +2f1n +2g1b +2g1c +2g1æ +2g1d +2g1f +2g1k +2g1m +2g1ñ +2g1p +2g1s +2g1¶ +2g1t +2g1z +2g1¼ +2g1¿ +2g2³1b +2h1b +2h1c +2h1æ +2h1d +2h1f +2h1g +2h1j +2h1k +2h1l +2h1³ +2h1m +2h1n +2h1ñ +2h1p +2h1r +2h1s +2h1¶ +2h1t +2h1w +2h1z +2h1¼ +2h1¿ +2j1b +2j1c +2j1æ +2j1d +2j1f +2j1g +2j1h +2j1k +2j1l +2j1³ +2j1m +2j1n +2j1ñ +2j1p +2j1r +2j1s +2j1¶ +2j1t +2j1w +2j1z +2j1¼ +2j1¿ +2k1b +2k1c +2k1æ +2k1d +2k1f +2k1g +2k1m +2k1n +2k1ñ +2k1p +2k1s +2k1s4z +2k1¶ +2k1t +2k1z +2k1¼ +2k1¿ +2k2³1b +2l1b +2l1c +2l1æ +2l1d +2l1f +2l1g +2l1h +2l1j +2l1k +2l1³ +2l1m +2l1n +2l1ñ +2l1p +2l1r +2l1s +2l1¶ +2l1t +2l1w +2l1z +2l1¼ +2l1¿ +2³1b +2³1c +2³1æ +2³1d +2³1f +2³1g +2³1h +2³1j +2³1k +2³1l +2³1m +2³1n +2³1ñ +2³1p +2³1r +2³1s +2³1¶ +2³1t +2³1w +2³1z +2³1¼ +2³1¿ +2m1b +2m1c +2m1æ +2m1d +2m1f +2m1g +2m1h +2m1j +2m1k +2m1l +2m1³ +2m1n +2m1ñ +2m1p +2m1r +2m1s +2m1¶ +2m1t +2m1w +2m1z +2m1¼ +2m1¿ +2n1b +2n1c +2n1æ +2n1d +2n1f +2n1g +2n1h +2n1j +2n1k +2n1l +2n1³ +2n1m +2n1ñ +2n1p +2n1r +2n1s +2n1¶ +2n1t +2n1w +2n1z +2n1¼ +2n1¿ +2n2t1n +2ñ1b +2ñ1c +2ñ1æ +2ñ1d +2ñ1f +2ñ1g +2ñ1h +2ñ1j +2ñ1k +2ñ1l +2ñ1³ +2ñ1m +2ñ1n +2ñ1ñ +2ñ1p +2ñ1r +2ñ1s +2ñ1¶ +2ñ1t +2ñ1w +2ñ1z +2ñ1¼ +2ñ1¿ +2p1b +2p1c +2p1æ +2p1d +2p1f +2p1g +2p1k +2p1m +2p1n +2p1ñ +2p1s +2p1s4z +2p1¶ +2p1t +2p1z +2p1¼ +2p1¿ +2p2l1n +2r1b +2r1c +2r1æ +2r1d +2r1f +2r1g +2r1h +2r1j +2r1k +2r1l +2r1³ +2r1m +2r1n +2r1ñ +2r1p +2r1s +2r1¶ +2r1t +2r1w +2r1¼ +2r1¿ +r4z +2rz1b +2r2z1c +2r2z1æ +2r2z1d +2r2z1f +2rz1g +2rz1h +2rz1j +2r2z1k +2rz1l +2rz1³ +2rz1m +2rz1n +2rz1ñ +2r2z1p +2rz1r +2r2z1s +2r2z1¶ +2r2z1t +2rz1w +2rz1¼ +2rz1¿ +2s1b +2s1d +2s1f +2s1g +2s1s +2s1¼ +2s1¿ +2s2³1b +2s2n1k +2s2t1k +2s2t1n +s2t1s +2sts4z +s4z +2s2z1c +2s2z1æ +2s2z1f +2s2z1k +2sz1l +2sz1m +2sz1n +2s2z1p +2s2z1s +2s2z1¶ +2s2z1t +2sz1w +2s4z3z +2sz2l1n +2¶1b +2¶1d +2¶1f +2¶1g +2¶1k +2¶1p +2¶1s +2¶1¶ +2¶1t +2¶1z +2¶1¼ +2¶1¿ +2¶2æ1c +2¶2l1m +2¶2l1n +2t1b +2t1c +2t1æ +2t1d +2t1f +2t1g +2t1k +2t1m +2t1n +2t1ñ +2t1p +2t1s +2t1¶ +2t1z +2t1¼ +2t1¿ +2t2l1n +2t2r1k +tr4z +2t2rz1n +2w1b +2w1c +2w1æ +2w1d +2w1f +2w1g +2w1j +2w1k +2w1l +2w1³ +2w1m +2w1n +2w1ñ +2w1p +2w1r +2w1s +2w1¶ +2w1t +2w1z +2w1¼ +2w1¿ +2z1c +2z1æ +2z1d +2z1f +2z1k +2z1p +2z1s +2z1¶ +2z1t +2z2d1k +2z2d1n +2¼1b +2¼1c +2¼1æ +2¼1d +2¼1f +2¼1g +2¼1k +2¼1l +2¼1m +2¼1n +2¼1p +2¼1s +2¼1¶ +2¼1t +2¼1w +2¼1z +2¼1¿ +2¿1b +2¿1c +2¿1æ +2¿1d +2¿1f +2¿1g +2¿1j +2¿1k +2¿1l +2¿1³ +2¿1m +2¿1n +2¿1ñ +2¿1p +2¿1r +2¿1s +2¿1¶ +2¿1t +2¿1w +2¿1z +2¿1¼ +dni1 +dni2o1 +3d2niow +3k2s2z2t +3m2k2n +mne1 +3m2nest +3m2nezj +3m2s2k2n +pne1 +3p2ne2u1 +wc4z +wcza1 +3w2czas +w³a1 +3w2³ad +w³o1 +3w2³os +4b3b +4c3c +4æ3æ +4d3d +4f3f +4g3g +4h3h +4j3j +4k3k +4l3l +4³3³ +4m3m +4n3n +4p3p +4r3r +4t3t +4w3w +4z3z +4¼3¼ +4¿3¿ +8b. +8b8b. +8b8c. +8b8æ. +8b8d. +8b8f. +8b8g. +8b8h. +8b8j. +8b8k. +8b8l. +8b8³. +8b8m. +8b8n. +8b8ñ. +8b8p. +8b8r. +br4z +8b8r8z. +8b8s. +8b8¶. +8b8t. +8b8v. +8b8w. +8b8x. +8b8z. +8b8¼. +8b8¿. +8c. +8c8b. +8c8c. +8c8æ. +8c8d. +8c8f. +8c8g. +8c8h. +c2h2³ +8c8h8³. +c2h2r +chr4z +8ch8r8z. +c2h2w +8c8h8w. +8c8j. +8c8k. +8c8l. +8c8³. +8c8m. +8c8n. +8c8ñ. +8c8p. +8c8r. +8c8s. +8c8¶. +8c8t. +8c8v. +8c8w. +8c8x. +8c8z. +8c8z8t. +8c8¼. +8c8¿. +8æ. +8æ8b. +8æ8c. +8æ8æ. +8æ8d. +8æ8f. +8æ8g. +8æ8h. +8æ8j. +8æ8k. +8æ8l. +8æ8³. +8æ8m. +8æ8n. +8æ8ñ. +8æ8p. +8æ8r. +8æ8s. +8æ8¶. +8æ8t. +8æ8v. +8æ8w. +8æ8x. +8æ8z. +8æ8¼. +8æ8¿. +8d. +8d8b. +8d8c. +8d8æ. +8d8d. +8d8f. +8d8g. +8d8h. +8d8j. +8d8k. +8d8l. +8d8³. +8d8m. +8d8n. +8d8ñ. +8d8p. +8d8r. +dr4z +8d8r8z. +8d8s. +8d8¶. +8d8t. +8d8v. +8d8w. +8d8x. +8d8z. +8d8¼. +8d8¿. +8f. +8f8b. +8f8c. +8f8æ. +8f8d. +8f8f. +8f8g. +8f8h. +8f8j. +8f8k. +8f8l. +8f8³. +8f8m. +8f8n. +8f8ñ. +8f8p. +8f8r. +8f8s. +8f8¶. +8f8t. +8f8v. +8f8w. +8f8x. +8f8z. +8f8¼. +8f8¿. +8g. +8g8b. +8g8c. +8g8æ. +8g8d. +8g8f. +8g8g. +8g8h. +8g8j. +8g8k. +8g8l. +8g8³. +8g8m. +8g8n. +8g8ñ. +8g8p. +8g8r. +8g8s. +8g8¶. +8g8t. +8g8v. +8g8w. +8g8x. +8g8z. +8g8¼. +8g8¿. +8h. +8h8b. +8h8c. +8h8æ. +8h8d. +8h8f. +8h8g. +8h8h. +8h8j. +8h8k. +8h8l. +8h8³. +8h8m. +8h8n. +8h8ñ. +8h8p. +8h8r. +8h8s. +8h8¶. +8h8t. +8h8v. +8h8w. +8h8x. +8h8z. +8h8¼. +8h8¿. +8j. +8j8b. +8j8c. +8j8æ. +8j8d. +8j8f. +8j8g. +8j8h. +8j8j. +8j8k. +8j8l. +8j8³. +8j8m. +8j8n. +8j8ñ. +8j8p. +8j8r. +8j8s. +8j8¶. +8j8t. +8j8v. +8j8w. +8j8x. +8j8z. +8j8¼. +8j8¿. +8k. +8k8b. +8k8c. +8k8æ. +8k8d. +8k8f. +8k8g. +8k8h. +8k8j. +8k8k. +8k8l. +8k8³. +8k8m. +8k8n. +8k8ñ. +8k8p. +8k8r. +8k8s. +8k8s8t. +8k8¶. +8k8t. +8k8v. +8k8w. +8k8x. +8k8z. +8k8¼. +8k8¿. +8l. +8l8b. +8l8c. +8l8æ. +8l8d. +8l8f. +8l8g. +8l8h. +8l8j. +8l8k. +8l8l. +8l8³. +8l8m. +8l8n. +8l8ñ. +8l8p. +8l8r. +8l8s. +8l8¶. +8l8t. +8l8v. +8l8w. +8l8x. +8l8z. +8l8¼. +8l8¿. +8³. +8³8b. +8³8c. +8³8æ. +8³8d. +8³8f. +8³8g. +8³8h. +8³8j. +8³8k. +8³8l. +8³8³. +8³8m. +8³8n. +8³8ñ. +8³8p. +8³8r. +8³8s. +8³8¶. +8³8t. +8³8v. +8³8w. +8³8x. +8³8z. +8³8¼. +8³8¿. +8m. +8m8b. +8m8c. +8m8æ. +8m8d. +8m8f. +8m8g. +8m8h. +8m8j. +8m8k. +8m8l. +8m8³. +8m8m. +8m8n. +8m8ñ. +8m8p. +8m8r. +8m8s. +8m8s8t. +8m8¶. +8m8t. +8m8v. +8m8w. +8m8x. +8m8z. +8m8¼. +8m8¿. +8n. +8n8b. +8n8c. +8n8æ. +8n8d. +8n8f. +8n8g. +8n8h. +8n8j. +8n8k. +8n8l. +8n8³. +8n8m. +8n8n. +8n8ñ. +8n8p. +8n8r. +8n8s. +8n8¶. +8n8t. +8n8v. +8n8w. +8n8x. +8n8z. +8n8¼. +8n8¿. +8ñ. +8ñ8b. +8ñ8c. +8ñ8æ. +8ñ8d. +8ñ8f. +8ñ8g. +8ñ8h. +8ñ8j. +8ñ8k. +8ñ8l. +8ñ8³. +8ñ8m. +8ñ8n. +8ñ8ñ. +8ñ8p. +8ñ8r. +8ñ8s. +8ñ8¶. +8ñ8t. +8ñ8v. +8ñ8w. +8ñ8x. +8ñ8z. +8ñ8¼. +8ñ8¿. +8p. +8p8b. +8p8c. +8p8æ. +8p8d. +8p8f. +8p8g. +8p8h. +8p8j. +8p8k. +8p8l. +8p8³. +8p8m. +8p8n. +8p8ñ. +8p8p. +8p8r. +pr4z +8p8r8z. +8p8s. +8p8¶. +8p8t. +8p8v. +8p8w. +8p8x. +8p8z. +8p8¼. +8p8¿. +8r. +8r8b. +8r8c. +8r8æ. +8r8d. +8r8f. +8r8g. +8r8h. +8r8j. +8r8k. +8r8l. +8r8³. +8r8m. +8r8n. +8r8ñ. +8r8p. +8r8r. +8r8s. +rs4z +8r8s8z. +8r8¶. +8r8t. +8r8v. +8r8w. +8r8x. +8r8z. +8r8z8³. +8r8¼. +8r8¿. +8s. +8s8b. +8s8c. +sc4h +8s8c8h. +8s8æ. +8s8d. +8s8f. +8s8g. +8s8h. +8s8j. +8s8k. +skr4z +8sk8r8z. +8s8l. +8s8³. +8s8m. +8s8n. +8s8ñ. +8s8p. +8s8r. +8s8s. +8s8¶. +8s8t. +8s8t8r. +str4z +8s8t8r8z. +8s8t8w. +8s8v. +8s8w. +8s8x. +8s8z. +szc4z +8sz8c8z. +sz2cz1b +8szc8z8b. +8s8z8k. +8s8z8n. +8s8z8t. +8sz8t8r. +8s8¼. +8s8¿. +8¶. +8¶8b. +8¶8c. +8¶8æ. +8¶8d. +8¶8f. +8¶8g. +8¶8h. +8¶8j. +8¶8k. +8¶8l. +8¶8³. +8¶8m. +8¶8n. +8¶8ñ. +8¶8p. +8¶8r. +8¶8s. +8¶8¶. +8¶8t. +8¶8v. +8¶8w. +8¶8x. +8¶8z. +8¶8¼. +8¶8¿. +8t. +8t8b. +8t8c. +8t8æ. +8t8d. +8t8f. +8t8g. +8t8h. +8t8j. +8t8k. +8t8l. +8t8³. +8t8m. +8t8n. +8t8ñ. +8t8p. +8t8r. +8t8r8z. +8t8s. +8t8¶. +8t8t. +8t8v. +8t8w. +8t8x. +8t8z. +8t8¼. +8t8¿. +8v. +8v8b. +8v8c. +8v8æ. +8v8d. +8v8f. +8v8g. +8v8h. +8v8j. +8v8k. +8v8l. +8v8³. +8v8m. +8v8n. +8v8ñ. +8v8p. +8v8r. +8v8s. +8v8¶. +8v8t. +8v8v. +8v8w. +8v8x. +8v8z. +8v8¼. +8v8¿. +8w. +8w8b. +8w8c. +8w8æ. +8w8d. +8w8f. +8w8g. +8w8h. +8w8j. +8w8k. +8w8l. +8w8³. +8w8m. +8w8n. +8w8ñ. +8w8p. +8w8r. +8w8s. +8w8¶. +8w8t. +8w8v. +8w8w. +8w8x. +8w8z. +8w8¼. +8w8¿. +8x. +8x8b. +8x8c. +8x8æ. +8x8d. +8x8f. +8x8g. +8x8h. +8x8j. +8x8k. +8x8l. +8x8³. +8x8m. +8x8n. +8x8ñ. +8x8p. +8x8r. +8x8s. +8x8¶. +8x8t. +8x8v. +8x8w. +8x8x. +8x8z. +8x8¼. +8x8¿. +8z. +8z8b. +8z8c. +8z8æ. +8z8d. +8z8d8r. +zdr4z +8z8d8r8z. +8z8f. +8z8g. +8z8h. +8z8j. +8z8k. +8z8l. +8z8³. +8z8m. +8z8n. +8z8ñ. +8z8p. +8z8r. +8z8s. +8z8¶. +8z8t. +8z8v. +8z8w. +8z8x. +8z8z. +8z8¼. +8z8¿. +8¼. +8¼8b. +8¼8c. +8¼8æ. +8¼8d. +8¼8f. +8¼8g. +8¼8h. +8¼8j. +8¼8k. +8¼8l. +8¼8³. +8¼8m. +8¼8n. +8¼8ñ. +8¼8p. +8¼8r. +8¼8s. +8¼8¶. +8¼8t. +8¼8v. +8¼8w. +8¼8x. +8¼8z. +8¼8¼. +8¼8¿. +8¿. +8¿8b. +8¿8c. +8¿8æ. +8¿8d. +8¿8f. +8¿8g. +8¿8h. +8¿8j. +8¿8k. +8¿8l. +8¿8³. +8¿8m. +8¿8n. +8¿8ñ. +8¿8p. +8¿8r. +8¿8s. +8¿8¶. +8¿8t. +8¿8v. +8¿8w. +8¿8x. +8¿8z. +8¿8¼. +8¿8¿. +a1 +a2u1 +a2y1 +a1a2 +ae2 +ai2 +ao2 +±1 +be1 +be1e2 +be2eth +be2f3s4z2 +be1khe1 +be2k1he2n1d +bi1 +bino1 +bi2n3o2ku1 +bis4z +bi2s2z1k +biszko1 +bi2sz3kop +bizne1 +bi2z3nes +bi2z3ne2s3m +bi2r1m +bi1rmi1 +birmi2n1g +birmingha1 +birmin2g1ham +blo1 +blokha1 +blokha2u1 +blo2k1hauz +bo1 +bo2s3ma1 +b2r2d +bro1 +broa2 +broa1dwa1 +bro2a2d3wa2y1 +bu1 +bus4z +bu2sz1m +bu2sz3me1 +bu2k1s +bu2k1s4z +buk2s2z1p +bukszpa1 +buk2sz3pan +busi1 +busine1 +busine2s2s +busine2ss3m +ca1 +ca2l1d +caldwe1 +cal2d1we4l3l +c2h2j +c2h2l +chu1 +chus1t +cu1 +cur4z +curzo1 +cu2r7zon +de1 +de2u1 +deu2t1s +deutsc4h +deutsc2h2l +deutschla1 +deut4sch3la2n1d +d2rz2w +du1 +dus4z +du2s2z1p +duszpa1 +du2sz3past +d2¿2j +d2¿2l +d2¿2³ +d2¿2r +d2¿2w +d¿e1 +d¿e4z3b +d¿e4z3m +e1 +er4z +erza1 +e2r5zac +e2u1 +e2y1 +e3u2s4z +ea2 +e1e2 +ei2 +eo2 +ê1 +fi1 +fisha1 +fi2s3ha2r1m +fis4z +fi1szbi1 +fi2sz3bin +fo1 +fo2k1s +fo2k2s3t +for4z +forza1 +fo2r5zac +fo2l1k +fo1lklo1 +fol2k1lor +fo2s1f +fosfa1 +fo1sfazo1 +fos2f1a2zot +ga1 +ga2d1g +gadge1 +ga3d2get +gado1 +gado2p1t +ga1do3p2ta1 +go1 +go2l1f +gol2f3s +golfs4z2 +gra1 +gra2n1d +grandi1 +gran2d1ilo1 +gro1 +gro4t3r +hi1 +his4z +hi2s2z3p +hu1 +huc4z +hu2cz1w +huxle1 +hu2x3le2y1 +i1 +i2a1 +i2±1 +i2e1 +i2ê1 +i2i1 +i2o1 +i2ó1 +i2u1 +i2y1 +i4n3n +in2n1s +inn2s1b +innsbru1 +in4nsbru2c1k +i2n1s +in2s1b +insbru1 +in4sbruc +j2t1³ +j2t1r +ja1 +ja4z3z +ja4z4z3b +ja4z4z3m +ka1 +ka2r1l +kar2l1s +karlskro1 +karl2s1kron +karlsru1 +karl2s1ruhe1 +ki1 +ki2r1c +kirc4h +kirc4h3h +kirchho1 +kir2chho4f3f +ko1 +ko2n1g +kongre1 +kongre2s3m +le1 +led1w +lu1 +luftwa1 +luftwa4f3f +lu2ft3waffe1 +lu2k1s +luk2s1f +luksfe1 +lu2ks1fer +ly1 +ly2o2 +ma1 +mar4z +ma2r5z1l +ma2r5z1³ +ma2r5z1n +mi1 +mis4z +mi2sz1m +miszma1 +mi2s4z1mas4z +mi2e1 +mier4z +mi1e2r5zi1 +mie2r5z1³ +mo1 +mo2n1t +montre1 +montrea2 +mon2t3real +moza1 +mozai2 +moza2i3k +mu1 +mur4z +murza1 +murzasi1 +murzasic4h +mu2r7zasic2h3l +na1 +na2³1k +na³ko1 +na4³3ko2w1s +na4r3v +o1 +o2y1 +oa2 +oc4h +o2c2h1m +ochmi1 +och3mistr4z +oe2 +o4f3f +offse1 +of2f3set +oi2 +o1o2 +ou2 +ó1 +ó2w1c +ó4w3c4z +pa1 +pa1na1 +paname1 +pa2n3a2mer +pa1sca1 +pa2s3cal +pa2s3c4h +po1 +po2d1n +podni1 +podni2e1 +po3d4niepr4z +po2m1n +po3m2n±1 +po3m2nê1 +po3m2ni1 +po2r1t +por2t1s +po1rtsmo1 +portsmou2 +po4rt2s3mo2uth +portla1 +po4rt3la2n1d +poli1 +poli2e1 +poli3e2t +poli2u1 +poli3u2re1 +po³u1 +po³u2d1n +po³u3d2ni1 +po2w1s +pows4z +powsze1 +powsze2d1n +powsze3d2ni1 +p2r1c +prc4h +prcha1 +pr2chal +pre1 +pres4z +pre2s2z1p +pre2sz3pa1 +ro1 +roe2 +roe2n1t +roen2t1g +roe1ntge1 +ro2e3nt2gen +ro1kro1 +ro2k3roc4z +ro1sto1 +ro2s3to3c2k +se1 +se2t3le1 +sko1 +skor4z +sko1rzo1 +skorzone1 +sko2r5zoner +s2m2r +so1 +sowi1 +sowi3z2 +sy1 +syno1 +sy2n3o2p1t +syste1 +sy2s1tem +sza1 +s4zas4z +sza2sz1³y1 +sze1 +szezlo1 +sze2z1lo2n1g +sze4¶æ +szto1 +szto1kho1 +szto2k1ho2l1m +szy1 +szy2n1k +szynkwa1 +szyn2k1was +to1 +to2y1 +to1yo2 +to3y2o3t +tu1 +tu2r1b +turbo1 +turbo1o2 +turboodr4z +tu1rboodrzu1 +turboo2d3rzut +ty1 +tygo1 +tygo2d1n +tygo3d2ni1 +u1 +u2y1 +ua2 +ue2 +ui2 +uo2 +u1u2 +vo1 +vo2l1k +vo2l2k2s3 +we1 +we1e2 +we1e1ke1 +we2e2k1e2n1d +we4s2t3f +we4s2t3m +y1 +ya2 +ye2 +yi2 +yo2 +yu2 +ze1 +ze4p3p +¼2d4¼ +.by1 +.byna1 +.byna2j1m +.bynaj2m1n +.bynajmni1 +.bynajmni2e1 +.by9naj9m8nie8j. +.bezac4h +.be9z8a8c8h. +.bezami1 +.be9z8ami. +.gd4z +.gdzi1 +.gdzi2e1 +.gdzi1eni1 +.gdzi2e1ni2e1 +.2g1dzienie2g1d +.gd4zieniegd4z +.gdzi1eni1egdzi1 +.gdzi2e1ni2e1gdzi2e1 +.gdzienie9g8dzie. +.ina1 +.inac4z +.inacze1 +.in8a9cze8j. +.n8a9da8l. +.ni2g1d +.nigdy1 +.n8i9gdy. +.nigd4z +.ni1gdzi1 +.nigdzi2e1 +.n8i9gdzie. +.nie2c2h1¿ +.nie1ch¿e1 +.nie8ch9¿e. +.nie2c2h1b +.niechby1 +.nie8ch9by. +.o2w1s +.ows4z +.owsze1 +.ow9sze8m. +.pó³a1 +.pó³ac4h +.pó9³8a8c8h. +.pó³ami1 +.pó9³8ami. +.pó9³8e8k. +.przyna1 +.przyna2j1m +.przynaj2m1n +.przynajmni1 +.przynajmni2e1 +.przy9naj9m8nie8j. +.sk±di1 +.sk±1din±1 +.sk±d9i8n±8d. +.trója1 +.trójac4h +.tró9j8a8c8h. +.trójami1 +.tró9j8ami. +.tró9j8e8k. +.podó2w1c +.podó4w3c4z +.podówcza1 +.podó3w2czas +.po8d9ó8w9cza8s. diff --git a/src/librarian/res/jedenprocent.png b/src/librarian/res/jedenprocent.png new file mode 100644 index 0000000..1b88c54 Binary files /dev/null and b/src/librarian/res/jedenprocent.png differ diff --git a/src/librarian/res/kmlu-logo-white.png b/src/librarian/res/kmlu-logo-white.png new file mode 100644 index 0000000..9850fd4 Binary files /dev/null and b/src/librarian/res/kmlu-logo-white.png differ diff --git a/src/librarian/res/mpv-logo-white.svg b/src/librarian/res/mpv-logo-white.svg new file mode 100644 index 0000000..826a7b4 --- /dev/null +++ b/src/librarian/res/mpv-logo-white.svg @@ -0,0 +1,190 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/librarian/res/mpw-logo-white.png b/src/librarian/res/mpw-logo-white.png new file mode 100644 index 0000000..e6ca31f Binary files /dev/null and b/src/librarian/res/mpw-logo-white.png differ diff --git a/src/librarian/res/sponsors/nck.png b/src/librarian/res/sponsors/nck.png new file mode 100644 index 0000000..e53f19c Binary files /dev/null and b/src/librarian/res/sponsors/nck.png differ diff --git a/src/librarian/res/wl-logo-mono.png b/src/librarian/res/wl-logo-mono.png new file mode 100644 index 0000000..c99447e Binary files /dev/null and b/src/librarian/res/wl-logo-mono.png differ diff --git a/src/librarian/res/wl-logo-small.png b/src/librarian/res/wl-logo-small.png new file mode 100644 index 0000000..b32c46d Binary files /dev/null and b/src/librarian/res/wl-logo-small.png differ diff --git a/src/librarian/res/wl-logo-white.png b/src/librarian/res/wl-logo-white.png new file mode 100644 index 0000000..3a9e62a Binary files /dev/null and b/src/librarian/res/wl-logo-white.png differ diff --git a/src/librarian/res/wl-logo.png b/src/librarian/res/wl-logo.png new file mode 100644 index 0000000..1194a1c Binary files /dev/null and b/src/librarian/res/wl-logo.png differ diff --git a/src/librarian/sponsor.py b/src/librarian/sponsor.py new file mode 100644 index 0000000..1374cda --- /dev/null +++ b/src/librarian/sponsor.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import unicode_literals + +from librarian import get_resource + + +def sponsor_logo(name): + return { + 'Narodowe Centrum Kultury': get_resource('res/sponsors/nck.png') + }.get(name.strip()) diff --git a/src/librarian/text.py b/src/librarian/text.py new file mode 100644 index 0000000..7ba6d29 --- /dev/null +++ b/src/librarian/text.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import unicode_literals + +import copy +from librarian import functions, OutputFile +from lxml import etree +import os +import six + + +functions.reg_substitute_entities() +functions.reg_wrap_words() +functions.reg_strip() +functions.reg_person_name() + +TEMPLATE = u"""\ +%(text)s + + +----- +Ta lektura, podobnie jak tysiące innych, dostępna jest na stronie wolnelektury.pl. +Wersja lektury w opracowaniu merytorycznym i krytycznym (przypisy i motywy) dostępna jest na stronie %(url)s. + +Utwór opracowany został w ramach projektu Wolne Lektury przez fundację Nowoczesna Polska. + +%(license_description)s.%(source)s%(publisher)s + +%(description)s%(contributors)s%(funders)s%(isbn)s +""" + + +def transform(wldoc, flags=None, **options): + """ + Transforms input_file in XML to output_file in TXT. + possible flags: raw-text, + """ + # Parse XSLT + style_filename = os.path.join(os.path.dirname(__file__), 'xslt/book2txt.xslt') + style = etree.parse(style_filename) + + document = copy.deepcopy(wldoc) + del wldoc + document.swap_endlines() + + if flags: + for flag in flags: + document.edoc.getroot().set(flag, 'yes') + if 'wrapping' in options: + options['wrapping'] = str(options['wrapping']) + + result = document.transform(style, **options) + + if not flags or 'raw-text' not in flags: + if document.book_info: + parsed_dc = document.book_info + description = parsed_dc.description + url = document.book_info.url + + license_description = parsed_dc.license_description + license = parsed_dc.license + if license: + license_description = u"Ten utwór jest udostępniony na licencji %s: \n%s" % ( + license_description, license) + else: + license_description = u"Ten utwór nie jest objęty majątkowym prawem autorskim i znajduje się " \ + u"w domenie publicznej, co oznacza że możesz go swobodnie wykorzystywać, " \ + u"publikować i rozpowszechniać. Jeśli utwór opatrzony jest dodatkowymi " \ + u"materiałami (przypisy, motywy literackie etc.), które podlegają prawu " \ + u"autorskiemu, to te dodatkowe materiały udostępnione są na licencji " \ + u"Creative Commons Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL " \ + u"(http://creativecommons.org/licenses/by-sa/3.0/)" + + source = parsed_dc.source_name + if source: + source = "\n\nTekst opracowany na podstawie: " + source + else: + source = '' + + contributors = ', '.join(person.readable() for person in + sorted(set(p for p in (parsed_dc.technical_editors + parsed_dc.editors) if p))) + if contributors: + contributors = "\n\nOpracowanie redakcyjne i przypisy: %s." % contributors + funders = ', '.join(parsed_dc.funders) + if funders: + funders = u"\n\nPublikację wsparli i wsparły: %s." % funders + publisher = '\n\nWydawca: ' + ', '.join(parsed_dc.publisher) + isbn = getattr(parsed_dc, 'isbn_txt', None) + if isbn: + isbn = '\n\n' + isbn + else: + isbn = '' + else: + description = 'Publikacja zrealizowana w ramach projektu Wolne Lektury (http://wolnelektury.pl).' + url = '*' * 10 + license_description = "" + source = "" + contributors = "" + funders = "" + publisher = "" + isbn = "" + result = (TEMPLATE % { + 'description': description, + 'url': url, + 'license_description': license_description, + 'text': six.text_type(result), + 'source': source, + 'contributors': contributors, + 'funders': funders, + 'publisher': publisher, + 'isbn': isbn, + }).encode('utf-8') + else: + result = six.text_type(result).encode('utf-8') + return OutputFile.from_bytes(b"\r\n".join(result.splitlines()) + b"\r\n") diff --git a/src/librarian/util.py b/src/librarian/util.py new file mode 100644 index 0000000..c302084 --- /dev/null +++ b/src/librarian/util.py @@ -0,0 +1,126 @@ +# Functions to convert between integers and Roman numerals. Doctest examples included. +# by Paul Winkler +# http://code.activestate.com/recipes/81611-roman-numerals/ +# PSFL (GPL compatible) +from __future__ import print_function, unicode_literals + +import os + + +def int_to_roman(input): + """ + Convert an integer to Roman numerals. + + Examples: + >>> int_to_roman(0) + Traceback (most recent call last): + ValueError: Argument must be between 1 and 3999 + + >>> int_to_roman(-1) + Traceback (most recent call last): + ValueError: Argument must be between 1 and 3999 + + >>> int_to_roman(1.5) # doctest: +IGNORE_EXCEPTION_DETAIL + Traceback (most recent call last): + TypeError: expected integer, got + + >>> for i in range(1, 21): print(int_to_roman(i)) + ... + I + II + III + IV + V + VI + VII + VIII + IX + X + XI + XII + XIII + XIV + XV + XVI + XVII + XVIII + XIX + XX + >>> print(int_to_roman(2000)) + MM + >>> print(int_to_roman(1999)) + MCMXCIX + """ + if type(input) != type(1): + raise TypeError("expected integer, got %s" % type(input)) + if not 0 < input < 4000: + raise ValueError("Argument must be between 1 and 3999") + ints = (1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1) + nums = ('M', 'CM', 'D', 'CD','C', 'XC','L','XL','X','IX','V','IV','I') + result = "" + for i in range(len(ints)): + count = int(input / ints[i]) + result += nums[i] * count + input -= ints[i] * count + return result + +def roman_to_int(input): + """ + Convert a roman numeral to an integer. + + >>> r = list(range(1, 4000)) + >>> nums = [int_to_roman(i) for i in r] + >>> ints = [roman_to_int(n) for n in nums] + >>> print(r == ints) + 1 + + >>> roman_to_int('VVVIV') + Traceback (most recent call last): + ... + ValueError: input is not a valid roman numeral: VVVIV + >>> roman_to_int(1) # doctest: +IGNORE_EXCEPTION_DETAIL + Traceback (most recent call last): + ... + TypeError: expected string, got + >>> roman_to_int('a') + Traceback (most recent call last): + ... + ValueError: input is not a valid roman numeral: A + >>> roman_to_int('IL') + Traceback (most recent call last): + ... + ValueError: input is not a valid roman numeral: IL + """ + if type(input) != type(""): + raise TypeError("expected string, got %s" % type(input)) + input = input.upper() + nums = ['M', 'D', 'C', 'L', 'X', 'V', 'I'] + ints = [1000, 500, 100, 50, 10, 5, 1] + places = [] + for c in input: + if not c in nums: + raise ValueError("input is not a valid roman numeral: %s" % input) + for i in range(len(input)): + c = input[i] + value = ints[nums.index(c)] + # If the next place holds a larger number, this value is negative. + try: + nextvalue = ints[nums.index(input[i +1])] + if nextvalue > value: + value *= -1 + except IndexError: + # there is no next place. + pass + places.append(value) + sum = 0 + for n in places: sum += n + # Easiest test for validity... + if int_to_roman(sum) == input: + return sum + else: + raise ValueError('input is not a valid roman numeral: %s' % input) + + +def makedirs(path): + if not os.path.isdir(path): + os.makedirs(path) diff --git a/src/librarian/xslt/book2html.xslt b/src/librarian/xslt/book2html.xslt new file mode 100644 index 0000000..7d2d6b5 --- /dev/null +++ b/src/librarian/xslt/book2html.xslt @@ -0,0 +1,464 @@ + + + + + + + + + + + + Książka z serwisu WolneLektury.pl + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +

    Przypisy

    + +
    + fn- + + [] + + +

    + [przypis autorski] + [przypis tłumacza] + [przypis redakcyjny] + [przypis edytorski] +

    +
    + + + +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + +

    + + +

    +
    + +
    + + + + + + + +
    +
    + + + +
    +

    +
      + +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    + +
    +
    + + +
    +
    + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +
    + + +
    + +
    +
    + + + +

    +
    + + +
    + +
    +
    + + + +

    +
    + + +
    + +
    +
    + + + + +

    +
    + + + +
    +
    + + +
  • +
    + + +

    + + +

    +
    + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + + + padding-left: 1em + + + + + padding-left: em + + + padding-left: 1em + + + + + padding-left: 12em + + + text-align: right + + + +
    +
    + + + +

    +
    + + + + + +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + [] + + + + + + + + + + + + + + + + + + „” + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + +

    *

    +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + + + + + + tłum. + + , + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/librarian/xslt/book2txt.xslt b/src/librarian/xslt/book2txt.xslt new file mode 100644 index 0000000..4175e96 --- /dev/null +++ b/src/librarian/xslt/book2txt.xslt @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/ / + + + + + * + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +„” + + + +** + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +* + + + + + + + +------------------------------------------------ + + + + + + + + + + + + + + + + + + + + tłum. + + + , + + + + + + + + + + + + +ISBN + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/librarian/xslt/config.xml b/src/librarian/xslt/config.xml new file mode 100644 index 0000000..9eaa34e --- /dev/null +++ b/src/librarian/xslt/config.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/src/librarian/xslt/wl2html_base.xslt b/src/librarian/xslt/wl2html_base.xslt new file mode 100644 index 0000000..3341658 --- /dev/null +++ b/src/librarian/xslt/wl2html_base.xslt @@ -0,0 +1,363 @@ + + + + + + + + + + + + + + + + + + + + + + + editable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Uwaga! Tekst poza paragrafem

    +

    ##

    +
    +
    +
    +
    + + + + + + + + + +
    + +
    + + + + diff --git a/src/librarian/xslt/wl2html_full.xslt b/src/librarian/xslt/wl2html_full.xslt new file mode 100644 index 0000000..30381c3 --- /dev/null +++ b/src/librarian/xslt/wl2html_full.xslt @@ -0,0 +1,33 @@ + + + + + + + + + + + +
    + + + + + + + + + + +
    +
    + +
    \ No newline at end of file diff --git a/src/librarian/xslt/wl2html_partial.xslt b/src/librarian/xslt/wl2html_partial.xslt new file mode 100644 index 0000000..0e5e27b --- /dev/null +++ b/src/librarian/xslt/wl2html_partial.xslt @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file