Hi,
I see that LaserShowGen uses Laserboy's font files in ild format.
Can we find any other fonts to use ?
Or is there a tool to convert normal fonts to ilda fonts ?
thanks
Printable View
Hi,
I see that LaserShowGen uses Laserboy's font files in ild format.
Can we find any other fonts to use ?
Or is there a tool to convert normal fonts to ilda fonts ?
thanks
Actually there is a tool to convert them in the experimental version of LaserBoy!
https://laserboy.org/code/LaserBoy_2022_11_23.zip
You need Inkscape.
You basically drop a text cursor into an Inkscape drawing and paste the literal string of characters you want to render from Trutype or whatever font Inkscape can draw from.
You need to space them apart from each other quite a bit.
The larger you render the font, the more detailed it is (more points).
You can also max out the padding between the characters in the Inkscape settings.
LB can read in any set of characters from a text file and generate a utf8 file that is a list of all of the unique characters in Unicode order.
A utf8 file is a few things. The very first line is the list of unique characters.
LaserBoy can properly name all the frames in the font_set with the corresponding Unicode hex values.
These names come from reading the utf8 file.
There is also a line of characters below that that are spaced out for copy paste into Inkscape.
Below that is a table of each character, frame_index, the character itself and its Unicode value in hex.
You copy the line of characters with spaces between them and paste that into Inkscape, then (in Inkscape) convert that into a tool path and save it as dxf.
If you save the dxf file with the same name as the utf8 file, then open that dxf file in the new version of LB as a dxf font_set, LB will find all of the individual characters in the dxf and make each one a frame. It will also pull the string of characters from the same named utf8 file and name each of those frames with the Unicode hex values.
It is possible to render any of the Unicode characters this way.
None of this new stuff has been documented, so please ask questions.
There are new utilities in the LaserBoy_ASCII_Text format that help you manage UTF8 / Unicode vector fonts.
LaserShowGen uses the original version of LaserBoy font files.
So you would only want to render the standard ascii character set.
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
Please feel free to contact me directly.
The experimental version of LB comes with new.txt and compose.txt as an example of some of the new font features.
James.
.
Thanks for trying to help me. You have written a long description.
But it is a little bit complicated for me.
What I understand is that combinin Inkscape and LaserBoy we can create fonts to be used in LaserBoy & LaserShowGen.
But it is really a complicated process.
Should I first install Inkscape ? I had once installed it to convert a PNG file to SVG but was not a user friendly interface, so I ended up creating my own app for this :)
https://play.google.com/store/apps/d...utils.giftosvg
If I install inkscape again, I am really worried that I won't be able to find how to do what you wrote :)
And even after doing that, I still need to use LaserBoy to create the font file in ild format. That is another challenge for me.
I understand that I need a utf8 file and a dxf file from Inkscape as an input to LaserBoy
But then how to open that file in LaserBoy ? I only see a text interface and it is so colorful that I can't even read with my old eyes :(
Isn't there any tool to convert the font easily ?
There is a ttf to svg converter here:
https://convertio.co/tr/ttf-svg/
Is it possible to convert from svg to ild ?
You can set the LB text menu color to monochrome.
You make a text file with all the characters you want in your font. When you open that in LB, it generates a utf8 file (also text). You copy a string of characters from that and paste it into Inkscape. Save that Inkscape drawing as dxf and open it in LB to make a whole font frame set. It might sound complicated, but it's just a process. It's a lot easier than drawing each frame. Like I said, if you contact me, I can guide you through it. Or better yet, what font do you want? I'll make it for you.
If you are only going to use the font in LaserShowGen, then you don't really need the text file or the utf8 file. But you do need the complete string of standard ascii characters to paste into Inkscape.
BTW, if you want to render font that includes non English variations of the Latin Alphabet like this:
TTF'den SVG'ye dönüştürücü
ttf dosyalarınızı svg'ye çevrimiçi & ücretsiz olarak dönüştürün
that's exactly what the new features of LaserBoy are all about!
Any character that is not included in the standard ascii character set is available in Unicode, including Greek, Cyrillic and many others.
If you have a font that contains these characters, you can make them into a LaserBoy font frame set and use them in the new version of LaserBoy.
Attachment 59788
.
How ?
Thanks. That's very nice of you. But actually I don't have a font in mind at the moment. I would like to be able to do it myself when I need.Quote:
You make a text file with all the characters you want in your font. When you open that in LB, it generates a utf8 file (also text). You copy a string of characters from that and paste it into Inkscape. Save that Inkscape drawing as dxf and open it in LB to make a whole font frame set. It might sound complicated, but it's just a process. It's a lot easier than drawing each frame. Like I said, if you contact me, I can guide you through it. Or better yet, what font do you want? I'll make it for you.
Yes, I am going to use the font in LaserSHowGen. So what is the easiest path ?Quote:
If you are only going to use the font in LaserShowGen, then you don't really need the text file or the utf8 file. But you do need the complete string of standard ascii characters to paste into Inkscape.
I open Inkscape, then ?
Can you write step by step to me ?
I only need the main characters :
and some special characters in Turkish (ISO 8859-9)Quote:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
Quote:
!"#$%&'()*+,-./0123456789:;<=>?@ABCÇDEFGĞHIİJKLMNOÖPQRSŞTUÜVWXYZ[\]^_`abcçdefgğhiıjklmnoöpqrsştuüvwxyz{|}~
In what order should I write the characters to Inkscape document ?
I'm going to have to make a how to video about this.
If you hit [Tab] in LB, you get a menu of settings menus. Menu 1 is for visible attributes of the app on screen. You can switch to monochrome text menus there. In menu 3 you can set the rgb values for the monochrome text color.
If you look at new.txt in the txt folder, you can see some examples. The utf8 chars function tells LB to read all the text in that block and do a character inventory. It creates a utf8 file (in the utf8 folder) that you can open in a text editor. LB puts all of the unique characters it found in Unicode order.
As far as I know, LaserShowGen can only use an ild font file of the 94 characters found in standard ascii. They must be in the right order because the frame index is what identifies the character.
You can use LB to make several different variations of text layouts (some animated) with any of the Unicode characters you have in a font. Since the new version of LB uses the frame name to identify the character, it doesn't matter which characters you use or what order they are in.
.
yes, a video would be nice.
Because I still couldn't get how to do it.
Your last message is even more confusing to me.
Maybe because I am not familiar with the app.
I just had a look at the new.txt file and I'm really confused.
Shall I have to write a file like this one ?
And then how do I run it ?
(don't try to answer these questions because I really don't understand. just trying to emphasize at what level I am )
I understand. There's a lot to it. But, all of the files in the txt folder are examples for LB to open and render into a frame_set. From main, you hit i to import a file, 4 for txt. Then type a name you see in the file list. There are many different things LB can read from a text file. Some of them are for rendering vector font and some are for animated math figures. You can look at any of them in a text editor.
I need to make how to videos. Whenever I start on that, I find all kinds of stuff to fix in the newest LB code. So I have to fix everything so I can get through a demo with all the code up to date. That means I will be releasing this updated version as soon as I get some decent video.
It might be a minute.
The idea is this:
You make a text file with instructions to find a character set within a block of text.
In this case the block of text is the 94 characters from standard ascii. It could be anything. You can copy text off a web page in Russian or Greek or many other left to right sequential character languages.Code:#----------------------------------------------------
utf8 chars standard_ascii
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
<<__TEXT_END__>>
The tag:
<<__TEXT_END__>>
must be after the block of text or else LB will read to the end of the text file.
When you open this in LB, it throws an error, because this instruction doesn't create anything in the LB vector frame set.
What it does is make a new file in the LaserBoy/utf8/ folder called standard_ascii.utf8
If you open this in a text editor you see this:
This is a kind of report on the character set you put in the utf8 chars instruction.Code:!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
........................
! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~
........................
........................
frame glyph Unicode
0 ! 0x00000021
1 " 0x00000022
2 # 0x00000023
3 $ 0x00000024
4 % 0x00000025
5 & 0x00000026
6 ' 0x00000027
7 ( 0x00000028
8 ) 0x00000029
9 * 0x0000002a
10 + 0x0000002b
11 , 0x0000002c
12 - 0x0000002d
13 . 0x0000002e
14 / 0x0000002f
15 0 0x00000030
16 1 0x00000031
17 2 0x00000032
18 3 0x00000033
19 4 0x00000034
20 5 0x00000035
21 6 0x00000036
22 7 0x00000037
23 8 0x00000038
24 9 0x00000039
25 : 0x0000003a
26 ; 0x0000003b
27 < 0x0000003c
28 = 0x0000003d
29 > 0x0000003e
30 ? 0x0000003f
31 @ 0x00000040
32 A 0x00000041
33 B 0x00000042
34 C 0x00000043
35 D 0x00000044
36 E 0x00000045
37 F 0x00000046
38 G 0x00000047
39 H 0x00000048
40 I 0x00000049
41 J 0x0000004a
42 K 0x0000004b
43 L 0x0000004c
44 M 0x0000004d
45 N 0x0000004e
46 O 0x0000004f
47 P 0x00000050
48 Q 0x00000051
49 R 0x00000052
50 S 0x00000053
51 T 0x00000054
52 U 0x00000055
53 V 0x00000056
54 W 0x00000057
55 X 0x00000058
56 Y 0x00000059
57 Z 0x0000005a
58 [ 0x0000005b
59 \ 0x0000005c
60 ] 0x0000005d
61 ^ 0x0000005e
62 _ 0x0000005f
63 ` 0x00000060
64 a 0x00000061
65 b 0x00000062
66 c 0x00000063
67 d 0x00000064
68 e 0x00000065
69 f 0x00000066
70 g 0x00000067
71 h 0x00000068
72 i 0x00000069
73 j 0x0000006a
74 k 0x0000006b
75 l 0x0000006c
76 m 0x0000006d
77 n 0x0000006e
78 o 0x0000006f
79 p 0x00000070
80 q 0x00000071
81 r 0x00000072
82 s 0x00000073
83 t 0x00000074
84 u 0x00000075
85 v 0x00000076
86 w 0x00000077
87 x 0x00000078
88 y 0x00000079
89 z 0x0000007a
90 { 0x0000007b
91 | 0x0000007c
92 } 0x0000007d
93 ~ 0x0000007e
........................
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
........................
The first line is the characters in Unicode order with no newline character until the very end.
The next line is similar, but there are 2 spaces between each character.
This line is there to be selected and copied, to be pasted into an Inkscape text element.
The next block of stuff is the index number of the character (frame_index), the character itself and its Unicode hex value.
After that is an exact copy of the text you submitted in the utf8 chars instruction, minus newline characters.
In Inkscape you choose the Text tool, pick a font face, set the font size (up to 144). Line gaps is irrelevant because we're only writing one single line. Spacing between letters is at 1000.00 in my setup.
Do a view, zoom, zoom to page, so you can see the page outlines.
Now when you drop the cursor into the page it will be quite large so drop it along the left edge of the page about 1/4 down from the top. And paste the line of text you copied from the utf8 file. This will make a line of text that goes WAY beyond the right hand side of the page.
If you click on Text in the menu bar and select Text and Font... you can see what you pasted in the Text tab of that dialog window. You can actually paste into this area or edit what is there.
But in order for LB to see it as vector art, it must be converted into a tool path.
In the menu bar, click Path, Object to Path.
You might notice that you can no longer edit the text in either the page itself or the Text and Font side window.
That's because it is no longer a text element. It is now a bunch of vectors.
So you can save it as dxf in the LaserBoy/dxf folder.
Name it the [name-of-the-font].dxf
Now you can open it in LB with i, 2, 5.
Just answer n to the question about moving the utf8 file. The newest version I am working on doesn't need to do that. Oops. This is all very new stuff and I'm still tweaking it.
You get a frame_set loaded into LB space.
Then you can i, 8, open the utf8 file, in this case, standard_ascii.utf8, and LB will read the very first line of it and rename all of the frames currently loaded into LB space with the hex Unicode values of each character.
You can optimize it or whatever and save it as ild in the LaserBoy/ild/fonts/ folder.
Your mileage may vary.
Good luck!
PS. Inkscape lets you undo, undo, undo, etc... So you can revers a Path, Object to Path and get back to be able to change the text or the font or other settings and try it again.
.
Thanks. It was a very detailed step-by-step guide. But I've failed :(
I believe I missed some steps.
First;
when you say "Spacing between letters is at 1000.00 in my setup." , I am not sure if this was an important setting but I could not find where to put 1000, so I skipped.
I set font size to 72 and pasted the line with 2 spaces between each character.
Then I converted it to a path and saved as dxf.
Second question;
While saving, there are 2 types of dxf.(dxf r12 , dxf r14) which one should I use ?
third;
when I do this step:
"Then you can i, 8, open the utf8 file, in this case, standard_ascii.utf8, and LB will read the very first line of it and rename all of the frames currently loaded into LB space with the hex Unicode values of each character."
it says "utf8 greater than frames! add missing frames ?"
so is that normal ?
and last;
with what command shall I save the new font ild file ?
DXF r12!
I'm in the process of putting together a new zip of the whole thing.
If you mouse hover over the Inkscape text settings elements just below the menu bar, one of them is
Spacing between letters (px)
You should be able to drop your text cursor into that number field and type in 1000.00.
It will have an example utf8 and dxf font file.
I think the new version will do a much better job of finding all of the individual characters in the dxf file.
The problem is if they are too close to each other LB chops them up into parts of one character and parts of the next.
The new version only needs one space between each character!
Hang on...
Try this one!
https://laserboy.org/code/LaserBoy_2022_12_27.zip
This has one has:
./txt/ubuntu.txt
./utf8/ubuntu.utf8
./dxf/ubuntu.dxf
.
With this new version, you can open ubuntu.dxf as a font frame_set and, since ubuntu.utf8 exists, it will ask if you want to name the frames according to the character string in it. Then you can save it as ubuntu.ild in the LaserBoy/ild/fonts folder. And you have a new font. You can also look at ubuntu.dxf as just a dxf file and see that it is a very long string of vector characters.
If you use LB to render your font frames and animations, you can make a font of only the characters you need. You can put whatever text you want in any Unicode character set in a txt file, and LB will make a utf8 file of only the characters used. Then you can paste that string into Inkscape or draw each character or whatever and use the utf8 file to name the frames with their Unicode values. Then use that font in the LB font rendering instructions in a txt file.
.
Thanks for the new version.
But I have the same problem when I work with a new font:
1. While saving, there are 2 types of dxf.(dxf r12 , dxf r14) which one should I use ?
2. when I do this step:
"Then you can i, 8, open the utf8 file, in this case, standard_ascii.utf8, and LB will read the very first line of it and rename all of the frames currently loaded into LB space with the hex Unicode values of each character."
it says "utf8 greater than frames! add missing frames ?"
3. I save the font file with option o-1 and then change directory to fonts and save font. But when I open it with LaserShowGen it fails to load. (probably because of items 1 & 2 above)
btw, on Inkscape text tool , I see "spacing between baselines". Is this the same as "Spacing between letters" ?
dxf r12.
If you have a file in the utf8 directory that is the same name as the dxf file you open to make a new font frame_set, LB will see that and ask you if you want to use it to rename all the frames to their Unicode hex values. If you answer y then it will attempt to do that. If there is a mismatch between the number of characters in the utf8 file and the number of frames in the font frame_set then it will tell you that. This probably indicates that there are either missing frames or too many frames. You can left and right arrow through the frames to look at each character and make sure they are all there and intact (as compared to the utf8 report of the same name). The LB dxf file to font frame_set function relies on a clipping window that moves from the beginning of the dxf image (far left) to the end of the image counting the number of vertices it sees inside that window. When the number peaks and then drops, it takes the previous (peak) window as the whole character. So the characters in the dxf vector space must be some distance apart from each other. Since they were rendered all on one line, they all have a relative vertical position in space. That is preserved in the font frame_set. The horizontal position of each character in a frame is just the character (horizontally) centered in the all positive quadrant of space. The actual size of the clipping window is the total height of the whole dxf image (the greatest Y coordinate value minus the lowest Y coordinate value). The height of the entire font frame_set (the square) by 3 times that measure in width (3 squares). Each new window position is a move of 2 times the height (2 squares). So as the window moves across the line of vector characters, there must be at least a whole empty window between each character. Since dxf is in real numbers and LB can manage real number 3D space, it doesn't matter what the actual coordinate values are. Any vector image has a height and width. It's all relative.
Code://############################################################################
LaserBoy_Error_Code LaserBoy_frame_set::from_dxf_font(const string& file, bool append)
{
std::ifstream in(file.c_str(), ios::in);
//------------------------------------------------------------------------
if(in.is_open())
{
u_int i,
last_i;
double the_move = 0.0,
height = 0.0,
span = 3.0, // squares
move_per_frame = 2.0; // squares
LaserBoy_3D_double center,
max,
min;
LaserBoy_real_segment rs1,
rs2,
rs3;
LaserBoy_real_segment_set rss;
LaserBoy_frame_set frames;
LaserBoy_Error_Code error_code = rs1.from_ifstream_dxf(in);
if(error_code)
return error_code;
in.close();
rs1.reduce_blank_vectors();
rs1.reduce_lit_vectors();
rs1.strip_color();
height = rs1.height();
min.x = -(span * height) / 2.0;
max.x = (span * height) / 2.0;
min.y = -height / 2.0;
max.y = height / 2.0;
min.z = -32767.0;
max.z = 32767.0;
center = rs1.rectangular_center_of();
center.x = rs1.segment_left().x;
last_i = (u_int)( ( ( rs1.width()
/ height
)
+ (2.0 * span)
) // in squares
/ move_per_frame
);
the_move = height * move_per_frame;
p_space->p_GUI->display_state("finding glyphs in dxf.");
for(i = 0; i <= last_i; i++)
{
p_space->p_GUI->display_progress(last_i - i);
rs2 = rs1;
rs2.clip_around_coordinate(center, max, min, height * 2.0);
if(rs2.number_of_lit_vectors() > rs3.number_of_lit_vectors())
rs3 = rs2;
else if(rs2.number_of_lit_vectors() < rs3.number_of_lit_vectors())
{
rss.push_back(rs3);
rs3.clear();
}
center.x += the_move;
}
rss.center_x(true);
rss.normalize(false);
frames = rss;
frames.normalize(0.495);
frames.move(LaserBoy_3D_double(16384, 16384, 0));
frames.conglomerate_lit_segments();
frames.minimize();
frames.convert_blank_to_black();
if(append)
*this += frames;
else
*this = frames;
} // end if(in.is_open())
else
{
if(!append)
{
from_nothing();
frame_index = 0;
}
frame_set_error |= LASERBOY_FILE_OPEN_FAILED;
}
//------------------------------------------------------------------------
return frame_set_error;
}
Most likely LSG is looking for a frame_set of at least or exactly 94 frames. I don't know.
No. There is an editable number field.
Attachment 59807
Try opening ubuntu.dxf as a dxf font frame_set.
.
OK. The problem seems to be the "spacing between letters"
I found it and set to 1000 , then when I type the letters from utf file, Inkscape crashes.
Then I tried with 500 px, still crashes.
Then I tried with 200 px, this time it did not crash.
But the result was failure (font not working on LaserShowGen)
SO what should be the value there for "spacing between letters" ?
I'll have to try it in Windows 10. I normally use Ubuntu for everything.
ok. 1000px or 500px fails in my setup.
I tried with the font StarJedi (available on Dafont)
Yes. Inkscape is different from the version I run in Ubuntu.
I've really tweaked out the current code.
It works quite well if you know what your dxf file should look like.
I'm going to release the first 2023 version soon and make a how to video.
thank you. Can you inform through this thread please ?
Yes. Sure. I just like to post new releases in The LaserBoy Thread.
I looked into starting a new video about rendering Unicode characters in addition to the standard ascii and you are correct. Windows 10 Inkscape crashes!
There is a way to do it. It just takes multiple dxf files and it requires a bit of fiddling to make all the characters in the same size space.
I will be getting it together soon.
Did you get anything out of the videos I made?
which videos ?
where did you post them ?
Look in the signature line of every one of my posts for tutorial videos. I just added 0021 and 0022. I started making them in 2020, so the early ones are a bit dated, but if you know that, there is still a lot of good information there.
thank you. I am checking the videos.
Also looking forward to your 2023 version which hopefully will solve my font creating issues...
I just released that.
https://laserboy.org/code/LaserBoy_2023_01_04.zip
Let me know what issues you are having and I will try to address them directly.
Thanks for checking this stuff out.
That helps make it better (a lot).
James.