GithubHelp home page GithubHelp logo

andy1978 / hf2gcode Goto Github PK

View Code? Open in Web Editor NEW
48.0 5.0 13.0 437 KB

Generates g-code from text with a hershey font

License: GNU General Public License v3.0

Makefile 0.65% Shell 0.23% C 94.89% MATLAB 4.23%
hershey-fonts g-code

hf2gcode's Issues

Error when building project

Hey Andy,

I'm having an error when building this program. I've installed the make command using Chocolatey, and when I run that command on the src folder, this is the output:

C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -C ../hershey_fonts src
make[1]: Entering directory 'C:/Users/techmaster/Downloads/hf2gcode-master/hershey_fonts'
./fix_linebreak.sh orig/astrology.jhf fixed/astrology.jhf
process_begin: CreateProcess(NULL, bash C:\Users\techmaster\Downloads\hf2gcode-master\hershey_fonts\fix_linebreak.sh orig/astrology.jhf fixed/astrology.jhf, ...) failed.
make (e=2): The system cannot find the file specified.
make[1]: *** [Makefile:21: fixed/astrology.jhf] Error 2
make[1]: Leaving directory 'C:/Users/techmaster/Downloads/hf2gcode-master/hershey_fonts'
make: *** [Makefile:12: hf2gcode] Error 2
PS C:\Users\techmaster\Downloads\hf2gcode-master\src>

As you can see. it cannot find fixed/astrology.jhf. Running the make command leaves two empty folders, however. These folders are -p and fixed.

multi-line text: x offset should apply to each line

If I try to generate g-code from an input file with line breaks, the x offset only indents the first line, but not the following lines.

e.g. hf2gcode --font=scripts -o out.nc -i in.txt -s 0.3 -y 100 -x 100

Didn't get proper gcode file

Hi there,

I tried to build this project:

