]> git.lyx.org Git - lyx.git/commitdiff
GuiDelimiter: Workaround symbols alignment problem #10118
authorGuillaume Munch <gm@lyx.org>
Thu, 5 May 2016 00:00:57 +0000 (01:00 +0100)
committerGuillaume Munch <gm@lyx.org>
Fri, 20 May 2016 18:32:35 +0000 (19:32 +0100)
src/frontends/qt4/GuiDelimiter.cpp

index 2ae6def688df913f9746ab35172cae037fcebde7..1f96788b2d04679fa16339786036c09a9e859531 100644 (file)
@@ -21,8 +21,9 @@
 #include "FontInfo.h"
 #include "FuncRequest.h"
 
-#include "support/gettext.h"
+#include "support/debug.h"
 #include "support/docstring.h"
+#include "support/gettext.h"
 
 #include <QPixmap>
 #include <QCheckBox>
@@ -201,7 +202,16 @@ GuiDelimiter::GuiDelimiter(GuiView & lv)
                lwi->setFont(font);
                lwi->setToolTip(toqstr(delim));
                lwi->setSizeHint(item_size);
-               lwi->setTextAlignment(Qt::AlignTop);
+               switch (ms.fontfamily) {
+               case CMSY_FAMILY:
+               case STMARY_FAMILY:
+                       // Hack to work around the broken metrics of these fonts
+                       // FIXME: Better fix the fonts or use fonts that are not broken
+                       lwi->setTextAlignment(Qt::AlignTop | Qt::AlignHCenter);
+                       break;
+               default:
+                       lwi->setTextAlignment(Qt::AlignCenter);
+               }
                list_items[ms.unicode] = lwi;
                leftLW->addItem(lwi);
        }