 Hello and welcome today. Well, we're gonna be looking at this This is a little wooden plane that a friend of mine made with his little CNC laser cutter engraver He is a pilot and he made this as a little gift to meet for me to ask me to be one of his groomsmen Which is pretty awesome. It has my name and initials on it and stuff He's gonna do something similar. I don't think this elaborate, but he's gonna make little wooden cardboard cutouts for his wedding and It's gonna be for people's names. So when you go to a wedding at the Reception at the tables usually you'll have little name tags, so you know where to go. Well, he plans on Laser engraving little planes with everybody's names on them. He said the hardest part is getting everybody's name into an SVG file He can manually do it, but he has a long list of names So our end goal here is to take a long list of names and I have a list of I think 50 names I generated and we're going to take that text Create an SVG using a font file And that's what we're gonna do and it doesn't take very long once you learn how to do it I did find a program So I look at many different ways of doing this and I've done it manually a number of times going into gimp typing something Or even drawing something selecting an area and then saying convert to line and then exporting that line as SVG and then you can import it into inkscape or Blender and make a 3d model out of it So that's just what we need to do, but the program I found will convert an image a bitmap image into an SVG file It does a great job. It's in the repositories. You'll see it here in a moment All the notes for this or an example script of this will be on pay spin There should be a link in the description of this video. Let's go ahead and jump into the shell So the first thing we need to do is generate a bitmap image with our text Now if we look what's in the directory. I'm in I have two files I have a font file because if we don't have a font file She's got to use a very basic font and we want something a little bit fancier And we have a nameless file which if I cat out is just a list of names Now this is a randomly generated list of names fake names And you'll see some of them have accent marks different accent marks and it's important that your font Supports those accent marks. Otherwise those characters are going to disappear. So keep that in mind if you're going to be doing this so First thing we need to do as I said I have a program that will convert bitmap images into SVG files, but we have to generate a bitmap image I'm going to use image magic image magic is a great program for converting and generating image think of it as Gimp or Photoshop for your shell. It is awesome. It's probably installing system. If not, it's definitely going to be in your repositories And we're going to use the convert command which is part of the image magic package now I'm going to be looking at my notes here So what we're going to do is we're going to use the convert command. Also, let me also say if you just Google Text to image with image magic. This is the page comes up. It's a very detailed With a lot of examples and there's lots of different ways and weight and things you can do Creating fonts and I just selected one of these To generate the text there may be better options out there But again, you can look at my example or you can use one of those other examples there But I'm going to use the convert command. So I'm going to say convert dash dash size We're just create an image of 600 by 100 if you're gonna have a really long text You're gonna want to make that 600 a little bit bigger Xc equals white is just going to make the background white next I'm going to give it a font name so dash font and whatever your font name is I just named mine font tff or ttf True type font and so we'll use that font then we're going to give it a point size for the size for the font so Point size and I'm just going to do 72 y 72 That's the number they use in the example from that web page. We're just looking at that I'm going to do dash fill right here and I'm going to say black so that's just going to say the backgrounds white the fill color is the color The text is going to be okay next and again there if you look at that example page There are a lot of different examples of ways to put text into an image And this is just one I chose here which is Dash draw we're going to say text 25 65 again, that's just what the example showed I didn't image magic is a great great program It can get a little complex. I'm just going with the basic examples here. Now. We're going to give it our text I'm just going to say hello world, okay And then I give it an output name. So I'll just say test dot BMP and if I typed everything right I now have A bmp a bitmap image I'll bring over my file browser here and you can see it right there with a little thumbnail Perfect. Okay. So now how do we convert that to an svg file? well We're going to use the command Potrace I guess is how you say it potrace potrace Again, it's in the package manager at least for debian And we're going to do dash s and then give it the input file Which in this case is test dot bmp and then dash lowercase o and our output name. I'll just say test dot svg And when I hit enter if I look back at my file browser here, you can see we now have an svg here Uh, and if I listen here, you can see it there and I can open it with inkscape test dot svg Give inkscape a second to open and there's there it is as an svg right We can also if we wanted to Close that I can open up blender And in here I'll delete the default cube f3 import svg And I'm going to do it as a vector graphic And I am going to choose our directory here and choose our file And Because of the options I used it's there. It's just really really small And it's also three separate in this particular case the letters that aren't connected or each separate object So let's go ahead and select all three of those control j to join them. And then I will just scale it up maybe 50 that looks good and I'll just Tab into edit mode select all And I'm going to put it right there and of course we can go into our Geometry here and extrude that boom now. We got 3d text here Scale that down on the z axis. Anyway, just showing you it is a svg vector graphic now that can be used In blender inkscape or if you're you know using a laser cutter now. We've done that Let's go ahead and use our name list here and just loop through all that so Make this full screen. I am going to now use our Convert command from last time and what I'm really going to do is I'm going to bring this uh Line into Vim here just to make things easier to type. I'm going to say cat our name list. I'm going to say while read name do And then I am going to say A dollar sign name for our output. So the file put file will be the person's name dot a bmp And the text will be name as well After that, we're going to use the pot race command Dash s and we are going to give it our bmp and then we're going to say dash o and we're going to give the output of svg After it does that I am going to whoops Say remove and we'll re remove our bmp file And then we're done with our loop So let me go ahead and exit back out to our shell here And oh did I just run it? I did not mean to run it I did run it look at that and run super fast So we just did 50 names and it literally took Probably less than two seconds to generate all these svgs are And it didn't remove our bmp's it should or didn't remove the the test bmp. That's fine So yeah, we can look at all these and They all look fine except for again if one of them has a special character name. So let's again, let's cat out our name dot list And look at some of these that have special characters. So like this maria one Let's go ahead come over here and I'll type in mar And there you go. You can see this one worked fine. It has the little accent mark over there over the eye Let's look at this one We'll type in si e And you can see yep that one got the u with the two dots over it no problem But if I remember correctly when I ran the test before doing this video if I check this one out You'll see this one the c with the accent mark the c looks like it got cut off So again, make sure that the font that you're using Allows for special characters or at least the special characters. You're going to use any accent marks and whatnot So again, check out the link in the description of this video there. You can find an example script Again, you'll have to select a font and replace that but it does It is going to use wget to download some random names, but you can use whatever file you want Um, that's it. I hope you found this useful for generating svg vector graphic text from a plain text list Uh, if you have any questions, let me know and please visit films by chris.com. That's chris of the k There's a link in the description to that as well. You can support me there Uh, there's a support section where there's a link to liba librae pay and paypal And of course patreon, which is a link to in the description of the video as well I appreciate you watching. I just appreciate your support like shares comments and subscribing As always, I hope that you have a great day