ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* international documents
@ 2012-09-17 10:11 Pavel Dohnal
  2012-09-17 10:24 ` Marco Patzer
  2012-09-17 10:29 ` S Barmeier
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Dohnal @ 2012-09-17 10:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

Hello,
I am creating script which generates context source from database
data. Then converts context to pdf and sends it to user. Problem is
that users enter international texts into database and some characters
are not present in final pdf.
Here is my minimal example:

%interface=en translate-file=utf-8
\enableregime[utf]
\starttext
        This is in Japan: 日本, 神奈川県藤沢市藤沢75
\stoptext

Now I run:
context file.tex
But japaneese character are missing in final pdf. You can see in
attached file. Is there a way how to create documents which can be
writen in any international language?
Thanks for your help
  Pavel Dohnal

[-- Attachment #2: c.pdf --]
[-- Type: application/pdf, Size: 5561 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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] 3+ messages in thread

* Re: international documents
  2012-09-17 10:11 international documents Pavel Dohnal
@ 2012-09-17 10:24 ` Marco Patzer
  2012-09-17 10:29 ` S Barmeier
  1 sibling, 0 replies; 3+ messages in thread
From: Marco Patzer @ 2012-09-17 10:24 UTC (permalink / raw)
  To: ntg-context

2012-09-17 Pavel Dohnal <pavel.dohnal@twobits.cz>:

Hi Pavel

> Problem is that users enter international texts into database and
> some characters are not present in final pdf.
> Here is my minimal example:
> 
> %interface=en translate-file=utf-8
> \enableregime[utf]

ConTeXt MkIV uses UTF-8 by default.

> \starttext
>         This is in Japan: 日本, 神奈川県藤沢市藤沢75
> \stoptext
> 
> Now I run:
> context file.tex
> But japaneese character are missing in final pdf. You can see in
> attached file. Is there a way how to create documents which can be
> writen in any international language?

The font Latin Modern does not contain the Japanese characters. Use
a font that covers the range you need.


Marco

___________________________________________________________________________________
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] 3+ messages in thread

* Re: international documents
  2012-09-17 10:11 international documents Pavel Dohnal
  2012-09-17 10:24 ` Marco Patzer
@ 2012-09-17 10:29 ` S Barmeier
  1 sibling, 0 replies; 3+ messages in thread
From: S Barmeier @ 2012-09-17 10:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 09/17/2012 07:11 PM, Pavel Dohnal wrote:
> Hello,
> I am creating script which generates context source from database
> data. Then converts context to pdf and sends it to user. Problem is
> that users enter international texts into database and some characters
> are not present in final pdf.
> Here is my minimal example:
> 
> %interface=en translate-file=utf-8
> \enableregime[utf]
> \starttext
>         This is in Japan: 日本, 神奈川県藤沢市藤沢75
> \stoptext
> 
> Now I run:
> context file.tex
> But japaneese character are missing in final pdf. You can see in
> attached file. Is there a way how to create documents which can be
> writen in any international language?

You need to load a font which contains Japanese characters. In order to
create documents, which can be written in any international language,
you need to make a typescript, which loads fonts for all languages (if
that is really what you want).

You can specify what Unicode range should be typeset in what font...

Here is a typescript I used for a Japanese document, which also
contained Korean Hangul, Vietnamese and the International Phonetic
Alphabet. You can use it as a reference.

--> type-mytypescript.mkiv <--

\definefontfeature[jpdefault][mode=node,script=latn,lang=jan,protrusion=pure,expansion=quality]
\definefontfeature[hz][default][protrusion=pure,mode=node,script=latn]

\def\mydefaultfeatures{kern=yes;liga=yes;tlig=yes;trep=yes}

% Vietnamese					0x1EA0-0x1EF9
% Phonetic Ext					0x1D00-0x1D7F
% Korean Hangul				0xAC00-0xD7A3

\definefontfallback[serifwhatever]			
[GenR102.ttf:\mydefaultfeatures]
[0x0000-0x0400,0x1EA0-0x1EF9,0x1D00-0x1D7F]	[force=yes]
\definefontfallback[serifwhatever]			
[UnBatang.ttf:\mydefaultfeatures][0xAC00-0xD7A3]	[force=yes]
\definefontfallback[serifwhatever]			
[AdobeSongStd-Light.otf:\mydefaultfeatures][0x35C2,0x5987,0x7535,0x4E50,0x98CE,0x957F,0x9A6C][force=yes]
\definefontfallback[serifboldwhatever]		
[GenBasB.ttf:\mydefaultfeatures]	[0x0000-0x0400]	[force=yes]
\definefontfallback[serifitalicwhatever]	
[GenI102.ttf:\mydefaultfeatures]	[0x0000-0x0400]	[force=yes]
\definefontfallback[serifbolditalicwhatever]
[GenBasBI.ttf:\mydefaultfeatures][0x0000-0x0400]	[force=yes]
\definefontfallback[sanswhatever]	 		
[Andika-R.ttf:\mydefaultfeatures]	[0x0000-0x0400]	[force=yes]

\starttypescript[serif][IPAexMincho]
\definefontsynonym [ipaexmincho]	 [ipaexm.ttf]
[features=jpdefault,fallbacks=serifwhatever]
\definefontsynonym [ipaexminchobold]	 [ipaexm.ttf]
[features=krdefault,fallbacks=serifboldwhatever]
\definefontsynonym [ipaexminchoitalic]	 [ipaexm.ttf]
[features=krslanted,fallbacks=serifitalicwhatever]
\definefontsynonym [ipaexminchobolditalic] [ipaexm.ttf]
[features=krslanted,fallbacks=serifbolditalicwhatever]
\stoptypescript
\starttypescript [serif][IPAexMincho][name]
\definefontsynonym[Serif]	 [ipaexmincho]
\definefontsynonym[SerifBold]	 [ipaexminchobold]
\definefontsynonym[SerifItalic]	 [ipaexminchoitalic]
\definefontsynonym[SerifBoldItalic]	 [ipaexminchobolditalic]
\stoptypescript
\starttypescript[sans][IPAexGothic]
\definefontsynonym[ipaexgothic]	 [ipaexg.ttf]
[features=jpdefault,fallbacks=sanswhatever]
\stoptypescript
\starttypescript[sans][IPAexGothic][name]
\definefontsynonym[Sans]	 [ipaexgothic]
\stoptypescript
\starttypescript[mono][KanjiStrokeOrders]
\definefontsynonym[kanjistrokeorders]	 [KanjiStrokeOrders_v2.016.ttf]
[features=jpdefault]
\stoptypescript
\starttypescript[mono][KanjiStrokeOrders][name]
\definefontsynonym[Mono]	 [kanjistrokeorders]
\stoptypescript
\starttypescript[MyIPAex]
\definetypeface[Myface]	[rm]	[serif]	[IPAexMincho]			[default]
[features=punctuation]
\definetypeface[Myface]	[ss]	[sans]	[IPAexGothic]			[default]
\definetypeface[Myface]	[tt]	[mono]	[KanjiStrokeOrders]	[default]
[rscale=0.9]
\stoptypescript

--> END type-mytypescript.mkiv <--

--> file.tex <--

\usetypescriptfile[mytypescript]
\usetypescript[MyIPAex]
\definebodyfontenvironment[12pt]
\setupbodyfont[Myface,rm,12pt]
\starttext

Place your text here.

\stoptext

--> END file.tex <--

Good luck.
Severin
___________________________________________________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2012-09-17 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-17 10:11 international documents Pavel Dohnal
2012-09-17 10:24 ` Marco Patzer
2012-09-17 10:29 ` S Barmeier

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).