ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hongwen Qiu <qiuhongwen@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Latest beta stops loading some ttc fonts
Date: Thu, 25 Sep 2014 16:50:01 +0800	[thread overview]
Message-ID: <5423D739.4010805@gmail.com> (raw)

The following minimal example used to work fine:
\starttypescript [serif] [zhfonts]
   \definefontsynonym [Serif] [name:nsimsun]
\stoptypescript

\starttypescript [zhfonts]
   \definetypeface [zhfonts] [rm] [serif] [zhfonts]
\stoptypescript

\usetypescript [zhfonts]
\setupbodyfont [zhfonts, rm, 11pt]

\starttext

测试

\stoptext

but it's no longer the case.

The font used here is 'simsun.ttc' which ships with Chinese edition 
Windows systems by default.
When I require "name:nsimsun" as above, the TTFAddLangStr() function in 
the luatex code base will have the following information:
fontname lang
NSimSun   0
NSimSun  1033
新宋体       2052
That is when lang equals 0 or 1033, the fontname will be NSimSun, but 
when lang equals 2052, the fontname will be 新宋体, the Chinese words 
for NSimSun.
Although the ValidatePostScriptFontName() complains about the Chinese 
name of this font, and set 'bad_ps_fontname' to true, luatex itself 
don't stop the font fromgetting the right fontname NSimSun, since it 
chooses ASCII names when there're multiple fontnames.

But actions["check metadata"](font-otf.lua, 1812),sets the 
metadata.fontname from the correct "NSimSun" to "bad-fontname-simsun", 
and this change causes ff_get_ttc_index() to always return -1 as the 
index, which caused ConTeXt to complain about the following error 
message before bail out:

(bad-fontname-simsun:-1)Invalid TTC index number

mtx-context     | fatal error: return code: 1

So, maybe font-otf.lua may need not change metadata.fontname and 
metadata.fullname if these two names are not nil?
___________________________________________________________________________________
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
___________________________________________________________________________________

             reply	other threads:[~2014-09-25  8:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25  8:50 Hongwen Qiu [this message]
2014-09-25 10:50 ` Hans Hagen
2014-09-26  2:06   ` Hongwen Qiu
2014-09-26  9:50     ` Hans Hagen

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=5423D739.4010805@gmail.com \
    --to=qiuhongwen@gmail.com \
    --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).