From 71e0f049996013abcbfd549b516e594e019fb744 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 14 Feb 2018 16:43:07 +0100 Subject: 2018-02-14 16:27:00 --- doc/context/documents/general/manuals/bidi.pdf | Bin 0 -> 84491 bytes doc/context/documents/general/manuals/luatex.pdf | Bin 1176569 -> 1179681 bytes doc/context/documents/general/qrcs/setup-cs.pdf | Bin 833609 -> 843584 bytes doc/context/documents/general/qrcs/setup-de.pdf | Bin 831499 -> 841986 bytes doc/context/documents/general/qrcs/setup-en.pdf | Bin 835950 -> 847162 bytes doc/context/documents/general/qrcs/setup-fr.pdf | Bin 829350 -> 838835 bytes doc/context/documents/general/qrcs/setup-it.pdf | Bin 835751 -> 843141 bytes .../documents/general/qrcs/setup-mapping-cs.pdf | Bin 358935 -> 359042 bytes .../documents/general/qrcs/setup-mapping-de.pdf | Bin 438388 -> 438494 bytes .../documents/general/qrcs/setup-mapping-en.pdf | Bin 356263 -> 356374 bytes .../documents/general/qrcs/setup-mapping-fr.pdf | Bin 358807 -> 358919 bytes .../documents/general/qrcs/setup-mapping-it.pdf | Bin 358110 -> 358217 bytes .../documents/general/qrcs/setup-mapping-nl.pdf | Bin 357586 -> 357683 bytes .../documents/general/qrcs/setup-mapping-ro.pdf | Bin 624829 -> 624939 bytes doc/context/documents/general/qrcs/setup-nl.pdf | Bin 825826 -> 836817 bytes doc/context/documents/general/qrcs/setup-ro.pdf | Bin 829455 -> 837949 bytes .../sources/general/fonts/fonts/fonts-features.tex | 15 +- doc/context/sources/general/manuals/bidi/bidi.tex | 239 +++++++++++++++++++++ .../sources/general/manuals/luatex/luatex-math.tex | 13 +- .../sources/general/manuals/luatex/luatex.tex | 2 +- 20 files changed, 264 insertions(+), 5 deletions(-) create mode 100644 doc/context/documents/general/manuals/bidi.pdf create mode 100644 doc/context/sources/general/manuals/bidi/bidi.tex (limited to 'doc') diff --git a/doc/context/documents/general/manuals/bidi.pdf b/doc/context/documents/general/manuals/bidi.pdf new file mode 100644 index 000000000..5a787197b Binary files /dev/null and b/doc/context/documents/general/manuals/bidi.pdf differ diff --git a/doc/context/documents/general/manuals/luatex.pdf b/doc/context/documents/general/manuals/luatex.pdf index 12cf14af5..7f8da5be3 100644 Binary files a/doc/context/documents/general/manuals/luatex.pdf and b/doc/context/documents/general/manuals/luatex.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf index 79755c1de..d91a8803c 100644 Binary files a/doc/context/documents/general/qrcs/setup-cs.pdf and b/doc/context/documents/general/qrcs/setup-cs.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf index 870abf15a..0e758e0ec 100644 Binary files a/doc/context/documents/general/qrcs/setup-de.pdf and b/doc/context/documents/general/qrcs/setup-de.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf index 1d8b2788a..fac1032e1 100644 Binary files a/doc/context/documents/general/qrcs/setup-en.pdf and b/doc/context/documents/general/qrcs/setup-en.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf index 80356c268..3feedc089 100644 Binary files a/doc/context/documents/general/qrcs/setup-fr.pdf and b/doc/context/documents/general/qrcs/setup-fr.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf index cf7967076..c76f97203 100644 Binary files a/doc/context/documents/general/qrcs/setup-it.pdf and b/doc/context/documents/general/qrcs/setup-it.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf index a87569c5e..9cc2b95af 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf and b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf index 273d9a418..4dc4e83ff 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-de.pdf and b/doc/context/documents/general/qrcs/setup-mapping-de.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf index 632e7724d..e7ad18be9 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-en.pdf and b/doc/context/documents/general/qrcs/setup-mapping-en.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf index 11fe1bca1..1bc434fed 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf and b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf index a21650aac..5bdce456a 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-it.pdf and b/doc/context/documents/general/qrcs/setup-mapping-it.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf index 52a71db58..dd25d0abe 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf and b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf index f9aef80e4..26893c58e 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf and b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf index 05d8b86c6..1bc64c2a9 100644 Binary files a/doc/context/documents/general/qrcs/setup-nl.pdf and b/doc/context/documents/general/qrcs/setup-nl.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf index 432c9324f..f402e01e9 100644 Binary files a/doc/context/documents/general/qrcs/setup-ro.pdf and b/doc/context/documents/general/qrcs/setup-ro.pdf differ diff --git a/doc/context/sources/general/fonts/fonts/fonts-features.tex b/doc/context/sources/general/fonts/fonts/fonts-features.tex index 48121b51f..0ecd3c9d9 100644 --- a/doc/context/sources/general/fonts/fonts/fonts-features.tex +++ b/doc/context/sources/general/fonts/fonts/fonts-features.tex @@ -1074,12 +1074,21 @@ correction of \type {0.025} but for some shapes a different value is used. Again we have some commands at the \TEX\ end: \starttyping -\setupmathematics[italics=1] % fontitalics -\setupmathematics[italics=2] % fontdata -\setupmathematics[italics=3] % quad based +\setupmathematics[italics=1] % apply italics with we have an italic font +\setupmathematics[italics=2] % apply italics anyway +\setupmathematics[italics=3] % apply italics only when italic or bolditalic shapes \setupmathematics[italics=4] % combination of 1 and 3 \stoptyping +An alternative is this: + +\starttyping +\definefontfeature[mathextra][mathextra][collapseitalics=yes] +\stoptyping + +This extends the \type {mathextra} feature to move the italic correction into +the character's width. Often this works out ok. + Because (definitely at the start of the \LUATEX\ project) we had no proper \OPENTYPE\ math fonts, but at the same time wanted to move on to \OPENTYPE\ and \UNICODE\ math and no longer struggle with all diff --git a/doc/context/sources/general/manuals/bidi/bidi.tex b/doc/context/sources/general/manuals/bidi/bidi.tex new file mode 100644 index 000000000..5bb24b118 --- /dev/null +++ b/doc/context/sources/general/manuals/bidi/bidi.tex @@ -0,0 +1,239 @@ +% language=uk + +% \showglyphs + +\dontcomplain + +\startbuffer[preamble-fonts] +\definefontfallback + [Serif] [scheherazaderegular*arabic sa 1.5] + [arabic] [force=yes] +\definefontfallback + [SerifBold] [scheherazadebold*arabic sa 1.5] + [arabic] [force=yes] +\definefontfallback + [SerifItalic] [scheherazaderegular*arabic sa 1.5] + [arabic] [force=yes] +\definefontfallback + [SerifBoldItalic] [scheherazadebold*arabic sa 1.5] + [arabic] [force=yes] + +\definefontfallback + [Serif] [sileot*hebrew sa 1.0] + [hebrew] [force=yes] +\definefontfallback + [SerifBold] [sileot*hebrew sa 1.0] + [hebrew] [force=yes] +\definefontfallback + [SerifItalic] [sileot*hebrew sa 1.0] + [hebrew] [force=yes] +\definefontfallback + [SerifBoldItalic] [sileot*hebrew sa 1.0] + [hebrew] [force=yes] + +\definefontfeature[fakemono][mode=node,fakemono=yes] + +% \definefontfallback +% [Mono] [scheherazaderegular*fakemono sa 1.5] +% [arabic] [force=yes,factor=1] % factor forces a monospace + +\definefontfallback + [Mono] [sileot*fakemono sa 1.0] + [hebrew] [force=yes,factor=1] % factor forces a monospace + +\setupbodyfont + [dejavu,10pt] +\stopbuffer + +\startbuffer[preamble-languages] +\setuplanguage[ar][font=arabic,bidi=right] +\setuplanguage[he][font=hebrew,bidi=right] +\stopbuffer + +\getbuffer[preamble-fonts] +\getbuffer[preamble-languages] + +\setuplayout + [backspace=15mm, + topspace=15mm, + footer=0pt, + width=middle, + height=middle] + +\setuptyping + [color=middleblue] + +\setuptype + [color=middleblue] + +\definecolor + [maincolor] + [middleblue] + +\setupwhitespace + [big] + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\startluacode + local report = logs.reporter("directions","check") + local line = 0 + function nodes.tracers.checkdirections(head) + line = line + 1 + report("line: %i",line) + for n in nodes.traverse_id(nodes.nodecodes.dir,head) do + report(" %s (%i,%i)",n.dir,n.subtype,n.direction) + end + return head, false + end + + nodes.tasks.appendaction("contributers","after","nodes.tracers.checkdirections") + nodes.tasks.disableaction("contributers","nodes.tracers.checkdirections") +\stopluacode + +\installtextracker + {directions.check} + {\ctxlua{nodes.tasks.enableaction("contributers","nodes.tracers.checkdirections")}} + {\ctxlua{nodes.tasks.disableaction("contributers","nodes.tracers.checkdirections")}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\starttext + +\startMPpage + + picture p, q, r, s ; + + p := textext("l2r") xsized .9PaperWidth ; + q := textext("r2l") xsized .9PaperWidth ; + r := textext("a few tips") xsized .9PaperWidth ; + s := textext("hans\quad\quad hagen") xsized .5bbheight(p); + + p := p shifted - llcorner p ; + q := q shifted - llcorner q ; + r := r shifted - llcorner r ; + s := s shifted - llcorner s ; + + fill Page withcolor "darkyellow" ; + + p := p shifted (.05PaperWidth,ypart .5[ulcorner Page, urcorner Page]-1.1bbheight(p)) ; + q := q shifted (.05PaperWidth,ypart .5[ulcorner Page, urcorner Page]-1.1bbheight(p)-1.15bbheight(q)) ; + r := r shifted (.05PaperWidth,ypart .5[llcorner Page, lrcorner Page]+0.3bbheight(r)) ; + s := s shifted (.66PaperWidth,ypart .5[llcorner Page, lrcorner Page]+1.5bbheight(s)) ; + + draw p withcolor "lightgray" ; + draw q withcolor "lightgray" ; + draw r withcolor "middleblue" ; + draw s withcolor "middleblue" ; + +\stopMPpage + +\startchapter[title=Introduction] + +With \CONTEXT\ you can typeset in two directions: from left to right and from +right to left. In fact you can also combine these two directions, like this: + +\startbuffer +There are many {\righttoleft \maincolor \bf scripts in use} and some run into the +other direction. However, there is {\righttoleft \maincolor \bf no fixed relation +{\lefttoright \black \tf between the} direction of the script} and cars being +driven left or right of the road. +\stopbuffer + +\typebuffer + +% \enabletrackers[directions.check] + +\getbuffer + +% \disabletrackers[directions.check] + +This manual is written by a left to right user so don't expect a manual on +semitic typesetting (Hebrew and Arabic). Also don't expect a (yet) complete +manual. I'll add whatever comes to mind. So let's see how Arabic comes out: + +\startbuffer +The sentence \quotation {I have no clue what this means.} is translated (by +Google Translate) into \quotation {\ar \righttoleft ليس لدي أي فكرة عما يعنيه هذا.} +which is then translated back to \quotation {I have no idea what this means.} so +maybe arabic has no clue what a clue is. The suggested Arabic pronunciation is +\quotation {\ar lays laday 'ayu fikrat eamaa yaenih hadha}. Hebrew also likes ideas +more: \quotation {\hr \righttoleft אין לי מושג מה זה אומר}. +\stopbuffer + +\typebuffer + +\getbuffer + +The \CONTEXT\ (or any \TEX) ecosystem deals with languages and fonts. Languages +(that relate to scripts) have specific characteristics, like running from right +to left, and fonts provide a repertoire of glyphs and features. There is no real +(standard) relationship between these. In for instance browsers, there are +automatic fallback systems for missing characters in a font: another font is +taken. These fallbacks are often not easy to tweak. + +In this document we use Dejavu and although that font has Arabic shapes in its +monospace variant, the serifs come without them (at least when I write this +down). Before we actually define the bodyfont we hook in some fallbacks. The +typescript for Dejavu has lines like this: + +\starttyping +\definefontsynonym + [SerifBoldItalic] + [name:dejavuserifbolditalic] + [features=default, + fallbacks=SerifBoldItalic] +\stoptyping + +This permits us to do this: + +\typebuffer[preamble-fonts] + +In addition we set up the languages: + +\typebuffer[preamble-languages] + +The following example demonstrates what the effects of these commands are: + +\startbuffer +{ليس لدي أي فكرة عما يعنيه هذا.} +{אין לי מושג מה זה אומר.} +{\righttoleft ليس لدي أي فكرة عما يعنيه هذا.} +{\righttoleft אין לי מושג מה זה אומר.} +{\ar \righttoleft ليس لدي أي فكرة عما يعنيه هذا.} +{\he \righttoleft אין לי מושג מה זה אומר.} +{\ar ليس لدي أي فكرة عما يعنيه هذا.} +{\he אין לי מושג מה זה אומר.} +\stopbuffer + +\typebuffer + +\startlines +\getbuffer +\stoplines + +In principle you can also rely on automatic direction changes, for instance +by using the following command: + +\starttyping +\setupdirections + [bidi=global, + method=three] +\stoptyping + +But that doesn't do a font switch for you, nor does it do any of the other +language related settings. It really helps if you properly tag your +document content, as in: + +\starttyping +{\ar ليس لدي أي فكرة عما يعنيه هذا.} +{\he אין לי מושג מה זה אומר.} +\stoptyping + +One reason to set the \type {font} parameter for a language is that it will +activate the right features in a font. Instead of falling back on some default, +we can be very specific in what we want to enable. + +\stopchapter + +\stoptext diff --git a/doc/context/sources/general/manuals/luatex/luatex-math.tex b/doc/context/sources/general/manuals/luatex/luatex-math.tex index f29a3aed0..8ccae83f3 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-math.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-math.tex @@ -719,7 +719,18 @@ So, when set to 7 fenced subformulas with unscaled delimiters come out the same as unfenced ones. This can be handy for cases where one is forced to use \type {\left} and \type {\right} always because of unpredictable content. As said, it's an experimental features (which somehow fits in the exceptional way fences are -dealt with in the engine). +dealt with in the engine). The full list of flags is given in the next table: + +\starttabulate[|T|l|] +\NC "01 \NC don't apply the usual shift \NC \NR +\NC "02 \NC apply italic correction when possible \NC \NR +\NC "04 \NC force a ordinary subformula \NC \NR +\NC "08 \NC no shift when a base character \NC \NR +\NC "10 \NC only shift when an extensible \NC \NR +\stoptabulate + +The effect can depend on the font (and for Cambria one can use for instance \type +{"16}). \section{Math spacing setting} diff --git a/doc/context/sources/general/manuals/luatex/luatex.tex b/doc/context/sources/general/manuals/luatex/luatex.tex index 42e487bde..43f81ab5e 100644 --- a/doc/context/sources/general/manuals/luatex/luatex.tex +++ b/doc/context/sources/general/manuals/luatex/luatex.tex @@ -45,7 +45,7 @@ \startdocument [status=experimental, - version=1.07.0] + version=1.08.0] \startnotmode[*export] \component luatex-titlepage -- cgit v1.2.3