From: Ariya H. <ar...@us...> - 2006-06-17 08:12:50
|
Update of /cvsroot/libwpg/libwpg In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14544 Added Files: NOTES Log Message: - important records for WPG2 (pen, brush, lines, curve) - the listener is now PaintInterface, using PostScript-like rendering model - simplified SVG generation (due to the above PaintInterface) - fixed coding style to follow libwpd (tab-indentation, camelcase function names, correct file names, ...) - fixed FSF address - added notices on implementation details (first commit for my Google Summer of Code project) --- NEW FILE: NOTES --- Notes of various issues Ariya Hidayat, June 2006 Parsing status for WPG1 ----------------------- Here is a list of WPG1 records and its parsing status: 0x01 Fill attributes implemented (partially) 0x02 Line attributes implemented (partially) 0x03 Marker attributes - 0x04 Polymarker - 0x05 Line implemented 0x06 Polyline implemented 0x07 Rectangle implemented 0x08 Polygon implemented 0x09 Ellipse implemented 0x0A Reserved ? 0x0B Bitmap (Type 1) - 0x0C Graphics text (Type 1) - 0x0D Graphics text attributes - 0x0E Color map - 0x0F Start of WPG data (Type 1) implemented 0x10 End of WPG data implemented 0x11 PostScript data follows (Type 1) ignored 0x12 Output attributes - 0x13 Curved polyline - 0x14 Bitmap (Type 2) - 0x15 Start figure ignored 0x16 Start chart ignored 0x17 PlanPerfect data ignored 0x18 Graphics text (Type 2) implemented 0x19 Start of WPG data (Type 2) - 0x1A Graphics text (Type 3) - 0x1B PostScript data follows (Type 2) - Legend: "-" : not implemented at all "implemented" : the record is fully parsed "ignored" : the record is recognized but not useful and thus ignored "?" : no documentation exists Parsing status for WPG2 ----------------------- Here is a list of WPG2 records and its parsing status: 0x01 Start WPG implemented 0x02 End WPG implemented 0x03 Form Settings ignored 0x04 Ruler Settings ignored 0x05 Grid Settings ignored 0x06 Layer implemented 0x07 Unknown/Reserved ? 0x08 Pen Style Definition implemented 0x09 Pattern Definition - 0x0a Comment ignored 0x0b Color Transfer implemented 0x0c Color Palette implemented 0x0d DP Color Palette - 0x0e Bitmap Data - 0x0f Text Data - 0x10 Chart Style ignored 0x11 Chart Data ignored 0x12 Object Image - 0x13 Unknown/Reserved ? 0x14 Unknown/Reserved ? 0x15 Polyline implemented 0x16 Polyspline - 0x17 Polycurve implemented 0x18 Rectangle implemented 0x19 Arc implemented 0x1a Compound Polygon - 0x1b Bitmap - 0x1c Text Line - 0x1d Text Block - 0x1e Text Path - 0x1f Chart ignored 0x20 Group - 0x21 Object Capsule - 0x22 Font Settings - 0x23 Unknown/Reserved ? 0x24 Unknown/Reserved ? 0x25 Pen Fore Color implemented 0x26 DP Pen Fore Color implemented 0x27 Pen Back Color implemented 0x28 DP Pen Back Color implemented 0x29 Pen Style implemented 0x2a Pen Pattern - 0x2b Pen Size implemented 0x2c DP Pen Size implemented 0x2d Line Cap - 0x2e Line Join - 0x2f Brush Gradient - 0x30 DP Brush Gradient - 0x31 Brush Fore Color implemented 0x32 DP Brush Fore Color implemented 0x33 Brush Back Color implemented 0x34 DP Brush Back Color implemented 0x35 Brush Pattern - 0x36 Horizontal Line ignored 0x37 Vertical Line ignored 0x38 Poster Settings ignored 0x39 Image State - 0x3a Envelope Definition ignored 0x3b Envelope ignored 0x3c Texture Definition - 0x3d Brush Texture - 0x3e Texture Alignment - 0x3f Pen Texture - Legend: "-" : not implemented at all "implemented" : the record is fully parsed "ignored" : the record is recognized but not useful and thus ignored "?" : no documentation exists WPG2 File Format Documentation Errata ------------------------------------- In "Pen Styles" section, style #8 is described as: 1: 164 (0xA4),55 (0x37),18 (0x12),55 (0x37) while it should be instead: 2: 164 (0xA4),55 (0x37),18 (0x12),55 (0x37) because this style consists of 2 (two) pair of segments, not only 1 (one). For "Order of Optional Characterization Data Fields", it is described as: {Edit lock flags}[Object ID] {Angle of rotation} {Sxcos() transformation element} {Sycos() transformation element} {Kxsin() transformation element} {Kysin() transformation element} {Tx transformation element (integer)} [Tx transformation element (fraction)] {Ty transformation element (integer)} [Ty transformation element (fraction)] {Px transformation element} {Py transformation element} However, the correct order (after reverse-engineering) seems to be: {Edit lock flags}[Object ID] {Angle of rotation} {Sxcos() transformation element} {Sycos() transformation element} {Kxsin() transformation element} {Kysin() transformation element} [Tx transformation element (fraction)] {Tx transformation element (integer)} [Ty transformation element (fraction)] {Ty transformation element (integer)} {Px transformation element} {Py transformation element} i.e. the fraction part (16-bit) of the transformation element comes before the integer part (32-bit). SVG (Scalable Vector Graphics) ------------------------------ The conversion tool wpg2svg can convert WPG file into SVG format. The SVG result may contain embedded comment such as: <!-- Created with wpg2svg/libwpg 0.2.0 --> This is intended so that when the file contains errors or bugs, the version of the converter can be traced back. |