-int ParagraphMetrics::singleWidth(pos_type pos, Font const & font) const
-{
- // The most special cases are handled first.
- if (par_->isInset(pos))
- return insetDimension(par_->getInset(pos)).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::isComposeChar_arabic(c))
- return 0;
- c = par_->transformChar(c, pos);
- } else if (language->lang() == "hebrew" &&
- Encodings::isComposeChar_hebrew(c))
- return 0;
- }
- return theFontMetrics(font).width(c);
-}
-
-