https://wiki.contextgarden.net/api.php?action=feedcontributions&user=Aksdb&feedformat=atomWiki - User contributions [en]2024-03-28T10:37:37ZUser contributionsMediaWiki 1.34.1https://wiki.contextgarden.net/index.php?title=Verbatim_XML&diff=22751Verbatim XML2015-02-13T08:13:01Z<p>Aksdb: Created page with "Processing elements in XML that should be typeset verbatim (for example code snippets) is a tricky matter, since during XML processing, the catcode table is a different one. Han..."</p>
<hr />
<div>Processing elements in XML that should be typeset verbatim (for example code snippets) is a tricky matter, since during XML processing, the catcode table is a different one.<br />
<br />
Hans came up with a [http://www.ntg.nl/pipermail/ntg-context/2015/080914.html quick but powerful] solution, that demonstrates two important things:<br />
* Processing a buffer from XML content in Lua<br />
* Temporarily (re)setting the catcode table to allow buffers to work.<br />
<br />
This can come in handy in more situations.<br />
<br />
First, define a xml function to process the xml element manually. (In this example, vimtyping is used to format a JSON buffer)<br />
<br />
<texcode><br />
\startluacode<br />
function xml.functions.processJSON(t)<br />
buffers.assign("foo","\\startJSON\n" .. tostring(xml.text(t)) .. "\n\\stopJSON")<br />
context.getbuffer { "foo" }<br />
end<br />
\stopluacode<br />
</texcode><br />
<br />
The actual XML setup to process the {{code|<json>...</json>}} element looks as follows. This also handles the catcode table manipulation.<br />
<br />
<texcode><br />
\startxmlsetups xml:json<br />
\pushcatcodetable<br />
\setcatcodetable\ctxcatcodes<br />
\xmlfunction{#1}{processJSON}<br />
\popcatcodetable<br />
\stopxmlsetups<br />
</texcode></div>Aksdbhttps://wiki.contextgarden.net/index.php?title=XML&diff=22750XML2015-02-13T07:58:55Z<p>Aksdb: </p>
<hr />
<div>< [[Main Page]] | [[DocBook]] | [[MathML]] | [[Formatting Objects]] ><br />
<br />
If you want to get more from your code than just a PDF (or DVI) output, e.g. HTML, or if you need a good typesetting machine for your XML code, you're right with ConTeXt.<br />
<br />
Handling XML in ConTeXt has improved dramatically with the advent of MKIV. A new infrastructure, based on Lua, makes typesetting, manipulating, filtering, reusing XML much much easier than before. Unfortunately, this means that most of the existing documentation is now obsolete. As a rule of thumb: in general, the "old" MKII code uses upper-case <tt>XML</tt> in its commands, the new MKIV code uses lower-case <tt>xml</tt>. <br />
<br />
Here are some links to existing docs:<br />
<br />
==Documents about XML in MKIV==<br />
===General Information===<br />
*[http://pragma-ade.com/show-man-44.htm xml-mkiv.pdf]<br />
* [[TEI_xml| TEI xml]] (typesetting editions encoded in TEI xml)<br />
* [[Verbatim_XML | Verbatim/VIM in XML]]<br />
<br />
===Processing XML with lua===<br />
* [[XML_Lua| XML in Lua]] (manipulating xml in Lua)<br />
===XHTML in MKIV===<br />
* [http://dl.contextgarden.net/myway/tas/xhtml.pdf Thomas' MyWay on processing XHTML with MKIV]<br />
<br />
<br />
==Documents about XML in MKII (obsolete)==<br />
===XML/ConTeXt in general===<br />
* [[manual:example.pdf|XML in ConTeXt]] by Pragma (2001)<br />
* [http://www.leverkruid.eu/context/index.html XML DocBook in ConTeXt] by Simon Pepping<br />
* [http://getfo.sourceforge.net/context_xml/index.html XML ConTeXt] by Paul Tremblay<br />
* [http://www.pragma-ade.com/show-mag-9.htm Dealing with XML] by Pragma (about XML, XSLT and typesetting without TeX code)<br />
* XML Basics: [[Mixing_XML_and_ConTeXt]] using the pre-defined ContML vocabulary<br />
<br />
===Additions and Details of XML/ConTeXt===<br />
* [[manual:xfigures-p.pdf|Figures (XML image databases)]] ([[manual:xfigures-s.pdf|screen]]) by Pragma (2001); see [[Image Database]]<br />
* [[Two pass tag processing example]] (float and figure tags)<br />
* [[manual:xsteps-p.pdf|Steps (XML step charts)]] ([[manual:xsteps-s.pdf|screen]]) by Pragma (2001)<br />
* [[manual:xxmldir.pdf|XML DIR (directory and file access)]] by Pragma<br />
* [[Interface.rnc]], the Relax NG schema of texshow-web<br />
* [[manual:xmanipulate.pdf|Preprocessing Source Files / Manipulating Graphic Resources]] by Pragma<br />
** a simple [[ctx|.ctx example]] of processing xml files<br />
* [[manual:xcorresp.pdf|Serial Letters]] (using a XML database) by Pragma (2003)<br />
<br />
===eXaMpLe framework=== <br />
(batch processing)<br />
* [[manual:ex-ample.pdf|Example Interface]] (empty)<br />
* [[manual:ex-gui.pdf|Example GUI]]<br />
* [[manual:ex-imple.pdf|Eximple Toolkit]] (simple subset of Example)<br />
<br />
===MathML===<br />
* [[manual:pre-mml.pdf|MathML Intro presentation]] by Pragma<br />
* [[manual:mmlprime.pdf|MathML manual]] by Pragma (2001)<br />
* [[manual:mmlexamp.pdf|MathML in ConTeXt]] by Pragma (2001)<br />
* [[manual:xmathml-p.pdf|MathML support]] ([[manual:xmathml-s.pdf|screen]]) by Pragma (2001)<br />
* [[manual:xchemml-p.pdf|ChemML (MathML extension for chemistry)]] ([[manual:xchemml-s.pdf|screen]]) by Pragma<br />
* [[manual:xphysml-p.pdf|PhysML (MathML extension for physics)]] ([[manual:xphysml-s.pdf|screen]]) by Pragma<br />
<br />
===XSL/FO===<br />
* XSL/FO: [[Formatting Objects]]<br />
* [[ConTeXt FO and XML]] is a tutorial with a view to presenting ConTeXt from the XSL-FO mindset.<br />
<br />
[[Category:XML]]</div>Aksdbhttps://wiki.contextgarden.net/index.php?title=Fonts_in_LuaTeX&diff=13433Fonts in LuaTeX2011-10-18T06:39:59Z<p>Aksdb: Added example for simplefonts with a special case.</p>
<hr />
<div>{{note|This page is not finished yet}}<br />
<br />
'''Please, someone, fill this page !'''<br />
<br />
'''This page is beeing regorganized'''<br />
<br />
Using [[LuaTeX]] as the processing engine in ConTeXt allows one to directly use fonts installed on the user's system. Instead of converting all fonts into the standard <code>.tfm</code> and <code>.vf</code> formats (as outlined in some [[My Way]] documents<ref>[http://dl.contextgarden.net/websitesarchive/atl/tex/OpenType.pdf OpenType in ConTeXt] by Adam Lindsay</ref><ref>[http://dl.contextgarden.net/myway/expertfonts.pdf Installing Expert Fonts: Minion Pro] by Idris Samawi Hamid</ref>), LuaTeX creates these metric files automatically at run-time. This greatly simplifies font installation in ConTeXt.<br />
<br />
= How LuaTeX handles system fonts =<br />
<br />
LuaTeX can use fonts in non-TeX format (e.g. OpenType, TrueType or Type1 format) directly. When ConTeXt processes a file that uses such non-traditional fonts, the actual fonts themselves are loaded in LuaTeX's embedded section of fontforge to extract their metric information. This removes the need for tfm and vf files on your disk, but it is also a somewhat lengthy and often memory-hungry process. Fortunately, the result of that internal preprocessing are also saved inside the texmf cache. Future runs using the same font (not just this file, but all files using that particular font) can then use the cached version of the metrics instead.<br />
<br />
Mac OS users should note that the current version of LuaTeX (0.60) has severe problems dealing with the new TrueType collection fonts in Snow Leopard (Mac OS 10.6). The older Mac OS .dfont format works fine nowadays.<br />
<br />
== Building the font database ==<br />
<br />
You need to specify where the fonts should be looked for, by setting the <code>OSFONTDIR</code> environment variable. On Windows, this might be achieved by running<br />
set OSFONTDIR=c:/windows/fonts/<br />
if the fonts should be found in <code>c:/windows/fonts/</code>. For Unix machines,<br />
export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts"<br />
indicate that the fonts should be found in both <code>/usr/local/share/fonts</code> and <code>$HOME/.fonts</code>.<br />
<br />
The font database will then be automatically generated in the next run of <code>context</code>. You can also generate it manually by typing <br />
mtxrun --script fonts --reload<br />
<br />
The output should look like<br />
MTXrun | fontnames: identifying tree font files with suffix otf<br />
MTXrun | fontnames: identifying tree font files with suffix OTF<br />
MTXrun | fontnames: 331 tree files identified, 332 hash entries added, runtime 7.653 seconds<br />
MTXrun | fontnames: identifying tree font files with suffix ttf<br />
MTXrun | fontnames: identifying tree font files with suffix TTF<br />
MTXrun | fontnames: 17 tree files identified, 14 hash entries added, runtime 4.645 seconds<br />
...<br />
MTXrun | fontnames: 94 system files identified, 94 hash entries added, runtime 0.554 seconds<br />
MTXrun | fontnames: 3837 files read, 3342 normal and 49 extra entries added, 5 rejected, 3386 valid<br />
<br />
If mtxrun has problem finding the mtx-fonts.lua file, it may be necessary to regenerate ConTeXt's file database:<br />
context --generate<br />
<br />
== Querying the font database ==<br />
<br />
The command<br />
mtxrun --script fonts --list --all --pattern=*<br />
will return the whole entries of the font database as a list, such as<br />
<br />
...<br />
warnockprobold WarnockPro-Bold E:/Fonts/Warnock Pro/WarnockPro-Bold.otf<br />
warnockproboldcapt WarnockPro-BoldCapt E:/Fonts/Warnock Pro/WarnockPro-BoldCapt.otf<br />
warnockprobolddisp WarnockPro-BoldDisp E:/Fonts/Warnock Pro/WarnockPro-BoldDisp.otf<br />
warnockproboldit WarnockPro-BoldIt E:/Fonts/Warnock Pro/WarnockPro-BoldIt.otf<br />
warnockprobolditcapt WarnockPro-BoldItCapt E:/Fonts/Warnock Pro/WarnockPro-BoldItCapt.otf<br />
warnockprobolditdisp WarnockPro-BoldItDisp E:/Fonts/Warnock Pro/WarnockPro-BoldItDisp.otf<br />
warnockprobolditsubh WarnockPro-BoldItSubh E:/Fonts/Warnock Pro/WarnockPro-BoldItSubh.otf<br />
warnockproboldsubh WarnockPro-BoldSubh E:/Fonts/Warnock Pro/WarnockPro-BoldSubh.otf<br />
...<br />
<br />
You can query the database against a particular pattern. For instance,<br />
mtxrun --script fonts --list --all --pattern=Delicious*<br />
will return<br />
deliciousbold Delicious-Bold /usr/local/share/fonts/d/delicious_bold.otf<br />
deliciousbolditalic Delicious-BoldItalic /usr/local/share/fonts/d/delicious_bolditalic.otf<br />
deliciousheavy Delicious-Heavy /usr/local/share/fonts/d/delicious_heavy.otf<br />
deliciousitalic Delicious-Italic /usr/local/share/fonts/d/delicious_italic.otf<br />
deliciousroman Delicious-Roman /usr/local/share/fonts/d/delicious_roman.otf<br />
delicioussmallcaps Delicious-SmallCaps /usr/local/share/fonts/d/delicious_smallcaps.otf<br />
<br />
You can get useful informations about your fonts by using the <code>--info</code> option. For instance,<br />
mtxrun --script fonts --list --info --pattern=Delicious*Roman<br />
will return<br />
MTXrun | fontname: deliciousroman<br />
MTXrun | fullname: Delicious-Roman<br />
MTXrun | filename: /usr/local/share/fonts/d/delicious_roman.otf<br />
MTXrun |<br />
MTXrun | gpos features:<br />
MTXrun |<br />
MTXrun | feature script languages<br />
MTXrun |<br />
MTXrun | kern latn dflt<br />
MTXrun |<br />
MTXrun | gsub features:<br />
MTXrun |<br />
MTXrun | feature script languages<br />
MTXrun |<br />
MTXrun | tlig all all<br />
MTXrun | trep all all<br />
<br />
== Installing new fonts ==<br />
<br />
After installing new fonts, the font database must be rebuilt for LuaTeX to access them.<br />
<br />
In current versions of Mark IV (earlier than July 2008) this is automatically done whenever a named font cannot be found.<br />
<br />
You only have to do the reload manually when you have installed updates to already installed fonts that cause the font and/or file names to change. <br />
This normally only happens for fonts that are still in development like [[TeX Gyre]] and [[Latin Modern]].<br />
<br />
You can rebuild the database manually, using the already-mentioned command<br />
mtxrun --script fonts --reload<br />
<br />
Alternatively, you can turn off the automatic rebuild of the database, by setting either of<br />
MTX.FONTS.AUTOLOAD<br />
MTX_FONTS_AUTOLOAD<br />
to "no".<br />
<br />
== References ==<br />
<br />
[http://context.aanhet.net/svn/contextman/context-reference/en/co-fonts.pdf The new manual chapter on fonts]<br />
<br />
= Using fonts =<br />
<br />
Handling fonts in LuaTeX can be done<br />
* in a simple but limited way, using the <code>simplefonts</code> module;<br />
* in the standard way, using [[TypeScripts]]<br />
<br />
== With the <code>simplefonts</code> module ==<br />
<br />
[http://www.ctan.org/tex-archive/macros/context/contrib/context-simplefonts simplefonts] is a third-party module written by Wolfgang Schuster.<br />
<br />
It simplifies the use of fonts in LuaTeX by<br />
* freeing the user from writing or using [[TypeScripts]];<br />
* offering an interface similar to the [http://www.ctan.org/tex-archive/macros/xetex/latex/fontspec/ fontspec package for XeTeX]<br />
<br />
For instance, assuming the [http://www.josbuivenga.demon.nl/delicious.html Delicious fonts] are properly installed and recognized by ConTeXt, you can simply write:<br />
<br />
<texcode><br />
\usemodule[simplefonts] % load the module<br />
\setmainfont[Delicious] % set Delicious as main (serif) font<br />
<br />
\starttext<br />
\rm\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps<br />
\stoptext<br />
</texcode><br />
<br />
=== Installing <code>simplefonts</code> ===<br />
<br />
* If you're using LuaTeX along with TeXlive 2009, <code>simplefonts</code> is already installed<br />
* If you're running [[ConTeXt Standalone]], <code>simplefonts</code> can be installed like [http://wiki.contextgarden.net/ConTeXt_Standalone#Installing_third_party_modules any third-party module]:<br />
first-setup.sh --modules="t-simplefonts"<br />
<br />
=== Handling special cases ===<br />
<br />
If the font in question has an unusual naming scheme and is missing some features, it may be necessary to specify the names to look for and the font features to implement. In [http://archive.contextgarden.net/message/20111017.113829.e2b20bf4.en.html this example] the font names do not end with *bold and *regular but with *fett and *nor (from the german words "fett" for bold and "normal" for regular). Also the font doesn't provide an italic font face, so it has to be emulated.<br />
<br />
Wolfgang Schuster proposed the following [http://archive.contextgarden.net/message/20111017.144952.1a72175c.en.html solutions]:<br />
<br />
<texcode><br />
\usemodule[simplefonts] <br />
<br />
\definefontfeature[fakeitalic][default][slant=.25] % for fake bold use “stretch=<number>” <br />
<br />
\setmainfont <br />
[telegrotesk] <br />
[regularfont=* nor, <br />
italicfont=* nor, <br />
boldfont=* fett, <br />
bolditalicfont=* fett, <br />
italicfeatures=fakeitalic, % just the name of a fontfeature <br />
bolditalicfeatures=fakeitalic]<br />
</texcode><br />
<br />
== The standard way: Typescripts ==<br />
<br />
=== Installing typescripts ===<br />
<br />
Installing typescripts consists in the following:<br />
<br />
1. Copy the typescript files into either <br />
<texcode>$TEXMF/tex/texmf-fonts/tex/context/user<br />
$TEXMF/tex/texmf-project/tex/context/user</texcode><br />
2. Run <code>context --generate</code><br />
<br />
By convention, typescript files are named like <code>type-(fontname|foundry).tex</code>. <br />
<br />
It may happen that some <code>type-xx.tex</code> typescript file depends on mkiv-specific code located in a matching <code>type-xx.mkiv</code> file. In this case, both files need to be installed.<br />
<br />
=== Loading typescripts ===<br />
<br />
A typescript file named <code>type-xx.tex</code> should be loaded using<br />
\usetypescriptfile[type-xx]<br />
<br />
An alternative way is<br />
\usetypefile[xx]<br />
where ConTeXt prepends <code>type-</code> when it loads the file; but <br />
<cmd>usetypescriptfile</cmd> is the preferred command because it takes care of the<br />
<cmd>starttypescriptcollection</cmd>/<cmd>stoptypescriptcollection</cmd> environments.<br />
<br />
=== Very simple example of typescript ===<br />
<br />
If you are new to typescript you might have a look at this [[Simple Typescript Example]] to get a first idea how to use it.<br />
<br />
=== Where to find existing typescripts ===<br />
<br />
Each of the typescripts below defines a keyword to use with <cmd>setupbodyfont</cmd>. Usually this is the same as the name of the typescript, but there is one exception (<code>antykwa-torunska</code>)<br />
<br />
* Latin Modern (typescript name: <code>modern</code>; this is the default font set)<br />
* Latin Modern variant (ts name: <code>modernvariable</code>; LM variable typewriter for serif)<br />
* Postscript (ts name: <code>postscript</code>; Termes for serif, Heros for sans, Cursor for mono)<br />
* Antykwa Toruńska (ts name: <code>antykwa-torunska</code>; only serif; defines <tt>antykwa</tt> as keyword for <cmd>setupbodyfont</cmd>)<br />
* Iwona (ts name: <code>iwona</code>; only sans serif)<br />
* Iwona Light, Medium and Heavy (ts names: <code>iwona-light</code>, <code>iwona-medium</code>, <code>iwona-heavy</code>; only sans; the medium variant is a small bit heavier than a "regular" one)<br />
* Pagella (ts name: <code>palatino</code>; only serif)<br />
* Termes (ts name: <code>times</code>; only serif, Heros for sans)<br />
<br />
=== Usage example ===<br />
<br />
<texcode><br />
\usetypescript[palatino]<br />
\setupbodyfont[palatino,18pt]<br />
<br />
\starttext<br />
Hello world, I'm Pagella!<br />
\stoptext<br />
</texcode><br />
<br />
The first line seems to order ConTeXt to "install" (for the current file) the given typescript (it accepts what I have earlier called a "typescript name"). The last one starts using it (you may omit the size if you are satisfied with the default).<br />
<br />
=== Combining predefined fonts in your own typescripts ===<br />
<br />
It is also possible to combine fonts from the TeX Gyre collection in your own typescripts. The example below combines Bonum (Bookman) roman, Adventor (AvantGarde) for sans serif, Cursor (Courier) for teletype, and Euler for math. The <code>rscale=...</code> option ensures that all fonts have the same x-height. (You can lookup the relative x-heigt of a font using fontforge.)<br />
<br />
<texcode><br />
\starttypescript [Bonum]<br />
\definetypeface [Bonum] [rm] [serif] [bonum] [default]<br />
\definetypeface [Bonum] [ss] [sans] [adventor] [default] [rscale=0.887]<br />
\definetypeface [Bonum] [tt] [mono] [cursor] [default] [rscale=1.163]<br />
\definetypeface [Bonum] [mm] [math] [euler] [default] [rscale=1.050]<br />
\stoptypescript<br />
<br />
\usetypescript[Bonum]<br />
\setupbodyfont[Bonum,12pt]<br />
<br />
\starttext<br />
Hello world, I'm Bonum!<br />
\stoptext<br />
</texcode><br />
<br />
= Old contents =<br />
<br />
* [[TrueType fonts in luaTeX]]<br />
<br />
==== Good ol' typescripts ====<br />
<br />
Of course, Mark IV allows you to use typescripts as you've always done; for example:<br />
<br />
<texcode><br />
\usetypescript[palatino]<br />
\setupbodyfont[palatino,12pt]<br />
effe fietsen 2: \input tufte $\sqrt{2}$ \eogonek<br />
<br />
\sc effe fietsen 2: \input tufte $\sqrt{2}$ \eogonek<br />
</texcode><br />
<br />
That's as simple as using a traditional ConTeXt typescript!<br />
<br />
But ... how is it any different, then? Well, the difference is that in Mark IV, we can use an Opentype font directly, so that what is done here: when we want to use Palatino, the [[TeX Gyre]] equivalent (“Pagella”) is called and we can use its Opentype “features”; read on.<br />
<br />
==== Opentype features ====<br />
<br />
A “feature”, in the Opentype jargon, is a set of rules describing changes in the appearance of the text. Hmm, that's not very precise. Let's show some examples. First of all, you have to know that features are referred to by 4-letter tags, and you will see this a lot. One of them is ‘smcp‘, for “small caps“. Let's consider the following Mark IV-only code:<br />
<br />
<texcode><br />
\definefontfeature[smallcaps][language=DFLT,script=latn,smcp=yes]<br />
\font\palasmallcaps=texgyrepagella-regular*smallcaps<br />
\palasmallcaps This is a text in small capitals.<br />
</texcode><br />
<br />
Here you basically define a (Mark IV) feature with the name ”smallcaps”, and associate it with the (Opentype) feature “smcp”. You have to specify which script you want to use it with; scripts in Opentype are also tagged with four letters, and “latn” is of course Latin.<br />
<br />
Then you define a TeX font with that feature.<br />
<br />
You can see what features are defined in a particular font with the following bit of code<br />
<br />
<texcode><br />
\ctxlua<br />
{<br />
fontname = 'texgyrepagella-regular.otf'<br />
<br />
--[[ First read the font data.<br />
This makes heavy use of some of the Mark IV code]]<br />
tfmdata = fonts.tfm.read_and_define("file:" .. fontname, 655360)<br />
font = tfmdata.shared.otfdata<br />
if font<br />
then<br />
gsubfeatures = fonts.otf.analyze_features(font.gsub)<br />
gposfeatures = fonts.otf.analyze_features(font.gpos)<br />
end<br />
<br />
if gsubfeatures then<br />
table.sort(gsubfeatures) % We want our list sorted alphabetically!<br />
tex.sprint("\\rm GSUB features: \\tt ") % Beware: you don't want \rm to be interpreted by lua (\rm would yield carriage return + letter m)!<br />
for _, feat in ipairs(gsubfeatures)<br />
do tex.sprint(feat) tex.sprint(' ')<br />
end<br />
else tex.sprint("\\rm No GSUB features")<br />
end<br />
tex.sprint("\\par")<br />
<br />
if gposfeatures then<br />
tex.sprint("\\rm GPOS features: \\tt ")<br />
table.sort(gposfeatures)<br />
for _, feat in ipairs(gposfeatures)<br />
do tex.sprint(feat) tex.sprint(' ')<br />
end<br />
else tex.sprint("\\rm No GPOS features")<br />
end<br />
}<br />
</texcode><br />
<br />
It prints the list on the page. You'll notice there are two sets of features, each one of them defined in a different table of the Opentype font: the <code>GSUB</code> table (for Glyph SUBstitution) gives rules for replacing glyphs in certains circumstances (think of ligatures: f + i -> fi); the <code>GPOS</code> table (Glyph POSititioning) gives rules for moving glyphs (think of kerning: A + V -> A <kerning> V).<br />
<br />
Incidentally, the above code gives some basic examples of LuaTeX programming, a mixture of both Lua and TeX programming with some special features (features in the general sense, not the Opentype one :-).<br />
<br />
==== A (Complete) Typescript Example ====<br />
<br />
<texcode><br />
\starttypescript [sans] [franklin]<br />
<br />
\definefontsynonym [FranklinBookRegular] [name:FranklinGothicBookITC-Regular] [features=default]<br />
\definefontsynonym [FranklinMediumRegular] [name:FranklinGothicMediumITC-Regular] [features=default]<br />
\definefontsynonym [FranklinDemiRegular] [name:FranklinGothicDemiITC-Regular] [features=default]<br />
\definefontsynonym [FranklinHeavyRegular] [name:FranklinGothicHeavyITC-Regular] [features=default]<br />
<br />
\definefontsynonym [FranklinBookItalic] [name:FranklinGothicBookITC-Italic] [features=default]<br />
\definefontsynonym [FranklinDemiItalic] [name:FranklinGothicMediumITC-Italic] [features=default]<br />
\definefontsynonym [FranklinHeavyItalic] [name:FranklinGothicDemiITC-Italic] [features=default]<br />
\definefontsynonym [FranklinMediumItalic] [name:FranklinGothicHeavyITC-Italic] [features=default]<br />
<br />
\stoptypescript<br />
<br />
\starttypescript [sans] [franklin]<br />
<br />
\definefontsynonym [Sans] [FranklinBookRegular] [features=default]<br />
\definefontsynonym [SansItalic] [FranklinBookItalic] [features=default]<br />
\definefontsynonym [SansBold] [FranklinDemiRegular] [features=default]<br />
\definefontsynonym [SansBoldItalic] [FranklinDemiItalic] [features=default]<br />
\definefontsynonym [SansSlanted] [SansItalic] [features=default]<br />
\definefontsynonym [SansBoldSlanted] [SansBoldItalic] [features=default]<br />
\definefontsynonym [SansCaps] [Sans] [features=smallcaps]<br />
<br />
\stoptypescript<br />
<br />
\definetypeface[franklin][rm][sans][franklin][default]<br />
\definetypeface[franklin][ss][sans][franklin][default]<br />
\definetypeface[franklin][tt][mono][modern] [default][rscale=1.12]<br />
\definetypeface[franklin][mm][math][iwona] [default][rscale=1.02]<br />
<br />
\setupbodyfont[franklin,ss,10pt]<br />
</texcode><br />
<br />
<br />
<br />
Just the simplest way to use an otf font — or any font that does appear in <tt>mtxrun --script font --list</tt> — in all the document.<br />
<br />
I’m stick here :<br />
<br />
\definefontfeature [myfontfeature] [method=node, kern=yes, OTHER_FEATURE_COMMA_SEPERATED]<br />
\definefontsynonym [MyFontRegular] [name:TheFontName-Regular][features=myfontfeature]<br />
\definedfont [MyFontRegular at 16pt]<br />
<br />
This doesn’t run for my title which use « \tfc », only for the body of the text.<br />
<br />
*\definefontfeature<br />
**[myfontfeature] : you can use the name you want. It will be use at the next line ;<br />
**the fonts feature can be found with <tt>otfinfo -f TheFontFile.otf</tt>.<br />
*\definefontsynonym :<br />
**[MyFontRegular] : you can use the name you want. It will be use at the next line ;<br />
**The name after <tt>name:</tt> is the name given by <tt>mtxrun --script font --list</tt><br />
**The « name: » part can be replaced by <tt>file:TheFontFile.otf</tt><br />
<br />
<br />
== Example ==<br />
<br />
<br />
Now to access, say the regular warnock font, the following are valid. And I ought to mention that Hans recommends the first http://article.gmane.org/gmane.comp.tex.context/43685.<br />
<br />
<texcode><br />
% Hans recommends this format;<br />
\definefontsynonym [WarnockPro-Regular] [name:warnockproregular] <br />
</texcode><br />
<br />
and<br />
<br />
<texcode><br />
\definefontsynonym [WarnockPro-Regular] [name:WarnockPro-Regular]<br />
</texcode><br />
<br />
An entire typescript would be defined as;<br />
<br />
<texcode><br />
\definefontfeature[latin-smallcaps][smallcaps][script=latn]<br />
<br />
\starttypescript [serif] [warnockpro]<br />
\setups[font:fallback:sans]<br />
\definefontsynonym [WarnockPro-Regular] [name:WarnockPro-Regular] <br />
\definefontsynonym [WarnockPro-Bold] [name:WarnockPro-Bold] <br />
\definefontsynonym [WarnockPro-Italic] [name:WarnockPro-It] <br />
\definefontsynonym [WarnockPro-BoldItalic] [name:WarnockPro-BoldIt] <br />
\stoptypescript<br />
<br />
\starttypescript [serif] [warnockpro]<br />
\definefontsynonym [Serif] [WarnockPro-Regular] [features=default]<br />
\definefontsynonym [SerifBold] [WarnockPro-Bold] [features=default]<br />
\definefontsynonym [SerifItalic] [WarnockPro-Italic] [features=default]<br />
\definefontsynonym [SerifBoldItalic] [WarnockPro-BoldItalic] [features=default]<br />
\definefontsynonym [SerifCaps] [Serif] [features=latin-smallcaps]<br />
\stoptypescript<br />
<br />
\definetypeface[adobe][rm][serif][warnockpro][default]<br />
\setupbodyfont[adobe,11pt]<br />
<br />
</texcode><br />
<br />
= References =<br />
<references/><br />
<br />
[[Category:Fonts]]<br />
[[Category:International]]<br />
[[Category:LuaTeX]]</div>Aksdb