From 59043f9676986b2c9fde7453f47945e021d9c7d6 Mon Sep 17 00:00:00 2001 From: stekot Date: Thu, 23 Feb 2012 21:52:04 +0100 Subject: [PATCH 01/13] Write function, Text on first page is working. @FIXME: find better way for handeling the fonts. --- lib/pdf.js | 1542 ++++++++++++++++++++++++++++------------------------ 1 file changed, 846 insertions(+), 696 deletions(-) diff --git a/lib/pdf.js b/lib/pdf.js index 5ebb0c7..dac9b25 100644 --- a/lib/pdf.js +++ b/lib/pdf.js @@ -1,696 +1,846 @@ -/* - -Original Project -Copyright (c) 2009 James Hall http://code.google.com/p/jspdf/ -https://github.com/MrRio/jsPDF - -Contributor(s) - pdf.js -Copyright (c) 2010 Marak Squires http://github.com/marak/pdf.js/ - - -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. - -*/ - -/* dual-side hack, i sorry */ -var sprintf; -var Base64; -if(typeof exports == 'undefined'){ - var exports = window; - var Base64 = window; -} - - -var pdf = exports.pdf = function(){ - - // Private properties - var version = '20090504'; - var buffer = ''; - - var pdfVersion = '1.3'; // PDF Version - var defaultPageFormat = 'a4'; - var pageFormats = { // Size in mm of various paper formats - 'a3': [841.89, 1190.55], - 'a4': [595.28, 841.89], - 'a5': [420.94, 595.28], - 'letter': [612, 792], - 'legal': [612, 1008] - }; - var textColor = '0 g'; - var page = 0; - var objectNumber = 2; // 'n' Current object number - var state = 0; // Current document state - var pages = new Array(); - var offsets = new Array(); // List of offsets - var lineWidth = 0.200025; // 2mm - var pageHeight; - var k; // Scale factor - var unit = 'mm'; // Default to mm for units - var documentProperties = {}; - var fontSize = 16; // Default font size - var pageFontSize = 16; - var font = 'Helvetica'; // Default font - var pageFont = font; - var fonts = {}; // fonts holder, namely use in putRessource - var fontIndex = 0; // F1, F2, etc. using setFont - var fontsNumber = {}; // object number holder for fonts - - // Initilisation - if (unit == 'pt') { - k = 1; - } else if(unit == 'mm') { - k = 72/25.4; - } else if(unit == 'cm') { - k = 72/2.54; - } else if(unit == 'in') { - k = 72; - } - - // Private functions - var newObject = function() { - //Begin a new object - objectNumber ++; - offsets[objectNumber] = buffer.length; - out(objectNumber + ' 0 obj'); - } - - - var putHeader = function() { - out('%PDF-' + pdfVersion); - } - - var putPages = function() { - - // TODO: Fix, hardcoded to a4 portrait - var wPt = pageWidth * k; - var hPt = pageHeight * k; - - for(n=1; n <= page; n++) { - newObject(); - out('<>'); - out('endobj'); - - //Page content - p = pages[n]; - newObject(); - out('<>'); - putStream(p); - out('endobj'); - } - offsets[1] = buffer.length; - out('1 0 obj'); - out('<>'); - out('endobj'); - } - - var putStream = function(str) { - out('stream'); - out(str); - out('endstream'); - } - - var putResources = function() { - var f; - // Deal with fonts, defined in fonts by user (using setFont). - if(fontIndex) { - for( f in fonts ) { - putFonts(f); - } - } else { - // if fontIndex still 0, means that setFont was not used, fallback to default - fonts[font] = 0; - putFonts(font); - } - - - putImages(); - - //Resource dictionary - offsets[2] = buffer.length; - out('2 0 obj'); - out('<<'); - putResourceDictionary(); - out('>>'); - out('endobj'); - } - - var putFonts = function(font) { - newObject(); - fontsNumber[font] = objectNumber; - - out('<>'); - out('endobj'); - } - - var putImages = function() { - // TODO - } - - var _drawLine = function(x1, y1, x2, y2, weight, style) { - if (typeof weight === "undefined" || weight < 0) { - weight = 1; - } - - if (typeof style === "undefined") { - style = '[] 0 d'; - } else { - if (style === 'dotted') { - style = '[1 2] 1 d'; - } else if (style === 'dashed') { - style = '[4 2] 2 d'; - } else { - style = '[] 0 d'; - } - } - - var str = sprintf('\n/LEP BMC \nq\n0 G\n%.2f w\n%s\n0 J\n1 0 0 1 0 0 cm\n%.2f %.2f m\n%.2f %.2f l\nS\nQ\nEMC\n', weight, style, k*x1, k*(pageHeight-y1), k*x2, k*(pageHeight-y2)); - out(str); - }; - - var putResourceDictionary = function() { - var i = 0, index, fx; - - out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); - out('/Font <<'); - - // Do this for each font, the '1' bit is the index of the font - // fontNumber is currently the object number related to 'putFonts' - for( index in fontsNumber ) { - out(fonts[index] + ' ' + fontsNumber[index] + ' 0 R'); - } - - out('>>'); - out('/XObject <<'); - putXobjectDict(); - out('>>'); - } - - var putXobjectDict = function() { - // TODO - // Loop through images - } - - - var putInfo = function() { - out('/Producer (pdf.js ' + version + ')'); - if(documentProperties.title != undefined) { - out('/Title (' + pdfEscape(documentProperties.title) + ')'); - } - if(documentProperties.subject != undefined) { - out('/Subject (' + pdfEscape(documentProperties.subject) + ')'); - } - if(documentProperties.author != undefined) { - out('/Author (' + pdfEscape(documentProperties.author) + ')'); - } - if(documentProperties.keywords != undefined) { - out('/Keywords (' + pdfEscape(documentProperties.keywords) + ')'); - } - if(documentProperties.creator != undefined) { - out('/Creator (' + pdfEscape(documentProperties.creator) + ')'); - } - var created = new Date(); - var year = created.getFullYear(); - var month = (created.getMonth() + 1); - var day = created.getDate(); - var hour = created.getHours(); - var minute = created.getMinutes(); - var second = created.getSeconds(); - out('/CreationDate (D:' + sprintf('%02d%02d%02d%02d%02d%02d', year, month, day, hour, minute, second) + ')'); - } - - var putCatalog = function () { - out('/Type /Catalog'); - out('/Pages 1 0 R'); - // TODO: Add zoom and layout modes - out('/OpenAction [3 0 R /FitH null]'); - out('/PageLayout /OneColumn'); - } - - function putTrailer() { - out('/Size ' + (objectNumber + 1)); - out('/Root ' + objectNumber + ' 0 R'); - out('/Info ' + (objectNumber - 1) + ' 0 R'); - } - - var endDocument = function() { - state = 1; - putHeader(); - putPages(); - - putResources(); - //Info - newObject(); - out('<<'); - putInfo(); - out('>>'); - out('endobj'); - - //Catalog - newObject(); - out('<<'); - putCatalog(); - out('>>'); - out('endobj'); - - //Cross-ref - var o = buffer.length; - out('xref'); - out('0 ' + (objectNumber + 1)); - out('0000000000 65535 f '); - for (var i=1; i <= objectNumber; i++) { - out(sprintf('%010d 00000 n ', offsets[i])); - } - //Trailer - out('trailer'); - out('<<'); - putTrailer(); - out('>>'); - out('startxref'); - out(o); - out('%%EOF'); - state = 3; - } - - var beginPage = function() { - page ++; - // Do dimension stuff - state = 2; - pages[page] = ''; - - // TODO: Hardcoded at A4 and portrait - pageHeight = pageFormats['a4'][1] / k; - pageWidth = pageFormats['a4'][0] / k; - } - - var out = function(string) { - if(state == 2) { - pages[page] += string + '\n'; - } else { - buffer += string + '\n'; - } - } - - var _addPage = function() { - beginPage(); - // Set line width - out(sprintf('%.2f w', (lineWidth * k))); - - // 16 is the font size - pageFontSize = fontSize; - pageFont = font; - out('BT ' + fonts[font] + ' ' + parseInt(fontSize) + '.00 Tf ET'); - } - - // Add the first page automatically - _addPage(); - - // Escape text - var pdfEscape = function(text) { - return text.replace(/\\/g, '\\\\').replace(/\(/g, '\\(').replace(/\)/g, '\\)'); - } - - return { - addPage: function() { - _addPage(); - }, - text: function(x, y, text, f) { - if(f) { - this.setFont(f); - } - - // need either page height or page font - if(pageFontSize !== fontSize || pageFont !== font) { - pageFontSize = fontSize; - pageFont = font; - } - - var str = sprintf('BT %.2f %.2f Td (%s) Tj ET', x * k, (pageHeight - y) * k, pdfEscape(text)) - out('BT ' + (fonts[font] ? fonts[font] : '/F0') + ' ' + parseInt(fontSize, 10) + '.00 Tf ET'); - out(str); - }, - drawRect: function(x, y, w, h, style) { - var op = 'S'; - if (style === 'F') { - op = 'f'; - } else if (style === 'FD' || style === 'DF') { - op = 'B'; - } - out(sprintf('%.2f %.2f %.2f %.2f re %s', x * k, (pageHeight - y) * k, w * k, -h * k, op)); - }, - drawLine: _drawLine, - setProperties: function(properties) { - documentProperties = properties; - }, - addImage: function(imageData, format, x, y, w, h) { - - }, - output: function(type, options) { - endDocument(); - if(type == undefined) { - return buffer; - } - if(type == 'datauri') { - return 'data:application/pdf;filename='+options.fileName+';base64,' + Base64.encode(buffer); - } - // @TODO: Add different output options - }, - setFontSize: function(size) { - fontSize = size; - }, - setFont: function(f){ - if( !(f in fonts) ) { - // if not known font yet, add in fonts array, then used in endDocument - // while putting ressource - fonts[f] = '/F' + (fontIndex++); - } - font = f; - } - } - -}; - -/** -* -* Base64 encode / decode -* http://www.webtoolkit.info/ -* -**/ - -// private property -var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - -// public method for encoding -exports.encode = function (input) { - var output = ""; - var chr1, chr2, chr3, enc1, enc2, enc3, enc4; - var i = 0; - - input = utf8_encode(input); - - while (i < input.length) { - - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - - enc1 = chr1 >> 2; - enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); - enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); - enc4 = chr3 & 63; - - if (isNaN(chr2)) { - enc3 = enc4 = 64; - } else if (isNaN(chr3)) { - enc4 = 64; - } - - output = output + - keyStr.charAt(enc1) + keyStr.charAt(enc2) + - keyStr.charAt(enc3) + keyStr.charAt(enc4); - - } - - return output; -} - -// public method for decoding -exports.decode = function (input) { - var output = ""; - var chr1, chr2, chr3; - var enc1, enc2, enc3, enc4; - var i = 0; - - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - - while (i < input.length) { - - enc1 = keyStr.indexOf(input.charAt(i++)); - enc2 = keyStr.indexOf(input.charAt(i++)); - enc3 = keyStr.indexOf(input.charAt(i++)); - enc4 = keyStr.indexOf(input.charAt(i++)); - - chr1 = (enc1 << 2) | (enc2 >> 4); - chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); - chr3 = ((enc3 & 3) << 6) | enc4; - - output = output + String.fromCharCode(chr1); - - if (enc3 != 64) { - output = output + String.fromCharCode(chr2); - } - if (enc4 != 64) { - output = output + String.fromCharCode(chr3); - } - - } - - output = utf8_decode(output); - - return output; - -} - -// private method for UTF-8 encoding -function utf8_encode(string) { - string = string.replace(/\r\n/g,"\n"); - var utftext = ""; - - for (var n = 0; n < string.length; n++) { - - var c = string.charCodeAt(n); - - if (c < 128) { - utftext += String.fromCharCode(c); - } - else if((c > 127) && (c < 2048)) { - utftext += String.fromCharCode((c >> 6) | 192); - utftext += String.fromCharCode((c & 63) | 128); - } - else { - utftext += String.fromCharCode((c >> 12) | 224); - utftext += String.fromCharCode(((c >> 6) & 63) | 128); - utftext += String.fromCharCode((c & 63) | 128); - } - - } - - return utftext; -} - -// private method for UTF-8 decoding -function utf8_decode(utftext) { - var string = ""; - var i = 0; - var c = c1 = c2 = 0; - - while ( i < utftext.length ) { - - c = utftext.charCodeAt(i); - - if (c < 128) { - string += String.fromCharCode(c); - i++; - } - else if((c > 191) && (c < 224)) { - c2 = utftext.charCodeAt(i+1); - string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); - i += 2; - } - else { - c2 = utftext.charCodeAt(i+1); - c3 = utftext.charCodeAt(i+2); - string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - i += 3; - } - - } - - return string; -} - -/**** BUNDLED SOME EXTRA STUFF FOR THE BROWSER, IF YOU REALLY DONT LIKE THIS HERE IN YOUR NODE VERSION YOU CAN DELETE IT.... SORRY... ******/ -// Modified to work as a CommonJS/NodeJS lib -// Use: sprintf = require("sprintf").sprintf - -var sprintf = exports.sprintf = function ( ) { - // Return a formatted string - // - // version: 903.3016 - // discuss at: http://phpjs.org/functions/sprintf - // + original by: Ash Searle (http://hexmen.com/blog/) - // + namespaced by: Michael White (http://getsprink.com) - // + tweaked by: Jack - // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) - // + input by: Paulo Ricardo F. Santos - // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) - // + input by: Brett Zamir (http://brettz9.blogspot.com) - // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) - // * example 1: sprintf("%01.2f", 123.1); - // * returns 1: 123.10 - // * example 2: sprintf("[%10s]", 'monkey'); - // * returns 2: '[ monkey]' - // * example 3: sprintf("[%'#10s]", 'monkey'); - // * returns 3: '[####monkey]' - var regex = /%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g; - var a = arguments, i = 0, format = a[i++]; - - // pad() - var pad = function(str, len, chr, leftJustify) { - if (!chr) chr = ' '; - var padding = (str.length >= len) ? '' : Array(1 + len - str.length >>> 0).join(chr); - return leftJustify ? str + padding : padding + str; - }; - - // justify() - var justify = function(value, prefix, leftJustify, minWidth, zeroPad, customPadChar) { - var diff = minWidth - value.length; - if (diff > 0) { - if (leftJustify || !zeroPad) { - value = pad(value, minWidth, customPadChar, leftJustify); - } else { - value = value.slice(0, prefix.length) + pad('', diff, '0', true) + value.slice(prefix.length); - } - } - return value; - }; - - // formatBaseX() - var formatBaseX = function(value, base, prefix, leftJustify, minWidth, precision, zeroPad) { - // Note: casts negative numbers to positive ones - var number = value >>> 0; - prefix = prefix && number && {'2': '0b', '8': '0', '16': '0x'}[base] || ''; - value = prefix + pad(number.toString(base), precision || 0, '0', false); - return justify(value, prefix, leftJustify, minWidth, zeroPad); - }; - - // formatString() - var formatString = function(value, leftJustify, minWidth, precision, zeroPad, customPadChar) { - if (precision != null) { - value = value.slice(0, precision); - } - return justify(value, '', leftJustify, minWidth, zeroPad, customPadChar); - }; - - // doFormat() - var doFormat = function(substring, valueIndex, flags, minWidth, _, precision, type) { - var number; - var prefix; - var method; - var textTransform; - var value; - - if (substring == '%%') return '%'; - - // parse flags - var leftJustify = false, positivePrefix = '', zeroPad = false, prefixBaseX = false, customPadChar = ' '; - var flagsl = flags.length; - for (var j = 0; flags && j < flagsl; j++) switch (flags.charAt(j)) { - case ' ': positivePrefix = ' '; break; - case '+': positivePrefix = '+'; break; - case '-': leftJustify = true; break; - case "'": customPadChar = flags.charAt(j+1); break; - case '0': zeroPad = true; break; - case '#': prefixBaseX = true; break; - } - - // parameters may be null, undefined, empty-string or real valued - // we want to ignore null, undefined and empty-string values - if (!minWidth) { - minWidth = 0; - } else if (minWidth == '*') { - minWidth = +a[i++]; - } else if (minWidth.charAt(0) == '*') { - minWidth = +a[minWidth.slice(1, -1)]; - } else { - minWidth = +minWidth; - } - - // Note: undocumented perl feature: - if (minWidth < 0) { - minWidth = -minWidth; - leftJustify = true; - } - - if (!isFinite(minWidth)) { - throw new Error('sprintf: (minimum-)width must be finite'); - } - - if (!precision) { - precision = 'fFeE'.indexOf(type) > -1 ? 6 : (type == 'd') ? 0 : void(0); - } else if (precision == '*') { - precision = +a[i++]; - } else if (precision.charAt(0) == '*') { - precision = +a[precision.slice(1, -1)]; - } else { - precision = +precision; - } - - // grab value using valueIndex if required? - value = valueIndex ? a[valueIndex.slice(0, -1)] : a[i++]; - - switch (type) { - case 's': return formatString(String(value), leftJustify, minWidth, precision, zeroPad, customPadChar); - case 'c': return formatString(String.fromCharCode(+value), leftJustify, minWidth, precision, zeroPad); - case 'b': return formatBaseX(value, 2, prefixBaseX, leftJustify, minWidth, precision, zeroPad); - case 'o': return formatBaseX(value, 8, prefixBaseX, leftJustify, minWidth, precision, zeroPad); - case 'x': return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad); - case 'X': return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad).toUpperCase(); - case 'u': return formatBaseX(value, 10, prefixBaseX, leftJustify, minWidth, precision, zeroPad); - case 'i': - case 'd': { - number = parseInt(+value); - prefix = number < 0 ? '-' : positivePrefix; - value = prefix + pad(String(Math.abs(number)), precision, '0', false); - return justify(value, prefix, leftJustify, minWidth, zeroPad); - } - case 'e': - case 'E': - case 'f': - case 'F': - case 'g': - case 'G': { - number = +value; - prefix = number < 0 ? '-' : positivePrefix; - method = ['toExponential', 'toFixed', 'toPrecision']['efg'.indexOf(type.toLowerCase())]; - textTransform = ['toString', 'toUpperCase']['eEfFgG'.indexOf(type) % 2]; - value = prefix + Math.abs(number)[method](precision); - return justify(value, prefix, leftJustify, minWidth, zeroPad)[textTransform](); - } - default: return substring; - } - }; - - return format.replace(regex, doFormat); -} +/* + +Original Project +Copyright (c) 2009 James Hall http://code.google.com/p/jspdf/ +https://github.com/MrRio/jsPDF + +Contributor(s) - pdf.js +Copyright (c) 2010 Marak Squires http://github.com/marak/pdf.js/ + + +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. + + */ + +/* dual-side hack, i sorry */ +var sprintf; +var Base64; +if (typeof exports == 'undefined') { + var exports = window; + var Base64 = window; +} + +var pdf = exports.pdf = function() { + + // Private properties + var version = '20090504'; + var buffer = ''; + + var pdfVersion = '1.3'; // PDF Version + var defaultPageFormat = 'a4'; + var pageFormats = { // Size in mm of various paper formats + 'a3' : [ 841.89, 1190.55 ], + 'a4' : [ 595.28, 841.89 ], + 'a5' : [ 420.94, 595.28 ], + 'letter' : [ 612, 792 ], + 'legal' : [ 612, 1008 ] + }; + var textColor = '0 g'; + var page = 0; + var objectNumber = 2; // 'n' Current object number + var state = 0; // Current document state + var pages = new Array(); + var offsets = new Array(); // List of offsets + var lineWidth = 0.200025; // 2mm + var pageHeight; + var k; // Scale factor + var unit = 'mm'; // Default to mm for units + var documentProperties = {}; + var fontSize = 16; // Default font size + var pageFontSize = 16; + var font = 'Helvetica'; // Default font + var pageFont = font; + var fonts = {}; // fonts holder, namely use in putRessource + var fontIndex = 0; // F1, F2, etc. using setFont + var fontsNumber = {}; // object number holder for fonts + var coreFonts = { + courier : 'Courier', + courierB : 'Courier-Bold', + courierI : 'Courier-Oblique', + courierBI : 'Courier-BoldOblique', + helvetica : 'Helvetica', + helveticaB : 'Helvetica-Bold', + helveticaI : 'Helvetica-Oblique', + helveticaBI : 'Helvetica-BoldOblique', + times : 'Times-Roman', + timesB : 'Times-Bold', + timesI : 'Times-Italic', + timesBI : 'Times-BoldItalic', + symbol : 'Symbol', + zapfdingbats : 'ZapfDingbats' + }; + var lMargin = 30; + var rMargin = 40; + var tMargin = 20; + var bMargin = 0; + var curX, curY; + // Initilisation + if (unit == 'pt') { + k = 1; + } else if (unit == 'mm') { + k = 72 / 25.4; + } else if (unit == 'cm') { + k = 72 / 2.54; + } else if (unit == 'in') { + k = 72; + } + + var lMarginPt = lMargin / k; + var rMarginPt = rMargin / k; + var tMarginPt = tMargin / k; + var bMarginPt = bMargin / k; + + // Private functions + var newObject = function() { + // Begin a new object + objectNumber++; + offsets[objectNumber] = buffer.length; + out(objectNumber + ' 0 obj'); + }; + + var putHeader = function() { + out('%PDF-' + pdfVersion); + }; + + var putPages = function() { + + // TODO: Fix, hardcoded to a4 portrait + var wPt = pageWidth * k; + var hPt = pageHeight * k; + + for (n = 1; n <= page; n++) { + newObject(); + out('<>'); + out('endobj'); + + // Page content + p = pages[n]; + newObject(); + out('<>'); + putStream(p); + out('endobj'); + } + offsets[1] = buffer.length; + out('1 0 obj'); + out('<>'); + out('endobj'); + }; + + var putStream = function(str) { + out('stream'); + out(str); + out('endstream'); + }; + + var putResources = function() { + var f; + // Deal with fonts, defined in fonts by user (using setFont). + if (fontIndex) { + for (f in fonts) { + putFonts(f); + } + } else { + // if fontIndex still 0, means that setFont was not used, fallback + // to default + fonts[font] = 0; + putFonts(font); + } + ; + + putImages(); + + // Resource dictionary + offsets[2] = buffer.length; + out('2 0 obj'); + out('<<'); + putResourceDictionary(); + out('>>'); + out('endobj'); + }; + + var putFonts = function(font) { + newObject(); + fontsNumber[font] = objectNumber; + + out('<>'); + out('endobj'); + }; + + var putImages = function() { + // TODO + }; + + var _drawLine = function(x1, y1, x2, y2, weight, style) { + if (typeof weight === "undefined" || weight < 0) { + weight = 1; + } + + if (typeof style === "undefined") { + style = '[] 0 d'; + } else { + if (style === 'dotted') { + style = '[1 2] 1 d'; + } else if (style === 'dashed') { + style = '[4 2] 2 d'; + } else { + style = '[] 0 d'; + } + } + + var str = sprintf( + '\n/LEP BMC \nq\n0 G\n%.2f w\n%s\n0 J\n1 0 0 1 0 0 cm\n%.2f %.2f m\n%.2f %.2f l\nS\nQ\nEMC\n', + weight, style, k * x1, k * (pageHeight - y1), k * x2, k + * (pageHeight - y2)); + out(str); + }; + + var putResourceDictionary = function() { + var i = 0, index, fx; + + out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); + out('/Font <<'); + + // Do this for each font, the '1' bit is the index of the font + // fontNumber is currently the object number related to 'putFonts' + for (index in fontsNumber) { + out(fonts[index] + ' ' + fontsNumber[index] + ' 0 R'); + } + + out('>>'); + out('/XObject <<'); + putXobjectDict(); + out('>>'); + }; + + var putXobjectDict = function() { + // TODO + // Loop through images + }; + + var putInfo = function() { + out('/Producer (pdf.js ' + version + ')'); + if (documentProperties.title != undefined) { + out('/Title (' + pdfEscape(documentProperties.title) + ')'); + } + if (documentProperties.subject != undefined) { + out('/Subject (' + pdfEscape(documentProperties.subject) + ')'); + } + if (documentProperties.author != undefined) { + out('/Author (' + pdfEscape(documentProperties.author) + ')'); + } + if (documentProperties.keywords != undefined) { + out('/Keywords (' + pdfEscape(documentProperties.keywords) + ')'); + } + if (documentProperties.creator != undefined) { + out('/Creator (' + pdfEscape(documentProperties.creator) + ')'); + } + var created = new Date(); + var year = created.getFullYear(); + var month = (created.getMonth() + 1); + var day = created.getDate(); + var hour = created.getHours(); + var minute = created.getMinutes(); + var second = created.getSeconds(); + out('/CreationDate (D:' + + sprintf('%02d%02d%02d%02d%02d%02d', year, month, day, hour, + minute, second) + ')'); + }; + + var putCatalog = function() { + out('/Type /Catalog'); + out('/Pages 1 0 R'); + // TODO: Add zoom and layout modes + out('/OpenAction [3 0 R /FitH null]'); + out('/PageLayout /OneColumn'); + }; + + var putTrailer = function() { + out('/Size ' + (objectNumber + 1)); + out('/Root ' + objectNumber + ' 0 R'); + out('/Info ' + (objectNumber - 1) + ' 0 R'); + }; + + var getStringWidth = function(text) { + // using CSS + var span = document.createElement('span'); + span.style.position = 'absolute'; + span.style.visibile = 'hidden'; + span.style.whiteSpace = 'pre'; + span.style.height = 'auto'; + span.style.width = 'auto'; + span.style.fontSize = fontSize; + span.style.fontFamily = font; + (document.getElementsByTagName('body')[0]).appendChild(span); + span.textContent = text; + var width = span.offsetWidth / k; + span.parentNode.removeChild(span); + return width; + }; + + var endDocument = function() { + state = 1; + putHeader(); + putPages(); + + putResources(); + // Info + newObject(); + out('<<'); + putInfo(); + out('>>'); + out('endobj'); + + // Catalog + newObject(); + out('<<'); + putCatalog(); + out('>>'); + out('endobj'); + + // Cross-ref + var o = buffer.length; + out('xref'); + out('0 ' + (objectNumber + 1)); + out('0000000000 65535 f '); + for ( var i = 1; i <= objectNumber; i++) { + out(sprintf('%010d 00000 n ', offsets[i])); + } + // Trailer + out('trailer'); + out('<<'); + putTrailer(); + out('>>'); + out('startxref'); + out(o); + out('%%EOF'); + state = 3; + }; + + var beginPage = function() { + page++; + // Do dimension stuff + state = 2; + pages[page] = ''; + + // TODO: Hardcoded at A4 and portrait + pageHeight = pageFormats['a4'][1] / k; + pageWidth = pageFormats['a4'][0] / k; + curX = lMarginPt; + curY = tMarginPt; + }; + + var out = function(string) { + if (state == 2) { + pages[page] += string + '\n'; + } else { + buffer += string + '\n'; + } + }; + var _setFont = function(f) { + if (!(f in fonts)) { + // if not known font yet, add in fonts array, then used in + // endDocument + // while putting ressource + fonts[f] = '/F' + (fontIndex++); + } + font = f; + }; + // @FIXME: Find more elegand solution + for (var f in coreFonts){ + _setFont(coreFonts[f]); + } + var _addPage = function() { + beginPage(); + // Set line width + out(sprintf('%.2f w', (lineWidth * k))); + + // 16 is the font size + pageFontSize = fontSize; + pageFont = font; + out('BT ' + fonts[font] + ' ' + parseInt(fontSize) + '.00 Tf ET'); + }; + + // Add the first page automatically + _addPage(); + + // Escape text + var pdfEscape = function(text) { + return text.replace(/\\/g, '\\\\').replace(/\(/g, '\\(').replace(/\)/g, + '\\)'); + }; + + return { + addPage : function() { + _addPage(); + }, + text : function(x, y, text, f) { + if (f) { + this.setFont(f); + } + + // need either page height or page font + if (pageFontSize !== fontSize || pageFont !== font) { + pageFontSize = fontSize; + pageFont = font; + } + + var str = sprintf('BT %.2f %.2f Td (%s) Tj ET', x * k, + (pageHeight - y) * k, pdfEscape(text)); + out('BT ' + (fonts[font] ? fonts[font] : '/F0') + ' ' + + parseInt(fontSize, 10) + '.00 Tf ET'); + out(str); + }, + write: function(h, text, f){ + if(f){ + this.setFont(f); + } + text = text.replace('\r', ''); + var maxW = pageWidth - lMarginPt - rMarginPt - 1; + var lineW = 0; + var sep = -1; + var n = text.length; + var i = 0; // actual letter + var j = 0; // last line break + this.newLine(h); + if(getStringWidth(text) < pageWidth){ + this.text(curX, curY, text); + this.newLine(h); + } + while(i < n){ + // @TODO add handeling of new line + letterW = getStringWidth(text[i]); + if((lineW) >= maxW){ + //new line + this.text(curX, curY, text.substr(j, sep - j)); + j = sep+1; + sep = -1; + i = j; + lineW = 0; + this.newLine(h); + if(getStringWidth(text.substr(i,n)) < maxW){ + this.text(curX, curY, text.substr(i, n)); + this.newLine(h); + i = n; + } + i++; + continue; + } + if(text[i] === ' '){ + sep = i; + } + lineW += letterW; + i++; + if(i == n){// end of the text + this.text(curX, curY, text.substr(j, sep - i)); + this.newLine(h); + } + + } + }, + newLine: function(h){ + curY += h; + }, + drawRect : function(x, y, w, h, style) { + var op = 'S'; + if (style === 'F') { + op = 'f'; + } else if (style === 'FD' || style === 'DF') { + op = 'B'; + } + out(sprintf('%.2f %.2f %.2f %.2f re %s', x * k, (pageHeight - y) + * k, w * k, -h * k, op)); + }, + drawLine : _drawLine, + setProperties : function(properties) { + documentProperties = properties; + }, + addImage : function(imageData, format, x, y, w, h) { + + }, + output : function(type, options) { + endDocument(); + if (type == undefined) { + return buffer; + } + if (type == 'datauri') { + return 'data:application/pdf;filename=' + options.fileName + + ';base64,' + Base64.encode(buffer); + } + // @TODO: Add different output options + }, + setFontSize : function(size) { + fontSize = size; + }, + setFont : _setFont, + fonts : fonts + }; + +}; + +/** + * + * Base64 encode / decode http://www.webtoolkit.info/ + * + */ + +// private property +var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + +// public method for encoding +exports.encode = function(input) { + var output = ""; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + + input = utf8_encode(input); + + while (i < input.length) { + + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + + keyStr.charAt(enc3) + keyStr.charAt(enc4); + + } + + return output; +}; + +// public method for decoding +exports.decode = function(input) { + var output = ""; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + while (i < input.length) { + + enc1 = keyStr.indexOf(input.charAt(i++)); + enc2 = keyStr.indexOf(input.charAt(i++)); + enc3 = keyStr.indexOf(input.charAt(i++)); + enc4 = keyStr.indexOf(input.charAt(i++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output = output + String.fromCharCode(chr1); + + if (enc3 != 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 != 64) { + output = output + String.fromCharCode(chr3); + } + + } + + output = utf8_decode(output); + + return output; + +}; + +// private method for UTF-8 encoding +function utf8_encode(string) { + string = string.replace(/\r\n/g, "\n"); + var utftext = ""; + + for ( var n = 0; n < string.length; n++) { + + var c = string.charCodeAt(n); + + if (c < 128) { + utftext += String.fromCharCode(c); + } else if ((c > 127) && (c < 2048)) { + utftext += String.fromCharCode((c >> 6) | 192); + utftext += String.fromCharCode((c & 63) | 128); + } else { + utftext += String.fromCharCode((c >> 12) | 224); + utftext += String.fromCharCode(((c >> 6) & 63) | 128); + utftext += String.fromCharCode((c & 63) | 128); + } + + } + + return utftext; +} + +// private method for UTF-8 decoding +function utf8_decode(utftext) { + var string = ""; + var i = 0; + var c = c1 = c2 = 0; + + while (i < utftext.length) { + + c = utftext.charCodeAt(i); + + if (c < 128) { + string += String.fromCharCode(c); + i++; + } else if ((c > 191) && (c < 224)) { + c2 = utftext.charCodeAt(i + 1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } else { + c2 = utftext.charCodeAt(i + 1); + c3 = utftext.charCodeAt(i + 2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) + | (c3 & 63)); + i += 3; + } + + } + + return string; +} + +/** + * ** BUNDLED SOME EXTRA STUFF FOR THE BROWSER, IF YOU REALLY DONT LIKE THIS + * HERE IN YOUR NODE VERSION YOU CAN DELETE IT.... SORRY... ***** + */ +// Modified to work as a CommonJS/NodeJS lib +// Use: sprintf = require("sprintf").sprintf +var sprintf = exports.sprintf = function() { + // Return a formatted string + // + // version: 903.3016 + // discuss at: http://phpjs.org/functions/sprintf + // + original by: Ash Searle (http://hexmen.com/blog/) + // + namespaced by: Michael White (http://getsprink.com) + // + tweaked by: Jack + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + input by: Paulo Ricardo F. Santos + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + input by: Brett Zamir (http://brettz9.blogspot.com) + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // * example 1: sprintf("%01.2f", 123.1); + // * returns 1: 123.10 + // * example 2: sprintf("[%10s]", 'monkey'); + // * returns 2: '[ monkey]' + // * example 3: sprintf("[%'#10s]", 'monkey'); + // * returns 3: '[####monkey]' + var regex = /%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g; + var a = arguments, i = 0, format = a[i++]; + + // pad() + var pad = function(str, len, chr, leftJustify) { + if (!chr) + chr = ' '; + var padding = (str.length >= len) ? '' : Array( + 1 + len - str.length >>> 0).join(chr); + return leftJustify ? str + padding : padding + str; + }; + + // justify() + var justify = function(value, prefix, leftJustify, minWidth, zeroPad, + customPadChar) { + var diff = minWidth - value.length; + if (diff > 0) { + if (leftJustify || !zeroPad) { + value = pad(value, minWidth, customPadChar, leftJustify); + } else { + value = value.slice(0, prefix.length) + + pad('', diff, '0', true) + value.slice(prefix.length); + } + } + return value; + }; + + // formatBaseX() + var formatBaseX = function(value, base, prefix, leftJustify, minWidth, + precision, zeroPad) { + // Note: casts negative numbers to positive ones + var number = value >>> 0; + prefix = prefix && number && { + '2' : '0b', + '8' : '0', + '16' : '0x' + }[base] || ''; + value = prefix + pad(number.toString(base), precision || 0, '0', false); + return justify(value, prefix, leftJustify, minWidth, zeroPad); + }; + + // formatString() + var formatString = function(value, leftJustify, minWidth, precision, + zeroPad, customPadChar) { + if (precision != null) { + value = value.slice(0, precision); + } + return justify(value, '', leftJustify, minWidth, zeroPad, customPadChar); + }; + + // doFormat() + var doFormat = function(substring, valueIndex, flags, minWidth, _, + precision, type) { + var number; + var prefix; + var method; + var textTransform; + var value; + + if (substring == '%%') + return '%'; + + // parse flags + var leftJustify = false, positivePrefix = '', zeroPad = false, prefixBaseX = false, customPadChar = ' '; + var flagsl = flags.length; + for ( var j = 0; flags && j < flagsl; j++) + switch (flags.charAt(j)) { + case ' ': + positivePrefix = ' '; + break; + case '+': + positivePrefix = '+'; + break; + case '-': + leftJustify = true; + break; + case "'": + customPadChar = flags.charAt(j + 1); + break; + case '0': + zeroPad = true; + break; + case '#': + prefixBaseX = true; + break; + } + + // parameters may be null, undefined, empty-string or real valued + // we want to ignore null, undefined and empty-string values + if (!minWidth) { + minWidth = 0; + } else if (minWidth == '*') { + minWidth = +a[i++]; + } else if (minWidth.charAt(0) == '*') { + minWidth = +a[minWidth.slice(1, -1)]; + } else { + minWidth = +minWidth; + } + + // Note: undocumented perl feature: + if (minWidth < 0) { + minWidth = -minWidth; + leftJustify = true; + } + + if (!isFinite(minWidth)) { + throw new Error('sprintf: (minimum-)width must be finite'); + } + + if (!precision) { + precision = 'fFeE'.indexOf(type) > -1 ? 6 : (type == 'd') ? 0 + : void (0); + } else if (precision == '*') { + precision = +a[i++]; + } else if (precision.charAt(0) == '*') { + precision = +a[precision.slice(1, -1)]; + } else { + precision = +precision; + } + + // grab value using valueIndex if required? + value = valueIndex ? a[valueIndex.slice(0, -1)] : a[i++]; + + switch (type) { + case 's': + return formatString(String(value), leftJustify, minWidth, + precision, zeroPad, customPadChar); + case 'c': + return formatString(String.fromCharCode(+value), leftJustify, + minWidth, precision, zeroPad); + case 'b': + return formatBaseX(value, 2, prefixBaseX, leftJustify, minWidth, + precision, zeroPad); + case 'o': + return formatBaseX(value, 8, prefixBaseX, leftJustify, minWidth, + precision, zeroPad); + case 'x': + return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, + precision, zeroPad); + case 'X': + return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, + precision, zeroPad).toUpperCase(); + case 'u': + return formatBaseX(value, 10, prefixBaseX, leftJustify, minWidth, + precision, zeroPad); + case 'i': + case 'd': { + number = parseInt(+value); + prefix = number < 0 ? '-' : positivePrefix; + value = prefix + + pad(String(Math.abs(number)), precision, '0', false); + return justify(value, prefix, leftJustify, minWidth, zeroPad); + } + case 'e': + case 'E': + case 'f': + case 'F': + case 'g': + case 'G': { + number = +value; + prefix = number < 0 ? '-' : positivePrefix; + method = [ 'toExponential', 'toFixed', 'toPrecision' ]['efg' + .indexOf(type.toLowerCase())]; + textTransform = [ 'toString', 'toUpperCase' ]['eEfFgG' + .indexOf(type) % 2]; + value = prefix + Math.abs(number)[method](precision); + return justify(value, prefix, leftJustify, minWidth, zeroPad)[textTransform] + (); + } + default: + return substring; + } + }; + + return format.replace(regex, doFormat); +}; From 9b034719f2ee9f71ca99974c05ba077f72ee9fc1 Mon Sep 17 00:00:00 2001 From: stekot Date: Tue, 28 Feb 2012 23:05:53 +0100 Subject: [PATCH 02/13] New page is added if text in write is too long. --- lib/pdf.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/pdf.js b/lib/pdf.js index dac9b25..0ebbe56 100644 --- a/lib/pdf.js +++ b/lib/pdf.js @@ -60,6 +60,9 @@ var pdf = exports.pdf = function() { var offsets = new Array(); // List of offsets var lineWidth = 0.200025; // 2mm var pageHeight; + var pageWidth; + var pageHeightPt; + var pageWidthPt; var k; // Scale factor var unit = 'mm'; // Default to mm for units var documentProperties = {}; @@ -87,9 +90,9 @@ var pdf = exports.pdf = function() { zapfdingbats : 'ZapfDingbats' }; var lMargin = 30; - var rMargin = 40; + var rMargin = 30; var tMargin = 20; - var bMargin = 0; + var bMargin = 20; var curX, curY; // Initilisation if (unit == 'pt') { @@ -355,6 +358,8 @@ var pdf = exports.pdf = function() { pages[page] = ''; // TODO: Hardcoded at A4 and portrait + pageHeightPt = pageFormats['a4'][1]; + pageWidthPt = pageFormats['a4'][0]; pageHeight = pageFormats['a4'][1] / k; pageWidth = pageFormats['a4'][0] / k; curX = lMarginPt; @@ -470,7 +475,10 @@ var pdf = exports.pdf = function() { } }, newLine: function(h){ - curY += h; + if(pageHeight - bMargin < curY){ + _addPage(); + } + curY += h; }, drawRect : function(x, y, w, h, style) { var op = 'S'; From 8a83c34df16bacffaa785de3412ae954b4ec230d Mon Sep 17 00:00:00 2001 From: stekot Date: Tue, 28 Feb 2012 23:39:59 +0100 Subject: [PATCH 03/13] Demo file updated. --- index.html | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index cf1f5df..677eb6e 100644 --- a/index.html +++ b/index.html @@ -72,12 +72,6 @@

demo - /* create the PDF document */ var doc = new pdf(); - doc.text(20, 20, 'hello, I am PDF.'); - doc.setFont('Courier'); - doc.text(20, 30, 'i was created in the browser using javascript.'); - doc.setFont('Times-Roman'); - doc.text(20, 40, 'i can also be created from node.js'); - /* optional - set properties on the document */ doc.setProperties({ title: 'A sample document created by pdf.js', @@ -86,13 +80,14 @@

demo - keywords: 'pdf.js, javascript, Marak, Marak Squires', creator: 'pdf.js' }); - doc.addPage(); - doc.setFontSize(22); + doc.setFontSize(18); doc.setFont('Verdana'); - doc.text(20, 20, 'This is a title'); - - doc.setFontSize(16); + doc.write(8, 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce tellus odio, dapibus id fermentum quis, suscipit id erat. Mauris dolor felis, sagittis at, luctus sed, aliquam non, tellus. Etiam posuere lacus quis dolor. Fusce aliquam vestibulum ipsum. Integer rutrum, orci vestibulum ullamcorper ultricies, lacus quam ultricies odio, vitae placerat pede sem sit amet enim. Mauris dolor felis, sagittis at, luctus sed, aliquam non, tellus. Etiam egestas wisi a erat. Etiam dictum tincidunt diam. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Integer lacinia. Curabitur bibendum justo non orci. Proin mattis lacinia justo.'); + doc.write(8, 'Fusce consectetuer risus a nunc. Maecenas ipsum velit, consectetuer eu lobortis ut, dictum at dui. Mauris dolor felis, sagittis at, luctus sed, aliquam non, tellus. Nulla pulvinar eleifend sem. Fusce tellus odio, dapibus id fermentum quis, suscipit id erat. Aliquam in lorem sit amet leo accumsan lacinia. Mauris metus. Integer malesuada. Mauris suscipit, ligula sit amet pharetra semper, nibh ante cursus purus, vel sagittis velit mauris vel metus. Nullam dapibus fermentum ipsum. Sed convallis magna eu sem. Pellentesque pretium lectus id turpis. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Fusce tellus odio, dapibus id fermentum quis, suscipit id erat. Nunc tincidunt ante vitae massa.'); + doc.write(8, 'Duis condimentum augue id magna semper rutrum. Donec ipsum massa, ullamcorper in, auctor et, scelerisque sed, est. Aliquam erat volutpat. Phasellus et lorem id felis nonummy placerat. Integer malesuada. Morbi scelerisque luctus velit. Mauris suscipit, ligula sit amet pharetra semper, nibh ante cursus purus, vel sagittis velit mauris vel metus. Vestibulum erat nulla, ullamcorper nec, rutrum non, nonummy ac, erat. Etiam dictum tincidunt diam. Mauris dictum facilisis augue. Praesent id justo in neque elementum ultrices.'); + doc.write(8, 'Aenean id metus id velit ullamcorper pulvinar. Fusce tellus odio, dapibus id fermentum quis, suscipit id erat. Vivamus porttitor turpis ac leo. Suspendisse nisl. In sem justo, commodo ut, suscipit at, pharetra vitae, orci. Vivamus porttitor turpis ac leo. Integer malesuada. Fusce wisi. Maecenas ipsum velit, consectetuer eu lobortis ut, dictum at dui. Nullam justo enim, consectetuer nec, ullamcorper ac, vestibulum in, elit. Integer lacinia. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Fusce wisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec ipsum massa, ullamcorper in, auctor et, scelerisque sed, est. Etiam dui sem, fermentum vitae, sagittis id, malesuada in, quam. Integer malesuada. Nulla pulvinar eleifend sem.'); + doc.addPage(); doc.text(20, 30, 'You can also override page fonts with text method', 'Times-Roman'); doc.text(20, 40, 'Monaco -This is some normal sized text underneath.', 'Monaco'); doc.text(20, 50, 'Times-Roman - This is some normal sized text underneath.', 'Times-Roman'); From 1b2aa190fbd8d56c32b91c6ad744e18d034fb7ad Mon Sep 17 00:00:00 2001 From: stekot Date: Wed, 28 Mar 2012 14:17:46 +0200 Subject: [PATCH 04/13] Locale encoding support added. TODO: update readme file. --- lib/pdf.js | 320 +++++--- makefont/cp1250.map | 251 ++++++ makefont/cp1251.map | 255 ++++++ makefont/cp1252.map | 251 ++++++ makefont/cp1253.map | 239 ++++++ makefont/cp1254.map | 249 ++++++ makefont/cp1255.map | 233 ++++++ makefont/cp1257.map | 244 ++++++ makefont/cp1258.map | 247 ++++++ makefont/cp874.map | 225 ++++++ makefont/fUTF8.php | 1640 ++++++++++++++++++++++++++++++++++++++ makefont/index.php | 6 + makefont/iso-8859-1.map | 256 ++++++ makefont/iso-8859-11.map | 248 ++++++ makefont/iso-8859-15.map | 256 ++++++ makefont/iso-8859-16.map | 256 ++++++ makefont/iso-8859-2.map | 256 ++++++ makefont/iso-8859-4.map | 256 ++++++ makefont/iso-8859-5.map | 256 ++++++ makefont/iso-8859-7.map | 250 ++++++ makefont/iso-8859-9.map | 256 ++++++ makefont/koi8-r.map | 256 ++++++ makefont/koi8-u.map | 256 ++++++ makefont/makefont.php | 373 +++++++++ makefont/ttfparser.php | 289 +++++++ vendor/jquery.js | 4 +- 26 files changed, 7520 insertions(+), 108 deletions(-) create mode 100644 makefont/cp1250.map create mode 100644 makefont/cp1251.map create mode 100644 makefont/cp1252.map create mode 100644 makefont/cp1253.map create mode 100644 makefont/cp1254.map create mode 100644 makefont/cp1255.map create mode 100644 makefont/cp1257.map create mode 100644 makefont/cp1258.map create mode 100644 makefont/cp874.map create mode 100644 makefont/fUTF8.php create mode 100644 makefont/index.php create mode 100644 makefont/iso-8859-1.map create mode 100644 makefont/iso-8859-11.map create mode 100644 makefont/iso-8859-15.map create mode 100644 makefont/iso-8859-16.map create mode 100644 makefont/iso-8859-2.map create mode 100644 makefont/iso-8859-4.map create mode 100644 makefont/iso-8859-5.map create mode 100644 makefont/iso-8859-7.map create mode 100644 makefont/iso-8859-9.map create mode 100644 makefont/koi8-r.map create mode 100644 makefont/koi8-u.map create mode 100644 makefont/makefont.php create mode 100644 makefont/ttfparser.php diff --git a/lib/pdf.js b/lib/pdf.js index 0ebbe56..5882f47 100644 --- a/lib/pdf.js +++ b/lib/pdf.js @@ -36,12 +36,23 @@ if (typeof exports == 'undefined') { var exports = window; var Base64 = window; } +if (!Object.keys) { + Object.keys = function(o) { + if (o !== Object(o)) + throw new TypeError('Object.keys called on non-object'); + var ret = []; + for ( var p in o) + if (Object.prototype.hasOwnProperty.call(o, p)) + ret.push(p); + return ret; + }; +} var pdf = exports.pdf = function() { // Private properties var version = '20090504'; - var buffer = ''; + var buffer = []; var pdfVersion = '1.3'; // PDF Version var defaultPageFormat = 'a4'; @@ -71,9 +82,13 @@ var pdf = exports.pdf = function() { var font = 'Helvetica'; // Default font var pageFont = font; var fonts = {}; // fonts holder, namely use in putRessource + var fontData = {}; // fonts data var fontIndex = 0; // F1, F2, etc. using setFont var fontsNumber = {}; // object number holder for fonts - var coreFonts = { + var fontFiles = []; + var encodings = {}; + var curEnc = null; + var baseFonts = { courier : 'Courier', courierB : 'Courier-Bold', courierI : 'Courier-Oblique', @@ -90,10 +105,10 @@ var pdf = exports.pdf = function() { zapfdingbats : 'ZapfDingbats' }; var lMargin = 30; - var rMargin = 30; - var tMargin = 20; - var bMargin = 20; - var curX, curY; + var rMargin = 30; + var tMargin = 30; + var bMargin = 30; + var curX, curY; // Initilisation if (unit == 'pt') { k = 1; @@ -104,11 +119,11 @@ var pdf = exports.pdf = function() { } else if (unit == 'in') { k = 72; } - - var lMarginPt = lMargin / k; - var rMarginPt = rMargin / k; - var tMarginPt = tMargin / k; - var bMarginPt = bMargin / k; + + var lMarginPt = lMargin / k; + var rMarginPt = rMargin / k; + var tMarginPt = tMargin / k; + var bMarginPt = bMargin / k; // Private functions var newObject = function() { @@ -128,7 +143,7 @@ var pdf = exports.pdf = function() { var wPt = pageWidth * k; var hPt = pageHeight * k; - for (n = 1; n <= page; n++) { + for ( var n = 1; n <= page; n++) { newObject(); out('<>'); - out('endobj'); + var putFonts = function() { + // put encodings + for (enc in encodings) { + newObject(); + out('<>'); + out('endobj'); + encodings[enc]['i'] = objectNumber; + } + for (f in fonts) { + newObject(); + fontsNumber[f] = objectNumber; + // basefonts + if (!(f in fontData)) { + out('<>'); + out('endobj'); + } + // embeded fonts + else { + var f = fontData[f]; + out('<>'); + out('endobj'); + newObject(); + out('<FontFiles[$font['file']]['n'].' 0 R'; + } + out('>>'); + out('endobj'); + } + } }; var putImages = function() { @@ -223,8 +275,9 @@ var pdf = exports.pdf = function() { } var str = sprintf( - '\n/LEP BMC \nq\n0 G\n%.2f w\n%s\n0 J\n1 0 0 1 0 0 cm\n%.2f %.2f m\n%.2f %.2f l\nS\nQ\nEMC\n', - weight, style, k * x1, k * (pageHeight - y1), k * x2, k + '\n/LEP BMC \nq\n0 G\n%.2f w\n%s\n0 J\n1 0 0 1 0 0 cm\n%.2f ' + + '%.2f m\n%.2f %.2f l\nS\nQ\nEMC\n', weight, style, k + * x1, k * (pageHeight - y1), k * x2, k * (pageHeight - y2)); out(str); }; @@ -295,8 +348,11 @@ var pdf = exports.pdf = function() { out('/Info ' + (objectNumber - 1) + ' 0 R'); }; + var getStringWidth = function(text) { + // FIXME: include bold fonts. // using CSS + console.log(unicodeToAscii(text).length); var span = document.createElement('span'); span.style.position = 'absolute'; span.style.visibile = 'hidden'; @@ -304,7 +360,11 @@ var pdf = exports.pdf = function() { span.style.height = 'auto'; span.style.width = 'auto'; span.style.fontSize = fontSize; - span.style.fontFamily = font; + if (font in fontData) { + span.style.fontFamily = fontData[font['cssname']]; + } else { + span.style.fontFamily = font; + } (document.getElementsByTagName('body')[0]).appendChild(span); span.textContent = text; var width = span.offsetWidth / k; @@ -363,29 +423,77 @@ var pdf = exports.pdf = function() { pageHeight = pageFormats['a4'][1] / k; pageWidth = pageFormats['a4'][0] / k; curX = lMarginPt; - curY = tMarginPt; + curY = tMarginPt; }; - var out = function(string) { + var out = function(str) { if (state == 2) { - pages[page] += string + '\n'; + pages[page] += str + '\n'; } else { - buffer += string + '\n'; + buffer += str + '\n'; } }; + var _setFont = function(f) { if (!(f in fonts)) { // if not known font yet, add in fonts array, then used in // endDocument // while putting ressource fonts[f] = '/F' + (fontIndex++); + } font = f; + if(f in fontData){ + curEnc = fontData[f]['enc']; + } }; - // @FIXME: Find more elegand solution - for (var f in coreFonts){ - _setFont(coreFonts[f]); - } + + var _addFont = function(family, style, data) { + var fontKey = family + style; + if (!(fontKey in fonts)) { + fonts[fontKey] = '/F' + fontIndex; + if (data) { + data['i'] = fontIndex; + if ('enc' in data) { + _addEncoding(data['enc'], data['uni2ascii'], data['diff']); + data['diff'] = undefined; + data['uni2ascii'] = undefined + } + fontData[fontKey] = data; + } + fontIndex++; + } + }; + + var _addEncoding = function(enc, uni2ascii, diff) { + if (!(enc in encodings)) { + encodings[enc] = {}; + encodings[enc]['uni2ascii'] = uni2ascii; + encodings[enc]['diff'] = diff.replace("\\"); + encodings[enc]['i'] = null; + } + }; + + var unicodeToAscii = function(text){ + if(!curEnc || !text){ + return text; + } + returnText = []; + for(var i=0;i= maxW){ - //new line - this.text(curX, curY, text.substr(j, sep - j)); - j = sep+1; - sep = -1; - i = j; - lineW = 0; - this.newLine(h); - if(getStringWidth(text.substr(i,n)) < maxW){ - this.text(curX, curY, text.substr(i, n)); - this.newLine(h); - i = n; - } - i++; - continue; - } - if(text[i] === ' '){ - sep = i; - } - lineW += letterW; - i++; - if(i == n){// end of the text - this.text(curX, curY, text.substr(j, sep - i)); - this.newLine(h); - } - - } - }, - newLine: function(h){ - if(pageHeight - bMargin < curY){ - _addPage(); - } - curY += h; - }, + write : function(h, text, f) { + if (f) { + this.setFont(f); + } + text = text.replace('\r', ''); + var maxW = pageWidth - lMarginPt - rMarginPt - 1; + var lineW = 0; + var sep = -1; + var n = text.length; + var i = 0; // actual letter + var j = 0; // last line break + this.newLine(h); + if (getStringWidth(text) < pageWidth) { + this.text(curX, curY, text); + this.newLine(h); + } + while (i < n) { + // @TODO add handeling of new line + letterW = getStringWidth(text[i]); + if ((lineW) >= maxW) { + // new line + this.text(curX, curY, text.substr(j, sep - j)); + j = sep + 1; + sep = -1; + i = j; + lineW = 0; + this.newLine(h); + if (getStringWidth(text.substr(i, n)) < maxW) { + this.text(curX, curY, text.substr(i, n)); + this.newLine(h); + i = n; + } + i++; + continue; + } + if (text[i] === ' ') { + sep = i; + } + lineW += letterW; + i++; + if (i == n) {// end of the text + this.text(curX, curY, text.substr(j, sep - i)); + this.newLine(h); + } + + } + }, + newLine : function(h) { + if (pageHeight - bMargin < curY) { + _addPage(); + } + curY += h; + }, drawRect : function(x, y, w, h, style) { var op = 'S'; if (style === 'F') { @@ -499,10 +607,9 @@ var pdf = exports.pdf = function() { }, output : function(type, options) { endDocument(); - if (type == undefined) { + if (type === undefined) { return buffer; - } - if (type == 'datauri') { + } else if (type === 'datauri') { return 'data:application/pdf;filename=' + options.fileName + ';base64,' + Base64.encode(buffer); } @@ -512,7 +619,8 @@ var pdf = exports.pdf = function() { fontSize = size; }, setFont : _setFont, - fonts : fonts + addFont : _addFont, + addEncoding : _addEncoding, }; }; @@ -532,7 +640,7 @@ exports.encode = function(input) { var chr1, chr2, chr3, enc1, enc2, enc3, enc4; var i = 0; - input = utf8_encode(input); +// input = utf8_encode(input); while (i < input.length) { diff --git a/makefont/cp1250.map b/makefont/cp1250.map new file mode 100644 index 0000000..ec110af --- /dev/null +++ b/makefont/cp1250.map @@ -0,0 +1,251 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+015A Sacute +!8D U+0164 Tcaron +!8E U+017D Zcaron +!8F U+0179 Zacute +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+015B sacute +!9D U+0165 tcaron +!9E U+017E zcaron +!9F U+017A zacute +!A0 U+00A0 space +!A1 U+02C7 caron +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+0104 Aogonek +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+015E Scedilla +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+0105 aogonek +!BA U+015F scedilla +!BB U+00BB guillemotright +!BC U+013D Lcaron +!BD U+02DD hungarumlaut +!BE U+013E lcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent diff --git a/makefont/cp1251.map b/makefont/cp1251.map new file mode 100644 index 0000000..de6a198 --- /dev/null +++ b/makefont/cp1251.map @@ -0,0 +1,255 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0402 afii10051 +!81 U+0403 afii10052 +!82 U+201A quotesinglbase +!83 U+0453 afii10100 +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+20AC Euro +!89 U+2030 perthousand +!8A U+0409 afii10058 +!8B U+2039 guilsinglleft +!8C U+040A afii10059 +!8D U+040C afii10061 +!8E U+040B afii10060 +!8F U+040F afii10145 +!90 U+0452 afii10099 +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0459 afii10106 +!9B U+203A guilsinglright +!9C U+045A afii10107 +!9D U+045C afii10109 +!9E U+045B afii10108 +!9F U+045F afii10193 +!A0 U+00A0 space +!A1 U+040E afii10062 +!A2 U+045E afii10110 +!A3 U+0408 afii10057 +!A4 U+00A4 currency +!A5 U+0490 afii10050 +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+0401 afii10023 +!A9 U+00A9 copyright +!AA U+0404 afii10053 +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+0407 afii10056 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+0406 afii10055 +!B3 U+0456 afii10103 +!B4 U+0491 afii10098 +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+0451 afii10071 +!B9 U+2116 afii61352 +!BA U+0454 afii10101 +!BB U+00BB guillemotright +!BC U+0458 afii10105 +!BD U+0405 afii10054 +!BE U+0455 afii10102 +!BF U+0457 afii10104 +!C0 U+0410 afii10017 +!C1 U+0411 afii10018 +!C2 U+0412 afii10019 +!C3 U+0413 afii10020 +!C4 U+0414 afii10021 +!C5 U+0415 afii10022 +!C6 U+0416 afii10024 +!C7 U+0417 afii10025 +!C8 U+0418 afii10026 +!C9 U+0419 afii10027 +!CA U+041A afii10028 +!CB U+041B afii10029 +!CC U+041C afii10030 +!CD U+041D afii10031 +!CE U+041E afii10032 +!CF U+041F afii10033 +!D0 U+0420 afii10034 +!D1 U+0421 afii10035 +!D2 U+0422 afii10036 +!D3 U+0423 afii10037 +!D4 U+0424 afii10038 +!D5 U+0425 afii10039 +!D6 U+0426 afii10040 +!D7 U+0427 afii10041 +!D8 U+0428 afii10042 +!D9 U+0429 afii10043 +!DA U+042A afii10044 +!DB U+042B afii10045 +!DC U+042C afii10046 +!DD U+042D afii10047 +!DE U+042E afii10048 +!DF U+042F afii10049 +!E0 U+0430 afii10065 +!E1 U+0431 afii10066 +!E2 U+0432 afii10067 +!E3 U+0433 afii10068 +!E4 U+0434 afii10069 +!E5 U+0435 afii10070 +!E6 U+0436 afii10072 +!E7 U+0437 afii10073 +!E8 U+0438 afii10074 +!E9 U+0439 afii10075 +!EA U+043A afii10076 +!EB U+043B afii10077 +!EC U+043C afii10078 +!ED U+043D afii10079 +!EE U+043E afii10080 +!EF U+043F afii10081 +!F0 U+0440 afii10082 +!F1 U+0441 afii10083 +!F2 U+0442 afii10084 +!F3 U+0443 afii10085 +!F4 U+0444 afii10086 +!F5 U+0445 afii10087 +!F6 U+0446 afii10088 +!F7 U+0447 afii10089 +!F8 U+0448 afii10090 +!F9 U+0449 afii10091 +!FA U+044A afii10092 +!FB U+044B afii10093 +!FC U+044C afii10094 +!FD U+044D afii10095 +!FE U+044E afii10096 +!FF U+044F afii10097 diff --git a/makefont/cp1252.map b/makefont/cp1252.map new file mode 100644 index 0000000..dd490e5 --- /dev/null +++ b/makefont/cp1252.map @@ -0,0 +1,251 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!8E U+017D Zcaron +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9E U+017E zcaron +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/makefont/cp1253.map b/makefont/cp1253.map new file mode 100644 index 0000000..4bd826f --- /dev/null +++ b/makefont/cp1253.map @@ -0,0 +1,239 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9B U+203A guilsinglright +!A0 U+00A0 space +!A1 U+0385 dieresistonos +!A2 U+0386 Alphatonos +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+2015 afii00208 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+0384 tonos +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+0388 Epsilontonos +!B9 U+0389 Etatonos +!BA U+038A Iotatonos +!BB U+00BB guillemotright +!BC U+038C Omicrontonos +!BD U+00BD onehalf +!BE U+038E Upsilontonos +!BF U+038F Omegatonos +!C0 U+0390 iotadieresistonos +!C1 U+0391 Alpha +!C2 U+0392 Beta +!C3 U+0393 Gamma +!C4 U+0394 Delta +!C5 U+0395 Epsilon +!C6 U+0396 Zeta +!C7 U+0397 Eta +!C8 U+0398 Theta +!C9 U+0399 Iota +!CA U+039A Kappa +!CB U+039B Lambda +!CC U+039C Mu +!CD U+039D Nu +!CE U+039E Xi +!CF U+039F Omicron +!D0 U+03A0 Pi +!D1 U+03A1 Rho +!D3 U+03A3 Sigma +!D4 U+03A4 Tau +!D5 U+03A5 Upsilon +!D6 U+03A6 Phi +!D7 U+03A7 Chi +!D8 U+03A8 Psi +!D9 U+03A9 Omega +!DA U+03AA Iotadieresis +!DB U+03AB Upsilondieresis +!DC U+03AC alphatonos +!DD U+03AD epsilontonos +!DE U+03AE etatonos +!DF U+03AF iotatonos +!E0 U+03B0 upsilondieresistonos +!E1 U+03B1 alpha +!E2 U+03B2 beta +!E3 U+03B3 gamma +!E4 U+03B4 delta +!E5 U+03B5 epsilon +!E6 U+03B6 zeta +!E7 U+03B7 eta +!E8 U+03B8 theta +!E9 U+03B9 iota +!EA U+03BA kappa +!EB U+03BB lambda +!EC U+03BC mu +!ED U+03BD nu +!EE U+03BE xi +!EF U+03BF omicron +!F0 U+03C0 pi +!F1 U+03C1 rho +!F2 U+03C2 sigma1 +!F3 U+03C3 sigma +!F4 U+03C4 tau +!F5 U+03C5 upsilon +!F6 U+03C6 phi +!F7 U+03C7 chi +!F8 U+03C8 psi +!F9 U+03C9 omega +!FA U+03CA iotadieresis +!FB U+03CB upsilondieresis +!FC U+03CC omicrontonos +!FD U+03CD upsilontonos +!FE U+03CE omegatonos diff --git a/makefont/cp1254.map b/makefont/cp1254.map new file mode 100644 index 0000000..829473b --- /dev/null +++ b/makefont/cp1254.map @@ -0,0 +1,249 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+011E Gbreve +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0130 Idotaccent +!DE U+015E Scedilla +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+011F gbreve +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0131 dotlessi +!FE U+015F scedilla +!FF U+00FF ydieresis diff --git a/makefont/cp1255.map b/makefont/cp1255.map new file mode 100644 index 0000000..079e10c --- /dev/null +++ b/makefont/cp1255.map @@ -0,0 +1,233 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9B U+203A guilsinglright +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+20AA afii57636 +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00D7 multiply +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD sfthyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 middot +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00F7 divide +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+05B0 afii57799 +!C1 U+05B1 afii57801 +!C2 U+05B2 afii57800 +!C3 U+05B3 afii57802 +!C4 U+05B4 afii57793 +!C5 U+05B5 afii57794 +!C6 U+05B6 afii57795 +!C7 U+05B7 afii57798 +!C8 U+05B8 afii57797 +!C9 U+05B9 afii57806 +!CB U+05BB afii57796 +!CC U+05BC afii57807 +!CD U+05BD afii57839 +!CE U+05BE afii57645 +!CF U+05BF afii57841 +!D0 U+05C0 afii57842 +!D1 U+05C1 afii57804 +!D2 U+05C2 afii57803 +!D3 U+05C3 afii57658 +!D4 U+05F0 afii57716 +!D5 U+05F1 afii57717 +!D6 U+05F2 afii57718 +!D7 U+05F3 gereshhebrew +!D8 U+05F4 gershayimhebrew +!E0 U+05D0 afii57664 +!E1 U+05D1 afii57665 +!E2 U+05D2 afii57666 +!E3 U+05D3 afii57667 +!E4 U+05D4 afii57668 +!E5 U+05D5 afii57669 +!E6 U+05D6 afii57670 +!E7 U+05D7 afii57671 +!E8 U+05D8 afii57672 +!E9 U+05D9 afii57673 +!EA U+05DA afii57674 +!EB U+05DB afii57675 +!EC U+05DC afii57676 +!ED U+05DD afii57677 +!EE U+05DE afii57678 +!EF U+05DF afii57679 +!F0 U+05E0 afii57680 +!F1 U+05E1 afii57681 +!F2 U+05E2 afii57682 +!F3 U+05E3 afii57683 +!F4 U+05E4 afii57684 +!F5 U+05E5 afii57685 +!F6 U+05E6 afii57686 +!F7 U+05E7 afii57687 +!F8 U+05E8 afii57688 +!F9 U+05E9 afii57689 +!FA U+05EA afii57690 +!FD U+200E afii299 +!FE U+200F afii300 diff --git a/makefont/cp1257.map b/makefont/cp1257.map new file mode 100644 index 0000000..2f2ecfa --- /dev/null +++ b/makefont/cp1257.map @@ -0,0 +1,244 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!8D U+00A8 dieresis +!8E U+02C7 caron +!8F U+00B8 cedilla +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9B U+203A guilsinglright +!9D U+00AF macron +!9E U+02DB ogonek +!A0 U+00A0 space +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00D8 Oslash +!A9 U+00A9 copyright +!AA U+0156 Rcommaaccent +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00C6 AE +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00F8 oslash +!B9 U+00B9 onesuperior +!BA U+0157 rcommaaccent +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00E6 ae +!C0 U+0104 Aogonek +!C1 U+012E Iogonek +!C2 U+0100 Amacron +!C3 U+0106 Cacute +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+0118 Eogonek +!C7 U+0112 Emacron +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0179 Zacute +!CB U+0116 Edotaccent +!CC U+0122 Gcommaaccent +!CD U+0136 Kcommaaccent +!CE U+012A Imacron +!CF U+013B Lcommaaccent +!D0 U+0160 Scaron +!D1 U+0143 Nacute +!D2 U+0145 Ncommaaccent +!D3 U+00D3 Oacute +!D4 U+014C Omacron +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0172 Uogonek +!D9 U+0141 Lslash +!DA U+015A Sacute +!DB U+016A Umacron +!DC U+00DC Udieresis +!DD U+017B Zdotaccent +!DE U+017D Zcaron +!DF U+00DF germandbls +!E0 U+0105 aogonek +!E1 U+012F iogonek +!E2 U+0101 amacron +!E3 U+0107 cacute +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+0119 eogonek +!E7 U+0113 emacron +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+017A zacute +!EB U+0117 edotaccent +!EC U+0123 gcommaaccent +!ED U+0137 kcommaaccent +!EE U+012B imacron +!EF U+013C lcommaaccent +!F0 U+0161 scaron +!F1 U+0144 nacute +!F2 U+0146 ncommaaccent +!F3 U+00F3 oacute +!F4 U+014D omacron +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0173 uogonek +!F9 U+0142 lslash +!FA U+015B sacute +!FB U+016B umacron +!FC U+00FC udieresis +!FD U+017C zdotaccent +!FE U+017E zcaron +!FF U+02D9 dotaccent diff --git a/makefont/cp1258.map b/makefont/cp1258.map new file mode 100644 index 0000000..fed915f --- /dev/null +++ b/makefont/cp1258.map @@ -0,0 +1,247 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!8C U+0152 OE +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9B U+203A guilsinglright +!9C U+0153 oe +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+0300 gravecomb +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+0110 Dcroat +!D1 U+00D1 Ntilde +!D2 U+0309 hookabovecomb +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+01A0 Ohorn +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+01AF Uhorn +!DE U+0303 tildecomb +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+0301 acutecomb +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+0111 dcroat +!F1 U+00F1 ntilde +!F2 U+0323 dotbelowcomb +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+01A1 ohorn +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+01B0 uhorn +!FE U+20AB dong +!FF U+00FF ydieresis diff --git a/makefont/cp874.map b/makefont/cp874.map new file mode 100644 index 0000000..1006e6b --- /dev/null +++ b/makefont/cp874.map @@ -0,0 +1,225 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!85 U+2026 ellipsis +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!A0 U+00A0 space +!A1 U+0E01 kokaithai +!A2 U+0E02 khokhaithai +!A3 U+0E03 khokhuatthai +!A4 U+0E04 khokhwaithai +!A5 U+0E05 khokhonthai +!A6 U+0E06 khorakhangthai +!A7 U+0E07 ngonguthai +!A8 U+0E08 chochanthai +!A9 U+0E09 chochingthai +!AA U+0E0A chochangthai +!AB U+0E0B sosothai +!AC U+0E0C chochoethai +!AD U+0E0D yoyingthai +!AE U+0E0E dochadathai +!AF U+0E0F topatakthai +!B0 U+0E10 thothanthai +!B1 U+0E11 thonangmonthothai +!B2 U+0E12 thophuthaothai +!B3 U+0E13 nonenthai +!B4 U+0E14 dodekthai +!B5 U+0E15 totaothai +!B6 U+0E16 thothungthai +!B7 U+0E17 thothahanthai +!B8 U+0E18 thothongthai +!B9 U+0E19 nonuthai +!BA U+0E1A bobaimaithai +!BB U+0E1B poplathai +!BC U+0E1C phophungthai +!BD U+0E1D fofathai +!BE U+0E1E phophanthai +!BF U+0E1F fofanthai +!C0 U+0E20 phosamphaothai +!C1 U+0E21 momathai +!C2 U+0E22 yoyakthai +!C3 U+0E23 roruathai +!C4 U+0E24 ruthai +!C5 U+0E25 lolingthai +!C6 U+0E26 luthai +!C7 U+0E27 wowaenthai +!C8 U+0E28 sosalathai +!C9 U+0E29 sorusithai +!CA U+0E2A sosuathai +!CB U+0E2B hohipthai +!CC U+0E2C lochulathai +!CD U+0E2D oangthai +!CE U+0E2E honokhukthai +!CF U+0E2F paiyannoithai +!D0 U+0E30 saraathai +!D1 U+0E31 maihanakatthai +!D2 U+0E32 saraaathai +!D3 U+0E33 saraamthai +!D4 U+0E34 saraithai +!D5 U+0E35 saraiithai +!D6 U+0E36 sarauethai +!D7 U+0E37 saraueethai +!D8 U+0E38 sarauthai +!D9 U+0E39 sarauuthai +!DA U+0E3A phinthuthai +!DF U+0E3F bahtthai +!E0 U+0E40 saraethai +!E1 U+0E41 saraaethai +!E2 U+0E42 saraothai +!E3 U+0E43 saraaimaimuanthai +!E4 U+0E44 saraaimaimalaithai +!E5 U+0E45 lakkhangyaothai +!E6 U+0E46 maiyamokthai +!E7 U+0E47 maitaikhuthai +!E8 U+0E48 maiekthai +!E9 U+0E49 maithothai +!EA U+0E4A maitrithai +!EB U+0E4B maichattawathai +!EC U+0E4C thanthakhatthai +!ED U+0E4D nikhahitthai +!EE U+0E4E yamakkanthai +!EF U+0E4F fongmanthai +!F0 U+0E50 zerothai +!F1 U+0E51 onethai +!F2 U+0E52 twothai +!F3 U+0E53 threethai +!F4 U+0E54 fourthai +!F5 U+0E55 fivethai +!F6 U+0E56 sixthai +!F7 U+0E57 seventhai +!F8 U+0E58 eightthai +!F9 U+0E59 ninethai +!FA U+0E5A angkhankhuthai +!FB U+0E5B khomutthai diff --git a/makefont/fUTF8.php b/makefont/fUTF8.php new file mode 100644 index 0000000..b94d03e --- /dev/null +++ b/makefont/fUTF8.php @@ -0,0 +1,1640 @@ + + * @license http://flourishlib.com/license + * + * @package Flourish + * @link http://flourishlib.com/fUTF8 + * + * @version 1.0.0b15 + * @changes 1.0.0b15 Fixed a bug with using IBM's iconv implementation on AIX [wb, 2011-07-29] + * @changes 1.0.0b14 Added a workaround for iconv having issues in MAMP 1.9.4+ [wb, 2011-07-26] + * @changes 1.0.0b13 Fixed notices from being thrown when invalid data is sent to ::clean() [wb, 2011-06-10] + * @changes 1.0.0b12 Fixed a variable name typo in ::sub() [wb, 2011-05-09] + * @changes 1.0.0b11 Updated the class to not using phpinfo() to determine the iconv implementation [wb, 2010-11-04] + * @changes 1.0.0b10 Fixed a bug with capitalizing a lowercase i resulting in a dotted upper-case I [wb, 2010-11-01] + * @changes 1.0.0b9 Updated class to use fCore::startErrorCapture() instead of `error_reporting()` [wb, 2010-08-09] + * @changes 1.0.0b8 Removed `e` flag from preg_replace() calls [wb, 2010-06-08] + * @changes 1.0.0b7 Added the methods ::trim(), ::rtrim() and ::ltrim() [wb, 2010-05-11] + * @changes 1.0.0b6 Fixed ::clean() to work with PHP installs that use an iconv library that doesn't support //IGNORE [wb, 2010-03-02] + * @changes 1.0.0b5 Changed ::ucwords() to also uppercase words right after various punctuation [wb, 2009-09-18] + * @changes 1.0.0b4 Changed replacement values in preg_replace() calls to be properly escaped [wb, 2009-06-11] + * @changes 1.0.0b3 Fixed a parameter name in ::rpos() from `$search` to `$needle` [wb, 2009-02-06] + * @changes 1.0.0b2 Fixed a bug in ::explode() with newlines and zero-length delimiters [wb, 2009-02-05] + * @changes 1.0.0b The initial implementation [wb, 2008-06-01] + */ +class fUTF8 +{ + // The following constants allow for nice looking callbacks to static methods + const ascii = 'fUTF8::ascii'; + const chr = 'fUTF8::chr'; + const clean = 'fUTF8::clean'; + const cmp = 'fUTF8::cmp'; + const explode = 'fUTF8::explode'; + const icmp = 'fUTF8::icmp'; + const inatcmp = 'fUTF8::inatcmp'; + const ipos = 'fUTF8::ipos'; + const ireplace = 'fUTF8::ireplace'; + const irpos = 'fUTF8::irpos'; + const istr = 'fUTF8::istr'; + const len = 'fUTF8::len'; + const lower = 'fUTF8::lower'; + const ltrim = 'fUTF8::ltrim'; + const natcmp = 'fUTF8::natcmp'; + const ord = 'fUTF8::ord'; + const pad = 'fUTF8::pad'; + const pos = 'fUTF8::pos'; + const replace = 'fUTF8::replace'; + const reset = 'fUTF8::reset'; + const rev = 'fUTF8::rev'; + const rpos = 'fUTF8::rpos'; + const rtrim = 'fUTF8::rtrim'; + const str = 'fUTF8::str'; + const sub = 'fUTF8::sub'; + const trim = 'fUTF8::trim'; + const ucfirst = 'fUTF8::ucfirst'; + const ucwords = 'fUTF8::ucwords'; + const upper = 'fUTF8::upper'; + const wordwrap = 'fUTF8::wordwrap'; + + + /** + * Depending how things are compiled, NetBSD and Solaris don't support //IGNORE in iconv() + * + * If //IGNORE support is not provided strings with invalid characters will be truncated + * + * @var boolean + */ + static private $can_ignore_invalid = NULL; + + /** + * All lowercase UTF-8 characters mapped to uppercase characters + * + * @var array + */ + static private $lower_to_upper = array( + 'a' => 'A', 'b' => 'B', 'c' => 'C', 'd' => 'D', 'e' => 'E', 'f' => 'F', + 'g' => 'G', 'h' => 'H', 'i' => 'I', 'j' => 'J', 'k' => 'K', 'l' => 'L', + 'm' => 'M', 'n' => 'N', 'o' => 'O', 'p' => 'P', 'q' => 'Q', 'r' => 'R', + 's' => 'S', 't' => 'T', 'u' => 'U', 'v' => 'V', 'w' => 'W', 'x' => 'X', + 'y' => 'Y', 'z' => 'Z', 'à' => 'À', 'á' => 'Ã', 'â' => 'Â', 'ã' => 'Ã', + 'ä' => 'Ä', 'Ã¥' => 'Ã…', 'æ' => 'Æ', 'ç' => 'Ç', 'è' => 'È', 'é' => 'É', + 'ê' => 'Ê', 'ë' => 'Ë', 'ì' => 'ÃŒ', 'í' => 'Ã', 'î' => 'ÃŽ', 'ï' => 'Ã', + 'ð' => 'Ã', 'ñ' => 'Ñ', 'ò' => 'Ã’', 'ó' => 'Ó', 'ô' => 'Ô', 'õ' => 'Õ', + 'ö' => 'Ö', 'ø' => 'Ø', 'ù' => 'Ù', 'ú' => 'Ú', 'û' => 'Û', 'ü' => 'Ü', + 'ý' => 'Ã', 'þ' => 'Þ', 'Ä' => 'Ä€', 'ă' => 'Ä‚', 'Ä…' => 'Ä„', 'ć' => 'Ć', + 'ĉ' => 'Ĉ', 'Ä‹' => 'ÄŠ', 'Ä' => 'ÄŒ', 'Ä' => 'ÄŽ', 'Ä‘' => 'Ä', 'Ä“' => 'Ä’', + 'Ä•' => 'Ä”', 'Ä—' => 'Ä–', 'Ä™' => 'Ę', 'Ä›' => 'Äš', 'Ä' => 'Äœ', 'ÄŸ' => 'Äž', + 'Ä¡' => 'Ä ', 'Ä£' => 'Ä¢', 'Ä¥' => 'Ĥ', 'ħ' => 'Ħ', 'Ä©' => 'Ĩ', 'Ä«' => 'Ī', + 'Ä­' => 'Ĭ', 'į' => 'Ä®', 'ij' => 'IJ', 'ĵ' => 'Ä´', 'Ä·' => 'Ķ', 'ĺ' => 'Ĺ', + 'ļ' => 'Ä»', 'ľ' => 'Ľ', 'Å€' => 'Ä¿', 'Å‚' => 'Å', 'Å„' => 'Ń', 'ņ' => 'Å…', + 'ň' => 'Ň', 'Å‹' => 'ÅŠ', 'Å' => 'ÅŒ', 'Å' => 'ÅŽ', 'Å‘' => 'Å', 'Å“' => 'Å’', + 'Å•' => 'Å”', 'Å—' => 'Å–', 'Å™' => 'Ř', 'Å›' => 'Åš', 'Å' => 'Åœ', 'ÅŸ' => 'Åž', + 'Å¡' => 'Å ', 'Å£' => 'Å¢', 'Å¥' => 'Ť', 'ŧ' => 'Ŧ', 'Å©' => 'Ũ', 'Å«' => 'Ū', + 'Å­' => 'Ŭ', 'ů' => 'Å®', 'ű' => 'Ű', 'ų' => 'Ų', 'ŵ' => 'Å´', 'Å·' => 'Ŷ', + 'ÿ' => 'Ÿ', 'ź' => 'Ź', 'ż' => 'Å»', 'ž' => 'Ž', 'É“' => 'Æ', 'ƃ' => 'Æ‚', + 'Æ…' => 'Æ„', 'É”' => 'Ɔ', 'ƈ' => 'Ƈ', 'É—' => 'ÆŠ', 'ÆŒ' => 'Æ‹', 'ɘ' => 'ÆŽ', + 'É™' => 'Æ', 'É›' => 'Æ', 'Æ’' => 'Æ‘', 'É ' => 'Æ“', 'É£' => 'Æ”', 'É©' => 'Æ–', + 'ɨ' => 'Æ—', 'Æ™' => 'Ƙ', 'ɯ' => 'Æœ', 'ɲ' => 'Æ', 'ɵ' => 'ÆŸ', 'Æ¡' => 'Æ ', + 'Æ£' => 'Æ¢', 'Æ¥' => 'Ƥ', 'ƨ' => 'Ƨ', 'ʃ' => 'Æ©', 'Æ­' => 'Ƭ', 'ʈ' => 'Æ®', + 'ư' => 'Ư', 'ÊŠ' => 'Ʊ', 'Ê‹' => 'Ʋ', 'Æ´' => 'Ƴ', 'ƶ' => 'Ƶ', 'Ê’' => 'Æ·', + 'ƹ' => 'Ƹ', 'ƽ' => 'Ƽ', 'dž' => 'Ç„', 'dž' => 'Ç…', 'lj' => 'LJ', 'lj' => 'Lj', + 'ÇŒ' => 'ÇŠ', 'ÇŒ' => 'Ç‹', 'ÇŽ' => 'Ç', 'Ç' => 'Ç', 'Ç’' => 'Ç‘', 'Ç”' => 'Ç“', + 'Ç–' => 'Ç•', 'ǘ' => 'Ç—', 'Çš' => 'Ç™', 'Çœ' => 'Ç›', 'ÇŸ' => 'Çž', 'Ç¡' => 'Ç ', + 'Ç£' => 'Ç¢', 'Ç¥' => 'Ǥ', 'ǧ' => 'Ǧ', 'Ç©' => 'Ǩ', 'Ç«' => 'Ǫ', 'Ç­' => 'Ǭ', + 'ǯ' => 'Ç®', 'dz' => 'DZ', 'ǵ' => 'Ç´', 'Ç»' => 'Ǻ', 'ǽ' => 'Ǽ', 'Ç¿' => 'Ǿ', + 'È' => 'È€', 'ȃ' => 'È‚', 'È…' => 'È„', 'ȇ' => 'Ȇ', 'ȉ' => 'Ȉ', 'È‹' => 'ÈŠ', + 'È' => 'ÈŒ', 'È' => 'ÈŽ', 'È‘' => 'È', 'È“' => 'È’', 'È•' => 'È”', 'È—' => 'È–', + 'ά' => 'Ά', 'έ' => 'Έ', 'ή' => 'Ή', 'ί' => 'Ί', 'ÏŒ' => 'ÎŒ', 'Ï' => 'ÎŽ', + 'ÏŽ' => 'Î', 'α' => 'Α', 'β' => 'Î’', 'γ' => 'Γ', 'δ' => 'Δ', 'ε' => 'Ε', + 'ζ' => 'Ζ', 'η' => 'Η', 'θ' => 'Θ', 'ι' => 'Ι', 'κ' => 'Κ', 'λ' => 'Λ', + 'μ' => 'Μ', 'ν' => 'Î', 'ξ' => 'Ξ', 'ο' => 'Ο', 'Ï€' => 'Π', 'Ï' => 'Ρ', + 'σ' => 'Σ', 'Ï„' => 'Τ', 'Ï…' => 'Î¥', 'φ' => 'Φ', 'χ' => 'Χ', 'ψ' => 'Ψ', + 'ω' => 'Ω', 'ÏŠ' => 'Ϊ', 'Ï‹' => 'Ϋ', 'Ï£' => 'Ï¢', 'Ï¥' => 'Ϥ', 'ϧ' => 'Ϧ', + 'Ï©' => 'Ϩ', 'Ï«' => 'Ϫ', 'Ï­' => 'Ϭ', 'ϯ' => 'Ï®', 'Ñ‘' => 'Ð', 'Ñ’' => 'Ђ', + 'Ñ“' => 'Ѓ', 'Ñ”' => 'Є', 'Ñ•' => 'Ð…', 'Ñ–' => 'І', 'Ñ—' => 'Ї', 'ј' => 'Ј', + 'Ñ™' => 'Љ', 'Ñš' => 'Њ', 'Ñ›' => 'Ћ', 'Ñœ' => 'ÐŒ', 'Ñž' => 'ÐŽ', 'ÑŸ' => 'Ð', + 'а' => 'Ð', 'б' => 'Б', 'в' => 'Ð’', 'г' => 'Г', 'д' => 'Д', 'е' => 'Е', + 'ж' => 'Ж', 'з' => 'З', 'и' => 'И', 'й' => 'Й', 'к' => 'К', 'л' => 'Л', + 'м' => 'М', 'н' => 'Ð', 'о' => 'О', 'п' => 'П', 'Ñ€' => 'Р', 'Ñ' => 'С', + 'Ñ‚' => 'Т', 'у' => 'У', 'Ñ„' => 'Ф', 'Ñ…' => 'Ð¥', 'ц' => 'Ц', 'ч' => 'Ч', + 'ш' => 'Ш', 'щ' => 'Щ', 'ÑŠ' => 'Ъ', 'Ñ‹' => 'Ы', 'ÑŒ' => 'Ь', 'Ñ' => 'Э', + 'ÑŽ' => 'Ю', 'Ñ' => 'Я', 'Ñ¡' => 'Ñ ', 'Ñ£' => 'Ñ¢', 'Ñ¥' => 'Ѥ', 'ѧ' => 'Ѧ', + 'Ñ©' => 'Ѩ', 'Ñ«' => 'Ѫ', 'Ñ­' => 'Ѭ', 'ѯ' => 'Ñ®', 'ѱ' => 'Ѱ', 'ѳ' => 'Ѳ', + 'ѵ' => 'Ñ´', 'Ñ·' => 'Ѷ', 'ѹ' => 'Ѹ', 'Ñ»' => 'Ѻ', 'ѽ' => 'Ѽ', 'Ñ¿' => 'Ѿ', + 'Ò' => 'Ò€', 'Ò‘' => 'Ò', 'Ò“' => 'Ò’', 'Ò•' => 'Ò”', 'Ò—' => 'Ò–', 'Ò™' => 'Ò˜', + 'Ò›' => 'Òš', 'Ò' => 'Òœ', 'ÒŸ' => 'Òž', 'Ò¡' => 'Ò ', 'Ò£' => 'Ò¢', 'Ò¥' => 'Ò¤', + 'Ò§' => 'Ò¦', 'Ò©' => 'Ò¨', 'Ò«' => 'Òª', 'Ò­' => 'Ò¬', 'Ò¯' => 'Ò®', 'Ò±' => 'Ò°', + 'Ò³' => 'Ò²', 'Òµ' => 'Ò´', 'Ò·' => 'Ò¶', 'Ò¹' => 'Ò¸', 'Ò»' => 'Òº', 'Ò½' => 'Ò¼', + 'Ò¿' => 'Ò¾', 'Ó‚' => 'Ó', 'Ó„' => 'Óƒ', 'Óˆ' => 'Ó‡', 'ÓŒ' => 'Ó‹', 'Ó‘' => 'Ó', + 'Ó“' => 'Ó’', 'Ó•' => 'Ó”', 'Ó—' => 'Ó–', 'Ó™' => 'Ó˜', 'Ó›' => 'Óš', 'Ó' => 'Óœ', + 'ÓŸ' => 'Óž', 'Ó¡' => 'Ó ', 'Ó£' => 'Ó¢', 'Ó¥' => 'Ó¤', 'Ó§' => 'Ó¦', 'Ó©' => 'Ó¨', + 'Ó«' => 'Óª', 'Ó¯' => 'Ó®', 'Ó±' => 'Ó°', 'Ó³' => 'Ó²', 'Óµ' => 'Ó´', 'Ó¹' => 'Ó¸', + 'Õ¡' => 'Ô±', 'Õ¢' => 'Ô²', 'Õ£' => 'Ô³', 'Õ¤' => 'Ô´', 'Õ¥' => 'Ôµ', 'Õ¦' => 'Ô¶', + 'Õ§' => 'Ô·', 'Õ¨' => 'Ô¸', 'Õ©' => 'Ô¹', 'Õª' => 'Ôº', 'Õ«' => 'Ô»', 'Õ¬' => 'Ô¼', + 'Õ­' => 'Ô½', 'Õ®' => 'Ô¾', 'Õ¯' => 'Ô¿', 'Õ°' => 'Õ€', 'Õ±' => 'Õ', 'Õ²' => 'Õ‚', + 'Õ³' => 'Õƒ', 'Õ´' => 'Õ„', 'Õµ' => 'Õ…', 'Õ¶' => 'Õ†', 'Õ·' => 'Õ‡', 'Õ¸' => 'Õˆ', + 'Õ¹' => 'Õ‰', 'Õº' => 'ÕŠ', 'Õ»' => 'Õ‹', 'Õ¼' => 'ÕŒ', 'Õ½' => 'Õ', 'Õ¾' => 'ÕŽ', + 'Õ¿' => 'Õ', 'Ö€' => 'Õ', 'Ö' => 'Õ‘', 'Ö‚' => 'Õ’', 'Öƒ' => 'Õ“', 'Ö„' => 'Õ”', + 'Ö…' => 'Õ•', 'Ö†' => 'Õ–', 'áƒ' => 'á‚ ', 'ბ' => 'á‚¡', 'გ' => 'á‚¢', 'დ' => 'á‚£', + 'ე' => 'Ⴄ', 'ვ' => 'á‚¥', 'ზ' => 'Ⴆ', 'თ' => 'á‚§', 'ი' => 'Ⴈ', 'კ' => 'á‚©', + 'ლ' => 'Ⴊ', 'მ' => 'á‚«', 'ნ' => 'Ⴌ', 'áƒ' => 'á‚­', 'პ' => 'á‚®', 'ჟ' => 'Ⴏ', + 'რ' => 'á‚°', 'ს' => 'Ⴑ', 'ტ' => 'Ⴒ', 'უ' => 'Ⴓ', 'ფ' => 'á‚´', 'ქ' => 'Ⴕ', + 'ღ' => 'á‚¶', 'ყ' => 'á‚·', 'შ' => 'Ⴘ', 'ჩ' => 'Ⴙ', 'ც' => 'Ⴚ', 'ძ' => 'á‚»', + 'წ' => 'Ⴜ', 'ჭ' => 'Ⴝ', 'ხ' => 'Ⴞ', 'ჯ' => 'á‚¿', 'ჰ' => 'Ⴠ', 'ჱ' => 'áƒ', + 'ჲ' => 'Ⴢ', 'ჳ' => 'Ⴣ', 'ჴ' => 'Ⴤ', 'ჵ' => 'Ⴥ', 'á¸' => 'Ḁ', 'ḃ' => 'Ḃ', + 'ḅ' => 'Ḅ', 'ḇ' => 'Ḇ', 'ḉ' => 'Ḉ', 'ḋ' => 'Ḋ', 'á¸' => 'Ḍ', 'á¸' => 'Ḏ', + 'ḑ' => 'á¸', 'ḓ' => 'Ḓ', 'ḕ' => 'Ḕ', 'ḗ' => 'Ḗ', 'ḙ' => 'Ḙ', 'ḛ' => 'Ḛ', + 'á¸' => 'Ḝ', 'ḟ' => 'Ḟ', 'ḡ' => 'Ḡ', 'ḣ' => 'Ḣ', 'ḥ' => 'Ḥ', 'ḧ' => 'Ḧ', + 'ḩ' => 'Ḩ', 'ḫ' => 'Ḫ', 'ḭ' => 'Ḭ', 'ḯ' => 'Ḯ', 'ḱ' => 'Ḱ', 'ḳ' => 'Ḳ', + 'ḵ' => 'Ḵ', 'ḷ' => 'Ḷ', 'ḹ' => 'Ḹ', 'ḻ' => 'Ḻ', 'ḽ' => 'Ḽ', 'ḿ' => 'Ḿ', + 'á¹' => 'á¹€', 'ṃ' => 'Ṃ', 'á¹…' => 'Ṅ', 'ṇ' => 'Ṇ', 'ṉ' => 'Ṉ', 'ṋ' => 'Ṋ', + 'á¹' => 'Ṍ', 'á¹' => 'Ṏ', 'ṑ' => 'á¹', 'ṓ' => 'á¹’', 'ṕ' => 'á¹”', 'á¹—' => 'á¹–', + 'á¹™' => 'Ṙ', 'á¹›' => 'Ṛ', 'á¹' => 'Ṝ', 'ṟ' => 'Ṟ', 'ṡ' => 'á¹ ', 'á¹£' => 'á¹¢', + 'á¹¥' => 'Ṥ', 'á¹§' => 'Ṧ', 'ṩ' => 'Ṩ', 'ṫ' => 'Ṫ', 'á¹­' => 'Ṭ', 'ṯ' => 'á¹®', + 'á¹±' => 'á¹°', 'á¹³' => 'á¹²', 'á¹µ' => 'á¹´', 'á¹·' => 'á¹¶', 'á¹¹' => 'Ṹ', 'á¹»' => 'Ṻ', + 'á¹½' => 'á¹¼', 'ṿ' => 'á¹¾', 'áº' => 'Ẁ', 'ẃ' => 'Ẃ', 'ẅ' => 'Ẅ', 'ẇ' => 'Ẇ', + 'ẉ' => 'Ẉ', 'ẋ' => 'Ẋ', 'áº' => 'Ẍ', 'áº' => 'Ẏ', 'ẑ' => 'áº', 'ẓ' => 'Ẓ', + 'ẕ' => 'Ẕ', 'ạ' => 'Ạ', 'ả' => 'Ả', 'ấ' => 'Ấ', 'ầ' => 'Ầ', 'ẩ' => 'Ẩ', + 'ẫ' => 'Ẫ', 'ậ' => 'Ậ', 'ắ' => 'Ắ', 'ằ' => 'Ằ', 'ẳ' => 'Ẳ', 'ẵ' => 'Ẵ', + 'ặ' => 'Ặ', 'ẹ' => 'Ẹ', 'ẻ' => 'Ẻ', 'ẽ' => 'Ẽ', 'ế' => 'Ế', 'á»' => 'Ề', + 'ể' => 'Ể', 'á»…' => 'Ễ', 'ệ' => 'Ệ', 'ỉ' => 'Ỉ', 'ị' => 'Ị', 'á»' => 'Ọ', + 'á»' => 'Ỏ', 'ố' => 'á»', 'ồ' => 'á»’', 'ổ' => 'á»”', 'á»—' => 'á»–', 'á»™' => 'Ộ', + 'á»›' => 'Ớ', 'á»' => 'Ờ', 'ở' => 'Ở', 'ỡ' => 'á» ', 'ợ' => 'Ợ', 'ụ' => 'Ụ', + 'á»§' => 'Ủ', 'ứ' => 'Ứ', 'ừ' => 'Ừ', 'á»­' => 'Ử', 'ữ' => 'á»®', 'á»±' => 'á»°', + 'ỳ' => 'Ỳ', 'ỵ' => 'á»´', 'á»·' => 'á»¶', 'ỹ' => 'Ỹ', 'á¼€' => 'Ἀ', 'á¼' => 'Ἁ', + 'ἂ' => 'Ἂ', 'ἃ' => 'Ἃ', 'ἄ' => 'Ἄ', 'á¼…' => 'á¼', 'ἆ' => 'Ἆ', 'ἇ' => 'á¼', + 'á¼' => 'Ἐ', 'ἑ' => 'á¼™', 'á¼’' => 'Ἒ', 'ἓ' => 'á¼›', 'á¼”' => 'Ἔ', 'ἕ' => 'á¼', + 'á¼ ' => 'Ἠ', 'ἡ' => 'Ἡ', 'á¼¢' => 'Ἢ', 'á¼£' => 'Ἣ', 'ἤ' => 'Ἤ', 'á¼¥' => 'á¼­', + 'ἦ' => 'á¼®', 'á¼§' => 'Ἧ', 'á¼°' => 'Ἰ', 'á¼±' => 'á¼¹', 'á¼²' => 'Ἲ', 'á¼³' => 'á¼»', + 'á¼´' => 'á¼¼', 'á¼µ' => 'á¼½', 'á¼¶' => 'á¼¾', 'á¼·' => 'Ἷ', 'á½€' => 'Ὀ', 'á½' => 'Ὁ', + 'ὂ' => 'Ὂ', 'ὃ' => 'Ὃ', 'ὄ' => 'Ὄ', 'á½…' => 'á½', 'ὑ' => 'á½™', 'ὓ' => 'á½›', + 'ὕ' => 'á½', 'á½—' => 'Ὗ', 'á½ ' => 'Ὠ', 'ὡ' => 'Ὡ', 'á½¢' => 'Ὢ', 'á½£' => 'Ὣ', + 'ὤ' => 'Ὤ', 'á½¥' => 'á½­', 'ὦ' => 'á½®', 'á½§' => 'Ὧ', 'á¾€' => 'ᾈ', 'á¾' => 'ᾉ', + 'ᾂ' => 'ᾊ', 'ᾃ' => 'ᾋ', 'ᾄ' => 'ᾌ', 'á¾…' => 'á¾', 'ᾆ' => 'ᾎ', 'ᾇ' => 'á¾', + 'á¾' => 'ᾘ', 'ᾑ' => 'á¾™', 'á¾’' => 'ᾚ', 'ᾓ' => 'á¾›', 'á¾”' => 'ᾜ', 'ᾕ' => 'á¾', + 'á¾–' => 'ᾞ', 'á¾—' => 'ᾟ', 'á¾ ' => 'ᾨ', 'ᾡ' => 'ᾩ', 'á¾¢' => 'ᾪ', 'á¾£' => 'ᾫ', + 'ᾤ' => 'ᾬ', 'á¾¥' => 'á¾­', 'ᾦ' => 'á¾®', 'á¾§' => 'ᾯ', 'á¾°' => 'Ᾰ', 'á¾±' => 'á¾¹', + 'á¿' => 'Ῐ', 'á¿‘' => 'á¿™', 'á¿ ' => 'Ῠ', 'á¿¡' => 'á¿©', 'â“' => 'â’¶', 'â“‘' => 'â’·', + 'â“’' => 'â’¸', 'â““' => 'â’¹', 'â“”' => 'â’º', 'â“•' => 'â’»', 'â“–' => 'â’¼', 'â“—' => 'â’½', + 'ⓘ' => 'â’¾', 'â“™' => 'â’¿', 'ⓚ' => 'â“€', 'â“›' => 'â“', 'ⓜ' => 'â“‚', 'â“' => 'Ⓝ', + 'ⓞ' => 'â“„', 'ⓟ' => 'â“…', 'â“ ' => 'Ⓠ', 'â“¡' => 'Ⓡ', 'â“¢' => 'Ⓢ', 'â“£' => 'Ⓣ', + 'ⓤ' => 'Ⓤ', 'â“¥' => 'â“‹', 'ⓦ' => 'Ⓦ', 'â“§' => 'â“', 'ⓨ' => 'Ⓨ', 'â“©' => 'â“', + 'ï½' => 'A', 'b' => 'ï¼¢', 'c' => 'ï¼£', 'd' => 'D', 'ï½…' => 'ï¼¥', 'f' => 'F', + 'g' => 'ï¼§', 'h' => 'H', 'i' => 'I', 'j' => 'J', 'k' => 'K', 'l' => 'L', + 'ï½' => 'ï¼­', 'n' => 'ï¼®', 'ï½' => 'O', 'ï½' => 'ï¼°', 'q' => 'ï¼±', 'ï½’' => 'ï¼²', + 's' => 'ï¼³', 'ï½”' => 'ï¼´', 'u' => 'ï¼µ', 'ï½–' => 'ï¼¶', 'ï½—' => 'ï¼·', 'x' => 'X', + 'ï½™' => 'ï¼¹', 'z' => 'Z' + ); + + /** + * All lowercase UTF-8 characters not properly handled by [http://php.net/mb_strtoupper mb_strtoupper()] mapped to uppercase characters + * + * @var array + */ + static private $mb_lower_to_upper_fix = array( + 'ɘ' => 'ÆŽ', 'Dz' => 'DZ', 'áƒ' => 'á‚ ', 'ბ' => 'á‚¡', 'გ' => 'á‚¢', 'დ' => 'á‚£', + 'ე' => 'Ⴄ', 'ვ' => 'á‚¥', 'ზ' => 'Ⴆ', 'თ' => 'á‚§', 'ი' => 'Ⴈ', 'კ' => 'á‚©', + 'ლ' => 'Ⴊ', 'მ' => 'á‚«', 'ნ' => 'Ⴌ', 'áƒ' => 'á‚­', 'პ' => 'á‚®', 'ჟ' => 'Ⴏ', + 'რ' => 'á‚°', 'ს' => 'Ⴑ', 'ტ' => 'Ⴒ', 'უ' => 'Ⴓ', 'ფ' => 'á‚´', 'ქ' => 'Ⴕ', + 'ღ' => 'á‚¶', 'ყ' => 'á‚·', 'შ' => 'Ⴘ', 'ჩ' => 'Ⴙ', 'ც' => 'Ⴚ', 'ძ' => 'á‚»', + 'წ' => 'Ⴜ', 'ჭ' => 'Ⴝ', 'ხ' => 'Ⴞ', 'ჯ' => 'á‚¿', 'ჰ' => 'Ⴠ', 'ჱ' => 'áƒ', + 'ჲ' => 'Ⴢ', 'ჳ' => 'Ⴣ', 'ჴ' => 'Ⴤ', 'ჵ' => 'Ⴥ', 'â“' => 'â’¶', 'â“‘' => 'â’·', + 'â“’' => 'â’¸', 'â““' => 'â’¹', 'â“”' => 'â’º', 'â“•' => 'â’»', 'â“–' => 'â’¼', 'â“—' => 'â’½', + 'ⓘ' => 'â’¾', 'â“™' => 'â’¿', 'ⓚ' => 'â“€', 'â“›' => 'â“', 'ⓜ' => 'â“‚', 'â“' => 'Ⓝ', + 'ⓞ' => 'â“„', 'ⓟ' => 'â“…', 'â“ ' => 'Ⓠ', 'â“¡' => 'Ⓡ', 'â“¢' => 'Ⓢ', 'â“£' => 'Ⓣ', + 'ⓤ' => 'Ⓤ', 'â“¥' => 'â“‹', 'ⓦ' => 'Ⓦ', 'â“§' => 'â“', 'ⓨ' => 'Ⓨ', 'â“©' => 'â“' + ); + + /** + * All uppercase UTF-8 characters not properly handled by [http://php.net/mb_strtolower mb_strtolower()] mapped to lowercase characters + * + * @var array + */ + static private $mb_upper_to_lower_fix = array( + 'Ç' => 'ɘ', 'Ç…' => 'dž', 'Lj' => 'lj', 'Ç‹' => 'ÇŒ', 'á‚ ' => 'áƒ', 'á‚¡' => 'ბ', + 'á‚¢' => 'გ', 'á‚£' => 'დ', 'Ⴄ' => 'ე', 'á‚¥' => 'ვ', 'Ⴆ' => 'ზ', 'á‚§' => 'თ', + 'Ⴈ' => 'ი', 'á‚©' => 'კ', 'Ⴊ' => 'ლ', 'á‚«' => 'მ', 'Ⴌ' => 'ნ', 'á‚­' => 'áƒ', + 'á‚®' => 'პ', 'Ⴏ' => 'ჟ', 'á‚°' => 'რ', 'Ⴑ' => 'ს', 'Ⴒ' => 'ტ', 'Ⴓ' => 'უ', + 'á‚´' => 'ფ', 'Ⴕ' => 'ქ', 'á‚¶' => 'ღ', 'á‚·' => 'ყ', 'Ⴘ' => 'შ', 'Ⴙ' => 'ჩ', + 'Ⴚ' => 'ც', 'á‚»' => 'ძ', 'Ⴜ' => 'წ', 'Ⴝ' => 'ჭ', 'Ⴞ' => 'ხ', 'á‚¿' => 'ჯ', + 'Ⴠ' => 'ჰ', 'áƒ' => 'ჱ', 'Ⴢ' => 'ჲ', 'Ⴣ' => 'ჳ', 'Ⴤ' => 'ჴ', 'Ⴥ' => 'ჵ', + 'ᾈ' => 'á¾€', 'ᾉ' => 'á¾', 'ᾊ' => 'ᾂ', 'ᾋ' => 'ᾃ', 'ᾌ' => 'ᾄ', 'á¾' => 'á¾…', + 'ᾎ' => 'ᾆ', 'á¾' => 'ᾇ', 'ᾘ' => 'á¾', 'á¾™' => 'ᾑ', 'ᾚ' => 'á¾’', 'á¾›' => 'ᾓ', + 'ᾜ' => 'á¾”', 'á¾' => 'ᾕ', 'ᾞ' => 'á¾–', 'ᾟ' => 'á¾—', 'ᾨ' => 'á¾ ', 'ᾩ' => 'ᾡ', + 'ᾪ' => 'á¾¢', 'ᾫ' => 'á¾£', 'ᾬ' => 'ᾤ', 'á¾­' => 'á¾¥', 'á¾®' => 'ᾦ', 'ᾯ' => 'á¾§', + 'â’¶' => 'â“', 'â’·' => 'â“‘', 'â’¸' => 'â“’', 'â’¹' => 'â““', 'â’º' => 'â“”', 'â’»' => 'â“•', + 'â’¼' => 'â“–', 'â’½' => 'â“—', 'â’¾' => 'ⓘ', 'â’¿' => 'â“™', 'â“€' => 'ⓚ', 'â“' => 'â“›', + 'â“‚' => 'ⓜ', 'Ⓝ' => 'â“', 'â“„' => 'ⓞ', 'â“…' => 'ⓟ', 'Ⓠ' => 'â“ ', 'Ⓡ' => 'â“¡', + 'Ⓢ' => 'â“¢', 'Ⓣ' => 'â“£', 'Ⓤ' => 'ⓤ', 'â“‹' => 'â“¥', 'Ⓦ' => 'ⓦ', 'â“' => 'â“§', + 'Ⓨ' => 'ⓨ', 'â“' => 'â“©' + ); + + /** + * All uppercase UTF-8 characters mapped to lowercase characters + * + * @var array + */ + static private $upper_to_lower = array( + 'A' => 'a', 'B' => 'b', 'C' => 'c', 'D' => 'd', 'E' => 'e', 'F' => 'f', + 'G' => 'g', 'H' => 'h', 'I' => 'i', 'J' => 'j', 'K' => 'k', 'L' => 'l', + 'M' => 'm', 'N' => 'n', 'O' => 'o', 'P' => 'p', 'Q' => 'q', 'R' => 'r', + 'S' => 's', 'T' => 't', 'U' => 'u', 'V' => 'v', 'W' => 'w', 'X' => 'x', + 'Y' => 'y', 'Z' => 'z', 'À' => 'à', 'Ã' => 'á', 'Â' => 'â', 'Ã' => 'ã', + 'Ä' => 'ä', 'Ã…' => 'Ã¥', 'Æ' => 'æ', 'Ç' => 'ç', 'È' => 'è', 'É' => 'é', + 'Ê' => 'ê', 'Ë' => 'ë', 'ÃŒ' => 'ì', 'Ã' => 'í', 'ÃŽ' => 'î', 'Ã' => 'ï', + 'Ã' => 'ð', 'Ñ' => 'ñ', 'Ã’' => 'ò', 'Ó' => 'ó', 'Ô' => 'ô', 'Õ' => 'õ', + 'Ö' => 'ö', 'Ø' => 'ø', 'Ù' => 'ù', 'Ú' => 'ú', 'Û' => 'û', 'Ü' => 'ü', + 'Ã' => 'ý', 'Þ' => 'þ', 'Ä€' => 'Ä', 'Ä‚' => 'ă', 'Ä„' => 'Ä…', 'Ć' => 'ć', + 'Ĉ' => 'ĉ', 'ÄŠ' => 'Ä‹', 'ÄŒ' => 'Ä', 'ÄŽ' => 'Ä', 'Ä' => 'Ä‘', 'Ä’' => 'Ä“', + 'Ä”' => 'Ä•', 'Ä–' => 'Ä—', 'Ę' => 'Ä™', 'Äš' => 'Ä›', 'Äœ' => 'Ä', 'Äž' => 'ÄŸ', + 'Ä ' => 'Ä¡', 'Ä¢' => 'Ä£', 'Ĥ' => 'Ä¥', 'Ħ' => 'ħ', 'Ĩ' => 'Ä©', 'Ī' => 'Ä«', + 'Ĭ' => 'Ä­', 'Ä®' => 'į', 'İ' => 'i', 'IJ' => 'ij', 'Ä´' => 'ĵ', 'Ķ' => 'Ä·', + 'Ĺ' => 'ĺ', 'Ä»' => 'ļ', 'Ľ' => 'ľ', 'Ä¿' => 'Å€', 'Å' => 'Å‚', 'Ń' => 'Å„', + 'Å…' => 'ņ', 'Ň' => 'ň', 'ÅŠ' => 'Å‹', 'ÅŒ' => 'Å', 'ÅŽ' => 'Å', 'Å' => 'Å‘', + 'Å’' => 'Å“', 'Å”' => 'Å•', 'Å–' => 'Å—', 'Ř' => 'Å™', 'Åš' => 'Å›', 'Åœ' => 'Å', + 'Åž' => 'ÅŸ', 'Å ' => 'Å¡', 'Å¢' => 'Å£', 'Ť' => 'Å¥', 'Ŧ' => 'ŧ', 'Ũ' => 'Å©', + 'Ū' => 'Å«', 'Ŭ' => 'Å­', 'Å®' => 'ů', 'Ű' => 'ű', 'Ų' => 'ų', 'Å´' => 'ŵ', + 'Ŷ' => 'Å·', 'Ÿ' => 'ÿ', 'Ź' => 'ź', 'Å»' => 'ż', 'Ž' => 'ž', 'Æ' => 'É“', + 'Æ‚' => 'ƃ', 'Æ„' => 'Æ…', 'Ɔ' => 'É”', 'Ƈ' => 'ƈ', 'ÆŠ' => 'É—', 'Æ‹' => 'ÆŒ', + 'ÆŽ' => 'ɘ', 'Æ' => 'É™', 'Æ' => 'É›', 'Æ‘' => 'Æ’', 'Æ“' => 'É ', 'Æ”' => 'É£', + 'Æ–' => 'É©', 'Æ—' => 'ɨ', 'Ƙ' => 'Æ™', 'Æœ' => 'ɯ', 'Æ' => 'ɲ', 'ÆŸ' => 'ɵ', + 'Æ ' => 'Æ¡', 'Æ¢' => 'Æ£', 'Ƥ' => 'Æ¥', 'Ƨ' => 'ƨ', 'Æ©' => 'ʃ', 'Ƭ' => 'Æ­', + 'Æ®' => 'ʈ', 'Ư' => 'ư', 'Ʊ' => 'ÊŠ', 'Ʋ' => 'Ê‹', 'Ƴ' => 'Æ´', 'Ƶ' => 'ƶ', + 'Æ·' => 'Ê’', 'Ƹ' => 'ƹ', 'Ƽ' => 'ƽ', 'Ç„' => 'dž', 'Ç…' => 'dž', 'LJ' => 'lj', + 'Lj' => 'lj', 'ÇŠ' => 'ÇŒ', 'Ç‹' => 'ÇŒ', 'Ç' => 'ÇŽ', 'Ç' => 'Ç', 'Ç‘' => 'Ç’', + 'Ç“' => 'Ç”', 'Ç•' => 'Ç–', 'Ç—' => 'ǘ', 'Ç™' => 'Çš', 'Ç›' => 'Çœ', 'Çž' => 'ÇŸ', + 'Ç ' => 'Ç¡', 'Ç¢' => 'Ç£', 'Ǥ' => 'Ç¥', 'Ǧ' => 'ǧ', 'Ǩ' => 'Ç©', 'Ǫ' => 'Ç«', + 'Ǭ' => 'Ç­', 'Ç®' => 'ǯ', 'DZ' => 'dz', 'Ç´' => 'ǵ', 'Ǻ' => 'Ç»', 'Ǽ' => 'ǽ', + 'Ǿ' => 'Ç¿', 'È€' => 'È', 'È‚' => 'ȃ', 'È„' => 'È…', 'Ȇ' => 'ȇ', 'Ȉ' => 'ȉ', + 'ÈŠ' => 'È‹', 'ÈŒ' => 'È', 'ÈŽ' => 'È', 'È' => 'È‘', 'È’' => 'È“', 'È”' => 'È•', + 'È–' => 'È—', 'Ά' => 'ά', 'Έ' => 'έ', 'Ή' => 'ή', 'Ί' => 'ί', 'ÎŒ' => 'ÏŒ', + 'ÎŽ' => 'Ï', 'Î' => 'ÏŽ', 'Α' => 'α', 'Î’' => 'β', 'Γ' => 'γ', 'Δ' => 'δ', + 'Ε' => 'ε', 'Ζ' => 'ζ', 'Η' => 'η', 'Θ' => 'θ', 'Ι' => 'ι', 'Κ' => 'κ', + 'Λ' => 'λ', 'Μ' => 'μ', 'Î' => 'ν', 'Ξ' => 'ξ', 'Ο' => 'ο', 'Π' => 'Ï€', + 'Ρ' => 'Ï', 'Σ' => 'σ', 'Τ' => 'Ï„', 'Î¥' => 'Ï…', 'Φ' => 'φ', 'Χ' => 'χ', + 'Ψ' => 'ψ', 'Ω' => 'ω', 'Ϊ' => 'ÏŠ', 'Ϋ' => 'Ï‹', 'Ï¢' => 'Ï£', 'Ϥ' => 'Ï¥', + 'Ϧ' => 'ϧ', 'Ϩ' => 'Ï©', 'Ϫ' => 'Ï«', 'Ϭ' => 'Ï­', 'Ï®' => 'ϯ', 'Ð' => 'Ñ‘', + 'Ђ' => 'Ñ’', 'Ѓ' => 'Ñ“', 'Є' => 'Ñ”', 'Ð…' => 'Ñ•', 'І' => 'Ñ–', 'Ї' => 'Ñ—', + 'Ј' => 'ј', 'Љ' => 'Ñ™', 'Њ' => 'Ñš', 'Ћ' => 'Ñ›', 'ÐŒ' => 'Ñœ', 'ÐŽ' => 'Ñž', + 'Ð' => 'ÑŸ', 'Ð' => 'а', 'Б' => 'б', 'Ð’' => 'в', 'Г' => 'г', 'Д' => 'д', + 'Е' => 'е', 'Ж' => 'ж', 'З' => 'з', 'И' => 'и', 'Й' => 'й', 'К' => 'к', + 'Л' => 'л', 'М' => 'м', 'Ð' => 'н', 'О' => 'о', 'П' => 'п', 'Р' => 'Ñ€', + 'С' => 'Ñ', 'Т' => 'Ñ‚', 'У' => 'у', 'Ф' => 'Ñ„', 'Ð¥' => 'Ñ…', 'Ц' => 'ц', + 'Ч' => 'ч', 'Ш' => 'ш', 'Щ' => 'щ', 'Ъ' => 'ÑŠ', 'Ы' => 'Ñ‹', 'Ь' => 'ÑŒ', + 'Э' => 'Ñ', 'Ю' => 'ÑŽ', 'Я' => 'Ñ', 'Ñ ' => 'Ñ¡', 'Ñ¢' => 'Ñ£', 'Ѥ' => 'Ñ¥', + 'Ѧ' => 'ѧ', 'Ѩ' => 'Ñ©', 'Ѫ' => 'Ñ«', 'Ѭ' => 'Ñ­', 'Ñ®' => 'ѯ', 'Ѱ' => 'ѱ', + 'Ѳ' => 'ѳ', 'Ñ´' => 'ѵ', 'Ѷ' => 'Ñ·', 'Ѹ' => 'ѹ', 'Ѻ' => 'Ñ»', 'Ѽ' => 'ѽ', + 'Ѿ' => 'Ñ¿', 'Ò€' => 'Ò', 'Ò' => 'Ò‘', 'Ò’' => 'Ò“', 'Ò”' => 'Ò•', 'Ò–' => 'Ò—', + 'Ò˜' => 'Ò™', 'Òš' => 'Ò›', 'Òœ' => 'Ò', 'Òž' => 'ÒŸ', 'Ò ' => 'Ò¡', 'Ò¢' => 'Ò£', + 'Ò¤' => 'Ò¥', 'Ò¦' => 'Ò§', 'Ò¨' => 'Ò©', 'Òª' => 'Ò«', 'Ò¬' => 'Ò­', 'Ò®' => 'Ò¯', + 'Ò°' => 'Ò±', 'Ò²' => 'Ò³', 'Ò´' => 'Òµ', 'Ò¶' => 'Ò·', 'Ò¸' => 'Ò¹', 'Òº' => 'Ò»', + 'Ò¼' => 'Ò½', 'Ò¾' => 'Ò¿', 'Ó' => 'Ó‚', 'Óƒ' => 'Ó„', 'Ó‡' => 'Óˆ', 'Ó‹' => 'ÓŒ', + 'Ó' => 'Ó‘', 'Ó’' => 'Ó“', 'Ó”' => 'Ó•', 'Ó–' => 'Ó—', 'Ó˜' => 'Ó™', 'Óš' => 'Ó›', + 'Óœ' => 'Ó', 'Óž' => 'ÓŸ', 'Ó ' => 'Ó¡', 'Ó¢' => 'Ó£', 'Ó¤' => 'Ó¥', 'Ó¦' => 'Ó§', + 'Ó¨' => 'Ó©', 'Óª' => 'Ó«', 'Ó®' => 'Ó¯', 'Ó°' => 'Ó±', 'Ó²' => 'Ó³', 'Ó´' => 'Óµ', + 'Ó¸' => 'Ó¹', 'Ô±' => 'Õ¡', 'Ô²' => 'Õ¢', 'Ô³' => 'Õ£', 'Ô´' => 'Õ¤', 'Ôµ' => 'Õ¥', + 'Ô¶' => 'Õ¦', 'Ô·' => 'Õ§', 'Ô¸' => 'Õ¨', 'Ô¹' => 'Õ©', 'Ôº' => 'Õª', 'Ô»' => 'Õ«', + 'Ô¼' => 'Õ¬', 'Ô½' => 'Õ­', 'Ô¾' => 'Õ®', 'Ô¿' => 'Õ¯', 'Õ€' => 'Õ°', 'Õ' => 'Õ±', + 'Õ‚' => 'Õ²', 'Õƒ' => 'Õ³', 'Õ„' => 'Õ´', 'Õ…' => 'Õµ', 'Õ†' => 'Õ¶', 'Õ‡' => 'Õ·', + 'Õˆ' => 'Õ¸', 'Õ‰' => 'Õ¹', 'ÕŠ' => 'Õº', 'Õ‹' => 'Õ»', 'ÕŒ' => 'Õ¼', 'Õ' => 'Õ½', + 'ÕŽ' => 'Õ¾', 'Õ' => 'Õ¿', 'Õ' => 'Ö€', 'Õ‘' => 'Ö', 'Õ’' => 'Ö‚', 'Õ“' => 'Öƒ', + 'Õ”' => 'Ö„', 'Õ•' => 'Ö…', 'Õ–' => 'Ö†', 'á‚ ' => 'áƒ', 'á‚¡' => 'ბ', 'á‚¢' => 'გ', + 'á‚£' => 'დ', 'Ⴄ' => 'ე', 'á‚¥' => 'ვ', 'Ⴆ' => 'ზ', 'á‚§' => 'თ', 'Ⴈ' => 'ი', + 'á‚©' => 'კ', 'Ⴊ' => 'ლ', 'á‚«' => 'მ', 'Ⴌ' => 'ნ', 'á‚­' => 'áƒ', 'á‚®' => 'პ', + 'Ⴏ' => 'ჟ', 'á‚°' => 'რ', 'Ⴑ' => 'ს', 'Ⴒ' => 'ტ', 'Ⴓ' => 'უ', 'á‚´' => 'ფ', + 'Ⴕ' => 'ქ', 'á‚¶' => 'ღ', 'á‚·' => 'ყ', 'Ⴘ' => 'შ', 'Ⴙ' => 'ჩ', 'Ⴚ' => 'ც', + 'á‚»' => 'ძ', 'Ⴜ' => 'წ', 'Ⴝ' => 'ჭ', 'Ⴞ' => 'ხ', 'á‚¿' => 'ჯ', 'Ⴠ' => 'ჰ', + 'áƒ' => 'ჱ', 'Ⴢ' => 'ჲ', 'Ⴣ' => 'ჳ', 'Ⴤ' => 'ჴ', 'Ⴥ' => 'ჵ', 'Ḁ' => 'á¸', + 'Ḃ' => 'ḃ', 'Ḅ' => 'ḅ', 'Ḇ' => 'ḇ', 'Ḉ' => 'ḉ', 'Ḋ' => 'ḋ', 'Ḍ' => 'á¸', + 'Ḏ' => 'á¸', 'á¸' => 'ḑ', 'Ḓ' => 'ḓ', 'Ḕ' => 'ḕ', 'Ḗ' => 'ḗ', 'Ḙ' => 'ḙ', + 'Ḛ' => 'ḛ', 'Ḝ' => 'á¸', 'Ḟ' => 'ḟ', 'Ḡ' => 'ḡ', 'Ḣ' => 'ḣ', 'Ḥ' => 'ḥ', + 'Ḧ' => 'ḧ', 'Ḩ' => 'ḩ', 'Ḫ' => 'ḫ', 'Ḭ' => 'ḭ', 'Ḯ' => 'ḯ', 'Ḱ' => 'ḱ', + 'Ḳ' => 'ḳ', 'Ḵ' => 'ḵ', 'Ḷ' => 'ḷ', 'Ḹ' => 'ḹ', 'Ḻ' => 'ḻ', 'Ḽ' => 'ḽ', + 'Ḿ' => 'ḿ', 'á¹€' => 'á¹', 'Ṃ' => 'ṃ', 'Ṅ' => 'á¹…', 'Ṇ' => 'ṇ', 'Ṉ' => 'ṉ', + 'Ṋ' => 'ṋ', 'Ṍ' => 'á¹', 'Ṏ' => 'á¹', 'á¹' => 'ṑ', 'á¹’' => 'ṓ', 'á¹”' => 'ṕ', + 'á¹–' => 'á¹—', 'Ṙ' => 'á¹™', 'Ṛ' => 'á¹›', 'Ṝ' => 'á¹', 'Ṟ' => 'ṟ', 'á¹ ' => 'ṡ', + 'á¹¢' => 'á¹£', 'Ṥ' => 'á¹¥', 'Ṧ' => 'á¹§', 'Ṩ' => 'ṩ', 'Ṫ' => 'ṫ', 'Ṭ' => 'á¹­', + 'á¹®' => 'ṯ', 'á¹°' => 'á¹±', 'á¹²' => 'á¹³', 'á¹´' => 'á¹µ', 'á¹¶' => 'á¹·', 'Ṹ' => 'á¹¹', + 'Ṻ' => 'á¹»', 'á¹¼' => 'á¹½', 'á¹¾' => 'ṿ', 'Ẁ' => 'áº', 'Ẃ' => 'ẃ', 'Ẅ' => 'ẅ', + 'Ẇ' => 'ẇ', 'Ẉ' => 'ẉ', 'Ẋ' => 'ẋ', 'Ẍ' => 'áº', 'Ẏ' => 'áº', 'áº' => 'ẑ', + 'Ẓ' => 'ẓ', 'Ẕ' => 'ẕ', 'Ạ' => 'ạ', 'Ả' => 'ả', 'Ấ' => 'ấ', 'Ầ' => 'ầ', + 'Ẩ' => 'ẩ', 'Ẫ' => 'ẫ', 'Ậ' => 'ậ', 'Ắ' => 'ắ', 'Ằ' => 'ằ', 'Ẳ' => 'ẳ', + 'Ẵ' => 'ẵ', 'Ặ' => 'ặ', 'Ẹ' => 'ẹ', 'Ẻ' => 'ẻ', 'Ẽ' => 'ẽ', 'Ế' => 'ế', + 'Ề' => 'á»', 'Ể' => 'ể', 'Ễ' => 'á»…', 'Ệ' => 'ệ', 'Ỉ' => 'ỉ', 'Ị' => 'ị', + 'Ọ' => 'á»', 'Ỏ' => 'á»', 'á»' => 'ố', 'á»’' => 'ồ', 'á»”' => 'ổ', 'á»–' => 'á»—', + 'Ộ' => 'á»™', 'Ớ' => 'á»›', 'Ờ' => 'á»', 'Ở' => 'ở', 'á» ' => 'ỡ', 'Ợ' => 'ợ', + 'Ụ' => 'ụ', 'Ủ' => 'á»§', 'Ứ' => 'ứ', 'Ừ' => 'ừ', 'Ử' => 'á»­', 'á»®' => 'ữ', + 'á»°' => 'á»±', 'Ỳ' => 'ỳ', 'á»´' => 'ỵ', 'á»¶' => 'á»·', 'Ỹ' => 'ỹ', 'Ἀ' => 'á¼€', + 'Ἁ' => 'á¼', 'Ἂ' => 'ἂ', 'Ἃ' => 'ἃ', 'Ἄ' => 'ἄ', 'á¼' => 'á¼…', 'Ἆ' => 'ἆ', + 'á¼' => 'ἇ', 'Ἐ' => 'á¼', 'á¼™' => 'ἑ', 'Ἒ' => 'á¼’', 'á¼›' => 'ἓ', 'Ἔ' => 'á¼”', + 'á¼' => 'ἕ', 'Ἠ' => 'á¼ ', 'Ἡ' => 'ἡ', 'Ἢ' => 'á¼¢', 'Ἣ' => 'á¼£', 'Ἤ' => 'ἤ', + 'á¼­' => 'á¼¥', 'á¼®' => 'ἦ', 'Ἧ' => 'á¼§', 'Ἰ' => 'á¼°', 'á¼¹' => 'á¼±', 'Ἲ' => 'á¼²', + 'á¼»' => 'á¼³', 'á¼¼' => 'á¼´', 'á¼½' => 'á¼µ', 'á¼¾' => 'á¼¶', 'Ἷ' => 'á¼·', 'Ὀ' => 'á½€', + 'Ὁ' => 'á½', 'Ὂ' => 'ὂ', 'Ὃ' => 'ὃ', 'Ὄ' => 'ὄ', 'á½' => 'á½…', 'á½™' => 'ὑ', + 'á½›' => 'ὓ', 'á½' => 'ὕ', 'Ὗ' => 'á½—', 'Ὠ' => 'á½ ', 'Ὡ' => 'ὡ', 'Ὢ' => 'á½¢', + 'Ὣ' => 'á½£', 'Ὤ' => 'ὤ', 'á½­' => 'á½¥', 'á½®' => 'ὦ', 'Ὧ' => 'á½§', 'ᾈ' => 'á¾€', + 'ᾉ' => 'á¾', 'ᾊ' => 'ᾂ', 'ᾋ' => 'ᾃ', 'ᾌ' => 'ᾄ', 'á¾' => 'á¾…', 'ᾎ' => 'ᾆ', + 'á¾' => 'ᾇ', 'ᾘ' => 'á¾', 'á¾™' => 'ᾑ', 'ᾚ' => 'á¾’', 'á¾›' => 'ᾓ', 'ᾜ' => 'á¾”', + 'á¾' => 'ᾕ', 'ᾞ' => 'á¾–', 'ᾟ' => 'á¾—', 'ᾨ' => 'á¾ ', 'ᾩ' => 'ᾡ', 'ᾪ' => 'á¾¢', + 'ᾫ' => 'á¾£', 'ᾬ' => 'ᾤ', 'á¾­' => 'á¾¥', 'á¾®' => 'ᾦ', 'ᾯ' => 'á¾§', 'Ᾰ' => 'á¾°', + 'á¾¹' => 'á¾±', 'Ῐ' => 'á¿', 'á¿™' => 'á¿‘', 'Ῠ' => 'á¿ ', 'á¿©' => 'á¿¡', 'â’¶' => 'â“', + 'â’·' => 'â“‘', 'â’¸' => 'â“’', 'â’¹' => 'â““', 'â’º' => 'â“”', 'â’»' => 'â“•', 'â’¼' => 'â“–', + 'â’½' => 'â“—', 'â’¾' => 'ⓘ', 'â’¿' => 'â“™', 'â“€' => 'ⓚ', 'â“' => 'â“›', 'â“‚' => 'ⓜ', + 'Ⓝ' => 'â“', 'â“„' => 'ⓞ', 'â“…' => 'ⓟ', 'Ⓠ' => 'â“ ', 'Ⓡ' => 'â“¡', 'Ⓢ' => 'â“¢', + 'Ⓣ' => 'â“£', 'Ⓤ' => 'ⓤ', 'â“‹' => 'â“¥', 'Ⓦ' => 'ⓦ', 'â“' => 'â“§', 'Ⓨ' => 'ⓨ', + 'â“' => 'â“©', 'A' => 'ï½', 'ï¼¢' => 'b', 'ï¼£' => 'c', 'D' => 'd', 'ï¼¥' => 'ï½…', + 'F' => 'f', 'ï¼§' => 'g', 'H' => 'h', 'I' => 'i', 'J' => 'j', 'K' => 'k', + 'L' => 'l', 'ï¼­' => 'ï½', 'ï¼®' => 'n', 'O' => 'ï½', 'ï¼°' => 'ï½', 'ï¼±' => 'q', + 'ï¼²' => 'ï½’', 'ï¼³' => 's', 'ï¼´' => 'ï½”', 'ï¼µ' => 'u', 'ï¼¶' => 'ï½–', 'ï¼·' => 'ï½—', + 'X' => 'x', 'ï¼¹' => 'ï½™', 'Z' => 'z' + ); + + /** + * A mapping of all ASCII-based latin characters, puntuation, symbols and number forms to ASCII. + * + * Includes elements form the following unicode blocks: + * + * - Latin-1 Supplement + * - Latin Extended-A + * - Latin Extended-B + * - IPA Extensions + * - Latin Extended Additional + * - General Punctuation + * - Letterlike symbols + * - Number Forms + * + * @var array + */ + static private $utf8_to_ascii = array( + // Latin-1 Supplement + '©' => '(c)', '«' => '<<', '®' => '(R)', '»' => '>>', '¼' => '1/4', + '½' => '1/2', '¾' => '3/4', 'À' => 'A', 'Ã' => 'A', 'Â' => 'A', + 'Ã' => 'A', 'Ä' => 'A', 'Ã…' => 'A', 'Æ' => 'AE', 'Ç' => 'C', + 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'ÃŒ' => 'I', + 'Ã' => 'I', 'ÃŽ' => 'I', 'Ã' => 'I', 'Ñ' => 'N', 'Ã’' => 'O', + 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O', 'Ø' => 'O', + 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ã' => 'Y', + 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', + 'Ã¥' => 'a', 'æ' => 'ae', 'ç' => 'c', 'è' => 'e', 'é' => 'e', + 'ê' => 'e', 'ë' => 'e', 'ì' => 'i', 'í' => 'i', 'î' => 'i', + 'ï' => 'i', 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', + 'õ' => 'o', 'ö' => 'o', 'ø' => 'o', 'ù' => 'u', 'ú' => 'u', + 'û' => 'u', 'ü' => 'u', 'ý' => 'y', 'ÿ' => 'y', + // Latin Extended-A + 'Ä€' => 'A', 'Ä' => 'a', 'Ä‚' => 'A', 'ă' => 'a', 'Ä„' => 'A', + 'Ä…' => 'a', 'Ć' => 'C', 'ć' => 'c', 'Ĉ' => 'C', 'ĉ' => 'c', + 'ÄŠ' => 'C', 'Ä‹' => 'c', 'ÄŒ' => 'C', 'Ä' => 'c', 'ÄŽ' => 'D', + 'Ä' => 'd', 'Ä' => 'D', 'Ä‘' => 'd', 'Ä’' => 'E', 'Ä“' => 'e', + 'Ä”' => 'E', 'Ä•' => 'e', 'Ä–' => 'E', 'Ä—' => 'e', 'Ę' => 'E', + 'Ä™' => 'e', 'Äš' => 'E', 'Ä›' => 'e', 'Äœ' => 'G', 'Ä' => 'g', + 'Äž' => 'G', 'ÄŸ' => 'g', 'Ä ' => 'G', 'Ä¡' => 'g', 'Ä¢' => 'G', + 'Ä£' => 'g', 'Ĥ' => 'H', 'Ä¥' => 'h', 'Ħ' => 'H', 'ħ' => 'h', + 'Ĩ' => 'I', 'Ä©' => 'i', 'Ī' => 'I', 'Ä«' => 'i', 'Ĭ' => 'I', + 'Ä­' => 'i', 'Ä®' => 'I', 'į' => 'i', 'İ' => 'I', 'ı' => 'i', + 'IJ' => 'IJ', 'ij' => 'ij', 'Ä´' => 'J', 'ĵ' => 'j', 'Ķ' => 'K', + 'Ä·' => 'k', 'Ĺ' => 'L', 'ĺ' => 'l', 'Ä»' => 'L', 'ļ' => 'l', + 'Ľ' => 'L', 'ľ' => 'l', 'Ä¿' => 'L', 'Å€' => 'l', 'Å' => 'L', + 'Å‚' => 'l', 'Ń' => 'N', 'Å„' => 'n', 'Å…' => 'N', 'ņ' => 'n', + 'Ň' => 'N', 'ň' => 'n', 'ʼn' => "'n", 'ÅŠ' => 'N', 'Å‹' => 'n', + 'ÅŒ' => 'O', 'Å' => 'o', 'ÅŽ' => 'O', 'Å' => 'o', 'Å' => 'O', + 'Å‘' => 'o', 'Å’' => 'OE', 'Å“' => 'oe', 'Å”' => 'R', 'Å•' => 'r', + 'Å–' => 'R', 'Å—' => 'r', 'Ř' => 'R', 'Å™' => 'r', 'Åš' => 'S', + 'Å›' => 's', 'Åœ' => 'S', 'Å' => 's', 'Åž' => 'S', 'ÅŸ' => 's', + 'Å ' => 'S', 'Å¡' => 's', 'Å¢' => 'T', 'Å£' => 't', 'Ť' => 'T', + 'Å¥' => 't', 'Ŧ' => 'T', 'ŧ' => 't', 'Ũ' => 'U', 'Å©' => 'u', + 'Ū' => 'U', 'Å«' => 'u', 'Ŭ' => 'U', 'Å­' => 'u', 'Å®' => 'U', + 'ů' => 'u', 'Ű' => 'U', 'ű' => 'u', 'Ų' => 'U', 'ų' => 'u', + 'Å´' => 'W', 'ŵ' => 'w', 'Ŷ' => 'Y', 'Å·' => 'y', 'Ÿ' => 'Y', + 'Ź' => 'Z', 'ź' => 'z', 'Å»' => 'Z', 'ż' => 'z', 'Ž' => 'Z', + 'ž' => 'z', + // Latin Extended-B + 'Æ€' => 'b', 'Æ' => 'B', 'Æ‚' => 'B', 'ƃ' => 'b', 'Ɔ' => 'O', + 'Ƈ' => 'C', 'ƈ' => 'c', 'Ɖ' => 'D', 'ÆŠ' => 'D', 'Æ‹' => 'D', + 'ÆŒ' => 'd', 'ÆŽ' => 'E', 'Æ' => 'E', 'Æ‘' => 'F', 'Æ’' => 'f', + 'Æ“' => 'G', 'Æ—' => 'I', 'Ƙ' => 'K', 'Æ™' => 'k', 'Æš' => 'l', + 'Æœ' => 'M', 'Æ' => 'N', 'Æž' => 'n', 'ÆŸ' => 'O', 'Æ ' => 'O', + 'Æ¡' => 'o', 'Æ¢' => 'OI', 'Æ£' => 'oi', 'Ƥ' => 'P', 'Æ¥' => 'p', + 'Æ«' => 't', 'Ƭ' => 'T', 'Æ­' => 't', 'Æ®' => 'T', 'Ư' => 'U', + 'ư' => 'u', 'Ʋ' => 'V', 'Ƴ' => 'Y', 'Æ´' => 'y', 'Ƶ' => 'Z', + 'ƶ' => 'z', 'Æ»' => '2', 'Ç„' => 'DZ', 'Ç…' => 'Dz', 'dž' => 'dz', + 'LJ' => 'LJ', 'Lj' => 'Lj', 'lj' => 'lj', 'ÇŠ' => 'Nj', 'Ç‹' => 'Nj', + 'ÇŒ' => 'nj', 'Ç' => 'A', 'ÇŽ' => 'a', 'Ç' => 'I', 'Ç' => 'i', + 'Ç‘' => 'O', 'Ç’' => 'o', 'Ç“' => 'U', 'Ç”' => 'u', 'Ç•' => 'U', + 'Ç–' => 'u', 'Ç—' => 'U', 'ǘ' => 'u', 'Ç™' => 'U', 'Çš' => 'u', + 'Ç›' => 'U', 'Çœ' => 'u', 'Ç' => 'e', 'Çž' => 'A', 'ÇŸ' => 'a', + 'Ç ' => 'A', 'Ç¡' => 'a', 'Ç¢' => 'AE', 'Ç£' => 'ae', 'Ǥ' => 'G', + 'Ç¥' => 'g', 'Ǧ' => 'G', 'ǧ' => 'g', 'Ǩ' => 'K', 'Ç©' => 'k', + 'Ǫ' => 'O', 'Ç«' => 'o', 'Ǭ' => 'O', 'Ç­' => 'o', 'ǰ' => 'j', + 'DZ' => 'DZ', 'Dz' => 'Dz', 'dz' => 'dz', 'Ç´' => 'G', 'ǵ' => 'g', + 'Ǹ' => 'N', 'ǹ' => 'n', 'Ǻ' => 'A', 'Ç»' => 'a', 'Ǽ' => 'AE', + 'ǽ' => 'ae', 'Ǿ' => 'O', 'Ç¿' => 'o', 'È€' => 'A', 'È' => 'a', + 'È‚' => 'A', 'ȃ' => 'a', 'È„' => 'E', 'È…' => 'e', 'Ȇ' => 'E', + 'ȇ' => 'e', 'Ȉ' => 'I', 'ȉ' => 'i', 'ÈŠ' => 'I', 'È‹' => 'i', + 'ÈŒ' => 'O', 'È' => 'o', 'ÈŽ' => 'O', 'È' => 'o', 'È' => 'R', + 'È‘' => 'r', 'È’' => 'R', 'È“' => 'r', 'È”' => 'U', 'È•' => 'u', + 'È–' => 'U', 'È—' => 'u', 'Ș' => 'S', 'È™' => 's', 'Èš' => 'T', + 'È›' => 't', 'Èž' => 'H', 'ÈŸ' => 'h', 'È ' => 'N', 'È¡' => 'd', + 'Ȥ' => 'Z', 'È¥' => 'z', 'Ȧ' => 'A', 'ȧ' => 'a', 'Ȩ' => 'E', + 'È©' => 'e', 'Ȫ' => 'O', 'È«' => 'o', 'Ȭ' => 'O', 'È­' => 'o', + 'È®' => 'O', 'ȯ' => 'o', 'Ȱ' => 'O', 'ȱ' => 'o', 'Ȳ' => 'Y', + 'ȳ' => 'y', 'È´' => 'l', 'ȵ' => 'n', 'ȶ' => 't', 'È·' => 'j', + 'ȸ' => 'db', 'ȹ' => 'qp', 'Ⱥ' => 'A', 'È»' => 'C', 'ȼ' => 'c', + 'Ƚ' => 'L', 'Ⱦ' => 'T', 'È¿' => 's', 'É€' => 'z', 'Ƀ' => 'B', + 'É„' => 'U', 'É…' => 'V', 'Ɇ' => 'E', 'ɇ' => 'e', 'Ɉ' => 'J', + 'ɉ' => 'j', 'ÉŠ' => 'Q', 'É‹' => 'q', 'ÉŒ' => 'R', 'É' => 'r', + 'ÉŽ' => 'Y', 'É' => 'y', + // IPA Extensions + 'É' => 'a', 'É“' => 'b', 'É”' => 'o', 'É•' => 'c', 'É–' => 'd', + 'É—' => 'd', 'ɘ' => 'e', 'É›' => 'e', 'Éœ' => 'e', 'É' => 'e', + 'Éž' => 'e', 'ÉŸ' => 'j', 'É ' => 'g', 'É¡' => 'g', 'É¢' => 'G', + 'É¥' => 'h', 'ɦ' => 'h', 'ɨ' => 'i', 'ɪ' => 'I', 'É«' => 'l', + 'ɬ' => 'l', 'É­' => 'l', 'ɯ' => 'm', 'ɰ' => 'm', 'ɱ' => 'm', + 'ɲ' => 'n', 'ɳ' => 'n', 'É´' => 'N', 'ɵ' => 'o', 'ɶ' => 'OE', + 'ɹ' => 'r', 'ɺ' => 'r', 'É»' => 'r', 'ɼ' => 'r', 'ɽ' => 'r', + 'ɾ' => 'r', 'É¿' => 'r', 'Ê€' => 'R', 'Ê' => 'R', 'Ê‚' => 's', + 'ʇ' => 't', 'ʈ' => 't', 'ʉ' => 'u', 'Ê‹' => 'v', 'ÊŒ' => 'v', + 'Ê' => 'w', 'ÊŽ' => 'y', 'Ê' => 'Y', 'Ê' => 'z', 'Ê‘' => 'z', + 'Ê—' => 'C', 'Ê™' => 'B', 'Êš' => 'e', 'Ê›' => 'G', 'Êœ' => 'H', + 'Ê' => 'j', 'Êž' => 'k', 'ÊŸ' => 'L', 'Ê ' => 'q', 'Ê£' => 'dz', + 'Ê¥' => 'dz', 'ʦ' => 'ts', 'ʨ' => 'tc', 'ʪ' => 'ls', 'Ê«' => 'lz', + 'Ê®' => 'h', 'ʯ' => 'h', + // Latin Extended Additional + 'Ḁ' => 'A', 'á¸' => 'a', 'Ḃ' => 'B', 'ḃ' => 'b', 'Ḅ' => 'B', + 'ḅ' => 'b', 'Ḇ' => 'B', 'ḇ' => 'b', 'Ḉ' => 'C', 'ḉ' => 'c', + 'Ḋ' => 'D', 'ḋ' => 'd', 'Ḍ' => 'D', 'á¸' => 'd', 'Ḏ' => 'D', + 'á¸' => 'd', 'á¸' => 'D', 'ḑ' => 'd', 'Ḓ' => 'D', 'ḓ' => 'd', + 'Ḕ' => 'E', 'ḕ' => 'e', 'Ḗ' => 'E', 'ḗ' => 'e', 'Ḙ' => 'E', + 'ḙ' => 'e', 'Ḛ' => 'E', 'ḛ' => 'e', 'Ḝ' => 'E', 'á¸' => 'e', + 'Ḟ' => 'F', 'ḟ' => 'f', 'Ḡ' => 'G', 'ḡ' => 'g', 'Ḣ' => 'H', + 'ḣ' => 'h', 'Ḥ' => 'H', 'ḥ' => 'h', 'Ḧ' => 'H', 'ḧ' => 'h', + 'Ḩ' => 'H', 'ḩ' => 'h', 'Ḫ' => 'H', 'ḫ' => 'h', 'Ḭ' => 'I', + 'ḭ' => 'i', 'Ḯ' => 'I', 'ḯ' => 'i', 'Ḱ' => 'K', 'ḱ' => 'k', + 'Ḳ' => 'K', 'ḳ' => 'k', 'Ḵ' => 'K', 'ḵ' => 'k', 'Ḷ' => 'L', + 'ḷ' => 'l', 'Ḹ' => 'L', 'ḹ' => 'l', 'Ḻ' => 'L', 'ḻ' => 'l', + 'Ḽ' => 'L', 'ḽ' => 'l', 'Ḿ' => 'M', 'ḿ' => 'm', 'á¹€' => 'M', + 'á¹' => 'm', 'Ṃ' => 'M', 'ṃ' => 'm', 'Ṅ' => 'N', 'á¹…' => 'n', + 'Ṇ' => 'N', 'ṇ' => 'n', 'Ṉ' => 'N', 'ṉ' => 'n', 'Ṋ' => 'N', + 'ṋ' => 'n', 'Ṍ' => 'O', 'á¹' => 'o', 'Ṏ' => 'O', 'á¹' => 'o', + 'á¹' => 'O', 'ṑ' => 'o', 'á¹’' => 'O', 'ṓ' => 'o', 'á¹”' => 'P', + 'ṕ' => 'p', 'á¹–' => 'P', 'á¹—' => 'p', 'Ṙ' => 'R', 'á¹™' => 'r', + 'Ṛ' => 'R', 'á¹›' => 'r', 'Ṝ' => 'R', 'á¹' => 'r', 'Ṟ' => 'R', + 'ṟ' => 'r', 'á¹ ' => 'S', 'ṡ' => 's', 'á¹¢' => 'S', 'á¹£' => 's', + 'Ṥ' => 'S', 'á¹¥' => 's', 'Ṧ' => 'S', 'á¹§' => 's', 'Ṩ' => 'S', + 'ṩ' => 's', 'Ṫ' => 'T', 'ṫ' => 't', 'Ṭ' => 'T', 'á¹­' => 't', + 'á¹®' => 'T', 'ṯ' => 't', 'á¹°' => 'T', 'á¹±' => 't', 'á¹²' => 'U', + 'á¹³' => 'u', 'á¹´' => 'U', 'á¹µ' => 'u', 'á¹¶' => 'U', 'á¹·' => 'u', + 'Ṹ' => 'U', 'á¹¹' => 'u', 'Ṻ' => 'U', 'á¹»' => 'u', 'á¹¼' => 'V', + 'á¹½' => 'v', 'á¹¾' => 'V', 'ṿ' => 'v', 'Ẁ' => 'W', 'áº' => 'w', + 'Ẃ' => 'W', 'ẃ' => 'w', 'Ẅ' => 'W', 'ẅ' => 'w', 'Ẇ' => 'W', + 'ẇ' => 'w', 'Ẉ' => 'W', 'ẉ' => 'w', 'Ẋ' => 'X', 'ẋ' => 'x', + 'Ẍ' => 'X', 'áº' => 'x', 'Ẏ' => 'Y', 'áº' => 'y', 'áº' => 'Z', + 'ẑ' => 'z', 'Ẓ' => 'Z', 'ẓ' => 'z', 'Ẕ' => 'Z', 'ẕ' => 'z', + 'ẖ' => 'h', 'ẗ' => 't', 'ẘ' => 'w', 'ẙ' => 'y', 'ẚ' => 'a', + 'Ạ' => 'A', 'ạ' => 'a', 'Ả' => 'A', 'ả' => 'a', 'Ấ' => 'A', + 'ấ' => 'a', 'Ầ' => 'A', 'ầ' => 'a', 'Ẩ' => 'A', 'ẩ' => 'a', + 'Ẫ' => 'A', 'ẫ' => 'a', 'Ậ' => 'A', 'ậ' => 'a', 'Ắ' => 'A', + 'ắ' => 'a', 'Ằ' => 'A', 'ằ' => 'a', 'Ẳ' => 'A', 'ẳ' => 'a', + 'Ẵ' => 'A', 'ẵ' => 'a', 'Ặ' => 'A', 'ặ' => 'a', 'Ẹ' => 'E', + 'ẹ' => 'e', 'Ẻ' => 'E', 'ẻ' => 'e', 'Ẽ' => 'E', 'ẽ' => 'e', + 'Ế' => 'E', 'ế' => 'e', 'Ề' => 'E', 'á»' => 'e', 'Ể' => 'E', + 'ể' => 'e', 'Ễ' => 'E', 'á»…' => 'e', 'Ệ' => 'E', 'ệ' => 'e', + 'Ỉ' => 'I', 'ỉ' => 'i', 'Ị' => 'I', 'ị' => 'i', 'Ọ' => 'O', + 'á»' => 'o', 'Ỏ' => 'O', 'á»' => 'o', 'á»' => 'O', 'ố' => 'o', + 'á»’' => 'O', 'ồ' => 'o', 'á»”' => 'O', 'ổ' => 'o', 'á»–' => 'O', + 'á»—' => 'o', 'Ộ' => 'O', 'á»™' => 'o', 'Ớ' => 'O', 'á»›' => 'o', + 'Ờ' => 'O', 'á»' => 'o', 'Ở' => 'O', 'ở' => 'o', 'á» ' => 'O', + 'ỡ' => 'o', 'Ợ' => 'O', 'ợ' => 'o', 'Ụ' => 'U', 'ụ' => 'u', + 'Ủ' => 'U', 'á»§' => 'u', 'Ứ' => 'U', 'ứ' => 'u', 'Ừ' => 'U', + 'ừ' => 'u', 'Ử' => 'U', 'á»­' => 'u', 'á»®' => 'U', 'ữ' => 'u', + 'á»°' => 'U', 'á»±' => 'u', 'Ỳ' => 'Y', 'ỳ' => 'y', 'á»´' => 'Y', + 'ỵ' => 'y', 'á»¶' => 'Y', 'á»·' => 'y', 'Ỹ' => 'Y', 'ỹ' => 'y', + // General Punctuation + ' ' => ' ', 'â€' => ' ', ' ' => ' ', ' ' => ' ', ' ' => ' ', + ' ' => ' ', ' ' => ' ', ' ' => ' ', ' ' => ' ', ' ' => ' ', + ' ' => ' ', '​' => '', '‌' => '', 'â€' => '', 'â€' => '-', + '‑' => '-', '‒' => '-', '–' => '-', '—' => '-', '―' => '-', + '‖' => '||', '‘' => "'", '’' => "'", '‚' => ',', '‛' => "'", + '“' => '"', 'â€' => '"', '‟' => '"', '․' => '.', '‥' => '..', + '…' => '...', ' ' => ' ', '′' => "'", '″' => '"', '‴' => '\'"', + '‵' => "'", '‶' => '"', '‷' => '"\'', '‹' => '<', '›' => '>', + '‼' => '!!', '‽' => '?!', 'â„' => '/', 'â‡' => '?/', 'âˆ' => '?!', + 'â‰' => '!?', + // Letterlike Symbols + 'â„ ' => 'SM', 'â„¢' => 'TM', + // Number Forms + 'â…“' => '1/3', 'â…”' => '2/3', 'â…•' => '1/5', 'â…–' => '2/5', 'â…—' => '3/5', + 'â…˜' => '4/5', 'â…™' => '1/6', 'â…š' => '5/6', 'â…›' => '1/8', 'â…œ' => '3/8', + 'â…' => '5/8', 'â…ž' => '7/8', 'â… ' => 'I', 'â…¡' => 'II', 'â…¢' => 'III', + 'â…£' => 'IV', 'â…¤' => 'V', 'â…¥' => 'Vi', 'â…¦' => 'VII', 'â…§' => 'VIII', + 'â…¨' => 'IX', 'â…©' => 'X', 'â…ª' => 'XI', 'â…«' => 'XII', 'â…¬' => 'L', + 'â…­' => 'C', 'â…®' => 'D', 'â…¯' => 'M', 'â…°' => 'i', 'â…±' => 'ii', + 'â…²' => 'iii', 'â…³' => 'iv', 'â…´' => 'v', 'â…µ' => 'vi', 'â…¶' => 'vii', + 'â…·' => 'viii','â…¸' => 'ix', 'â…¹' => 'x', 'â…º' => 'xi', 'â…»' => 'xii', + 'â…¼' => 'l', 'â…½' => 'c', 'â…¾' => 'd', 'â…¿' => 'm' + ); + + /** + * If the [http://php.net/mbstring mbstring] extension is available + * + * @var boolean + */ + static private $mbstring_available = NULL; + + + /** + * Maps UTF-8 ASCII-based latin characters, puntuation, symbols and number forms to ASCII + * + * Any characters or symbols that can not be translated will be removed. + * + * This function is most useful for situation that only allows ASCII, such + * as in URLs. + * + * Translates elements form the following unicode blocks: + * + * - Latin-1 Supplement + * - Latin Extended-A + * - Latin Extended-B + * - IPA Extensions + * - Latin Extended Additional + * - General Punctuation + * - Letterlike symbols + * - Number Forms + * + * @internal + * + * @param string $string The string to convert + * @return string The input string in pure ASCII + */ + static public function ascii($string) + { + if (!self::detect($string)) { + return $string; + } + + $string = strtr($string, self::$utf8_to_ascii); + return preg_replace('#[^\x00-\x7F]#', '', $string); + } + + + /** + * Checks to see if the [http://php.net/mbstring mbstring] extension is available + * + * @return void + */ + static private function checkMbString() + { + self::$mbstring_available = extension_loaded('mbstring'); + } + + + /** + * Converts a unicode value into a UTF-8 character + * + * @param mixed $unicode_code_point The character to create, either the `U+hex` or decimal code point + * @return string The UTF-8 character + */ + static public function chr($unicode_code_point) + { + if (is_string($unicode_code_point) && substr($unicode_code_point, 0, 2) == 'U+') { + $unicode_code_point = substr($unicode_code_point, 2); + $unicode_code_point = hexdec($unicode_code_point); + } + + $bin = decbin($unicode_code_point); + $digits = strlen($bin); + + $first = $second = $third = $fourth = NULL; + + // One byte characters + if ($digits <= 7) { + $first = chr(bindec($bin)); + + // Two byte characters + } elseif ($digits <= 11) { + $first = chr(bindec('110' . str_pad(substr($bin, 0, -6), 5, '0', STR_PAD_LEFT))); + $second = chr(bindec('10' . substr($bin, -6))); + + // Three byte characters + } elseif ($digits <= 16) { + $first = chr(bindec('1110' . str_pad(substr($bin, 0, -12), 4, '0', STR_PAD_LEFT))); + $second = chr(bindec('10' . substr($bin, -12, -6))); + $third = chr(bindec('10' . substr($bin, -6))); + + // Four byte characters + } elseif ($digits <= 21) { + $first = chr(bindec('11110' . str_pad(substr($bin, 0, -18), 3, '0', STR_PAD_LEFT))); + $second = chr(bindec('10' . substr($bin, -18, -12))); + $third = chr(bindec('10' . substr($bin, -12, -6))); + $fourth = chr(bindec('10' . substr($bin, -6))); + } + + $ord = ord($first); + if ($digits > 21 || $ord == 0xC0 || $ord == 0xC1 || $ord > 0xF4) { + throw new fProgrammerException( + 'The code point specified, %s, is invalid.', + $unicode_code_point + ); + } + + return $first . $second . $third . $fourth; + } + + + /** + * Removes any invalid UTF-8 characters from a string or array of strings + * + * @param array|string $value The string or array of strings to clean + * @return string The cleaned string + */ + static public function clean($value) + { + if (!is_array($value)) { + if (self::$can_ignore_invalid === NULL) { + self::$can_ignore_invalid = !in_array(strtolower(ICONV_IMPL), array('unknown', 'ibm iconv')); + } + fCore::startErrorCapture(E_NOTICE); + $value = self::iconv('UTF-8', 'UTF-8' . (self::$can_ignore_invalid ? '//IGNORE' : ''), (string) $value); + fCore::stopErrorCapture(); + return $value; + } + + $keys = array_keys($value); + $num_keys = sizeof($keys); + for ($i=0; $i<$num_keys; $i++) { + $value[$keys[$i]] = self::clean($value[$keys[$i]]); + } + + return $value; + } + + + /** + * Compares strings, with the resulting order having latin characters that are based on ASCII letters placed after the relative ASCII characters + * + * Please note that this function sorts based on English language sorting + * rules only. Locale-sepcific sorting is done by + * [http://php.net/strcoll strcoll()], however there are technical + * limitations. + * + * @param string $str1 The first string to compare + * @param string $str2 The second string to compare + * @return integer < 0 if $str1 < $str2, 0 if they are equal, > 0 if $str1 > $str2 + */ + static public function cmp($str1, $str2) + { + $ascii_str1 = strtr($str1, self::$utf8_to_ascii); + $ascii_str2 = strtr($str2, self::$utf8_to_ascii); + + $res = strcmp($ascii_str1, $ascii_str2); + + // If the ASCII representations are the same, sort by the UTF-8 representations + if ($res === 0) { + $res = strcmp($str1, $str2); + } + + return $res; + } + + + /** + * Converts an offset in characters to an offset in bytes to that we can use the built-in functions for some operations + * + * @param string $string The string to base the offset on + * @param integer $offset The character offset to conver to bytes + * @return integer The converted offset + */ + static private function convertOffsetToBytes($string, $offset) + { + if ($offset == 0) { + return 0; + } + + $len = strlen($string); + + $byte_offset = 0; + $measured_offset = 0; + $sign = 1; + + // Negative offsets require us to reverse some stuff + if ($offset < 0) { + $string = strrev($string); + $sign = -1; + $offset = abs($offset); + } + + for ($i=0; $i<$len && $measured_offset<$offset; $i++) { + $char = $string[$i]; + ++$byte_offset; + if (ord($char) < 0x80) { + ++$measured_offset; + } else { + switch (ord($char) & 0xF0) { + case 0xF0: + case 0xE0: + case 0xD0: + case 0xC0: + ++$measured_offset; + break; + } + } + } + + return $byte_offset * $sign; + } + + + /** + * Detects if a UTF-8 string contains any non-ASCII characters + * + * @param string $string The string to check + * @return boolean If the string contains any non-ASCII characters + */ + static private function detect($string) + { + return (boolean) preg_match('#[^\x00-\x7F]#', $string); + } + + + /** + * Explodes a string on a delimiter + * + * If no delimiter is provided, the string will be exploded with each + * characters being an element in the array. + * + * @param string $string The string to explode + * @param string $delimiter The string to explode on. If `NULL` or `''` this method will return one character per array index. + * @return array The exploded string + */ + static public function explode($string, $delimiter=NULL) + { + // If a delimiter was passed, we just do an explode + if ($delimiter || (!$delimiter && is_numeric($delimiter))) { + return explode($delimiter, $string); + } + + // If no delimiter was passed, we explode the characters into an array + preg_match_all('#.|^\z#us', $string, $matches); + return $matches[0]; + } + + + /** + * This works around a bug in MAMP 1.9.4+ and PHP 5.3 where iconv() + * does not seem to properly assign the return value to a variable, but + * does work when returning the value. + * + * @param string $in_charset The incoming character encoding + * @param string $out_charset The outgoing character encoding + * @param string $string The string to convert + * @return string The converted string + */ + static private function iconv($in_charset, $out_charset, $string) + { + return iconv($in_charset, $out_charset, $string); + } + + + /** + * Compares strings in a case-insensitive manner, with the resulting order having characters that are based on ASCII letters placed after the relative ASCII characters + * + * Please note that this function sorts based on English language sorting + * rules only. Locale-sepcific sorting is done by + * [http://php.net/strcoll strcoll()], however there are technical + * limitations. + * + * @param string $str1 The first string to compare + * @param string $str2 The second string to compare + * @return integer < 0 if $str1 < $str2, 0 if they are equal, > 0 if $str1 > $str2 + */ + static public function icmp($str1, $str2) + { + $str1 = self::lower($str1); + $str2 = self::lower($str2); + + return self::cmp($str1, $str2); + } + + + /** + * Compares strings using a natural order algorithm in a case-insensitive manner, with the resulting order having latin characters that are based on ASCII letters placed after the relative ASCII characters + * + * Please note that this function sorts based on English language sorting + * rules only. Locale-sepcific sorting is done by + * [http://php.net/strcoll strcoll()], however there are technical + * limitations. + * + * @param string $str1 The first string to compare + * @param string $str2 The second string to compare + * @return integer `< 0` if `$str1 < $str2`, `0` if they are equal, `> 0` if `$str1 > $str2` + */ + static public function inatcmp($str1, $str2) + { + $str1 = self::lower($str1); + $str2 = self::lower($str2); + + return self::natcmp($str1, $str2); + } + + + /** + * Finds the first position (in characters) of the search value in the string - case is ignored when doing performing a match + * + * @param string $haystack The string to search in + * @param string $needle The string to search for. This match will be done in a case-insensitive manner. + * @param integer $offset The character position to start searching from + * @return mixed The integer character position of the first occurence of the needle or `FALSE` if no match + */ + static public function ipos($haystack, $needle, $offset=0) + { + // We get better performance falling back for ASCII strings + if (!self::detect($haystack)) { + return stripos($haystack, $needle, $offset); + } + + if (self::$mbstring_available === NULL) { + self::checkMbString(); + } + + if (self::$mbstring_available && function_exists('mb_stripos')) { + return mb_stripos($haystack, $needle, $offset, 'UTF-8'); + } + + $haystack = self::lower($haystack); + $needle = self::lower($needle); + + return self::pos($haystack, $needle, $offset); + } + + + /** + * Replaces matching parts of the string, with matches being done in a a case-insensitive manner + * + * If `$search` and `$replace` are both arrays and `$replace` is shorter, + * the extra `$search` string will be replaced with an empty string. If + * `$search` is an array and `$replace` is a string, all `$search` values + * will be replaced with the string specified. + * + * @param string $string The string to perform the replacements on + * @param mixed $search The string (or array of strings) to search for - see method description for details + * @param mixed $replace The string (or array of strings) to replace with - see method description for details + * @return string The input string with the specified replacements + */ + static public function ireplace($string, $search, $replace) + { + if (is_array($search)) { + foreach ($search as &$needle) { + $needle = '#' . preg_quote($needle, '#') . '#ui'; + } + } else { + $search = '#' . preg_quote($search, '#') . '#ui'; + } + return preg_replace( + $search, + strtr($replace, array('\\' => '\\\\', '$' => '\\$')), + $string + ); + } + + + /** + * Finds the last position (in characters) of the search value in the string - case is ignored when doing performing a match + * + * @param string $haystack The string to search in + * @param string $needle The string to search for. This match will be done in a case-insensitive manner. + * @param integer $offset The character position to start searching from. A negative value will stop looking that many characters from the end of the string + * @return mixed The integer character position of the last occurence of the needle or `FALSE` if no match + */ + static public function irpos($haystack, $needle, $offset=0) + { + // We get better performance falling back for ASCII strings + if (!self::detect($haystack)) { + return strripos($haystack, $needle, $offset); + } + + if (self::$mbstring_available === NULL) { + self::checkMbString(); + } + + if (self::$mbstring_available && function_exists('mb_strripos')) { + return mb_strripos($haystack, $needle, $offset, 'UTF-8'); + } + + $haystack = self::lower($haystack); + $needle = self::lower($needle); + + return self::rpos($haystack, $needle, $offset); + } + + + /** + * Matches a string needle in the string haystack, returning a substring from the beginning of the needle to the end of the haystack + * + * Can optionally return the part of the haystack before the needle. Matching + * is done in a case-insensitive manner. + * + * @param string $haystack The string to search in + * @param string $needle The string to search for. This match will be done in a case-insensitive manner. + * @param boolean $before_needle If a substring of the haystack before the needle should be returned instead of the substring from the needle to the end of the haystack + * @return mixed The specified part of the haystack, or `FALSE` if the needle was not found + */ + static public function istr($haystack, $needle, $before_needle=FALSE) + { + // We get better performance falling back for ASCII strings + if ($before_needle == FALSE && !self::detect($haystack)) { + return stristr($haystack, $needle); + } + + if (self::$mbstring_available === NULL) { + self::checkMbString(); + } + + if (self::$mbstring_available && function_exists('mb_stristr')) { + return mb_stristr($haystack, $needle, $before_needle, 'UTF-8'); + } + + $lower_haystack = self::lower($haystack); + $lower_needle = self::lower($needle); + + $pos = strpos($lower_haystack, $lower_needle); + + if ($before_needle) { + return substr($haystack, 0, $pos); + } + + return substr($haystack, $pos); + } + + + /** + * Determines the length (in characters) of a string + * + * @param string $string The string to measure + * @return integer The number of characters in the string + */ + static public function len($string) + { + if (self::$mbstring_available === NULL) { + self::checkMbString(); + } + + if (self::$mbstring_available) { + return mb_strlen($string, 'UTF-8'); + } + + return strlen(utf8_decode($string)); + } + + + /** + * Converts all uppercase characters to lowercase + * + * @param string $string The string to convert + * @return string The input string with all uppercase characters in lowercase + */ + static public function lower($string) + { + // We get better performance falling back for ASCII strings + if (!self::detect($string)) { + return strtolower($string); + } + + if (self::$mbstring_available === NULL) { + self::checkMbString(); + } + + if (self::$mbstring_available) { + $string = mb_strtolower($string, 'utf-8'); + // For some reason mb_strtolower misses some character + return strtr($string, self::$mb_upper_to_lower_fix); + } + + return strtr($string, self::$upper_to_lower); + } + + + /** + * Trims whitespace, or any specified characters, from the beginning of a string + * + * @param string $string The string to trim + * @param string $charlist The characters to trim + * @return string The trimmed string + */ + static public function ltrim($string, $charlist=NULL) + { + if (strlen($charlist) === 0) { + return ltrim($string); + } + + $search = preg_quote($charlist, '#'); + $search = str_replace('-', '\-', $search); + $search = str_replace('\.\.', '-', $search); + return preg_replace('#^[' . $search . ']+#Du', '', $string); + } + + + /** + * Compares strings using a natural order algorithm, with the resulting order having latin characters that are based on ASCII letters placed after the relative ASCII characters + * + * Please note that this function sorts based on English language sorting + * rules only. Locale-sepcific sorting is done by + * [http://php.net/strcoll strcoll()], however there are technical + * limitations. + * + * @param string $str1 The first string to compare + * @param string $str2 The second string to compare + * @return integer `< 0` if `$str1 < $str2`, `0` if they are equal, `> 0` if `$str1 > $str2` + */ + static public function natcmp($str1, $str2) + { + $ascii_str1 = strtr($str1, self::$utf8_to_ascii); + $ascii_str2 = strtr($str2, self::$utf8_to_ascii); + + $res = strnatcmp($ascii_str1, $ascii_str2); + + // If the ASCII representations are the same, sort by the UTF-8 representations + if ($res === 0) { + $res = strnatcmp($str1, $str2); + } + + return $res; + } + + + /** + * Converts a UTF-8 character to a unicode code point + * + * @param string $character The character to decode + * @return string The U+hex unicode code point for the character + */ + static public function ord($character) + { + $b = array_map('ord', str_split($character)); + $invalid = FALSE; + + switch (strlen($character)) { + case 1: + if ($b[0] > 0x7F) { + $invalid = TRUE; + break; + } + $bin = decbin($b[0]); + break; + + case 2: + if ($b[0] < 0xC2 || $b[0] > 0xDF || + $b[1] < 0x80 || $b[1] > 0xBF) { + $invalid = TRUE; + break; + } + $bin = substr(decbin($b[0]), 3) . + substr(decbin($b[1]), 2); + break; + + case 3: + if ($b[0] < 0xE0 || $b[0] > 0xEF || + $b[1] < 0x80 || $b[1] > 0xBF || + $b[2] < 0x80 || $b[2] > 0xBF) { + $invalid = TRUE; + break; + } + $bin = substr(decbin($b[0]), 4) . + substr(decbin($b[1]), 2) . + substr(decbin($b[2]), 2); + break; + + case 4: + if ($b[0] < 0xF0 || $b[0] > 0xF4 || + $b[1] < 0x80 || $b[1] > 0xBF || + $b[2] < 0x80 || $b[2] > 0xBF || + $b[3] < 0x80 || $b[3] > 0xBF) { + $invalid = TRUE; + break; + } + $bin = substr(decbin($b[0]), 5) . + substr(decbin($b[1]), 2) . + substr(decbin($b[2]), 2) . + substr(decbin($b[3]), 2); + break; + + default: + $invalid = TRUE; + break; + } + + if ($invalid) { + throw new fProgrammerException( + 'The UTF-8 character specified is invalid' + ); + } + + $hex = strtoupper(dechex(bindec($bin))); + return 'U+' . str_pad($hex, 4, '0', STR_PAD_LEFT); + } + + + /** + * Pads a string to the number of characters specified + * + * @param string $string The string to pad + * @param integer $pad_length The character length to pad the string to + * @param string $pad_string The string to pad the source string with + * @param string $pad_type The type of padding to do: `'left'`, `'right'`, `'both'` + * @return string The input string padded to the specified character width + */ + static public function pad($string, $pad_length, $pad_string=' ', $pad_type='right') + { + $valid_pad_types = array('right', 'left', 'both'); + if (!in_array($pad_type, $valid_pad_types)) { + throw new fProgrammerException( + 'The pad type specified, %1$s, is not valid. Must be one of: %2$s.', + $pad_type, + join(', ', $valid_pad_types) + ); + } + + // We get better performance falling back for ASCII strings + if (!self::detect($string) && !self::detect($pad_string)) { + static $type_map = array( + 'left' => STR_PAD_LEFT, + 'right' => STR_PAD_RIGHT, + 'both' => STR_PAD_BOTH + ); + return str_pad($string, $pad_length, $pad_string, $type_map[$pad_type]); + } + + + $string_length = self::len($string); + $pad_string_length = self::len($pad_string); + + $pad_to_length = $pad_length - $string_length; + + if ($pad_to_length < 1) { + return $string; + } + + $padded = 0; + $next_side = 'left'; + $left_pad_string = ''; + $right_pad_string = ''; + + while ($padded < $pad_to_length) { + + // For pad strings over 1 characters long, they may be too long to fit + if ($pad_to_length - $padded < $pad_string_length) { + $pad_string = self::sub($pad_string, 0, $pad_to_length - $padded); + } + + switch (($pad_type != 'both') ? $pad_type : $next_side) { + case 'right': + $right_pad_string .= $pad_string; + $next_side = 'left'; + break; + + case 'left': + $left_pad_string .= $pad_string; + $next_side = 'right'; + break; + } + + $padded += $pad_string_length; + } + + return $left_pad_string . $string . $right_pad_string; + } + + + /** + * Finds the first position (in characters) of the search value in the string + * + * @param string $haystack The string to search in + * @param string $needle The string to search for + * @param integer $offset The character position to start searching from + * @return mixed The integer character position of the first occurence of the needle or `FALSE` if no match + */ + static public function pos($haystack, $needle, $offset=0) + { + if (self::$mbstring_available === NULL) { + self::checkMbString(); + } + + if (self::$mbstring_available) { + return mb_strpos($haystack, $needle, $offset, 'UTF-8'); + } + + $offset = self::convertOffsetToBytes($haystack, $offset); + + $position = strpos($haystack, $needle, $offset); + + if ($position === FALSE) { + return FALSE; + } + + return strlen(utf8_decode(substr($haystack, 0, $position))); + } + + + /** + * Replaces matching parts of the string + * + * If `$search` and `$replace` are both arrays and `$replace` is shorter, + * the extra `$search` string will be replaced with an empty string. If + * `$search` is an array and `$replace` is a string, all `$search` values + * will be replaced with the string specified. + * + * @param string $string The string to perform the replacements on + * @param mixed $search The string (or array of strings) to search for - see method description for details + * @param mixed $replace The string (or array of strings) to replace with - see method description for details + * @return string The input string with the specified replacements + */ + static public function replace($string, $search, $replace) + { + return str_replace($search, $replace, $string); + } + + + /** + * Resets the configuration of the class + * + * @internal + * + * @return void + */ + static public function reset() + { + self::$mbstring_available = NULL; + } + + + /** + * Reverses a string + * + * @param string $string The string to reverse + * @return string The reversed string + */ + static public function rev($string) + { + $output = ''; + $len = strlen($string); + + static $char_lens = array( + 0xF0 => 4, + 0xE0 => 3, + 0xD0 => 2, + 0xC0 => 2 + ); + + $mb_char = ''; + for ($i=0; $i<$len; $i++) { + $char = $string[$i]; + if (ord($char) < 128) { + $output = $char . $output; + } else { + switch (ord($char) & 0xF0) { + case 0xF0: + $output = $string[$i] . $string[$i+1] . $string[$i+2] . $string[$i+3] . $output; + $i += 3; + break; + + case 0xE0: + $output = $string[$i] . $string[$i+1] . $string[$i+2] . $output; + $i += 2; + break; + + case 0xD0: + case 0xC0: + $output = $string[$i] . $string[$i+1] . $output; + $i += 1; + break; + } + } + } + + return $output; + } + + + /** + * Finds the last position (in characters) of the search value in the string + * + * @param string $haystack The string to search in + * @param string $needle The string to search for. + * @param integer $offset The character position to start searching from. A negative value will stop looking that many characters from the end of the string + * @return mixed The integer character position of the last occurence of the needle or `FALSE` if no match + */ + static public function rpos($haystack, $needle, $offset=0) + { + // We get better performance falling back for ASCII strings + if (!self::detect($haystack)) { + return strrpos($haystack, $needle, $offset); + } + + // We don't even both trying mb_strrpos since this method is faster + + $offset = self::convertOffsetToBytes($haystack, $offset); + + $position = strrpos($haystack, $needle, $offset); + + if ($position === FALSE) { + return FALSE; + } + + return strlen(utf8_decode(substr($haystack, 0, $position))); + } + + + /** + * Trims whitespace, or any specified characters, from the end of a string + * + * @param string $string The string to trim + * @param string $charlist The characters to trim + * @return string The trimmed string + */ + static public function rtrim($string, $charlist=NULL) + { + if (strlen($charlist) === 0) { + return rtrim($string); + } + + $search = preg_quote($charlist, '#'); + $search = str_replace('-', '\-', $search); + $search = str_replace('\.\.', '-', $search); + return preg_replace('#[' . $search . ']+$#Du', '', $string); + } + + + /** + * Matches a string needle in the string haystack, returning a substring from the beginning of the needle to the end of the haystack + * + * Can optionally return the part of the haystack before the needle. + * + * @param string $haystack The string to search in + * @param string $needle The string to search for + * @param boolean $before_needle If a substring of the haystack before the needle should be returned instead of the substring from the needle to the end of the haystack + * @return mixed The specified part of the haystack, or `FALSE` if the needle was not found + */ + static public function str($haystack, $needle, $before_needle=FALSE) + { + if (self::$mbstring_available === NULL) { + self::checkMbString(); + } + + if (self::$mbstring_available && function_exists('mb_strstr')) { + return mb_strstr($haystack, $needle, $before_needle, 'UTF-8'); + } + + $pos = strpos($haystack, $needle); + + if ($pos === FALSE) { + return $pos; + } + + if ($before_needle) { + return substr($haystack, 0, $pos); + } + + return substr($haystack, $pos); + } + + + /** + * Extracts part of a string + * + * @param string $string The string to extract from + * @param integer $start The zero-based starting index to extract from. Negative values will start the extraction that many characters from the end of the string. + * @param integer $length The length of the string to extract. If an empty value is provided, the remainder of the string will be returned. + * @return mixed The extracted subtring or `FALSE` if the start is out of bounds + */ + static public function sub($string, $start, $length=NULL) + { + if (self::$mbstring_available === NULL) { + self::checkMbString(); + } + + if (self::$mbstring_available) { + $str_len = mb_strlen($string, 'UTF-8'); + if (abs($start) > $str_len) { + return FALSE; + } + if ($length === NULL) { + if ($start >= 0) { + $length = $str_len-$start; + } else { + $length = abs($start); + } + } + return mb_substr($string, $start, $length, 'UTF-8'); + } + + // We get better performance falling back for ASCII strings + if (!self::detect($string)) { + if ($length === NULL) { + if ($start >= 0) { + $length = strlen($string)-$start; + } else { + $length = abs($start); + } + } + return substr($string, $start, $length); + } + + + // This is the slowest version + $str_len = strlen(utf8_decode($string)); + + if (abs($start) > $str_len) { + return FALSE; + } + + // Optimize looking by changing to negative start positions if the + // start is in the second half of the string + if ($start > $str_len/2) { + $start = 0-($str_len-$start); + } + + // Substrings to the end of the string are pretty simple + $start = self::convertOffsetToBytes($string, $start); + $string = substr($string, $start); + + if ($length === NULL) { + return $string; + } + + $length = self::convertOffsetToBytes($string, $length); + return substr($string, 0, $length); + } + + + /** + * Trims whitespace, or any specified characters, from the beginning and end of a string + * + * @param string $string The string to trim + * @param string $charlist The characters to trim, .. indicates a range + * @return string The trimmed string + */ + static public function trim($string, $charlist=NULL) + { + if (strlen($charlist) === 0) { + return trim($string); + } + + $search = preg_quote($charlist, '#'); + $search = str_replace('-', '\-', $search); + $search = str_replace('\.\.', '-', $search); + return preg_replace('#^[' . $search . ']+|[' . $search . ']+$#Du', '', $string); + } + + + /** + * Converts the first character of the string to uppercase. + * + * @param string $string The string to process + * @return string The processed string + */ + static public function ucfirst($string) + { + return self::upper(self::sub($string, 0, 1)) . self::sub($string, 1); + } + + + /** + * Converts the first character of every word to uppercase + * + * Words are considered to start at the beginning of the string, or after any + * whitespace character. + * + * @param string $string The string to process + * @return string The processed string + */ + static public function ucwords($string) + { + return preg_replace_callback( + '#(?<=^|\s|[\x{2000}-\x{200A}]|/|-|\(|\[|\{|\||"|^\'|\s\'|‘|“)(.)#u', + array('self', 'ucwordsCallback'), + $string + ); + } + + + /** + * Handles converting a character to uppercase for ::ucwords() + * + * @param array $match The regex match from ::ucwords() + * @return string The uppercase character + */ + static private function ucwordsCallback($match) + { + return self::upper($match[1]); + } + + + /** + * Converts all lowercase characters to uppercase + * + * @param string $string The string to convert + * @return string The input string with all lowercase characters in uppercase + */ + static public function upper($string) + { + // We get better performance falling back for ASCII strings + if (!self::detect($string)) { + return strtoupper($string); + } + + if (self::$mbstring_available === NULL) { + self::checkMbString(); + } + + if (self::$mbstring_available) { + $string = mb_strtoupper($string, 'utf-8'); + // For some reason mb_strtoupper misses some character + return strtr($string, self::$mb_lower_to_upper_fix); + } + + return strtr($string, self::$lower_to_upper); + } + + + /** + * Wraps a string to a specific character width + * + * @param string $string The string to wrap + * @param integer $width The character width to wrap to + * @param string $break The string to insert as a break + * @param boolean $cut If words longer than the character width should be split to fit + * @return string The input string with all lowercase characters in uppercase + */ + static public function wordwrap($string, $width=75, $break="\n", $cut=FALSE) + { + // We get better performance falling back for ASCII strings + if (!self::detect($string)) { + return wordwrap($string, $width, $break, $cut); + } + + $words = preg_split('#(?<=\s|[\x{2000}-\x{200A}])#ue', $string); + + $output = ''; + + $line_len = 0; + foreach ($words as $word) { + $word_len = self::len($word); + + // Shorten up words that are too long + while ($cut && $word_len > $width) { + $output .= $break; + $output .= self::sub($word, 0, $width); + $line_len = $width; + $word = self::sub($word, $width); + $word_len = self::len($word); + } + + if ($line_len && $line_len + $word_len > $width) { + $output .= $break; + $line_len = 0; + } + $output .= $word; + $line_len += $word_len; + } + + return $output; + } + + + /** + * Forces use as a static class + * + * @return fUTF8 + */ + private function __construct() { } +} + + + +/** + * Copyright (c) 2008-2011 Will Bond + * + * 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. + */ \ No newline at end of file diff --git a/makefont/index.php b/makefont/index.php new file mode 100644 index 0000000..ede8f85 --- /dev/null +++ b/makefont/index.php @@ -0,0 +1,6 @@ +".file_get_contents($font.".js"); diff --git a/makefont/iso-8859-1.map b/makefont/iso-8859-1.map new file mode 100644 index 0000000..61740a3 --- /dev/null +++ b/makefont/iso-8859-1.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/makefont/iso-8859-11.map b/makefont/iso-8859-11.map new file mode 100644 index 0000000..9168812 --- /dev/null +++ b/makefont/iso-8859-11.map @@ -0,0 +1,248 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0E01 kokaithai +!A2 U+0E02 khokhaithai +!A3 U+0E03 khokhuatthai +!A4 U+0E04 khokhwaithai +!A5 U+0E05 khokhonthai +!A6 U+0E06 khorakhangthai +!A7 U+0E07 ngonguthai +!A8 U+0E08 chochanthai +!A9 U+0E09 chochingthai +!AA U+0E0A chochangthai +!AB U+0E0B sosothai +!AC U+0E0C chochoethai +!AD U+0E0D yoyingthai +!AE U+0E0E dochadathai +!AF U+0E0F topatakthai +!B0 U+0E10 thothanthai +!B1 U+0E11 thonangmonthothai +!B2 U+0E12 thophuthaothai +!B3 U+0E13 nonenthai +!B4 U+0E14 dodekthai +!B5 U+0E15 totaothai +!B6 U+0E16 thothungthai +!B7 U+0E17 thothahanthai +!B8 U+0E18 thothongthai +!B9 U+0E19 nonuthai +!BA U+0E1A bobaimaithai +!BB U+0E1B poplathai +!BC U+0E1C phophungthai +!BD U+0E1D fofathai +!BE U+0E1E phophanthai +!BF U+0E1F fofanthai +!C0 U+0E20 phosamphaothai +!C1 U+0E21 momathai +!C2 U+0E22 yoyakthai +!C3 U+0E23 roruathai +!C4 U+0E24 ruthai +!C5 U+0E25 lolingthai +!C6 U+0E26 luthai +!C7 U+0E27 wowaenthai +!C8 U+0E28 sosalathai +!C9 U+0E29 sorusithai +!CA U+0E2A sosuathai +!CB U+0E2B hohipthai +!CC U+0E2C lochulathai +!CD U+0E2D oangthai +!CE U+0E2E honokhukthai +!CF U+0E2F paiyannoithai +!D0 U+0E30 saraathai +!D1 U+0E31 maihanakatthai +!D2 U+0E32 saraaathai +!D3 U+0E33 saraamthai +!D4 U+0E34 saraithai +!D5 U+0E35 saraiithai +!D6 U+0E36 sarauethai +!D7 U+0E37 saraueethai +!D8 U+0E38 sarauthai +!D9 U+0E39 sarauuthai +!DA U+0E3A phinthuthai +!DF U+0E3F bahtthai +!E0 U+0E40 saraethai +!E1 U+0E41 saraaethai +!E2 U+0E42 saraothai +!E3 U+0E43 saraaimaimuanthai +!E4 U+0E44 saraaimaimalaithai +!E5 U+0E45 lakkhangyaothai +!E6 U+0E46 maiyamokthai +!E7 U+0E47 maitaikhuthai +!E8 U+0E48 maiekthai +!E9 U+0E49 maithothai +!EA U+0E4A maitrithai +!EB U+0E4B maichattawathai +!EC U+0E4C thanthakhatthai +!ED U+0E4D nikhahitthai +!EE U+0E4E yamakkanthai +!EF U+0E4F fongmanthai +!F0 U+0E50 zerothai +!F1 U+0E51 onethai +!F2 U+0E52 twothai +!F3 U+0E53 threethai +!F4 U+0E54 fourthai +!F5 U+0E55 fivethai +!F6 U+0E56 sixthai +!F7 U+0E57 seventhai +!F8 U+0E58 eightthai +!F9 U+0E59 ninethai +!FA U+0E5A angkhankhuthai +!FB U+0E5B khomutthai diff --git a/makefont/iso-8859-15.map b/makefont/iso-8859-15.map new file mode 100644 index 0000000..6c2b571 --- /dev/null +++ b/makefont/iso-8859-15.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+20AC Euro +!A5 U+00A5 yen +!A6 U+0160 Scaron +!A7 U+00A7 section +!A8 U+0161 scaron +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+017D Zcaron +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+017E zcaron +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+0152 OE +!BD U+0153 oe +!BE U+0178 Ydieresis +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/makefont/iso-8859-16.map b/makefont/iso-8859-16.map new file mode 100644 index 0000000..202c8fe --- /dev/null +++ b/makefont/iso-8859-16.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+0105 aogonek +!A3 U+0141 Lslash +!A4 U+20AC Euro +!A5 U+201E quotedblbase +!A6 U+0160 Scaron +!A7 U+00A7 section +!A8 U+0161 scaron +!A9 U+00A9 copyright +!AA U+0218 Scommaaccent +!AB U+00AB guillemotleft +!AC U+0179 Zacute +!AD U+00AD hyphen +!AE U+017A zacute +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+010C Ccaron +!B3 U+0142 lslash +!B4 U+017D Zcaron +!B5 U+201D quotedblright +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+017E zcaron +!B9 U+010D ccaron +!BA U+0219 scommaaccent +!BB U+00BB guillemotright +!BC U+0152 OE +!BD U+0153 oe +!BE U+0178 Ydieresis +!BF U+017C zdotaccent +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0106 Cacute +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+015A Sacute +!D8 U+0170 Uhungarumlaut +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0118 Eogonek +!DE U+021A Tcommaaccent +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+0107 cacute +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+015B sacute +!F8 U+0171 uhungarumlaut +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0119 eogonek +!FE U+021B tcommaaccent +!FF U+00FF ydieresis diff --git a/makefont/iso-8859-2.map b/makefont/iso-8859-2.map new file mode 100644 index 0000000..65ae09f --- /dev/null +++ b/makefont/iso-8859-2.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+013D Lcaron +!A6 U+015A Sacute +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+0160 Scaron +!AA U+015E Scedilla +!AB U+0164 Tcaron +!AC U+0179 Zacute +!AD U+00AD hyphen +!AE U+017D Zcaron +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+0105 aogonek +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+013E lcaron +!B6 U+015B sacute +!B7 U+02C7 caron +!B8 U+00B8 cedilla +!B9 U+0161 scaron +!BA U+015F scedilla +!BB U+0165 tcaron +!BC U+017A zacute +!BD U+02DD hungarumlaut +!BE U+017E zcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent diff --git a/makefont/iso-8859-4.map b/makefont/iso-8859-4.map new file mode 100644 index 0000000..a7d87bf --- /dev/null +++ b/makefont/iso-8859-4.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+0138 kgreenlandic +!A3 U+0156 Rcommaaccent +!A4 U+00A4 currency +!A5 U+0128 Itilde +!A6 U+013B Lcommaaccent +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+0160 Scaron +!AA U+0112 Emacron +!AB U+0122 Gcommaaccent +!AC U+0166 Tbar +!AD U+00AD hyphen +!AE U+017D Zcaron +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+0105 aogonek +!B2 U+02DB ogonek +!B3 U+0157 rcommaaccent +!B4 U+00B4 acute +!B5 U+0129 itilde +!B6 U+013C lcommaaccent +!B7 U+02C7 caron +!B8 U+00B8 cedilla +!B9 U+0161 scaron +!BA U+0113 emacron +!BB U+0123 gcommaaccent +!BC U+0167 tbar +!BD U+014A Eng +!BE U+017E zcaron +!BF U+014B eng +!C0 U+0100 Amacron +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+012E Iogonek +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+0116 Edotaccent +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+012A Imacron +!D0 U+0110 Dcroat +!D1 U+0145 Ncommaaccent +!D2 U+014C Omacron +!D3 U+0136 Kcommaaccent +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+0172 Uogonek +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0168 Utilde +!DE U+016A Umacron +!DF U+00DF germandbls +!E0 U+0101 amacron +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+012F iogonek +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+0117 edotaccent +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+012B imacron +!F0 U+0111 dcroat +!F1 U+0146 ncommaaccent +!F2 U+014D omacron +!F3 U+0137 kcommaaccent +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+0173 uogonek +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0169 utilde +!FE U+016B umacron +!FF U+02D9 dotaccent diff --git a/makefont/iso-8859-5.map b/makefont/iso-8859-5.map new file mode 100644 index 0000000..f9cd4ed --- /dev/null +++ b/makefont/iso-8859-5.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0401 afii10023 +!A2 U+0402 afii10051 +!A3 U+0403 afii10052 +!A4 U+0404 afii10053 +!A5 U+0405 afii10054 +!A6 U+0406 afii10055 +!A7 U+0407 afii10056 +!A8 U+0408 afii10057 +!A9 U+0409 afii10058 +!AA U+040A afii10059 +!AB U+040B afii10060 +!AC U+040C afii10061 +!AD U+00AD hyphen +!AE U+040E afii10062 +!AF U+040F afii10145 +!B0 U+0410 afii10017 +!B1 U+0411 afii10018 +!B2 U+0412 afii10019 +!B3 U+0413 afii10020 +!B4 U+0414 afii10021 +!B5 U+0415 afii10022 +!B6 U+0416 afii10024 +!B7 U+0417 afii10025 +!B8 U+0418 afii10026 +!B9 U+0419 afii10027 +!BA U+041A afii10028 +!BB U+041B afii10029 +!BC U+041C afii10030 +!BD U+041D afii10031 +!BE U+041E afii10032 +!BF U+041F afii10033 +!C0 U+0420 afii10034 +!C1 U+0421 afii10035 +!C2 U+0422 afii10036 +!C3 U+0423 afii10037 +!C4 U+0424 afii10038 +!C5 U+0425 afii10039 +!C6 U+0426 afii10040 +!C7 U+0427 afii10041 +!C8 U+0428 afii10042 +!C9 U+0429 afii10043 +!CA U+042A afii10044 +!CB U+042B afii10045 +!CC U+042C afii10046 +!CD U+042D afii10047 +!CE U+042E afii10048 +!CF U+042F afii10049 +!D0 U+0430 afii10065 +!D1 U+0431 afii10066 +!D2 U+0432 afii10067 +!D3 U+0433 afii10068 +!D4 U+0434 afii10069 +!D5 U+0435 afii10070 +!D6 U+0436 afii10072 +!D7 U+0437 afii10073 +!D8 U+0438 afii10074 +!D9 U+0439 afii10075 +!DA U+043A afii10076 +!DB U+043B afii10077 +!DC U+043C afii10078 +!DD U+043D afii10079 +!DE U+043E afii10080 +!DF U+043F afii10081 +!E0 U+0440 afii10082 +!E1 U+0441 afii10083 +!E2 U+0442 afii10084 +!E3 U+0443 afii10085 +!E4 U+0444 afii10086 +!E5 U+0445 afii10087 +!E6 U+0446 afii10088 +!E7 U+0447 afii10089 +!E8 U+0448 afii10090 +!E9 U+0449 afii10091 +!EA U+044A afii10092 +!EB U+044B afii10093 +!EC U+044C afii10094 +!ED U+044D afii10095 +!EE U+044E afii10096 +!EF U+044F afii10097 +!F0 U+2116 afii61352 +!F1 U+0451 afii10071 +!F2 U+0452 afii10099 +!F3 U+0453 afii10100 +!F4 U+0454 afii10101 +!F5 U+0455 afii10102 +!F6 U+0456 afii10103 +!F7 U+0457 afii10104 +!F8 U+0458 afii10105 +!F9 U+0459 afii10106 +!FA U+045A afii10107 +!FB U+045B afii10108 +!FC U+045C afii10109 +!FD U+00A7 section +!FE U+045E afii10110 +!FF U+045F afii10193 diff --git a/makefont/iso-8859-7.map b/makefont/iso-8859-7.map new file mode 100644 index 0000000..e163796 --- /dev/null +++ b/makefont/iso-8859-7.map @@ -0,0 +1,250 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+2018 quoteleft +!A2 U+2019 quoteright +!A3 U+00A3 sterling +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AF U+2015 afii00208 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+0384 tonos +!B5 U+0385 dieresistonos +!B6 U+0386 Alphatonos +!B7 U+00B7 periodcentered +!B8 U+0388 Epsilontonos +!B9 U+0389 Etatonos +!BA U+038A Iotatonos +!BB U+00BB guillemotright +!BC U+038C Omicrontonos +!BD U+00BD onehalf +!BE U+038E Upsilontonos +!BF U+038F Omegatonos +!C0 U+0390 iotadieresistonos +!C1 U+0391 Alpha +!C2 U+0392 Beta +!C3 U+0393 Gamma +!C4 U+0394 Delta +!C5 U+0395 Epsilon +!C6 U+0396 Zeta +!C7 U+0397 Eta +!C8 U+0398 Theta +!C9 U+0399 Iota +!CA U+039A Kappa +!CB U+039B Lambda +!CC U+039C Mu +!CD U+039D Nu +!CE U+039E Xi +!CF U+039F Omicron +!D0 U+03A0 Pi +!D1 U+03A1 Rho +!D3 U+03A3 Sigma +!D4 U+03A4 Tau +!D5 U+03A5 Upsilon +!D6 U+03A6 Phi +!D7 U+03A7 Chi +!D8 U+03A8 Psi +!D9 U+03A9 Omega +!DA U+03AA Iotadieresis +!DB U+03AB Upsilondieresis +!DC U+03AC alphatonos +!DD U+03AD epsilontonos +!DE U+03AE etatonos +!DF U+03AF iotatonos +!E0 U+03B0 upsilondieresistonos +!E1 U+03B1 alpha +!E2 U+03B2 beta +!E3 U+03B3 gamma +!E4 U+03B4 delta +!E5 U+03B5 epsilon +!E6 U+03B6 zeta +!E7 U+03B7 eta +!E8 U+03B8 theta +!E9 U+03B9 iota +!EA U+03BA kappa +!EB U+03BB lambda +!EC U+03BC mu +!ED U+03BD nu +!EE U+03BE xi +!EF U+03BF omicron +!F0 U+03C0 pi +!F1 U+03C1 rho +!F2 U+03C2 sigma1 +!F3 U+03C3 sigma +!F4 U+03C4 tau +!F5 U+03C5 upsilon +!F6 U+03C6 phi +!F7 U+03C7 chi +!F8 U+03C8 psi +!F9 U+03C9 omega +!FA U+03CA iotadieresis +!FB U+03CB upsilondieresis +!FC U+03CC omicrontonos +!FD U+03CD upsilontonos +!FE U+03CE omegatonos diff --git a/makefont/iso-8859-9.map b/makefont/iso-8859-9.map new file mode 100644 index 0000000..48c123a --- /dev/null +++ b/makefont/iso-8859-9.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+011E Gbreve +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0130 Idotaccent +!DE U+015E Scedilla +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+011F gbreve +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0131 dotlessi +!FE U+015F scedilla +!FF U+00FF ydieresis diff --git a/makefont/koi8-r.map b/makefont/koi8-r.map new file mode 100644 index 0000000..6ad5d05 --- /dev/null +++ b/makefont/koi8-r.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+2500 SF100000 +!81 U+2502 SF110000 +!82 U+250C SF010000 +!83 U+2510 SF030000 +!84 U+2514 SF020000 +!85 U+2518 SF040000 +!86 U+251C SF080000 +!87 U+2524 SF090000 +!88 U+252C SF060000 +!89 U+2534 SF070000 +!8A U+253C SF050000 +!8B U+2580 upblock +!8C U+2584 dnblock +!8D U+2588 block +!8E U+258C lfblock +!8F U+2590 rtblock +!90 U+2591 ltshade +!91 U+2592 shade +!92 U+2593 dkshade +!93 U+2320 integraltp +!94 U+25A0 filledbox +!95 U+2219 periodcentered +!96 U+221A radical +!97 U+2248 approxequal +!98 U+2264 lessequal +!99 U+2265 greaterequal +!9A U+00A0 space +!9B U+2321 integralbt +!9C U+00B0 degree +!9D U+00B2 twosuperior +!9E U+00B7 periodcentered +!9F U+00F7 divide +!A0 U+2550 SF430000 +!A1 U+2551 SF240000 +!A2 U+2552 SF510000 +!A3 U+0451 afii10071 +!A4 U+2553 SF520000 +!A5 U+2554 SF390000 +!A6 U+2555 SF220000 +!A7 U+2556 SF210000 +!A8 U+2557 SF250000 +!A9 U+2558 SF500000 +!AA U+2559 SF490000 +!AB U+255A SF380000 +!AC U+255B SF280000 +!AD U+255C SF270000 +!AE U+255D SF260000 +!AF U+255E SF360000 +!B0 U+255F SF370000 +!B1 U+2560 SF420000 +!B2 U+2561 SF190000 +!B3 U+0401 afii10023 +!B4 U+2562 SF200000 +!B5 U+2563 SF230000 +!B6 U+2564 SF470000 +!B7 U+2565 SF480000 +!B8 U+2566 SF410000 +!B9 U+2567 SF450000 +!BA U+2568 SF460000 +!BB U+2569 SF400000 +!BC U+256A SF540000 +!BD U+256B SF530000 +!BE U+256C SF440000 +!BF U+00A9 copyright +!C0 U+044E afii10096 +!C1 U+0430 afii10065 +!C2 U+0431 afii10066 +!C3 U+0446 afii10088 +!C4 U+0434 afii10069 +!C5 U+0435 afii10070 +!C6 U+0444 afii10086 +!C7 U+0433 afii10068 +!C8 U+0445 afii10087 +!C9 U+0438 afii10074 +!CA U+0439 afii10075 +!CB U+043A afii10076 +!CC U+043B afii10077 +!CD U+043C afii10078 +!CE U+043D afii10079 +!CF U+043E afii10080 +!D0 U+043F afii10081 +!D1 U+044F afii10097 +!D2 U+0440 afii10082 +!D3 U+0441 afii10083 +!D4 U+0442 afii10084 +!D5 U+0443 afii10085 +!D6 U+0436 afii10072 +!D7 U+0432 afii10067 +!D8 U+044C afii10094 +!D9 U+044B afii10093 +!DA U+0437 afii10073 +!DB U+0448 afii10090 +!DC U+044D afii10095 +!DD U+0449 afii10091 +!DE U+0447 afii10089 +!DF U+044A afii10092 +!E0 U+042E afii10048 +!E1 U+0410 afii10017 +!E2 U+0411 afii10018 +!E3 U+0426 afii10040 +!E4 U+0414 afii10021 +!E5 U+0415 afii10022 +!E6 U+0424 afii10038 +!E7 U+0413 afii10020 +!E8 U+0425 afii10039 +!E9 U+0418 afii10026 +!EA U+0419 afii10027 +!EB U+041A afii10028 +!EC U+041B afii10029 +!ED U+041C afii10030 +!EE U+041D afii10031 +!EF U+041E afii10032 +!F0 U+041F afii10033 +!F1 U+042F afii10049 +!F2 U+0420 afii10034 +!F3 U+0421 afii10035 +!F4 U+0422 afii10036 +!F5 U+0423 afii10037 +!F6 U+0416 afii10024 +!F7 U+0412 afii10019 +!F8 U+042C afii10046 +!F9 U+042B afii10045 +!FA U+0417 afii10025 +!FB U+0428 afii10042 +!FC U+042D afii10047 +!FD U+0429 afii10043 +!FE U+0427 afii10041 +!FF U+042A afii10044 diff --git a/makefont/koi8-u.map b/makefont/koi8-u.map new file mode 100644 index 0000000..40a7e4f --- /dev/null +++ b/makefont/koi8-u.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+2500 SF100000 +!81 U+2502 SF110000 +!82 U+250C SF010000 +!83 U+2510 SF030000 +!84 U+2514 SF020000 +!85 U+2518 SF040000 +!86 U+251C SF080000 +!87 U+2524 SF090000 +!88 U+252C SF060000 +!89 U+2534 SF070000 +!8A U+253C SF050000 +!8B U+2580 upblock +!8C U+2584 dnblock +!8D U+2588 block +!8E U+258C lfblock +!8F U+2590 rtblock +!90 U+2591 ltshade +!91 U+2592 shade +!92 U+2593 dkshade +!93 U+2320 integraltp +!94 U+25A0 filledbox +!95 U+2022 bullet +!96 U+221A radical +!97 U+2248 approxequal +!98 U+2264 lessequal +!99 U+2265 greaterequal +!9A U+00A0 space +!9B U+2321 integralbt +!9C U+00B0 degree +!9D U+00B2 twosuperior +!9E U+00B7 periodcentered +!9F U+00F7 divide +!A0 U+2550 SF430000 +!A1 U+2551 SF240000 +!A2 U+2552 SF510000 +!A3 U+0451 afii10071 +!A4 U+0454 afii10101 +!A5 U+2554 SF390000 +!A6 U+0456 afii10103 +!A7 U+0457 afii10104 +!A8 U+2557 SF250000 +!A9 U+2558 SF500000 +!AA U+2559 SF490000 +!AB U+255A SF380000 +!AC U+255B SF280000 +!AD U+0491 afii10098 +!AE U+255D SF260000 +!AF U+255E SF360000 +!B0 U+255F SF370000 +!B1 U+2560 SF420000 +!B2 U+2561 SF190000 +!B3 U+0401 afii10023 +!B4 U+0404 afii10053 +!B5 U+2563 SF230000 +!B6 U+0406 afii10055 +!B7 U+0407 afii10056 +!B8 U+2566 SF410000 +!B9 U+2567 SF450000 +!BA U+2568 SF460000 +!BB U+2569 SF400000 +!BC U+256A SF540000 +!BD U+0490 afii10050 +!BE U+256C SF440000 +!BF U+00A9 copyright +!C0 U+044E afii10096 +!C1 U+0430 afii10065 +!C2 U+0431 afii10066 +!C3 U+0446 afii10088 +!C4 U+0434 afii10069 +!C5 U+0435 afii10070 +!C6 U+0444 afii10086 +!C7 U+0433 afii10068 +!C8 U+0445 afii10087 +!C9 U+0438 afii10074 +!CA U+0439 afii10075 +!CB U+043A afii10076 +!CC U+043B afii10077 +!CD U+043C afii10078 +!CE U+043D afii10079 +!CF U+043E afii10080 +!D0 U+043F afii10081 +!D1 U+044F afii10097 +!D2 U+0440 afii10082 +!D3 U+0441 afii10083 +!D4 U+0442 afii10084 +!D5 U+0443 afii10085 +!D6 U+0436 afii10072 +!D7 U+0432 afii10067 +!D8 U+044C afii10094 +!D9 U+044B afii10093 +!DA U+0437 afii10073 +!DB U+0448 afii10090 +!DC U+044D afii10095 +!DD U+0449 afii10091 +!DE U+0447 afii10089 +!DF U+044A afii10092 +!E0 U+042E afii10048 +!E1 U+0410 afii10017 +!E2 U+0411 afii10018 +!E3 U+0426 afii10040 +!E4 U+0414 afii10021 +!E5 U+0415 afii10022 +!E6 U+0424 afii10038 +!E7 U+0413 afii10020 +!E8 U+0425 afii10039 +!E9 U+0418 afii10026 +!EA U+0419 afii10027 +!EB U+041A afii10028 +!EC U+041B afii10029 +!ED U+041C afii10030 +!EE U+041D afii10031 +!EF U+041E afii10032 +!F0 U+041F afii10033 +!F1 U+042F afii10049 +!F2 U+0420 afii10034 +!F3 U+0421 afii10035 +!F4 U+0422 afii10036 +!F5 U+0423 afii10037 +!F6 U+0416 afii10024 +!F7 U+0412 afii10019 +!F8 U+042C afii10046 +!F9 U+042B afii10045 +!FA U+0417 afii10025 +!FB U+0428 afii10042 +!FC U+042D afii10047 +!FD U+0429 afii10043 +!FE U+0427 afii10041 +!FF U+042A afii10044 diff --git a/makefont/makefont.php b/makefont/makefont.php new file mode 100644 index 0000000..781ab36 --- /dev/null +++ b/makefont/makefont.php @@ -0,0 +1,373 @@ +$severity: "; + echo "$txt
"; + } +} + +function Notice($txt) { + Message($txt, 'Notice'); +} + +function Warning($txt) { + Message($txt, 'Warning'); +} + +function Error($txt) { + Message($txt, 'Error'); + exit ; +} + +function LoadMap($enc) { + $file = dirname(__FILE__) . '/' . strtolower($enc) . '.map'; + $a = file($file); + if (empty($a)) + Error('Encoding not found: ' . $enc); + $map = array_fill(0, 256, array('uv' => -1, 'name' => '.notdef')); + foreach ($a as $line) { + $e = explode(' ', rtrim($line)); + $c = hexdec(substr($e[0], 1)); + $uv = hexdec(substr($e[1], 2)); + $name = $e[2]; + $map[$c] = array('uv' => $uv, 'name' => $name); + } + return $map; +} + +function LoadAsciiUnicodeValues($enc){ + $file = dirname(__FILE__) . '/' . strtolower($enc) . '.map'; + $a = file($file); + if (empty($a)){ + Error('Encoding not found: ' . $enc); + } + $unicodeValues = array(); + for($i=0; $i < count($a); $i++){ + $line = explode(' ', rtrim($a[$i])); + $unicodeValues[$i] = $line[1]; + } + return $unicodeValues; +} + +function GetInfoFromTrueType($file, $embed, $map) { + // Return informations from a TrueType font + $ttf = new TTFParser(); + $ttf -> Parse($file); + if ($embed) { + if (!$ttf -> Embeddable) + Error('Font license does not allow embedding'); + $info['Data'] = file_get_contents($file); + $info['OriginalSize'] = filesize($file); + } + $k = 1000 / $ttf -> unitsPerEm; + $info['FontName'] = $ttf -> postScriptName; + $info['Bold'] = $ttf -> Bold; + $info['ItalicAngle'] = $ttf -> italicAngle; + $info['IsFixedPitch'] = $ttf -> isFixedPitch; + $info['Ascender'] = round($k * $ttf -> typoAscender); + $info['Descender'] = round($k * $ttf -> typoDescender); + $info['UnderlineThickness'] = round($k * $ttf -> underlineThickness); + $info['UnderlinePosition'] = round($k * $ttf -> underlinePosition); + $info['FontBBox'] = array(round($k * $ttf -> xMin), round($k * $ttf -> yMin), round($k * $ttf -> xMax), round($k * $ttf -> yMax)); + $info['CapHeight'] = round($k * $ttf -> capHeight); + $info['MissingWidth'] = round($k * $ttf -> widths[0]); + $widths = array_fill(0, 256, $info['MissingWidth']); + for ($c = 0; $c <= 255; $c++) { + if ($map[$c]['name'] != '.notdef') { + $uv = $map[$c]['uv']; + if (isset($ttf -> chars[$uv])) { + $w = $ttf -> widths[$ttf -> chars[$uv]]; + $widths[$c] = round($k * $w); + } else + Warning('Character ' . $map[$c]['name'] . ' is missing'); + } + } + $info['Widths'] = $widths; + return $info; +} + +function GetInfoFromType1($file, $embed, $map) { + // Return informations from a Type1 font + if ($embed) { + $f = fopen($file, 'rb'); + if (!$f) + Error('Can\'t open font file'); + // Read first segment + $a = unpack('Cmarker/Ctype/Vsize', fread($f, 6)); + if ($a['marker'] != 128) + Error('Font file is not a valid binary Type1'); + $size1 = $a['size']; + $data = fread($f, $size1); + // Read second segment + $a = unpack('Cmarker/Ctype/Vsize', fread($f, 6)); + if ($a['marker'] != 128) + Error('Font file is not a valid binary Type1'); + $size2 = $a['size']; + $data .= fread($f, $size2); + fclose($f); + $info['Data'] = $data; + $info['Size1'] = $size1; + $info['Size2'] = $size2; + } + + $afm = substr($file, 0, -3) . 'afm'; + if (!file_exists($afm)) + Error('AFM font file not found: ' . $afm); + $a = file($afm); + if (empty($a)) + Error('AFM file empty or not readable'); + foreach ($a as $line) { + $e = explode(' ', rtrim($line)); + if (count($e) < 2) + continue; + $entry = $e[0]; + if ($entry == 'C') { + $w = $e[4]; + $name = $e[7]; + $cw[$name] = $w; + } elseif ($entry == 'FontName') + $info['FontName'] = $e[1]; + elseif ($entry == 'Weight') + $info['Weight'] = $e[1]; + elseif ($entry == 'ItalicAngle') + $info['ItalicAngle'] = (int)$e[1]; + elseif ($entry == 'Ascender') + $info['Ascender'] = (int)$e[1]; + elseif ($entry == 'Descender') + $info['Descender'] = (int)$e[1]; + elseif ($entry == 'UnderlineThickness') + $info['UnderlineThickness'] = (int)$e[1]; + elseif ($entry == 'UnderlinePosition') + $info['UnderlinePosition'] = (int)$e[1]; + elseif ($entry == 'IsFixedPitch') + $info['IsFixedPitch'] = ($e[1] == 'true'); + elseif ($entry == 'FontBBox') + $info['FontBBox'] = array((int)$e[1], (int)$e[2], (int)$e[3], (int)$e[4]); + elseif ($entry == 'CapHeight') + $info['CapHeight'] = (int)$e[1]; + elseif ($entry == 'StdVW') + $info['StdVW'] = (int)$e[1]; + } + + if (!isset($info['FontName'])) + Error('FontName missing in AFM file'); + $info['Bold'] = isset($info['Weight']) && preg_match('/bold|black/i', $info['Weight']); + if (isset($cw['.notdef'])) + $info['MissingWidth'] = $cw['.notdef']; + else + $info['MissingWidth'] = 0; + $widths = array_fill(0, 256, $info['MissingWidth']); + for ($c = 0; $c <= 255; $c++) { + $name = $map[$c]['name']; + if ($name != '.notdef') { + if (isset($cw[$name])) + $widths[$c] = $cw[$name]; + else + Warning('Character ' . $name . ' is missing'); + } + } + $info['Widths'] = $widths; + return $info; +} + +function MakeFontDescriptor($info) { + // Ascent + $fd = array(); + $fd['Ascent'] = $info['Ascender']; + // Descent + $fd['Descent'] = $info['Descender']; + // CapHeight + if (!empty($info['CapHeight'])) { + $fd['CapHeight'] = $info['CapHeight']; + } else { + $fd['CapHeight'] = $info['Ascender']; + } + // Flags + $flags = 0; + if ($info['IsFixedPitch']) + $flags += 1<<0; + $flags += 1<<5; + if ($info['ItalicAngle'] != 0) + $flags += 1<<6; + $fd['Flags'] = $flags; + // FontBBox + $fbb = $info['FontBBox']; + $fd['FontBBox'] = '[' . $fbb[0] . ' ' . $fbb[1] . ' ' . $fbb[2] . ' ' . $fbb[3] . ']'; + // ItalicAngle + $fd['ItalicAngle'] = $info['ItalicAngle']; + // StemV + if (isset($info['StdVW'])) + $stemv = $info['StdVW']; + elseif ($info['Bold']) + $stemv = 120; + else + $stemv = 70; + $fd['StemV'] = $stemv; + // MissingWidth + + $fd['MissingWidth'] = $info['MissingWidth']; + return $fd; +} + +function MakeWidthArray($widths, $enc) { + $cw = array(); + $hexaUnicodeValues = LoadAsciiUnicodeValues($enc); + $map = LoadMap($enc); + for ($i = 0; $i <= 255; $i++) { + if(count($hexaUnicodeValues) > $i){ + $cw[fUTF8::chr($hexaUnicodeValues[$i])] = $widths[$i]; + } + else{ + $cw[null] = $widths[$i]; + } + } + return $cw; +} + +function MakeFontEncoding($map) { + // Build differences from reference encoding + $ref = LoadMap('cp1252'); + $s = ''; + $last = 0; + for ($c = 32; $c <= 255; $c++) { + if ($map[$c]['name'] != $ref[$c]['name']) { + if ($c != $last + 1) + $s .= $c . ' '; + $last = $c; + $s .= '/' . $map[$c]['name'] . ' '; + } + } + return rtrim($s); +} + +function MakeUnicodeEncodingTable($enc){ + $file = dirname(__FILE__) . '/' . strtolower($enc) . '.map'; + $a = file($file); + if (empty($a)){ + Error('Encoding not found: ' . $enc); + } + $unicodeAsciiValues = array(); + for($i=0; $i < count($a); $i++){ + $line = explode(' ', rtrim($a[$i])); + $key = ltrim($line[1],'U+'); + $key = hexdec($key); + $value = ltrim($line[0],'!'); + $value = hexdec($value); + $unicodeAsciiValues[$key] = $value; + } + return $unicodeAsciiValues; +} + +function JSONToFile($file, $json_obj) { + SaveToFile($file, json_encode($json_obj)); +} + +function SaveToFile($file, $s) { + $f = fopen($file, 'w+'); + if (!$f) + Error('Can\'t write to file ' . $file); + fwrite($f, $s, strlen($s)); + fclose($f); +} + +function MakeDefinitionFile($file, $type, $enc, $embed, $map, $info) { + $json_obj = array(); + $json_obj['type'] = $type; + $json_obj['decs'] = MakeFontDescriptor($info); + $json_obj['name'] = $info['FontName']; + $json_obj['up'] = $info['UnderlinePosition']; + $json_obj['ut'] = $info['UnderlineThickness']; + $json_obj['cw'] = $info['Widths']; + $json_obj['enc'] = $enc; + $json_obj['uni2ascii'] = MakeUnicodeEncodingTable($enc); + $diff = MakeFontEncoding($map); + if ($diff) + $json_obj['diff'] = $diff; + if ($embed) { + $json_obj['file'] = $info['file']; + $json_obj['filesize'] = $info['filesize']; + if ($type == 'Type1') { + $json_obj['size1'] = $info['Size1']; + $json_obj['size2'] = $info['Size2']; + + } else { + $json_obj['originalsize'] = $info['OriginalSize']; + } + } + JSONToFile($file, $json_obj); +} + +function MakeFont($fontfile, $enc = 'cp1252', $embed = true) { + $embed = false; //unsuported + // Generate a font definition file + if (get_magic_quotes_runtime()) + @set_magic_quotes_runtime(0); + ini_set('auto_detect_line_endings', '1'); + + if (!file_exists($fontfile)) + Error('Font file not found: ' . $fontfile); + $ext = strtolower(substr($fontfile, -3)); + if ($ext == 'ttf' || $ext == 'otf') + $type = 'TrueType'; + elseif ($ext == 'pfb') + $type = 'Type1'; + else + Error('Unrecognized font file extension: ' . $ext); + + $map = LoadMap($enc); + + if ($type == 'TrueType') + $info = GetInfoFromTrueType($fontfile, $embed, $map); + else + $info = GetInfoFromType1($fontfile, $embed, $map); + + $basename = substr(basename($fontfile), 0, -4); + if ($embed) { + if (function_exists('gzcompress')) { + $embeded_font = gzcompress($info['Data']); + $info['filesize'] = strlen($embeded_font); + // $embeded_font = base64_encode($embeded_font); + $embeded_font = utf8_encode($embeded_font); + $info['file'] = $embeded_font; + Message('Font compressed.'); + } else { + Notice('Font file could not be compressed (zlib extension not available)'); + } + } + + MakeDefinitionFile($basename . '.js', $type, $enc, $embed, $map, $info); + Message('Font definition file generated: ' . $basename . '.json'); +} + +if (PHP_SAPI == 'cli') { + // Command-line interface + if ($argc == 1) + die("Usage: php makefont.php fontfile [enc] [embed]\n"); + $fontfile = $argv[1]; + if ($argc >= 3) + $enc = $argv[2]; + else + $enc = 'cp1252'; + if ($argc >= 4) + $embed = ($argv[3] == 'true' || $argv[3] == '1'); + else + $embed = true; + MakeFont($fontfile, $enc, $embed); +} +?> diff --git a/makefont/ttfparser.php b/makefont/ttfparser.php new file mode 100644 index 0000000..602a543 --- /dev/null +++ b/makefont/ttfparser.php @@ -0,0 +1,289 @@ +f = fopen($file, 'rb'); + if(!$this->f) + $this->Error('Can\'t open file: '.$file); + + $version = $this->Read(4); + if($version=='OTTO') + $this->Error('OpenType fonts based on PostScript outlines are not supported'); + if($version!="\x00\x01\x00\x00") + $this->Error('Unrecognized file format'); + $numTables = $this->ReadUShort(); + $this->Skip(3*2); // searchRange, entrySelector, rangeShift + $this->tables = array(); + for($i=0;$i<$numTables;$i++) + { + $tag = $this->Read(4); + $this->Skip(4); // checkSum + $offset = $this->ReadULong(); + $this->Skip(4); // length + $this->tables[$tag] = $offset; + } + + $this->ParseHead(); + $this->ParseHhea(); + $this->ParseMaxp(); + $this->ParseHmtx(); + $this->ParseCmap(); + $this->ParseName(); + $this->ParseOS2(); + $this->ParsePost(); + + fclose($this->f); + } + + function ParseHead() + { + $this->Seek('head'); + $this->Skip(3*4); // version, fontRevision, checkSumAdjustment + $magicNumber = $this->ReadULong(); + if($magicNumber!=0x5F0F3CF5) + $this->Error('Incorrect magic number'); + $this->Skip(2); // flags + $this->unitsPerEm = $this->ReadUShort(); + $this->Skip(2*8); // created, modified + $this->xMin = $this->ReadShort(); + $this->yMin = $this->ReadShort(); + $this->xMax = $this->ReadShort(); + $this->yMax = $this->ReadShort(); + } + + function ParseHhea() + { + $this->Seek('hhea'); + $this->Skip(4+15*2); + $this->numberOfHMetrics = $this->ReadUShort(); + } + + function ParseMaxp() + { + $this->Seek('maxp'); + $this->Skip(4); + $this->numGlyphs = $this->ReadUShort(); + } + + function ParseHmtx() + { + $this->Seek('hmtx'); + $this->widths = array(); + for($i=0;$i<$this->numberOfHMetrics;$i++) + { + $advanceWidth = $this->ReadUShort(); + $this->Skip(2); // lsb + $this->widths[$i] = $advanceWidth; + } + if($this->numberOfHMetrics<$this->numGlyphs) + { + $lastWidth = $this->widths[$this->numberOfHMetrics-1]; + $this->widths = array_pad($this->widths, $this->numGlyphs, $lastWidth); + } + } + + function ParseCmap() + { + $this->Seek('cmap'); + $this->Skip(2); // version + $numTables = $this->ReadUShort(); + $offset31 = 0; + for($i=0;$i<$numTables;$i++) + { + $platformID = $this->ReadUShort(); + $encodingID = $this->ReadUShort(); + $offset = $this->ReadULong(); + if($platformID==3 && $encodingID==1) + $offset31 = $offset; + } + if($offset31==0) + $this->Error('No Unicode encoding found'); + + $startCount = array(); + $endCount = array(); + $idDelta = array(); + $idRangeOffset = array(); + $this->chars = array(); + fseek($this->f, $this->tables['cmap']+$offset31, SEEK_SET); + $format = $this->ReadUShort(); + if($format!=4) + $this->Error('Unexpected subtable format: '.$format); + $this->Skip(2*2); // length, language + $segCount = $this->ReadUShort()/2; + $this->Skip(3*2); // searchRange, entrySelector, rangeShift + for($i=0;$i<$segCount;$i++) + $endCount[$i] = $this->ReadUShort(); + $this->Skip(2); // reservedPad + for($i=0;$i<$segCount;$i++) + $startCount[$i] = $this->ReadUShort(); + for($i=0;$i<$segCount;$i++) + $idDelta[$i] = $this->ReadShort(); + $offset = ftell($this->f); + for($i=0;$i<$segCount;$i++) + $idRangeOffset[$i] = $this->ReadUShort(); + + for($i=0;$i<$segCount;$i++) + { + $c1 = $startCount[$i]; + $c2 = $endCount[$i]; + $d = $idDelta[$i]; + $ro = $idRangeOffset[$i]; + if($ro>0) + fseek($this->f, $offset+2*$i+$ro, SEEK_SET); + for($c=$c1;$c<=$c2;$c++) + { + if($c==0xFFFF) + break; + if($ro>0) + { + $gid = $this->ReadUShort(); + if($gid>0) + $gid += $d; + } + else + $gid = $c+$d; + if($gid>=65536) + $gid -= 65536; + if($gid>0) + $this->chars[$c] = $gid; + } + } + } + + function ParseName() + { + $this->Seek('name'); + $tableOffset = ftell($this->f); + $this->postScriptName = ''; + $this->Skip(2); // format + $count = $this->ReadUShort(); + $stringOffset = $this->ReadUShort(); + for($i=0;$i<$count;$i++) + { + $this->Skip(3*2); // platformID, encodingID, languageID + $nameID = $this->ReadUShort(); + $length = $this->ReadUShort(); + $offset = $this->ReadUShort(); + if($nameID==6) + { + // PostScript name + fseek($this->f, $tableOffset+$stringOffset+$offset, SEEK_SET); + $s = $this->Read($length); + $s = str_replace(chr(0), '', $s); + $s = preg_replace('|[ \[\](){}<>/%]|', '', $s); + $this->postScriptName = $s; + break; + } + } + if($this->postScriptName=='') + $this->Error('PostScript name not found'); + } + + function ParseOS2() + { + $this->Seek('OS/2'); + $version = $this->ReadUShort(); + $this->Skip(3*2); // xAvgCharWidth, usWeightClass, usWidthClass + $fsType = $this->ReadUShort(); + $this->Embeddable = ($fsType!=2) && ($fsType & 0x200)==0; + $this->Skip(11*2+10+4*4+4); + $fsSelection = $this->ReadUShort(); + $this->Bold = ($fsSelection & 32)!=0; + $this->Skip(2*2); // usFirstCharIndex, usLastCharIndex + $this->typoAscender = $this->ReadShort(); + $this->typoDescender = $this->ReadShort(); + if($version>=2) + { + $this->Skip(3*2+2*4+2); + $this->capHeight = $this->ReadShort(); + } + else + $this->capHeight = 0; + } + + function ParsePost() + { + $this->Seek('post'); + $this->Skip(4); // version + $this->italicAngle = $this->ReadShort(); + $this->Skip(2); // Skip decimal part + $this->underlinePosition = $this->ReadShort(); + $this->underlineThickness = $this->ReadShort(); + $this->isFixedPitch = ($this->ReadULong()!=0); + } + + function Error($msg) + { + if(PHP_SAPI=='cli') + die("Error: $msg\n"); + else + die("Error: $msg"); + } + + function Seek($tag) + { + if(!isset($this->tables[$tag])) + $this->Error('Table not found: '.$tag); + fseek($this->f, $this->tables[$tag], SEEK_SET); + } + + function Skip($n) + { + fseek($this->f, $n, SEEK_CUR); + } + + function Read($n) + { + return fread($this->f, $n); + } + + function ReadUShort() + { + $a = unpack('nn', fread($this->f,2)); + return $a['n']; + } + + function ReadShort() + { + $a = unpack('nn', fread($this->f,2)); + $v = $a['n']; + if($v>=0x8000) + $v -= 65536; + return $v; + } + + function ReadULong() + { + $a = unpack('NN', fread($this->f,4)); + return $a['N']; + } +} +?> diff --git a/vendor/jquery.js b/vendor/jquery.js index e414a7e..b076ccc 100644 --- a/vendor/jquery.js +++ b/vendor/jquery.js @@ -1721,7 +1721,7 @@ jQuery.event = { type = namespaces.shift(); namespace = new RegExp("(^|\\.)" + - jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)") + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); } eventType = events[ type ]; @@ -2522,7 +2522,7 @@ jQuery.each(["live", "die"], function( i, name ) { } return this; - } + }; }); function liveHandler( event ) { From d2ca24beff75c5a1fa2969319be237cc5f30a114 Mon Sep 17 00:00:00 2001 From: stekot Date: Thu, 12 Apr 2012 12:31:48 +0200 Subject: [PATCH 05/13] External font support added. --- index.html | 197 ++++++++++++++++++++--------------------- lib/pdf.js | 201 +++++++++++++++++++++++++----------------- makefont/index.php | 5 +- makefont/makefont.php | 46 ++++++++-- 4 files changed, 259 insertions(+), 190 deletions(-) diff --git a/index.html b/index.html index 677eb6e..04946ce 100644 --- a/index.html +++ b/index.html @@ -1,74 +1,95 @@ - pdf.js - create basic pdf files in the browser and node.js - - - - - - - +pdf.js - create basic pdf files in the browser and + node.js + + + + + + + + + -

pdf.js - create basic pdf files in the browser and node.js

- - -

demo - -this uses dataURIs and they kinda suck. the -node.js version is better.


-
- - -
- -
- - - -Fork me on GitHub - + + \ No newline at end of file diff --git a/lib/pdf.js b/lib/pdf.js index 5882f47..4ed2c69 100644 --- a/lib/pdf.js +++ b/lib/pdf.js @@ -6,6 +6,7 @@ https://github.com/MrRio/jsPDF Contributor(s) - pdf.js Copyright (c) 2010 Marak Squires http://github.com/marak/pdf.js/ +Copyright (c) 2012 Stekot Squires http://github.com/stekot/pdf.js/ Permission is hereby granted, free of charge, to any person obtaining @@ -109,6 +110,7 @@ var pdf = exports.pdf = function() { var tMargin = 30; var bMargin = 30; var curX, curY; + var stringWidths = {}; // Initilisation if (unit == 'pt') { k = 1; @@ -240,12 +242,13 @@ var pdf = exports.pdf = function() { out('>>'); out('endobj'); newObject(); - out('<FontFiles[$font['file']]['n'].' 0 R'; + if (!('file' in f)) { + // $s .= ' /FontFile'.($type=='Type1' ? '' : '2').' + // '.$this->FontFiles[$font['file']]['n'].' 0 R'; } out('>>'); out('endobj'); @@ -348,11 +351,24 @@ var pdf = exports.pdf = function() { out('/Info ' + (objectNumber - 1) + ' 0 R'); }; - - var getStringWidth = function(text) { + var unicodeToAscii = function(text) { + if (!curEnc || !text) { + return text; + } + returnText = []; + for ( var i = 0; i < text.length; i++) { + var charCode = text.charCodeAt(i); + if (charCode in encodings[curEnc]['uni2ascii']) { + charCode = encodings[curEnc]['uni2ascii'][charCode]; + } + returnText.push(String.fromCharCode(charCode)); + } + return returnText.join(''); + }; + + var getStringWidthCSS = function(text) { // FIXME: include bold fonts. // using CSS - console.log(unicodeToAscii(text).length); var span = document.createElement('span'); span.style.position = 'absolute'; span.style.visibile = 'hidden'; @@ -363,7 +379,7 @@ var pdf = exports.pdf = function() { if (font in fontData) { span.style.fontFamily = fontData[font['cssname']]; } else { - span.style.fontFamily = font; + span.style.fontFamily = baseFonts[font]; } (document.getElementsByTagName('body')[0]).appendChild(span); span.textContent = text; @@ -372,6 +388,45 @@ var pdf = exports.pdf = function() { return width; }; + var getStringWidthAFM = function(text) { + if (text in stringWidths) { + return stringWidths[text]; + } + text2 = unicodeToAscii(text); + width = 0; + len = text2.length; + for ( var i = 00; i < len; i++) { + var charCode = text2.charCodeAt(i); + width += fontData[font]['cw'][charCode]; + } + if (width == undefined) { + raise("width is undefined"); + } + width = width * fontSize / 2834 / 0.5176945533026998 / k; + if (buffer) { + stringWidths[text] = width; + } + return width; + }; + + var getStringWidth = function(text, buffer) { + if (buffer === undefined) { + buffer = false; + } + if (buffer && text in stringWidths) { + return stringWidths[text]; + } + if (font in fontData) { + var width = getStringWidthAFM(text, buffer); + } else { + var width = getStringWidthCSS(text, buffer); + } + if (buffer) { + stringWidths[text] = width; + } + return width; + } + var endDocument = function() { state = 1; putHeader(); @@ -435,15 +490,16 @@ var pdf = exports.pdf = function() { }; var _setFont = function(f) { + stringWidths = {}; if (!(f in fonts)) { // if not known font yet, add in fonts array, then used in // endDocument // while putting ressource fonts[f] = '/F' + (fontIndex++); - + } font = f; - if(f in fontData){ + if (f in fontData) { curEnc = fontData[f]['enc']; } }; @@ -473,26 +529,11 @@ var pdf = exports.pdf = function() { encodings[enc]['i'] = null; } }; - - var unicodeToAscii = function(text){ - if(!curEnc || !text){ - return text; - } - returnText = []; - for(var i=0;i= maxW) { - // new line - this.text(curX, curY, text.substr(j, sep - j)); - j = sep + 1; - sep = -1; - i = j; - lineW = 0; - this.newLine(h); - if (getStringWidth(text.substr(i, n)) < maxW) { - this.text(curX, curY, text.substr(i, n)); - this.newLine(h); - i = n; - } - i++; - continue; - } - if (text[i] === ' ') { - sep = i; - } - lineW += letterW; - i++; - if (i == n) {// end of the text - this.text(curX, curY, text.substr(j, sep - i)); - this.newLine(h); - } - - } - }, + write: function(h, text, f){ + if(f){ + this.setFont(f); + } + text = text.replace('\r', ''); + var maxW = pageWidth - lMarginPt - rMarginPt - 60; + var lineW = 0; + var sep = -1; + var n = text.length; + var i = 0; // actual letter + var j = 0; // last line break + this.newLine(h); + if(getStringWidth(text) < pageWidth){ + this.text(curX, curY, text); + this.newLine(h); + } + while(i < n){ + // @TODO add handeling of new line + letterW = getStringWidth(text[i]); + if((lineW) >= maxW){ + //new line + this.text(curX, curY, text.substr(j, sep - j)); + j = sep+1; + sep = -1; + i = j; + lineW = 0; + this.newLine(h); + if(getStringWidth(text.substr(i,n)) < maxW){ + this.text(curX, curY, text.substr(i, n)); + this.newLine(h); + i = n; + } + i++; + continue; + } + if(text[i] === ' '){ + sep = i; + } + lineW += letterW; + i++; + if(i == n){// end of the text + this.text(curX, curY, text.substr(j, sep - i)); + this.newLine(h); + } + + } + }, newLine : function(h) { if (pageHeight - bMargin < curY) { _addPage(); @@ -616,11 +657,11 @@ var pdf = exports.pdf = function() { // @TODO: Add different output options }, setFontSize : function(size) { + stringWidths = {}; fontSize = size; }, setFont : _setFont, - addFont : _addFont, - addEncoding : _addEncoding, + addFont : _addFont }; }; @@ -640,7 +681,7 @@ exports.encode = function(input) { var chr1, chr2, chr3, enc1, enc2, enc3, enc4; var i = 0; -// input = utf8_encode(input); + // input = utf8_encode(input); while (i < input.length) { @@ -698,7 +739,7 @@ exports.decode = function(input) { } - output = utf8_decode(output); + // output = utf8_decode(output); return output; diff --git a/makefont/index.php b/makefont/index.php index ede8f85..67cd2a0 100644 --- a/makefont/index.php +++ b/makefont/index.php @@ -1,6 +1,7 @@ ".file_get_contents($font.".js"); diff --git a/makefont/makefont.php b/makefont/makefont.php index 781ab36..011c39f 100644 --- a/makefont/makefont.php +++ b/makefont/makefont.php @@ -275,7 +275,37 @@ function MakeUnicodeEncodingTable($enc){ } function JSONToFile($file, $json_obj) { - SaveToFile($file, json_encode($json_obj)); + $str = json_encode($json_obj); + $str = str_replace('\\/','/',$str); + $str = str_replace('\\\\','\\',$str); + $str = "var font = $str;"; + SaveToFile($file, $str); +} + +function strToHex($string) { + $hex = array(); + for ($i=0; $i < strlen($string); $i++) + { + $char = dechex(ord($string[$i])); + $len = strlen($char); + for($j=0;$j<4-$len;$j++){ + $char = "0".$char; + } + if(strlen($char) != 4){ + throw new Exception("$string[$i]-$char-$len"); + } + $char = '\\'.$char; + $hex[] = $char; + } + return implode('',$hex); +} + +function strToCode($str){ + $count = 0; + for ($i=0; $i < strlen($str); $i++){ + $count += ord($str[$i]); + } + echo $count; } function SaveToFile($file, $s) { @@ -289,7 +319,7 @@ function SaveToFile($file, $s) { function MakeDefinitionFile($file, $type, $enc, $embed, $map, $info) { $json_obj = array(); $json_obj['type'] = $type; - $json_obj['decs'] = MakeFontDescriptor($info); + $json_obj['desc'] = MakeFontDescriptor($info); $json_obj['name'] = $info['FontName']; $json_obj['up'] = $info['UnderlinePosition']; $json_obj['ut'] = $info['UnderlineThickness']; @@ -301,11 +331,11 @@ function MakeDefinitionFile($file, $type, $enc, $embed, $map, $info) { $json_obj['diff'] = $diff; if ($embed) { $json_obj['file'] = $info['file']; +// $json_obj['base64'] = $info['base64']; $json_obj['filesize'] = $info['filesize']; if ($type == 'Type1') { $json_obj['size1'] = $info['Size1']; $json_obj['size2'] = $info['Size2']; - } else { $json_obj['originalsize'] = $info['OriginalSize']; } @@ -314,7 +344,6 @@ function MakeDefinitionFile($file, $type, $enc, $embed, $map, $info) { } function MakeFont($fontfile, $enc = 'cp1252', $embed = true) { - $embed = false; //unsuported // Generate a font definition file if (get_magic_quotes_runtime()) @set_magic_quotes_runtime(0); @@ -342,17 +371,16 @@ function MakeFont($fontfile, $enc = 'cp1252', $embed = true) { if (function_exists('gzcompress')) { $embeded_font = gzcompress($info['Data']); $info['filesize'] = strlen($embeded_font); - // $embeded_font = base64_encode($embeded_font); - $embeded_font = utf8_encode($embeded_font); - $info['file'] = $embeded_font; +// $info['file'] = strToHex($embeded_font); + strToCode($embeded_font); + $info['file'] = base64_encode($embeded_font); Message('Font compressed.'); } else { Notice('Font file could not be compressed (zlib extension not available)'); } } - MakeDefinitionFile($basename . '.js', $type, $enc, $embed, $map, $info); - Message('Font definition file generated: ' . $basename . '.json'); + Message('Font definition file generated: ' . $basename . '.js'); } if (PHP_SAPI == 'cli') { From 3c0ae45c91edfd249450c129bc5de7c3de0624c7 Mon Sep 17 00:00:00 2001 From: stekot Date: Fri, 13 Apr 2012 00:22:17 +0200 Subject: [PATCH 06/13] External font can included into the file. --- lib/pdf.js | 117 +++++++++++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 52 deletions(-) diff --git a/lib/pdf.js b/lib/pdf.js index 4ed2c69..2724254 100644 --- a/lib/pdf.js +++ b/lib/pdf.js @@ -246,12 +246,22 @@ var pdf = exports.pdf = function() { for (d in f['desc']) { out(' /' + d + ' ' + f['desc'][d]); } - if (!('file' in f)) { - // $s .= ' /FontFile'.($type=='Type1' ? '' : '2').' - // '.$this->FontFiles[$font['file']]['n'].' 0 R'; + if ('file' in f) { + out(' /FontFile' + (f['type'] == 'Type1' ? '' : '2') + ' ' + + (objectNumber + 1) + ' 0 R'); + out('>>'); + out('endobj'); + newObject(); + out('<>'); + putStream(f['file']); + out('endobj'); + } else { + out('>>'); + out('endobj'); } - out('>>'); - out('endobj'); } } }; @@ -515,6 +525,9 @@ var pdf = exports.pdf = function() { data['diff'] = undefined; data['uni2ascii'] = undefined } + if ('file' in data) { + data['file'] = Base64.decode(data['file']); + } fontData[fontKey] = data; } fontIndex++; @@ -576,53 +589,53 @@ var pdf = exports.pdf = function() { + parseInt(fontSize, 10) + '.00 Tf ET'); out(str); }, - write: function(h, text, f){ - if(f){ - this.setFont(f); - } - text = text.replace('\r', ''); - var maxW = pageWidth - lMarginPt - rMarginPt - 60; - var lineW = 0; - var sep = -1; - var n = text.length; - var i = 0; // actual letter - var j = 0; // last line break - this.newLine(h); - if(getStringWidth(text) < pageWidth){ - this.text(curX, curY, text); - this.newLine(h); - } - while(i < n){ - // @TODO add handeling of new line - letterW = getStringWidth(text[i]); - if((lineW) >= maxW){ - //new line - this.text(curX, curY, text.substr(j, sep - j)); - j = sep+1; - sep = -1; - i = j; - lineW = 0; - this.newLine(h); - if(getStringWidth(text.substr(i,n)) < maxW){ - this.text(curX, curY, text.substr(i, n)); - this.newLine(h); - i = n; - } - i++; - continue; - } - if(text[i] === ' '){ - sep = i; - } - lineW += letterW; - i++; - if(i == n){// end of the text - this.text(curX, curY, text.substr(j, sep - i)); - this.newLine(h); - } - - } - }, + write : function(h, text, f) { + if (f) { + this.setFont(f); + } + text = text.replace('\r', ''); + var maxW = pageWidth - lMarginPt - rMarginPt - 60; + var lineW = 0; + var sep = -1; + var n = text.length; + var i = 0; // actual letter + var j = 0; // last line break + this.newLine(h); + if (getStringWidth(text) < pageWidth) { + this.text(curX, curY, text); + this.newLine(h); + } + while (i < n) { + // @TODO add handeling of new line + letterW = getStringWidth(text[i]); + if ((lineW) >= maxW) { + // new line + this.text(curX, curY, text.substr(j, sep - j)); + j = sep + 1; + sep = -1; + i = j; + lineW = 0; + this.newLine(h); + if (getStringWidth(text.substr(i, n)) < maxW) { + this.text(curX, curY, text.substr(i, n)); + this.newLine(h); + i = n; + } + i++; + continue; + } + if (text[i] === ' ') { + sep = i; + } + lineW += letterW; + i++; + if (i == n) {// end of the text + this.text(curX, curY, text.substr(j, sep - i)); + this.newLine(h); + } + + } + }, newLine : function(h) { if (pageHeight - bMargin < curY) { _addPage(); From 2dd1a6242a2c94b74a1bc5cc33f4fb4345ec47dc Mon Sep 17 00:00:00 2001 From: stekot Date: Thu, 26 Apr 2012 11:53:28 +0200 Subject: [PATCH 07/13] Basic image support added. --- lib/pdf.js | 243 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 226 insertions(+), 17 deletions(-) diff --git a/lib/pdf.js b/lib/pdf.js index 2724254..bf5c641 100644 --- a/lib/pdf.js +++ b/lib/pdf.js @@ -49,11 +49,11 @@ if (!Object.keys) { }; } -var pdf = exports.pdf = function() { +var pdf = exports.pdf = function(listener) { // Private properties var version = '20090504'; - var buffer = []; + var buffer = ''; var pdfVersion = '1.3'; // PDF Version var defaultPageFormat = 'a4'; @@ -86,7 +86,6 @@ var pdf = exports.pdf = function() { var fontData = {}; // fonts data var fontIndex = 0; // F1, F2, etc. using setFont var fontsNumber = {}; // object number holder for fonts - var fontFiles = []; var encodings = {}; var curEnc = null; var baseFonts = { @@ -105,12 +104,29 @@ var pdf = exports.pdf = function() { symbol : 'Symbol', zapfdingbats : 'ZapfDingbats' }; + var images = {}; var lMargin = 30; var rMargin = 30; var tMargin = 30; var bMargin = 30; var curX, curY; var stringWidths = {}; + var openConnections = 0; + var replacement = {}; + var outputFlag = false; + var createCon = function() { + openConnections++; + }; + var closeCon = function() { + openConnections--; + if (openConnections == 0 && outputFlag) { + var type = outputFlag[0]; + var opts = outputFlag[1]; + outputFlag = false; + _output(type, opts); + } + }; + // Initilisation if (unit == 'pt') { k = 1; @@ -266,8 +282,132 @@ var pdf = exports.pdf = function() { } }; + var putImg = function(img, url) { + newObject(); + // $this->_newobj(); + // FIXME + images[url]['n'] = objectNumber; + // $info['n'] = $this->n; + + // $this->_out('<_out('/Subtype /Image'); + out('/Subtype /Image'); + // $this->_out('/Width '.$info['w']); + out('/Width ' + img['w']); + // $this->_out('/Height '.$info['h']); + out('/Height ' + img['h']); + // if($info['cs']=='Indexed') + if (img['cs'] === 'Indexed') { + // $this->_out('/ColorSpace [/Indexed /DeviceRGB + out('/ColorSpace [/Indexed /DeviceRGB ' + + (img['pal'].length / 3 - 1) + ' ' + (objectNumber + 1) + + ' 0 R]'); + // '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]'); + } + // else { + else { + // $this->_out('/ColorSpace /'.$info['cs']); + out('/ColorSpace /' + img['cs']); + // if($info['cs']=='DeviceCMYK') + if (img['cs'] === 'DeviceCMYK') { + // $this->_out('/Decode [1 0 1 0 1 0 1 0]'); + out('/Decode [1 0 1 0 1 0 1 0]'); + } + } + // } + // $this->_out('/BitsPerComponent '.$info['bpc']); + out('/BitsPerComponent ' + img['bpc']); + // if(isset($info['f'])) + if ('f' in img) { + // $this->_out('/Filter /'.$info['f']); + out('/Filter /' + img['f']); + } + // if(isset($info['dp'])) + if ('dp' in img) { + // $this->_out('/DecodeParms <<'.$info['dp'].'>>'); + out('/DecodeParms <<' + img['dp'] + '>>'); + } + // if(isset($info['trns']) && is_array($info['trns'])) + if ('trns' in img && img['trns'].constructor == Array) { + // { + // $trns = ''; + // for($i=0;$i_out('/Mask ['.$trns.']'); + // } + var trns = ''; + for ( var i = 0; i < img['trns'].length; i++) { + trns += (img[trns][i] + ' ' + img['trns'][i] + ' '); + out('/Mask [' + trns + ']'); + } + } + // if(isset($info['smask'])) + if ('smask' in img) { + // $this->_out('/SMask '.($this->n+1).' 0 R'); + out('/SMask ' + (objectNumber + 1) + ' 0 R'); + } + // $this->_out('/Length '.strlen($info['data']).'>>'); + out('/Length ' + img['data'].length + '>>'); + // $this->_putstream($info['data']); + // /**/putStream('IMAGE DATA'); + putStream(img['data']); + // $this->_out('endobj'); + out('endobj'); + // // Soft mask + // if(isset($info['smask'])){ + if ('smask' in img) { + // $dp = '/Predictor 15 /Colors 1 /BitsPerComponent 8 /Columns + // '.$info['w']; + var dp = '/Predictor 15 /Colors 1 /BitsPerComponent 8 /Columns ' + + img['w']; + // $smask = array('w'=>$info['w'], 'h'=>$info['h'], + // 'cs'=>'DeviceGray', + // 'bpc'=>8, 'f'=>$info['f'], 'dp'=>$dp, 'data'=>$info['smask']); + var smask = { + w : img['w'], + h : img['h'], + cs : 'DeviceGray', + bpc : 8, + f : img['f'], + dp : dp, + data : img['smask'] + }; + // $this->_putimage($smask); + putImg(smask); + // } + } + // // Palette + // if($info['cs']=='Indexed') + if (img['cs'] == 'Indexed') { + // { + // $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; + // $pal = ($this->compress) ? gzcompress($info['pal']) : + // $info['pal']; + // $this->_newobj(); + newObject(); + // $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>'); + out('<>'); + // $this->_putstream($pal); + // /**/putStream('PAL DATA'); + putStream(img['pal']); + // $this->_out('endobj'); + out('endobj'); + // } + } + }; + var putImages = function() { - // TODO + for ( var url in images) { + putImg(images[url], url); + } + // foreach(array_keys($this->images) as $file) + // { + // $this->_putimage($this->images[$file]); + // unset($this->images[$file]['data']); + // unset($this->images[$file]['smask']); + // } + }; var _drawLine = function(x1, y1, x2, y2, weight, style) { @@ -315,7 +455,12 @@ var pdf = exports.pdf = function() { var putXobjectDict = function() { // TODO - // Loop through images + for (img in images) { + out('/I' + images[img]['i'] + ' ' + images[img]['n'] + ' 0 R'); + } + // foreach($this->images as $image){ + // $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); + // } }; var putInfo = function() { @@ -441,7 +586,6 @@ var pdf = exports.pdf = function() { state = 1; putHeader(); putPages(); - putResources(); // Info newObject(); @@ -474,6 +618,9 @@ var pdf = exports.pdf = function() { out(o); out('%%EOF'); state = 3; + for (r in replacement) { + buffer = buffer.replace(r, replacement[r]); + } }; var beginPage = function() { @@ -568,6 +715,17 @@ var pdf = exports.pdf = function() { '\\)'); }; + var _output = function(type, options) { + endDocument(); + if (type === 'datauri') { + listener('data:application/pdf;filename=' + options.fileName + + ';base64,' + Base64.encode(buffer)); + } else { + listener(buffer); + } + // @TODO: Add different output options + }; + return { addPage : function() { _addPage(); @@ -655,26 +813,77 @@ var pdf = exports.pdf = function() { drawLine : _drawLine, setProperties : function(properties) { documentProperties = properties; - }, - addImage : function(imageData, format, x, y, w, h) { - }, output : function(type, options) { - endDocument(); - if (type === undefined) { - return buffer; - } else if (type === 'datauri') { - return 'data:application/pdf;filename=' + options.fileName - + ';base64,' + Base64.encode(buffer); + if (openConnections == 0) { + _output(type, options); + } else { + outputFlag = [ type, options ]; } - // @TODO: Add different output options }, setFontSize : function(size) { stringWidths = {}; fontSize = size; }, setFont : _setFont, - addFont : _addFont + addFont : _addFont, + image : function(url, x, y, w, h) { + var replacementKey = sprintf('{{img%s}}', + Object.keys(replacement).length); + replacement[replacementKey] = ''; + out(replacementKey); + if (!(url in images)) { + images[url] = {}; + images[url]['i'] = (Object.keys(images).length + 1); + } + var i = images[url]['i']; + var img = new Image(); + createCon(); + img.onload = function() { + var canvas = document.getElementById('canvas'); + canvas = document.createElement('canvas'); + document.body.appendChild(canvas); + var height = img.height; + var width = img.width; + canvas.width = width; + canvas.height = height; + var ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); + var info = { + w : width, + h : height, + cs : 'DeviceRGB', + bpc : 8, + f : 'DCTDecode', + i : i, + data : Base64.decode(canvas.toDataURL("image/jpeg") + .replace('data:image/jpeg;base64,', '')) + }; + document.body.removeChild(canvas); + images[url] = info; + if (!w && !h) { + w = -96; + h = -96; + } + if (w < 0) { + w = (-1) * info['w'] * 72 / w / k; + } + if (h < 0) { + h = (-1) * info['h'] * 72 / h / k; + } + if (w === 0) { + w = h * info['w'] / info['h']; + } + if (h === 0) { + h = w * info['h'] / info['w']; + } + replacement[replacementKey] = sprintf( + 'q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q', w * k, h * k, + x * k, (pageHeight - (y + h)) * k, info['i']); + closeCon(); + }; + img.src = url; + } }; }; From 5e254c7e71fe79932187b8d89c1ff43c84747150 Mon Sep 17 00:00:00 2001 From: stekot Date: Thu, 26 Apr 2012 12:24:46 +0200 Subject: [PATCH 08/13] Example and documentation updated. --- cour.js | 296 +++++++++++++++++++++++++++++++++++++++++++++ index.html | 28 +++-- makefont/index.php | 6 +- package.json | 14 --- stekot.jpg | Bin 0 -> 2149 bytes testFile57.pdf | Bin 1960 -> 0 bytes 6 files changed, 315 insertions(+), 29 deletions(-) create mode 100644 cour.js delete mode 100644 package.json create mode 100644 stekot.jpg delete mode 100644 testFile57.pdf diff --git a/cour.js b/cour.js new file mode 100644 index 0000000..564cf84 --- /dev/null +++ b/cour.js @@ -0,0 +1,296 @@ +/** + * This is font embeded into pdf file. It support cp1250 encoding. + * You can generate your own from ttf file using makefont. + */ + +var cour = { + "type" : "TrueType", + "desc" : { + "Ascent" : 613, + "Descent" : -188, + "CapHeight" : 571, + "Flags" : 33, + "FontBBox" : "[-122 -680 623 1021]", + "ItalicAngle" : 0, + "StemV" : 70, + "MissingWidth" : 600 + }, + "name" : "Courier", + "up" : -233, + "ut" : 41, + "cw" : [ 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600 ], + "enc" : "cp1250", + "uni2ascii" : { + "0" : 0, + "1" : 1, + "2" : 2, + "3" : 3, + "4" : 4, + "5" : 5, + "6" : 6, + "7" : 7, + "8" : 8, + "9" : 9, + "10" : 10, + "11" : 11, + "12" : 12, + "13" : 13, + "14" : 14, + "15" : 15, + "16" : 16, + "17" : 17, + "18" : 18, + "19" : 19, + "20" : 20, + "21" : 21, + "22" : 22, + "23" : 23, + "24" : 24, + "25" : 25, + "26" : 26, + "27" : 27, + "28" : 28, + "29" : 29, + "30" : 30, + "31" : 31, + "32" : 32, + "33" : 33, + "34" : 34, + "35" : 35, + "36" : 36, + "37" : 37, + "38" : 38, + "39" : 39, + "40" : 40, + "41" : 41, + "42" : 42, + "43" : 43, + "44" : 44, + "45" : 45, + "46" : 46, + "47" : 47, + "48" : 48, + "49" : 49, + "50" : 50, + "51" : 51, + "52" : 52, + "53" : 53, + "54" : 54, + "55" : 55, + "56" : 56, + "57" : 57, + "58" : 58, + "59" : 59, + "60" : 60, + "61" : 61, + "62" : 62, + "63" : 63, + "64" : 64, + "65" : 65, + "66" : 66, + "67" : 67, + "68" : 68, + "69" : 69, + "70" : 70, + "71" : 71, + "72" : 72, + "73" : 73, + "74" : 74, + "75" : 75, + "76" : 76, + "77" : 77, + "78" : 78, + "79" : 79, + "80" : 80, + "81" : 81, + "82" : 82, + "83" : 83, + "84" : 84, + "85" : 85, + "86" : 86, + "87" : 87, + "88" : 88, + "89" : 89, + "90" : 90, + "91" : 91, + "92" : 92, + "93" : 93, + "94" : 94, + "95" : 95, + "96" : 96, + "97" : 97, + "98" : 98, + "99" : 99, + "100" : 100, + "101" : 101, + "102" : 102, + "103" : 103, + "104" : 104, + "105" : 105, + "106" : 106, + "107" : 107, + "108" : 108, + "109" : 109, + "110" : 110, + "111" : 111, + "112" : 112, + "113" : 113, + "114" : 114, + "115" : 115, + "116" : 116, + "117" : 117, + "118" : 118, + "119" : 119, + "120" : 120, + "121" : 121, + "122" : 122, + "123" : 123, + "124" : 124, + "125" : 125, + "126" : 126, + "127" : 127, + "8364" : 128, + "8218" : 130, + "8222" : 132, + "8230" : 133, + "8224" : 134, + "8225" : 135, + "8240" : 137, + "352" : 138, + "8249" : 139, + "346" : 140, + "356" : 141, + "381" : 142, + "377" : 143, + "8216" : 145, + "8217" : 146, + "8220" : 147, + "8221" : 148, + "8226" : 149, + "8211" : 150, + "8212" : 151, + "8482" : 153, + "353" : 154, + "8250" : 155, + "347" : 156, + "357" : 157, + "382" : 158, + "378" : 159, + "160" : 160, + "711" : 161, + "728" : 162, + "321" : 163, + "164" : 164, + "260" : 165, + "166" : 166, + "167" : 167, + "168" : 168, + "169" : 169, + "350" : 170, + "171" : 171, + "172" : 172, + "173" : 173, + "174" : 174, + "379" : 175, + "176" : 176, + "177" : 177, + "731" : 178, + "322" : 179, + "180" : 180, + "181" : 181, + "182" : 182, + "183" : 183, + "184" : 184, + "261" : 185, + "351" : 186, + "187" : 187, + "317" : 188, + "733" : 189, + "318" : 190, + "380" : 191, + "340" : 192, + "193" : 193, + "194" : 194, + "258" : 195, + "196" : 196, + "313" : 197, + "262" : 198, + "199" : 199, + "268" : 200, + "201" : 201, + "280" : 202, + "203" : 203, + "282" : 204, + "205" : 205, + "206" : 206, + "270" : 207, + "272" : 208, + "323" : 209, + "327" : 210, + "211" : 211, + "212" : 212, + "336" : 213, + "214" : 214, + "215" : 215, + "344" : 216, + "366" : 217, + "218" : 218, + "368" : 219, + "220" : 220, + "221" : 221, + "354" : 222, + "223" : 223, + "341" : 224, + "225" : 225, + "226" : 226, + "259" : 227, + "228" : 228, + "314" : 229, + "263" : 230, + "231" : 231, + "269" : 232, + "233" : 233, + "281" : 234, + "235" : 235, + "283" : 236, + "237" : 237, + "238" : 238, + "271" : 239, + "273" : 240, + "324" : 241, + "328" : 242, + "243" : 243, + "244" : 244, + "337" : 245, + "246" : 246, + "247" : 247, + "345" : 248, + "367" : 249, + "250" : 250, + "369" : 251, + "252" : 252, + "253" : 253, + "355" : 254, + "729" : 255 + }, + "diff" : "131 \/.notdef 136 \/.notdef 140 \/Sacute \/Tcaron 143 \/Zacute 152 \/.notdef 156 \/sacute \/tcaron 159 \/zacute 161 \/caron \/breve \/Lslash 165 \/Aogonek 170 \/Scedilla 175 \/Zdotaccent 178 \/ogonek \/lslash 185 \/aogonek \/scedilla 188 \/Lcaron \/hungarumlaut \/lcaron \/zdotaccent \/Racute 195 \/Abreve 197 \/Lacute \/Cacute 200 \/Ccaron 202 \/Eogonek 204 \/Ecaron 207 \/Dcaron \/Dcroat \/Nacute \/Ncaron 213 \/Ohungarumlaut 216 \/Rcaron \/Uring 219 \/Uhungarumlaut 222 \/Tcommaaccent 224 \/racute 227 \/abreve 229 \/lacute \/cacute 232 \/ccaron 234 \/eogonek 236 \/ecaron 239 \/dcaron \/dcroat \/nacute \/ncaron 245 \/ohungarumlaut 248 \/rcaron \/uring 251 \/uhungarumlaut 254 \/tcommaaccent \/dotaccent" +}; \ No newline at end of file diff --git a/index.html b/index.html index 04946ce..7b18d96 100644 --- a/index.html +++ b/index.html @@ -60,15 +60,16 @@ @@ -92,7 +93,9 @@

diff --git a/makefont/index.php b/makefont/index.php index 67cd2a0..92f5cf8 100644 --- a/makefont/index.php +++ b/makefont/index.php @@ -1,7 +1,7 @@ ".file_get_contents($font.".js"); diff --git a/package.json b/package.json deleted file mode 100644 index b98d99e..0000000 --- a/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "pdf", - "description": "create basic pdf files in the browser or node.js, simple as cake", - "version": "0.2.1", - "author": "Marak Squires", - "repository": { - "type": "git", - "url": "http://github.com/Marak/pdf.js.git" - }, - "engine": [ - "node >=0.1.90" - ], - "main": "lib/pdf" -} \ No newline at end of file diff --git a/stekot.jpg b/stekot.jpg new file mode 100644 index 0000000000000000000000000000000000000000..34cd60cc31c0f70c6822e4986d0e543d7aa09516 GIT binary patch literal 2149 zcmbW1doNY$;HRbd6&13BR+D!`N1O*k@zG_iw$_=#CS?fB;MU)8{T7w+ctcX z!v+&GJT-COVM;fkL8CKOK#cL!mKf6iQA( z4kIr!Xr`zjuP9r{F8Os7js!uZJQ{`mnesmcX&Zo*1FQfm5T*yfu`mz|lXd_&2om{I z9z^=fU~mwDM4=%W3Q$7h3P?T(LZXq7VkkQm+6NF=q^ho^GfHjeKC~WH-Rd~AR8D_u zUHeL(mqG*Uu(%A2yv8a`t<{EWjf_p!+1T3IJ8X1xadjhY+wSh+yKA?ff54u=@cj`7 zBBLk=;}a5-X!PWxnJ2RT$Ud2qn}7bo#e%|1msw?3ua#F^ue?!J-*CI}PE+&Udylvs zosYY^pFHg!7<@JK`pw&69$)a+$MK2DsZXMBv)})on-~9Bka58P@D~;o|05R`;)2Wm z04?K!!D*0#SOikn5~b?A6TOeBre}3rPJJu0w5}baZ|x&o85Z|aUcI; z`2MF_R!$OcE7shgYwvON&#A2tR#X;f_=k4aXpd?$8fsT-{o$F8RXlA~833dPZvTAT zi{-57WfGL7#c%G-3b~y(JuiAqZW?M)Sd0_q<$j4dpQ1*mbrdvJ3C3R#E^A9_*z?|{ zoQ>jE=vBR?%W13V{WH9f?5_{pMYzXyIw5m~nagT)pU)kILptG(*M~dv2}$_dhppp8 z%9u$E@EbZ$3XI)c))G!kU#(1gou;#NDNQ$szSGR8aOGf8_^n zq;L=A7$W0{=0$inc?g*u_1w$^(((mFWr?D-$K<|=bL#P@mYGegwUbfmyxdNr4* z-h%VmSH@QDjSIV%|E#-L?$CY8e9)HGZ~bq&{p0H_r9it$>|*j5@m;teZ(1O-=dzwT z;f1Xki-sEaZ+^l?p9(4%N{#%z;T3biGv@m#uQkQ4KV18~u`nKW3$8>{XK*K*@mdOS z+<=r3DWJ4ja%9o6zeEaT%}QX;Yq1Wwv%AIif-7EOK$d7C^~z3-RRNe;D?JZx*-WpF zi)8H~c0=!?+K0IcajP(1z{#}1WiK>!_U0D0tP|2Yjy<%DHcN?&P8;WMb|QZx)E%Qx z&EK0+%yOS)8RV$^*%qI~Koa~#Nymt4%ROwNH|O*yPGT^*u=l>`{9LhUeb#jT?)BM@ z(FNtn38LCT!?jJ>4AwT9?bp^Oqc7$>Z#aDu7gz7!!FhXUf`9$YvZa`@<5qtP7B<)@en2e^At zb^SGqo8n{DZzLayydyuKm+)Neyz%>DKXAns-?@N+uIU_!VG2QPE%97Tcxgc(^Vsrx zC<{Y(t3Dr79Z$%km>LeCna)1BGqW2!&na*DI}bw_w5K@@C^wCTXiTwQ6<+fF!t(k~ z!^UbpojHB6`>S;)K*{_ZVzd0N7W#F>-TRw?^i5d>+B$ES1&Q_02m8(!q ztKh-kr!a&14n{rX?h7E5wGcG8x}Ye$`pxr-gMQ53SgO|9sEFXFpGfk|_baw{0)Bld z{=6CWsHDAXg+q0*m6YK#*Jy#MOBXT%VnUfNU1l-YvPnLg8w^%BtNTy9;79=ks`<{V zn3@(XNX7PL8#<9oeeWn{JPI^i)a!ArQ*_m^lYAT9WjUQ=~XUk5hU@`4+#gIl?7igBktDKiI%{ zEgDcy*$=%%AgnoR8?8TQBn~%RIIZOCD~u@mGQNT2^pdLml!Vb7X>*wBbP?GvW9~{! z=;Nbap1 zyyg!LyVy9vEe?wqtEB3k*|J$2ElHw>eLP$tv_Co4_kdyQ`9!JrMB*NP(?d#n1R^j< zn=JgoHjh5g)^Ubiel;QAmWfuhawtK*WlMoz_5HN6^i?25FvP4ZO9z)3fxcZH#w98c zN=6k4>RO1drP7`fLnpMj*3}^Ob+FFV#q3f9TqO*~i56BrDApRd#_X{Uc(fwrn&}X`-??6l6{u6_MvW)-$ literal 0 HcmV?d00001 diff --git a/testFile57.pdf b/testFile57.pdf deleted file mode 100644 index f313ed13679dec09961100cf3b395960e6d88607..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1960 zcmbVNZExZ@5dQ98F<&ZCsTfhw~Pie*EbZkt*{jez-xqm1^eZ5OR*w))^^E!h*OBE7BbS9dO{SfH4?Np+EAb zxD~WI&`#nYL~90(xhx8O0XHB@z;uIi7%h%{aY+)_zB#Ofg%qPWnL%Z9H3OwH87wS3 zOJj4bKEg8#qJVu^8hHv8CPBOon?ouTh{9@^$Q|U==n~vq!o=v6m1c|JcfQ%(hJ$#| z!T({jb^B+pB!}UzNgmB}3-}Y@a#tJ@^Uo#P)4pA8bt#c=Q;Gs?{uh?O z$rlHe%A`?PlliWAgx>ZapnKN?@{=(5gK(eUiaa$T9AkTBX#7Ha-?6&;7^Ec$lPGAm zAdZuu8Nq(cc+ifZAdlo5>EHDTc?TVv3DJ>=G2;CedemeA-$na1dh=g%-=eK^{cpLq zYVO!g|!ehWT8xgfMFtn_a{Kg;4-x;zzxK2{S~>yAGwoY1~Xb>>em z{hq5UW%I4!0N;zyI(ZZ-qti#};EAF{03G?Zqc;TBL)MOxxP5-WLg#>m zwV?Hc6NR4nTVjTH!se2=UrKeAI>g*I5FO<1GpMR4kb3WXD_(Vl^|@EFr;Dmo2Vq`} zoZ{K%jIiAYT5%l3Folf`6T}bf~ohPbprjH)^WEH(A|=)(PWk7I-TO$=O-|en9>P DDMkD; From 673c892b4a68464b507062ff92babc14bfc0b8b7 Mon Sep 17 00:00:00 2001 From: stekot Date: Wed, 9 May 2012 11:14:14 +0200 Subject: [PATCH 09/13] Image supports img or canvas argument. --- index.html | 3 +- lib/pdf.js | 214 ++++++++++++++++++++++++++++------------------------- 2 files changed, 113 insertions(+), 104 deletions(-) diff --git a/index.html b/index.html index 7b18d96..ab125c0 100644 --- a/index.html +++ b/index.html @@ -1,8 +1,7 @@ -pdf.js - create basic pdf files in the browser and - node.js +pdf.js - create basic pdf files in the browser - + @@ -109,7 +109,7 @@

doc.text(20, 50, 'Times-Roman - This is some normal sized text underneath.', 'Times-Roman'); doc.text(20, 60, 'Helvetica - This is some normal sized text underneath.', 'Helvetica'); doc.text(20, 70, 'Courier - This is some normal sized text.', 'Courier'); - doc.addFont('courcs', '', cour); + doc.addFont('courcs', '', font); doc.setFont('courcs'); doc.text(20, 80, 'Text with some foreign characters: ìšèøžýáíù'); doc.drawLine(100, 100, 100, 120, 1.0, 'dashed'); diff --git a/lib/pdf.js b/lib/pdf.js index f636a1b..5f8e1b8 100644 --- a/lib/pdf.js +++ b/lib/pdf.js @@ -64,7 +64,6 @@ var pdf = exports.pdf = function(listener) { 'letter' : [ 612, 792 ], 'legal' : [ 612, 1008 ] }; - var textColor = '0 g'; var page = 0; var objectNumber = 2; // 'n' Current object number var state = 0; // Current document state @@ -158,7 +157,6 @@ var pdf = exports.pdf = function(listener) { var putPages = function() { - // TODO: Fix, hardcoded to a4 portrait var wPt = pageWidth * k; var hPt = pageHeight * k; @@ -230,7 +228,6 @@ var pdf = exports.pdf = function(listener) { encodings[enc]['i'] = objectNumber; } for (f in fonts) { - console.log("font "+f); newObject(); fontsNumber[f] = objectNumber; // basefonts @@ -251,12 +248,13 @@ var pdf = exports.pdf = function(listener) { out('/BaseFont /' + f['name']); out('/Subtype /' + f['type']); if ('enc' in f) { - out('/FirstChar 32 /LastChar 255'); + out('/FirstChar 0 /LastChar 255'); out('/Encoding ' + encodings[f['enc']]['i'] + ' 0 R'); } else { out('/Encoding /WinAnsiEncoding'); } out('/FontDescriptor ' + (objectNumber + 1) + ' 0 R'); + out('/Widths '+ (objectNumber + 2) +' 0 R'); out('>>'); out('endobj'); newObject(); @@ -280,6 +278,9 @@ var pdf = exports.pdf = function(listener) { out('>>'); out('endobj'); } + newObject(); + out('[ ' + (f['cw'].join(' '))+ ' ]'); + out('endobj'); } } }; @@ -323,26 +324,6 @@ var pdf = exports.pdf = function(listener) { out('/Length ' + img['data'].length + '>>'); putStream(img['data']); out('endobj'); - if ('smask' in img) { - var dp = '/Predictor 15 /Colors 1 /BitsPerComponent 8 /Columns ' - + img['w']; - var smask = { - w : img['w'], - h : img['h'], - cs : 'DeviceGray', - bpc : 8, - f : img['f'], - dp : dp, - data : img['smask'] - }; - putImg(smask); - } - if (img['cs'] == 'Indexed') { - newObject(); - out('<>'); - putStream(img['pal']); - out('endobj'); - } }; var putImages = function() { @@ -480,7 +461,7 @@ var pdf = exports.pdf = function(listener) { span.parentNode.removeChild(span); return width; }; - + // pouzit prostredi listing latex var getStringWidthAFM = function(text) { if (text in stringWidths) { return stringWidths[text]; @@ -567,11 +548,10 @@ var pdf = exports.pdf = function(listener) { state = 2; pages[page] = ''; - // TODO: Hardcoded at A4 and portrait - pageHeightPt = pageFormats['a4'][1]; - pageWidthPt = pageFormats['a4'][0]; - pageHeight = pageFormats['a4'][1] / k; - pageWidth = pageFormats['a4'][0] / k; + pageHeightPt = pageFormats[defaultPageFormat][1]; + pageWidthPt = pageFormats[defaultPageFormat][0]; + pageHeight = pageFormats[defaultPageFormat][1] / k; + pageWidth = pageFormats[defaultPageFormat][0] / k; curX = lMarginPt; curY = tMarginPt; }; @@ -686,12 +666,15 @@ var pdf = exports.pdf = function(listener) { + parseInt(fontSize, 10) + '.00 Tf ET'); out(str); }, - write : function(h, text, f) { + write : function(h, text, f, w) { if (f) { this.setFont(f); } text = text.replace('\r', ''); var maxW = pageWidth - lMarginPt - rMarginPt - 60; + if (w) { + maxW = w; + } var lineW = 0; var sep = -1; var n = text.length; @@ -753,13 +736,6 @@ var pdf = exports.pdf = function(listener) { setProperties : function(properties) { documentProperties = properties; }, - output : function(type, options) { - if (openConnections == 0) { - _output(type, options); - } else { - outputFlag = [ type, options ]; - } - }, setFontSize : function(size) { stringWidths = {}; fontSize = size; @@ -880,11 +856,84 @@ var pdf = exports.pdf = function(listener) { out(sprintf('q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q', w * k, h * k, x * k, (pageHeight - (y + h)) * k, info['i'])); } - } - }; - - var imageSVG = function(data) { - // TODO + }, + table : function(header, data, opts) { + var widths = opts.innerWidths; + var height = opts.innerHeight; + var headerHeight = opts.headerInnerHeight; + if (!headerHeight) { + headerHeight = height; + } + var charHeight = opts.charHeight; + var headerCharHeight = opts.headerCharHeight; + if (!headerCharHeight) { + headerCharHeight = charHeight; + } + var padding = opts.padding; + var headerPadding = opts.headerPadding; + if (!headerPadding) { + headerPadding = padding; + } + var font2 = opts.font; + if (!font2) { + font2 = font; + } + var fontSize2 = opts.fontSize; + if (!fontSize2) { + fontSize2 = fontSize; + } + var headerFont = opts.headerFont; + if (!headerFont) { + headerFont = font2; + } + var headerFontSize = opts.headerFontSize; + if (!headerFontSize) { + headerFontSize = fontSize2; + } + var borderStyle = opts.borderStyle; + var orX = curX; + var orY = curY; + var orFontSize = fontSize; + var orFont = font; + this.setFontSize(headerFontSize); + this.setFont(headerFont); + for ( var i = 0; i < header.length; i++) { + if (borderStyle) { + this.drawRect(curX - headerPadding, curY - headerPadding, + widths[i] + (2 * headerPadding), height + + (2 * headerPadding), 'B'); + } + this.write(headerCharHeight, header[i], undefined, widths[i]); + curY = orY; + curX += widths[i] + padding * 2; + } + this.setFontSize(orFontSize); + this.setFont(orFont); + this.setFontSize(fontSize2); + this.setFont(font2); + for ( var j = 0; j < data.length; j++) { + curX = orX; + orY += height + padding * 2; + curY = orY; + for ( var i = 0; i < data[j].length; i++) { + if (borderStyle) { + this.drawRect(curX - padding, curY - padding, widths[i] + + (2 * padding), height + (2 * padding), + 'dotted'); + } + this.write(charHeight, data[j][i], undefined, widths[i]); + curY = orY; + curX += widths[i] + padding * 2; + } + } + }, + output : function(type, options) { + if (openConnections == 0) { + _output(type, options); + } else { + outputFlag = [ type, options ]; + } + }, }; }; diff --git a/makefont/index.php b/makefont/index.php index 92f5cf8..a322c1e 100644 --- a/makefont/index.php +++ b/makefont/index.php @@ -1,7 +1,6 @@ ".file_get_contents($font.".js"); +makefont($font, $enc, $embed); diff --git a/makefont/makefont.php b/makefont/makefont.php index 011c39f..8f7781d 100644 --- a/makefont/makefont.php +++ b/makefont/makefont.php @@ -1,11 +1,4 @@ Date: Sat, 19 May 2012 12:56:20 +0200 Subject: [PATCH 12/13] Table support updated. --- lib/pdf.js | 82 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 21 deletions(-) diff --git a/lib/pdf.js b/lib/pdf.js index 5f8e1b8..d6a2ccc 100644 --- a/lib/pdf.js +++ b/lib/pdf.js @@ -254,7 +254,7 @@ var pdf = exports.pdf = function(listener) { out('/Encoding /WinAnsiEncoding'); } out('/FontDescriptor ' + (objectNumber + 1) + ' 0 R'); - out('/Widths '+ (objectNumber + 2) +' 0 R'); + out('/Widths ' + (objectNumber + 2) + ' 0 R'); out('>>'); out('endobj'); newObject(); @@ -279,7 +279,7 @@ var pdf = exports.pdf = function(listener) { out('endobj'); } newObject(); - out('[ ' + (f['cw'].join(' '))+ ' ]'); + out('[ ' + (f['cw'].join(' ')) + ' ]'); out('endobj'); } } @@ -671,6 +671,9 @@ var pdf = exports.pdf = function(listener) { this.setFont(f); } text = text.replace('\r', ''); + if (!text) { + return 0; + } var maxW = pageWidth - lMarginPt - rMarginPt - 60; if (w) { maxW = w; @@ -680,10 +683,12 @@ var pdf = exports.pdf = function(listener) { var n = text.length; var i = 0; // actual letter var j = 0; // last line break + lines = 0 this.newLine(h); if (getStringWidth(text) < pageWidth) { this.text(curX, curY, text); this.newLine(h); + lines++; } while (i < n) { // @TODO add handeling of new line @@ -695,11 +700,13 @@ var pdf = exports.pdf = function(listener) { sep = -1; i = j; lineW = 0; + lines++; this.newLine(h); if (getStringWidth(text.substr(i, n)) < maxW) { this.text(curX, curY, text.substr(i, n)); this.newLine(h); i = n; + lines++; } i++; continue; @@ -712,9 +719,10 @@ var pdf = exports.pdf = function(listener) { if (i == n) {// end of the text this.text(curX, curY, text.substr(j, sep - i)); this.newLine(h); + lines++; } - } + return lines; }, newLine : function(h) { if (pageHeight - bMargin < curY) { @@ -891,40 +899,72 @@ var pdf = exports.pdf = function(listener) { headerFontSize = fontSize2; } var borderStyle = opts.borderStyle; - var orX = curX; - var orY = curY; var orFontSize = fontSize; var orFont = font; + t = 0.67; + this.setFontSize(headerFontSize); this.setFont(headerFont); + var orX = curX; + var orY = curY; + var lines = 0; for ( var i = 0; i < header.length; i++) { - if (borderStyle) { - this.drawRect(curX - headerPadding, curY - headerPadding, - widths[i] + (2 * headerPadding), height - + (2 * headerPadding), 'B'); - } - this.write(headerCharHeight, header[i], undefined, widths[i]); + var lines2 = this.write(headerHeight, header[i], undefined, + widths[i] * t) - 1 + lines = Math.max(lines, lines2); curY = orY; - curX += widths[i] + padding * 2; + curX += widths[i] + headerPadding * 2; + } + if (borderStyle) { + curX = orX; + curY = orY + for ( var i = 0; i < header.length; i++) { + var x1 = curX - headerPadding; + var x2 = curX + widths[i] + headerPadding; + var y1 = curY - headerPadding; + var y2 = curY + headerHeight * lines + headerPadding; + doc.drawLine(x1, y1, x1, y2, 1.2, borderStyle); + doc.drawLine(x1, y1, x2, y1, 1.2, borderStyle); + doc.drawLine(x1, y2, x2, y2, 1.2, borderStyle); + doc.drawLine(x2, y1, x2, y2, 1.2, borderStyle); + curY = orY; + curX += widths[i] + headerPadding * 2; + } + curX = orX; + curY += headerHeight * lines + headerPadding + padding; } this.setFontSize(orFontSize); this.setFont(orFont); this.setFontSize(fontSize2); this.setFont(font2); for ( var j = 0; j < data.length; j++) { - curX = orX; - orY += height + padding * 2; - curY = orY; + orY = curY; + lines = 0; for ( var i = 0; i < data[j].length; i++) { - if (borderStyle) { - this.drawRect(curX - padding, curY - padding, widths[i] - + (2 * padding), height + (2 * padding), - 'dotted'); - } - this.write(charHeight, data[j][i], undefined, widths[i]); + var lines2 = this.write(charHeight, data[j][i], undefined, + widths[i] * t) - 1; + lines = Math.max(lines, lines2); curY = orY; curX += widths[i] + padding * 2; } + curX = orX + if (borderStyle) { + for ( var i = 0; i < data[j].length; i++) { + x1 = curX - padding; + x2 = curX + widths[i] + padding; + y1 = curY - padding; + y2 = curY + height * lines + padding; + doc.drawLine(x1, y1, x1, y2, 1.0, borderStyle); + doc.drawLine(x1, y1, x2, y1, 1.0, borderStyle); + doc.drawLine(x1, y2, x2, y2, 1.0, borderStyle); + doc.drawLine(x2, y1, x2, y2, 1.0, borderStyle); + curY = orY; + curX += widths[i] + headerPadding * 2; + } + curX = orX; + } + curY += height * lines + padding * 2; + } }, output : function(type, options) { From a6d5121e0913345c2f6f67311117c1e8ecfef011 Mon Sep 17 00:00:00 2001 From: stekot Date: Sun, 20 May 2012 20:30:33 +0200 Subject: [PATCH 13/13] Demo file updated. --- index.html | 13 +++++++------ lib/pdf.js | 48 +++++++++++++++++++++++++----------------------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/index.html b/index.html index bb9638f..aa7708f 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,3 @@ - pdf.js - create basic pdf files in the browser @@ -81,8 +80,8 @@

pdf.js - create basic pdf files in the browser and node.js

demo - this uses dataURIs - and they kinda suck. the - node.js version is better. + so IE is not supported. If it throws security error, make sure page is + running on the server.


@@ -93,6 +92,7 @@

/* create the PDF document */ var doc = new pdf(function(data){ + $('#run').remove(); window.open(data, 'doc'); }); /* optional - set properties on the document */ @@ -119,12 +119,13 @@

doc.image('stekot.jpg', 50, 100); doc.drawRect(140, 140, 10, 10, 'solid'); - doc.addPage(); + doc.addPage(); + doc.setFont('courcs'); doc.setFontSize(18); - doc.setFont('Verdana'); doc.write(8, 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce tellus odio, dapibus id fermentum quis, suscipit id erat. Mauris dolor felis, sagittis at, luctus sed, aliquam non, tellus. Etiam posuere lacus quis dolor. Fusce aliquam vestibulum ipsum. Integer rutrum, orci vestibulum ullamcorper ultricies, lacus quam ultricies odio, vitae placerat pede sem sit amet enim. Mauris dolor felis, sagittis at, luctus sed, aliquam non, tellus. Etiam egestas wisi a erat. Etiam dictum tincidunt diam. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Integer lacinia. Curabitur bibendum justo non orci. Proin mattis lacinia justo.'); + doc.setFontSize(24); doc.write(8, 'Fusce consectetuer risus a nunc. Maecenas ipsum velit, consectetuer eu lobortis ut, dictum at dui. Mauris dolor felis, sagittis at, luctus sed, aliquam non, tellus. Nulla pulvinar eleifend sem. Fusce tellus odio, dapibus id fermentum quis, suscipit id erat. Aliquam in lorem sit amet leo accumsan lacinia. Mauris metus. Integer malesuada. Mauris suscipit, ligula sit amet pharetra semper, nibh ante cursus purus, vel sagittis velit mauris vel metus. Nullam dapibus fermentum ipsum. Sed convallis magna eu sem. Pellentesque pretium lectus id turpis. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Fusce tellus odio, dapibus id fermentum quis, suscipit id erat. Nunc tincidunt ante vitae massa.'); - + var fileName = "testFile"+new Date().getSeconds()+".pdf"; doc.output('datauri', {"fileName":fileName}); diff --git a/lib/pdf.js b/lib/pdf.js index d6a2ccc..7757450 100644 --- a/lib/pdf.js +++ b/lib/pdf.js @@ -190,7 +190,6 @@ var pdf = exports.pdf = function(listener) { }; var putStream = function(str, b64) { - // FIXME add support for binary objects out('stream'); if (b64) { out(Base64.decode(str)); @@ -287,8 +286,6 @@ var pdf = exports.pdf = function(listener) { var putImg = function(img, url) { newObject(); - // $this->_newobj(); - // FIXME images[url]['n'] = objectNumber; out('<