Re: [patch] LuaTeX

2010-11-27 Thread Jürgen Spitzmüller
Guenter Milde wrote:
 Regarding the naming:  it is IMO best to call the button use System
 fonts. 

I won't touch the naming anymore.

Jürgen


Re: [patch] LuaTeX

2010-11-27 Thread Enrico Forestieri
On Sat, Nov 27, 2010 at 11:25:51AM +0100, Jürgen Spitzmüller wrote:

 Guenter Milde wrote:
  Regarding the naming:  it is IMO best to call the button use System
  fonts. 
 
 I won't touch the naming anymore.

I agree with Günter. Please reconsider.

-- 
Enrico


Re: [patch] LuaTeX

2010-11-27 Thread Jürgen Spitzmüller
Enrico Forestieri wrote:
  Guenter Milde wrote:
   Regarding the naming:  it is IMO best to call the button use System
   fonts. 
 
  
 
  I won't touch the naming anymore.
 
 I agree with Günter. Please reconsider.

Well, my initial proposal was Use System Fonts. Then people objected (also 
Günter and you), and after a long discussion, we ended up with the text font 
thing.

Sorry, I'm fed up with this.

Jürgen


Re: [patch] LuaTeX

2010-11-27 Thread Jürgen Spitzmüller
Guenter Milde wrote:
 On 2010-11-26, Jürgen Spitzmüller wrote:
  Guenter Milde wrote:
  Both xelatex and luatlaex can use TeX fonts and PSNFSS:
  OK, I tried this now. The two engines indeed seem to be able to deal with
  these font packages. However, as soon as the fontspec package is loaded,
  it doesn't work anymore (and there will always be LM in the output).
 
 LM is the fontspec default. If it is really used, depends on the loading
 order. The following gives Bookman output here.
 
 \documentclass{minimal}
 \usepackage{fixltx2e}
 \usepackage{fontspec}
 \usepackage{bookman}
 \usepackage[T1]{fontenc}
 \usepackage[utf8]{inputenc}
 \begin{document}
 Hallo Welt!
 \end{document}

And fontenc seems to be needed as well.

  fontspec is automatically loaded at least by xltxtra and polyglossia.
  So if we provide tex fonts support with XeTeX, we will have to use
  babel and omit xltxtra. We can do that, but do we really want to
  provide such a limited choice?
 
 I don't know whether it is really usefull. Maybe some day people want to
 use LuaTeX with some font that only exists in TeX encoding...
 
 But you could keep the use non-TeX fonts (or better use System fonts
 or use fontspec) button and make \usepackage{fontspec} as well as the
 choice of babel vs. polyglossia dependent on its setting.

The latter is no good idea, IMHO. Who will understand that whether babel or 
polyglossia is used depends on the font choice?

 xltxtra is no longer recommended by its author. The recommended parts of
 it are moved to fontspec now.

 It changes the math setup and super- and subscripting in a way that
 should not be forced on the user without choice.
 
 Also, it loads fixltx2e.sty, which you did not want to load whithout a
 means to disable it!

At the time when I wrote this code, I read that the two packages (xunicode and 
xltxtra) should always be loaded with every XeTeX document. So I did.

But I will happily remove it if it is not really necessary.

 AFAIK, xunicode should not be used with luatex.

It isn't.

 Thanks,
 
 Günter

Jürgen


Re: [patch] LuaTeX

2010-11-27 Thread Enrico Forestieri
On Sat, Nov 27, 2010 at 02:26:44PM +0100, Jürgen Spitzmüller wrote:

 Enrico Forestieri wrote:
   Guenter Milde wrote:
Regarding the naming:  it is IMO best to call the button use System
fonts. 
  
   
  
   I won't touch the naming anymore.
  
  I agree with Günter. Please reconsider.
 
 Well, my initial proposal was Use System Fonts. Then people objected (also 
 Günter and you), and after a long discussion, we ended up with the text font 
 thing.

I think the only one that objected to Use System Fonts was JMarc.
I was objecting as regards using LaTeXFonts vs TeXFonts, and Günter was
rather proposing UnicodeFonts instead of (La)TeXFonts.

 Sorry, I'm fed up with this.

I understand and will shut up from now on.

-- 
Enrico


Re: [patch] LuaTeX

2010-11-27 Thread Guenter Milde
On 2010-11-27, Jürgen Spitzmüller wrote:
 Guenter Milde wrote:
 On 2010-11-26, Jürgen Spitzmüller wrote:
  Guenter Milde wrote:
  Both xelatex and luatlaex can use TeX fonts and PSNFSS:
  OK, I tried this now. The two engines indeed seem to be able to deal with
  these font packages. However, as soon as the fontspec package is loaded,
  it doesn't work anymore (and there will always be LM in the output).

 LM is the fontspec default. If it is really used, depends on the loading
 order. The following gives Bookman output here.

 \documentclass{minimal}
 \usepackage{fixltx2e}
 \usepackage{fontspec}
 \usepackage{bookman}
 \usepackage[T1]{fontenc}
 \usepackage[utf8]{inputenc}
 \begin{document}
 Hallo Welt!
 \end{document}

 And fontenc seems to be needed as well.

For T1 encoded fonts, yes.

However, this was only for the sake of argument. In praxi, it
does not make sense to load both, but rather select between

 fontspec: Unicode-encoded fonts (non-tex fonts, system fonts)
   (TeX encoding EU1 or EU2 (Experimental Unicode))

   * font setup via fontspec commands
   * works only with xetex or luatex engines

or 

 fontenc: TeX encoded fonts (T1, Tn, OTn, LGR, LY, ...)

   * font setup via packages (lmodern, tgtermes, arev, ...)
 or NFSS commands
   * works with tex, etex, pdftex, xetex, and luatex engines


  fontspec is automatically loaded at least by xltxtra and polyglossia.
  So if we provide tex fonts support with XeTeX, we will have to use
  babel and omit xltxtra. We can do that, but do we really want to
  provide such a limited choice?

 I don't know whether it is really usefull. Maybe some day people want to
 use LuaTeX with some font that only exists in TeX encoding...

 But you could keep the use non-TeX fonts (or better use System fonts
 or use fontspec) button and make \usepackage{fontspec} as well as the
 choice of babel vs. polyglossia dependent on its setting.

 The latter is no good idea, IMHO. Who will understand that whether babel or 
 polyglossia is used depends on the font choice?

Font setup package and language setup package are inter-dependent: 

babel
  with some languages (Greek, Russian, ...), babel requires fontenc and
  employs NFSS commands for font encoding switches.

polyglossia
  always requires fontspec (language-independent)
  provides a hook to select language-dependent fonts via fontspec.

The problem is, how to present this mutual dependency to the user...

Also, since fontenc is now luatex-save, I don't know which language setup
package is better to use with LuaLaTeX output.


 xltxtra is no longer recommended by its author. The recommended parts of
 it are moved to fontspec now.

 It changes the math setup and super- and subscripting in a way that
 should not be forced on the user without choice.

 Also, it loads fixltx2e.sty, which you did not want to load whithout a
 means to disable it!

 At the time when I wrote this code, I read that the two packages
 (xunicode and xltxtra) should always be loaded with every XeTeX
 document. So I did.

So did I. 
(But things moved with the LuaLaTeX support of fontspec.)

 But I will happily remove it if it is not really necessary.

 AFAIK, xunicode should not be used with luatex.

 It isn't.

Fine. 

I don't know whether it is needed with XeTeX either:

  The package provides access to latin accents and many other characters
  in the Unicode lower plane [xunicode README]

via the established LaTeX macros. Are there places, where LyX's XeTeX
export uses macros instead of Unicode characters?
But we could also decide to leave it in -- just in case or so that ERT
marcros will not break by switching from pdftex to xetex.


Thanks for your work,

Günter



Re: [patch] LuaTeX

2010-11-27 Thread Jürgen Spitzmüller
Guenter Milde wrote:
> Regarding the naming:  it is IMO best to call the button "use System
> fonts". 

I won't touch the naming anymore.

Jürgen


Re: [patch] LuaTeX

2010-11-27 Thread Enrico Forestieri
On Sat, Nov 27, 2010 at 11:25:51AM +0100, Jürgen Spitzmüller wrote:

> Guenter Milde wrote:
> > Regarding the naming:  it is IMO best to call the button "use System
> > fonts". 
> 
> I won't touch the naming anymore.

I agree with Günter. Please reconsider.

-- 
Enrico


Re: [patch] LuaTeX

2010-11-27 Thread Jürgen Spitzmüller
Enrico Forestieri wrote:
> > Guenter Milde wrote:
> > > Regarding the naming:  it is IMO best to call the button "use System
> > > fonts". 
> >
> > 
> >
> > I won't touch the naming anymore.
> 
> I agree with Günter. Please reconsider.

Well, my initial proposal was "Use System Fonts". Then people objected (also 
Günter and you), and after a long discussion, we ended up with the text font 
thing.

Sorry, I'm fed up with this.

Jürgen


Re: [patch] LuaTeX

2010-11-27 Thread Jürgen Spitzmüller
Guenter Milde wrote:
> On 2010-11-26, Jürgen Spitzmüller wrote:
> > Guenter Milde wrote:
> >> Both xelatex and luatlaex can use TeX fonts and PSNFSS:
> > OK, I tried this now. The two engines indeed seem to be able to deal with
> > these font packages. However, as soon as the fontspec package is loaded,
> > it doesn't work anymore (and there will always be LM in the output).
> 
> LM is the fontspec default. If it is really used, depends on the loading
> order. The following gives Bookman output here.
> 
> \documentclass{minimal}
> \usepackage{fixltx2e}
> \usepackage{fontspec}
> \usepackage{bookman}
> \usepackage[T1]{fontenc}
> \usepackage[utf8]{inputenc}
> \begin{document}
> Hallo Welt!
> \end{document}

And fontenc seems to be needed as well.

> > fontspec is automatically loaded at least by xltxtra and polyglossia.
> > So if we provide tex fonts support with XeTeX, we will have to use
> > babel and omit xltxtra. We can do that, but do we really want to
> > provide such a limited choice?
> 
> I don't know whether it is really usefull. Maybe some day people want to
> use LuaTeX with some font that only exists in TeX encoding...
> 
> But you could keep the "use non-TeX fonts" (or better "use System fonts"
> or "use fontspec") button and make "\usepackage{fontspec}" as well as the
> choice of babel vs. polyglossia dependent on its setting.

The latter is no good idea, IMHO. Who will understand that whether babel or 
polyglossia is used depends on the font choice?

> xltxtra is no longer recommended by its author. The recommended parts of
> it are moved to fontspec now.
>
> It changes the math setup and super- and subscripting in a way that
> should not be forced on the user without choice.
> 
> Also, it loads fixltx2e.sty, which you did not want to load whithout a
> means to disable it!

At the time when I wrote this code, I read that the two packages (xunicode and 
xltxtra) should always be loaded with every XeTeX document. So I did.

But I will happily remove it if it is not really necessary.

> AFAIK, xunicode should not be used with luatex.

It isn't.

> Thanks,
> 
> Günter

Jürgen


Re: [patch] LuaTeX

2010-11-27 Thread Enrico Forestieri
On Sat, Nov 27, 2010 at 02:26:44PM +0100, Jürgen Spitzmüller wrote:

> Enrico Forestieri wrote:
> > > Guenter Milde wrote:
> > > > Regarding the naming:  it is IMO best to call the button "use System
> > > > fonts". 
> > >
> > > 
> > >
> > > I won't touch the naming anymore.
> > 
> > I agree with Günter. Please reconsider.
> 
> Well, my initial proposal was "Use System Fonts". Then people objected (also 
> Günter and you), and after a long discussion, we ended up with the text font 
> thing.

I think the only one that objected to "Use System Fonts" was JMarc.
I was objecting as regards using LaTeXFonts vs TeXFonts, and Günter was
rather proposing UnicodeFonts instead of (La)TeXFonts.

> Sorry, I'm fed up with this.

I understand and will shut up from now on.

-- 
Enrico


Re: [patch] LuaTeX

2010-11-27 Thread Guenter Milde
On 2010-11-27, Jürgen Spitzmüller wrote:
> Guenter Milde wrote:
>> On 2010-11-26, Jürgen Spitzmüller wrote:
>> > Guenter Milde wrote:
>> >> Both xelatex and luatlaex can use TeX fonts and PSNFSS:
>> > OK, I tried this now. The two engines indeed seem to be able to deal with
>> > these font packages. However, as soon as the fontspec package is loaded,
>> > it doesn't work anymore (and there will always be LM in the output).

>> LM is the fontspec default. If it is really used, depends on the loading
>> order. The following gives Bookman output here.

>> \documentclass{minimal}
>> \usepackage{fixltx2e}
>> \usepackage{fontspec}
>> \usepackage{bookman}
>> \usepackage[T1]{fontenc}
>> \usepackage[utf8]{inputenc}
>> \begin{document}
>> Hallo Welt!
>> \end{document}

> And fontenc seems to be needed as well.

For T1 encoded fonts, yes.

However, this was only for the sake of argument. In praxi, it
does not make sense to load both, but rather select between

 fontspec: Unicode-encoded fonts ("non-tex fonts", "system fonts")
   (TeX encoding EU1 or EU2 (Experimental Unicode))

   * font setup via fontspec commands
   * works only with xetex or luatex engines

or 

 fontenc: TeX encoded fonts (T1, T, OT, LGR, LY, ...)

   * font setup via packages (lmodern, tgtermes, arev, ...)
 or NFSS commands
   * works with tex, etex, pdftex, xetex, and luatex engines


>> > fontspec is automatically loaded at least by xltxtra and polyglossia.
>> > So if we provide tex fonts support with XeTeX, we will have to use
>> > babel and omit xltxtra. We can do that, but do we really want to
>> > provide such a limited choice?

>> I don't know whether it is really usefull. Maybe some day people want to
>> use LuaTeX with some font that only exists in TeX encoding...

>> But you could keep the "use non-TeX fonts" (or better "use System fonts"
>> or "use fontspec") button and make "\usepackage{fontspec}" as well as the
>> choice of babel vs. polyglossia dependent on its setting.

> The latter is no good idea, IMHO. Who will understand that whether babel or 
> polyglossia is used depends on the font choice?

Font setup package and language setup package are inter-dependent: 

babel
  with some languages (Greek, Russian, ...), babel requires fontenc and
  employs NFSS commands for font encoding switches.

polyglossia
  always requires fontspec (language-independent)
  provides a "hook" to select language-dependent fonts via fontspec.

The problem is, how to present this mutual dependency to the user...

Also, since fontenc is now luatex-save, I don't know which language setup
package is better to use with LuaLaTeX output.


>> xltxtra is no longer recommended by its author. The recommended parts of
>> it are moved to fontspec now.

>> It changes the math setup and super- and subscripting in a way that
>> should not be forced on the user without choice.

>> Also, it loads fixltx2e.sty, which you did not want to load whithout a
>> means to disable it!

> At the time when I wrote this code, I read that the two packages
> (xunicode and xltxtra) should always be loaded with every XeTeX
> document. So I did.

So did I. 
(But things moved with the LuaLaTeX support of fontspec.)

> But I will happily remove it if it is not really necessary.

>> AFAIK, xunicode should not be used with luatex.

> It isn't.

Fine. 

I don't know whether it is needed with XeTeX either:

  The package provides access to latin accents and many other characters
  in the Unicode lower plane [xunicode README]

via the "established" LaTeX macros. Are there places, where LyX's XeTeX
export uses macros instead of Unicode characters?
But we could also decide to leave it in -- just in case or so that ERT
marcros will not break by switching from pdftex to xetex.


Thanks for your work,

Günter



Re: [patch] LuaTeX

2010-11-26 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
 [ ] use extended typesetting capabilities

This is a bit too vague for my taste.

Jürgen


Re: [patch] LuaTeX

2010-11-26 Thread Jean-Marc Lasgouttes

Le 26/11/2010 10:30, Jürgen Spitzmüller a écrit :

Jean-Marc Lasgouttes wrote:

[ ] use extended typesetting capabilities


This is a bit too vague for my taste.


Even with a tooltip? Or

[ ] improved typesetting (xetex, luatex)

JMarc


Re: [patch] LuaTeX

2010-11-26 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
 Even with a tooltip? Or
 
 [ ] improved typesetting (xetex, luatex)

Yes. I'm not even sure it's adaequate. Is XeTeX/LuaTeX really improved? This 
really depends on what you want to achieve.

I really think the fonts description is most adequate, the more so if it 
turns out we can also use XeTeX and LuaTeX without \use_non_tex_fonts (i.e., 
with the tex fonts).

Jürgen


Re: [patch] LuaTeX

2010-11-26 Thread Jean-Marc Lasgouttes

Le 26/11/2010 11:42, Jürgen Spitzmüller a écrit :

Jean-Marc Lasgouttes wrote:

Even with a tooltip? Or

[ ] improved typesetting (xetex, luatex)


Yes. I'm not even sure it's adaequate. Is XeTeX/LuaTeX really improved? This
really depends on what you want to achieve.

I really think the fonts description is most adequate, the more so if it
turns out we can also use XeTeX and LuaTeX without \use_non_tex_fonts (i.e.,
with the tex fonts).


I thought the typesetting algorithm was supposed to be better with more 
action on the font spacing (which is different from being able to use

NewCenturyOldStyleCondensedBlack as main font).

JMarc


Re: [patch] LuaTeX

2010-11-26 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
 I thought the typesetting algorithm was supposed to be better with more 
 action on the font spacing (which is different from being able to use
 NewCenturyOldStyleCondensedBlack as main font).

I don't think so; where did you get this info from?

You can use (with XeTeX) some OpenType features, but in general, the quality 
in pdflatex is not worse, on the contrary (microtypographic features are not 
yet fully implemented in XeTeX and LuaTeX).

Jürgen


Re: [patch] LuaTeX

2010-11-26 Thread Jürgen Spitzmüller
Guenter Milde wrote:
 Both xelatex and luatlaex can use TeX fonts and PSNFSS:
 
 \documentclass{minimal}
 \usepackage{fixltx2e}
 \usepackage{bookman}
 \usepackage[T1]{fontenc}
 \usepackage[utf8]{inputenc}
 
 \begin{document}
 
 Hallo Welt!
 
 \end{document}

OK, I tried this now. The two engines indeed seem to be able to deal with 
these font packages. However, as soon as the fontspec package is loaded, it 
doesn't work anymore (and there will always be LM in the output).

Fontspec is automatically loaded at least by xltxtra and polyglossia. So if we 
provide tex fonts support with XeTeX, we will have to use babel and omit 
xltxtra. We can do that, but do we really want to provide such a limited 
choice?

Attached is a patch, if you want to try it out.

Jürgen
Index: src/Buffer.cpp
===
--- src/Buffer.cpp	(Revision 36500)
+++ src/Buffer.cpp	(Arbeitskopie)
@@ -3630,10 +3630,12 @@
 	vectorstring v;
 	v.push_back(bufferFormat());
 	// FIXME: Don't hardcode format names here, but use a flag
-	if (v.back() == latex)
+	if (v.back() == latex) {
 		v.push_back(pdflatex);
-	else if (v.back() == xetex)
 		v.push_back(luatex);
+		v.push_back(xetex);
+	} else if (v.back() == xetex)
+		v.push_back(luatex);
 	v.push_back(xhtml);
 	v.push_back(text);
 	v.push_back(lyx);
