From: S Barmeier <severinbarmeier@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: international documents
Date: Mon, 17 Sep 2012 19:29:56 +0900 [thread overview]
Message-ID: <5056FBA4.10907@googlemail.com> (raw)
In-Reply-To: <CAKBDiW6VO8GgW8N3oGf4AV70TczczeUrvrcw=UG5ZUPWx1M9ow@mail.gmail.com>
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
___________________________________________________________________________________
prev parent reply other threads:[~2012-09-17 10:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-17 10:11 Pavel Dohnal
2012-09-17 10:24 ` Marco Patzer
2012-09-17 10:29 ` S Barmeier [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=5056FBA4.10907@googlemail.com \
--to=severinbarmeier@googlemail.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).