2006-06-07 Bernhard Herzog * Filters/svgsaver.py (SVGSaver.Save): Add a namespace attribute so that other programs, e.g. Firefox, recognize the generated XML as SVG. Wald patch #50 by Fabian Dortu 2006-02-12 Bernhard Herzog Fix some problems in the drawfile filter because of changes in the int/long unification introduced in Python 2.4 * Filters/Lib/spritefile.py (spritefile.str2num): Implement in terms of the module global str2num: (str2num): New function that was formerly a method with the same used in spritefile and drawfile. The implementation is completely new because the old implementation was incorrect in Python 2.4 because the behavior of the << operator has change a bit. * Filters/Lib/drawfile.py (drawfile_object.str2num) (drawfile.str2num): Implement in terms of spritefile.str2num. (drawfile.new): Convert some hexadecimal constants to decimal so that they still have the same value in python 2.4 as before. 2005-07-30 Bernhard Herzog * Filters/sk1loader.py (make_base_style): New function that creates the base style for objects read from an sk1 file. The code used to be at the module level, but having it in a function makes it easier to test. (SKLoader.base_style): Use the new function to create the base style object. 2005-02-14 Bernhard Herzog * Filters/svgloader.py (rx_trafo): Modify the regular expression to be more efficient, especially in cases where the trailing closing parenthesis is missing. 2004-12-19 Bernhard Herzog * Filters/svgloader.py: Fix a typo. (SVGHandler.parse_path): also accept capital Z as closepath command as required by the SVG specification. Savannah Patch #3587 by Bernhard Reiter. 2004-11-10 Bernhard Herzog * Filters/svgloader.py (SVGLoader.Load): Make sure not to download DTDs etc. 2004-05-29 Bernhard Herzog * Filters/svgsaver.py (SVGSaver.make_style): Set the fill-rule to even-odd for filled shapes. Patch by Philippe Blayo (Savannah #3103), fixes Savannah bug #5756. 2004-01-04 Bernhard Herzog Add fill opacity to the .sk file format * Filters/sksaver.py (base_style): Add the default for the fill_opacity (SKSaver.Save): Bump the minor file format version number to 1 since this change introduces a new feature (SKSaver.write_style): Write the fill_opacity setting to the file * Filters/skloader.py (base_style): add defaults for the new fill_opacity property (SKLoader.__init__): Update the supported minor file format version number to 1. Use int instead of atoi (that it used atoi show the age of that code :) since it must have been written for Python 1.4) (SKLoader.fo): New. Handle the fo() call in .sk files which sets the fill opacity 2003-12-20 Bernhard Herzog * Objects/regpoly.py (RegularPolygon.__init__): The range builtin complains about float arguments in Pythion 2.3 so make sure we give it an int. Patches by Lukasz Pankowski (slightly modified by me): * Filters/cgmsaver.py (CGMSaver.PathText): Write a PathText object. (CGMSaver.SaveObjects): Recognize PathText objects properly. * Filters/wmfsaver.py (WMFSaver.PathText): Write a PathText object. (WMFSaver.SaveObjects): Recognize PathText objects properly. 2003-06-09 Bernhard Herzog * Filters/wmfsaver.py: New. WMF export filter by Lukasz Pankowski. I modified it a little: Now all lines are shorter than 79 chars, only spaces are used for indentation, some unused imports are removed and the license statement is clarified to say LGPL consitently (an error which was copied over from the cgm filters) 2003-05-17 Bernhard Herzog * Filters/cgmloader.py, Filters/cgmsaver.py: Update the license statement so that it says LGPL consistently 2003-04-14 Bernhard Herzog * Filters/svgsaver.py (SVGSaver.make_style): Add omit_stroke parameter so that the stroke properties can be explicitly omitted. (SVGSaver.SimpleText): Use the new parameter to make_style to omit the stroke properties for text. Otherwise it can happen that the SVG file will not be drawn the same way as the original Sketch document. 2003-04-12 Bernhard Herzog * Filters/svgloader.py: Adapt to Python 2.2's xml module. (SVGHandler.__init__): Make initial fill color black. 2003-03-01 Bernhard Herzog * Filters/cgmsaver.py: Updates from Antoon Pardon to make the CGM export filter more robust. If the drawing contains features unsupported by the filter it produces warning messages. 2003-01-11 Bernhard Herzog * Filters/svgloader.py (namedcolors): Update to the complete color list of the SVG 1.0 specification (SVGHandler.initsvg): Handle the viewBox attribute. (SVGHandler.try_add_style): Pretetend to apply the transformation matrix to the stroke-width. See the comment. (SVGHandler.set_loader_style): New method to set the loader's graphics properties for the new object. One purpose of this method is to strip the font for objects that can't have fonts. (SVGHandler.circle, SVGHandler.ellipse, SVGHandler.rect) (SVGHandler.polyline, SVGHandler.polygon, SVGHandler.begin_path) (SVGHandler.image, SVGHandler.begin_text): Use the new method to set the style. * Filters/cgmsaver.py: Updates from Antoon Pardon: Rewrote the Polybezier method and implemented rectangles and ellipses * Filters/cgmloader.py: Updates from Antoon Pardon: Added code for searching fonts. Unfortunately loading a CGM file with a fontlist now takes considerably longer. * Filters/cmxloader.py (CMXInterpreter.get_uint16): New. Read usigned 16 bit int. (CMXInterpreter.get_tag): The size is an unsigned 16 bit int. (CMXInterpreter32.PolyCurve): Handle the tags 'manually' because their sizes can't be trusted for very long curves. See comments. 2002-11-02 Bernhard Herzog * Filters/epssaver.py: New. Export filter for EPS. 2002-08-31 Bernhard Herzog * Filters/cgmsaver.py, Filters/cgmloader.py: New. Antoon Pardon's CGM filters * Filters/svgloader.py (SVGHandler.try_add_style): Convert font names to 8bit strings. 2002-08-01 Bernhard Herzog * Filters/svgsaver.py (escape): Function to xml-escape text (SVGSaver.SimpleText): Escape the actual text properly 2002-07-13 Bernhard Herzog * Filters/pdfgensaver.py: Convert tabs to spaces. (PDFGenSaver.__init__): Recognize the pdgen_canvas option to allow python code to render a document on an existing pdf canvas. (PDFGenSaver.close): If the canvas came from the new pdgen_canvas option do nothing here. 2002-05-13 Bernhard Herzog * Filters/svgsaver.py, Filters/svgloader.py, Filters/pdfgensaver.py: Correct the license statement to LGPL. It should have been LGPL all along, just like the rest of Sketch. 2002-02-25 Bernhard Herzog * Filters/bziploader.py (BZIP2Loader.Load): * Filters/gziploader.py (GZIPLoader.Load): Quote the filename properly 2002-02-22 Bernhard Herzog * Filters/wmfloader.py (WMFLoader.PolyPolygon): Implement the PolyPolygon WMF function. Patch by Antoon Pardon. 2002-02-21 Bernhard Herzog * Filters/svgloader.py (SVGHandler.parse_style): Ignore styles with empty values. (SVGHandler.parse_path): Use skread.tokenize_line to parse the arguments of a command, so that we deal with a negative number immediately following another number properly. * Filters/ailoader.py Add support for text alignment. (AILoader.__init__): New ivar text_align (AILoader.end_text): Handle text alignment. Add a few comments. (AILoader.set_text_align): Handle the Ta operator * Filters/ailoader.py (AILoader.read_prolog): Issue a warning if it doesn't look like an Illustrator file. Ideally, the AI-filter shouldn't even attempt to parse files that aren't illustrator files but warning about it is better than silently reading the file and creating a more or less empty document. 2002-02-18 Bernhard Herzog Patch by David Boddie: * Filters/drawinput.py (DrawfileLoader.read_objects): Changed the transformation matrix encoding for sprites so that the off-diagonal elements should now be scaled appropriately according to the horizontal and vertical dots per inch of the sprite. * Filters/Lib/drawfile.py (sprite.input): Fix comment * Filters/Lib/spritefile.py (spritefile.read_details): Modified the maximum number of dots per inch for sprites with a mode number. 2002-02-10 Bernhard Herzog * Filters/sk1saver.py: change extension to .sk1 so that you can explicitly save files in the older format 2002-02-02 Bernhard Herzog * Filters/svgsaver.py (SVGSaver.Save): Set encoding to ISO-8859-1 * Filters/svgsaver.py (SVGSaver.make_style): First stab at dashes, arrow heads and fonts. It generates only predefined dashes and arrows, for now, and probably doesn't do the right thing with fonts. (SVGSaver.Save): Write some simple arrow heads. A real solution should write out the arrow heads actually used in the drawing. (SVGSaver.SimpleText): New method to implement text. (SVGSaver.save_objects): Handle text objects. These changes are based on a patch by Paul Giotta. * Filters/svgloader.py (SVGHandler.parse_style, SVGHandler.try_add_style): Split the actual parsing of the individual style attributes from parse_style into the new method try_add_style so that it can be used for presentation attributes. Patch by Paul Giotta. (SVGHandler.begin_text): Use the new try_add_style to parse the presentation attributes. Patch by Paul Giotta. 2002-01-30 Bernhard Herzog * Filters/Lib/spritefile.py, Filters/Lib/drawfile.py: Updates from David Boddie. * Filters/drawinput.py (RISCOSFont): Bug fix from David Boddie. 2002-01-24 Bernhard Herzog * Filters/aisaver.py (AISaver.write_header): Add EPSF to the output header so that Sketch recognizes the ai files it writes. 2001-12-04 Bernhard Herzog * Filters/Lib/spritefile.py: * Filters/Lib/drawfile.py: * Filters/drawinput.py: New files implementing an import for Acorn Drawfiles. Contributed by David Boddie. 2001-08-11 Bernhard Herzog * Filters/svgloader.py (SVGHandler.parse_style): Parse font sizes more correctly (csscolor): Parse single digit hexadecimal RGB values correctly 2001-06-27 Bernhard Herzog * Filters/cmxloader.py (CMXInterpreter.get_tag, CMXInterpreter.Run): Add some debug output (CMXInterpreter.EndGroup): Ignore empty groups (CMXInterpreter32.BeginGroup): Fix read_struct typestring to match the CMX docs and the 16 bit version. (CMXLoader.Load): Print tracebacks for unhandled exceptions. 2001-05-17 Bernhard Herzog * Filters/svgloader.py (SVGHandler._print): Disable print again. * Filters/pdfgensaver.py (PDFGenSaver.polybezier): Set the fill color to the line color before drawing the arrows to make sure that filled arrows are filled with the proper color. 2001-05-03 Bernhard Herzog * Filters/svgloader.py (SVGHandler.initsvg): The width and height attrs are optional in CR-SVG-20001102 (SVGHandler.user_point): (SVGHandler.point): Split the point method into user_point which computes the point in user coordinates and point which computes the absolute coordinates as before. (SVGHandler.image): Use user_point and fix the positioning of the images. (SVGHandler.begin_text): use user_point (length): (SVGHandler.user_length): Turn the length function into a method because the return value may depend on SVGHandler's instance data. Change the callers accordingly. * Filters/svgloader.py (as_latin1): New function to convert Unicode text to 8bit iso-latin-1 text when sketch runs under Python 2.0 or 2.1 (SVGHandler.parse_transform): (SVGHandler.polyline): (SVGHandler.polygon): (SVGHandler.parse_path): Make sure to convert strings to iso-latin-1 before parsing them further. (SVGHandler.begin_path): Handle the id attribute (SVGHandler.point): Handle units as in CR-SVG-20001102, not as in earlier drafts. (SVGHandler.dispatch_start): (SVGHandler.dispatch_end): (SVGHandler.__init__): (SVGHandler.characters): (SVGHandler.parse_style): (SVGHandler.image): (SVGHandler.begin_text): (SVGHandler.end_text): Add support for text and images (SVGLoader.__init__): Remember the directory of the file being opened to be able to handle relative filenames later 2001-04-04 Bernhard Herzog * Filters/sk1saver.py: * Filters/sk1loader.py: Import export filters for the format of Sketch 0.6.x. * Filters/sksaver.py: Substantial changes so that it traverses the object tree on its own just like the other export filters do, instead of using the SaveToFile methods. There are also some changes to the file format to make it more regular and to support saving meta data * Filters/skloader.py: Substantial changes to read the new file format version including meta data and use the new Sketch.Plugin.scaffold module * Objects/regpoly.py (RegularPolygon.PluginArgs): * Objects/lcdtext.py (LCDText.PluginArgs): Implement the new method for saving plugins. 2001-03-29 Bernhard Herzog * Filters/svgsaver.py (SVGSaver.write_gradient): Insert a missing space in the radial gradient format string and add gradientUnits="userSpaceOnUse" to radial and axial gradients. Pointed out by Laetitia MARIN 2001-02-18 Bernhard Herzog * Filters/pdfgensaver.py (PDFGenSaver.polybezier): Draw the arrowheads only when the polybezier object actually has line properties. * Filters/svgloader.py (SVGHandler.point): Handle %-coordinates better. Patch provided by Philipp Matthias Hahn 2000-10-21 Bernhard Herzog * Filters/xfigloader.py (XFigLoader.line): (XFigLoader.read_arc): (XFigLoader.read_ellipse): (XFigLoader.read_polyline): (XFigLoader.read_spline): Add support for dash patterns 2000-09-24 Bernhard Herzog * Filters/pdfgensaver.py (PDFGenSaver.set_properties): (PDFDevice.SetLineAttributes): Multiply the dashes with the line width (PDFGenSaver.draw_arrow): New method to draw an arrow head (PDFGenSaver.polybezier): Draw arrow heads if present 2000-08-04 Bernhard Herzog * Filters/pdfgensaver.py (PDFGenSaver.polybezier): For an active fill (i.e. gradients etc), make sure to restore the the state before stroking the path. Otherwise half of it gets clipped. 2000-08-01 Bernhard Herzog * Filters/svgsaver.py: Add support for gradients. 2000-07-27 Bernhard Herzog * Filters/pdfgensaver.py: New export filter for PDF. Uses reportlab's pdfgen as the backend, therefore reportlab must be installed to use this filter. 2000-04-08 Bernhard Herzog * Filters/ailoader.py (AILoader.end_gradient): Clear the stack at the end instead of just pop_to_mark. The second mark may not always be present. (AFAICT it's only present if the ai file contains printing information (i.e. final form)). 2000-03-24 Bernhard Herzog * Filters/svgloader.py (SVGHandler.parse_style): deal with empty strings left in the list created by splitting on ';' 2000-03-19 Bernhard Herzog * Filters/xfigloader.py (XFigLoader.read_text): Use a globals dictionary with an empty __builtins__ (i.e. use restricted execution) when eval()ing strings. 2000-03-18 Bernhard Herzog * Filters/skloader.py (SKLoader.__init__): Fixed a typo in the warning message for files of newer Sketch versions 2000-03-06 Bernhard Herzog * Filters/cmxloader.py: removed some unused imports 2000-02-29 Bernhard Herzog * Filters/cmxloader.py (CMXFile.read_procindex): In preparation for Python 1.6, call list append methods with exactly one argument. 2000-02-25 Bernhard Herzog * Filters/ailoader.py (AILoader.begin_ai_layer): In Illustrator 8, the Lb operator takes more arguments. Treat this case properly. (AILoader.read_prolog): Recognize the AI5_FileFormat comment and set self.format_version accordingly (AILoader.Load): Recognize and ignore the BrushPattern definitions in AI8 files. Otherwise the filter treats them like normal objects 2000-02-24 Bernhard Herzog * Filters/ailoader.py (AILoader.__init__): New instance variable format_version that holds the value of the AI5_FileFormat comment. It defaults to 0.0 (AILoader.dummy_gradient_stop): New method to deal with the additional color stop operator BS introduced in Illustrator 8 (AILoader.end_gradient): Now that the Br operator is recognized pop the additional mark 2000-02-23 Bernhard Herzog * Objects/regpoly.py: * Objects/lcdtext.py: * Filters/xfigloader.py: * Filters/skloader.py: * Filters/gziploader.py: * Filters/bziploader.py: * Filters/aisaver.py: * Filters/ailoader.py: Use xpot's special syntax to mark translatable strings. 2000-02-13 Bernhard Herzog * Filters/cmxloader.py (CMXFile.load_bitmap): (CMXFile.load_rimage): * Filters/ailoader.py: use PIL as a package, therefore change "import Image" to "from PIL import Image" or use "import PIL.Image" and refer to PIL.Image 2000-01-27 Bernhard Herzog * Filters/ailoader.py: Removed .ps and .eps from the list of possible file name extensions. They mislead users to assume that File->Open was the way to load EPS files. 2000-01-25 Bernhard Herzog * Filters/bziploader.py (BZIP2Loader.Load): refer to self.filename instead of just filename if extension != .bz2 * Filters/gziploader.py (GZIPLoader.Load): refer to self.filename instead of just filename if extension != .gz * Filters/bziploader.py (BZIP2Loader.Load): same as GZIPLoader.Load below. (BZIP2Loader.set_doc_class): same as GZIPLoader.set_doc_class below. * Filters/gziploader.py (GZIPLoader.Load): pass doc_class through to load.load_drawing_from_file (GZIPLoader.set_doc_class): This method is required in a loader in 0.7.x to pass the document class to the loader. Normally, it's implemented in GenericLoader, but GZIPLoader isn't derived from that 2000-01-23 Bernhard Herzog * ChangeLog: created