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

Originally Posted by
ilkeraktuna
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;
}

Originally Posted by
ilkeraktuna
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.

Originally Posted by
ilkeraktuna
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.

Try opening ubuntu.dxf as a dxf font frame_set.
.