-int ParagraphMetrics::singleWidth(pos_type pos, Font const & font) const
-{
- // The most special cases are handled first.
- if (Inset const * inset = par_->getInset(pos))
- return insetDimension(inset).wid;
-
- char_type c = par_->getChar(pos);
-
- if (!isPrintable(c))
- return theFontMetrics(font).width(c);
-
- Language const * language = font.language();
- if (language->rightToLeft()) {
- if (language->lang() == "arabic_arabtex" ||
- language->lang() == "arabic_arabi" ||
- language->lang() == "farsi") {
- if (Encodings::isArabicComposeChar(c))
- return 0;
- c = par_->transformChar(c, pos);
- } else if (language->lang() == "hebrew" &&
- Encodings::isHebrewComposeChar(c)) {
- return 0;
- }
- }
- return theFontMetrics(font).width(c);
-}
-
-