make -C ../hershey_fonts src
make[1]: Entering directory '/home/pi/dev/hf2gcode/hershey_fonts'
./fix_linebreak.sh orig/greeks.jhf fixed/greeks.jhf
removing unwanted linebreak and CR in orig/greeks.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/greeks.jhf","gen_c_src/greeks.h")'
./fix_linebreak.sh orig/gothiceng.jhf fixed/gothiceng.jhf
removing unwanted linebreak and CR in orig/gothiceng.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/gothiceng.jhf","gen_c_src/gothiceng.h")'
./fix_linebreak.sh orig/timesr.jhf fixed/timesr.jhf
removing unwanted linebreak and CR in orig/timesr.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/timesr.jhf","gen_c_src/timesr.h")'
./fix_linebreak.sh orig/music.jhf fixed/music.jhf
removing unwanted linebreak and CR in orig/music.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/music.jhf","gen_c_src/music.h")'
./fix_linebreak.sh orig/astrology.jhf fixed/astrology.jhf
removing unwanted linebreak and CR in orig/astrology.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/astrology.jhf","gen_c_src/astrology.h")'
./fix_linebreak.sh orig/scripts.jhf fixed/scripts.jhf
removing unwanted linebreak and CR in orig/scripts.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/scripts.jhf","gen_c_src/scripts.h")'
./fix_linebreak.sh orig/cyrilc_1.jhf fixed/cyrilc_1.jhf
removing unwanted linebreak and CR in orig/cyrilc_1.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/cyrilc_1.jhf","gen_c_src/cyrilc_1.h")'
./fix_linebreak.sh orig/gothgbt.jhf fixed/gothgbt.jhf
removing unwanted linebreak and CR in orig/gothgbt.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/gothgbt.jhf","gen_c_src/gothgbt.h")'
./fix_linebreak.sh orig/symbolic.jhf fixed/symbolic.jhf
removing unwanted linebreak and CR in orig/symbolic.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/symbolic.jhf","gen_c_src/symbolic.h")'
./fix_linebreak.sh orig/futuram.jhf fixed/futuram.jhf
removing unwanted linebreak and CR in orig/futuram.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/futuram.jhf","gen_c_src/futuram.h")'
./fix_linebreak.sh orig/cyrillic.jhf fixed/cyrillic.jhf
removing unwanted linebreak and CR in orig/cyrillic.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/cyrillic.jhf","gen_c_src/cyrillic.h")'
./fix_linebreak.sh orig/timesib.jhf fixed/timesib.jhf
removing unwanted linebreak and CR in orig/timesib.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/timesib.jhf","gen_c_src/timesib.h")'
./fix_linebreak.sh orig/mathlow.jhf fixed/mathlow.jhf
removing unwanted linebreak and CR in orig/mathlow.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/mathlow.jhf","gen_c_src/mathlow.h")'
./fix_linebreak.sh orig/greek.jhf fixed/greek.jhf
removing unwanted linebreak and CR in orig/greek.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/greek.jhf","gen_c_src/greek.h")'
./fix_linebreak.sh orig/markers.jhf fixed/markers.jhf
removing unwanted linebreak and CR in orig/markers.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/markers.jhf","gen_c_src/markers.h")'
./fix_linebreak.sh orig/timesg.jhf fixed/timesg.jhf
removing unwanted linebreak and CR in orig/timesg.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/timesg.jhf","gen_c_src/timesg.h")'
./fix_linebreak.sh orig/meteorology.jhf fixed/meteorology.jhf
removing unwanted linebreak and CR in orig/meteorology.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/meteorology.jhf","gen_c_src/meteorology.h")'
./fix_linebreak.sh orig/japanese.jhf fixed/japanese.jhf
removing unwanted linebreak and CR in orig/japanese.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/japanese.jhf","gen_c_src/japanese.h")'
./fix_linebreak.sh orig/timesrb.jhf fixed/timesrb.jhf
removing unwanted linebreak and CR in orig/timesrb.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/timesrb.jhf","gen_c_src/timesrb.h")'
./fix_linebreak.sh orig/gothgrt.jhf fixed/gothgrt.jhf
removing unwanted linebreak and CR in orig/gothgrt.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/gothgrt.jhf","gen_c_src/gothgrt.h")'
./fix_linebreak.sh orig/greekc.jhf fixed/greekc.jhf
removing unwanted linebreak and CR in orig/greekc.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/greekc.jhf","gen_c_src/greekc.h")'
./fix_linebreak.sh orig/mathupp.jhf fixed/mathupp.jhf
removing unwanted linebreak and CR in orig/mathupp.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/mathupp.jhf","gen_c_src/mathupp.h")'
./fix_linebreak.sh orig/rowmans.jhf fixed/rowmans.jhf
removing unwanted linebreak and CR in orig/rowmans.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/rowmans.jhf","gen_c_src/rowmans.h")'
./fix_linebreak.sh orig/timesi.jhf fixed/timesi.jhf
removing unwanted linebreak and CR in orig/timesi.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/timesi.jhf","gen_c_src/timesi.h")'
./fix_linebreak.sh orig/cursive.jhf fixed/cursive.jhf
removing unwanted linebreak and CR in orig/cursive.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/cursive.jhf","gen_c_src/cursive.h")'
./fix_linebreak.sh orig/gothitt.jhf fixed/gothitt.jhf
removing unwanted linebreak and CR in orig/gothitt.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/gothitt.jhf","gen_c_src/gothitt.h")'
./fix_linebreak.sh orig/rowmant.jhf fixed/rowmant.jhf
removing unwanted linebreak and CR in orig/rowmant.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/rowmant.jhf","gen_c_src/rowmant.h")'
./fix_linebreak.sh orig/gothicita.jhf fixed/gothicita.jhf
removing unwanted linebreak and CR in orig/gothicita.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/gothicita.jhf","gen_c_src/gothicita.h")'
./fix_linebreak.sh orig/scriptc.jhf fixed/scriptc.jhf
removing unwanted linebreak and CR in orig/scriptc.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/scriptc.jhf","gen_c_src/scriptc.h")'
./fix_linebreak.sh orig/gothicger.jhf fixed/gothicger.jhf
removing unwanted linebreak and CR in orig/gothicger.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/gothicger.jhf","gen_c_src/gothicger.h")'
./fix_linebreak.sh orig/futural.jhf fixed/futural.jhf
removing unwanted linebreak and CR in orig/futural.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/futural.jhf","gen_c_src/futural.h")'
./fix_linebreak.sh orig/rowmand.jhf fixed/rowmand.jhf
removing unwanted linebreak and CR in orig/rowmand.jhf
octave -q --eval 'addpath("../src/"); gen_C_code("fixed/rowmand.jhf","gen_c_src/rowmand.h")'
rm fixed/futural.jhf fixed/japanese.jhf fixed/cyrilc_1.jhf fixed/timesr.jhf fixed/scripts.jhf fixed/meteorology.jhf fixed/astrology.jhf fixed/greek.jhf fixed/rowmans.jhf fixed/cursive.jhf fixed/mathlow.jhf fixed/music.jhf fixed/greekc.jhf fixed/timesi.jhf fixed/gothgrt.jhf fixed/gothicita.jhf fixed/timesrb.jhf fixed/greeks.jhf fixed/timesib.jhf fixed/gothicger.jhf fixed/rowmant.jhf fixed/gothitt.jhf fixed/symbolic.jhf fixed/gothgbt.jhf fixed/cyrillic.jhf fixed/mathupp.jhf fixed/markers.jhf fixed/scriptc.jhf fixed/futuram.jhf fixed/gothiceng.jhf fixed/rowmand.jhf fixed/timesg.jhf
make[1]: Leaving directory '/home/pi/dev/hf2gcode/hershey_fonts'
gcc -Wall -Wextra -O0 -ggdb hf2gcode.c libhf2gcode.c -o hf2gcode
libhf2gcode.c: In function ‘get_gcode_line’:
libhf2gcode.c:406:12: warning: comparison is always false due to limited range of data type [-Wtype-limits]
if (x==-50 && y==0) /Pen-Up/
^~
./hf2gcode -i demo.txt -o demo_hello_world.ngc -y 23
./hf2gcode -m -s 0.3 -p 2 -f 800 -i demo.txt -o demo_hello_world_needler.ngc -y 23
./hf2gcode -i demo.txt --font=scripts -o demo_hello_world_scripts.ngc -y 23

