public Box createBox(TeXEnvironment env) { boolean prev = env.getSmallCap(); env.setSmallCap(true); Box box = base.createBox(env); env.setSmallCap(prev); return box; }
public Box createBox(TeXEnvironment env) { TreeEditor.addAtoms(this); TeXFont tf = env.getTeXFont(); int style = env.getStyle(); Char c = tf.getChar(name, style); Box cb = new CharBox(c); if (env.getSmallCap() && unicode != 0 && Character.isLowerCase(unicode)) { try { cb = new ScaleBox( new CharBox( tf.getChar( TeXFormula.symbolTextMappings[Character.toUpperCase(unicode)], style)), 0.8, 0.8); } catch (SymbolMappingNotFoundException e) { } } if (type == TeXConstants.TYPE_BIG_OPERATOR) { if (style < TeXConstants.STYLE_TEXT && tf.hasNextLarger(c)) c = tf.getNextLarger(c, style); cb = new CharBox(c); cb.setShift( -(cb.getHeight() + cb.getDepth()) / 2 - env.getTeXFont().getAxisHeight(env.getStyle())); float delta = c.getItalic(); HorizontalBox hb = new HorizontalBox(cb); if (delta > TeXFormula.PREC) hb.add(new StrutBox(delta, 0, 0, 0)); usedBox = hb; return hb; } usedBox = cb; return cb; }