| 15 | /************************************** factory implementation ************************************/ |
| 16 | |
| 17 | sptr<Box> DelimiterFactory::create(_in_ SymbolAtom& symbol, _out_ TeXEnvironment& env, int size) { |
| 18 | if (size > 4) return symbol.createBox(env); |
| 19 | |
| 20 | TeXFont& tf = *(env.getTeXFont()); |
| 21 | int style = env.getStyle(); |
| 22 | Char c = tf.getChar(symbol.getName(), style); |
| 23 | int i = 0; |
| 24 | |
| 25 | for (int i = 1; i <= size && tf.hasNextLarger(c); i++) c = tf.getNextLarger(c, style); |
| 26 | |
| 27 | if (i <= size && !tf.hasNextLarger(c)) { |
| 28 | CharBox A(tf.getChar(L'A', "mathnormal", style)); |
| 29 | auto b = create(symbol.getName(), env, size * (A._height + A._depth)); |
| 30 | return b; |
| 31 | } |
| 32 | |
| 33 | return sptr<Box>(new CharBox(c)); |
| 34 | } |
| 35 | |
| 36 | sptr<Box> DelimiterFactory::create(const string& symbol, _out_ TeXEnvironment& env, float minHeight) { |
| 37 | TeXFont& tf = *(env.getTeXFont()); |
nothing calls this directly
no test coverage detected