| 48 | } |
| 49 | |
| 50 | TeXRender* LaTeX::parse(const wstring& latex, int width, float textSize, float lineSpace, color fg) { |
| 51 | bool lined = true; |
| 52 | if (startswith(latex, L"$$") || startswith(latex, L"\\[")) { |
| 53 | lined = false; |
| 54 | } |
| 55 | int align = lined ? ALIGN_LEFT : ALIGN_CENTER; |
| 56 | _formula->setLaTeX(latex); |
| 57 | TeXRender* render = |
| 58 | _builder->setStyle(STYLE_DISPLAY) |
| 59 | .setTextSize(textSize) |
| 60 | .setWidth(UNIT_PIXEL, width, align) |
| 61 | .setIsMaxWidth(lined) |
| 62 | .setLineSpace(UNIT_PIXEL, lineSpace) |
| 63 | .setForeground(fg) |
| 64 | .build(*_formula); |
| 65 | return render; |
| 66 | } |
nothing calls this directly
no test coverage detected