Index: src/BufferParams.cpp
===
--- src/BufferParams.cpp	(Revision 36500)
+++ src/BufferParams.cpp	(Arbeitskopie)
@@ -1896,8 +1896,11 @@
 	if (features.runparams().flavor == OutputParams::XETEX) {
 		os  \\usepackage{xunicode}\n;
 		texrow.newline();
-		os  \\usepackage{xltxtra}\n;
-		texrow.newline();
+		// this must only be loaded if we use OS fonts
+		if (useNonTeXFonts) {
+			os  \\usepackage{xltxtra}\n;
+			texrow.newline();
+		}
 	}
 	// Polyglossia must be loaded after xltxtra
 	if (use_polyglossia) {


Re: [patch] LuaTeX

2010-11-26 Thread Jean-Marc Lasgouttes
Le 26 nov. 2010 à 12:15, Jürgen Spitzmüller a écrit :
 I don't think so; where did you get this info from?

I probably misread the recent thread on lyx-users about LuaTeX and
XeTeX typesetting.

JMarc

Re: [patch] LuaTeX

2010-11-26 Thread Guenter Milde
On 2010-11-25, Jürgen Spitzmüller wrote:
 Guenter Milde wrote:


 Please allow parallel specification of TeXFonts and SystemFonts.

 I think this is plain overkill. The (probably few) people who really need 
 this can easily achieve it by using a portmanteau master file that just 
 includes the actual file and uses other font settings.

Currently (LyX 2.0.0svn (not released yet)
Built on Nov 26 2010, 14:31:19), if I set some fonts and then click the
Use non-TeX fonts button, my selection is lost. It is not restored
when I click again.

I can imagine many people want to compare the output of their document
with several different fonts and also with xetex vs. pdftex.

Given that the [Default] EC TeX fonts are not a good choice (bitmap),
the complete font settings should be stored in the document (so that also
after closing and reopening, the setting could be re-activated.

Regarding the naming:  it is IMO best to call the button use System
fonts. 

* Even if XeTeX/LuaTeX can work with other fonts as well, there is no GUI
  support for them. The drop-down list of non-TeX fonts contains the
  systemwide istalled fonts.
  
* The term system fonts is widely used in descriptions of XeTeX
  features.
  
Günter




Re: [patch] LuaTeX

2010-11-26 Thread Guenter Milde
On 2010-11-26, Jürgen Spitzmüller wrote:
 Guenter Milde wrote:
 Both xelatex and luatlaex can use TeX fonts and PSNFSS:

 OK, I tried this now. The two engines indeed seem to be able to deal with
 these font packages. However, as soon as the fontspec package is loaded, it
 doesn't work anymore (and there will always be LM in the output).

LM is the fontspec default. If it is really used, depends on the loading
order. The following gives Bookman output here.

\documentclass{minimal}
\usepackage{fixltx2e}
\usepackage{fontspec}
\usepackage{bookman}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
Hallo Welt!
\end{document}


 fontspec is automatically loaded at least by xltxtra and polyglossia.
 So if we provide tex fonts support with XeTeX, we will have to use
 babel and omit xltxtra. We can do that, but do we really want to
 provide such a limited choice?

I don't know whether it is really usefull. Maybe some day people want to
use LuaTeX with some font that only exists in TeX encoding...

But you could keep the use non-TeX fonts (or better use System fonts
or use fontspec) button and make \usepackage{fontspec} as well as the
choice of babel vs. polyglossia dependent on its setting.

xltxtra is no longer recommended by its author. The recommended parts of
it are moved to fontspec now.

It changes the math setup and super- and subscripting in a way that
should not be forced on the user without choice.

Also, it loads fixltx2e.sty, which you did not want to load whithout a
means to disable it!

AFAIK, xunicode should not be used with luatex.


Thanks,

Günter



Re: [patch] LuaTeX

2010-11-26 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
> [ ] use extended typesetting capabilities

This is a bit too vague for my taste.

Jürgen


Re: [patch] LuaTeX

2010-11-26 Thread Jean-Marc Lasgouttes

Le 26/11/2010 10:30, Jürgen Spitzmüller a écrit :

Jean-Marc Lasgouttes wrote:

[ ] use extended typesetting capabilities


This is a bit too vague for my taste.


Even with a tooltip? Or

[ ] improved typesetting (xetex, luatex)

JMarc


Re: [patch] LuaTeX

2010-11-26 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
> Even with a tooltip? Or
> 
> [ ] improved typesetting (xetex, luatex)

Yes. I'm not even sure it's adaequate. Is XeTeX/LuaTeX really "improved"? This 
really depends on what you want to achieve.

I really think the "fonts" description is most adequate, the more so if it 
turns out we can also use XeTeX and LuaTeX without \use_non_tex_fonts (i.e., 
with the tex fonts).

Jürgen


Re: [patch] LuaTeX

2010-11-26 Thread Jean-Marc Lasgouttes

Le 26/11/2010 11:42, Jürgen Spitzmüller a écrit :

Jean-Marc Lasgouttes wrote:

Even with a tooltip? Or

[ ] improved typesetting (xetex, luatex)


Yes. I'm not even sure it's adaequate. Is XeTeX/LuaTeX really "improved"? This
really depends on what you want to achieve.

I really think the "fonts" description is most adequate, the more so if it
turns out we can also use XeTeX and LuaTeX without \use_non_tex_fonts (i.e.,
with the tex fonts).


I thought the typesetting algorithm was supposed to be better with more 
action on the font spacing (which is different from being able to use

NewCenturyOldStyleCondensedBlack as main font).

JMarc


Re: [patch] LuaTeX

2010-11-26 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
> I thought the typesetting algorithm was supposed to be better with more 
> action on the font spacing (which is different from being able to use
> NewCenturyOldStyleCondensedBlack as main font).

I don't think so; where did you get this info from?

You can use (with XeTeX) some OpenType features, but in general, the quality 
in pdflatex is not worse, on the contrary (microtypographic features are not 
yet fully implemented in XeTeX and LuaTeX).

Jürgen


Re: [patch] LuaTeX

2010-11-26 Thread Jürgen Spitzmüller
Guenter Milde wrote:
> Both xelatex and luatlaex can use TeX fonts and PSNFSS:
> 
> \documentclass{minimal}
> \usepackage{fixltx2e}
> \usepackage{bookman}
> \usepackage[T1]{fontenc}
> \usepackage[utf8]{inputenc}
> 
> \begin{document}
> 
> Hallo Welt!
> 
> \end{document}

OK, I tried this now. The two engines indeed seem to be able to deal with 
these font packages. However, as soon as the fontspec package is loaded, it 
doesn't work anymore (and there will always be LM in the output).

Fontspec is automatically loaded at least by xltxtra and polyglossia. So if we 
provide tex fonts support with XeTeX, we will have to use babel and omit 
xltxtra. We can do that, but do we really want to provide such a limited 
choice?

Attached is a patch, if you want to try it out.

Jürgen
Index: src/Buffer.cpp
===
--- src/Buffer.cpp	(Revision 36500)
+++ src/Buffer.cpp	(Arbeitskopie)
@@ -3630,10 +3630,12 @@
 	vector v;
 	v.push_back(bufferFormat());
 	// FIXME: Don't hardcode format names here, but use a flag
-	if (v.back() == "latex")
+	if (v.back() == "latex") {
 		v.push_back("pdflatex");
-	else if (v.back() == "xetex")
 		v.push_back("luatex");
+		v.push_back("xetex");
+	} else if (v.back() == "xetex")
+		v.push_back("luatex");
 	v.push_back("xhtml");
 	v.push_back("text");
 	v.push_back("lyx");
Index: src/BufferParams.cpp
===
--- src/BufferParams.cpp	(Revision 36500)
+++ src/BufferParams.cpp	(Arbeitskopie)
@@ -1896,8 +1896,11 @@
 	if (features.runparams().flavor == OutputParams::XETEX) {
 		os << "\\usepackage{xunicode}\n";
 		texrow.newline();
-		os << "\\usepackage{xltxtra}\n";
-		texrow.newline();
+		// this must only be loaded if we use OS fonts
+		if (useNonTeXFonts) {
+			os << "\\usepackage{xltxtra}\n";
+			texrow.newline();
+		}
 	}
 	// Polyglossia must be loaded after xltxtra
 	if (use_polyglossia) {


Re: [patch] LuaTeX

2010-11-26 Thread Jean-Marc Lasgouttes
Le 26 nov. 2010 à 12:15, Jürgen Spitzmüller a écrit :
> I don't think so; where did you get this info from?

I probably misread the recent thread on lyx-users about LuaTeX and
XeTeX typesetting.

JMarc

Re: [patch] LuaTeX

2010-11-26 Thread Guenter Milde
On 2010-11-25, Jürgen Spitzmüller wrote:
> Guenter Milde wrote:


>> Please allow parallel specification of TeXFonts and SystemFonts.

> I think this is plain overkill. The (probably few) people who really need 
> this can easily achieve it by using a portmanteau master file that just 
> includes the actual file and uses other font settings.

Currently (LyX 2.0.0svn (not released yet)
Built on Nov 26 2010, 14:31:19), if I set some fonts and then click the
"Use non-TeX fonts" button, my selection is lost. It is not restored
when I click again.

I can imagine many people want to compare the output of their document
with several different fonts and also with xetex vs. pdftex.

Given that the [Default] EC TeX fonts are not a good choice (bitmap),
the complete font settings should be stored in the document (so that also
after closing and reopening, the setting could be re-activated.

Regarding the naming:  it is IMO best to call the button "use System
fonts". 

* Even if XeTeX/LuaTeX can work with other fonts as well, there is no GUI
  support for them. The drop-down list of "non-TeX fonts" contains the
  systemwide istalled fonts.
  
* The term "system fonts" is widely used in descriptions of XeTeX
  features.
  
Günter




Re: [patch] LuaTeX

2010-11-26 Thread Guenter Milde
On 2010-11-26, Jürgen Spitzmüller wrote:
> Guenter Milde wrote:
>> Both xelatex and luatlaex can use TeX fonts and PSNFSS:

> OK, I tried this now. The two engines indeed seem to be able to deal with
> these font packages. However, as soon as the fontspec package is loaded, it
> doesn't work anymore (and there will always be LM in the output).

LM is the fontspec default. If it is really used, depends on the loading
order. The following gives Bookman output here.

\documentclass{minimal}
\usepackage{fixltx2e}
\usepackage{fontspec}
\usepackage{bookman}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
Hallo Welt!
\end{document}


> fontspec is automatically loaded at least by xltxtra and polyglossia.
> So if we provide tex fonts support with XeTeX, we will have to use
> babel and omit xltxtra. We can do that, but do we really want to
> provide such a limited choice?

I don't know whether it is really usefull. Maybe some day people want to
use LuaTeX with some font that only exists in TeX encoding...

But you could keep the "use non-TeX fonts" (or better "use System fonts"
or "use fontspec") button and make "\usepackage{fontspec}" as well as the
choice of babel vs. polyglossia dependent on its setting.

xltxtra is no longer recommended by its author. The recommended parts of
it are moved to fontspec now.

It changes the math setup and super- and subscripting in a way that
should not be forced on the user without choice.

Also, it loads fixltx2e.sty, which you did not want to load whithout a
means to disable it!

AFAIK, xunicode should not be used with luatex.


Thanks,

Günter



Re: [patch] LuaTeX

2010-11-25 Thread Guenter Milde
On 2010-11-23, Jürgen Spitzmüller wrote:

 Again, we just need to know in advance if we use XeTeX/LuaTeX 

HTML, LyXHTML, Docbook, (+ any custom output format that uses System
Fonts)

 OR anything else (because this has consequences for the GUI, namely the
 font combos).  Everything else can be determined at export time.

Please allow parallel specification of TeXFonts and SystemFonts.

Günter



Re: [patch] LuaTeX

2010-11-25 Thread Guenter Milde
On 2010-11-23, Enrico Forestieri wrote:
 On Tue, Nov 23, 2010 at 04:58:19PM +0100, Liviu Andronic wrote:
 On Tue, Nov 23, 2010 at 4:51 PM, Enrico Forestieri for...@lyx.org wrote:
  A google search gives ~8000 hits for latex fonts and ~10 hits
  for tex fonts. That's more that one order of magnitude difference...
 
 Can't confirm this:
 'latex fonts': About 185,000 results (0.27 seconds)
 'tex fonts': About 175,000 results (0.27 seconds)

 You are searching for documents containing the word latex and fonts
 in whatever position. Try surrounding the search with double quotes,
 i.e., search for latex fonts and tex fonts literally. That will
 hit only those documents where the word fonts exactly follows the
 words latex or tex.

Besides this counts, the font format is actually dictated by tex
(the engine), not the macro package LaTeX. Every properly installed
(La)TeX-font can be used by tex (without la) as well as latex.

Günter



Re: [patch] LuaTeX

2010-11-25 Thread Guenter Milde
On 2010-11-23, Jürgen Spitzmüller wrote:
 Jean-Marc Lasgouttes wrote:
 What about useNonLaTeXFonts? useNormalFonts? Use OpenTypeFonts?

 I still do not like System.

 OK, I understand that. I'm fine with useNonLaTeXFonts. useOpenTypeFonts
 is not really appropriate, since also TrueType can be used.

However, it should be Unicode-encoded fonts, otherwise you will get
strange results (e.g. the Symbols or Dingbats fonts will lead to
strange results with xetex).

I propose TeXFonts - UnicodeFonts

Günter



Re: [patch] LuaTeX

2010-11-25 Thread Guenter Milde
On 2010-11-23, Jürgen Spitzmüller wrote:
 Guenter Milde wrote:
 * XeTeX can also use OpenType fonts that are not system-wide installed as
   well as traditional LaTeX fonts.

 With System Fonts, I do not mean System-wide fonts, but fonts
 avaliable to the OS (as opposed to specialized LaTeX fonts)

OK.

 Can XeTeX really use PSNFSS and METAFONT? How?

Both xelatex and luatlaex can use TeX fonts and PSNFSS:

\documentclass{minimal}
\usepackage{fixltx2e}
\usepackage{bookman}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{document}

Hallo Welt!

\end{document}

I did not try the automatic generation of bitmaps with METAFONT, though.


 IMV, it is also wrong to define the used engine as a special document
 setting: Just like we allow export of the same document to XHTML, PS, and
 PDF without change in the document settings, we should allow

 * PDF (ps2pdf)
 * PDF (pslatex)
 * PDF (xetex)
 * PDF (luatex)

 as export options.

 At the price of cluttering the document dialog with at least 3 more font 
 combos

Yes.

 and two more checkboxes? Nah...

Which?


We could fold some settings depending on the default output format
(which should include a distinction between xetex and luatex, but also
HTML (elyxer) and HTML (native), etc.)
There are ,e.g., lots of options without any use for HTML export.

Günter




Re: [patch] LuaTeX

2010-11-25 Thread Jürgen Spitzmüller
Guenter Milde wrote:

 Both xelatex and luatlaex can use TeX fonts and PSNFSS:

OK, another argument for the checkbox! We just need to add xetex (and maybe 
luatex) to the non-texfonts list of possible output formats.

But this needs to be tested first (and can be added easily within the 2.0 
cycle).

And an argument against separate font combos. How should we know which font 
(OpenType or tex) is desired without that checkbox?

Jürgen



Re: [patch] LuaTeX

2010-11-25 Thread Jürgen Spitzmüller
Guenter Milde wrote:

 Again, we just need to know in advance if we use XeTeX/LuaTeX
 
 HTML, LyXHTML, Docbook, (+ any custom output format that uses System
 Fonts)

DocBook is different. We have separate document classes. LyXHTML is not 
different yet, since it does not use system fonts (but it could, of course; 
another reason for the checkbox). LaTeX-HTML cannot use system fonts, AFAIK 
(tex4ht allows to specify fonts in a config file, AFAIK).

 OR anything else (because this has consequences for the GUI, namely the
 font combos).  Everything else can be determined at export time.
 
 Please allow parallel specification of TeXFonts and SystemFonts.

I think this is plain overkill. The (probably few) people who really need 
this can easily achieve it by using a portmanteau master file that just 
includes the actual file and uses other font settings.

Jürgen



Re: [patch] LuaTeX

2010-11-25 Thread Jean-Marc Lasgouttes

Le 25/11/2010 10:38, Jürgen Spitzmüller a écrit :

And an argument against separate font combos. How should we know which font
(OpenType or tex) is desired without that checkbox?


Since xtex is not only about fonts, but also algorithms, what about

[ ] use extended typesetting capabilities

JMarc


Re: [patch] LuaTeX

2010-11-25 Thread Guenter Milde
On 2010-11-23, Jürgen Spitzmüller wrote:

> Again, we just need to know in advance if we use XeTeX/LuaTeX 

HTML, LyXHTML, Docbook, (+ any custom output format that uses System
Fonts)

> OR anything else (because this has consequences for the GUI, namely the
> font combos).  Everything else can be determined at export time.

Please allow parallel specification of TeXFonts and SystemFonts.

Günter



Re: [patch] LuaTeX

2010-11-25 Thread Guenter Milde
On 2010-11-23, Enrico Forestieri wrote:
> On Tue, Nov 23, 2010 at 04:58:19PM +0100, Liviu Andronic wrote:
>> On Tue, Nov 23, 2010 at 4:51 PM, Enrico Forestieri  wrote:
>> > A google search gives ~8000 hits for "latex fonts" and ~10 hits
>> > for "tex fonts". That's more that one order of magnitude difference...
>> >
>> Can't confirm this:
>> 'latex fonts': About 185,000 results (0.27 seconds)
>> 'tex fonts': About 175,000 results (0.27 seconds)

> You are searching for documents containing the word latex and fonts
> in whatever position. Try surrounding the search with double quotes,
> i.e., search for "latex fonts" and "tex fonts" literally. That will
> hit only those documents where the word fonts exactly follows the
> words latex or tex.

Besides this counts, the font format is actually "dictated" by tex
(the engine), not the macro package LaTeX. Every properly installed
(La)TeX-font can be used by tex (without la) as well as latex.

Günter



Re: [patch] LuaTeX

2010-11-25 Thread Guenter Milde
On 2010-11-23, Jürgen Spitzmüller wrote:
> Jean-Marc Lasgouttes wrote:
>> What about useNonLaTeXFonts? useNormalFonts? Use OpenTypeFonts?

>> I still do not like System.

> OK, I understand that. I'm fine with useNonLaTeXFonts. useOpenTypeFonts
> is not really appropriate, since also TrueType can be used.

However, it should be Unicode-encoded fonts, otherwise you will get
strange results (e.g. the "Symbols" or "Dingbats" fonts will lead to
strange results with xetex).

I propose TeXFonts <-> UnicodeFonts

Günter



Re: [patch] LuaTeX

2010-11-25 Thread Guenter Milde
On 2010-11-23, Jürgen Spitzmüller wrote:
> Guenter Milde wrote:
>> * XeTeX can also use OpenType fonts that are not system-wide installed as
>>   well as "traditional" LaTeX fonts.

> With "System Fonts", I do not mean "System-wide" fonts, but fonts
> avaliable to the OS (as opposed to specialized LaTeX fonts)

OK.

> Can XeTeX really use PSNFSS and METAFONT? How?

Both xelatex and luatlaex can use TeX fonts and PSNFSS:

\documentclass{minimal}
\usepackage{fixltx2e}
\usepackage{bookman}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{document}

Hallo Welt!

\end{document}

I did not try the automatic generation of bitmaps with METAFONT, though.


>> IMV, it is also wrong to define the used engine as a special document
>> setting: Just like we allow export of the same document to XHTML, PS, and
>> PDF without change in the document settings, we should allow

>> * PDF (ps2pdf)
>> * PDF (pslatex)
>> * PDF (xetex)
>> * PDF (luatex)

>> as export options.

> At the price of cluttering the document dialog with at least 3 more font 
> combos

Yes.

> and two more checkboxes? Nah...

Which?


We could "fold" some settings depending on the default output format
(which should include a distinction between xetex and luatex, but also
HTML (elyxer) and HTML (native), etc.)
There are ,e.g., lots of options without any use for HTML export.

Günter




Re: [patch] LuaTeX

2010-11-25 Thread Jürgen Spitzmüller
Guenter Milde wrote:

> Both xelatex and luatlaex can use TeX fonts and PSNFSS:

OK, another argument for the checkbox! We just need to add xetex (and maybe 
luatex) to the non-texfonts list of possible output formats.

But this needs to be tested first (and can be added easily within the 2.0 
cycle).

And an argument against separate font combos. How should we know which font 
(OpenType or tex) is desired without that checkbox?

Jürgen



Re: [patch] LuaTeX

2010-11-25 Thread Jürgen Spitzmüller
Guenter Milde wrote:

>> Again, we just need to know in advance if we use XeTeX/LuaTeX
> 
> HTML, LyXHTML, Docbook, (+ any custom output format that uses System
> Fonts)

DocBook is different. We have separate document classes. LyXHTML is not 
different yet, since it does not use system fonts (but it could, of course; 
another reason for the checkbox). LaTeX->HTML cannot use system fonts, AFAIK 
(tex4ht allows to specify fonts in a config file, AFAIK).

>> OR anything else (because this has consequences for the GUI, namely the
>> font combos).  Everything else can be determined at export time.
> 
> Please allow parallel specification of TeXFonts and SystemFonts.

I think this is plain overkill. The (probably few) people who really need 
this can easily achieve it by using a portmanteau master file that just 
includes the actual file and uses other font settings.

Jürgen



Re: [patch] LuaTeX

2010-11-25 Thread Jean-Marc Lasgouttes

Le 25/11/2010 10:38, Jürgen Spitzmüller a écrit :

And an argument against separate font combos. How should we know which font
(OpenType or tex) is desired without that checkbox?


Since xtex is not only about fonts, but also algorithms, what about

[ ] use extended typesetting capabilities

JMarc


Re: [patch] LuaTeX

2010-11-24 Thread Enrico Forestieri
On Wed, Nov 24, 2010 at 06:31:29AM +0100, Peter Kümmel wrote:
 On 23.11.2010 23:38, Enrico Forestieri wrote:
  On Tue, Nov 23, 2010 at 10:58:52PM +0100, Peter Kümmel wrote:
  On 23.11.2010 22:53, Peter Kümmel wrote:
  Now having Lua in TeX we should also embedded it in LyX and replace all 
  Python scripts with Lua.
  Lua is the future! ;)
 
  Enrico, shouldn't we replace all QProcess/multithreaded code
  by Lua coroutines (co-operative multitasking)?
 
  I'm sure, you are eager to fix the argument passing ;)
  
  Everything's OK, Peter?
  
 
 Yes, I'm fine, it was a choke.

So, was it a lua constrictor attack?

 But I had the impression you
 are mostly very skeptical about such new features, and are
 still traumatized by the QProcess stuff ;)

Challenge not accepted. Try a better teasing.

-- 
Enrico


Re: [patch] LuaTeX

2010-11-24 Thread José Matos
On Tuesday 23 November 2010 21:53:21 Peter Kümmel wrote:
 Now having Lua in TeX we should also embedded it in LyX and replace all
 Python scripts with Lua. Lua is the future! ;)
 
 Peter

There are Lua bindings for python so I don not see what is the problem. :-)

