AM
Adrian Mariano
Sun, Aug 18, 2024 9:52 PM
It looks like I sent this only to Jordan instead of the whole list. This
shows how to place the text without a lot of effort
Yeah, if you want kerning you're on your own. But (1) most people aren't
that attuned to text spacing so they probably won't notice the lack of
kerning and (2) kerning may need to be different for text on a curved path
anyway. Just getting the right basic spacing for a proportionally spaced
font is going to be enough for most people.
I rewrote OP's code. First of all, it offended me that things weren't
parallel. Two non-circular ellipses aren't parallel, so this meant the
border varied in thickness. And if the text is on an ellipse it isn't
parallel to the border. You need to use offset() operations to make them
parallel. Then I used path_text() to place the text. I also replaced the
hyphen with a unicode en-dash. The hyphen is too short and looks bad. I
think it looks fine without kerning, but if you disagree, you can use the
kern parameter to tweak the spacing from this, which is a lot easier than
getting straight to this layout with trial and error.
[image: image.png]
include <BOSL2/std.scad>
include <BOSL2/screws.scad>
$fa = 1;
$fs = 0.4;
size = [120, 78]; // size inside the border of the model
border=5;
text_inset=18;
font="Liberation Sans:style=Bold";
difference()
{
linear_extrude(height=2) offset(border)ellipse(size);
up(1) linear_extrude(height=2) ellipse(size);
up(1) xflip_copy()
right(100)screw_hole("M3", length=2, head="flat",anchor=TOP);
}
path_top = [for(theta=[180:-1:0]) [size.xcos(theta), size.ysin(theta)]];
inset_path_top=path3d(offset(path_top, delta=-text_inset));
path_text(inset_path_top, text="HMSLS 50th ANNIVERSARY",center=true,
size=9, normal=UP, thickness=2, offset=1,
font=font,textmetrics=true);
path_bot = [for(theta=[180:1:360]) [size.xcos(theta), size.ysin(theta)]];
inset_path_bot=path3d(offset(path_bot, delta=text_inset));
path_text(inset_path_bot, text="1974 – 2024",center=true, size=9,
normal=UP, thickness=2, offset=1,
font=font,textmetrics=true,valign="top");
On Sun, Aug 11, 2024 at 6:28 AM Jordan Brown openscad@jordan.maileater.net
wrote:
I didn't dig into your example, but is there a reason you can't do this
directly with the path_text() module? Assuming you use a dev version and
enable textmetrics, you will get proper text spacing (but no ligatures).
Probably also no kerning, which might be the source of the IV complaint.
For those not familiar with typography, ligatures are the substitution of
certain sequences with single glyphs - for instance, replacing f f i with a
single glyph that connects the three. Kerning is the related technique of
adjusting spacing to account for the different shapes of the glyphs (vs a
simple box model) - for instance, pulling AV together, possibly even
overlapping their boxes, to avoid putting the white space at the top right
of the A next to the white space at the bottom left of the V.
The easy way to lay out text does neither of these things.
Forming the text to a curve makes the picture more complicated - I didn’t
look at the OP’s example, but IV at the bottom of a curve will put the
bottoms of the two letters way far apart.
Quite possibly the only practical remedy is to manually adjust the spacing
until it looks right.
It looks like I sent this only to Jordan instead of the whole list. This
shows how to place the text without a lot of effort
Yeah, if you want kerning you're on your own. But (1) most people aren't
that attuned to text spacing so they probably won't notice the lack of
kerning and (2) kerning may need to be different for text on a curved path
anyway. Just getting the right basic spacing for a proportionally spaced
font is going to be enough for most people.
I rewrote OP's code. First of all, it offended me that things weren't
parallel. Two non-circular ellipses aren't parallel, so this meant the
border varied in thickness. And if the text is on an ellipse it isn't
parallel to the border. You need to use offset() operations to make them
parallel. Then I used path_text() to place the text. I also replaced the
hyphen with a unicode en-dash. The hyphen is too short and looks bad. I
think it looks fine without kerning, but if you disagree, you can use the
kern parameter to tweak the spacing from this, which is a lot easier than
getting straight to this layout with trial and error.
[image: image.png]
include <BOSL2/std.scad>
include <BOSL2/screws.scad>
$fa = 1;
$fs = 0.4;
size = [120, 78]; // size inside the border of the model
border=5;
text_inset=18;
font="Liberation Sans:style=Bold";
difference()
{
linear_extrude(height=2) offset(border)ellipse(size);
up(1) linear_extrude(height=2) ellipse(size);
up(1) xflip_copy()
right(100)screw_hole("M3", length=2, head="flat",anchor=TOP);
}
path_top = [for(theta=[180:-1:0]) [size.x*cos(theta), size.y*sin(theta)]];
inset_path_top=path3d(offset(path_top, delta=-text_inset));
path_text(inset_path_top, text="HMSLS 50th ANNIVERSARY",center=true,
size=9, normal=UP, thickness=2, offset=1,
font=font,textmetrics=true);
path_bot = [for(theta=[180:1:360]) [size.x*cos(theta), size.y*sin(theta)]];
inset_path_bot=path3d(offset(path_bot, delta=text_inset));
path_text(inset_path_bot, text="1974 – 2024",center=true, size=9,
normal=UP, thickness=2, offset=1,
font=font,textmetrics=true,valign="top");
On Sun, Aug 11, 2024 at 6:28 AM Jordan Brown <openscad@jordan.maileater.net>
wrote:
>
> > I didn't dig into your example, but is there a reason you can't do this
> directly with the path_text() module? Assuming you use a dev version and
> enable textmetrics, you will get proper text spacing (but no ligatures).
>
> Probably also no kerning, which might be the source of the IV complaint.
>
> For those not familiar with typography, ligatures are the substitution of
> certain sequences with single glyphs - for instance, replacing f f i with a
> single glyph that connects the three. Kerning is the related technique of
> adjusting spacing to account for the different shapes of the glyphs (vs a
> simple box model) - for instance, pulling AV together, possibly even
> overlapping their boxes, to avoid putting the white space at the top right
> of the A next to the white space at the bottom left of the V.
>
> The easy way to lay out text does neither of these things.
>
> Forming the text to a curve makes the picture more complicated - I didn’t
> look at the OP’s example, but IV at the bottom of a curve will put the
> bottoms of the two letters way far apart.
>
> Quite possibly the only practical remedy is to manually adjust the spacing
> until it looks right.
>
K
Ken
Thu, Aug 22, 2024 7:28 AM
Adrian, many thanks for the re-write of my code, I had never seen things
like up, xflip, normal, etc. used before. They certainly make it easier
to use and understand.
Also, the use of screw_hole- another part of BOSL2 I hadn't noticed. I
had actually written a module specifically to create m3 countersunk
screw holes (and m2 and m4 and m5- four separate modules....)- following
your example I can now dispense with all that!
And I like the more accurate oval text (though I don't really understand
it), I have now used that in my plaque, it looks much better than my
attempts.
Next step is to find a pla that is close to Brunswick Green for the body
of the plaque, then I can have a go at printing it multi-colour with my Xl.
On 2024-08-19 07:52, Adrian Mariano via Discuss wrote:
It looks like I sent this only to Jordan instead of the whole list.
This shows how to place the text without a lot of effort
Yeah, if you want kerning you're on your own. But (1) most people
aren't that attuned to text spacing so they probably won't notice the
lack of kerning and (2) kerning may need to be different for text on a
curved path anyway. Just getting the right basic spacing for a
proportionally spaced font is going to be enough for most people.
I rewrote OP's code. First of all, it offended me that things weren't
parallel. Two non-circular ellipses aren't parallel, so this meant
the border varied in thickness. And if the text is on an ellipse it
isn't parallel to the border. You need to use offset() operations to
make them parallel. Then I used path_text() to place the text. I also
replaced the hyphen with a unicode en-dash. The hyphen is too short
and looks bad. I think it looks fine without kerning, but if you
disagree, you can use the kern parameter to tweak the spacing from
this, which is a lot easier than getting straight to this layout with
trial and error.
image.png
include <BOSL2/std.scad>
include <BOSL2/screws.scad>
$fa = 1;
$fs = 0.4;
size = [120, 78]; // size inside the border of the model
border=5;
text_inset=18;
font="Liberation Sans:style=Bold";
difference()
{
linear_extrude(height=2) offset(border)ellipse(size);
up(1) linear_extrude(height=2) ellipse(size);
up(1) xflip_copy()
right(100)screw_hole("M3", length=2, head="flat",anchor=TOP);
}
path_top = [for(theta=[180:-1:0]) [size.xcos(theta), size.ysin(theta)]];
inset_path_top=path3d(offset(path_top, delta=-text_inset));
path_text(inset_path_top, text="HMSLS 50th ANNIVERSARY",center=true,
size=9, normal=UP, thickness=2, offset=1,
font=font,textmetrics=true);
path_bot = [for(theta=[180:1:360]) [size.xcos(theta),
size.ysin(theta)]];
inset_path_bot=path3d(offset(path_bot, delta=text_inset));
path_text(inset_path_bot, text="1974 – 2024",center=true, size=9,
normal=UP, thickness=2, offset=1,
font=font,textmetrics=true,valign="top");
On Sun, Aug 11, 2024 at 6:28 AM Jordan Brown
openscad@jordan.maileater.net wrote:
I didn't dig into your example, but is there a reason you can't
do this directly with the path_text() module? Assuming you use a
dev version and enable textmetrics, you will get proper text
spacing (but no ligatures).
Probably also no kerning, which might be the source of the IV
complaint.
For those not familiar with typography, ligatures are the
substitution of certain sequences with single glyphs - for
instance, replacing f f i with a single glyph that connects the
three. Kerning is the related technique of adjusting spacing to
account for the different shapes of the glyphs (vs a simple box
model) - for instance, pulling AV together, possibly even
overlapping their boxes, to avoid putting the white space at the
top right of the A next to the white space at the bottom left of
the V.
The easy way to lay out text does neither of these things.
Forming the text to a curve makes the picture more complicated - I
didn’t look at the OP’s example, but IV at the bottom of a curve
will put the bottoms of the two letters way far apart.
Quite possibly the only practical remedy is to manually adjust the
spacing until it looks right.
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
Adrian, many thanks for the re-write of my code, I had never seen things
like up, xflip, normal, etc. used before. They certainly make it easier
to use and understand.
Also, the use of screw_hole- another part of BOSL2 I hadn't noticed. I
had actually written a module specifically to create m3 countersunk
screw holes (and m2 and m4 and m5- four separate modules....)- following
your example I can now dispense with all that!
And I like the more accurate oval text (though I don't really understand
it), I have now used that in my plaque, it looks much better than my
attempts.
Next step is to find a pla that is close to Brunswick Green for the body
of the plaque, then I can have a go at printing it multi-colour with my Xl.
On 2024-08-19 07:52, Adrian Mariano via Discuss wrote:
> It looks like I sent this only to Jordan instead of the whole list.
> This shows how to place the text without a lot of effort
>
> Yeah, if you want kerning you're on your own. But (1) most people
> aren't that attuned to text spacing so they probably won't notice the
> lack of kerning and (2) kerning may need to be different for text on a
> curved path anyway. Just getting the right basic spacing for a
> proportionally spaced font is going to be enough for most people.
>
> I rewrote OP's code. First of all, it offended me that things weren't
> parallel. Two non-circular ellipses aren't parallel, so this meant
> the border varied in thickness. And if the text is on an ellipse it
> isn't parallel to the border. You need to use offset() operations to
> make them parallel. Then I used path_text() to place the text. I also
> replaced the hyphen with a unicode en-dash. The hyphen is too short
> and looks bad. I think it looks fine without kerning, but if you
> disagree, you can use the kern parameter to tweak the spacing from
> this, which is a lot easier than getting straight to this layout with
> trial and error.
>
> image.png
>
>
>
> include <BOSL2/std.scad>
> include <BOSL2/screws.scad>
> $fa = 1;
> $fs = 0.4;
>
> size = [120, 78]; // size inside the border of the model
> border=5;
> text_inset=18;
> font="Liberation Sans:style=Bold";
>
> difference()
> {
> linear_extrude(height=2) offset(border)ellipse(size);
> up(1) linear_extrude(height=2) ellipse(size);
> up(1) xflip_copy()
> right(100)screw_hole("M3", length=2, head="flat",anchor=TOP);
> }
> path_top = [for(theta=[180:-1:0]) [size.x*cos(theta), size.y*sin(theta)]];
> inset_path_top=path3d(offset(path_top, delta=-text_inset));
> path_text(inset_path_top, text="HMSLS 50th ANNIVERSARY",center=true,
> size=9, normal=UP, thickness=2, offset=1,
> font=font,textmetrics=true);
> path_bot = [for(theta=[180:1:360]) [size.x*cos(theta),
> size.y*sin(theta)]];
> inset_path_bot=path3d(offset(path_bot, delta=text_inset));
> path_text(inset_path_bot, text="1974 – 2024",center=true, size=9,
> normal=UP, thickness=2, offset=1,
> font=font,textmetrics=true,valign="top");
>
> On Sun, Aug 11, 2024 at 6:28 AM Jordan Brown
> <openscad@jordan.maileater.net> wrote:
>
>
> > I didn't dig into your example, but is there a reason you can't
> do this directly with the path_text() module? Assuming you use a
> dev version and enable textmetrics, you will get proper text
> spacing (but no ligatures).
>
> Probably also no kerning, which might be the source of the IV
> complaint.
>
> For those not familiar with typography, ligatures are the
> substitution of certain sequences with single glyphs - for
> instance, replacing f f i with a single glyph that connects the
> three. Kerning is the related technique of adjusting spacing to
> account for the different shapes of the glyphs (vs a simple box
> model) - for instance, pulling AV together, possibly even
> overlapping their boxes, to avoid putting the white space at the
> top right of the A next to the white space at the bottom left of
> the V.
>
> The easy way to lay out text does neither of these things.
>
> Forming the text to a curve makes the picture more complicated - I
> didn’t look at the OP’s example, but IV at the bottom of a curve
> will put the bottoms of the two letters way far apart.
>
> Quite possibly the only practical remedy is to manually adjust the
> spacing until it looks right.
>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email todiscuss-leave@lists.openscad.org
--
Cheers, Ken
bats059@gmail.com
https://vk7krj.com
https://vk7krj.com/running.html
----------------------------------------
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!