* Latest beta stops loading some ttc fonts
@ 2014-09-25 8:50 Hongwen Qiu
2014-09-25 10:50 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Hongwen Qiu @ 2014-09-25 8:50 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Latest beta stops loading some ttc fonts
2014-09-25 8:50 Latest beta stops loading some ttc fonts Hongwen Qiu
@ 2014-09-25 10:50 ` Hans Hagen
2014-09-26 2:06 ` Hongwen Qiu
0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2014-09-25 10:50 UTC (permalink / raw)
To: ntg-context
On 9/25/2014 10:50 AM, Hongwen Qiu wrote:
> 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.
is it context or the binary?
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Latest beta stops loading some ttc fonts
2014-09-25 10:50 ` Hans Hagen
@ 2014-09-26 2:06 ` Hongwen Qiu
2014-09-26 9:50 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Hongwen Qiu @ 2014-09-26 2:06 UTC (permalink / raw)
To: mailing list for ConTeXt users
在 2014年09月25日 18:50, Hans Hagen 写道:
> On 9/25/2014 10:50 AM, Hongwen Qiu wrote:
>> 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.
>
> is it context or the binary?
Don't know which one changed that caused the above example to fail. I
havn't used nsimsun for months, and indeed the above code used to run
properly. Just heard from someone that it works in the current but not
in the beta.
In my opinion, it's much easier to change the context code to fix this
problem (about 2 line lua code), but maybe tweaking with the luatex code
is the way that should be done.
I don't know anything about font format. In the luatex code, a comment
said that PLRM only support ASCII fontnames. I suppose PLRM is short for
PostScript Language Reference. I have a quick glance of the 3rd edition
of PLRM, and only find that fontname have this explanation: "(Optional)
The name of the font. This entry is for information only; it is not
used by the PostScript interpreter. Ordinarily, it is the same as the
key passed
to definefont , but it need not be."
I noticed that font can have multiple fotnames, each for a lang, just as
I posted in the previous message that there're 3 fontnames for index 1
of simsun.ttc. And many other Unicode fonts have non ASCII font names
for lang other than 0 too. Just enable the warning message when loading
font, and I noticed a lot of arabic font in the Linux box have Arabic
font names. So I don't think that context (or luatex) should refuse to
work when font have non-ASCII fontnames.
Currently there're other font related bugs that I'd wish getting fixed too.
I'm currently trying to find out why typesetting with sourcehansanscn
will cause some glyphs to disapper.
e.g. the following code should typeset two glyphs "理" and "论". But the
"理" just get deleted from the output.
\starttypescript [serif] [zhfonts]
\definefontsynonym [Serif] [name:sourcehansanscn]
\stoptypescript
\starttypescript [zhfonts]
\definetypeface [zhfonts] [rm] [serif] [zhfonts]
\stoptypescript
\usetypescript [zhfonts]
\setupbodyfont [zhfonts, rm, 11pt]
\starttext
理论
\stoptext
FYI. this font can display "理", when I use libreOffice. I have no clue
how to debug this problem. So some advice about debugging this kind of
problem is helpful if you're busy to debug the problem. I'd glad to find
out the reason why it won't work myself.
By the way, I belived that something like \definefontsynonym [Serif]
[sourcehansanscn] used to load sourcehansanscn correctly but you must
prefix it with name: now, otherwise it won't load any font.
___________________________________________________________________________________
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
* Re: Latest beta stops loading some ttc fonts
2014-09-26 2:06 ` Hongwen Qiu
@ 2014-09-26 9:50 ` Hans Hagen
0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2014-09-26 9:50 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 9/26/2014 4:06 AM, Hongwen Qiu wrote:
> Don't know which one changed that caused the above example to fail. I
> havn't used nsimsun for months, and indeed the above code used to run
> properly. Just heard from someone that it works in the current but not
> in the beta.
It has to do with the fact that the loader reports an issue. For this
font that report can be ignored. I extended the code that deals with the
report with additional checking so it should work ok with the nexct
beta. We still report the warning, just to be sure.
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-09-26 9:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-25 8:50 Latest beta stops loading some ttc fonts Hongwen Qiu
2014-09-25 10:50 ` Hans Hagen
2014-09-26 2:06 ` Hongwen Qiu
2014-09-26 9:50 ` 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).