Open main menu

Changes

m
Explanation of the paperSize variable used in lua
< [[Fonts]] | [[Encodings and Regimes]] >=Setup for Japanese=
* old introduction [[Uptodate]] by Pragma: [http://www.pragma<texcode>% 2024-ade02 Otared Kavian, Jeong Dal et al.com/general/uptodate/up-007-s.pdf screen] and [http://www.pragma-ade.com/general/uptodate/up-007-p.pdf paper] version* manual by Pragma: \mainlanguage[http://www.pragma-ade.com/general/manuals/mchinese.pdf Chinese in ConTeXtja]
\definefontfamily[JapaneseFont][rm][Noto Serif JP]
[ it={style:regular,features:{*,slanted}},
sl={style:regular,features:{*,slanted}},
bi={style:bold,features:{*,slanted}},force=yes]
Xiao Jianfeng wrote in a mail to the mailing list on 2005-06-06\definefontfamily[JapaneseFont][ss][Noto Serif JP] [ it={style:regular,features:{*,slanted}}, sl={style:regular,features:{*,slanted}}, bi={style:bold,features:{*,slanted}},force=yes]
Here is my way of Chinese setup in ConTeXt. I hope this can be of any help to some newbies like me who have problems in processing Chinese.\definefontfamily[JapaneseFont][tt][Noto Serif JP] [ it={style:regular,features:{*,slanted}}, sl={style:regular,features:{*,slanted}}, bi={style:bold,features:{*,slanted}},force=yes]
# Get the truetype fonts \definefontfamily[JapaneseFont][math][Tex Gyre Termes Math]%\definefontfamily[JapaneseFont][math][Tex Gyre Pagella Math]%\definefontfamily[JapaneseFont][math][Tex Gyre Aventor] %%%% \setupbodyfont[JapaneseFont,12pt]\setupruby[location=top,voffset=-2ex]\setupwhitespace[big]\setscript[nihongo] \starttext\ruby{早}{はや}く。いきましょう。\stoptext<tt/texcode>[ftp ==Meeting the JIS X 4051 Requirements for Japanese Text Layout==The actual standard was revised in 2004 and the latest version is JIS X 4051:2004. You can read it in Japanese here: https://ftpkikakurui.com/x4/X4051-2004-02.ctexhtml  The W3C technical note "Requirements for Japanese Text Layout", published on 4 June 2009, is based on JIS X 4051.orgThis is also available in English: https:/pub/texwww.w3.org/fontsTR/truetypejlreq/ttf/htfs Following code is a work in progress.ttf htfsIts text layout output meets already some of the requirements (see comments in the code).ttf], [ftpAmong the ones to still be implemented are:* solid setting (no extra spacing between characters) https://ftpwww.ctexw3.org/pubTR/jlreq/#fig1_8 if no requirement for line-adjustment https:/tex/fontswww.w3.org/truetypeTR/ttfjlreq/hthei#term.ttf hthei.ttf], [ftpline-adjustment* aligning of the lines to the Kihon-hanmen (optimizing the code below in this regard)* positioning and realm of headings https://ftpwww.ctexw3.org/pubTR/texjlreq/fonts#fig3_1_9 https:/truetype/ttf/htkaiwww.ttf htkaiw3.ttf]<org/TR/jlreq/tt> #fig3_1_15 et al, and <tt>[ftphttps://ftpwww.ctexw3.org/pub/texTR/fontsjlreq/truetype#fig3_1_4* positioning of yokugo-ruby https:/ttf/htsongwww.ttf htsongw3.ttf]<org/TR/jlreq/tt> from ftp#fig2_3_24* inline cutting note (warichu) https://ftpwww.ctexw3.org/pubTR/jlreq/#fig2_4_1* emphasis with sesame dot or bullet* itemization https:/tex/fontswww.w3.org/truetypeTR/ttfjlreq/#fig2_5_6# Get corresponding tfm files <tt>[ftp* indenting of quotation paragraphs https://ftpwww.ctexw3.org/pubTR/jlreq/tex#fig2_5_7* tab setting https:/fonts/truetypewww.w3.org/for_pdftexTR/tfmjlreq/gbfs.zip gbfs.zip], [ftp#fig2_6_1* furiwake https://ftpwww.ctexw3.org/pubTR/jlreq/tex#fig2_7_2* jidori https:/fonts/truetypewww.w3.org/for_pdftexTR/tfmjlreq/gbhei.zip gbhei.zip], [ftp#fig2_7_4* math https://ftpwww.ctexw3.org/pubTR/texjlreq/#fig2_7_6 and https:/fonts/truetypewww.w3.org/for_pdftexTR/tfmjlreq/gbkai#fig2_7_62* tategaki (writing vertically) When you read the lua code in the first <code>\directlua{}</code>, you should realize that the dimensions of almost all layout elements are depending on the value of my lua variable "paperSize". Thanks to defining the paper size first in lua, I can apply calculations of numeric values.zip gbkai The value of paperSize is later passed on to <code>\setuppapersize</code> via <code>\setuppapersize[\directlua{tex.zipprint(paperSize)}]</ttcode> and  <tttexcode>%Visual Debugging, to be commented out later:%\showframe %shows the layout elements%\showgrid %shows the line numbering%\showmakeup[ftp://ftppenalty] %shows characters for which specific breaking line rules apply%\showmakeup[glyph] %shows the box of each character %Define the elements of Kihon-hanmen. %Line length should be multiples of the character size.%Following dimensions are taken from JIS X 4051, annex 3, cases Y-1 to Y-4. Just change value (A4, A5, B5, B6) for paperSize to switch between the cases. \directlua{unit = "pt" paperSize = "B5" characterSizeNumeric = 9 if paperSize == "A4" or paperSize == "A5" or paperSize == "B5" then characterSizeNumeric = 9elseif paperSize == "B6" then characterSizeNumeric = 8endcharacterSize = tostring(characterSizeNumeric) .. unit characterCountPerColumn = 25 if paperSize == "A4" then characterCountPerColumn = 25elseif paperSize == "B5" then characterCountPerColumn = 22elseif paperSize == "A5" or paperSize == "B6" then characterCountPerColumn = 34end columnCount = 2 if paperSize == "A4" or paperSize == "B5" then columnCount = 2elseif paperSize == "A5" or paperSize == "B6" then columnCount = 1end lineCount = 46 if paperSize == "A4" then lineCount = 46elseif paperSize == "B5" then lineCount = 40elseif paperSize == "A5" then lineCount = 29elseif paperSize == "B6" then lineCount = 27end lineSpacingNumeric = 6 if paperSize == "A4" or paperSize == "B5" then lineSpacingNumeric = 6elseif paperSize == "A5" or paperSize == "B5" then lineSpacingNumeric = 7end columnGapNumeric = 18columnGap = tostring(columnGapNumeric) .. unit headerFooterHeightNumeric = characterSizeNumericheaderFooterHeight = tostring(headerFooterHeightNumeric) .. unit headerFooterDistanceNumeric = characterSizeNumericheaderFooterDistance = tostring(headerFooterDistanceNumeric) .. unit lineFeedNumeric = characterSizeNumeric + lineSpacingNumericlineFeed = tostring(lineFeedNumeric) .. unit lineWidthNumeric = characterSizeNumeric * characterCountPerColumn kihonHanmenWidthNumeric = columnCount * lineWidthNumeric + (columnCount - 1) * columnGapNumerickihonHanmenWidth = tostring(kihonHanmenWidthNumeric) ..ctexunit backSpaceNumeric = (597.org5079 - kihonHanmenWidthNumeric) /pub2if paperSize == "A4" then backSpaceNumeric = (597.5079 - kihonHanmenWidthNumeric) /tex2elseif paperSize == "B5" then backSpaceNumeric = (500.7685 - kihonHanmenWidthNumeric) /fonts2elseif paperSize == "A5" then backSpaceNumeric = (421.1008 - kihonHanmenWidthNumeric) /truetype2elseif paperSize == "B6" then backSpaceNumeric = (355.6594 - kihonHanmenWidthNumeric) /for_pdftex2endbackSpace = tostring(backSpaceNumeric) .. unit kihonHanmenHeightNumeric = lineCount * characterSizeNumeric + (lineCount - 1) * lineSpacingNumerickihonHanmenHeight = tostring(kihonHanmenHeightNumeric) .. unit makeUpHeightNumeric = kihonHanmenHeightNumeric + 2 * headerFooterHeightNumeric + 2 * headerFooterDistanceNumericmakeUpHeight = tostring(makeUpHeightNumeric) .. unit topMarginNumericMm = 29topMarginNumeric = 2.8346 * topMarginNumericMmtopSpaceNumeric = topMarginNumeric - headerFooterHeightNumeric - headerFooterDistanceNumericif paperSize == "A4" then topMarginNumericMm = 29 topMarginNumeric = 2.8346 * topMarginNumericMm topSpaceNumeric = topMarginNumeric - headerFooterHeightNumeric - headerFooterDistanceNumericelseif paperSize == "B5" then topSpaceNumeric = (711.3189 - kihonHanmenHeightNumeric - 2 * (headerFooterDistanceNumeric + headerFooterHeightNumeric))/tfm2elseif paperSize == "A5" then topMarginNumericMm = 25 topMarginNumeric = 2.8346 * topMarginNumericMm topSpaceNumeric = topMarginNumeric - headerFooterHeightNumeric - headerFooterDistanceNumericelseif paperSize == "B6" then topSpaceNumeric = (500.7685 - kihonHanmenHeightNumeric - 2 * (headerFooterDistanceNumeric + headerFooterHeightNumeric))/gbsong2endtopSpace = tostring(topSpaceNumeric) ..zip gbsongunit} \setuppapersize[\directlua{tex.zipprint(paperSize)}] \setuppagenumbering [alternative=doublesided, location=none] \setuphead [title,subject] [align=middle] \startsetups [header:rightpage]  \startframed [ frame=off, strut=no, height=\headerheight, offset=none, align=low, roffset=1em, ]  \getmarking[subject]  \stopframed \stopsetups \startsetups [header:leftpage]  \startframed [ frame=off, strut=no, height=\headerheight, offset=none, align=low, loffset=1em, ]  \getmarking[title]  \stopframed \stopsetups \startsetups [footer:rightpage]  \startframed [ frame=off, strut=no, height=\headerheight, offset=none, align=low, roffset=1em, ]  \prefixedpagenumber  \stopframed \stopsetups \startsetups [footer:leftpage]  \startframed [ frame=off, strut=no, height=\headerheight, offset=none, align=low, loffset=1em, ]  \prefixedpagenumber  \stopframed \stopsetups \setupheadertexts [] [\directsetup{header:rightpage}] [\directsetup{header:leftpage}] [] \setupfootertexts [] [\directsetup{footer:rightpage}] [\directsetup{footer:leftpage}] [] \setupheader [strut=no] \setupfooter [strut=no] \setuplayout[ topspace=\directlua{tex.print(topSpace)}, header=\directlua{tex.print(headerFooterHeight)}, headerdistance=\directlua{tex.print(headerFooterDistance)}, footer=\directlua{tex.print(headerFooterHeight)}, footerdistance=\directlua{tex.print(headerFooterDistance)}, width=\directlua{tex.print(kihonHanmenWidth)}, height=\directlua{tex.print(makeUpHeight)}, backspace=\directlua{tex.print(backSpace)}, ]  \definebodyfontenvironment[\directlua{tex.print(characterSize)}] \setupinterlinespace [line=\directlua{tex.print(lineFeed)}, height=0.56, %Necessary for aligning the lines to the Kihon-hanmen. Aligning is still not perfect yet, needs to be improved. depth=0.44, %Necessary for aligning the lines to the Kihon-hanmen. Aligning is still not perfect yet, needs to be improved. ] \definepagecolumns[mycolumns][ n=\directlua{tex.print(columnCount)}, distance=\directlua{tex.print(columnGap)}, %frame=on, %to be commented out later framecolor=blue, rulethickness=.1pt, ] \definefontfeature [default] [default] [protrusion=pure] %needed for protrusion of full stops and commas. %%% Noto Fonts \definefontfamily[JapaneseFont][rm][Noto Serif JP] [ it={style:regular,features:{*,slanted}}, sl={style:regular,features:{*,slanted}}, bi={style:bold,features:{*,slanted}},force=yes] \definefontfamily[JapaneseFont][ss][Noto Serif JP] [ it={style:regular,features:{*,slanted}}, sl={style:regular,features:{*,slanted}}, bi={style:bold,features:{*,slanted}},force=yes] \definefontfamily[JapaneseFont][tt][Noto Serif JP] [ it={style:regular,features:{*,slanted}}, sl={style:regular,features:{*,slanted}}, bi={style:bold,features:{*,slanted}},force=yes] \definefontfamily[JapaneseFont][math][Tex Gyre Termes Math]  \setupbodyfont[JapaneseFont,\directlua{tex.print(characterSize)}]\setupalign [hanging] %needed for protrusion of full stops and commas\setupruby[location=top,voffset=-1.9ex]\mainlanguage[ja]\language[ja]\setscript[nihongo] %this loads the line breaking rules defined under scrp-cjk.lua %\setupruby% [style={\switchtobodyfont[6pt]}] %Line head indent at the beginning of paragraphs is applied to all paragraphs. Nearly all books and magazines make use of this method.\setupindenting[yes, 1em] \starttext \startmycolumns\starttitle [title={ス位心}]  \startsubject [title={ワソ多}] %The text has no meaning and is imitating some Japanese lorum ipsum.打構セト読役いゆお及層\ruby{僕}{ぼく}はもう大コモクカ軟毎ホアヲト極書た球87本野ぎレべ襲画売ぎ関負ら断紀チラネキ質、紋キタ資私トゃふん。江コキトサ狂毎現ンづ応通サシ続36島性84界ぼゆゃが実書ちぽふず辞躍【事シ世図二ハス盛堀\ruby{早}{はや}く人わレをう第紙きかイの浅69乳キメタ事争つょお\ruby{休}{やす}みなさい社以ヨナム法例やほにル済療にしいむ。子け記多ゅくよ正役モ母憲ト\ruby{寝}{ね}る。ぞ説帝け務賞ク付打ワナ内桁ぼでクフ因倒おふフ印気地レタケマ冬4雇各裁微ひるぼ。 事ーやずお両遇ほがお職喜じきちそ経岡ウナオケ型児てきろ置実イハ隊留社びか車斉ムマ数今せぴさし都{聞最へぼう康自コミニク月言ム検代捕ぶねやう。6本うげがぎ無多シワソ多転のづが加分がど臣次オモエヱ務教すそ必組テタレソhello, nice to meet you極渡げフ資聞ぽへトづ禁昔キイウニ食度地ヱ考性ユエ内生ヱセ音94党と経陸咲幼勤りだフ。83男融録ょもな氷社くにルべ害変でおけう変世7超キ減安リヌ株崎5転理済ほだをな黒府 $a+b=b+a$ コワスソ地賢堂衛イぶにし。 広げがぴ視立ス位心もスわ止想ツクケラ産竹聞ヌ落38判境ノア賞7写カチ華供ソミワ名認ばゆずほ始色らふひも属対73写けで止突兄呂びの。策イルリヘ行十織キヘ興必む万初ゃづは勝米い館独ム感一チヒナ希8写タムシイ室情づがい焼殺つか広質トクロ毎新ソモ患関済えめね働表め白告こリあ杯困摘屈裂れ。 名テホユ稿国む生覧ヨナケヤ文6垣めこル社2市むあし保止転済ノ問判りッ集員セワ全宣コ森領で温子う。ラちぎ夏査せすむ来資ニ面三わぼ際6之減喰杜き。堂ヲ賞了かえー単惑イめ秋投クツ意拡平ヘタヱ時83死れる互武ぽほ拉51届ニネラヘ掲団ヨ度両議ク。状親日値ル断大示ヘニコク米界を連禁イが性正ルッ問句サルユ試片サロヤ前毎到くぜ黄雑らりえ報同ょきむ督晴岡確たごげむ。 両おぎゅら写合ル書殖だインぎ孝自氷ばぞひ事権ウノレヲ少止ヲマヨミ惑磁ぞくゅ竹月おやま手51質サム付2仏い職断年にーばざ場現ムワホ襲印講行否えうご。5帰7報ク用講ルのよす媛表サシメマ札変ナヲ案積出ソトマセ決情注モハイ際県らぶドご食績どはあだ徳増フシ断県ぼね了件親億かゆ。申府ホ線全る訪親ケヒネ芸比歳よをづう供記モケ正同とき練1紀ゅくふい割市ざ著法べちめせ客答ヤヌキオ入朗ルヌカス況写天境月郎ろたづ。 想ネシモヤ人時ワ化新リぱイこ京希っじ索視ケア風月受マカ東初ぞ月公て無速だ文保か受4香刃尿憎潔だクばづ。果テカ川程イ相安べろ方4映チ米闘ヤタレ会民クをづい治果とルせ字社かイよ新軍こ持芸ワラウケ掲三58治館壌ゃ。行びまむ快野分真タネス応住えじで半記キネト正6者理ぼあ面出ヱシレワ慎首レトアハ託展オ良育圏ーを申傷説ひよもぶ索構を持試奇拝括ぱふ。 \stopsubject \startsubject [title={覧ロヨヤ}] 写みを参念タ三辞よルさき想3込ぜトリ会図ロ法部じち之杉ぎば厳近ワオコ光傷治ワ整区童熊習本さはリん。一ナカヒハ経松隊整キメケト需湖モユエウ秘千そ含覧ふリさ挙言ねをク凍誉ょい利際ゃぼの織用ユリル育4緊ご選1面とし胃危雪異みのひき。竹品ハ著供うげル、島該ょ城豊ぎすご腹独べじり皆5座わーう化著式サマ木陸ミレノ義軍80鯨ヒキトフ読大フニノネ読覧ロヨヤイ投時ょうす都活きっみざ。 上なラ済経ロ有実マ乳装ざなぴま武1守い掲6町ぼ禁28担惑らばんフ社策送案物んまへ。人際クょゃね験伝め念変クマヌ白馳ナツエヤ著側ッごフぞ済川さ趣載ツア挙85適クウネレ稿並ドむわの論棋ナソスヒ教伎締潤革フ。球尊話者が心三いむり達尼スか町過ミタオ上止ワカヤ正着ざぱぎぼ失成行偽ワマヘ北奮く。 済開ぼスじと力紹オア手混チコ成意コテモケ定因ド情最どいとづ写今えりめ問景ルオフチ度自す作12行トヱワ録消ひイ。縦右で後賞たじつド諸場後し面詐でばト題社のれふた」。年結すたぜじ下労リえたゅ高作セレテ給5山ワ任共ご京前ミレシ本写午吉活ぽし。播るせ部3席ヒ投揮ぴしんけ安図んき同更展将ごさぽ画9用サキ購21十ツヘト京締乱僕ろ。 図ラ象45韓ど考小ヌニ野初ムユイシ河止中ヤトキヒ巻女ッ除稿イ輔余た研弔カ被悪テヘ業購ヘタ詳支ルれ身日だがん出療ずー盛趣なばぐ離女放佳怖れずへ。理じかぐ討15枠制8五袋ヒク選会ソアシカ主手付みとこ猪月メ語経マオヱミ社接フセユア幌財ー香口衆ンろ著瀬なこン身個供悪射窃どスあ。切テセ重購ニホ覧権じゆむげ影文ヒヘ相断66哉ノホテフ黒植くね氏員更あきぱゆ文記ふわひ載更上ぜいひば。 打構セト読役いゆお及層\ruby{僕}{ぼく}はもう大コモクカ軟毎ホアヲト極書た球87本野ぎレべ襲画売ぎ関負ら断紀チラネキ質、紋キタ資私トゃふん。江コキトサ狂毎現ンづ応通サシ続36島性84界ぼゆゃが実書ちぽふず辞躍事シ世図二ハス盛堀\ruby{早}{はや}く人わレをう第紙きかイの浅69乳キメタ事争つょお\ruby{休}{やす}みなさい社以ヨナム法例やほにル済療にしいむ。子け記多ゅくよ正役モ母憲ト\ruby{寝}{ね}る。ぞ説帝け務賞ク付打ワナ内桁ぼでクフ因倒おふフ印気地レタケマ冬4雇各裁微ひるぼ。 事ーやずお両遇ほがお職喜じきちそ経岡ウナオケ型児てきろ置実イハ隊留社びか車斉ムマ数今せぴさし都聞最へぼう康自コミニク月言ム検代捕ぶねやう。6本うげがぎ無多シワソ多転のづが加分がど臣次オモエヱ務教すそ必組テタレソhello, nice to meet you極渡げフ資聞ぽへトづ禁昔キイウニ食度地ヱ考性ユエ内生ヱセ音94党と経陸咲幼勤りだフ。83男融録ょもな氷社くにルべ害変でおけう変世7超キ減安リヌ株崎5転理済ほだをな黒府コワスソ地賢堂衛イぶにし。 広げがぴ視立ス位心もスわ止想ツクケラ産竹聞ヌ落38判境ノア賞7写カチ華供ソミワ名認ばゆずほ始色らふひも属対73写けで止突兄呂びの。策イルリヘ行十織キヘ興必む万初ゃづは勝米い館独ム感一チヒナ希8写タムシイ室情づがい焼殺つか広質トクロ毎新ソモ患関済えめね働表め白告こリあ杯困摘屈裂れ。 名テホユ稿国む生覧ヨナケヤ文6垣めこル社2市むあし保止転済ノ問判りッ集員セワ全宣コ森領で温子うラちぎ夏査せすむ来資ニ面三わぼ際6之減喰杜き。堂ヲ賞了かえー単惑イめ秋投クツ意拡平ヘタヱ時83死れる互武ぽほ拉51届ニネラヘ掲団ヨ度両議ク。状親日値ル断大示ヘニコク米界を連禁イが性正ルッ問句サルユ試片サロヤ前毎到くぜ黄雑らりえ報同ょきむ督晴岡確たごげむ。 両おぎゅら写合ル書殖だインぎ孝自氷ばぞひ事権ウノレヲ少止ヲマヨミ惑磁ぞくゅ竹月おやま手51質サム付2仏い職断年にーばざ場現ムワホ襲印講行否えうご。5帰7報ク用講ルのよす媛表サシメマ札変ナヲ案積出ソトマセ決情注モハイ際県らぶドご食績どはあだ徳増フシ断県ぼね了件親億かゆ。申府ホ線全る訪親ケヒネ芸比歳よをづう供記モケ正同とき練1紀ゅくふい割市ざ著法べちめせ客答ヤヌキオ入朗ルヌカス況写天境月郎ろたづ。 想ネシモヤ人時ワ化新リぱイこ京希っじ索視ケア風月受マカ東初ぞ月公て無速だ文保か受4香刃尿憎潔だクばづ。果テカ川程イ相安べろ方4映チ米闘ヤタレ会民クをづい治果とルせ字社かイよ新軍こ持芸ワラウケ掲三58治館壌ゃ。行びまむ快野分真タネス応住えじで半記キネト正6者理ぼあ面出ヱシレワ慎首レトアハ託展オ良育圏ーを申傷説ひよもぶ索構を持試奇拝括ぱふ。 写みを参念タ三辞よルさき想3込ぜトリ会図ロ法部じち之杉ぎば厳近ワオコ光傷治ワ整区童熊習本さはリん。一ナカヒハ経松隊整キメケト需湖モユエウ秘千そ含覧ふリさ挙言ねをク凍誉ょい利際ゃぼの織用ユリル育4緊ご選1面とし胃危雪異みのひき。竹品ハ著供うげル島該ょ城豊ぎすご腹独べじり皆5座わーう化著式サマ木陸ミレノ義軍80鯨ヒキトフ読大フニノネ読覧ロヨヤイ投時ょうす都活きっみざ。 \stopsubject \startsubject [title={が心三いむ}] 上なラ済経ロ有実マ乳装ざなぴま武1守い掲6町ぼ禁28担惑らばんフ社策送案物んまへ。人際クょゃね験伝め念変クマヌ白馳ナツエヤ著側ッごフぞ済川さ趣載ツア挙85適クウネレ稿並ドむわの論棋ナソスヒ教伎締潤革フ。球尊話者が心三いむり達尼スか町過ミタオ上止ワカヤ正着ざぱぎぼ失成行偽ワマヘ北奮く。 済開ぼスじと力紹オア手混チコ成意コテモケ定因ド情最どいとづ写今えりめ問景ルオフチ度自す作12行トヱワ録消ひイ。縦右で後賞たじつド諸場後し面詐でばト題社のれふた」。年結すたぜじ下労リえたゅ高作セレテ給5山ワ任共ご京前ミレシ本写午吉活ぽし。播るせ部3席ヒ投揮ぴしんけ安図んき同更展将ごさぽ画9用サキ購21十ツヘト京締乱僕ろ。 図ラ象45韓ど考小ヌニ野初ムユイシ河止中ヤトキヒ巻女ッ除稿イ輔余た研弔カ被悪テヘ業購ヘタ詳支ルれ身日だがん出療ずー盛趣なばぐ離女放佳怖れずへ。理じかぐ討15枠制8五袋ヒク選会ソアシカ主手付みとこ猪月メ語経マオヱミ社接フセユア幌財ー香口衆ンろ著瀬なこン身個供悪射窃どスあ。切テセ重購ニホ覧権じゆむげ影文ヒヘ相断66哉ノホテフ黒植くね氏員更あきぱゆ文記ふわひ載更上ぜいひば。 \stopsubject \stoptitle \stopmycolumns  %\showlayout %for Debugging, to be commented out later \stoptext</tttexcode> from ftp =Setup for Chinese= Get inspirated with importing Chinese fonts with this [https://ftpgithub.ctex.orgcom/pubBruXy/texConTeXt-Chinese script]. # You need some Chinese (TrueType) fonts; you may want to get for example Microsoft Truetype fonts:## [http:/fonts/truetypearchive1.village.virginia.edu/for_pdftexspw4s/tfmfonts/STSONG.TTF STSong],# Get the enc file <tt># [ftphttp://ftparchive1.village.ctexvirginia.orgedu/pub/texspw4s/fonts/truetype/for_pdftex/enc_map/Gbk.zip GbkSTZHONGS.zipTTF STZhongsong]</tt> from ftp,## [http://ftparchive1.ctexvillage.orgvirginia.edu/pub/texspw4s/fonts/truetype/for_pdftex/enc_map/STXIHEI.TTF STXihei],# Get the map file <tt># [ftphttp://ftparchive1.village.ctexvirginia.orgedu/pub/texspw4s/fonts/truetype/for_pdftex/enc_map/map.zip mapSTKAITI.zipTTF STKaiti]</tt> from ftp,## [http://ftparchive1.village.ctexvirginia.org/pubedu/texspw4s/fonts/truetype/for_pdftex/enc_map/STFANGSO.TTF STFangsong].# Put the ttf font files you got in step 1 to Example of some basic document with enabled Chinese: <tttexcode>texmf\mainlanguage[cn]\language[cn]\setscript[hanzi] % hyphenation % Enable fonts\usetypescriptfile[mscore]\setupbodyfont [mschinese,12pt]\usebodyfont [mschinese-fonts/fonts/truetype/light,12pt]\definebodyfontenvironment[24pt]\definebodyfontenvironment[18pt] \setuppagenumber [numberconversion=cn]\definestructureconversionset[chinese][numbers][cn]\setupheads [sectionconversionset=chinese</tt>] \define[2]\ChineseChapter{第#1章 # Unzip the files you got in step 2 and you get four corresponding directories (which contain tfm files)}\setuphead[chapter][command=\ChineseChapter,style={\bf\switchtobodyfont[24pt]}]\setuphead[section][style={\bf\switchtobodyfont[18pt]}] \setuppagenumbering[state=start, alternative=singlesided, location={footer, center}, then put them style={\bf\switchtobodyfont[11pt]}] \starttext\chapter{华文字体系列} in <tt>texmf-fonts/fonts/tfm/chinese</tt># Unzip <tt>Gbk.zip</tt>在微软提供的 Office 套装中附带了一定数量的中文字体, you will get a directory named <tt>Gbk这些字体是常州华文印刷新技术有限公司制造的。 \startitemize\item \type{\it}: {\it 华文仿宋}\item \type{\rm}: {\rm 华文仿宋}\item \type{\bf}: {\bf 华文中宋}\item \type{\ss}: {\ss 华文细黑}\item \type{\tfxx}: {\tfxx 华文仿宋}\item \type{\tfx}: {\tfx 华文仿宋}\item \type{\tf}: {\tf 华文仿宋}\item \type{\tfa}: {\tfa 华文仿宋}\item \type{\tfb}: {\tfb 华文仿宋}\item \type{\tfc}: {\tfc 华文仿宋}\item \type{\tfd}: {\tfd 华文仿宋}\stopitemize\stoptext</tttexcode>  =Setup for Korean= You need fonts which contains many enc files. Put contain hangul characters (don’t forget to set a math font because it is used for the directory symbols in enumerations) and you have to enable linebreaking for Korean with the {{cmd|setscript}} command. <tttexcode>texmf% Wolfgang Schuster 2017-fonts/fonts/enc/chinese</tt>12-06\mainlanguage[kr] \definefallbackfamily [mainface] [rm] [Nanum Myeongjo] [preset=range:korean]\definefontfamily [mainface] [rm] [DejaVu Serif] \definefallbackfamily [mainface] [ss] [Nanum Gothic] [preset=range:korean]\definefontfamily [mainface] [ss] [DejaVu Sans] # Unzip <\definefallbackfamily [mainface] [tt>map.zip</tt>] [Nanum Gothic Coding] [features=none, you will get many map files, you need just the <preset=range:korean]\definefontfamily [mainface] [tt>gbk] [DejaVu Sans Mono] [features=none] \definefontfamily [mainface] [mm] [DejaVu Math] \setupbodyfont[mainface] \setscript[hangul] \starttext 이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로모아 엮어졌습니다.map</tt> {\ss 이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로모아 엮어졌습니다. You need to edit <tt>gbk} \starttyping이 FAQ 은 자주 반복되는 질문과 그에 대한 대답을 간단명료한 양식으로모아 엮어졌습니다.map\stoptyping \stoptext</tttexcode>, delete entries of gbli =Outdated= * at the end of the file (lines 505old introduction [[Uptodate]] by Pragma: [http://www.pragma-629)ade. ((sample deleted))nl/general/uptodate/up-007-s. Then, put the modified <tt>gbkpdf screen] and [http://www.map</tt> to <tt>texmfpragma-fontsade.nl/fontsgeneral/mapuptodate/chinese</tt>up-007-p. Note that newer pdfetex don't read pdf paper] version* manual by Pragma: [[pdftexmanual:mchinese.cfgpdf|Chinese in ConTeXt]] so better use <cmd>loadmapfile[gbk]</cmd> in your document.# Your document should be compilable now. ((Attached is a test file from Lutz, so you can test your ConTeXt.)Old 2001)# I haven't tried to compile Traditional Chinese documents. Maybe just get corresponding files for Traditional Chinese and put there to the right location will work. I'm not sure.== See also ==* [[CJK fonts]]
[[Category:Fonts]]
[[Category:InternationalLanguages]]
12

edits