but when I open the ngc file, it doesn't have the letters I am expecting. I am wondering what I missed. Thank you.

This is what I get:
Screenshot at Oct 24 10-15-37

demo_hello_world_scripts.txt

Couldnot make on raspberry pi

pi@raspberrypi:~/hf2gcode $ make
make -C src
make[1]: Entering directory '/home/pi/hf2gcode/src'
make -C ../hershey_fonts src
make[2]: Entering directory '/home/pi/hf2gcode/hershey_fonts'
./fix_linebreak.sh orig/greeks.jhf fixed/greeks.jhf
removing unwanted linebreak and CR in orig/greeks.jhf
./fix_linebreak.sh: line 7: gawk: command not found
make[2]: *** [Makefile:19: fixed/greeks.jhf] Error 127
rm fixed/greeks.jhf
make[2]: Leaving directory '/home/pi/hf2gcode/hershey_fonts'
make[1]: *** [Makefile:11: hf2gcode] Error 2
make[1]: Leaving directory '/home/pi/hf2gcode/src'
make: *** [Makefile:4: simple] Error 2

G-Code output too long for GRBL and LinuxCNC

Please split the text and add some line-breaks to the "( text='...' )" G-Code output:

https://github.com/Andy1978/hf2gcode/blob/master/src/hf2gcode.c#L298

hf2gcode generated G-Code with long input texts does not work on GRBL and LinuxCNC:

  • The GRBL motion controller has a line length limit (– 50 for older versions, 70 for 0.8c dev or later),
  • The LinuxCNC / Machinekit NIST rs274 G-Code interpreter has a line length limit, too (– don't know the exact values but just ran into this):
Interpreter exited with error:
Command too long
( text="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.