]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gtk/xftFontLoader.h
fontloader for gtk, probably not efficient
[lyx.git] / src / frontends / gtk / xftFontLoader.h
index 4c2cb086c67bd18b1d3891ae4ae7932a8ba5556b..0599a998a1110d771f8bbd932f5cc6fb7ecf8960 100644 (file)
@@ -14,6 +14,8 @@
 
 #include "frontends/FontLoader.h"
 
+#include "xftFontMetrics.h"
+
 #include "lyxfont.h"
 
 #include <gtkmm.h>
@@ -34,6 +36,15 @@ public:
        virtual void update();
 
        virtual bool available(LyXFont const & f);
+       virtual lyx::frontend::FontMetrics const & metrics(LyXFont const & f)
+       {
+               if (f.realShape() != LyXFont::SMALLCAPS_SHAPE)
+                       return font_metrics(load(f.family(), f.series(), f.realShape(), f.size()), 0);
+               LyXFont scf(f);
+               scf.decSize().decSize().setShape(LyXFont::UP_SHAPE);
+               return font_metrics(load(f.family(), f.series(), f.realShape(), f.size()),
+                               load(scf.family(), scf.series(), scf.realShape(), scf.size()));
+       }
 
        /// Load font
        XftFont * load(LyXFont::FONT_FAMILY family,