MCPcopy Create free account
hub / github.com/NanoMichael/MicroTeX / create

Method create

src/atom/box.cpp:17–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15/************************************** factory implementation ************************************/
16
17sptr<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
36sptr<Box> DelimiterFactory::create(const string& symbol, _out_ TeXEnvironment& env, float minHeight) {
37 TeXFont& tf = *(env.getTeXFont());

Callers

nothing calls this directly

Calls 15

SmashedAtomFunction · 0.85
SpaceAtomFunction · 0.85
ScaleAtomFunction · 0.85
hasTopMethod · 0.80
hasMiddleMethod · 0.80
hasBottomMethod · 0.80
createBoxMethod · 0.45
getStyleMethod · 0.45
getCharMethod · 0.45
hasNextLargerMethod · 0.45
getNextLargerMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected