LuaTeX + microtype: Small Caps vs. Letter Spacing
Hi everyone, I'm happy to see that by now almost all of microtype's features are available in Lua, almost like in the old days. There's one thing that seems a bit strange, though: While I have no trouble applying letter spacing using \textls or \lsstyle to regular, italic, or bold text, I can't get it to work on small caps. What's even stranger: while this problem occurs with all fonts I've tried, it does /not/ occur when I don't specify a font at all. Consider the example below. The only way to get the correct output, with spaced small caps, is to deactivate the \setmainfont line -- which obviously isn't what you'd want :) Any hints are appreciated; chances are I just have to add a thing here or there. best Nils. \documentclass{scrartcl} \usepackage{fontspec,microtype} \setmainfont{Minion Pro}%or TeX Gyre Termes, or Latin Modern Roman... \begin{document} stealing sheep\par \textls{stealing sheep}\par \textsc{stealing sheep}\par \textls{\textit{stealing sheep}}\par \textls{\textbf{stealing sheep}}\par \textls{\textsc{stealing sheep}} \end{document}
On 14-6-2011 9:52, N. Lindenhayn wrote:
\documentclass{scrartcl} \usepackage{fontspec,microtype} \setmainfont{Minion Pro}%or TeX Gyre Termes, or Latin Modern Roman... \begin{document} stealing sheep\par \textls{stealing sheep}\par \textsc{stealing sheep}\par \textls{\textit{stealing sheep}}\par \textls{\textbf{stealing sheep}}\par \textls{\textsc{stealing sheep}} \end{document}
on this list you should provide an example using context macros Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am Wed, 15 Jun 2011 09:33:38 +0200 schrieb Hans Hagen:
On 14-6-2011 9:52, N. Lindenhayn wrote:
\documentclass{scrartcl} \usepackage{fontspec,microtype} \setmainfont{Minion Pro}%or TeX Gyre Termes, or Latin Modern Roman... \begin{document} stealing sheep\par \textls{stealing sheep}\par \textsc{stealing sheep}\par \textls{\textit{stealing sheep}}\par \textls{\textbf{stealing sheep}}\par \textls{\textsc{stealing sheep}} \end{document}
on this list you should provide an example using context macros
At first I thought that it is a pure latex problem which should better go at comp.text.tex or the lualatex mailing list. But it could be that there is (context) font code or luatex problem. With ConTeXt ver: 2011.06.13 23:08 MKIV fmt: 2011.6.15 (from the minimals) the following fails: \starttext \font\test=file:fxlr.otf \test abc \letterspacefont\lspfont=\font 500 \lspfont blub %breaks: letterspaced font is not small small caps: \font\test=file:fxlr.otf:mode=node;+smcp \test abc \letterspacefont\lspfont=\font 500 \lspfont blub %letterspacefont works: \font\test=file:fxlr.otf:mode=base;+smcp \test abc \letterspacefont\lspfont=\font 500 \lspfont blub \stoptext (fxlr.otf are the linux libertine O fonts as you get them in the libertine package on CTAN. But probably the problem can be tested with every font where small caps are implemented with +smcp). -- Ulrike Fischer
On 15-6-2011 10:59, Ulrike Fischer wrote:
With ConTeXt ver: 2011.06.13 23:08 MKIV fmt: 2011.6.15 (from the minimals) the following fails:
I have to admit that I never used \letterspacefont (luatex offers it as a pdftex compatibility feature and as such it's strongly related to traditional font handling). The command makes a copy of an internal (tfm) + adapted metrics.
\starttext
\font\test=file:fxlr.otf \test abc \letterspacefont\lspfont=\font 500 \lspfont blub
base mode i.e. traditional, so it works
%breaks: letterspaced font is not small small caps: \font\test=file:fxlr.otf:mode=node;+smcp \test abc \letterspacefont\lspfont=\font 500 \lspfont blub
a font defined to use node mode, but the copy is a basemode one so it has regular shapes and no smallcaps (as there are changed on the fly)
%letterspacefont works: \font\test=file:fxlr.otf:mode=base;+smcp \test abc \letterspacefont\lspfont=\font 500 \lspfont blub
base mode i.e. traditional, so it works
\stoptext
So, when someone wants that feature he/she'd better force basemode which is no big deal as letterspacing is selectively applied to often known / specially defined fonts. Anyhow, context users will not use that command / method but instead use \kerncharacters[fraction], as in: {test {\kerncharacters[.5] test \bf test} test} or \setuphead [section] [style=\sca, textstyle={\kerncharacters[.5]}] etc. Support using \letterspacefont is very unlikely to end up in the core font code. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am Wed, 15 Jun 2011 11:48:10 +0200 schrieb Hans Hagen:
On 15-6-2011 10:59, Ulrike Fischer wrote:
With ConTeXt ver: 2011.06.13 23:08 MKIV fmt: 2011.6.15 (from the minimals) the following fails:
I have to admit that I never used \letterspacefont (luatex offers it as a pdftex compatibility feature and as such it's strongly related to traditional font handling). The command makes a copy of an internal (tfm) + adapted metrics.
\starttext
\font\test=file:fxlr.otf \test abc \letterspacefont\lspfont=\font 500 \lspfont blub
base mode i.e. traditional, so it works
So, when someone wants that feature he/she'd better force basemode which is no big deal as letterspacing is selectively applied to often known / specially defined fonts.
Ah. Ok that explains it. This means that in latex/fontspec it works with \setmainfont[Renderer=basic]{...}.
Anyhow, context users will not use that command / method but instead use \kerncharacters[fraction], as in:
{test {\kerncharacters[.5] test \bf test} test}
\kerncharacters is define in typo-krn. As far as I can see from luatex-fonts.lua the generic code doesn't load typo-krn. Does that mean that letterspacing in node-mode with latex would need some new code? -- Ulrike Fischer
On 15-6-2011 12:51, Ulrike Fischer wrote:
Ah. Ok that explains it. This means that in latex/fontspec it works with \setmainfont[Renderer=basic]{...}.
I guess so (if basic == basemode). There's nothing wrong with basemode in such cases.
\kerncharacters is define in typo-krn. As far as I can see from luatex-fonts.lua the generic code doesn't load typo-krn. Does that mean that letterspacing in node-mode with latex would need some new code?
It depends (one can also to it at the tex end using macros or some lua parsing as normally this kind of inter character kerning is happening in controller situations). In context a lot happens in lua nowadays (but we need to keep an eye on interference). I expect to do some more in this area. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Ah. Ok that explains it. This means that in latex/fontspec it works with \setmainfont[Renderer=basic]{...}.
I guess so (if basic == basemode). There's nothing wrong with basemode in such cases.
thanks Ulrike and Hans for the comments. It works fine with Renderer=basic, although I'm not sure what the side effects of switching from Full to Basic will be (it's not a particularly well documented feature, at least in the fontspec manual). Sorry for posting to the wrong list; I was thinking about putting this in the Lua list, but I remembered someone saying anything Lua related is welcome on the ConTeXt list as well... which it probably is, but LuaLa(!)TeX is a different story, obviously. I'll try to gather more info on the renderer issue, wait a day or two for more comments here, and then will post the problem to the Lua list. take care Nils
On 15-6-2011 7:12, N. Lindenhayn wrote:
Ah. Ok that explains it. This means that in latex/fontspec it works with \setmainfont[Renderer=basic]{...}.
I guess so (if basic == basemode). There's nothing wrong with basemode in such cases.
thanks Ulrike and Hans for the comments. It works fine with Renderer=basic, although I'm not sure what the side effects of switching from Full to Basic will be (it's not a particularly well documented feature, at least in the fontspec manual).
In most cases a basic mode is good enough when you want to do intercharacter spacing as it makes only sense for scripts that have isolated glyphs (even ligatures are to be avoided).
Sorry for posting to the wrong list; I was thinking about putting this in the Lua list, but I remembered someone saying anything Lua related is welcome on the ConTeXt list as well... which it probably is, but LuaLa(!)TeX is a different story, obviously. I'll try to gather more info on the renderer issue, wait a day or two for more comments here, and then will post the problem to the Lua list.
it's no problem at all posting here, it's just that you get more respons when there is a context example given Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
N. Lindenhayn
-
Ulrike Fischer