]> git.lyx.org Git - lyx.git/blobdiff - src/font.C
small fix with footnote, use stringstream some more
[lyx.git] / src / font.C
index 0ae9286b2bde5001029ae940b1ebb1bdc6cfa03d..f022b22c41eedb25c4ab4e8848368759466b7b51 100644 (file)
 #include "FontLoader.h"
 #include "lyxrc.h"
 #include "encoding.h"
+#include "language.h"
 
-// namespace {
-static inline
+namespace {
+
+inline
 XFontStruct * getXFontstruct(LyXFont const & f)
 {
        return fontloader.load(f.family(), f.series(),
@@ -30,12 +32,13 @@ XFontStruct * getXFontstruct(LyXFont const & f)
 }
 
 
-static inline
+inline
 XID getFontID(LyXFont const & f)
 {
        return getXFontstruct(f)->fid;
 }
-// } // end of anon namespace
+
+} // namespace anon
 
 int lyxfont::maxAscent(LyXFont const & f)
 {
@@ -55,7 +58,7 @@ int lyxfont::ascent(char c, LyXFont const & f)
        unsigned int uc = static_cast<unsigned char>(c);
        if (finfo->per_char
            && uc >= finfo->min_char_or_byte2
-           && uc <= finfo->max_char_or_byte2) 
+           && uc <= finfo->max_char_or_byte2+256*finfo->max_byte1
                return finfo->per_char[uc - finfo->min_char_or_byte2].ascent;
        else
                return finfo->ascent;
@@ -68,7 +71,7 @@ int lyxfont::descent(char c, LyXFont const & f)
        unsigned int uc = static_cast<unsigned char>(c);
        if (finfo->per_char
            && uc >= finfo->min_char_or_byte2
-           && uc <= finfo->max_char_or_byte2) 
+           && uc <= finfo->max_char_or_byte2+256*finfo->max_byte1
                return finfo->per_char[uc - finfo->min_char_or_byte2].descent;
        else
                return finfo->descent;
@@ -81,7 +84,7 @@ int lyxfont::lbearing(char c, LyXFont const & f)
        unsigned int uc = static_cast<unsigned char>(c);
        if (finfo->per_char
            && uc >= finfo->min_char_or_byte2
-           && uc <= finfo->max_char_or_byte2) 
+           && uc <= finfo->max_char_or_byte2+256*finfo->max_byte1
                return finfo->per_char[uc - finfo->min_char_or_byte2].lbearing;
        else
                return 0;
@@ -94,7 +97,7 @@ int lyxfont::rbearing(char c, LyXFont const & f)
        unsigned int uc = static_cast<unsigned char>(c);
        if (finfo->per_char
            && uc >= finfo->min_char_or_byte2
-           && uc <= finfo->max_char_or_byte2) 
+           && uc <= finfo->max_char_or_byte2+256*finfo->max_byte1
                return finfo->per_char[uc - finfo->min_char_or_byte2].rbearing;
        else
                return width(c, f);