<div dir="ltr">I use the following test file but Arabic alphabets are not connected. Do you know what should I do?<br><br>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>\documentclass[a4paper,12pt]{article}<br>
\pdfoutput1<br>\directlua0{<br>callback.register('define_font',<br> function(name, size)<br> fonttype = nil<br> filename = kpse.find_file(name,"opentype fonts")<br> if (filename)<br> then fonttype = 'opentype'<br>
else filename = kpse.find_file(name, "truetype fonts")<br> end<br> if filename and not fonttype then fonttype = 'truetype' end<br> if fonttype then<br> if (size < 0) then size = (- 655.36) * size end<br>
ttffont = fontforge.to_table(fontforge.open(filename))<br> if ttffont then<br> f = { }<br> <a href="http://f.name">f.name</a> = ttffont.fontname<br> f.fullname = ttffont.names[1].names.fullname<br>
f.parameters = { }<br> f.designsize = size<br> f.size = size<br> direction = 0<br> f.parameters.slant = 0<br> f.parameters.space = size * 0.25<br> f.parameters.space_stretch = 0.3 * size<br>
f.parameters.space_shrink = 0.1 * size<br> f.parameters.x_height = 0.4 * size<br> f.parameters.quad = 1.0 * size<br> f.parameters.extra_space = 0<br> f.characters = { }<br> local mag = size / ttffont.units_per_em<br>
<br> names_of_char = { }<br> for char, glyph in pairs(ttffont.map.map)<br> do<br> names_of_char[ttffont.glyphs[glyph].name]<br> = ttffont.map.backmap[glyph]<br> end<br><br>
names_of_glyph = { }<br> for char, glyph in pairs(ttffont.map.map)<br> do<br> names_of_glyph[ttffont.glyphs[glyph].name]<br> = glyph<br> end<br><br> for char, glyph in pairs(ttffont.map.map)<br>
do<br> glyph_table = ttffont.glyphs[glyph]<br><br> f.characters[char] = {<br> index = glyph,<br> width = glyph_table.width * mag,<br> name = <a href="http://glyph_table.name">glyph_table.name</a>,<br>
}<br> if glyph_table.boundingbox[4] then<br> f.characters[char].height = glyph_table.boundingbox[4] * mag<br> end<br> if glyph_table.boundingbox[2] then<br> f.characters[char].depth = -glyph_table.boundingbox[2] * mag<br>
end<br><br> if glyph_table.kerns then<br> local kerns = { }<br> for _, kern in pairs(glyph_table.kerns)<br> do<br> kerns[names_of_char[kern.char]] = kern.off * mag<br>
end<br> f.characters[char].kerns = kerns<br> end<br> end<br> f.filename = filename<br> f.type = 'real'<br> f.format = fonttype<br> f.embedding = "subset"<br>
f.cidinfo = {<br> registry = "Adobe",<br> ordering = "Identity",<br> supplement = 0,<br> version = 1<br> }<br> end<br> else<br> f = font.read_tfm(name, size)<br>
end<br> return f<br> end<br>)<br>}<br><br>\pagedir TRT \bodydir TRT \textdir TRT \pardir TRT<br>\font\test="IranNastaliq.ttf" at 12pt<br>\begin{document}<br>\test<br>این یک آزمایش است.<br>\end{document}<br clear="all">
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>-- <br>VK<br>
</div>