وفا خلیقی wrote:
Hi Hans
Thanks for the code so that we can use fonts in Plain and LaTeX.
I just had two questions
1- I got the code from Khaled. How can I get the beta myself from your
repository? I just joined ConTeXt mailing list.
in most cases it's the same as on the website (the ftp is low bandwidth
so only used by a few)
http://www.pragma-ade.com/context/latest/cont-tmf.zip
2- Your code works fine but if in LaTeX, I compile a document like
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\pagedir TRT \bodydir TRT \pardir TRT \textdir TRT
\directlua {
dofile(kpse.find_file("luatex-fonts.lua","tex"))
}
\font\body=file:XBZar.ttf:mode=node;script=arab;language=ara;+init;+medi;+fina;+liga;+rlig;+mark;+mkmk
at 14pt
\def\normalfont{\body}
\AtBeginDocument{\body}
\begin{document}
این یک آزمایش است که در حال وقوع است.
\section{مقدمه}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Then it gives this error
! LuaTeX error /home/vafa/texmf/tex/luatex-fonts/font-def.lua:337: attempt
to c
all field 'read_from_afm' (a nil value).
<to be read again>
indeed, has to do with the fact that (since we use the xetex syntax
there) we default to name lookups and those are tagged as afm while
luatex-fonts does not have that code (does not make sense)
you can try the attached file (probably enough, else i have to send more)
as we're in transition to luatex 0.38 i cannot post a zip today (some
fundamental math changes)
Hans
ps. keep in mind that the real advanced stuff with respect to fonts is
context only although node mode should work ok in luatex-fonts (add
mode=yes to the specification)
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
if not modules then modules = { } end modules ['font-dum'] = {
version = 1.001,
comment = "companion to luatex-*.tex",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
fonts = fonts or { }
-- general
fonts.otf.pack = false
fonts.tfm.resolve_vf = false -- no sure about this
-- readers
fonts.tfm.readers = fonts.tfm.readers or { }
fonts.tfm.readers.sequence = { 'otf', 'ttf', 'tfm' }
fonts.tfm.readers.afm = nil
-- define
fonts.define = fonts.define or { }
--~ fonts.define.method = "tfm"
fonts.define.specify.colonized_default_lookup = "name"
function fonts.define.get_specification(str)
return "", str, "", ":", str
end
-- logger
fonts.logger = fonts.logger or { }
function fonts.logger.save()
end
-- names
fonts.names = fonts.names or { }
fonts.names.basename = "luatex-fonts-names.lua"
fonts.names.new_to_old = { }
fonts.names.old_to_new = { }
local data, loaded = nil, false
function fonts.names.resolve(name,sub)
if not loaded then
local basename = fonts.names.basename
if basename and basename ~= "" then
for _, format in ipairs { "lua", "tex", "other text files" } do
local foundname = input.find_file(basename,format) or ""
if foundname ~= "" then
data = dofile(foundname)
if data then
local d = { }
for k, v in pairs(data.mapping) do
local t = v[1]
if t == "ttf" or t == "otf" or t == "ttc" then
d[k] = v
end
end
data.mapping = d
end
break
end
end
end
loaded = true
end
if type(data) == "table" and data.version == 1.07 then
local condensed = string.gsub(name,"[^%a%d]","")
local found = data.mapping and data.mapping[condensed]
if found then
local filename, is_sub = found[3], found[4]
return filename, is_sub
else
return name, false -- fallback to filename
end
end
end
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________