| 32 | } |
| 33 | |
| 34 | Node* TextModule::evaluate(const Context& ctx) const |
| 35 | { |
| 36 | auto* textVal=dynamic_cast<TextValue*>(getParameterArgument(ctx,0)); |
| 37 | if(!textVal) |
| 38 | return nullptr; |
| 39 | |
| 40 | QString family; |
| 41 | auto* fontVal=dynamic_cast<TextValue*>(getParameterArgument(ctx,1)); |
| 42 | if(fontVal) |
| 43 | family=fontVal->getValueString(); |
| 44 | |
| 45 | int size=12; |
| 46 | auto* sizeVal=dynamic_cast<NumberValue*>(getParameterArgument(ctx,2)); |
| 47 | if(sizeVal) |
| 48 | size=sizeVal->toInteger(); |
| 49 | |
| 50 | QPathTextBuilder tb; |
| 51 | tb.setText(textVal->getValueString()); |
| 52 | tb.setFamily(family); |
| 53 | tb.setSize(size); |
| 54 | |
| 55 | auto* pn=new PrimitiveNode(); |
| 56 | Primitive* p=tb.buildPrimitive(); |
| 57 | p->setType(PrimitiveTypes::Surface); |
| 58 | p->setSanitized(false); |
| 59 | pn->setPrimitive(p); |
| 60 | pn->setChildren(ctx.getInputNodes()); |
| 61 | return pn; |
| 62 | } |
nothing calls this directly
no test coverage detected