PATCH: Export glyph to PDF from script
Scott Pakin <[email protected]>
| Newsgroups | gmane.comp.fonts.fontforge.devel |
|---|---|
| Message-ID | <[email protected]> |
This script works:
Open($1)
Select(65)
Export("u%U.eps")
This script fails with an "Export: Wrong number of arguments" error:
Open($1)
Select(65)
Export("u%U.pdf")
The problem seems to be an off-by-one error when distinguishing vector
from bitmapped formats, and PDF is the format that's unlucky enough to
be misidentified.
I've attached a patch for your consideration.
Regards,
-- Scott
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Fontforge-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
fontforge.patch
(text/x-diff, 684 B)
--- fontforge/scripting.c.ORIG 2014-02-25 11:44:52.879987938 -0700
+++ fontforge/scripting.c 2014-02-25 11:45:31.073550477 -0700
@@ -2203,10 +2203,10 @@
else
ScriptError( c, "Bad format (first arg must be eps/fig/xbm/bmp)");
#endif
- if (( format>=4 && c->a.argc!=3 ) || (format<4 && c->a.argc==3 ))
+ if (( format>4 && c->a.argc!=3 ) || (format<=4 && c->a.argc==3 ))
ScriptError( c, "Wrong number of arguments");
bdf=NULL;
- if ( format>=4 ) {
+ if ( format>4 ) {
for ( bdf = c->curfv->sf->bitmaps; bdf!=NULL; bdf=bdf->next )
if (( BDFDepth(bdf)==1 && bdf->pixelsize==c->a.vals[2].u.ival) ||
(bdf->pixelsize!=(c->a.vals[2].u.ival&0xffff) &&