diff --git a/AuerNameTag.scad b/AuerNameTag.scad index 9541cda..19d3c90 100644 --- a/AuerNameTag.scad +++ b/AuerNameTag.scad @@ -1,10 +1,14 @@ -name="mAdEx"; +name="madex"; +symbolPre=""; +symbolPost=""; part=3; //[1:base,2:text,3:preview] use <./font/LiberationSans-Bold.ttf>; +use <./font/Symbola_hint.ttf>; label_thickness= 1.5; font = "Liberation Sans:style=Bold"; +symbolFont="Symbola:style=Regular"; font_size = 12; font_offset = 9; $fn = 128; @@ -30,8 +34,21 @@ module tag() { translate([30, 15, 0]) cube([20, 3, 4 + label_thickness/2]); } module name(str) { - translate([-9, font_offset + font_size/2, -label_thickness/2 + 0.29]) rotate(v=[1,0,0],a=180) linear_extrude(0.3) translate([15, 0]) - text(str, size=font_size, font = font); + translate([-9+15, font_offset + font_size/2, -label_thickness/2 + 0.29]) rotate(v=[1,0,0],a=180) linear_extrude(0.3) { + text(symbolPre,font_size,symbolFont); + symbolPreSize=textmetrics(symbolPre,font_size,font); + echo (symbolPreSize); + + translate([symbolPreSize.size[0]+symbolPreSize.advance[0],0,0]){ + text(str, size=font_size, font = font); + + echo(textSize); + + translate([textSize.advance[0],0,0]) text(symbolPost,font_size,symbolFont); + } + textSize=textmetrics(str, size=font_size, font = font); + + } } diff --git a/font/Symbola_hint.ttf b/font/Symbola_hint.ttf new file mode 100644 index 0000000..59e428f Binary files /dev/null and b/font/Symbola_hint.ttf differ