From: Jürgen Spitzmüller Date: Sat, 23 May 2009 05:47:40 +0000 (+0000) Subject: We cannot access theFontMetrics in command line mode. X-Git-Tag: 2.0.0~6480 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e4f95b890cb6ceec7b4de812c1391f6e28db15f5;p=features.git We cannot access theFontMetrics in command line mode. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29804 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetNomencl.cpp b/src/insets/InsetNomencl.cpp index 8cb01e8b46..33c7366557 100644 --- a/src/insets/InsetNomencl.cpp +++ b/src/insets/InsetNomencl.cpp @@ -24,6 +24,7 @@ #include "InsetList.h" #include "LaTeXFeatures.h" #include "Length.h" +#include "LyX.h" #include "MetricsInfo.h" #include "sgml.h" @@ -242,8 +243,9 @@ docstring nomenclWidest(Buffer const & buffer) nomencl->getParam("symbol"); // This is only an approximation, // but the best we can get. - int const wx = - theFontMetrics(Font()).width(symbol); + int const wx = use_gui ? + theFontMetrics(Font()).width(symbol) : + symbol.size(); if (wx > w) { w = wx; symb = symbol;