Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: Font files for LaserShowGen

  1. #11
    Join Date
    Dec 2022
    Posts
    18

    Default

    Quote Originally Posted by james View Post
    I need to make how to videos.
    .
    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 ?


  2. #12
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default

    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


    .
    Last edited by james; 12-27-2022 at 14:59.
    Creator of LaserBoy!
    LaserBoy is free and runs in Windows, MacOS and Linux (including Raspberry Pi!).
    Download LaserBoy!
    YouTube Tutorials
    Ask me about my LaserBoy Correction Amp Kit for sale!
    All software has a learning curve usually proportional to its capabilities and unique features. Pointing with a mouse is in no way easier than tapping a key.

  3. #13
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default

    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.


    .
    Last edited by james; 12-28-2022 at 08:03.
    Creator of LaserBoy!
    LaserBoy is free and runs in Windows, MacOS and Linux (including Raspberry Pi!).
    Download LaserBoy!
    YouTube Tutorials
    Ask me about my LaserBoy Correction Amp Kit for sale!
    All software has a learning curve usually proportional to its capabilities and unique features. Pointing with a mouse is in no way easier than tapping a key.

  4. #14
    Join Date
    Dec 2022
    Posts
    18

    Default

    Quote Originally Posted by james View Post
    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" ?
    Last edited by ilkeraktuna; 12-28-2022 at 12:00.

  5. #15
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default

    Quote Originally Posted by ilkeraktuna View Post
    1. While saving, there are 2 types of dxf.(dxf r12 , dxf r14) which one should I use ?
    dxf r12.



    Quote Originally Posted by ilkeraktuna View Post

    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 ?"
    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;
    }

    Quote Originally Posted by ilkeraktuna View Post
    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)
    Most likely LSG is looking for a frame_set of at least or exactly 94 frames. I don't know.



    Quote Originally Posted by ilkeraktuna View Post

    btw, on Inkscape text tool , I see "spacing between baselines". Is this the same as "
    Spacing between letters" ?
    No. There is an editable number field.

    Click image for larger version. 

Name:	inkscape.png 
Views:	3 
Size:	117.8 KB 
ID:	59807

    Try opening ubuntu.dxf as a dxf font frame_set.

    .
    Last edited by james; 12-28-2022 at 22:07.
    Creator of LaserBoy!
    LaserBoy is free and runs in Windows, MacOS and Linux (including Raspberry Pi!).
    Download LaserBoy!
    YouTube Tutorials
    Ask me about my LaserBoy Correction Amp Kit for sale!
    All software has a learning curve usually proportional to its capabilities and unique features. Pointing with a mouse is in no way easier than tapping a key.

  6. #16
    Join Date
    Dec 2022
    Posts
    18

    Default

    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" ?

  7. #17
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default

    I'll have to try it in Windows 10. I normally use Ubuntu for everything.
    Creator of LaserBoy!
    LaserBoy is free and runs in Windows, MacOS and Linux (including Raspberry Pi!).
    Download LaserBoy!
    YouTube Tutorials
    Ask me about my LaserBoy Correction Amp Kit for sale!
    All software has a learning curve usually proportional to its capabilities and unique features. Pointing with a mouse is in no way easier than tapping a key.

  8. #18
    Join Date
    Dec 2022
    Posts
    18

    Default

    ok. 1000px or 500px fails in my setup.
    I tried with the font StarJedi (available on Dafont)

  9. #19
    Join Date
    Dec 2022
    Posts
    18

    Default

    Quote Originally Posted by james View Post
    I'll have to try it in Windows 10. I normally use Ubuntu for everything.

    did you have a chance to test it ?

  10. #20
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default

    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.
    Creator of LaserBoy!
    LaserBoy is free and runs in Windows, MacOS and Linux (including Raspberry Pi!).
    Download LaserBoy!
    YouTube Tutorials
    Ask me about my LaserBoy Correction Amp Kit for sale!
    All software has a learning curve usually proportional to its capabilities and unique features. Pointing with a mouse is in no way easier than tapping a key.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •