From 869b84aef9dbec9c90ba4483db0b28a3fb92b947 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Thu, 16 Aug 2012 13:23:39 +0200 Subject: [PATCH] Clean up LaTeX font handling (#4999) The LaTeX font information are now centralized and outsourced. This removes a lot of hardcoding and duplication and makes it easier to support new LaTeX fonts. --- development/qmake/lyx.pro | 2 + lib/Makefile.am | 2 +- lib/latexfonts | 242 +++++++++++++++++++++ po/Rules-lyx | 3 + po/lyx_pot.py | 25 ++- src/BufferParams.cpp | 140 ++++--------- src/LaTeXFonts.cpp | 335 ++++++++++++++++++++++++++++++ src/LaTeXFonts.h | 136 ++++++++++++ src/LyX.cpp | 16 +- src/LyX.h | 2 + src/Makefile.am | 2 + src/frontends/qt4/GuiDocument.cpp | 245 ++++++++++------------ src/frontends/qt4/GuiDocument.h | 14 +- 13 files changed, 923 insertions(+), 241 deletions(-) create mode 100644 lib/latexfonts create mode 100644 src/LaTeXFonts.cpp create mode 100644 src/LaTeXFonts.h diff --git a/development/qmake/lyx.pro b/development/qmake/lyx.pro index 2b0d271dfa..cef4569653 100644 --- a/development/qmake/lyx.pro +++ b/development/qmake/lyx.pro @@ -91,6 +91,7 @@ SOURCES += \ ../../src/Language.cpp \ ../../src/LaTeX.cpp \ ../../src/LaTeXFeatures.cpp \ +../../src/LaTeXFonts.cpp \ ../../src/Layout.cpp \ ../../src/LayoutFile.cpp \ ../../src/LayoutModuleList.cpp \ @@ -439,6 +440,7 @@ HEADERS += \ ../../src/KeySequence.h \ ../../src/Language.h \ ../../src/LaTeXFeatures.h \ +../../src/LaTeXFonts.h \ ../../src/LaTeX.h \ ../../src/LayoutEnums.h \ ../../src/LayoutFile.h \ diff --git a/lib/Makefile.am b/lib/Makefile.am index 2111dfbc72..90935c3fe6 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -5,7 +5,7 @@ SUBDIRS = doc lyx2lyx CHMOD = chmod dist_pkgdata_DATA = CREDITS autocorrect chkconfig.ltx external_templates \ - encodings layouttranslations languages symbols syntax.default \ + encodings layouttranslations languages latexfonts symbols syntax.default \ unicodesymbols nodist_pkgdata_DATA = installed_translations diff --git a/lib/latexfonts b/lib/latexfonts new file mode 100644 index 0000000000..cf5940546f --- /dev/null +++ b/lib/latexfonts @@ -0,0 +1,242 @@ +########################################################################## +# +# LaTeX fonts natively supported by LyX. +# +# Syntax: +# +# Font +# GuiName "" +# Family +# SwitchDefault <0|1> +# Package +# Requires +# AltPackages +# OT1Package +# CompletePackage +# OsfOption