pz09-CORVUS-CORAX / LIVE_DEPL

realizacja wdrożenie
GNU General Public License v3.0
1 stars 0 forks source link

GCODE Converter - path #13

Open ja669nle2bil opened 6 months ago

ja669nle2bil commented 6 months ago
try:
    with tempfile.NamedTemporaryFile(suffix='.svg', delete=False, dir=custom_temp_dir) as temp_svg_file:
        print(temp_svg_file.name)
        print("whole file", temp_svg_file)

        output_svg_path = temp_svg_file.name

        # 21:50-23-04
        # subprocess.check_call(['pdf2svg', file_path, output_svg_path, '1'])

        # return jsonify({
        #     "svg_path": output_svg_path
        # })
        with open(temp_svg_file.name, 'r') as f:
            svg_content = f.read()

        #Font extraction/Zespol
        # subprocess.check_call(['python', '/font_extractor/font_extractor/font_extractor.py', temp_svg_file.name])
        subprocess.check_call(['fontforge', '-script', './font_extractor/font_extractor/font_extractor.py',  temp_svg_file.name])
        # do sth.
        with open('output_from_parse_svg.json', 'r') as f:
            font_data = json.load(f)

        return font_data  # Return the processed font data
ja669nle2bil commented 6 months ago

nodeenv inside of the python venv: pip install nodeenv nodeenv -p npm install -g npm npm -v

ja669nle2bil commented 6 months ago

!!! Reset the page after successfull gcode download.