Re: [NTG-context] MS Office Chinese fonts in ConTeXt

2017-09-05 Thread Hans Hagen

On 9/5/2017 3:18 AM, Martin Bruchanov wrote:

Hi Hans,

Thank you for your help! I have switched to \usetypescriptfile[mscore].

However, I do not understand one thing, I am using envvar in Linux 
`OSFONTDIR` and all font file names are in upper case. When 
\usetypescriptfile[mscore] is set, ConTeXt cannot find font files, when 
I have renamed all files to lower case, then it works.


If I will query font cache with: `mtxrun --script font --list --all 
--pattern=stsong`, it will return correct path to font file and it does 
not depend on case.


Is it a feature?
indeed, to avoid issues we do lookups in lowercase (often mixed case 
works but is more sensitive to the os)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] MS Office Chinese fonts in ConTeXt

2017-09-05 Thread Henning Hraban Ramm
Am 2017-09-05 um 03:18 schrieb Martin Bruchanov :

> However, I do not understand one thing, I am using envvar in Linux 
> `OSFONTDIR` and all font file names are in upper case. When 
> \usetypescriptfile[mscore] is set, ConTeXt cannot find font files, when I 
> have renamed all files to lower case, then it works.

I had this experience also with other fonts on OSX. Regardless of the spelling 
in my typescripts, fonts were only found if I renamed them to all-lowercase.
I guess the problem is not current any more, but since I use mostly the same 
fonts since years, I’m not sure. No time to check at the moment.

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] MS Office Chinese fonts in ConTeXt

2017-09-04 Thread Martin Bruchanov

Hi Hans,

Thank you for your help! I have switched to \usetypescriptfile[mscore].

However, I do not understand one thing, I am using envvar in Linux 
`OSFONTDIR` and all font file names are in upper case. When 
\usetypescriptfile[mscore] is set, ConTeXt cannot find font files, when 
I have renamed all files to lower case, then it works.


If I will query font cache with: `mtxrun --script font --list --all 
--pattern=stsong`, it will return correct path to font file and it does 
not depend on case.


Is it a feature?

Best regards,

BruXy


On 27/08/17 03:12 PM, Hans Hagen wrote:

Hi,

Attached is a better alternative (just replace the file in the 
distribution).


\usetypescriptfile[mscore]

\setupbodyfont [mschinese,12pt]
\usebodyfont   [mschinese-light,12pt]

\definebodyfontenvironment[24pt]
\definebodyfontenvironment[18pt]

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] MS Office Chinese fonts in ConTeXt

2017-08-27 Thread Hans Hagen

Hi,

Attached is a better alternative (just replace the file in the 
distribution).


\usetypescriptfile[mscore]

\setupbodyfont [mschinese,12pt]
\usebodyfont   [mschinese-light,12pt]

