On Tue, Dec 10, 2002 at 08:48:02PM +0100, Lars Gullik Bjønnes wrote:

> | +#include <map>
> | + 
> | +#include "encoding.h"
> |  #include "lyxfont.h"
> |  
> |  #include <qfont.h>
> 
> include order

I have never been able  to work out what you wanted with these, and I
never understood your summary

> | +   /// return pixel width for the given unicode char
> | +   short charwidth(LyXFont const & f, Uchar val);
> | +
> 
> "short" makes me go: "Hu! Why? Anything special going on here?"

why not save some memory ?

> | -   font_info const * fi = 
>fontinfo_[f.family()][f.series()][f.realShape()][f.size()];
> | +   font_info * fi =
> | fontinfo_[f.family()][f.series()][f.realShape()][f.size()];
> 
> And why cannot these be left const?

Because we have to modify the std::map

> |     if (!fi) {
> |             fi = new font_info(f);
> 
> and give this one its own variable. (I hate double usage)

I thought you hated duplicate code

> | +int charwidth(Uchar val, LyXFont const & f)
> | +{
> | +   return fontloader.charwidth(f, val); 
> | +}
> 
> Where did the short (Hu! Why! Anything special going on here?) go?

This one isn't stored

regards
john
-- 
"Saying that taste is just personal preference is a good way to prevent
disputes. The trouble is, it's not true."
        - Paul Graham

Reply via email to