-- 
José Abílio


Re: [patch] LuaTeX

2010-11-24 Thread Enrico Forestieri
On Wed, Nov 24, 2010 at 06:31:29AM +0100, Peter Kümmel wrote:
> On 23.11.2010 23:38, Enrico Forestieri wrote:
> > On Tue, Nov 23, 2010 at 10:58:52PM +0100, Peter Kümmel wrote:
> >> On 23.11.2010 22:53, Peter Kümmel wrote:
> >>> Now having Lua in TeX we should also embedded it in LyX and replace all 
> >>> Python scripts with Lua.
> >>> Lua is the future! ;)
> >>
> >> Enrico, shouldn't we replace all QProcess/multithreaded code
> >> by Lua coroutines (co-operative multitasking)?
> >>
> >> I'm sure, you are eager to fix the argument passing ;)
> > 
> > Everything's OK, Peter?
> > 
> 
> Yes, I'm fine, it was a choke.

So, was it a lua constrictor attack?

> But I had the impression you
> are mostly very skeptical about such new features, and are
> still traumatized by the QProcess stuff ;)

Challenge not accepted. Try a better teasing.

-- 
Enrico


Re: [patch] LuaTeX

2010-11-24 Thread José Matos
On Tuesday 23 November 2010 21:53:21 Peter Kümmel wrote:
> Now having Lua in TeX we should also embedded it in LyX and replace all
> Python scripts with Lua. Lua is the future! ;)
> 
> Peter

There are Lua bindings for python so I don not see what is the problem. :-)

-- 
José Abílio


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Richard Heck wrote:
 On 11/22/2010 10:55 AM, Jürgen Spitzmüller wrote:
  Out of curiosity, I checked out what it would need us to implement basic
  support for Lua(La)TeX (basic in the sense of what we had for XeTeX prior
  to the polyglossia commit today*). And it's really as simple as the
  attached.
  
  What I would do additionally to the patch are just two cosmetic things:
  
  (1) rename the buffer param useXeTeX to useLuaXeTeX (or something else,
  if someone comes up with a better name), since that param just tells us
  that we use a modern utf8- and OpenType-aware processor (such as XeTeX
  and LuaTeX), contrary to the flavour that tells us which processor this
  is.
  This one would be a file format change, although a very simple one.
 
 useUnicodeTeX? useUTF8TeX?

my newest proposal is useSystemFonts. See below.

  (2) In the GUI, I would rename the Use XeTeX checkbox to Use System
  Fonts (since this is really what is of interest for the end user) and
  put the checkbox to fonts.
 
 This one I'm less sure about. I cant tell from the patch how we decide
 which one to use. Wasn't it determined
 before by the Use XeTeX box? Anyway, clearly I'm confused.

No, this checkbox is misleading. We only need the checkbox (and the 
BufferParam) because we use different fonts. Everything else can be determined 
by the flavour. Also the Unicode thing is not relevant for this option.

That's why we cannot provide, as Günter proposes, all PDF export formats at 
once. We can provide:

* Export formats that use system fonts (i.e., OpenType):
-- XeTeX
-- LuaTeX

or

* Export formats that use LaTeX (PSNFSS or METAFONT) fonts:
-- PDFLaTeX
-- DVIPDFM(x)
-- PS2PDF

Of course, however we name it, it needs to be documented. Currently, Use 
XeTeX says nothing to users who do not know XeTeX.

  I hesitated to send this now, since I agree we should not add any more
  new features, and of course I respect if this is gonna be postponed.
  OTOH, people are just starting to use LuaTeX now for serious work, and I
  expect it to become more mature within the next months. So I just wanted
  to let you know how cheap this inclusion would be ;-)
 
 Cheap indeed.
 
 On a somewhat unrelated note:
  Index: src/Converter.cpp
  ===
  --- src/Converter.cpp   (Revision 36432)
  +++ src/Converter.cpp   (Arbeitskopie)
  @@ -257,6 +257,8 @@
  
  if (conv.latex)
  
  if (contains(conv.from, xetex))
  
  return OutputParams::XETEX;
  
  +   if (contains(conv.from, luatex))
  +   return OutputParams::LUATEX;
  
  if (contains(conv.to, pdf))
  
  return OutputParams::PDFLATEX;
  
  if (conv.xml)
 
 These tests look wrong. At the very least, shouldn't these check
 startswith. What if someone defines a format nopdf?

Maybe, yes. This is a very old test.

Jürgen

 Richard


Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Richard Heck wrote:
 I cant tell from the patch how we decide 
 which one to use. Wasn't it determined
 before by the Use XeTeX box? Anyway, clearly I'm confused.

To answer this question more precisely: with my patch, you can chose between 
PDF (XeTeX), PDF (LuaTeX) and DVI (LuaTeX) if Use XeTeX is checked 
(given that all these backends are installed, of course).

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Guenter Milde wrote:
 * XeTeX can also use OpenType fonts that are not system-wide installed as
   well as traditional LaTeX fonts.

With System Fonts, I do not mean System-wide fonts, but fonts avaliable to 
the OS (as opposed to specialized LaTeX fonts)ö

Can XeTeX really use PSNFSS and METAFONT? How?

 IMV, it is also wrong to define the used engine as a special document
 setting: Just like we allow export of the same document to XHTML, PS, and
 PDF without change in the document settings, we should allow
 
 * PDF (ps2pdf)
 * PDF (pslatex)
 * PDF (xetex)
 * PDF (luatex)
 
 as export options.

At the price of cluttering the document dialog with at least 3 more font 
combos and two more checkboxes? Nah...

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Richard Heck wrote:
 Cheap indeed.

After my recent cleanup, it looks even cheaper. See attached.

Jürgen
Index: src/insets/InsetExternal.cpp
===
--- src/insets/InsetExternal.cpp	(Revision 36445)
+++ src/insets/InsetExternal.cpp	(Arbeitskopie)
@@ -725,6 +725,7 @@
 	case OutputParams::LATEX:
 		format = LaTeX;
 		break;
+	case OutputParams::LUATEX:
 	case OutputParams::PDFLATEX:
 	case OutputParams::XETEX:
 		format = PDFLaTeX;
Index: src/insets/InsetGraphics.cpp
===
--- src/insets/InsetGraphics.cpp	(Revision 36445)
+++ src/insets/InsetGraphics.cpp	(Arbeitskopie)
@@ -102,9 +102,10 @@
 /// Note that \p format may be unknown (i. e. an empty string)
 string findTargetFormat(string const  format, OutputParams const  runparams)
 {
-	// Are we using latex or XeTeX/pdflatex?
+	// Are we using latex or XeTeX/LuaTeX/pdflatex?
 	if (runparams.flavor == OutputParams::PDFLATEX
-	|| runparams.flavor == OutputParams::XETEX) {
+	|| runparams.flavor == OutputParams::XETEX
+	|| runparams.flavor == OutputParams::LUATEX) {
 		LYXERR(Debug::GRAPHICS, findTargetFormat: PDF mode);
 		Format const * const f = formats.getFormat(format);
 		// Convert vector graphics to pdf
Index: src/Converter.cpp
===
--- src/Converter.cpp	(Revision 36445)
+++ src/Converter.cpp	(Arbeitskopie)
@@ -257,6 +257,8 @@
 		if (conv.latex)
 			if (contains(conv.from, xetex))
 return OutputParams::XETEX;
+			if (contains(conv.from, luatex))
+return OutputParams::LUATEX;
 			if (contains(conv.to, pdf))
 return OutputParams::PDFLATEX;
 		if (conv.xml)
@@ -747,6 +749,7 @@
 	v.push_back(docbook);
 	v.push_back(latex);
 	v.push_back(literate);
+	v.push_back(luatex);
 	v.push_back(lyx);
 	v.push_back(xhtml);
 	v.push_back(pdflatex);
Index: src/OutputParams.h
===
--- src/OutputParams.h	(Revision 36445)
+++ src/OutputParams.h	(Arbeitskopie)
@@ -29,6 +29,7 @@
 public:
 	enum FLAVOR {
 		LATEX,
+		LUATEX,
 		PDFLATEX,
 		XETEX,
 		XML,
Index: src/OutputParams.cpp
===
--- src/OutputParams.cpp	(Revision 36445)
+++ src/OutputParams.cpp	(Arbeitskopie)
@@ -45,13 +45,14 @@
 
 bool OutputParams::isLaTeX() const
 {
-	return flavor == LATEX || flavor == PDFLATEX || flavor == XETEX; 
+	return flavor == LATEX || flavor == LUATEX 
+		|| flavor == PDFLATEX || flavor == XETEX; 
 }
 
 
 bool OutputParams::isFullUnicode() const
 {
-	return flavor == XETEX; 
+	return flavor == LUATEX || flavor == XETEX; 
 }
 
 } // namespace lyx
Index: src/Buffer.cpp
===
--- src/Buffer.cpp	(Revision 36445)
+++ src/Buffer.cpp	(Arbeitskopie)
@@ -3406,6 +3406,8 @@
 		// FIXME: Don't hardcode format names here, but use a flag
 		if (backend_format == pdflatex)
 			runparams.flavor = OutputParams::PDFLATEX;
+		else if (backend_format == luatex)
+			runparams.flavor = OutputParams::LUATEX;
 		else if (backend_format == xetex)
 			runparams.flavor = OutputParams::XETEX;
 	}
@@ -3616,6 +3618,8 @@
 	// FIXME: Don't hardcode format names here, but use a flag
 	if (v.back() == latex)
 		v.push_back(pdflatex);
+	else if (v.back() == xetex)
+		v.push_back(luatex);
 	v.push_back(xhtml);
 	v.push_back(text);
 	v.push_back(lyx);
Index: src/BufferParams.cpp
===
--- src/BufferParams.cpp	(Revision 36445)
+++ src/BufferParams.cpp	(Arbeitskopie)
@@ -1120,6 +1120,7 @@
 features.require(ct-none);
 			}
 			break;
