Below is my first attempt, which reencodes a T1 font to Unicode (still a hack for testing). Accents are misplaced and there is an error: Error in processing VF font (ptmr8t.vf): invalid character code, virtual font will be ignored but I have no idea what's wrong. At least, kerns and ligatures seem to be right. (With 0.29 for Windows.) Javier =================================== \documentclass{book} \pdfoutput=1 % \nonstopmode \directlua0{\unexpanded{ dofile('context/l-table.lua') fonts = fonts or {} fonts.encodings = fonts.encodings or {} fonts.encodings["T1"] = { [0] = 0x0300, 0x0301, 0x0302, 0x0303, 0x0308, 0x030B, 0x030A, 0x030C, 0x0306, 0x0304, 0x0307, 0x0327, 0x0328, 0x201A, 0x2039, 0x203A, 0x201C, 0x201D, 0x201E, 0x00AB, 0x00BB, 0x2013, 0x2014, 0xFFFE, 0xFFFE, 0x0131, 0x0237, 0xFB00, 0xFB01, 0xFB02, 0xFB03, 0xFB04, 0x2423, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x2019, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x2018, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x2010, 0x0102, 0x0104, 0x0106, 0x010C, 0x010E, 0x011A, 0x0118, 0x011E, 0x0139, 0x013D, 0x0141, 0x0143, 0x0147, 0x014A, 0x0150, 0x0154, 0x0158, 0x015A, 0x0160, 0x015E, 0x0164, 0x0162, 0x0170, 0x016E, 0x0178, 0x0179, 0x017D, 0x017B, 0x0132, 0x0130, 0xFFFE, 0x00A7, 0x0103, 0x0105, 0x0107, 0x010D, 0x010F, 0x011B, 0x0119, 0x011F, 0x013A, 0x013E, 0x0142, 0x0144, 0x0148, 0x014B, 0x0151, 0x0155, 0x0159, 0x015B, 0x0161, 0x015F, 0xFFFE, 0x0163, 0x0171, 0x016F, 0x00FF, 0x017A, 0x017E, 0x017C, 0x0133, 0x00A1, 0x00BF, 0x00A3, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x0152, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0xFFFE, 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x0153, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00DF } function fonts.tounicode(name, size) texio.write_nl('Reencoding ' .. name) local f = font.read_tfm('ptmr8t', size) local vf = font.read_vf('ptmr8t', size) local u = {} u.name = name u.encodingbytes = 2 u.type = 'virtual' u.fonts = table.copy(vf.fonts) for k, v in pairs(f) do texio.write_nl(k) if k == 'characters' then enc = fonts.encodings['T1'] u.characters = {} for char_k, char_v in pairs(v) do char_uni = enc[char_k] u.characters[char_uni] = table.copy(v[char_k]) u.characters[char_uni].commands = table.copy(vf.characters[char_k].commands) if char_v.kerns then bk = {} for kern_k, kern_v in pairs(char_v.kerns) do bk[enc[kern_k]] = kern_v end u.characters[char_uni].kerns = table.copy(bk) end if char_v.ligatures then bl = {} for lig_k, lig_v in pairs(char_v.ligatures) do bl[enc[lig_k]] = {} bl[enc[lig_k]].char = enc[lig_v.char] bl[enc[lig_k]].type = lig_v.type end u.characters[char_uni].ligatures = table.copy(bl) end end elseif type(v) == 'table' then u[k] = table.copy(v) else u[k] = v end end return u end callback.register('define_font', function (name, size) if name == 'ptmr0u' then f = fonts.tounicode(name, size) else f = font.read_tfm(name, size) end % show_font(f) return f end) function show_font(f) for n, c in pairs(f.characters) do texio.write_nl('pos: ' .. n) for ck, cv in pairs(c) do if ck == 'kerns' then texio.write_nl(' kerns:') for kk, kv in pairs(cv) do texio.write_nl(' ' .. kk .. ': ' .. kv) end elseif ck == 'commands' then texio.write_nl(' commands:') for kk, kv in pairs(cv) do texio.write_nl(' ' .. kk .. ': ' .. kv[1] .. ',' .. (kv[2] or ''))% end elseif ck == 'ligatures' then texio.write_nl(' ligatures:') for lk, lv in pairs(cv) do texio.write_nl(' ' .. lk .. ':') for lck, lcv in pairs(lv) do texio.write(' ' .. lck .. ': ' .. lcv) end end elseif type(cv) == 'string' or type(cv) == 'number' then texio.write_nl(' ' .. ck .. ': ' .. cv) end end end end }} \begin{document} \font\nf=ptmr0u \nf Hola æo AV uU fl office AVa ß - \end{document}