+
+
+int GuiFontMetrics::width(char_type c) const
+{
+ if (!width_cache_.contains(c)) {
+ width_cache_.insert(c, metrics_.width(ucs4_to_qchar(c)));
+ }
+
+ return width_cache_.value(c);
+}
+
+
+int GuiFontMetrics::ascent(char_type c) const
+{
+ if (!metrics_cache_.contains(c))
+ fillMetricsCache(c);
+
+ return metrics_cache_.value(c).ascent;
+}
+
+
+int GuiFontMetrics::descent(char_type c) const
+{
+ if (!metrics_cache_.contains(c))
+ fillMetricsCache(c);
+
+ return metrics_cache_.value(c).descent;
+}
+
+#endif
+
+} // frontend
+} // lyx