+		case OutputParams::LUATEX:
 		case OutputParams::PDFLATEX:
 		case OutputParams::XETEX:
 			if (xcolorulem) {
@@ -1359,7 +1360,7 @@
 	// set font encoding
 	// for arabic_arabi and farsi we also need to load the LAE and
 	// LFE encoding
-	// XeTeX (isFullUnicode() flavor) works without fontenc
+	// XeTeX and LuaTeX (isFullUnicode() flavor) work without fontenc
 	if (font_encoding() != default  language-lang() != japanese
 	 !features.runparams().isFullUnicode()  !tclass.provides(fontenc)) {
 		size_t fars = language_options.str().find(farsi);
Index: lib/configure.py
===
--- lib/configure.py	(Revision 36445)
+++ lib/configure.py	(Arbeitskopie)
@@ -507,6 +507,7 @@
 \Format lilypond   ly LilyPond music 	%%	vector
 \Format lilypond-booklytex LilyPond book (LaTeX)	%%	document
 \Format latex  texLaTeX (plain) L  	%%	document
+\Format luatex texLaTeX (LuaTeX) 	%%	document
 \Format pdflatex   texLaTeX (pdflatex)   	%%	document
 \Format xetex  texLaTeX (XeTeX)  	%%	document
 \Format text   txtPlain texta  	%%	document
@@ -538,10 +539,12 @@
 rc_entry = [r'''\Format pdfpdf

Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
 my newest proposal is useSystemFonts. See below.

The attached patch demonstrates this renaming (still partial, I didn't rename 
the Qt widgets and the real buffer param yet). If you look at this, you'll see 
that this buffer param is indeed only relevant where we do special things due 
to the use of system fonts (loading and setting up fontspec, loading the 
system fonts into the combo, disabling PSNFSS-or CJK-related widgets) .

Where we use it for other things (as in PreviewLoader or Buffer::encoding()), 
we actually misuse it (because we have no access to the flavors here). So the 
renaming makes things actually much clearer, at least IMHO.

Jürgen
Index: src/graphics/PreviewLoader.cpp
===
--- src/graphics/PreviewLoader.cpp	(Revision 36445)
+++ src/graphics/PreviewLoader.cpp	(Arbeitskopie)
@@ -600,7 +600,9 @@
 	int(font_scaling_factor)  ' '
 	theApp()-hexName(fg)  ' '
 	theApp()-hexName(bg);
-	if (buffer_.params().useXetex)
+	// FIXME differentiate XeTeX from useSystemFonts here!
+	// FIXME particularly check LuaTeX
+	if (buffer_.params().useSystemFonts)
 		cs   xelatex;
 
 	string const command = libScriptSearch(cs.str());
Index: src/BufferParams.h
===
--- src/BufferParams.h	(Revision 36445)
+++ src/BufferParams.h	(Arbeitskopie)
@@ -215,8 +215,8 @@
 	std::string fontsTypewriter;
 	/// the default family (rm, sf, tt)
 	std::string fontsDefaultFamily;
-	/// use the XeTeX processor
-	bool useXetex;
+	/// use system fonts (OpenType, True Type)
+	bool useSystemFonts;
 	/// use expert Small Caps
 	bool fontsSC;
 	/// use Old Style Figures
@@ -374,7 +374,7 @@
  std::string const  sf, std::string const  tt,
  bool const  sc, bool const  osf,
  int const  sfscale, int const  ttscale,
- bool const  xetex) const;
+ bool const  use_systemfonts) const;
 
 	/// get the appropriate cite engine (natbib handling)
 	CiteEngine citeEngine() const;
Index: src/frontends/qt4/GuiDocument.cpp
===
--- src/frontends/qt4/GuiDocument.cpp	(Revision 36445)
+++ src/frontends/qt4/GuiDocument.cpp	(Arbeitskopie)
@@ -2073,7 +2073,7 @@
 		return;
 	// make a copy in order to consider unapplied changes
 	Buffer * tmpbuf = buffer().clone();
-	tmpbuf-params().useXetex = outputModule-xetexCB-isChecked();
+	tmpbuf-params().useSystemFonts = outputModule-xetexCB-isChecked();
 	int idx = latexModule-classCO-currentIndex();
 	if (idx = 0) {
 		string const classname = classes_model_.getIDString(idx);
@@ -2390,7 +2390,7 @@
 		outputModule-defaultFormatCO-currentIndex()).toString());
 
 	bool const xetex = outputModule-xetexCB-isChecked();
-	bp_.useXetex = xetex;
+	bp_.useSystemFonts = xetex;
 
 	bp_.output_sync = outputModule-outputsyncCB-isChecked();
 	bp_.output_sync_macro = fromqstr(outputModule-synccustomCB-currentText());
@@ -2827,7 +2827,7 @@
 	outputModule-defaultFormatCO-setCurrentIndex(index);
 	outputModule-xetexCB-setEnabled(bp_.baseClass()-outputType() == lyx::LATEX);
 	outputModule-xetexCB-setChecked(
-		bp_.baseClass()-outputType() == lyx::LATEX  bp_.useXetex);
+		bp_.baseClass()-outputType() == lyx::LATEX  bp_.useSystemFonts);
 
 	outputModule-outputsyncCB-setChecked(bp_.output_sync);
 	outputModule-synccustomCB-setEditText(toqstr(bp_.output_sync_macro));
@@ -2840,7 +2840,7 @@
 	updateFontsize(documentClass().opt_fontsize(),
 			bp_.fontsize);
 
-	if (bp_.useXetex) {
+	if (bp_.useSystemFonts) {
 		fontModule-fontencLA-setEnabled(false);
 		fontModule-fontencCO-setEnabled(false);
 		fontModule-fontencLE-setEnabled(false);
Index: src/Buffer.cpp
===
--- src/Buffer.cpp	(Revision 36445)
+++ src/Buffer.cpp	(Arbeitskopie)
@@ -3029,7 +3029,7 @@
 {
 	OutputParams runparams(params().encoding());
 	runparams.nice = true;
-	runparams.flavor = params().useXetex ? 
+	runparams.flavor = params().useSystemFonts ? 
 		OutputParams::XETEX : OutputParams::LATEX;
 	runparams.linelen = lyxrc.plaintext_linelen;
 	// No side effect of file copying and image conversion
@@ -3308,7 +3308,7 @@
 {
 	string format = params().documentClass().outputFormat();
 	if (format == latex) {
-		if (params().useXetex)
+		if (params().useSystemFonts)
 			return xetex;
 		if (params().encoding().package() == Encoding::japanese)
 			return platex;
@@ -3326,7 +3326,7 @@
 	Formats formats = exportableFormats(true);
 	if (isDocBook()
 	|| isLiterate()
-	|| params().useXetex
+	|| params().useSystemFonts
 	|| params().encoding().package() == Encoding::japanese) {
 		if (formats.empty())
 			return string();
Index: src/BufferParams.cpp
===
--- src/BufferParams.cpp	(Revision 36445)
+++ src/BufferParams.cpp	(Arbeitskopie)
@@ -379,7 +379,7 @@
 	fontsSans = default;
 	

Re: [patch] LuaTeX

2010-11-23 Thread Jean-Marc Lasgouttes

Le 23 nov. 2010 à 14:05, Jürgen Spitzmüller a écrit :

 Jürgen Spitzmüller wrote:
 my newest proposal is useSystemFonts. See below.

What about useNonLaTeXFonts? useNormalFonts? Use OpenTypeFonts?

I still do not like System.

JMarc



Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
 What about useNonLaTeXFonts? useNormalFonts? Use OpenTypeFonts?
 
 I still do not like System.

OK, I understand that. I'm fine with useNonLaTeXFonts. useOpenTypeFonts is not 
really appropriate, since also TrueType can be used.

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Pavel Sanda
Jürgen Spitzmüller wrote:
 Richard Heck wrote:
  Cheap indeed.
 
 After my recent cleanup, it looks even cheaper. See attached.

ok, something of this kind can go in once you finish the discussion.

for the ui part i would let the keywords luatex/xetex somewhat visible
eg by putting into parenthesis. there will be users who will seek for
these strings.

pavel


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Pavel Sanda wrote:
 for the ui part i would let the keywords luatex/xetex somewhat visible
 eg by putting into parenthesis. there will be users who will seek for
 these strings.

My proposal would have been

Use non-LaTeX fonts
with the tooltip (Use OpenType- and TrueType fonts directly (requires XeTeX 
or LuaTeX))

But if you wish, I can change the label to
Use non-LaTeX fonts (via XeTeX/LuateX)

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Pavel Sanda
Jürgen Spitzmüller wrote:
 But if you wish, I can change the label to
 Use non-LaTeX fonts (via XeTeX/LuateX)

yes, i would prefer this one.
pavel


Re: [patch] LuaTeX

2010-11-23 Thread Richard Heck

On 11/23/2010 09:02 AM, Pavel Sanda wrote:

Jürgen Spitzmüller wrote:

But if you wish, I can change the label to
Use non-LaTeX fonts (via XeTeX/LuateX)

yes, i would prefer this one.


Agreed. We want to help the newbies, but not confuse the experts.

Richard



Re: [patch] LuaTeX

2010-11-23 Thread Enrico Forestieri
On Tue, Nov 23, 2010 at 10:02:36AM -0500, Richard Heck wrote:
 On 11/23/2010 09:02 AM, Pavel Sanda wrote:
 Jürgen Spitzmüller wrote:
 But if you wish, I can change the label to
 Use non-LaTeX fonts (via XeTeX/LuateX)
 yes, i would prefer this one.
 
 Agreed. We want to help the newbies, but not confuse the experts.

A google search gives ~8000 hits for latex fonts and ~10 hits
for tex fonts. That's more that one order of magnitude difference...

-- 
Enrico


Re: [patch] LuaTeX

2010-11-23 Thread Liviu Andronic
On Tue, Nov 23, 2010 at 4:51 PM, Enrico Forestieri for...@lyx.org wrote:
 A google search gives ~8000 hits for latex fonts and ~10 hits
 for tex fonts. That's more that one order of magnitude difference...

Can't confirm this:
'latex fonts': About 185,000 results (0.27 seconds)
'tex fonts': About 175,000 results (0.27 seconds)

Liviu


Re: [patch] LuaTeX

2010-11-23 Thread Enrico Forestieri
On Tue, Nov 23, 2010 at 04:58:19PM +0100, Liviu Andronic wrote:
 On Tue, Nov 23, 2010 at 4:51 PM, Enrico Forestieri for...@lyx.org wrote:
  A google search gives ~8000 hits for latex fonts and ~10 hits
  for tex fonts. That's more that one order of magnitude difference...
 
 Can't confirm this:
 'latex fonts': About 185,000 results (0.27 seconds)
 'tex fonts': About 175,000 results (0.27 seconds)

You are searching for documents containing the word latex and fonts
in whatever position. Try surrounding the search with double quotes,
i.e., search for latex fonts and tex fonts literally. That will
hit only those documents where the word fonts exactly follows the
words latex or tex.

-- 
Enrico


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Pavel Sanda wrote:
 ok, something of this kind can go in once you finish the discussion.

I've put in the actual LuaTeX part since this seems uncontroversial. LuaTeX is 
now there as a hidden feature.

I'll attache the (now complete) UI part so people can again raise their 
objections.

Jürgen
Index: src/BufferParams.h
===
--- src/BufferParams.h	(Revision 36448)
+++ src/BufferParams.h	(Arbeitskopie)
@@ -215,8 +215,8 @@
 	std::string fontsTypewriter;
 	/// the default family (rm, sf, tt)
 	std::string fontsDefaultFamily;
-	/// use the XeTeX processor
-	bool useXetex;
+	/// use the fonts of the OS (OpenType, True Type) directly
+	bool useNonLaTeXFonts;
 	/// use expert Small Caps
 	bool fontsSC;
 	/// use Old Style Figures
@@ -374,7 +374,7 @@
  std::string const  sf, std::string const  tt,
  bool const  sc, bool const  osf,
  int const  sfscale, int const  ttscale,
- bool const  xetex) const;
+ bool const  use_nonlatexfonts) const;
 
 	/// get the appropriate cite engine (natbib handling)
 	CiteEngine citeEngine() const;
Index: src/frontends/qt4/GuiDocument.h
===
--- src/frontends/qt4/GuiDocument.h	(Revision 36448)
+++ src/frontends/qt4/GuiDocument.h	(Arbeitskopie)
@@ -115,7 +115,7 @@
 	void deleteNoteFontColor();
 	void changeBoxBackgroundColor();
 	void deleteBoxBackgroundColor();
-	void xetexChanged(bool);
+	void osFontsChanged(bool);
 	void branchesRename(docstring const , docstring const );
 private:
 	/// validate listings parameters and return an error message, if any
Index: src/frontends/qt4/GuiDocument.cpp
===
--- src/frontends/qt4/GuiDocument.cpp	(Revision 36448)
+++ src/frontends/qt4/GuiDocument.cpp	(Arbeitskopie)
@@ -726,10 +726,6 @@
 	// output
 	outputModule = new UiWidgetUi::OutputUi;
 
-	connect(outputModule-xetexCB, SIGNAL(clicked()),
-		this, SLOT(change_adaptor()));
-	connect(outputModule-xetexCB, SIGNAL(toggled(bool)),
-		this, SLOT(xetexChanged(bool)));
 	connect(outputModule-defaultFormatCO, SIGNAL(activated(int)),
 		this, SLOT(change_adaptor()));
 	connect(outputModule-mathimgSB, SIGNAL(valueChanged(double)),
@@ -750,6 +746,10 @@
 
 	// fonts
 	fontModule = new UiWidgetUi::FontUi;
+	connect(fontModule-osFontsCB, SIGNAL(clicked()),
+		this, SLOT(change_adaptor()));
+	connect(fontModule-osFontsCB, SIGNAL(toggled(bool)),
+		this, SLOT(osFontsChanged(bool)));
 	connect(fontModule-fontsRomanCO, SIGNAL(activated(int)),
 		this, SLOT(change_adaptor()));
 	connect(fontModule-fontsRomanCO, SIGNAL(activated(int)),
@@ -1585,38 +1585,38 @@
 }
 
 
-void GuiDocument::xetexChanged(bool xetex)
+void GuiDocument::osFontsChanged(bool nonlatexfonts)
 {
 	updateFontlist();
 	updateDefaultFormat();
-	langModule-encodingCO-setEnabled(!xetex 
+	langModule-encodingCO-setEnabled(!nonlatexfonts 
 		!langModule-defaultencodingRB-isChecked());
-	langModule-defaultencodingRB-setEnabled(!xetex);
-	langModule-otherencodingRB-setEnabled(!xetex);
+	langModule-defaultencodingRB-setEnabled(!nonlatexfonts);
+	langModule-otherencodingRB-setEnabled(!nonlatexfonts);
 
-	fontModule-fontsDefaultCO-setEnabled(!xetex);
-	fontModule-fontsDefaultLA-setEnabled(!xetex);
-	fontModule-cjkFontLE-setEnabled(!xetex);
-	fontModule-cjkFontLA-setEnabled(!xetex);
+	fontModule-fontsDefaultCO-setEnabled(!nonlatexfonts);
+	fontModule-fontsDefaultLA-setEnabled(!nonlatexfonts);
+	fontModule-cjkFontLE-setEnabled(!nonlatexfonts);
+	fontModule-cjkFontLA-setEnabled(!nonlatexfonts);
 	string font;
-	if (!xetex)
+	if (!nonlatexfonts)
 		font = tex_fonts_sans[fontModule-fontsSansCO-currentIndex()];
 	bool scaleable = providesScale(font);
 	fontModule-scaleSansSB-setEnabled(scaleable);
 	fontModule-scaleSansLA-setEnabled(scaleable);
-	if (!xetex)
+	if (!nonlatexfonts)
 		font = tex_fonts_monospaced[fontModule-fontsTypewriterCO-currentIndex()];
 	scaleable = providesScale(font);
 	fontModule-scaleTypewriterSB-setEnabled(scaleable);
 	fontModule-scaleTypewriterLA-setEnabled(scaleable);
-	if (!xetex)
+	if (!nonlatexfonts)
 		font = tex_fonts_roman[fontModule-fontsRomanCO-currentIndex()];
 	fontModule-fontScCB-setEnabled(providesSC(font));
 	fontModule-fontOsfCB-setEnabled(providesOSF(font));
 	
-	fontModule-fontencLA-setEnabled(!xetex);
-	fontModule-fontencCO-setEnabled(!xetex);
-	if (xetex)
+	fontModule-fontencLA-setEnabled(!nonlatexfonts);
+	fontModule-fontencCO-setEnabled(!nonlatexfonts);
+	if (nonlatexfonts)
 		fontModule-fontencLE-setEnabled(false);
 	else
 		fontencChanged(fontModule-fontencCO-currentIndex());
@@ -1648,7 +1648,7 @@
 	fontModule-fontsTypewriterCO-clear();
 
 	// With XeTeX, we have access to all system fonts, but not the LaTeX fonts
-	if (outputModule-xetexCB-isChecked()) {
+	if (fontModule-osFontsCB-isChecked()) {
 		fontModule-fontsRomanCO-addItem(qt_(Default));
 		

Re: [patch] LuaTeX

2010-11-23 Thread Richard Heck

On 11/23/2010 11:10 AM, Jürgen Spitzmüller wrote:

Pavel Sanda wrote:

ok, something of this kind can go in once you finish the discussion.

I've put in the actual LuaTeX part since this seems uncontroversial. LuaTeX is
now there as a hidden feature.

So can you tell me, just so I understand this, how we decide whether to 
use LuaTeX or XeTeX? Is that
now part of the format in effect? Or what? I more or less understand 
what these processors are meant to do,

but I'm pretty ignorant about them otherwise.

Richard



Re: [patch] LuaTeX

2010-11-23 Thread Enrico Forestieri
On Tue, Nov 23, 2010 at 05:10:56PM +0100, Jürgen Spitzmüller wrote:
 Pavel Sanda wrote:
  ok, something of this kind can go in once you finish the discussion.
 
 I've put in the actual LuaTeX part since this seems uncontroversial. LuaTeX 
 is 
 now there as a hidden feature.
 
 I'll attache the (now complete) UI part so people can again raise their 
 objections.

I suggest to either 1) s/LaTeXFonts/TeXFonts/
or  2) s/tex_fonts/latex_fonts/
I prefer 1).

 - if (!xetex)
 + if (!nonlatexfonts)
   font = tex_fonts_sans[fontModule-fontsSansCO-currentIndex()];
[...]
 - if (!xetex)
 + if (!nonlatexfonts)
   font = 
 tex_fonts_monospaced[fontModule-fontsTypewriterCO-currentIndex()];
[...]
 - if (!xetex)
 + if (!nonlatexfonts)
   font = 
 tex_fonts_roman[fontModule-fontsRomanCO-currentIndex()];
[...]
   string const font = tex_fonts_roman[item];
[...]
   string const font = tex_fonts_sans[item];
[...]
   string const font = tex_fonts_monospaced[item];

-- 
Enrico


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Richard Heck wrote:
 So can you tell me, just so I understand this, how we decide whether to 
 use LuaTeX or XeTeX? Is that
 now part of the format in effect? Or what? I more or less understand 
 what these processors are meant to do,
 but I'm pretty ignorant about them otherwise.

The same way as we decide whether to use latex or pdflatex. The user has the 
choice to either click on View  PDF (XeTeX) or View  PDF (LuaTeX). Either 
choice comes with a respective flavor.

Again, we just need to know in advance if we use XeTeX/LuaTeX OR anything else 
(because this has consequences for the GUI, namely the font combos). 
Everything else can be determined at export time.

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Enrico Forestieri
On Tue, Nov 23, 2010 at 05:26:48PM +0100, Enrico Forestieri wrote:
 On Tue, Nov 23, 2010 at 05:10:56PM +0100, Jürgen Spitzmüller wrote:
  Pavel Sanda wrote:
   ok, something of this kind can go in once you finish the discussion.
  
  I've put in the actual LuaTeX part since this seems uncontroversial. LuaTeX 
  is 
  now there as a hidden feature.
  
  I'll attache the (now complete) UI part so people can again raise their 
  objections.
 
 I suggest to either 1) s/LaTeXFonts/TeXFonts/
 or  2) s/tex_fonts/latex_fonts/
 I prefer 1).

Also, given the number of occurrences of the construct !nonlatexfonts,
I would eliminate the non prefix and reverse the logic.

-- 
Enrico


RE: [patch] LuaTeX

2010-11-23 Thread Rob Oakes
I am ecstatic to see support for LuaTeX and XeTeX added.  I've used XeTeX
for a while now and I'm just starting to use LuaTeX.  However, it is really
important that you allow the user choose which engine they wish to use.
While the goal is to make LuaTeX the end all and be-all of TeX typesetting,
it isn't there yet.

XeLaTeX supports a number of advanced font features not available in LuaTeX
yet (the FontSpec manual has a pretty comprehensive list of what these are).
And while most LyX users aren't going to use all of them, some will and do.
(Which is to say, I do.)  Therefore, the ability to specify whether my
document will compile with LuaTeX or XeTeX is very important.

Help the newbies, but not frustrate the experienced.

Cheers,

Rob



Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Rob Oakes wrote:
 I am ecstatic to see support for LuaTeX and XeTeX added.  I've used XeTeX
 for a while now and I'm just starting to use LuaTeX.  However, it is really
 important that you allow the user choose which engine they wish to use.

Worry not. You are completely free to select either of these in the same way 
as you are free to select either pdfatex or ps2pdf.

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Enrico Forestieri wrote:
  I suggest to either 1) s/LaTeXFonts/TeXFonts/
  or  2) s/tex_fonts/latex_fonts/
  I prefer 1).
 
 Also, given the number of occurrences of the construct !nonlatexfonts,
 I would eliminate the non prefix and reverse the logic.

OK. Both points taken.

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Pavel Sanda
Jürgen Spitzmüller wrote:
 I'll attache the (now complete) UI part so people can again raise their 
 objections.

i didnt see FORMAT file...
pavel


Re: [patch] LuaTeX

2010-11-23 Thread Peter Kümmel
Now having Lua in TeX we should also embedded it in LyX and replace all Python 
scripts with Lua.
Lua is the future! ;)

Peter


Re: [patch] LuaTeX

2010-11-23 Thread Peter Kümmel
On 23.11.2010 22:53, Peter Kümmel wrote:
 Now having Lua in TeX we should also embedded it in LyX and replace all 
 Python scripts with Lua.
 Lua is the future! ;)

Enrico, shouldn't we replace all QProcess/multithreaded code
by Lua coroutines (co-operative multitasking)?

I'm sure, you are eager to fix the argument passing ;)

Peter


Re: [patch] LuaTeX

2010-11-23 Thread Peter Kümmel
On 23.11.2010 22:53, Peter Kümmel wrote:
 Now having Lua in TeX we should also embedded it in LyX and replace all 
 Python scripts with Lua.
 Lua is the future! ;)

And we should do it immediately before the LyX 2.0.0 release.

 Peter
 


Re: [patch] LuaTeX

2010-11-23 Thread Pavel Sanda
Peter Kümmel wrote:
 On 23.11.2010 22:53, Peter Kümmel wrote:
  Now having Lua in TeX we should also embedded it in LyX and replace all 
  Python scripts with Lua.
  Lua is the future! ;)
 
 And we should do it immediately before the LyX 2.0.0 release.

yes it has my ok!
pavel


Re: [patch] LuaTeX

2010-11-23 Thread Enrico Forestieri
On Tue, Nov 23, 2010 at 10:58:52PM +0100, Peter Kümmel wrote:
 On 23.11.2010 22:53, Peter Kümmel wrote:
  Now having Lua in TeX we should also embedded it in LyX and replace all 
  Python scripts with Lua.
  Lua is the future! ;)
 
 Enrico, shouldn't we replace all QProcess/multithreaded code
 by Lua coroutines (co-operative multitasking)?
 
 I'm sure, you are eager to fix the argument passing ;)

Everything's OK, Peter?

-- 
Enrico


Re: [patch] LuaTeX

2010-11-23 Thread Peter Kümmel
On 23.11.2010 23:38, Enrico Forestieri wrote:
 On Tue, Nov 23, 2010 at 10:58:52PM +0100, Peter Kümmel wrote:
 On 23.11.2010 22:53, Peter Kümmel wrote:
 Now having Lua in TeX we should also embedded it in LyX and replace all 
 Python scripts with Lua.
 Lua is the future! ;)

 Enrico, shouldn't we replace all QProcess/multithreaded code
 by Lua coroutines (co-operative multitasking)?

 I'm sure, you are eager to fix the argument passing ;)
 
 Everything's OK, Peter?
 

Yes, I'm fine, it was a choke. But I had the impression you
are mostly very skeptical about such new features, and are
still traumatized by the QProcess stuff ;)

Peter


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Richard Heck wrote:
> On 11/22/2010 10:55 AM, Jürgen Spitzmüller wrote:
> > Out of curiosity, I checked out what it would need us to implement basic
> > support for Lua(La)TeX (basic in the sense of what we had for XeTeX prior
> > to the polyglossia commit today*). And it's really as simple as the
> > attached.
> > 
> > What I would do additionally to the patch are just two cosmetic things:
> > 
> > (1) rename the buffer param useXeTeX to useLuaXeTeX (or something else,
> > if someone comes up with a better name), since that param just tells us
> > that we use a modern utf8- and OpenType-aware processor (such as XeTeX
> > and LuaTeX), contrary to the flavour that tells us which processor this
> > is.
> > This one would be a file format change, although a very simple one.
> 
> useUnicodeTeX? useUTF8TeX?

my newest proposal is useSystemFonts. See below.

> > (2) In the GUI, I would rename the "Use XeTeX" checkbox to "Use System
> > Fonts" (since this is really what is of interest for the end user) and
> > put the checkbox to fonts.
> 
> This one I'm less sure about. I cant tell from the patch how we decide
> which one to use. Wasn't it determined
> before by the "Use XeTeX" box? Anyway, clearly I'm confused.

No, this checkbox is misleading. We only need the checkbox (and the 
BufferParam) because we use different fonts. Everything else can be determined 
by the flavour. Also the "Unicode" thing is not relevant for this option.

That's why we cannot provide, as Günter proposes, all PDF export formats at 
once. We can provide:

* Export formats that use system fonts (i.e., OpenType):
-- XeTeX
-- LuaTeX

or

* Export formats that use LaTeX (PSNFSS or METAFONT) fonts:
-- PDFLaTeX
-- DVIPDFM(x)
-- PS2PDF

Of course, however we name it, it needs to be documented. Currently, "Use 
XeTeX" says nothing to users who do not know XeTeX.

> > I hesitated to send this now, since I agree we should not add any more
> > new features, and of course I respect if this is gonna be postponed.
> > OTOH, people are just starting to use LuaTeX now for serious work, and I
> > expect it to become more mature within the next months. So I just wanted
> > to let you know how cheap this inclusion would be ;-)
> 
> Cheap indeed.
> 
> On a somewhat unrelated note:
> > Index: src/Converter.cpp
> > ===
> > --- src/Converter.cpp   (Revision 36432)
> > +++ src/Converter.cpp   (Arbeitskopie)
> > @@ -257,6 +257,8 @@
> > 
> > if (conv.latex)
> > 
> > if (contains(conv.from, "xetex"))
> > 
> > return OutputParams::XETEX;
> > 
> > +   if (contains(conv.from, "luatex"))
> > +   return OutputParams::LUATEX;
> > 
> > if (contains(conv.to, "pdf"))
> > 
> > return OutputParams::PDFLATEX;
> > 
> > if (conv.xml)
> 
> These tests look wrong. At the very least, shouldn't these check
> "startswith". What if someone defines a format nopdf?

Maybe, yes. This is a very old test.

Jürgen

> Richard


Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Richard Heck wrote:
> I cant tell from the patch how we decide 
> which one to use. Wasn't it determined
> before by the "Use XeTeX" box? Anyway, clearly I'm confused.

To answer this question more precisely: with my patch, you can chose between 
"PDF (XeTeX)", "PDF (LuaTeX)" and "DVI (LuaTeX)" if "Use XeTeX" is checked 
(given that all these backends are installed, of course).

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Guenter Milde wrote:
> * XeTeX can also use OpenType fonts that are not system-wide installed as
>   well as "traditional" LaTeX fonts.

With "System Fonts", I do not mean "System-wide" fonts, but fonts avaliable to 
the OS (as opposed to specialized LaTeX fonts)ö

Can XeTeX really use PSNFSS and METAFONT? How?

> IMV, it is also wrong to define the used engine as a special document
> setting: Just like we allow export of the same document to XHTML, PS, and
> PDF without change in the document settings, we should allow
> 
> * PDF (ps2pdf)
> * PDF (pslatex)
> * PDF (xetex)
> * PDF (luatex)
> 
> as export options.

At the price of cluttering the document dialog with at least 3 more font 
combos and two more checkboxes? Nah...

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Richard Heck wrote:
> Cheap indeed.

After my recent cleanup, it looks even cheaper. See attached.

Jürgen
Index: src/insets/InsetExternal.cpp
===
--- src/insets/InsetExternal.cpp	(Revision 36445)
+++ src/insets/InsetExternal.cpp	(Arbeitskopie)
@@ -725,6 +725,7 @@
 	case OutputParams::LATEX:
 		format = "LaTeX";
 		break;
+	case OutputParams::LUATEX:
 	case OutputParams::PDFLATEX:
 	case OutputParams::XETEX:
 		format = "PDFLaTeX";
Index: src/insets/InsetGraphics.cpp
===
--- src/insets/InsetGraphics.cpp	(Revision 36445)
+++ src/insets/InsetGraphics.cpp	(Arbeitskopie)
@@ -102,9 +102,10 @@
 /// Note that \p format may be unknown (i. e. an empty string)
 string findTargetFormat(string const & format, OutputParams const & runparams)
 {
-	// Are we using latex or XeTeX/pdflatex?
+	// Are we using latex or XeTeX/LuaTeX/pdflatex?
 	if (runparams.flavor == OutputParams::PDFLATEX
-	|| runparams.flavor == OutputParams::XETEX) {
+	|| runparams.flavor == OutputParams::XETEX
+	|| runparams.flavor == OutputParams::LUATEX) {
 		LYXERR(Debug::GRAPHICS, "findTargetFormat: PDF mode");
 		Format const * const f = formats.getFormat(format);
 		// Convert vector graphics to pdf
Index: src/Converter.cpp
===
--- src/Converter.cpp	(Revision 36445)
+++ src/Converter.cpp	(Arbeitskopie)
@@ -257,6 +257,8 @@
 		if (conv.latex)
 			if (contains(conv.from, "xetex"))
 return OutputParams::XETEX;
+			if (contains(conv.from, "luatex"))
+return OutputParams::LUATEX;
 			if (contains(conv.to, "pdf"))
 return OutputParams::PDFLATEX;
 		if (conv.xml)
@@ -747,6 +749,7 @@
 	v.push_back("docbook");
 	v.push_back("latex");
 	v.push_back("literate");
+	v.push_back("luatex");
 	v.push_back("lyx");
 	v.push_back("xhtml");
 	v.push_back("pdflatex");
Index: src/OutputParams.h
===
--- src/OutputParams.h	(Revision 36445)
+++ src/OutputParams.h	(Arbeitskopie)
@@ -29,6 +29,7 @@
 public:
 	enum FLAVOR {
 		LATEX,
+		LUATEX,
 		PDFLATEX,
 		XETEX,
 		XML,
Index: src/OutputParams.cpp
===
--- src/OutputParams.cpp	(Revision 36445)
+++ src/OutputParams.cpp	(Arbeitskopie)
@@ -45,13 +45,14 @@
 
 bool OutputParams::isLaTeX() const
 {
-	return flavor == LATEX || flavor == PDFLATEX || flavor == XETEX; 
+	return flavor == LATEX || flavor == LUATEX 
+		|| flavor == PDFLATEX || flavor == XETEX; 
 }
 
 
 bool OutputParams::isFullUnicode() const
 {
-	return flavor == XETEX; 
+	return flavor == LUATEX || flavor == XETEX; 
 }
 
 } // namespace lyx
Index: src/Buffer.cpp
===
--- src/Buffer.cpp	(Revision 36445)
+++ src/Buffer.cpp	(Arbeitskopie)
@@ -3406,6 +3406,8 @@
 		// FIXME: Don't hardcode format names here, but use a flag
 		if (backend_format == "pdflatex")
 			runparams.flavor = OutputParams::PDFLATEX;
+		else if (backend_format == "luatex")
+			runparams.flavor = OutputParams::LUATEX;
 		else if (backend_format == "xetex")
 			runparams.flavor = OutputParams::XETEX;
 	}
@@ -3616,6 +3618,8 @@
 	// FIXME: Don't hardcode format names here, but use a flag
 	if (v.back() == "latex")
 		v.push_back("pdflatex");
+	else if (v.back() == "xetex")
+		v.push_back("luatex");
 	v.push_back("xhtml");
 	v.push_back("text");
 	v.push_back("lyx");
Index: src/BufferParams.cpp
===
--- src/BufferParams.cpp	(Revision 36445)
+++ src/BufferParams.cpp	(Arbeitskopie)
@@ -1120,6 +1120,7 @@
 features.require("ct-none");
 			}
 			break;
+		case OutputParams::LUATEX:
 		case OutputParams::PDFLATEX:
 		case OutputParams::XETEX:
 			if (xcolorulem) {
@@ -1359,7 +1360,7 @@
 	// set font encoding
 	// for arabic_arabi and farsi we also need to load the LAE and
 	// LFE encoding
-	// XeTeX (isFullUnicode() flavor) works without fontenc
+	// XeTeX and LuaTeX (isFullUnicode() flavor) work without fontenc
 	if (font_encoding() != "default" && language->lang() != "japanese"
 	&& !features.runparams().isFullUnicode() && !tclass.provides("fontenc")) {
 		size_t fars = language_options.str().find("farsi");
Index: lib/configure.py
===
--- lib/configure.py	(Revision 36445)
+++ lib/configure.py	(Arbeitskopie)
@@ -507,6 +507,7 @@
 \Format lilypond   ly "LilyPond music""" ""	"%%"	"vector"
 \Format lilypond-booklytex "LilyPond book (LaTeX)"   "" ""	"%%"	"document"
 \Format latex  tex"LaTeX (plain)" L  ""	"%%"	"document"
+\Format luatex tex"LaTeX (LuaTeX)""" ""	"%%"	"document"
 \Format pdflatex   tex"LaTeX (pdflatex)"  "" ""	"%%"	"document"
 \Format xetex  tex"LaTeX (XeTeX)" "" ""	"%%"	"document"
 \Format text  

Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
> my newest proposal is useSystemFonts. See below.

The attached patch demonstrates this renaming (still partial, I didn't rename 
the Qt widgets and the real buffer param yet). If you look at this, you'll see 
that this buffer param is indeed only relevant where we do special things due 
to the use of system fonts (loading and setting up fontspec, loading the 
system fonts into the combo, disabling PSNFSS-or CJK-related widgets) .

Where we use it for other things (as in PreviewLoader or Buffer::encoding()), 
we actually misuse it (because we have no access to the flavors here). So the 
renaming makes things actually much clearer, at least IMHO.

Jürgen
Index: src/graphics/PreviewLoader.cpp
===
--- src/graphics/PreviewLoader.cpp	(Revision 36445)
+++ src/graphics/PreviewLoader.cpp	(Arbeitskopie)
@@ -600,7 +600,9 @@
 	   << int(font_scaling_factor) << ' '
 	   << theApp()->hexName(fg) << ' '
 	   << theApp()->hexName(bg);
-	if (buffer_.params().useXetex)
+	// FIXME differentiate XeTeX from useSystemFonts here!
+	// FIXME particularly check LuaTeX
+	if (buffer_.params().useSystemFonts)
 		cs << " xelatex";
 
 	string const command = libScriptSearch(cs.str());
Index: src/BufferParams.h
===
--- src/BufferParams.h	(Revision 36445)
+++ src/BufferParams.h	(Arbeitskopie)
@@ -215,8 +215,8 @@
 	std::string fontsTypewriter;
 	/// the default family (rm, sf, tt)
 	std::string fontsDefaultFamily;
-	/// use the XeTeX processor
-	bool useXetex;
+	/// use system fonts (OpenType, True Type)
+	bool useSystemFonts;
 	/// use expert Small Caps
 	bool fontsSC;
 	/// use Old Style Figures
@@ -374,7 +374,7 @@
  std::string const & sf, std::string const & tt,
  bool const & sc, bool const & osf,
  int const & sfscale, int const & ttscale,
- bool const & xetex) const;
+ bool const & use_systemfonts) const;
 
 	/// get the appropriate cite engine (natbib handling)
 	CiteEngine citeEngine() const;
Index: src/frontends/qt4/GuiDocument.cpp
===
--- src/frontends/qt4/GuiDocument.cpp	(Revision 36445)
+++ src/frontends/qt4/GuiDocument.cpp	(Arbeitskopie)
@@ -2073,7 +2073,7 @@
 		return;
 	// make a copy in order to consider unapplied changes
 	Buffer * tmpbuf = buffer().clone();
-	tmpbuf->params().useXetex = outputModule->xetexCB->isChecked();
+	tmpbuf->params().useSystemFonts = outputModule->xetexCB->isChecked();
 	int idx = latexModule->classCO->currentIndex();
 	if (idx >= 0) {
 		string const classname = classes_model_.getIDString(idx);
@@ -2390,7 +2390,7 @@
 		outputModule->defaultFormatCO->currentIndex()).toString());
 
 	bool const xetex = outputModule->xetexCB->isChecked();
-	bp_.useXetex = xetex;
+	bp_.useSystemFonts = xetex;
 
 	bp_.output_sync = outputModule->outputsyncCB->isChecked();
 	bp_.output_sync_macro = fromqstr(outputModule->synccustomCB->currentText());
@@ -2827,7 +2827,7 @@
 	outputModule->defaultFormatCO->setCurrentIndex(index);
 	outputModule->xetexCB->setEnabled(bp_.baseClass()->outputType() == lyx::LATEX);
 	outputModule->xetexCB->setChecked(
-		bp_.baseClass()->outputType() == lyx::LATEX && bp_.useXetex);
+		bp_.baseClass()->outputType() == lyx::LATEX && bp_.useSystemFonts);
 
 	outputModule->outputsyncCB->setChecked(bp_.output_sync);
 	outputModule->synccustomCB->setEditText(toqstr(bp_.output_sync_macro));
@@ -2840,7 +2840,7 @@
 	updateFontsize(documentClass().opt_fontsize(),
 			bp_.fontsize);
 
-	if (bp_.useXetex) {
+	if (bp_.useSystemFonts) {
 		fontModule->fontencLA->setEnabled(false);
 		fontModule->fontencCO->setEnabled(false);
 		fontModule->fontencLE->setEnabled(false);
Index: src/Buffer.cpp
===
--- src/Buffer.cpp	(Revision 36445)
+++ src/Buffer.cpp	(Arbeitskopie)
@@ -3029,7 +3029,7 @@
 {
 	OutputParams runparams(().encoding());
 	runparams.nice = true;
-	runparams.flavor = params().useXetex ? 
+	runparams.flavor = params().useSystemFonts ? 
 		OutputParams::XETEX : OutputParams::LATEX;
 	runparams.linelen = lyxrc.plaintext_linelen;
 	// No side effect of file copying and image conversion
@@ -3308,7 +3308,7 @@
 {
 	string format = params().documentClass().outputFormat();
 	if (format == "latex") {
-		if (params().useXetex)
+		if (params().useSystemFonts)
 			return "xetex";
 		if (params().encoding().package() == Encoding::japanese)
 			return "platex";
@@ -3326,7 +3326,7 @@
 	Formats formats = exportableFormats(true);
 	if (isDocBook()
 	|| isLiterate()
-	|| params().useXetex
+	|| params().useSystemFonts
 	|| params().encoding().package() == Encoding::japanese) {
 		if (formats.empty())
 			return string();
Index: src/BufferParams.cpp
===
--- src/BufferParams.cpp	(Revision 36445)
+++ src/BufferParams.cpp	

Re: [patch] LuaTeX

2010-11-23 Thread Jean-Marc Lasgouttes

Le 23 nov. 2010 à 14:05, Jürgen Spitzmüller a écrit :

> Jürgen Spitzmüller wrote:
>> my newest proposal is useSystemFonts. See below.

What about useNonLaTeXFonts? useNormalFonts? Use OpenTypeFonts?

I still do not like System.

JMarc



Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
> What about useNonLaTeXFonts? useNormalFonts? Use OpenTypeFonts?
> 
> I still do not like System.

OK, I understand that. I'm fine with useNonLaTeXFonts. useOpenTypeFonts is not 
really appropriate, since also TrueType can be used.

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Pavel Sanda
Jürgen Spitzmüller wrote:
> Richard Heck wrote:
> > Cheap indeed.
> 
> After my recent cleanup, it looks even cheaper. See attached.

ok, something of this kind can go in once you finish the discussion.

for the ui part i would let the keywords luatex/xetex somewhat visible
eg by putting into parenthesis. there will be users who will seek for
these strings.

pavel


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Pavel Sanda wrote:
> for the ui part i would let the keywords luatex/xetex somewhat visible
> eg by putting into parenthesis. there will be users who will seek for
> these strings.

My proposal would have been

"Use non-LaTeX fonts"
with the tooltip ("Use OpenType- and TrueType fonts directly (requires XeTeX 
or LuaTeX)")

But if you wish, I can change the label to
"Use non-LaTeX fonts (via XeTeX/LuateX)"

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Pavel Sanda
Jürgen Spitzmüller wrote:
> But if you wish, I can change the label to
> "Use non-LaTeX fonts (via XeTeX/LuateX)"

yes, i would prefer this one.
pavel


Re: [patch] LuaTeX

2010-11-23 Thread Richard Heck

On 11/23/2010 09:02 AM, Pavel Sanda wrote:

Jürgen Spitzmüller wrote:

But if you wish, I can change the label to
"Use non-LaTeX fonts (via XeTeX/LuateX)"

yes, i would prefer this one.


Agreed. We want to help the newbies, but not confuse the experts.

Richard



Re: [patch] LuaTeX

2010-11-23 Thread Enrico Forestieri
On Tue, Nov 23, 2010 at 10:02:36AM -0500, Richard Heck wrote:
> On 11/23/2010 09:02 AM, Pavel Sanda wrote:
> >Jürgen Spitzmüller wrote:
> >>But if you wish, I can change the label to
> >>"Use non-LaTeX fonts (via XeTeX/LuateX)"
> >yes, i would prefer this one.
> >
> Agreed. We want to help the newbies, but not confuse the experts.

A google search gives ~8000 hits for "latex fonts" and ~10 hits
for "tex fonts". That's more that one order of magnitude difference...

-- 
Enrico


Re: [patch] LuaTeX

2010-11-23 Thread Liviu Andronic
On Tue, Nov 23, 2010 at 4:51 PM, Enrico Forestieri  wrote:
> A google search gives ~8000 hits for "latex fonts" and ~10 hits
> for "tex fonts". That's more that one order of magnitude difference...
>
Can't confirm this:
'latex fonts': About 185,000 results (0.27 seconds)
'tex fonts': About 175,000 results (0.27 seconds)

Liviu


Re: [patch] LuaTeX

2010-11-23 Thread Enrico Forestieri
On Tue, Nov 23, 2010 at 04:58:19PM +0100, Liviu Andronic wrote:
> On Tue, Nov 23, 2010 at 4:51 PM, Enrico Forestieri  wrote:
> > A google search gives ~8000 hits for "latex fonts" and ~10 hits
> > for "tex fonts". That's more that one order of magnitude difference...
> >
> Can't confirm this:
> 'latex fonts': About 185,000 results (0.27 seconds)
> 'tex fonts': About 175,000 results (0.27 seconds)

You are searching for documents containing the word latex and fonts
in whatever position. Try surrounding the search with double quotes,
i.e., search for "latex fonts" and "tex fonts" literally. That will
hit only those documents where the word fonts exactly follows the
words latex or tex.

-- 
Enrico


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Pavel Sanda wrote:
> ok, something of this kind can go in once you finish the discussion.

I've put in the actual LuaTeX part since this seems uncontroversial. LuaTeX is 
now there as a "hidden feature".

I'll attache the (now complete) UI part so people can again raise their 
objections.

Jürgen
Index: src/BufferParams.h
===
--- src/BufferParams.h	(Revision 36448)
+++ src/BufferParams.h	(Arbeitskopie)
@@ -215,8 +215,8 @@
 	std::string fontsTypewriter;
 	/// the default family (rm, sf, tt)
 	std::string fontsDefaultFamily;
-	/// use the XeTeX processor
-	bool useXetex;
+	/// use the fonts of the OS (OpenType, True Type) directly
+	bool useNonLaTeXFonts;
 	/// use expert Small Caps
 	bool fontsSC;
 	/// use Old Style Figures
@@ -374,7 +374,7 @@
  std::string const & sf, std::string const & tt,
  bool const & sc, bool const & osf,
  int const & sfscale, int const & ttscale,
- bool const & xetex) const;
+ bool const & use_nonlatexfonts) const;
 
 	/// get the appropriate cite engine (natbib handling)
 	CiteEngine citeEngine() const;
Index: src/frontends/qt4/GuiDocument.h
===
--- src/frontends/qt4/GuiDocument.h	(Revision 36448)
+++ src/frontends/qt4/GuiDocument.h	(Arbeitskopie)
@@ -115,7 +115,7 @@
 	void deleteNoteFontColor();
 	void changeBoxBackgroundColor();
 	void deleteBoxBackgroundColor();
-	void xetexChanged(bool);
+	void osFontsChanged(bool);
 	void branchesRename(docstring const &, docstring const &);
 private:
 	/// validate listings parameters and return an error message, if any
Index: src/frontends/qt4/GuiDocument.cpp
===
--- src/frontends/qt4/GuiDocument.cpp	(Revision 36448)
+++ src/frontends/qt4/GuiDocument.cpp	(Arbeitskopie)
@@ -726,10 +726,6 @@
 	// output
 	outputModule = new UiWidget;
 
-	connect(outputModule->xetexCB, SIGNAL(clicked()),
-		this, SLOT(change_adaptor()));
-	connect(outputModule->xetexCB, SIGNAL(toggled(bool)),
-		this, SLOT(xetexChanged(bool)));
 	connect(outputModule->defaultFormatCO, SIGNAL(activated(int)),
 		this, SLOT(change_adaptor()));
 	connect(outputModule->mathimgSB, SIGNAL(valueChanged(double)),
@@ -750,6 +746,10 @@
 
 	// fonts
 	fontModule = new UiWidget;
+	connect(fontModule->osFontsCB, SIGNAL(clicked()),
+		this, SLOT(change_adaptor()));
+	connect(fontModule->osFontsCB, SIGNAL(toggled(bool)),
+		this, SLOT(osFontsChanged(bool)));
 	connect(fontModule->fontsRomanCO, SIGNAL(activated(int)),
 		this, SLOT(change_adaptor()));
 	connect(fontModule->fontsRomanCO, SIGNAL(activated(int)),
@@ -1585,38 +1585,38 @@
 }
 
 
-void GuiDocument::xetexChanged(bool xetex)
+void GuiDocument::osFontsChanged(bool nonlatexfonts)
 {
 	updateFontlist();
 	updateDefaultFormat();
-	langModule->encodingCO->setEnabled(!xetex &&
+	langModule->encodingCO->setEnabled(!nonlatexfonts &&
 		!langModule->defaultencodingRB->isChecked());
-	langModule->defaultencodingRB->setEnabled(!xetex);
-	langModule->otherencodingRB->setEnabled(!xetex);
+	langModule->defaultencodingRB->setEnabled(!nonlatexfonts);
+	langModule->otherencodingRB->setEnabled(!nonlatexfonts);
 
-	fontModule->fontsDefaultCO->setEnabled(!xetex);
-	fontModule->fontsDefaultLA->setEnabled(!xetex);
-	fontModule->cjkFontLE->setEnabled(!xetex);
-	fontModule->cjkFontLA->setEnabled(!xetex);
+	fontModule->fontsDefaultCO->setEnabled(!nonlatexfonts);
+	fontModule->fontsDefaultLA->setEnabled(!nonlatexfonts);
+	fontModule->cjkFontLE->setEnabled(!nonlatexfonts);
+	fontModule->cjkFontLA->setEnabled(!nonlatexfonts);
 	string font;
-	if (!xetex)
+	if (!nonlatexfonts)
 		font = tex_fonts_sans[fontModule->fontsSansCO->currentIndex()];
 	bool scaleable = providesScale(font);
 	fontModule->scaleSansSB->setEnabled(scaleable);
 	fontModule->scaleSansLA->setEnabled(scaleable);
-	if (!xetex)
+	if (!nonlatexfonts)
 		font = tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()];
 	scaleable = providesScale(font);
 	fontModule->scaleTypewriterSB->setEnabled(scaleable);
 	fontModule->scaleTypewriterLA->setEnabled(scaleable);
-	if (!xetex)
+	if (!nonlatexfonts)
 		font = tex_fonts_roman[fontModule->fontsRomanCO->currentIndex()];
 	fontModule->fontScCB->setEnabled(providesSC(font));
 	fontModule->fontOsfCB->setEnabled(providesOSF(font));
 	
-	fontModule->fontencLA->setEnabled(!xetex);
-	fontModule->fontencCO->setEnabled(!xetex);
-	if (xetex)
+	fontModule->fontencLA->setEnabled(!nonlatexfonts);
+	fontModule->fontencCO->setEnabled(!nonlatexfonts);
+	if (nonlatexfonts)
 		fontModule->fontencLE->setEnabled(false);
 	else
 		fontencChanged(fontModule->fontencCO->currentIndex());
@@ -1648,7 +1648,7 @@
 	fontModule->fontsTypewriterCO->clear();
 
 	// With XeTeX, we have access to all system fonts, but not the LaTeX fonts
-	if (outputModule->xetexCB->isChecked()) {
+	if (fontModule->osFontsCB->isChecked()) {
 		

Re: [patch] LuaTeX

2010-11-23 Thread Richard Heck

On 11/23/2010 11:10 AM, Jürgen Spitzmüller wrote:

Pavel Sanda wrote:

ok, something of this kind can go in once you finish the discussion.

I've put in the actual LuaTeX part since this seems uncontroversial. LuaTeX is
now there as a "hidden feature".

So can you tell me, just so I understand this, how we decide whether to 
use LuaTeX or XeTeX? Is that
now part of the format in effect? Or what? I more or less understand 
what these processors are meant to do,

but I'm pretty ignorant about them otherwise.

Richard



Re: [patch] LuaTeX

2010-11-23 Thread Enrico Forestieri
On Tue, Nov 23, 2010 at 05:10:56PM +0100, Jürgen Spitzmüller wrote:
> Pavel Sanda wrote:
> > ok, something of this kind can go in once you finish the discussion.
> 
> I've put in the actual LuaTeX part since this seems uncontroversial. LuaTeX 
> is 
> now there as a "hidden feature".
> 
> I'll attache the (now complete) UI part so people can again raise their 
> objections.

I suggest to either 1) s/LaTeXFonts/TeXFonts/
or  2) s/tex_fonts/latex_fonts/
I prefer 1).

> - if (!xetex)
> + if (!nonlatexfonts)
>   font = tex_fonts_sans[fontModule->fontsSansCO->currentIndex()];
[...]
> - if (!xetex)
> + if (!nonlatexfonts)
>   font = 
> tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()];
[...]
> - if (!xetex)
> + if (!nonlatexfonts)
>   font = 
> tex_fonts_roman[fontModule->fontsRomanCO->currentIndex()];
[...]
>   string const font = tex_fonts_roman[item];
[...]
>   string const font = tex_fonts_sans[item];
[...]
>   string const font = tex_fonts_monospaced[item];

-- 
Enrico


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Richard Heck wrote:
> So can you tell me, just so I understand this, how we decide whether to 
> use LuaTeX or XeTeX? Is that
> now part of the format in effect? Or what? I more or less understand 
> what these processors are meant to do,
> but I'm pretty ignorant about them otherwise.

The same way as we decide whether to use latex or pdflatex. The user has the 
choice to either click on View > PDF (XeTeX) or View > PDF (LuaTeX). Either 
choice comes with a respective flavor.

Again, we just need to know in advance if we use XeTeX/LuaTeX OR anything else 
(because this has consequences for the GUI, namely the font combos). 
Everything else can be determined at export time.

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Enrico Forestieri
On Tue, Nov 23, 2010 at 05:26:48PM +0100, Enrico Forestieri wrote:
> On Tue, Nov 23, 2010 at 05:10:56PM +0100, Jürgen Spitzmüller wrote:
> > Pavel Sanda wrote:
> > > ok, something of this kind can go in once you finish the discussion.
> > 
> > I've put in the actual LuaTeX part since this seems uncontroversial. LuaTeX 
> > is 
> > now there as a "hidden feature".
> > 
> > I'll attache the (now complete) UI part so people can again raise their 
> > objections.
> 
> I suggest to either 1) s/LaTeXFonts/TeXFonts/
> or  2) s/tex_fonts/latex_fonts/
> I prefer 1).

Also, given the number of occurrences of the construct !nonlatexfonts,
I would eliminate the "non" prefix and reverse the logic.

-- 
Enrico


RE: [patch] LuaTeX

2010-11-23 Thread Rob Oakes
I am ecstatic to see support for LuaTeX and XeTeX added.  I've used XeTeX
for a while now and I'm just starting to use LuaTeX.  However, it is really
important that you allow the user choose which engine they wish to use.
While the goal is to make LuaTeX the end all and be-all of TeX typesetting,
it isn't there yet.

XeLaTeX supports a number of advanced font features not available in LuaTeX
yet (the FontSpec manual has a pretty comprehensive list of what these are).
And while most LyX users aren't going to use all of them, some will and do.
(Which is to say, I do.)  Therefore, the ability to specify whether my
document will compile with LuaTeX or XeTeX is very important.

Help the newbies, but not frustrate the experienced.

Cheers,

Rob



Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Rob Oakes wrote:
> I am ecstatic to see support for LuaTeX and XeTeX added.  I've used XeTeX
> for a while now and I'm just starting to use LuaTeX.  However, it is really
> important that you allow the user choose which engine they wish to use.

Worry not. You are completely free to select either of these in the same way 
as you are free to select either pdfatex or ps2pdf.

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Jürgen Spitzmüller
Enrico Forestieri wrote:
> > I suggest to either 1) s/LaTeXFonts/TeXFonts/
> > or  2) s/tex_fonts/latex_fonts/
> > I prefer 1).
> 
> Also, given the number of occurrences of the construct !nonlatexfonts,
> I would eliminate the "non" prefix and reverse the logic.

OK. Both points taken.

Jürgen


Re: [patch] LuaTeX

2010-11-23 Thread Pavel Sanda
Jürgen Spitzmüller wrote:
> I'll attache the (now complete) UI part so people can again raise their 
> objections.

i didnt see FORMAT file...
pavel


  1   2   >