ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: news3@nililand.de, mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Problems with ttc-fonts
Date: Sun, 1 May 2016 09:48:45 +0200	[thread overview]
Message-ID: <962d06f5-7348-f6bf-c449-7b926cbab036@wxs.nl> (raw)
In-Reply-To: <1qmochor1mtt1.dlg@nililand.de>

On 4/29/2016 9:51 AM, Ulrike Fischer wrote:
> 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.

I found the reason for that (side effect of utf conversion that takes 
the first character) of 'period'.

> 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?

i need to check it but some fonts have no sane glyph names (so we 
discard them) and there is also an standard name set (so no need for 
names then).

I uploaded a version that fixes the 'p' issue and falls back on agl 
names as well.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

      parent reply	other threads:[~2016-05-01  7:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29  7:51 Ulrike Fischer
2016-04-29  8:37 ` Hans Hagen
2016-04-29  9:25   ` Ulrike Fischer
2016-05-01  7:48 ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=962d06f5-7348-f6bf-c449-7b926cbab036@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=news3@nililand.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).