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;
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;
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;
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);
if (lyxrc.font_norm_type == LyXRC::ISO_10646_1) {
XChar2b * xs = new XChar2b[n];
Encoding const * encoding = f.language()->encoding();
- LyXFont const * font = &f;
+ //LyXFont const * font = &f;
+ LyXFont font(f);
if (f.family() == LyXFont::SYMBOL_FAMILY) {
#ifdef USE_UNICODE_FOR_SYMBOLS
- LyXFont font2 = f;
- font2.setFamily(LyXFont::ROMAN_FAMILY);
- font2.setShape(LyXFont::UP_SHAPE);
- font = &font2;
+ //LyXFont font2 = f;
+ font.setFamily(LyXFont::ROMAN_FAMILY);
+ font.setShape(LyXFont::UP_SHAPE);
+ //font = &font2;
#endif
- encoding = &symbol_encoding;
+ encoding = encodings.symbol_encoding();
}
- for (int i = 0; i < n; ++i) {
+ for (size_t i = 0; i < n; ++i) {
Uchar c = encoding->ucs(s[i]);
xs[i].byte1 = c >> 8;
xs[i].byte2 = c & 0xff;
}
- int result = width(xs, n, *font);
+ int result = width(xs, n, font);
delete[] xs;
return result;
}
char c;
LyXFont smallfont(f);
smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
- for (int i = 0; i < n; ++i) {
+ for (size_t i = 0; i < n; ++i) {
c = s[i];
// when islower is a macro, the cast is needed (JMarc)
if (islower(static_cast<unsigned char>(c))) {