-namespace {
-
-int logoWidth(FontInfo const & font, InsetSpecialChar::Kind kind) {
- frontend::FontMetrics const & fm = theFontMetrics(font);
- int const em = fm.em();
- int width = 0;
- // See drawlogo() below to understand what this does.
- switch (kind) {
- case InsetSpecialChar::PHRASE_LYX:
- width = fm.width(from_ascii("L")) - em / 6
- + fm.width(from_ascii("Y")) - em / 8
- + fm.width(from_ascii("X"));
- break;
-
- case InsetSpecialChar::PHRASE_TEX:
- width = fm.width(from_ascii("T")) - em / 6
- + fm.width(from_ascii("E")) - em / 8
- + fm.width(from_ascii("X"));
- break;
-
- case InsetSpecialChar::PHRASE_LATEX2E:
- width = logoWidth(font, InsetSpecialChar::PHRASE_LATEX)
- + 3 * em / 20
- + fm.width(from_ascii("2") + char_type(0x03b5));
- break;
- case InsetSpecialChar::PHRASE_LATEX: {
- FontInfo smaller = font;
- smaller.decSize().decSize();
- width = fm.width(from_ascii("L")) - 9 * em / 25
- + theFontMetrics(smaller).width(from_ascii("A")) - 3 * em / 20
- + logoWidth(font, InsetSpecialChar::PHRASE_TEX);
- break;
- }
- default:
- LYXERR0("No information for computing width of logo " << kind);
- }
-
- return width;
-}
-
-}
-
-
-void InsetSpecialChar::metrics(MetricsInfo & mi, Dimension & dim) const