mirror of https://github.com/vitalif/openscad
Add positional parameters for text().
Positional parameters are t, size, font. Example: text("OpenSCAD", 30, "Liberation Mono");text-module
parent
256a52d9c6
commit
6c84515275
|
@ -15,6 +15,8 @@ parser_yacc.h
|
|||
*/#*#
|
||||
/nbproject
|
||||
/openscad
|
||||
/mingw32
|
||||
/mingw64
|
||||
/tests/openscad_nogui
|
||||
testdata/scad/features/import_dxf-tests.scad
|
||||
testdata/scad/features/import_stl-tests.scad
|
||||
|
|
|
@ -49,6 +49,8 @@ AbstractNode *TextModule::instantiate(const Context *ctx, const ModuleInstantiat
|
|||
TextNode *node = new TextNode(inst);
|
||||
|
||||
AssignmentList args;
|
||||
args += Assignment("t", NULL), Assignment("size", NULL), Assignment("font", NULL);
|
||||
|
||||
Context c(ctx);
|
||||
c.setVariables(args, evalctx);
|
||||
|
||||
|
|
|
@ -17,4 +17,10 @@ rotate([45, 0, -45]) {
|
|||
|
||||
translate([0, -40, 0])
|
||||
text(t = t3, font="PT Serif:style=Regular", size=20, language="ru");
|
||||
|
||||
translate([0, -80, 0])
|
||||
text("positional", 30, "PT Serif:style=Regular");
|
||||
|
||||
translate([0, -100, 0])
|
||||
text("parameters", 12, "Amiri:style=Bold");
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Loading…
Reference in New Issue