From 8f9898994d93d8f215f041bf42df0e06d028bbee Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 22 Sep 2012 17:44:00 +0200 Subject: [PATCH] Basic UI for math (TeX) fonts This addresses #6543 by adding an option to prevent fonts such as Palatino and Times to automatically adapt the math font (IOW it lets you load the text font only for a bunch of fonts where this is easily possible). Furthermore it adds an interface to select a specific math font, which is defined in latexfonts. Currently, this is only euler (the only one I know), but if there are other math-only tex fonts, they can be added easily (but note that this changes the file format). Non-TeX math fonts are not yet supported. Eventually, unicode-math support can use the existing UI, but this is not on my agenda. --- development/FORMAT | 10 ++++ lib/chkconfig.ltx | 1 + lib/doc/LaTeXConfig.lyx | 31 ++++++++++- lib/latexfonts | 57 ++++++++++++++++++- lib/lyx2lyx/lyx_2_1.py | 37 +++++++++++- src/BufferParams.cpp | 25 +++++++-- src/BufferParams.h | 2 + src/LaTeXFeatures.cpp | 13 ++++- src/LaTeXFonts.cpp | 93 +++++++++++++++++++------------ src/LaTeXFonts.h | 22 +++++--- src/frontends/qt4/GuiDocument.cpp | 91 ++++++++++++++++++++++++++++-- src/frontends/qt4/GuiDocument.h | 7 +++ src/frontends/qt4/ui/FontUi.ui | 42 ++++++++++---- src/version.h | 4 +- 14 files changed, 361 insertions(+), 74 deletions(-) diff --git a/development/FORMAT b/development/FORMAT index f75d182a73..5b4e68c4e8 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -12,6 +12,16 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx. ----------------------- +2012-09-22 Jürgen Spitzmüller + * Format incremented to 440 + Math (TeX) font UI. + New Buffer param "\math_font ", + supported values are: + * "auto": automatically adapt math font (the status quo ante). + * "default": use class default, i.e. prevent TeX font packages + from changing the math font, if possible. + * "eulervm": use the eulervm package. + 2012-09-19 Jürgen Spitzmüller * Format incremented to 439 Support for the MinionPro LaTeX font. diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index cc0b876f85..e2be1a8341 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -357,6 +357,7 @@ \TestPackage{ccfonts} \TestPackage{cmbright} \TestPackage{eco} +\TestPackage{eulervm} \TestPackage{feyn} \TestPackage{fourier} \TestPackage{libertine} diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index 55cb304c3f..c05272dc37 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -1,5 +1,5 @@ #LyX 2.1 created this file. For more info see http://www.lyx.org/ -\lyxformat 438 +\lyxformat 440 \begin_document \begin_header \textclass article @@ -12,6 +12,7 @@ \font_roman default \font_sans default \font_typewriter default +\font_math auto \font_default_family default \use_non_tex_fonts false \font_sc false @@ -414,6 +415,34 @@ eco Computer Modern \family default font family. +\end_layout + +\begin_layout Subsection +Euler Virtual Math +\end_layout + +\begin_layout Description +Found: +\begin_inset Info +type "package" +arg "eulervm" +\end_inset + + +\end_layout + +\begin_layout Description +CTAN: +\family sans +fonts/eulervm/ +\end_layout + +\begin_layout Description +Notes: The +\family sans +eulervm +\family default + package provides access to the Euler math fonts. \end_layout diff --git a/lib/latexfonts b/lib/latexfonts index 273da4b2d4..25ca2e13a2 100644 --- a/lib/latexfonts +++ b/lib/latexfonts @@ -6,13 +6,14 @@ # # Font # GuiName "" -# Family +# Family # SwitchDefault <0|1> # Package # Requires # AltFonts # OT1Font # CompleteFont +# NoMathFont # PackageOptions # OsfOption