+ frontend::FontMetrics const & fm = theFontMetrics(mi.base.font);
+ int const max_width = mi.base.textwidth;
+
+ Length const width(to_ascii(getParam("width")));
+ dim.wid = width.inPixels(max_width, fm.width(char_type('M')));
+
+ // assure that the line inset is not outside of the window
+ // check that it doesn't exceed the outer boundary
+ if (dim.wid > max_width)
+ dim.wid = max_width;
+
+ // set a minimal width
+ int const minw = (dim.wid < 0) ? 24 : 4;
+ dim.wid = max(minw, max(dim.wid, -dim.wid));
+
+ Length height = Length(to_ascii(getParam("height")));
+ height_ = height.inPixels(dim.height(), fm.width(char_type('M')));
+
+ // get the length of the parameters in pixels
+ Length offset = Length(to_ascii(getParam("offset")));
+ offset_ = offset.inPixels(max_width, fm.width(char_type('M')));
+
+ dim.asc = max(fm.maxAscent(), offset_ + height_);
+ dim.des = max(fm.maxDescent(), - offset_);
+
+ // Cache the inset dimension
+ setDimCache(mi, dim);