Abdelrazak Younes a écrit :
There is no caching either in qt3. I guess we've found a nice
optimisation to do :-)
I'll send a patch soon!
Font caching was not done in qt3 and qt4, this patch fixes this. Please
test on linux/qt[34] and Mac/qt[34]
I am going to commit the qt4 part of this patch for now. If you want the
qt3 part also just tell me.
Abdel.
Abdel.
------------------------------------------------------------------------
Index: src/frontends/qt3/qfont_loader.h
===================================================================
--- src/frontends/qt3/qfont_loader.h (revision 13887)
+++ src/frontends/qt3/qfont_loader.h (working copy)
@@ -83,10 +83,13 @@
/// Get font info (font + metrics) for the given LyX font.
QLFontInfo & fontinfo(LyXFont const & f) {
- QLFontInfo * & fi =
+ QLFontInfo * fi =
fontinfo_[f.family()][f.series()][f.realShape()][f.size()];
- if (!fi)
+ if (!fi) {
fi = new QLFontInfo(f);
+
fontinfo_[f.family()][f.series()][f.realShape()][f.size()]
+ = fi;
+ }
return *fi;
}
Index: src/frontends/qt4/qfont_loader.h
===================================================================
--- src/frontends/qt4/qfont_loader.h (revision 13887)
+++ src/frontends/qt4/qfont_loader.h (working copy)
@@ -83,10 +83,13 @@
/// Get font info (font + metrics) for the given LyX font.
QLFontInfo & fontinfo(LyXFont const & f) {
- QLFontInfo * & fi =
+ QLFontInfo * fi =
fontinfo_[f.family()][f.series()][f.realShape()][f.size()];
- if (!fi)
+ if (!fi) {
fi = new QLFontInfo(f);
+
fontinfo_[f.family()][f.series()][f.realShape()][f.size()]
+ = fi;
+ }
return *fi;
}