ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Problems with ttc-fonts
@ 2016-04-29  7:51 Ulrike Fischer
  2016-04-29  8:37 ` Hans Hagen
  2016-05-01  7:48 ` Hans Hagen
  0 siblings, 2 replies; 4+ messages in thread
From: Ulrike Fischer @ 2016-04-29  7:51 UTC (permalink / raw)
  To: ntg-context

I was playing with the addfeature handler mentioned here
https://mailman.ntg.nl/pipermail/ntg-context/2016/083952.html and
run into a problem with ttc-fonts:

\starttext
\directlua{
    fonts.handlers.otf.addfeature {
        name = "oneb",
        {
            type = "substitution",
            data = {
                ["1"] = "period",
            },
        },
        "feature test",
    }
}
\font\test= name:LatinModernRoman:+oneb \test

1234567890

\font\test= name:cambria:+oneb \test

1234567890

\stoptext

This gives:

.234567890
p234567890

So with latin modern it works fine, while with cambria the first
letter of the substituation is used. 

The used fonts are:

filename=lmroman10-bold.otf filetype=otf format=otf
foundname=D:/context-minimals/context/tex/texmf/fonts/opentype/public/lm/lmroman10-bold.otf
usedmethod=database

filename=c:/windows/fonts/cambria.ttc format=ttc
foundname=c:/windows/fonts/cambria.ttc usedmethod=direct

(I have no idea why the bold version of lm is used, but I don't care
now)

Looking at the tma I see one difference between both fonts:
glyphs in cambria have no "name". A typical entry looks like this

  [46]={
   ["boundingbox"]={ 109, 0, 311, 232 },
   ["index"]=484,
   ["unicode"]=46,
   ["width"]=420,
  },  

while with latin modern it looks like this:

  [46]={
   ["boundingbox"]={ 81, 0, 237, 156 },
   ["index"]=88,
   ["name"]="period",
   ["unicode"]=46,
   ["width"]=319,
  },
  
Is is normal that glyph of ttc-fonts have no name data? If yes how
should one do substituations in such fonts? 



-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-01  7:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-29  7:51 Problems with ttc-fonts Ulrike Fischer
2016-04-29  8:37 ` Hans Hagen
2016-04-29  9:25   ` Ulrike Fischer
2016-05-01  7:48 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).