Difference between revisions of "MkIV Differences"
m (→Paragraph formatting: added todo) |
(→Paragraph formatting: attempt to explain better) |
||
Line 16: | Line 16: | ||
= Paragraph formatting = | = Paragraph formatting = | ||
− | + | Mark IV extends the <cmd>definefontfeature</cmd> to make full use of the lua opentype engine by adding | |
+ | '''mode=node''', and various opentype tags features that you want on or off. In the distribution, there is only one case of this: | ||
− | + | \definefontfeature | |
+ | [arabic] | ||
+ | [mode=node,language=dflt,script=arab,ccmp=yes, | ||
+ | init=yes,medi=yes,fina=yes,isol=yes, | ||
+ | liga=yes,dlig=yes,rlig=yes,clig=yes,calt=yes, | ||
+ | mark=yes,mkmk=yes,kern=yes,curs=yes] | ||
+ | |||
+ | It should come as no surprise that such a '''mode=node''' generates different effects, but even with a traditional font setup there are incompatibilies unless you use tfm-only fonts, because the metric information of fonts used in Mark IV | ||
+ | (afm, ttf, otf) are often subtly different from the tfm metrics used by Mark II. | ||
== Actual font usage == | == Actual font usage == | ||
Line 24: | Line 33: | ||
If you have a font in both OpenType and traditional Type 1, then Mark IV will typically use one version and Mark II the other. There is no guarantee that both sets have the same metrics. | If you have a font in both OpenType and traditional Type 1, then Mark IV will typically use one version and Mark II the other. There is no guarantee that both sets have the same metrics. | ||
− | + | This is related to open type fonts metrics not having the limitations of traditional tfm metrics (and the fact that internally luatex has some limitations removed) | |
== Interword spacing == | == Interword spacing == |
Revision as of 10:55, 20 November 2009
In Mark IV, much has changed. Most of the changes are not noticeable at the source document level, but there are in fact a few important differences. This page attempts to list the intentional as well as the unavoidable incompatibilities between Mark IV and Mark II (but not bugs).
Contents
Command line
You start Mark IV with the context command, and Mark II with texexec. The two programs are not the same, and even though they have mostly the same command line, there are some differences. Mostly, this is because context is still lacking a number of options of texexec like for example --passon (those will probably be implemented at some point in the future), but it also parses the command line different. You must remember to always give the full name of the options, and then the effects should be almost unnoticeable.
Parameter processing
Mark IV delegates lots of the key-value processing to lua, and as a result you often have provide 'expanded' numbers:
\setuplayout[width=\the\hize] % not just \hsize \definetypeface [joke] [ss] [sans] [joke] [default] [rscale=0.9] % not just .9
TODO: This is unclear. What is the current status? What does "often" mean? (See: To-Do List) |
Paragraph formatting
Mark IV extends the \definefontfeature to make full use of the lua opentype engine by adding mode=node, and various opentype tags features that you want on or off. In the distribution, there is only one case of this:
\definefontfeature [arabic] [mode=node,language=dflt,script=arab,ccmp=yes, init=yes,medi=yes,fina=yes,isol=yes, liga=yes,dlig=yes,rlig=yes,clig=yes,calt=yes, mark=yes,mkmk=yes,kern=yes,curs=yes]
It should come as no surprise that such a mode=node generates different effects, but even with a traditional font setup there are incompatibilies unless you use tfm-only fonts, because the metric information of fonts used in Mark IV (afm, ttf, otf) are often subtly different from the tfm metrics used by Mark II.
Actual font usage
If you have a font in both OpenType and traditional Type 1, then Mark IV will typically use one version and Mark II the other. There is no guarantee that both sets have the same metrics.
This is related to open type fonts metrics not having the limitations of traditional tfm metrics (and the fact that internally luatex has some limitations removed)
Interword spacing
TFM-based (Type 1) fonts, especially those generated by afmtotfm, tend to use heuristics to decide on the width of the interword space instead of looking at the actual value inside the font. In Mark IV, it is much more likely that the actual value from the font is used, because Mark IV prefers the actual AFM files over any existing TFM files. As this affects interword spacing, linebreaks in Mark IV can be quite different from the ones in Mark II.
Line spacing
TFM-based fonts often have to round heights and depths to allow for restrictions in the TFM format. This affects individual glyphs but more importantly, it can change the value of '1ex'. This can affect line spacing, because ConTeXt by default uses the value '2.8ex' for the setting of \baselineskip.
Languages and Regimes
Mark IV needs your input to be in UTF-8. Legacy documents using 8bit encodings have to be converted to utf-8 before they are usable.
Linebreaks can be different because full-blown UTF-8 hyphenation patterns are used.
HH: regimes still work so unless something is broken other encodings also should work but going utf8 is definitely wise
Fonts and Typescripts
Typescripts in Mark IV never specify any encoding at all (Unicode is mandatory)
Metapost
All inline metapost code in your document is executed in a large continuous run.
This means there are two things you have to watch out for:
- You should load the MP packages you need in \startMPinclusions..\stopMPinclusions; not inside a graphic.
- You have to make sure that you do not re-state equations that were already solved in a previous graphic.
These are in fact the exact same rules that you have to adhere to in mkii if \runMPgraphicsfalse is active.
Indices and sorting
Sort orders can be different because of changes to the sort order lists.
Images
The official way of placing image in in mkiv:
\placefigure[middle,none]{}{...}
mkii way was
\placefigure[middle]{none}{...}
Logos
The logo commands (\definelogo c.s.) do not exist in mkiv, use layers instead.
Itemizations
Bare \item paragraphs (without enclosing list) are not allowed.