diff --git a/README.md b/README.md index ba0905e..6224af1 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,7 @@ Dependencies ------------ * gcc, the GNU Compiler Collection, libc * [GNU argp](http://www.gnu.org/software/libc/manual/html_node/Argp.html) -* (OPTIONAL) GNU Octave if you want to generate the hershey font overview pngs and svgs or to generated the hershey_font C declarations. -* (OPTIONAL) photon if you want to generate a static HTML page with rendered fonts like http://www.tech-chat.de/png_album/ +* (OPTIONAL) GNU Octave if you want to generate the hershey font overview svgs or to generated the hershey_font C declarations. Build ----- @@ -109,7 +108,7 @@ Design and structure -------------------- * hershey_fonts/orig/*.jhf: original hershey fonts, see hershey_fonts/README * hershey_fonts/fixed/*.jhf: generated with fix_linebreak.sh from orig -* OPTIONAL hershey_fonts/rendered_png and rendered_svg: All fonts as PNG or SVG, generated from src/render_hf (see http://www.tech-chat.de/png_album/) +* OPTIONAL hershey_fonts/rendered_svg: All fonts as SVG, generated from src/render_hf (see http://www.tech-chat.de/png_album/) * hershey_fonts/gen_c_src/*.h: Font declarations, generated with src/gen_C_code.m * src/libhf2gcode.c and .h: Actual type setting/tracing * src/hf2gcode.c: A command line interface program to call libhf2gcode diff --git a/hershey_fonts/Makefile b/hershey_fonts/Makefile index 07a2238..98bee4a 100644 --- a/hershey_fonts/Makefile +++ b/hershey_fonts/Makefile @@ -5,7 +5,6 @@ .SECONDARY: fixed_hf = $(subst orig,fixed,$(wildcard orig/*.jhf)) -rendered_hf_png = $(patsubst %.jhf,%.png,$(subst orig,rendered_png,$(wildcard orig/*.jhf))) rendered_hf_svg = $(patsubst %.jhf,%.svg,$(subst orig,rendered_svg,$(wildcard orig/*.jhf))) gen_c = $(patsubst %.jhf,%.h,$(subst orig,gen_c_src,$(wildcard orig/*.jhf))) @@ -22,12 +21,9 @@ fixed/%.jhf: orig/%.jhf ./fix_linebreak.sh ./fix_linebreak.sh $< $@ find ./patches -name "$(basename $(notdir $@))_*.patch" -exec sh -c "patch -p1 < {}" \; -rendered_png/%.png rendered_svg/%.svg: fixed/%.jhf $(RENDER_DEP) +rendered_svg/%.svg: fixed/%.jhf $(RENDER_DEP) octave -q --eval 'addpath("../src/"); render_hf("$<", "rendered_png", "rendered_svg")' -png_album: $(rendered_hf_png) - photon -J -s 0 -t 800x800 -E -d 1 -l40 -o png_album rendered_png - gen_c_src/%.h:fixed/%.jhf ../src/gen_C_code.m ../src/load_hf.m @mkdir -p gen_c_src octave -q --eval 'addpath("../src/"); gen_C_code("$<","$@")' diff --git a/src/plot_hf_glyph.m b/src/plot_hf_glyph.m index c7b8677..92c5a15 100644 --- a/src/plot_hf_glyph.m +++ b/src/plot_hf_glyph.m @@ -27,7 +27,7 @@ function plot_hf_glyph(glyph, xo, yo, plot_margins=0) hold on plot([glyph.rightmargin+xo, glyph.rightmargin+xo], [10+yo -10+yo],"-r"); endif - text(xo-5,yo-20,num2str(glyph.num)); + #text(xo-5,yo-20,num2str(glyph.num)); m=numel(glyph.x); if (m>0) for k=1:m+1 @@ -35,7 +35,7 @@ function plot_hf_glyph(glyph, xo, yo, plot_margins=0) px=glyph.x(s:k-1)+xo; ## inverted, in hershey font y positive down py=-glyph.y(s:k-1)+yo; - plot(px, py) + plot(px, py, "-b") if(!plot_margins) hold on; endif @@ -44,4 +44,5 @@ function plot_hf_glyph(glyph, xo, yo, plot_margins=0) endfor endif hold off + axis off endfunction diff --git a/src/render_hf.m b/src/render_hf.m index cf9305c..fe77788 100644 --- a/src/render_hf.m +++ b/src/render_hf.m @@ -15,27 +15,19 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} render_hf (@var{fn}, @var{outdir}) -## Render hershey font using octave, export it to PNG and SVG image. +## Render hershey font using octave and export it as SVG. ## Its purpose is to get an overview over the available glyphs. -## Attention: outdir works only once, (not like mkdir -p). ## @seealso{plot_hf} ## @end deftypefn -function render_hf (fn, png_out = "./rendered_png", svg_out = "./rendered_svg") +function render_hf (fn, svg_out = "./rendered_svg") [DIR, NAME, EXT] = fileparts (fn); - - mkdir (png_out); mkdir (svg_out); - - fn_png = fullfile(png_out, [NAME ".png"]); fn_svg = fullfile(svg_out, [NAME,".svg"]); - printf("Rendering %s and %s from %s...\n",fn_png,fn_svg,fn); + printf("Rendering %s from %s...\n", fn_svg, fn); fflush(stdout); - hf = load_hf (fn); figure("visible","off"); - plot_hf(hf), axis square - - print(fn_png,"-S1200,1200") - print(fn_svg,"-S1200,1200") + plot_hf(hf) + print (fn_svg) endfunction