\definebodyfontenvironment[24pt]
\definebodyfontenvironment[18pt]

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
%D \module
%D   [   file=type-imp-mscore,
%Dversion=2007.07.30,
%D  title=\CONTEXT\ Typescript Macros,
%D   subtitle=Microsoft Core Fonts,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\starttypescriptcollection[mscore]

% .ttf not really needed but we want to force the originals

\starttypescript [\s!serif] [mscoretimes] [\s!name]
\setups[\s!font:\s!fallback:\s!serif]
\definefontsynonym [\s!Serif]   [\s!file:times.ttf]   
[\s!features=\s!default]
\definefontsynonym [\s!SerifBold]   [\s!file:timesbd.ttf] 
[\s!features=\s!default]
\definefontsynonym [\s!SerifItalic] [\s!file:timesi.ttf]  
[\s!features=\s!default]
\definefontsynonym [\s!SerifBoldItalic] [\s!file:timesbi.ttf] 
[\s!features=\s!default]
\stoptypescript

\starttypescript [\s!sans] [mscorearial] [\s!name]
\setups[\s!font:\s!fallback:\s!sans]
\definefontsynonym [\s!Sans]   [\s!file:arial.ttf]   
[\s!features=\s!default]
\definefontsynonym [\s!SansBold]   [\s!file:arialbd.ttf] 
[\s!features=\s!default]
\definefontsynonym [\s!SansItalic] [\s!file:ariali.ttf]  
[\s!features=\s!default]
\definefontsynonym [\s!SansBoldItalic] [\s!file:arialbi.ttf] 
[\s!features=\s!default]
\stoptypescript

\starttypescript [\s!sans] [mscorearialnarrow] [\s!name]
\setups[\s!font:\s!fallback:\s!sans]
\definefontsynonym [\s!Sans]   [\s!file:arialn.ttf]   
[\s!features=\s!default]
\definefontsynonym [\s!SansBold]   [\s!file:arialnb.ttf]  
[\s!features=\s!default]
\definefontsynonym [\s!SansItalic] [\s!file:arialni.ttf]  
[\s!features=\s!default]
\definefontsynonym [\s!SansBoldItalic] [\s!file:arialnbi.ttf] 
[\s!features=\s!default]
\stoptypescript

\starttypescript [\s!mono] [mscorecourier] [\s!name]
\setups[\s!font:\s!fallback:\s!mono]
\definefontsynonym [\s!Mono]   [\s!file:cour.ttf]   
[\s!features=\s!none]
\definefontsynonym [\s!MonoBold]   [\s!file:courbd.ttf] 
[\s!features=\s!none]
\definefontsynonym [\s!MonoItalic] [\s!file:couri.ttf]  
[\s!features=\s!none]
\definefontsynonym [\s!MonoBoldItalic] [\s!file:courbi.ttf] 
[\s!features=\s!none]
\stoptypescript

\starttypescript [\s!sans] [mscoreverdana] [\s!name]
\setups[\s!font:\s!fallback:\s!sans]
\definefontsynonym [\s!Sans]   [\s!file:verdana.ttf]  
[\s!features=\s!default]
\definefontsynonym [\s!SansBold]   [\s!file:verdanab.ttf] 
[\s!features=\s!default]
\definefontsynonym [\s!SansItalic] [\s!file:verdanai.ttf] 
[\s!features=\s!default]
\definefontsynonym [\s!SansBoldItalic] [\s!file:verdanaz.ttf] 
[\s!features=\s!default]
\stoptypescript

\starttypescript[mscore]
\definetypeface [\typescriptone] [\s!rm] [\s!serif] [mscoretimes]   
[\s!default]
\definetypeface [\typescriptone] [\s!ss] [\s!sans]  [mscorearial]   
[\s!default] [\s!rscale=0.860]
\definetypeface [\typescriptone] [\s!tt] [\s!mono]  [mscorecourier] 
[\s!default] [\s!rscale=1.065]
\definetypeface [\typescriptone] [\s!mm] [\s!math]  [times] 
[\s!default] [\s!rscale=1.020]
\stoptypescript

\starttypescript[mscorenarrow,mscore-narrow]
\definetypeface [\typescriptone] [\s!rm] [\s!serif] [mscoretimes]   
[\s!default]
\definetypeface [\typescriptone] [\s!ss] [\s!sans]  [mscorearialnarrow] 
[\s!default] [\s!rscale=0.860]
\definetypeface [\typescriptone] [\s!tt] [\s!mono]  [mscorecourier] 
[\s!default] [\s!rscale=1.065]
\definetypeface [\typescriptone] [\s!mm] [\s!math]  [times] 
[\s!default] [\s!rscale=1.020]
\stoptypescript

  % \starttypescript[mscoress]
  % \definetypeface [mscoress] [\s!ss] [\s!sans]  [mscorearial]   
[\s!default]
  % \definetypeface [mscoress] [\s!rm] [\s!serif] [mscoretimes]   
[\s!default] [rscale=1.160]
  % \definetypeface [mscoress] [\s!tt] [\s!mono]  [mscorecourier] 
[\s!default] [rscale=1.240]
  % \definetypeface [mscoress] [\s!mm] [\s!math]  [times] 
[\s!default] 

Re: [NTG-context] MS Office Chinese fonts in ConTeXt

2017-08-27 Thread Hans Hagen

On 8/27/2017 4:17 AM, Martin Bruchanov wrote:

Hi all,

I was trying to create a Chinese document. However, it was quite 
difficult to find actual information and find fonts...


Here is the result:

https://github.com/BruXy/ConTeXt-Chinese

There is still wrong numbering of Tables and I am not sure how to 
convert mschinese.ctex into module, but maybe somebody will help.

These are old fonts yes? Anyway, here is a better typescript:

\starttypescriptcollection[microsoft-chinese-old]

\starttypescript [serif] [mschinese,mschinese-light]
\definefontsynonym [STSong]  [name:STSong] 
[features=chinese]
\definefontsynonym [STKaiti] [name:STKaiti] 
[features=chinese]
\definefontsynonym [STZHongsong] [name:STZHongsong] 
[features=chinese]
\definefontsynonym [STFangsong]  [name:STFangsong] 
[features=chinese]

\stoptypescript

\starttypescript [sans] [mschinese]
\definefontsynonym [STXIHei] [name:STXIHei] [features=chinese]
\stoptypescript

\starttypescript [serif] [mschinese]
\usetypescript[serif][fallback]
\definefontsynonym [Serif]   [STSong]  [features=chinese]
\definefontsynonym [SerifItalic] [STKaiti] [features=chinese]
\definefontsynonym [SerifBold]   [STZHongsong] [features=chinese]
\stoptypescript

\starttypescript [serif] [mschinese-light]
\usetypescript[serif][fallback]
\definefontsynonym [Serif]   [STFangsong]  [features=chinese]
\definefontsynonym [Serif]   [STSong]  [features=chinese]
\definefontsynonym [SerifItalic] [STKaiti] [features=chinese]
\definefontsynonym [SerifBold]   [STZHongsong] [features=chinese]
\stoptypescript

\starttypescript [sans] [mschinese]
\setups[font:fallback:sans]
\definefontsynonym [Sans] [STXIHei] [features=chinese]
\stoptypescript

\starttypescript[mschinese]
\definetypeface [mschinese] [rm] [serif] [mschinese] [default]
\definetypeface [mschinese] [ss] [sans]  [mschinese] [default]
\definetypeface [mschinese] [mm] [math]  [pagella]
\definetypeface [mschinese] [tt] [mono]  [modern]
\stoptypescript

\starttypescript[mschinese-light]
\definetypeface [mschinese] [rm] [serif] [mschinese-light] 
[default]
\definetypeface [mschinese] [ss] [sans]  [mschinese] 
[default]

\definetypeface [mschinese] [mm] [math]  [modern]
\definetypeface [mschinese] [tt] [mono]  [modern]
\stoptypescript

\stoptypescriptcollection

if needed I can add type-imp-windows-chinese.mkiv but we need to be sure 
about the name(s).


In your test you need:


\setupbodyfont [mschinese,12pt]
\usebodyfont   [mschinese-light,12pt]  % preloads

\definebodyfontenvironment[24pt] % prevents messages
\definebodyfontenvironment[18pt] % prevents messages

There is no need to enable utf. Your table now becomes:

\bTABLEbody
\bTR\bTD 华文宋体 \eTD\bTD \tt STSONG.TTF   \eTD\bTD STSong  \eTD\bTD 
\tf  我能吞下玻璃而不伤身体 \eTD \eTR
\bTR\bTD 华文中宋 \eTD\bTD \tt STZHONGS.TTF \eTD\bTD STZhongsong \eTD\bTD 
\bf  我能吞下玻璃而不伤身体 \eTD \eTR
\bTR\bTD 华文细黑 \eTD\bTD \tt STXIHEI.TTF  \eTD\bTD STXihei \eTD\bTD 
\it  我能吞下玻璃而不伤身体 \eTD \eTR
\bTR\bTD 华文楷体 \eTD\bTD \tt STKAITI.TTF  \eTD\bTD STKaiti \eTD\bTD 
\ss  我能吞下玻璃而不伤身体 \eTD \eTR
\bTR\bTD 华文仿宋 \eTD\bTD \tt STFANGSO.TTF \eTD\bTD STFangsong  \eTD\bTD 
\switchtobodyfont[mschinese-light]我能吞下玻璃而不伤身体 \eTD \eTR

\eTABLEbody

There is no need for grouping. You switch to sans with \ss as it's part 
of the typeface specification.


For other issues you need to be more specific

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] MS Office Chinese fonts in ConTeXt

2017-08-26 Thread Martin Bruchanov

Hi all,

I was trying to create a Chinese document. However, it was quite 
difficult to find actual information and find fonts...


Here is the result:

https://github.com/BruXy/ConTeXt-Chinese

There is still wrong numbering of Tables and I am not sure how to 
convert mschinese.ctex into module, but maybe somebody will help.


Regards,

BruXy

PS: It you have some other working Chinese ConTeXt documents, I would be 
happy to get inspired.


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___