2004-09-26 Keith Packard * twin.h: * twin_convolve.c: (_twin_path_leftpoint), (_twin_path_step), (_twin_subpath_convolve): Hmm. Not sure this is right, but I'm giving it a try. Recognize closed paths and attempt to construct two disjoint paths as their convolution with the pen. This appears to break when the path has a radius of curvature smaller than the radius of the pen. I'm committing it to CVS mostly so I don't lose the code; I will shortly commit a patch which eliminates the check for a closed path. Oh, one correct change is to _twin_path_leftpoint which used to try to be clever about point selection. Now that pens are forced to be convex, the correct point to use is the one furthest from the line. * twin_path.c: (twin_path_fill), (twin_path_append): Ignore subpaths containing a single point. Add 'twin_path_append' to glue one path into another. * twin_poly.c: (_twin_edge_build), (_twin_edge_fill): Add debug output that shows vertices of polygons * xtwin.c: (main): Code to test convolution change mentioned above 2004-09-25 Keith Packard * twin_font.c: Spurious ) in file 2004-09-25 Keith Packard * twin_font.c: (_snap), (twin_path_ucs4): Reduce emboldening to +50% stroke thickness. Clean up debug code. Eliminate some dead code. Try to adjust width computations a bit. Still not right. * xtwin.c: (main): draw in more colors 2004-09-24 Keith Packard * Makefile.am: * twin.h: Switch to just supporting stroke fonts * twin_font.c: (twin_has_ucs4), (_twin_ucs4_base), (_twin_ucs4_points), (twin_path_ucs4), (twin_ucs4_width), (twin_path_string): Finish needed stroke font API. * twin_glyphs.c: Elimiate all but ascii glyphs, use offset table to eliminate table of pointers (which can't be const) * twin_vera.c: Remove twin_vera.c * twinint.h: Change glyph structures around for offsets and ascii only * xtwin.c: (main): Few more cases to show ascii text support 2004-09-24 Keith Packard * Makefile.am: * twin_hull.c: (_twin_slope_init), (_twin_hull_create), (_twin_slope_compare), (_twin_hull_vertex_compare), (_twin_hull_prev_valid), (_twin_hull_next_valid), (_twin_hull_eliminate_concave), (_twin_hull_to_path), (twin_path_convex_hull): Add convex hull algorithm from cairo sources. Used to constrain pens to convex shapes so that the convolution algorithm works correctly. * twin.h: Reduce default tolerance to 1/16 of a pixel * twin_convolve.c: (_angle), (_twin_subpath_convolve), (twin_path_convolve): Use convex hull of pen. * twin_font.c: (compare_snap), (_snap), (_add_snap), (twin_path_glyph), (twin_glyph_width), (twin_path_string): Snap horizontal and vertical elements of glyphs to pixel boundaries. Snap stem widths to integer amounts. Add slanting and emboldening * twin_glyphs.c: Add space and box * twin_primitive.c: Avoid using __inline as it increases size dramatically * twin_spline.c: (_twin_spline_decompose): Use <= tolerance_squared as that may be zero * xtwin.c: (main): Swizzle code to show off recent changes 2004-09-23 Keith Packard * Makefile.am: * configure.ac: * twin.h: Fix twin_fixed_floor to work for negative values correctly Add twin_path_cur_point * twin_convolve.c: (_twin_path_step), (_around_order), (_angle), (_twin_subpath_convolve), (twin_path_convolve): fix twin_path_step to actually handle duplicate points. Change 'clockwise' to 'around_order' so that all three possible results are returned (clockwise, parallel and counterclockwise) Handle disjoint strokes * twin_font.c: (twin_has_glyph), (twin_path_glyph), (twin_glyph_width), (twin_path_string), (twin_path_fglyph), (twin_path_ucs4), (_twin_utf8_to_ucs4), (twin_path_utf8): Add outline and stroke font support (pick one and remove the other) * twin_glyphs.c: Huge array of stroke fonts from Hershey. Pick appropriate subset and remove extra glyphs (there are a lot here) * twin_path.c: (_twin_cur_subpath_len), (twin_path_cur_point), (twin_path_move), (twin_path_draw), (twin_path_close): Eliminate repeated move and close, eliminate duplicate draw. * twin_poly.c: (_twin_edge_build), (_span_fill), (_twin_edge_fill): Add support for 1, 4, 16 and 64 samples. 16 appears to be the magic sweet spot. * twin_ttf/Makefile.am: * twin_ttf/Vera.ttf: * twin_ttf/twin_ttf.c: (pos), (command), (cpos), (ucs4_to_utf8), (glyph), (outline_moveto), (outline_lineto), (outline_conicto), (outline_cubicto), (ucs_page), (ucs_first_in_page), (sanitize), (facename), (convert_font), (main): Convert "real" outline fonts to twin built-ins * twin_vera.c: Converted version of Bitstream Vera Sans Roman * twinint.h: * xtwin.c: (main): 2004-09-21 Keith Packard * twin.h: * twinint.h: Add a few definitions * twin_convolve.c: (_twin_path_leftpoint), (twin_path_convolve): Find pen starting point as closest to the normal to the path. Restructure convolve loop to be easier to understand * twin_path.c: (twin_path_circle): Round circle coordinates instead of truncating them * twin_poly.c: (_twin_fixed_grid_ceil), (_twin_edge_build), (_span_fill), (_twin_edge_fill): Move sample grid by 1/2 sample step. Clip polygons to mask pixmap. Modest performance improvement in span filling. Fix end case to remove edges before stepping. * xtwin.c: (main): Stroke a path. 2004-09-21 Keith Packard * Makefile.am: * twin.h: * twin_convolve.c: (_twin_path_leftmost), (_twin_path_step), (_clockwise), (twin_path_convolve): Add convolution. Pen starting position needs work. * twin_geom.c: (_twin_distance_to_point_squared), (_twin_distance_to_line_squared): * twin_spline.c: (_twin_spline_error_squared), (twin_path_curve): * twinint.h: Move shared geometric functions to new file * twin_path.c: (_sin), (_cos), (twin_path_circle), (twin_path_fill): Add twin_path_circle to generate pens. Fix path edge generator to handle last subpath right. * twin_poly.c: (_twin_edge_build): Skip vertices which don't span a sample row * xtwin.c: (main): test convolutions 2004-09-20 Keith Packard * .cvsignore: Add .cvsignore file * architecture: Mention path primitives * Makefile.am: * twin.h: * twinint.h: Add paths * twin_draw.c: (twin_composite): Eliminate some unused variables. * twin_path.c: (twin_path_move), (twin_path_draw), (twin_path_close), (twin_path_fill), (twin_path_empty), (twin_path_create), (twin_path_destroy): Simple path construction * twin_poly.c: (_edge_compare_y), (_edge_step_by), (_dump_edge), (_twin_edge_build), (_span_fill), (_twin_edge_fill), (twin_polygon): Anti-aliased polygon fill code * twin_screen.c: Change twin_bool to twin_bool_t * twin_spline.c: (_lerp_half), (_de_casteljau), (_distance_squared_to_point), (_distance_squared_to_segment), (_twin_spline_error_squared), (_twin_spline_decompose), (twin_path_curve): Append cubic Bézier splines to paths * xtwin.c: (main): Test paths