{"id":122,"date":"2020-11-11T03:45:23","date_gmt":"2020-11-11T03:45:23","guid":{"rendered":"https:\/\/nitens.org\/w\/?page_id=122"},"modified":"2021-04-03T22:54:00","modified_gmt":"2021-04-03T22:54:00","slug":"texopentype","status":"publish","type":"page","link":"https:\/\/nitens.org\/w\/texopentype\/","title":{"rendered":"texopentype"},"content":{"rendered":"<h2>Accessing OpenType font features in&nbsp;<span class=\"latex\">L<sup>A<\/sup>T<sub>E<\/sub>X<\/span><\/h2>\n<p><a class=\"\" href=\"https:\/\/nitens.org\/w\/latex\"><img decoding=\"async\" class=\"right alignleft\" title=\"The Beauty of LaTeX\" src=\"https:\/\/nitens.org\/img\/latex\/effects.jpg\" alt=\"OpenType feature example\"><\/a>Mainstream typography websites discussing OpenType support in design and typesetting applications (<a class=\"ext\" href=\"https:\/\/web.archive.org\/web\/20200204020007\/http:\/\/ilovetypography.com\/OpenType\/opentype-features.html\">1<\/a>&#8211;<a class=\"ext\" href=\"https:\/\/web.archive.org\/web\/20200204020007\/http:\/\/www.typotheque.com\/fonts\/opentype_feature_support\">2<\/a>) seem to be largely unaware of the&nbsp;<a class=\"ext\" href=\"http:\/\/scripts.sil.org\/xetex\">amazing work<\/a>&nbsp;done by the creators of the&nbsp;<span class=\"latex\">X<sub>\u018e<\/sub>T<sub>E<\/sub>X<\/span>&nbsp;typesetting system and of its high-level interface to OpenType features (the&nbsp;<a class=\"ext\" href=\"http:\/\/www.ctan.org\/tex-archive\/macros\/latex\/contrib\/fontspec\/\">fontspec<\/a>&nbsp;package). To bridge this gap I put together a table with a list of font features currently supported in&nbsp;<span class=\"latex\">X<sub>\u018e<\/sub>T<sub>E<\/sub>X<\/span>, based on version&nbsp;<tt>2.0<\/tt>&nbsp;of fontspec.&nbsp;<span class=\"latex\">T<sub>E<\/sub>X<\/span>&nbsp;distributions such as&nbsp;<span class=\"latex\">X<sub>\u018e<\/sub>T<sub>E<\/sub>X<\/span>&nbsp;allow you to make the most of the&nbsp;<a class=\"\" href=\"..\/latex\">advanced typographic features<\/a>&nbsp;available with expert fonts via a simple user interface.<\/p>\n<h4>Activating font features with fontspec<\/h4>\n<p>Specific OpenType features can be activated globally, by declaring them in the document defaults:<\/p>\n<div class=\"code\">\n<pre>\\setmainfont[&lt;font features&gt;]{&lt;font name&gt;}<\/pre>\n<\/div>\n<p>or locally in the text, only when needed:<\/p>\n<div class=\"code\">\n<pre>\\addfontfeature{&lt;font features&gt;}<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<table class=\"data\">\n<caption>List of OpenType features supported in fontspec<\/caption>\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>Tags<\/th>\n<th>Fontspec options<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th colspan=\"4\"><strong>1. Numbers<\/strong><\/th>\n<\/tr>\n<tr>\n<td>Proportional Oldstyle<\/td>\n<td><tt>pnum+onum<\/tt><\/td>\n<td><tt>Numbers={Proportional,Oldstyle}<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Tabular Lining<\/td>\n<td><tt>tnum+lnum<\/tt><\/td>\n<td><tt>Numbers={Monospaced,Lining}<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Proportional Lining<\/td>\n<td><tt>pnum+lnum<\/tt><\/td>\n<td><tt>Numbers={Proportional,Lining}<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Tabular Oldstyle<\/td>\n<td><tt>tnum+onum<\/tt><\/td>\n<td><tt>Numbers={Monospaced,OldStyle}<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<th colspan=\"4\"><strong>2. Ligatures<\/strong><\/th>\n<\/tr>\n<tr>\n<td>Standard Ligatures<\/td>\n<td><tt>liga<\/tt><\/td>\n<td><tt>Ligatures=Common<\/tt><\/td>\n<td><span class=\"notes\">on by default, can be disabled with:<\/span>&nbsp;<tt>NoCommon<\/tt><\/td>\n<\/tr>\n<tr>\n<td>Required Ligatures<\/td>\n<td><tt>rlig<\/tt><\/td>\n<td><tt>Ligatures=Required<\/tt><\/td>\n<td><span class=\"notes\">on by default, can be disabled with:<\/span>&nbsp;<tt>NoRequired<\/tt><\/td>\n<\/tr>\n<tr>\n<td>Contextual Ligatures<\/td>\n<td><tt>clig<\/tt><\/td>\n<td><tt>Ligatures=Contextual<\/tt><\/td>\n<td><span class=\"notes\">on by default, can be disabled with:<\/span>&nbsp;<tt>NoContextual<\/tt><\/td>\n<\/tr>\n<tr>\n<td>Discretionary Ligatures<\/td>\n<td><tt>dlig<\/tt><\/td>\n<td><tt>Ligatures=Rare<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Historical Ligatures<\/td>\n<td><tt>hlig<\/tt><\/td>\n<td><tt>Ligatures=Historical<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<th colspan=\"4\"><strong>3. Letters<\/strong><\/th>\n<\/tr>\n<tr>\n<td>All Caps<\/td>\n<td><tt>case<\/tt><\/td>\n<td><tt>Letters=Uppercase<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Small Caps<\/td>\n<td><tt>smcp<\/tt><\/td>\n<td><tt>Letters=SmallCaps<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Petite Caps<\/td>\n<td><tt>pcap<\/tt><\/td>\n<td><tt>Letters=PetiteCaps<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Capitals to Small Caps<\/td>\n<td><tt>c2sc<\/tt><\/td>\n<td><tt>Letters=UppercaseSmallCaps<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Capitals to Petite Caps<\/td>\n<td><tt>c2pc<\/tt><\/td>\n<td><tt>Letters=UppercasePetiteCaps<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Unicase<\/td>\n<td><tt>unic<\/tt><\/td>\n<td><tt>Letters=Unicase<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<th colspan=\"4\"><strong>4. Contextuals<\/strong><\/th>\n<\/tr>\n<tr>\n<td>Contextual Swash<\/td>\n<td><tt>cswh<\/tt><\/td>\n<td><tt>Contextuals=Swash<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Contextual Alternate<\/td>\n<td><tt>calt<\/tt><\/td>\n<td><tt>Contextuals=Alternate<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Initial Form<\/td>\n<td><tt>init<\/tt><\/td>\n<td><tt>Contextuals=WordInitial<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Final Form<\/td>\n<td><tt>fina<\/tt><\/td>\n<td><tt>Contextuals=WordFinal<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Medial Form<\/td>\n<td><tt>medi<\/tt><\/td>\n<td><tt>Contextuals=Inner<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Line Final<\/td>\n<td><tt>falt<\/tt><\/td>\n<td><tt>Contextuals=LineFinal<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<th colspan=\"4\"><strong>5. Vertical Position<\/strong><\/th>\n<\/tr>\n<tr>\n<td>Superscript<\/td>\n<td><tt>sups<\/tt><\/td>\n<td><tt>VerticalPosition=Superior<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Subscript<\/td>\n<td><tt>subs<\/tt><\/td>\n<td><tt>VerticalPosition=Inferior<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Scientific Inferiors<\/td>\n<td><tt>sinf<\/tt><\/td>\n<td><tt>VerticalPosition=ScientificInferior<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Ordinals<\/td>\n<td><tt>ordn<\/tt><\/td>\n<td><tt>VerticalPosition=Ordinal<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<th colspan=\"4\"><strong>6. Fractions<\/strong><\/th>\n<\/tr>\n<tr>\n<td>Numerator<\/td>\n<td><tt>numr<\/tt><\/td>\n<td><tt>VerticalPosition=Numerator<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Denominator<\/td>\n<td><tt>dnom<\/tt><\/td>\n<td><tt>VerticalPosition=Denominator<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Fractions<\/td>\n<td><tt>frac<\/tt><\/td>\n<td><tt>Fractions=On<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Alternate Fractions<\/td>\n<td><tt>afrc<\/tt><\/td>\n<td><tt>Fractions=Alternate<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<th colspan=\"4\"><strong>7. Style and alternate glyphs<\/strong><\/th>\n<\/tr>\n<tr>\n<td>Stylistic Sets<\/td>\n<td><tt>ss01\u2026ss20<\/tt><\/td>\n<td><tt>StylisticSet=1<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Stylistic Alternates<\/td>\n<td><tt>salt<\/tt><\/td>\n<td><tt>Style=Alternate<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Italic<\/td>\n<td><tt>ital<\/tt><\/td>\n<td><tt>Style=Italic<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Ruby<\/td>\n<td><tt>ruby<\/tt><\/td>\n<td><tt>Style=Ruby<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Historical Forms<\/td>\n<td><tt>hist<\/tt><\/td>\n<td><tt>Style=Historic<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Titling Forms<\/td>\n<td><tt>titl<\/tt><\/td>\n<td><tt>Style=Titling<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Horizontal Kana<\/td>\n<td><tt>hkna<\/tt><\/td>\n<td><tt>Style=HorizontalKana<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Vertical Kana<\/td>\n<td><tt>vkna<\/tt><\/td>\n<td><tt>Style=VerticalKana<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<th colspan=\"4\"><strong>8. Diacritics<\/strong><\/th>\n<\/tr>\n<tr>\n<td>Mark Positioning<\/td>\n<td><tt>mark<\/tt><\/td>\n<td><tt>Diacritics=MarkToBase<\/tt><\/td>\n<td><span class=\"notes\">on by default, can be disabled with:<\/span>&nbsp;<tt>NoMarkToBase<\/tt><\/td>\n<\/tr>\n<tr>\n<td>Mark-to-mark Positioning<\/td>\n<td><tt>mkmk<\/tt><\/td>\n<td><tt>Diacritics=MarkToMark<\/tt><\/td>\n<td><span class=\"notes\">on by default, can be disabled with:<\/span>&nbsp;<tt>NoMarkToMark<\/tt><\/td>\n<\/tr>\n<tr>\n<td>Above-base Positioning<\/td>\n<td><tt>abvm<\/tt><\/td>\n<td><tt>Diacritics=AboveBase<\/tt><\/td>\n<td><span class=\"notes\">on by default, can be disabled with:<\/span>&nbsp;<tt>NoAboveBase<\/tt><\/td>\n<\/tr>\n<tr>\n<td>Below-base Positioning<\/td>\n<td><tt>blvm<\/tt><\/td>\n<td><tt>Diacritics=BelowBase<\/tt><\/td>\n<td><span class=\"notes\">on by default, can be disabled with:<\/span>&nbsp;<tt>NoBelowBase<\/tt><\/td>\n<\/tr>\n<tr>\n<th colspan=\"4\"><strong>9. Kerning<\/strong><\/th>\n<\/tr>\n<tr>\n<td>Uppercase kerning<\/td>\n<td><tt>cpsp<\/tt><\/td>\n<td><tt>Kerning=Uppercase<\/tt><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Regular kerning<\/td>\n<td><tt>kern<\/tt><\/td>\n<td><tt>Kerning=On<\/tt><\/td>\n<td><span class=\"notes\">on by default, can be disabled with:<\/span>&nbsp;<tt>Off<\/tt><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Notes<\/h4>\n<ul>\n<li>Further information about script-specific OpenType features controlling&nbsp;<em>CJK shape<\/em>,&nbsp;<em>Character width<\/em>&nbsp;and&nbsp;<em>Vertical typesetting<\/em>&nbsp;can be found in section 10 of the&nbsp;<a class=\"ext\" href=\"http:\/\/www.ctan.org\/tex-archive\/macros\/xetex\/latex\/fontspec\/fontspec.pdf\">fontspec documentation<\/a>.<\/li>\n<li>Additional OpenType features for which&nbsp;<tt>fontspec<\/tt>&nbsp;does not provide an interface can be manually accessed, as described in section Part 4, section 14 of the&nbsp;<a class=\"ext\" href=\"http:\/\/www.ctan.org\/tex-archive\/macros\/xetex\/latex\/fontspec\/fontspec.pdf\">fontspec documentation<\/a>.<\/li>\n<\/ul>\n<h4>See also<\/h4>\n<p><a class=\"\" href=\"https:\/\/nitens.org\/w\/latex\"><img loading=\"lazy\" decoding=\"async\" class=\"left_border alignleft\" title=\"The beauty of LaTeX\" src=\"https:\/\/nitens.org\/img\/mini\/latex.jpg\" alt=\"[latex]\" width=\"56\" height=\"56\"><\/a><a class=\"\" href=\"..\/latex\">The Beauty of <span class=\"latex\">L<sup>A<\/sup>T<sub>E<\/sub>X<\/span><\/a><br \/>\nA comparison of typographic accuracy in&nbsp;<span class=\"latex\">L<sup>A<\/sup>T<sub>E<\/sub>X<\/span>&nbsp;vs ordinary word processors.<\/p>\n<p><a class=\"\" href=\"https:\/\/nitens.org\/w\/cvtex\"><img loading=\"lazy\" decoding=\"async\" class=\"left_border alignleft\" title=\"Typesetting an academic CV in LaTeX\" src=\"https:\/\/nitens.org\/img\/mini\/cvtex.jpg\" alt=\"[latex]\" width=\"58\" height=\"58\"><\/a><a class=\"\" href=\"..\/cvtex\">Typesetting an academic CV in <span class=\"latex\">L<sup>A<\/sup>T<sub>E<\/sub>X<\/span><\/a><br \/>\nTemplates to compile an academic curriculum vitae or resume using&nbsp;<span class=\"latex\">X<sub>\u018e<\/sub>T<sub>E<\/sub>X<\/span>&nbsp;and expert fonts.<\/p>\n<p><a class=\"\" href=\"https:\/\/nitens.org\/w\/tools\"><img loading=\"lazy\" decoding=\"async\" class=\"left_border alignleft\" title=\"LaTeX on Mac OS\" src=\"https:\/\/nitens.org\/img\/mini\/tools.jpg\" alt=\"[latex tools]\" width=\"57\" height=\"57\"><\/a><a class=\"\" href=\"..\/tools\"><span class=\"latex\">L<sup>A<\/sup>T<sub>E<\/sub>X <\/span>on Mac OS<\/a><br \/>\nA review of open source software, tools and fonts to use&nbsp;<span class=\"latex\">L<sup>A<\/sup>T<sub>E<\/sub>X<\/span>&nbsp;and&nbsp;<span class=\"latex\">X<sub>\u018e<\/sub>T<sub>E<\/sub>X<\/span>&nbsp;on Mac OS.<\/p>\n<p><a class=\"\" href=\"https:\/\/nitens.org\/w\/texlogo\"><img loading=\"lazy\" decoding=\"async\" class=\"left_border alignleft\" title=\"Pure CSS TeX logo\" src=\"https:\/\/nitens.org\/img\/mini\/tools.jpg\" alt=\"[latex css logos]\" width=\"58\" height=\"58\"><\/a><a class=\"\" href=\"..\/texlogo\">Pure CSS <span class=\"latex\">T<sub>E<\/sub>X <\/span>logos<\/a><br \/>\nA simple hack to generate&nbsp;<span class=\"latex\">T<sub>E<\/sub>X<\/span>,&nbsp;<span class=\"latex\">L<sup>A<\/sup>T<sub>E<\/sub>X<\/span>&nbsp;and&nbsp;<span class=\"latex\">X<sub>\u018e<\/sub>T<sub>E<\/sub>X<\/span>&nbsp;logos in plain CSS.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Accessing OpenType font features in&nbsp;LATEX Mainstream typography websites discussing OpenType support in design and typesetting applications (1&#8211;2) seem to be largely unaware of the&nbsp;amazing work&nbsp;done by the creators of the&nbsp;X\u018eTEX&nbsp;typesetting system and of its high-level interface to OpenType features (the&nbsp;fontspec&nbsp;package). To bridge this gap I put together a table with a list of font features &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/nitens.org\/w\/texopentype\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;texopentype&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"nf_dc_page":"","_vp_format_video_url":"","_vp_image_focal_point":[],"footnotes":""},"class_list":["post-122","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/nitens.org\/w\/wp-json\/wp\/v2\/pages\/122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nitens.org\/w\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/nitens.org\/w\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/nitens.org\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nitens.org\/w\/wp-json\/wp\/v2\/comments?post=122"}],"version-history":[{"count":3,"href":"https:\/\/nitens.org\/w\/wp-json\/wp\/v2\/pages\/122\/revisions"}],"predecessor-version":[{"id":241,"href":"https:\/\/nitens.org\/w\/wp-json\/wp\/v2\/pages\/122\/revisions\/241"}],"wp:attachment":[{"href":"https:\/\/nitens.org\/w\/wp-json\/wp\/v2\/media?parent=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}