]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetNomencl.cpp
We cannot access theFontMetrics in command line mode.
[features.git] / src / insets / InsetNomencl.cpp
index 8cb01e8b46291440724b18355d87ff8bd49dfd79..33c7366557a630dea28d2e18c280d579429d30c6 100644 (file)
@@ -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;