2009/5/22 Taco Hoekwater <[email protected]>:
>
>
> Hans Hagen wrote:
>> Taco Hoekwater wrote:
>>>
>>> Khaled Hosny wrote:
>>>> Not very helpful in this situation, but FontForge has a non-standard
>>>> italic correction (ITLC) table[1], may be TeX related OpenTyp font
>>>> projects like Latin Modern and Gyre fonts can use it?
>>>
>>> That would perhaps not be a bad idea. If that table is there then
>>> luatex will automatically use it (it is a subtable of 'TeX ', which
>>> also contains height and depth information, and font dimensions).
>>
>> so, that data would end up in a regular feature/lookup? of is it an
>> entry in the glyph?
>
> They are automatically merged into the glyph, as
>
> glyph.italic_correction
> glyph.tex_height
> glyph.tex_depth
>
Hi,
Considering current state that we don't know any fonts that has ITLC table,
it would be better than nothing to implement italic correction as follows.
In the following code, "fontdata" is a table returned by the function
"fonts.define.read".
local param = fontdata.parameters
local italicangle = fontdata.shared.otfdata.metadata.italicangle
if italicangle and italicangle < 0 then
local uwidth = fontdata.shared.otfdata.metadata.uwidth or 40
local factor = fontdata.factor or 655.36
param.slant = - math.tan(italicangle*math.pi/180) * param.quad
for i,v in pairs(fontdata.characters) do
local gl = fontdata.descriptions[i]
local it = (gl.boundingbox[3] - gl.width + uwidth*0.5) * factor
if it > 0 then v.italic = it end
end
end
Best,
Dohyun Kim
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] / 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
___________________________________________________________________________________