Friday, December 31, 2010

zmidi-emit

Copperbox revision 2001.

I've added printing the instrument name back into the generated MIDI, this was removed in the previous commit as I switched General MIDI instruments from being a data type to just a Word8 representation.

zmidi-emit

Copperbox revision 2000.

I've replaced the General MIDI data types by named constructors.This means the Builder only has to handle one 'note' data type.

zmidi-emit

Copperbox revision 1999.

Work tidying up and adding Haddock docs. The root data type ZMidiRep is now called HiMidi as it is meant to be a higher level representation.

Thursday, December 30, 2010

zmidi-emit

Copperbox revision 1998.

I've sorted out a bug in the MIDI output where overlaid voices were being played sequentially, rather than simultaneously.

Wednesday, December 29, 2010

zmidi

Copperbox revision 1997.

More work turning ZMidi-Emit into a cohesive library, I've made the data types more 'pertinent' with better names. There is still quite a bit of work before it's a generally usable library, though.

ZMidi-Core - I've changed the prety print function names so they won't cause a name-clash.

zmidi

Copperbox revision 1995.

ZMidi-Core - I've changed the data type naming scheme, so that all data types are prefixed with 'Midi'. This is so higher-level software (especially ZMidi-Emit) has more freedom to use generic names like 'Track'.

Copperbox revision 1996.

Updated ZMidi-Emit to work with the new naming scheme in ZMidi-Core.

Note - the naming scheme in ZMidi-Emit still needs rationalizing.

Tuesday, December 28, 2010

zmidi-emit

Copperbox revision 1994.

I've reworked the data types and the MIDI rendering so that ZMidi-Emit better handles multiple tracks and multiple channels. There is still some work to do towards sorting out naming and adding a reasonable set of construction functions.

wumpus - new releases

Copperbox revision 1993.

New releases of the Wumpus libraries.

wumpus-core-0.41.0
wumpus-basic-0.14.0
wumpus-microprint-0.13.0
wumpus-tree-0.12.0

The major change in Core is PostScript output now uses custom procs for drawing circles and ellipses.

Basic has major changes - particularly splitting into two layers Basic and Drawing.

Tree and Microprint have only internal changes to work with the latest Basic.

Monday, December 27, 2010

wumpus-core

Copperbox revision 1992.

I've removed the buggy ellipse control point code rather than fix it. Ellipses don't have control points, so it was illustrating something that doesn't really exist and the even when it worked the illustration wasn't very informative. So it was an easy decision to cull it.

wumpus-core

Copperbox revision 1991.

I've changed the PostScript rendering to output a prolog defining procs for circles and ellipses, then to call these procs when needed in the body of the drawing.

This fixes the immediate bug, noted in the last post, but there is still a bug on drawing control points for illustrating the paths of ellipses. At least this bug is common to both SVG and PostScript output...

BUG - wumpus-core

I discovered a bug this afternoon in Wumpus-Core where ellipses are not drawn properly - the position of the center is miscalculated. Surprisingly this bug has been in place for quite a while, clearly I mustn't use ellipses very often with the higher-level stuff like Wumpus-Basic for it to go so long without being spotted.

I'm a bit hesitant about a fix as I think the best solution is probably to define PostScript procedures for drawing circles and ellipses, but this is something I've been reluctant to do - there are quite a lot of opportunities to go wrong, especially with EPS files which have special concerns for variables. 


% Filled ellipse
/FELL     % X Y RX RY FELL
{
  /RY exch def
  /RX exch def
  /Y  exch def
  /X  exch def
  X Y translate
  1 RY RX div scale
  newpath
  0 0 RX 0.0 360.0 arc
  closepath
  fill
  1 RX RY div scale
  X neg Y neg translate
} bind def

wumpus

Copperbox revision 1990.

Various updates before I make new release archives. Wumpus-Tree and Wumpus-Rhythm have been updated to work with Wumpus-Basic, the guide for Wumpus-Core has been updated.

Sunday, December 26, 2010

wumpus-basic

Copperbox revision 1989.

I've changed the FontLoader API so that the warning logs are returned as well as the font metrics.

wumpus-basic

Copperbox revision 1987 and 1988.

I've changed the directory layout of the font loader code so System.FontLoader.Internal is now System.FontLoader.Base. I've also extracted the FontLoadIO monad into its own module.

wumpus-basic

Copperbox revision 1986.

I've updated the examples to run again - some were failing to compile due to API changes.

Saturday, December 25, 2010

wumpus

Copperbox revision 1986.

I've updated Wumpus-Tree and Wumpus-Rhythm to work with the changes to font loading and the LRText API in Wumpus-Core. The LRText API needs more though - I'd forgotten that it needs functions for drawing single characters and already escaped text.

Friday, December 24, 2010

wumpus-basic

Copperbox revision 1984.

I've now reworked the font loader code (rather than just changing the namings).

The new code has capabilities for logging warnings during font loading, and it should also allow using different font loaders for the same drawing[*]. However, while these features are now in the code I haven't yet changed the API to make them visible.

[*] Mixing different font loaders is not going to be particularly useful in practice unless I develop a TrueType font loader. The current loaders can only load different metrics for what are essentially the same 14 fonts. 

wumpus-basic

Copperbox revision 1983.

More name changes and minor tidying of the FontLoader code, though these changes are rather trivial as I haven't really worked out what to do with the code to make font loading more robust.

At the moment, I've got a big function to load font files that is parametric on certain intermediate steps so it can handle the GhostScript font metrics or the AFM ones. How the big function is parameterized is rather convoluted, maybe it will be better for the GhostScript and AFM loaders do things independently.

Thursday, December 23, 2010

wumpus-basic

Copperbox revision 1982.

A round of name changes in the FontLoader code, before I look to add error logging / reporting to the file access code.

wumpus-basic

Copperbox revision 1981.

I've changed the directory structure for the FontLoader code. This is a preliminary step before I work on the code (the code needs improving for robustness).

Wednesday, December 22, 2010

wumpus-basic

Copperbox revision 1980.

I've tidied up the code in LRText and added functions for rotated versions of multi-line and single-line text.

Pleasingly the multi-line rotated text draws correctly, there is a problem that the bounding box isn't accurate. This might be a problem with "the algorithm" rather than the code itself, and I don't think I'll rush to fix it - improving the font loader is the next priority.

Copperbox revision 1979.

Old code removed from LRText module.

wumpus-core

Copperbox revision 1978.

I've stopped the function vectorPath needlessly throwing a runtime error.

wumpus-basic

Copperbox revision 1977.

New version of left-to-right text is now working for multi-line text. However, the code is rather rough at the moment (it needs cleaning up) and I haven't yet removed the the old code.

wumpus-basic

Copperbox revision 1976.

More work towards re-implementing left-to-right text. Single line text now supports being drawn at an angle, multi line text is not yet working.

Tuesday, December 21, 2010

wumpus-basic

Copperbox revision 1975.

Work towards re-implementing LRText.

I want to be able to handle rotated text, and I'd like the new implementation to be a lot clearer than the previous one which was essentially a proof-of-concept.

wumpus-core

Copperbox revision 1974.

I've added a function boundaryCenter to Core.BoundingBox.

wumpus-basic

Copperbox revision 1973.

Work improving the arrow tips code. Also I've now removed the adaptR1 and adaptR2 Context fun  combinators, so the set of remaining combinators is what I see as being the "optimal set".

Monday, December 20, 2010

wumpus-basic

Copperbox revision 1972.

More tidying up.

I've extended the Haddock documentation in the Anchor and ContextFun modules and reduced the use of the adaptR1 and adaptR2 functions. These two will be removed in due course, reducing the number of "arity" combinators in Wumpus-Basic and making the remaining set more comprehensible.

wumpus-basic

Copperbox revision 1971.

First part of a code clean up for Wumpus-Basic. I'm going to do a major round of cleaning on the WB code, I want to see if I can improve the drawing code (arrowheads in particular) with the new types for the basic objects.

Sunday, December 19, 2010

wumpus-rhythm

Copperbox revision 1970.

Wumpus-Rhythm can now emit MIDI using General MIDI drums as well as SVG and PostScript. This is in some ways a milestone although General MIDI drums are always a bit disappointing to hear and the sampled sounds don't perhaps match to the African percussion instruments too well.

zmidi-emit

Copperbox revision 1969.

Changes to get sections rendered into a specifically numbered channel. This is so percussion can be rendered on channel 9.

wumpus-rhythm

Copperbox revision 1968.

Work adding bell notes to kenkeni patterns. Bell is an X at the upstroke position.

zmidi-emit

Copperbox revision 1966.

I've renamed zmidi-construction to zmidi-emit. I decided zmidi-construction was too long, and I also want to emphasize that the point of the library is emitting MIDI rather than constructing it.


Copperbox revision 1967.

Deleted the zmidi-construction directories.

Saturday, December 18, 2010

zmidi-construction

Copperbox revision 1965.

Improvements to the syntax construction. I think most of the bits are now in place, it just needs some work to polish it up and see if it works well for other more complicated examples.

zmidi-construction

Copperbox revision 1963.

I've renamed ZMidi-Basic to ZMidi-Construction. As I'm not going to add MIDI file analysis to this library (although I originally planned to) it needed a better name.


Copperbox revision 1964.

Deleted old ZMidi-Basic folders.

zmidi-basic

Copperbox revision 1962.

I've changed the syntax representation to use JoinLists for Tracks and Sections - this will allow them to be assembled with cheap append.

With the next commit I expect to change the project name from zmidi-basic to zmidi-construction. It is looking like the library will only cover building MIDI files so needs a better name. Originally I wanted to analyse MIDI files as well but this can go in another library when I get round to it.

zmidi-basic

Copperbox revision 1961.

More work on the high-level representation. It looks like I'm going to need to extend the Build monad to be a writer monad as well as a reader monad. This commit is the work so far.

Friday, December 17, 2010

zmidi-basic

Copperbox revision 1960.

I've changed the module hierarchy, renaming ZMidi.Basic.WriteMidi to ZMidi.Basic.Construction. Also I've started work on a builder made with a reader monad that should allow some of the 'extraneous' properties of notes to be constructed implicitly.

zmidi-basic

Copperbox revision 1959.

I've added more structure to the high-level MIDI representation so it can handle "inline" tempo changes and different instruments.

zmidi-basic

Copperbox revision 1958.

More work on output for the higher-level MIDI representation. Added time stamp and end-of-track messages, so now the output file actually works.

Thursday, December 16, 2010

zmidi-basic

Copperbox revision 1957.

Initial work on rendering a more a higher level note list format to MIDI. The output is missing meta-events (e.g. end-of-track messages) so it doesn't currently work.

new release - zmidi-core-0.2.0

Copperbox revision 1956.

New release of zmidi-core. No new functionality - just the top level shim module.

zmidi-basic

Copperbox revision 1955.

I've started a new library ZMidi-Basic on top of ZMidi-Core to help construct MIDI output. Although simple, MIDI is quite a convoluted format if you want to output "music" rather than note-ons and note-offs. I've built MIDI builders many times now, though they've always had some short-comings. Hopefully I'll build a decent one with this library.

zmidi-core

Copperbox revision 1954.

I've updated ZMidi-Core, adding a top level shim module and some administration (version number file, CHANGES file). I'd like wumpus-rhythm to be able to output sound, so MIDI is the obvious candidate.

Wednesday, December 15, 2010

wumpus

Copperbox revision 1953.

Updates to Rhythm, Tree and Microprint to track the changes to Wumpus-Basic.

wumpus-basic

Copperbox revision 1952.

I've updated the Drawing modules to use the new CF, CF1 and CF2 functions. Also, I've removed the now outdated combinators in ContextFun.

wumpus-basic

Copperbox revision 1951.

Some work on combinators for lifting between Graphic functions of different arities (i.e the CF, CF1 and CF2 functions / newtypes).

wumpus-basic

Copperbox revision 1950.

I've reformulated the Graphic types again.

Instead of a single newtype with synonyms:

> newtype CF a = CF { unCF :: DrawingContext -> a}
> type LocCF u a = CF (Point2 u -> a)

I now have different newtypes for arity 0 and arity 1 & 2

> newtype CF a = CF { unCF :: DrawingContext -> a}
> newtype CF1 r1 a = CF { unCF1 :: DrawingContext -> r1 -> a}
> newtype CF2 r1 r2 a = CF { unCF2 :: DrawingContext -> r1 -> r2 -> a}

> type LocCF u a = CF1 (Point2 u) a

This should mean I can use standard Applicative and Monad combinators much more and depreciate the use of the arity combinators (prepro1, postpro2, situ1 etc.) in ContextFun.

At the moment I've just changed the types and got the Wumpus.Basic.* modules working, I haven't yet looked at improving the code or updated the Wumpus.Drawing.* modules.

Tuesday, December 14, 2010

wumpus-rhythm

Copperbox revision 1949.

Updated to work with changes to Wumpus-Basic. I've made some improvements to the code as I've added a bifunctor class to Wumpus-Basic so this gives me some useful functions on pairs.

Monday, December 13, 2010

wumpus-basic

Copperbox revision 1948.

I've changed the representation of the Graphic type so it is function producing a pair. This makes it the same "shape" as the Image type, but as Graphic isn't "interesting" returns () in the left slot of the pair rather than a useful answer such as a bounding box. This unifies the graphic types in Wumpus-Basic so they are now largely the same "shape" - they vary only in the implicit arguments e.g. start-point, angle of rotation...

That said the code has got very messy again, I'll have to re-think the "combinator basis" in Kernel.Base.ContextFun as the current set don't seem to be helping me write uniform code.

Sunday, December 12, 2010

wumpus-core

Copperbox revision 1947.

I've changed the argument orders of the functions rtextlabel and rescapedlabel - the point and the angle are swapped so now the angle is first. This is consistent with the rellipse functions - I should have spotted that there was a mismatch before now...

wumpus-core

Copperbox revision 1946.

I've added a new type UNil to Core.Geometry and added affine instances for Pair and Maybe.

I believe I can unify the graphic types in Wumpus.Basic.Kernel.Objects by making them all extensions of Image

> type Image u a = CF (a, Prim u)

> i.e. type Image u a = DrawingContext -> (a, Prim u)

Currently I have Graphic to be different from Image:

> type Graphic u = DrawingContext -> Prim u

But I think if I make it  this type:

> type Graphic u = Image u (UNil u)

> i.e. type Graphic u = DrawingContext -> (UNil u, Prim u)

Then the dichotomy between Image and Graphic vanishes so they can use the same functions.

Saturday, December 11, 2010

wumpus-rhythm

Copperbox revision 1944.

The djembe code now uses runtime loaded font metrics, rather than hard coded metrics.

Copperbox revision 1945.

Changes to LRText in Wumpus-Basic that should have been in the previous commit.

wumpus-core

Copperbox revision 1943.

I've made the EscapedText newtype in Core.Text.Base an opaque type. There is an new constructor for building a one element EscapedText from an EscapedChar and a new destructor to unwrap the newtype.

wumpus-rhythm

Copperbox revision 1942.

I'm changing Djembe to use loaded font metrics rather than hard coded character widths. This is the first part of the change - adding a specialized Helvetica font loader.

Friday, December 10, 2010

wumpus-rhythm

Copperbox revision 1941.

More work on the examples. One problem I've "discovered" is that the unit widths is fixed in Wumpus's djembe rendering, whereas in the Paul Nas book width is proportional so a rhythm in 16/8 can be aligned with a rhythm in 12/8. I don't intend fixing this soon but it is a limitation to note.

wumpus-clave - now wumpus-rhythm!

Copperbox revisions 1937 - 1940.

Wumpus-Clave has now become Wumpus-Rhythm.

Originally Wumpus-Clave supported drawing clave patterns in the Box notation. However that code is obsolete and the only working code is for djembe patterns. Rather than have a Wumpus project for every notation, it seems better just to have them all under a large enough name / category - "rhythm".

I had finger trouble with Subversion hence the four commits. Accidentally I deleted wumpus-rhythm just after I added it (wanting to delete wumpus-clave) however I couldn't seem to undo the delete (resolving to theirs-full wasn't resolving to the repository). In the end I deleted the newly added files and added them again, not ideal.

wumpus-clave

Copperbox revision 1936.

I've added repeat bar lines. I think this accounts for all the functionality for djembe notation, so next I'll have to look at packaging it into a coherent library. Probably I'll need a new name as I don't think I'll be re-doing clave patterns (the library's original subject) particularly soon and the current code no longer works.

wumpus-core

Copperbox revision 1935.

I've improved the SVG code generation for ellipses and circles. Previously all ellipses and circles were output with an accompanying matrix transformation even if the matrix was essentially the identity matrix. Now only rotated or scaled ellipses have an accompanying matrix, translation can be combined into the origin.

Thursday, December 9, 2010

wumpus-clave

Copperbox revision 1934.

I've added half beams for divided notes e.g. sixteenths in 8 time (I call divided notes Halves in Wumpus-Clave).

With this added, I've now implemented most of the graphic elements used in Paul Nas's "West African Percussions" book. The remaining obvious one is to add bar lines / repeat symbols.

wumpus-clave

Copperbox revision 1933.

More work - the most substantial addition is numbered brackets for n-plet groups (n-plets are generalized tuplets).

Here's a picture:

wumpus-clave

Copperbox revision 1932.

I've refactored the code so there is a tagless class for each drum. The module organisation has also been changed.

wumpus-clave

Copperbox revision 1931.

I've added more of the missing graphic elements - hand annotations, lead-in and accent symbols, parentheses to indicate optional strokes.

Wednesday, December 8, 2010

wumpus-clave

Copperbox revision 1930.

More tidying up of the GraphicPrimitives module. Most of the sloppiest code has been removed, now only scaleByCapHeight is looking wrong. That said there is still some functionality missing such as handing instructions and n-plet bracketing.

wumpus-clave

Copperbox revision 1929.

More work improving note head construction. I've split the Djembe.Graphic module in two - one module GraphicPrimitives has the drawing construction functions, the other DjembeGraphic has the bar rendering functionality.

wumpus-clave

Copperbox revision 1928.

Some work tidying up. I can now get print something that looks like a djembe pattern from the djembe tagless DSL.

Tuesday, December 7, 2010

wumpus-clave

Copperbox revision 1927.

I've improved the counting code for beam widths. The graphic code is untouched and needs improving.

wumpus-clave

Copperbox revision 1926.

I've re-implemented the beaming code. The new version seems to work, but the counting is confusing and the code is "just-try-to-get-it-to-work" quality.

Monday, December 6, 2010

wumpus-basic

Copperbox revision 1925.

Some work on marks and dots. I've added a triangle dot and done some work on improving the "combinator hieroglyphics". There is still more work to do on the latter...

Sunday, December 5, 2010

wumpus-basic

Copperbox revision 1924.

Minor adjustments to the module hierarchy - moving SafeFonts into Drawing.Text and putting the DrawingComposition operators into the Drawing module. The hierarchy now seems adequate, so this should be the last file layout change for a while.

wumpus

Copperbox revision 1923.

Updates to Tree, Microprint and Clave to track changes to Wumpus-Basic.

wumpus-basic

Copperbox revisions 1921 and 1922.

Second half of the refactoring to the module hierarchy. Wumpus.Basic.Graphic has now become Wumpus.Basic.Kernel, which is divided into three subdirectories Base, Geometry and Objects. The "drawing objects" that were previously in GraphicTypes (Graphic, Image, LocGraphic...) are now in individual modules in Basic.Kernel.Objects.

wumpus

Copperbox revision 1920.

Updates to Tree, Microprint and Clave to track the changes to Wumpus-Basic.

Saturday, December 4, 2010

wumpus-basic

Copperbox revisions 1918 and 1919.

I've split the Wumpus-Basic hierarchy into two layers Basic and Drawing. Basic contains the core graphic types, the font loader code, and the utilities (parser combinators etc.). Drawing contains the "derived" drawing objects Dots, Arrows, LRText etc. Basic had simply become to big to work with. Note that there will be further changes as I balance things out in Basic.Graphic.

wumpus-core

Copperbox revision 1917.

I've improved the handling of null paths (paths with an empty list of path segments) and empty text labels - labels with empty string for text. Neither generate PostScript and SVG output any more. Previously they generated output that wasn't actually printed (i.e. moveto instructions but no lineto instructions), the improvement saves code size. There is also a new constructor in the Picture API to create empty paths.

Friday, December 3, 2010

wumpus-clave

Copperbox revision 1916.

More pieces are working for djembe pattern drawing, though the code is still first draft quality. I can now draw a pattern with n-plets, or swing. 

wumpus-clave

Copperbox revision 1915.

More work on djembe patterns. I'm starting to get a feel for what needs to be done, though it isn't apparent in the code yet.

Thursday, December 2, 2010

wumpus-clave

Copperbox revision 1914.

Exploratory work on a data type representation of djembe patterns. Its made complicated because I want to have two interpretations of djembe patterns - one to draw with Wumpus and one to output MIDI, but I don't want to encode every possible notehead in the data types (this wouldn't be extensible). To get extensibility, I'm currently trying to use a typecase / tagless style.

Wednesday, December 1, 2010

wumpus-clave

Copperbox revision 1913.

Preliminary work re-doing djembe percussion notation.

Tuesday, November 30, 2010

wumpus

Copperbox revision 1912.

I've added a new function vectorPath to Core to create relative paths, and removed the arity family of raise functions from Basic - their usage is replaced by Applicative's pure.

Monday, November 29, 2010

wumpus-basic

Copperbox revision 1911.

First look at systematically naming setters and queries on the DrawingContext. Setters should have short names as they are used more commonly in client code - for instance lineWidth should set the line width. As querying the line width is legitimate, there is a function getLineWidth - it's expected to be less common in client code, so it gets the longer name. Prefixing both with get- or set- seems a burden although this would be uniform.

Often queries a return a synthetic property which can't be set directly. It seems reasonable to drop the get prefix for these queries as there won't be a corresponding setter.

Sunday, November 28, 2010

wumpus-tree - new release 0.11.1

Copperbox revision 1910.

New release of wumpus-tree, InnerSpace constraints in the Draw module have been removed. They were not needed and caused problems for the GHC used by Hackage.

Note - the build-depends of Wumpus-Core and Wumpus-Basic are too specific for GHC 7.0.1, they need to be hand edited to increase the upper bounds of Containers and Time.

wumpus - new releases

Copperbox revision 1909.

New releases - improved "special character" support in Wumpus-Core. Font metrics and re-designed Graphic types in Wumpus-Basic.

wumpus-core-0.40.0
wumpus-basic-0.13.0
wumpus-microprint-0.12.0
wumpus-tree-0.11.0

wumpus

Copperbox revision 1908.

Minor updates to version numbers and cabal files before a release.

wumpus

Copperbox revision 1907.

Wumpus-Basic - I've updated the demos to remove the hard-coded font paths.

Wumpus-Tree - updated to use glyph metrics and the numeric "unit type" has been generalized from Double. Although the current examples are too trivial to show a difference, having glyph metrics for Wumpus-Tree is a big improvement - node text really demands being centered.

Saturday, November 27, 2010

wumpus-basic

Copperbox revision 1906.

Work towards removing the hard coded paths to the font resources (either the GhostScript font directory or the Adobe Core14 fonts). The LeftRightText example is done, the other examples are still to do.

wumpus-basic

Copperbox revision 1905.

I've renamed the import modules for the font loaders, and changed the top level function to be a bit more convenient to use.

Friday, November 26, 2010

wumpus-basic

Copperbox revision 1904.

I've updated the demos included in the Hackage release to compile without warnings. I'll probably make a release of the current version once I've written a "status report" for it. While Wumpus-Basic is still very rough - the latest version is probably even less polished that the previous one, though it adds a lot of new features - the Wumpus-Core version on Hackage could do with being updated.

wumpus-basic

Copperbox revision 1903.

I've fixed the bug with the substError (question-mark-inside-angle-brackets) combinator. It was over keen in replacing the whole failure continuation - it should just replace the failure message of the failure continuation, the failure continuation can have both Fail and Okay.

The AFM v4.1 parser now works for the two examples I've tried it on, though it is far from robust. The main problem is v4.1 has many modes for advance vectors and I don't know what to do about them, for the moment I only want to handle horizontal, left-to-right text.

Thursday, November 25, 2010

wumpus-basic

Copperbox revision 1902.

More work on the v4.1 parser. Unfortunately I've discovered a pervasive bug in the parser combinators - if a parser is annotated with an error message via the substError[*] combinator it cannot be used by the manyTill parser. Currently I don't know how to fix this.

[*] I can't get the name to print with Blogger - it is really question-mark-inside-angle-brackets.

wumpus-basic

Copperbox revision 1901.

First work on adding a parser for AFM 4.1 files. This commit put the modules in place, but so far the parser is just the version 2.0 parser renamed.

Wednesday, November 24, 2010

wumpus-basic

Copperbox revision 1900.

Initial refactoring of the AFM font loader code. I want to add a loader for AFM version 4.1 files - Adobe provide metrics for the Core 14 fonts in this format - so I am tidying up the version 2.0 code first.

wumpus-basic

Copperbox revision 1899.

I've removed the modules that have been superseded by the new text implementation. One of them was the Shapes.Plaintext module which hasn't been superseded yet, but I don't want it in the source tree when I make another release. I've also updated the demos to use the new text where appropriate.

wumpus-basic

Copperbox revision 1898.

I've added single line functions for bounded text - one where the point is baseline-left, the other where it is "center-center". I've updated the dots code to use the center-center version, so now dots are drawn with proper centering.

wumpus-basic

Copperbox revision 1897.

I've improved the new text implementation so it can handle empty strings without throwing a runtime error.

wumpus

Copperbox revision 1896.

The Courier metrics in Wumpus.Core.FontSize are now hidden in the Wumpus.Core shim module. They can be imported directly if need, but otherwise they "waste" good names.

I've also corrected an error in the new text handling in Wumpus-Basic where the supplied point for multi-line text was not treated as the horizontal center.

Tuesday, November 23, 2010

wumpus-basic

Copperbox revision 1895.

I've made a new implementation of left-to-right bounded text, which can be left, center or right-aligned.

The new implementation is quite rough as I had to change my mind about how to do it many times. At the moment there are some error throwing functions that shouldn't need to throw errors.

Monday, November 22, 2010

wumpus-basic

Copperbox revision 1894.

I've removed the BoundaryAnchors and LRText / LRSymbol modules.

The code from BoundaryAnchors has be put back into the DrawingComposition module. I'm not going to attempt to make code common between drawing composition and text-line alignment and composition, so the boundary anchors need not be in their own module.

LRText didn't work with the changes to Wumpus-Core. As it is due to be superseded by the current work on text handling, I won't be spending time updating it.

wumpus

Copperbox revision 1893.

Updates to Wumpus-Basic, Tree and Microprint to work with the latest changes to Wumpus-Core.

Sunday, November 21, 2010

wumpus-core

Copperbox revision 1892.

I've added new API functions to expose the new SVG attribute functionality. This should be the last addition to Wumpus-Core for quite a while, all the new functionality I had plans for has been added (except improved PS kerning output that didn't actually improve things) so I'll be going back to Wumpus-Basic.

wumpus-core

Copperbox revision 1891.

I've added initial support for attributing SVG output with other properties than hyperlinks. At the moment I haven't worked out the API, so the functionality is in place but not client-level code to use it. It should be stressed that this is only for non-graphic properties e.g. onmouseover events.

wumpus-core

Copperbox revision 1890.

I've backed out the PostScript kerning code from the last commit.

In the presence of special chars, PostScript's xshow is not as capable as the SVG equivalent, so the Haskell code was becoming very complicated and the generated PostScript was not significantly more efficient that the original.

wumpus-core

Copperbox revision 1889.

Work on optimizing the generated PostScript for hernlabel and vkernlabel. The current code is unfortunately buggy.

wumpus-core

Copperbox revision 1888.

I've added a new example TextBBox to test the revised FontSize code; I've also corrected the errors it revealed.

Saturday, November 20, 2010

wumpus-core

Copperbox revision 1887.

I've reworked the FontSize module and API so that it exports are consistent set of metrics. That is consistent with the metrics accessible in font files, the metrics it originally exposed were ones I had measured by-hand.The bounding box calculation has been changed so it adds a margin around the all sides, again this is consistent with how fonts actually work.

wumpus-core

Copperbox revision 1886.

I've changed the PrimCTM representation so it stores the origin of the primitive (center for ellipse, baseline-left for text label). The PrimEllipse and PrimLabel types have also been changed so they don't store their respective origins. This unifies the code - previously ellipse has a rotation bug that label didn't have.

I've also fixed a bug with illustrateControlPoints that crept in at the last release, whereby the primitive being illustrated didn't actually get printed only its control points.

wumpus-core

Copperbox revision 1885.

I've fixed the ellipse bug where the bounding box was wrongly calculated after a rotation (and possibly a scale). It had been in the code for quite some time - probably back to when the affine transforms on Primitives were last changed.

wumpus-core

Copperbox revision 1884.

First round of work making moving Primitives a cheap operation. This is very useful to Wumpus-Basic so it can arrange BoundedGraphics where it needs to take a bounding box but then draw the Prim somewhere else.

This work changes the internal representation of Paths to use relative path segments rather than absolute ones. With relative path segments the function to move paths can just move the start point. A second round of work will have to look at the PrimGroup Primitive constructor - currently transforming this maps the transform to all its elements, maybe it ought to "cache" transformations in a CTM.

Note - I've found a bug in calculating the bounding box of rotated ellipses, I'm not sure how long this has been around...

Friday, November 19, 2010

wumpus-basic

Copperbox revision 1883.

Work refactoring the DrawingComposition code, which was the PictureLanguage code until a few days ago.

The BoundedLocGraphic, the new underlying type for align-able text could usefully support most of the drawing composition operators - however I can't yet see how both can co-exist. I don't think the original type class formulation of the PictureLanguage operators would work as the types are trickier now, but it would be good to unify them if I can.

wumpus-basic

Copperbox revision 1882.

I've moved the Anchors module in with the main Graphic modules that are the basis for constructing drawings. I've also added anchor instances for bounding boxes - this might useful improve the DrawingComposition code which has its own aliases for functions that are essentially anchors.

Thursday, November 18, 2010

wumpus

Copperbox revision 1881.

Minor corrections to Wumpus-Core - Core.Text.Base is now exposed in the Wumpus.Core shim module.

Work towards replacing the Advance text-with-metrics prototype in Wumpus-Basic. I now have a primitive function singleLine (which will be renamed in due course) that draws a line and returns its accurate bounding box. Advance should be replaced with code that uses this primitive.

Wednesday, November 17, 2010

wumpus-core

Copperbox revision 1880.

Work updating the Guide and document in Haddock issues relating to glyph lookup and encoding vectors.

wumpus-core

Copperbox revision 1879.

I've changed the naming for Wumpus-Core's internal escaped strings to assert that they are only Escaped strings and not Encoded ones. 'Encoding' as much as it exists, happens in the rendering phase not in the construction phase.

I'm undecided as to whether it would actually be better to encode strings as well as escape them at construction time. For the moment the status quo remains, but changing might be a more logical design.

wumpus

Copperbox revision 1878.

I've added a Latin1 encoding table to Wumpus-Core and a definitions file to Wumpus-Fontkit to generate it. The Latin1 example in Wumpus-Core wasn't working correctly with the Standard encoding table as Lslash replaces egrave in the Standard encoding.

wumpus-core

Copperbox revision 1877.

I've added label building functions for pre-encoded text - previously there were only string functions that parsed then input string for escape characters then built the label. Wumpus-Basic needs versions for pre-encoded text so it can more efficiently construct labels with advance vectors without having to un-encode the text to print it.

Tuesday, November 16, 2010

wumpus-basic

Copperbox revision 1876.

The NewText demo now works with font loading. This is something of a milestone, even though a lot of the code is currently quite flaky (the Advance data types probably need a rethink).

Here is the sample printed with Helvetica:

wumpus-basic

Copperbox revision 1875.

I've integrated most of the font loader / glyph metrics code into Wumpus-Basic. The DrawingContext now has a table mapping fonts to glyph metrics and the font loader has been changed to use the modified types. Unfortunately the Advance module and the NewText example aren't working yet.

wumpus-basic

Copperbox revision 1874.

I've changed the examples so they build Drawings rather than Pictures. When I add glyph metrics to the DrawingContext there should be less to change in the examples as they are now running a pure Drawing from within main.

wumpus-basic

Copperbox revision 1873.

I've added a prototype of a new drawing object for Wumpus-Basic to use rather than directly use Wumpus-Core's Picture.

Unlike the Wumpus-Core picture type this Drawing object has a DrawingContext so it can use font metrics which are loaded at run time. Font metrics are loaded in IO, and added to DrawingContext a Drawing is then run with the DrawingContext to produce a file Picture, which is written to file in IO. The new Drawing object supports affine transformations as-per the corresponding Picture type and it also has a version of the PictureLanguage combinators.

The one main sticking point is that although a Drawing is basically an evaluated TraceDrawing it cannot use the value produced by a TraceDrawing (TraceDrawing is basically a Writer monad, so it produces two values). So far TraceDrawings have always produced (), so this isn't isn't a problem for any existing code but maybe there are useful values a TraceDrawing can produce?

Monday, November 15, 2010

wumpus-basic

Copperbox revision 1872.

File name changes - Basic.Graphic.Drawing becomes Basic.Graphic.Context function.

I still haven't worked out the new type of Drawings that represent Pictures with DrawingContext. Because TraceDrawings can produce empty lists of Primitives, Wumpus-Basic has a liftToPictureU operation (U - for unsafe) to get a Picture from a non-empty list of primitives, for pictures-in-context, I'm not sure if the picture should be wrapped with a Maybe instead.

wumpus-basic

Copperbox revision 1871.

I've renamed the Drawing functional type to CF for (C)ontext (F)unction.

If I make "pictures" in Wumpus-Basic a functional type with the DrawingContext as a supplied argument, I want a good name for them as they need distinguishing from the Picture type in Wumpus-Core.

Sunday, November 14, 2010

wumpus-basic

Copperbox revision 1870.

Some more work on font metrics integration.

The problem with IO is a bit more drastic than I previously realized, previously I made pictures like this:

dctx :: DrawingContext
dctx = fontface courier_bold $ standardContext 24

pic1 :: DPicture
pic1 = liftToPictureU $ execTraceDrawing dctx $ do
    draw $ textlineMulti ["hello", "world"] `at` zeroPt

However, to accommodate the font loader I'll no longer be able to create a DrawingContext statically as a top level binding, I'll have to acquire BaseGlyphMetrics in IO then make a context like this:

makeDctx :: BaseGlyphMetrics Double -> DrawingContext
makeDctx base_metrics =
    fontface courier_bold $ standardContext 24 base_metrics

This will also mandate a change to pic1, it will have to become a functional type taking the runtime drawing context rather than just a picture:

pic1 :: DrawingContext -> DPicture
pic1 dctx = liftToPictureU $ execTraceDrawing dctx $ do
     draw $ textlineMulti ["hello", "world"] `at` zeroPt

This probably means I'll end up changing the (Wumpus-basic) Picture type so it is a function from DrawingContext to (Wumpus-core) Picture rather than just a Picture. The thought of this does make me worry about efficiency and that Wumpus is getting too higher-order, though.

wumpus-basic

Copperbox revision 1869.

More work integrating the font loader and font metrics code.

I can now get font metrics from file in the right data structure for the new Text types. Unfortunately the data is IO when Wumpus-Basic is otherwise pure. This is rectifiable by changing the DrawingContext and its run function to have an initializable table of font metrics that can be loaded at start up.

wumpus-basic

Copperbox revision 1868.

Work towards integrating the font metrics and font loader code.

This is going to be a substantial amount of work - the NewText demo was very much a proof-of-concept, tying it in to code that actually extracts metrics from AFM2 files (GhostScript) is a lot more effort and I'm not even going to think about AFM4.1 or TrueType fonts for some time.

Saturday, November 13, 2010

wumpus-fontkit

Copperbox revision 1867.

This commit adds the code that generated the Encoding Tables in the previous commit. As Wumpus-Fontkit now seems to be "scripts" to make other parts of Wumpus its getting rather messy. In all likelihood it will stay messy for a while, there probably isn't a great benefit to tidying it up until Wumpus-Basic is satisfactory.

wumpus-core

Copperbox revision 1866.

I've now generated lookup tables for the Symbol font and the Standard Encoding. This means that the work is "done" for the Text re-implementation, I've just got to make sure it works.

wumpus-basic

Copperbox revision 1865.

I've updated the demos to work with the latest wumpus-Core. Mostly this was simply removing the now redundant "_latin1" from the writeSVG and writePS functions. The other change was regarding the SafeFonts module, when Wumpus is more stable again this module will need re-thinking - the listed safe fonts aren't really safe for SVG in their current incarnation.

Friday, November 12, 2010

wumpus-core

Copperbox revision 1864.

I've updated the demos to work with the changes to the Text modules and added a stub module for the Symbol font encoding table.

wumpus-core

Copperbox revision 1863.

I've re-worked the Text handling code.

SVG output no longer uses a TextEncoder. That it previously used a font specific TextEncoder to lookup symbol names was a design mistake, to get a Unicode code point from a PostScript glyph name it now uses a global lookup table derived from the glyph list. Where the input string encodes a special character as a code point it simply prints the code point as-is and as per the Text.XHtml package character values above ASCII 128 are encoded as code points.

PostScript still needs a encoder per-font, though most of these will be one of the encoding vectors defined in the PostScript Language Reference Manual. At some point I will have to generate lookup tables for these encoding vectors, though Wumpus-Core already has a fall-back lookup table derived from the glyph list. The fall-back lookup is slightly problematic as the some of the entries in the glyph list share the same name (e.g. ncedilla and ncommaaccent). Here the glyph names "mean" the same character but they correspond to different renderings of it and fonts will support one or the other, so it is possible that the lookup might not find the correct character.

Thursday, November 11, 2010

wumpus-fontkit

Copperbox revision 1862.

I've added another generator to make a module / table that maps from PostScript glyph name to Unicode code point.

wumpus-fontkit

Copperbox revision 1861.

I've added a script to generate a Haskell module implementing a PostScript glyph name lookup from the Adobe glyphlist file. This will probably be the basis of Wumpus-Core's glyph name resolution when I redo it (its currently faulty).

Wednesday, November 10, 2010

wumpus-fontkit

Copperbox revision 1860.

I've updated the AFM parser in Wumpus-Fontkit to use the parser combinators in Basic. Also I've added a parser for the Adobe glyphlist file. This matches PostScript glyph names to Unicode code points - I think this would be a better basis for Wumpus-Core's extended glyph handling than the current Encoders.

Tuesday, November 9, 2010

wumpus-basic

Copperbox revision 1859.

More work on glyph metrics - some tidying of the AFM parser and changing lookup tables to be IntMaps.

wumpus-basic

Copperbox revision 1858.

I've decided to put Font Loader capabilities in wumpus-basic rather than require an "independent dependency" on wumpus-fontkit (clients would depend on both, but wumpus-basic need not depend on wumpus-fontkit).

Also I've worked out a new way of white-space handling for token parsers, so I've put the parser combinators into Wumpus.Basic.Utils.

Monday, November 8, 2010

wumpus-basic

Copperbox revision 1857.

I've now a working proof-of-concept attempt at using font metrics to center and right-align text:



I don't use a font loader yet and the code is horrible, but overall this is quite a milestone. I first looked at the "innards" of fonts for the OpenVG binding, this is the first real success.

wumpus status

Wumpus status - 8 November 2010

Wumpus-Core
Wumpus-Core is now at version 0.37.0 on Hackage. The drawing model in Wumpus-Core is comparatively mature - the Picture API tends to get tweaked every release but the tweaks are mostly minor. Now that Primitives can be combined as Primitives rather than needing a promotion to Picture the design is satisfactory.

Adding free annotations for SVG would be useful, so SVG output can support mouseover hints. This should be doable with a new function in Core.Picture working like the xlink function. Otherwise no changes to the Picture API are currently envisaged.

It would be nice if the PostScript output was more efficient for the hkernlabel and vkernlabel functions. PostScript Level 2 has the xshow and yshow operators which appear to support this efficiently. Wumpus-Core could support two printing modes for Level 1 or Level 2 output but this is not currently a priority.

The Text Encoding API has not changed very much recently, however it should be considered unstable. Its limitations are due to the authors own limited understanding of how PostScript encodes character names and codes (fonts != Unicode). Work on direct font support in Wumpus-Basic should improve Wumpus-Core, (e.g. the Encoding table types can be refined, other Encoding Vectors can be added) whilst Wumpus-Core should be able to maintain its font agnostic status.

Edit 9 Nov - I've identified an unfortunate oversight in the SVG handling of Encoding tables which will be corrected as I work on glyph metrics. In a nutshell, the SVG renderer should not use the Encoding tables as they are only really pertinent to PostScript.

Wumpus-Basic
Wumpus-Basic is at version 0.12.0 on Hackage. The SVN repository has already changed significantly from this version as the Basic.Graphic modules have been substantially re-worked. I have no plans to update the version on Hackage until progress has been made on glyph metrics and the Basic.Text modules. The previous attempts at text handling without glyph metrics - Basic.Text.LRText and Basic.Shapes.Plaintext - are considered obsolete though they won't be removed from the code base until they have a functioning replacement.

Wumpus-Basic should always support simple text through functions in the Basic.Graphics modules. Working with glyph metrics will add complexity to text drawing and make it less efficient so a path to avoid the penalities when not necessary for drawing is essential. Glyph metrics will also mandate than font loading has to be IO, though this should not IO-contaminate the rest of Wumpus-Basic.

Much of the work for handling glyph metrics will be farmed out to the Wumpus-Fontkit package. Reading text (AFM) and binary (TrueType) font files will need dependencies that I don't want to burden Wumpus-Basic with. Wumpus-Basic will define the tpes it needs and the table look up functions. Wumpus-Fontkit will build the metrics tables. Also I anticipate having to equip Wumpus-Fontkit with a quite a lot of code to introspect into font files - adding font loading support to Wumpus will open up many avenues for errors so giving users tools to investigate errors for themselves seems wise.

The new combinator basis in Basic.Graphic for building graphics is not yet systematically elsewhere in Wumpus-Basic. Overtime I will have to improve the code for Shapes, arrowheads etc. so that the source is more exemplary. Shapes themselves need work adding more shapes.There is also a lot of work to be done on designs in Wumpus-Basic as all the good examples so far e.g. the Petri-net and the Feature diagram use explicit coordinates.


Wumpus-Tree
Wumpus-Tree is at version 0.10.0 on Hackage. Wumpus-Tree has not had much attention since its initial release except to make sure it is compatible with the latest versions of Wumpus-Core and Wumpus-Basic. This is largely due to the deficiencies of text handling in Wumpus-Basic - for text labelled trees having left-aligned text is unwelcome. I intend to improve Wumpus-Tree once better text support is present in Wumpus-Basic.


Wumpus-Microprint
Wumpus-Microprint is at version 0.11.0 on Hackage. Microprint is rather underwhelming - unlike Wumpus-Tree it is not a particularly good subject to drive development of Wumpus-Basic as the graphic work is quite secondary to the input tokenizing. I will keep bumping the version on Hackage when Wumpus-Basic gets a release but unfortunately I don't anticipate doing any work to improve its capabilities. Unless it finds a compelling use my time is better spent working on Wumpus-Basic.


Poor Small Chart
Not released on Hackage. Charting is well served by other libraries, so it is a niche I don't see Wumpus occupying. As with Wumpus-Microprint the subject requires significant work that is not directly graphical (successful chart libraries appear to do a lot of automatic work interpreting the data for scaling ranges etc.). It would be nice to improve charting as there are still useful graphics to be manufactured, but I don't see it as a priority that will be worked on any time soon.

new release - wumpus-core-0.37.0

Copperbox revision 1856.

I've made a new release of wumpus-core - version 0.37.0.

I'm not going to make a twinned release of wumpus-basic as its design is in flux at the moment, however I don't want the Hackage release of wumpus-core to be too far behind the SVN repository.

Sunday, November 7, 2010

wumpus-basic

Copperbox revision 1855.

Alignment is now working for the horizontal, left-to-right versions of the new Text combinators. Hopefully the underlying mechanism is general enough that I'll be able to define similar combinators for right to left and vertical text. The main work is still to extract font metrics...

wumpus-basic

Copperbox revision 1854.

More work on the new text implementation, which is a actually a complete re-write of the last design. This current one has different types for single and multi-line text. I've worked it up to a demo (avoiding actual characters at the moment) but right alignment is currently not correct.

wumpus-basic

Copperbox revision 1853.

Work on a new implementation of Text using advance vectors. The new version should support right and center alignment and eventually right-to-left and vertical text. It will need metrics from font files - though I'll work with AFM files to begin with as they are simple.

Saturday, November 6, 2010

wumpus

Copperbox revision 1852.

Changes to both Wumpus-Basic and Wumpus-Fontkit to account for the AfmUnit datatype moving from Core to Basic.Also I'm starting work on replacing LRText with something that works with the bounding boxes and advance vectors in font files.

Bounding boxes and advance vectors are quite visible in AFM files, in OpenType files the htmx table has advance vectors and the glyf table has character bounding boxes. My old project ZFont can already access these tables but it is very rough and I never worked out the relation between glyphs and there indices in OpenType / TrueType files. For a while I can limit the scope to AFM and the core PostScript font files.

Friday, November 5, 2010

wumpus-basic

Copperbox revision 1851.

Updates to work with the changes to Wumpus-Core.

wumpus-core

Copperbox revision 1850.

I've renamed the constructors in the BoundingBox module. The original names were a bit terse and the would seem more useful for variable names than function names.

wumpus-core

Copperbox revisions 1848 & 1849.

I've swapped the internal OneList for a JoinList. This should allow more efficient concatenation of Pictures and Primitives, though I haven't yet extended the Picture API with functions for this.

In revision 1848 I missed adding some of the changes.

wumpus-core

Copperbox revision 1847.

I've shifted the "font delta' SVG optimization into the Primitive type from the Picture type. As Wumpus-Basic at least builds with Primitives much more than Pictures this should give some room to use the optimization more often.

I still haven't looked at improving the concatenation of Primitives - this will mean replacing the OneList with a JoinList. Fortunately I have a JoinList ready made.

wumpus-core

Copperbox revision 1846.

First work on improving the concatenation of Primitives. I've changed the Primitive tree shape so SVG hyper link annotations are independent of grouping.

Also I've removed the AfmUnit type that I recently added, this type will be put in Wumpus-Basic.

Thursday, November 4, 2010

wumpus-fontkit

Copperbox revision 1845.

More work towards extracting font metrics for the Core13[*] PostScript fonts. I'm now making a HTML report as the SVG renderer in Chrome doesn't support scrolling it seems.

[*] Note - I don't know whether there should be 13 or 14 (14 would include Dingbats). I've only seen the expression "core 14", but lists of assumed fonts often don't mention Dingbats. Wumpus-Basic has always had 13.

Wednesday, November 3, 2010

wumpus-basic

Copperbox revision 1844.

I've added an example "iterated" drawing. Iterated drawings pass the current point to the next drawing rather than always taking a fresh point via a supplied argument.

wumpus-basic

Copperbox revision 1843.

I've documented the Drawing combinators. Only cardinalprime is now sticking out like the proverbial sore thumb.

Tuesday, November 2, 2010

wumpus-basic

Copperbox revision 1842.

I've dropped the R suffix from the DrawingR functional type and renamed and split several modules in Basic.Graphic. Hopefully this should be the last substantial refactoring of these modules.

wumpus-basic

Copperbox revision 1841.

I've renamed the Drawing monad TraceDrawing. I want to signal that it is a bit less primary than a DrawingR, which might soon drop the suffix R itself.

wumpus-basic

Copperbox revision 1840.

I've updated the demos to work with the new DrawingR types. There are some quirks, such as Shapes can no longer be placed with `at`. Also there is a lot of code that heavily uses the Applicative and Monad operations, the idea is that they should use the new combinators instead, probably aliasing them for descriptive domain-specific naming.

wumpus-basic

Copperbox revision 1839.

All the library code compiles again following the changes to the DrawingR types. Some of the demos haven't been update yet, so this means that there's quite a bit of the revised code in the library modules is untested.

Monday, November 1, 2010

wumpus-basic

Copperbox revision 1838.

More work converting the Basic modules to use the new Drawing types. I've updated all the dots and most of the arrow tips, and I'm also getting a better feel for the combinator vocabulary though it still needs improvement.

Sunday, October 31, 2010

wumpus-basic

Copperbox revision 1837.

I'm reworking the Graphic.Base types so that the functionals are "inside" the DrawingR newtype.

Previously I had:

> type LocGraphic u = Point2 u -> DrawingR (PrimGraphic u)

Now I have

> type LocGraphic u = DrawingR (Point2 u -> PrimGraphic u)

I'm hypothesizing that this change will generally make the code more uniform, however it is only a hypothesis. As far as I can tell, Conal Elliott's Vertigo used this second form (though it avoided wrapping functionals with newtypes).

Quite a lot of code is currently broken and there is quite a lot of old code in Graphic.Base that will need removing when I have everything working again.

Friday, October 29, 2010

wumpus-basic

Copperbox revision 1836.

I've added a new type provisionally called VecGraphic to Basic.Graphic.Base.

VecGraphic models graphics that take an initial point and return a new end point as well as drawing themselves. This is how text works in PostScript - drawing text takes the implicit current point (usually initialized with moveto) draws the text and adds the width vector of the text to the current point.

Unfortunately for Wumpus whilst this is a useful graphic type, Basic.Graphic.Base is becoming very ad-hoc with lots of similar but special purpose types. It would be nice if they were unified somewhat.

Thursday, October 28, 2010

wumpus-fontkit

Copperbox revision 1835.

Initial work on a demo to print tables for the "Core 14" PostScript fonts.

A note to self - Wumpus-Basic provides almost no help in generating tables except for the chains which still remain primitive. This area really needs improving, considerably.

Wednesday, October 27, 2010

wumpus

Copperbox revision 1833.

Updated the parser and data types to use AfmUnit, an new type added to Wumpus-Core.


Copperbox revision 1834.

Added a new type AfmUnit to the PtSise module. AfmUnit represents the measurement units in AFM files.

wumpus-fontkit

Copperbox revision 1832

More work on the parser it now extracts character metrics, which is its purpose.

Note - Subversion said this commit failed, but it seems to have reached the server and been accepted.

Tuesday, October 26, 2010

wumpus

Copperbox revisions 1830 & 1831.

I've deleted wumpus-fresh (revision 1830) and wumpus-shapes (revision 1831).

Wumpus-fresh was rolled into Wumpus-core quite a while ago. Wumpus-shapes has been incorporated into Wumpus-basic.

wumpus-fontkit

Copperbox revisions 1828 and 1829.

Toy-Font-Metrics is now called Wumpus-Fontkit.

The parser in Toy-Font-Metrics was looking quite flaky due to AFM files being very liberal and allowing user defined fields. So, instead of trying to make a general parser with a general syntax tree, I'm now making one just good enough for Wumpus and I've moved the code in with the Wumpus packages.

toy-font-metrics

Copperbox revision 1827.

More work on the parser...

I've specialized the current parser to only work for v2.0 AFM format files. This is the format used by GhostScript. A one size fits all parser will be quite tricky - there are quite big differences between v2.0 and v3.0, and more differences again to v4.1 which appears to be the current revision. In fact the current parser is severely limited as AFM files can have user defined fields, so I think I'll have to make a much laxer parser that puts name-value pairs into a finite map rather than builds a syntax tree.

toy-font-metrics

Copperbox revision 1826.

More work on the parser. Some information can now be extracted from AFM files - AFM version number and the font names.

Monday, October 25, 2010

toy-font-metrics

Copperbox revision 1825.

I've added decent white-space handling courtesy of cut down versions of Parsec's LanguageDef and TokenParser modules / datatypes. Credit and thanks to Daan Leijen - Parsec is a truly exceptional library particularly in the details like the tokenizer / white-space handling and the expression table parser. Its a pity that white-space isn't configurable in the LanguageDef so I could make line oriented parsers (whiteSpace chomps newlines).

toy-font-metrics

Copperbox revision 1824.

Work on the parser combinators...

Because the format of AFM files is simple and I don't want a dependency on Parsec (and have to choose 2.1 or 3.0) TFM now has its own hand-crafted parser combinators.

Sunday, October 24, 2010

toy-font-metrics

Copperbox revision 1823.

I've started a new project to extract metrics from AFM files. These are the font metrics files that accompany PostScript (Type 1) fonts and are used by still used by GhostScript. All code is very preliminary, little more than stub modules.

Wumpus really needs better font handling, so I've decided to start with AFM files - even though they are rather antiquated, they are a lot simpler than TrueType fonts. At some point Wumpus-Basic will incorporate the work in toy-font-metrics, Wumpus-Core just renders what it is given so it can remain in happy ignorance of font metrics.

wumpus-basic

Copperbox revision 1822.

More work on the Plaintext shape. Multi-line text now seems to work properly under rotation.

Saturday, October 23, 2010

wumpus-basic

Copperbox revision 1821.

Preliminary work implementing multi-line support. Rotation does not work properly for this revision so it will have to be substantially revised, however it merits check-pointing.

A previous version of  Wumpus-Basic had multi-line support but that was too complicated as it tried to simulate right and center alignment. Still there should be code in that revision to fix the problems in this one.

wumpus-basic

Copperbox revision 1820.

I've added margins to Plaintext. This allows visually better anchor positions. 

Friday, October 22, 2010

wumpus-basic

Copperbox revision 1819.

First work updating Plaintext so that it is more like the current shape types. More work needs to be done to accommodate multi-line text.

Thursday, October 21, 2010

wumpus-basic

Copperbox revision 1818.

I've reworked the Coordinate object into a form I think I'm happy with. It now seems operationally close enough to the Shape types (and different to the marks) to make it useful.

wumpus-basic

Copperbox revision 1817.

Initial work on a feature model example. Unfortunately I'm not sure how to do the good bits yet - i.e. decorate groups of connectors with arcs for alternative and or and add repetition labels.

wumpus - new releases

Copperbox revision 1815.

Updates to get Wumpus-Microprint and Wumpus-Tree working with the current Wumpus-Basic.

Copperbox revision 1816.

New release archives for Hackage:
wumpus-basic-0.12.0
wumpus-microprint-0.11.0
wumpus-tree-0.10.0

wumpus-basic

Copperbox revision 1814.

I've implemented radial anchors for diamond.

Wednesday, October 20, 2010

wumpus-basic

Copperbox revision 1813.

I've reworked the internals of the Shape modules as a prelude to adding more shapes. How shapes work with the ShapeCTM has been made more uniform.

wumpus-basic

Copperbox revision 1812.

I've added two new curved arrowheads. The new curved arrowhead draws particularly nicely. The other one is its reverse, which was easy to implement but is less obviously nice.

wumpus-basic

Copperbox revision 1811.

I've moved the control point manufacturing functions out from Paths.Connectors into their own module Paths.ControlPoints so they can be reused elsewhere. Doing so also revealed quite a bit of code duplication in Paths.Connectors.

Tuesday, October 19, 2010

wumpus-basic

Copperbox revision 1810.

More work on connector paths, including a new example which should have been added in the last commit.

wumpus-basic

Copperbox revision 1809.

More arrowheads including reverse triangles and barbs and disks, squares and diamonds.
Also I've started making the Path connectors more systematic.

Monday, October 18, 2010

wumpus-basic

Copperbox revision 1808.

I've made the arrow connector drawing function straight-forwardly monadic again.

Previous I had some rather exotic types for transformations roughly: m (a -> a) but now I'm using simpler types along the lines of m a -> m a.

The new code is perhaps a bit uglier as it uses bind directly, but at least it is now comprehensible.

wumpus-basic

Copperbox revision 1807.

Some preliminary work on re-doing Shapes.

Shapes constructors are now functions from Point -> Shape, so this makes the API more consistent with the rest of Wumpus-Basic. It also means that shapes will have to be made instances of the Affine classes which will add some boiler plate.

wumpus-basic

Copperbox revision 1806.

Work tidying arrowheads. I've removed the DirectionContext reader monad - as the clarity of the arrowhead code has improved generally, DirectionContext was no longer adding anything and the fully pointed code that replaces its use-sites looks better.

Sunday, October 17, 2010

wumpus-basic

Copperbox revision 1805.

More work on arrowheads - I've made a new demo drawing to print all the tip styles and corrected some bugs in a couple of code paths that previously hadn't been exercised.

wumpus-basic

Copperbox revision 1804.

Work re-doing marks with the bindR combinator and its variants bindAsk and bindInto. The work seems promising but I'll have to look at other graphics elements such as Shapes before I can say whether or not it is a success.

Saturday, October 16, 2010

wumpus-basic

Copperbox revision 1803.

Some preliminary re-working of AnchorDots and Marks. I've moved and renamed the file Basic.Dots to Basic.Dots.AnchorDots and renamed the file Basic.Dots.Primitive to Basic.Dots.Marks. Marks are dots without anchors, AnchorDots are obviously dots with anchors.

I'm getting more of an idea about what I'm actually doing. As I'm trying to reduce the use of monadic operations in the code, I'm finding that a lot of the operations I'm replacing them with are similar to the regular applicative and monadic composition functions but they have more "static arguments". For the function instance Monad and Applicative work on a single "static argument" - synonymous to the Reader monad. I'm often working with two or more static arguments - the drawing context occupies the first so Applicative and Monad work directly here, but when I have LocGraphics there are two static arguments the drawing context and the start point. Similarly ThetaLocGraphic has three static arguments - the drawing context, the start point and the angle of displacement that the arrow head or whatever is drawn at.

Friday, October 15, 2010

wumpus-basic

Copperbox revision 1802.

I've reworked Arrowheads so they are now newtype wrapped ThetaLocGraphics - functions from Angle -> Point -> Graphic.

The arrow code seems quite pleasant now, though I'm still largely stumped for ideas on how to improve shapes...

wumpus-basic

Copperbox revision 1801.

The previous revision didn't retract the tip of the line underneath the arrowhead. Not doing so spoils the vee of the triangular arrowheads. This revision fixes the problem and tidies up the code.

wumpus-basic

Copperbox revision 1800.

Work on composing operations on the Image and Graphic types.

The code is very sketchy and I'm not quite sure what I've done, or how it works yet. I seem to have got normal functional application "back" by wrapping applicative functors in special applyTransformer functions. The new version of strokeConnector - the arrow building function is much less convoluted (and it can be simplified even more), but the machinery to make it is quite weird - lots of applicative operations and pairing functions.

Thursday, October 14, 2010

wumpus-basic

Copperbox revision 1799.

Changes to the types in Basic.Graphic.Base. As Wumpus-Core now supports grouping Primitives, Wumpus-Basic doesn't have to rely on using Hughes lists to manufacture multi-primitive Graphics, though it still uses Hughes lists for the Writer-like Trace monad.

Wednesday, October 13, 2010

new release - wumpus-core-0.36.0

Copperbox revision 1798.

I've updated the user guide and made a new release archive for Hackage:

wumpus-core-0.36.0

wumpus-core

Copperbox revision 1797.

A round of Haddock comments. I've covered all the exposed modules except the Text Encoder modules.

wumpus-core

Copperbox revision 1796.

I've updated the user guide to account for the changes to transformations on Primitives and the removal of PrimElement.

wumpus-core

Copperbox revision 1795.

I've updated all the demos to refer to Primitive rather than PrimElement and to use the transform classes rather than the removed functions - rotatePrim, scalePrim etc.

Tuesday, October 12, 2010

wumpus-core

Copperbox revision 1794.

Major change.

I've removed the PrimElement data type making the syntax tree shallower and more efficient. The grouping constructor that PrimElement provided is now added to Primitive as PGroup. Its a shame I added PrimElement in the first place, but my thinking was clouded by not wanting to make Primitive a tree (and thus not really living up to its name). Adding PrimElement caused an inefficiency even when SVG hyperlinks weren't used - so its removal is beneficial.

I haven't changed all the examples yet and there are code comments and the user revise, but the few examples tested so far work and the changes were surprisingly trivial.

wumpus-core

Copperbox revision 1793.

I've added some more examples that test whether primitives transform correctly - it looks as though the do, so its a pity I wasted so much thought confusing myself over whether primitives can transform or not.

wumpus-core

Copperbox revision 1792.

More work on transforming primitives - I've now added instances of the Affine classes for Primitives again.

Previously I saw this as controversial and removed the instances, however now I'm happy that if the code actually works (not properly tested yet), then having instances of these classes is valid, modulo the caveat that the stroke width of lines won't be scaled and possibly other minor distinctions.

wumpus-core

Copperbox revision 1791.

Initial work on changing the transformations on Primitives.

Previously primitives had rather "special" interpretations of transformation - rotations on ellipses or text labels were about their respective origins (center for ellipse, baseline-left for text). There was reasoning behind this Primitives weren't considered to be in an Affine space and it was important to have angled text - say if you want to create a graph where the baseline are all angled at 45deg you would want to rotate all labels individually about their center. However, now that I've written more code this has begun to seem naive, a better strategy is to have constructors for angled versions of ellipses and text labels and make rotation follow the standard affine interpretation.

In this revision, I've put in the new constructors for angled labels and ellipses and have changed the rotation behaviour of primitives, these changes are easy - most of the work is going to be creating examples to show that the new behaviour works as intended.

Monday, October 11, 2010

wumpus-core

Copperbox revision 1788?

The latest commit "failed" on transmission but seems to have shown up anyway but the new file Core.GraphicProps seems in limbo, so I'm a bit stumped...

Copperbox revision 1789.

I've committed a trivial change to another file which has worked...

Copperbox revision 1790.

I decided to check out a new copy of Copperbox to start afresh. This commit just changed some of white space to make sure Core.GraphicProps is in the repository and can be modified - it is in the repository and it can be modified!

wumpus-core

Copperbox revisions 1787 and 1786.

I've removed the dependency on the algebra package (for the Semigroup class, providing append). BoundingBox exports the equivalent function boundaryUnion.

wumpus-core

Copperbox revision 1784.

I've moved the utility modules into their own directory. Ideally I'd like to move more modules out of the Wumpus.Core top-level - there are still 22 modules here - but this would mean modules further down in the hierarchy would have to depend on ones higher up. There is some scope for moving the Text Encoder modules into their own directory as they have no dependencies on the Graphic types.

Update! - Copperbox revision 1785.

I've moved the Text modules into their own directory. There are now 17 modules in the top level directory which is more manageable.

wumpus-core

Copperbox revision 1781.

I've made PrimCTM its own module. This is a prelude before I start on reworking transformations on Primitives.

Update! - Copperbox revisions 1782 and 1783.

I've changed the name of PrimCTM.hs to TrafoInternal.hs and added the AffineTrans data type to it.

new release: wumpus-basic

Copperbox revision 1780.

I've reverted the changes to Shapes.Plain and made a new release of just wumpus-basic - revision 0.11.0.

I think I'll have to rework the transformations on primitives in Wumpus-Core before I can improve Shapes in Wumpus-Basic, so as a lot has changed in Wumpus-Basic since version 0.10.0 an interim release seems like a good idea. Wumpus-Microprint and Wumpus-Tree work with Basic version 0.11.0 only the .cabal file needs a version bump, so I am not making new-release of those two.

Sunday, October 10, 2010

wumpus-basic

Copperbox revision 1779.

I've changed Plaintext to accommodate multi-line text, however, the changes cause a lot of problems. The type of Plaintext changes as it must access the drawing context for font-size and this stops (pseudo-)affine transformations working on it.

"Must access the drawing context" is not strictly true - with more careful coding I could probably avoid reading the drawing context until Plaintext is drawn. That said, the current code at least flags up problems I'll have to do some thinking about: what objects should support the pseudo affine transformations and how should I use lifters? Currently all drawing uses the lifters draw and drawi extensively, maybe this is not opportune.

Saturday, October 9, 2010

wumpus-basic

Copperbox revision 1778.

I've updated the demos to work with the changes to the Path data type.

wumpus-basic

Copperbox revision 1777.

I've changed the Path data type to disallow empty paths. This makes the API much more pleasant as quite a lot of functions operating on paths can changed from partial functions (using the Maybe type) to total functions.

Friday, October 8, 2010

wumpus-basic

Copperbox revision 1776.

I've reworked the Arrow01.hs demo so it actually draws something worthwhile...

wumpus-basic

Copperbox revision 1775.

I've renamed the safe fonts to use underscore for the word separator rather than use camelCase. Generally constants in Wumpus use underscore - the safe fonts used to be functions, but they have been constants for a while.

wumpus-basic

Copperbox revision 1774.

I've removed the old code in the Arrows module and changed all the arrowhead constructors to make elements of the new type Arrowhead.

The Petri net example has been updated to use the new code, other examples might be broken at the moment...

Thursday, October 7, 2010

wumpus-basic

Copperbox revision 1773.

I've reimplemented connectors so that arrowheads are configurable - previously every (right) arrowhead had its own path function and there weren't any left arrows (!). I haven't yet removed the old code or migrated the demos, that will have to wait until tomorrow.

wumpus-basic

Copperbox revision 1772.

I've renamed the ConnImage type to ConnectorImage, likewise other types and that had a Conn- prefix now have a Connector- prefix. This is a prelude to reworking the arrowhead types. 

wumpus-basic

Copperbox revision 1771.

I've replaced FreeLabel with a new element Plaintext. Plaintext isn't a Shape as it doesn't generate a path, but it does have some Shape-like properties - it can be rotated and translated, and it generates anchor points.

The down side to these changes to Shape and the introduction of the new Plaintext type is that labelling shapes is now more complicated, I'll have to look into a plumbing function to see if I can make Shapes and Plaintext labels in the same expression.Also, at some point Plaintext should be extended to handle multi-line text.

wumpus-basic

Copperbox revision 1770.

I've reworked Shapes to support rounded corners for appropriate shapes - rectangle, diamond... This has forced changes to the Shape types and as a consequence FreeLabel no longer works and is currently removed. Also Coordinate (which is just a filled disk not a path) has been made a different type with its own drawing function.

Wednesday, October 6, 2010

wumpus - new releases

Copperbox revision 1769.

New releases for the Wumpus libraries.

Wumpus-Core gets a fix for the PostScript stroke attribute separator bug and updates to the user guide which was a bit off the pace. 

The changes to Wumpus-Basic an the main reasons for the new releases. As the organization of Basic.Graphic has changed quite a lot I'm making a release now rather than have a huge change when I actually add some new functionality.

The updates to Wumpus-Tree and Wumpus-Microprint just track changes to Wumpus-Basic.

wumpus-core-0.35.0
wumpus-basic-0.10.0
wumpus-microprint-0.10.0
wumpus-tree-0.9.0

wumpus-core

Copperbox revision 1768.

I've updated the user guide...

I'd quite like to make a release with the stroke attribute separator bug fix, but as that was only a one character change it would be fitting to add some more improvements.

wumpus

Copperbox revision 1767.

Wumpus-Tree and Wumpus-Microprint have been updated to work with the latest Wumpus-Basic.

Also I've changed the portability tag line in numerous source files to "GHC".

Tuesday, October 5, 2010

wumpus-basic

Copperbox revision 1766.

I've worked through the demos and they should all run now.

Also, I've done some tidying up of Basic.Graphic removing the functions localLG and lgappend. They can be recreated with Applicative notation slightly more verbosely, so not having them as functions is something of a loss, however, I felt they were adding more "concepts" to the Graphic.Base API so that swung the balance in favour of removing them.

wumpus-basic

Copperbox revision 1765.

I've merged the modules Basic.Graphic.BaseClasses and Basic.Graphic.BaseTypes into one module Basic.Graphic.Base. This is so DrawingR can be a instance of DrawingCtxM without having to be an orphan (previously BaseClasses depended on BaseTypes).

Also, I've renamed the methods in DrawingCtxM and removed the non-overloaded functions pureDF, askDF etc. This has percolated a lot of changes through the code. Again not all the demos have been updated yet.

wumpus-basic

Copperbox revision 1764.

In DrawingContext, I've renamed the field labels primary_colour to stroke_colour and secondary_colour to fill_colour. Also I've renamed the setters accordingly, though not all examples have been tested yet so some might fail.

wumpus-basic

Copperbox revision 1763.

I've added a DirectionContext monad - this is a reader monad with line direction as the context. Its intended to make creating paths easier when the path needs displacing by a line angle. For instance, arrow tips are easy to think about if drawn on a left-to-right horizontal line, its more complicated to think about them on a line of some parametric angular direction. DirectionContext abstracts the direction and provides two morphisms perpendicular and parallel that are analogous to the vector constructors vvec and hvec.

wumpus-basic

Copperbox revision 1762.

Work on arrow tips - mostly recoding how to make triangles whilst regarding line angle. I had forgotten how the original code I wrote for this worked.

Monday, October 4, 2010

wumpus-core

Copperbox revision 1761.

Wumpus-Core bug fix...

wumpus-core-0.34.0 has a bug in the PostScript output code. In the file OutputPostScript, line 464 uses *hcat* - this should be *vcat*. If more than one stroke property changes invalid PostScript will be generated. As this is a single character bug, I will update the Hackage distribution only when I have some other changes/fixes.

wumpus-basic

Copperbox revision 1760.

Initial work on round cornered paths. The new function roundEvery can be used to draw round cornered polygons when supplied with a list of the vertex points.

Sunday, October 3, 2010

wumpus-basic

Copperbox revision 1759.

I've reworked the implementation of connectors so they build Paths directly rather than use the PathM monad. There are a few simple connectors, when I add more connectors I'll have to work out a naming scheme. Also there might be a need to compose connectors which isn't addressed at the moment.

wumpus-basic

Copperbox revision 1758.

Paths.Connectors compiles again, however it is due to be reworked substantially.

wumpus-basic

Copperbox revision 1757.

First round of work re-doing paths...

The base data types now have an explicit representation of the empty path and they cache the start and end points as well as the length.

Constructing paths via a monad turns out to be good. I'd been wanting to get rid of the PathM monad but monadic construction handles the path start point nicely - the run function supplies the start point. Without the start point being abstracted, snoc-ing doesn't have good semantics - for instance, the hline combinator cannot work on the empty path because it has no Y-position to take.


I haven't looked at the Connectors module yet, and as the the base types have changed it is currently broken. Connectors seem quite different to paths as the start and end points are known from the start (monadic paths only 'know' the start point).

Saturday, October 2, 2010

wumpus - new releases

Copperbox revision 1756.

New releases for Hackage:

wumpus-core-0.34.0
wumpus-basic-0.9.0
wumpus-microprint-0.9.0
wumpus-tree-0.8.0

wumpus-basic

Copperbox revision 1755.

Updates to three of the examples that had stopped compiling due to changes with chains.

wumpus-core

Copperbox revision 1754.

A round of haddock doc improvements.

I'm going to make a release over the weekend, and some of the documentation in Wumpus-Core was getting out of date.

Friday, October 1, 2010

wumpus

I've been without internet access for a few days, so while I've still been working on Wumpus there's been a gap where I haven't made any commits. I've now committed all the new code:

Copperbox revision 1749 - Wumpus-Basic
Added ScalingContext to Basic.Graphic for drawings such as Trees or Turtle drawings that work with some coordinate space (e.g. integer coordinates for turtle) that gets scaled to Drawing coordinates.

Copperbox revision 1750 - Wumpus-Tree
Added a new drawing style for "family trees" - here the connector is drawn as a horizontal line with vertical ticks to the parent and child nodes.

Copperbox revisions 1751 & 1752 - Wumpus-Microprint
Changed the capitalization of the module hierarchy to use a lower 'p' for Microprint, so the first commit deleted the old source modules, the second commit adds the old ones back plus a new module for tokenizing input. This new tokenizer is preferred over the previous teletype style.

Copperbox revision 1753 - Poor Small Chart
Changes to the Sparkline implementation. The new implementation is closer to the latest drawing style supported by Wumpus-Basic, but it is not strictly an improvement as the new types are too complicated. Chart drawing needs a substantial rethink.

Sunday, September 26, 2010

wumpus-basic

Copperbox revision 1748.

I've changed LRText - the monad is now called LRText rather than TextM and the run functions run it as a LocGraphic rather than run it in the Drawing monad.

Running as a LocGraphic is a bit more flexible that running in the Drawing monad. It also puts it at the same level in the "monad hierarchy" as textline - which seems correct.

wumpus-core

Copperbox revision 1747.

I've rewritten the text label escape character lexer -it can now handle hexadecimal and octal character codes. It also had a limitation where it only worked for alphabetic names, but some symbol names require alpha-numeric names (e.g. "phi1" in the Symbol font table). This limitation has been fixed.

wumpus-basic

Copperbox revision 1746.

Work on an example commuting diagram. Wumpus will never compete with TikZ / PGF or XY-Pic as it cannot support TeX's mathematical formula typesetting, though the result so far is passable and the intention is to discover immediate weak spots in Wumpus rather than generate beautiful graphics.

Saturday, September 25, 2010

wumpus-basic

Copperbox revision 1745.

I've implemented an example petri net. The code is quite crude as I'm using absolute positions but the drawing is quite good - very close to the original source in Claus Reinke's Haskell-Coloured Petri Nets paper.

wumpus-basic

Copperbox revision 1744.

Now that shapes are working, I'm looking at connectors and paths again.This is the first round of work as I try to draw a petri net.

wumpus-basic

Copperbox revision 1743.

The shapes (except coordinate) now support labels. Unlike original code in Wumpus-Shapes, supporting labels is just a matter of adding another constructor which supplies and adaptor to the drawing function that draws the label. No label is stored in the datatypes so adding variants for LRText or multi-line text is straight-forward and doesn't need to change the underlying code.

Friday, September 24, 2010

wumpus-basic

Copperbox revision 1742.

I've added diamond, coordinate and ellipse- so now Wumpus-Basic has all the shapes from Wumpus-Shapes, though a lot of the anchor points aren't yet implemented. Also I haven't looked at text labels yet either, but the new Shape type should be an improvement here.

wumpus-basic

Copperbox revision 1741.

I've started re-implementing Shapes inside Wumpus-Basic. The new Shape datatype looks like a good improvement over Wumpus-Shapes - one type represents all shapes until they are drawn, then a specific type is created as an Image supporting anchors pertinent to the specific shape.

wumpus-shapes

Copperbox revision 1740.

I've updated Shapes to use the new types and drawing primitives from Wumpus-Basic.

Ideally Shapes should be moved into Basic, but currently the code is mostly horrible - particularly, there is a lot of almost duplicated code for manipulating individual shapes. Having Shapes in Wumpus-Basic would spur on the development of connectors - supporting usable connectors rather than the current single, proof of concept would be a major step forward.

Thursday, September 23, 2010

wumpus-basic

Copperbox revision 1739.

I've shimmed the FontSize API from Wumpus-Core in Basic.Graphic.Query - the shim uses the current front size via the DrawingF functional type.

wumpus-basic

Copperbox revision 1738.


I've added a new drawing primitive to draw text where the supplied point is the center rather than baseline left. Because it needs font metrics which Wumpus doen't really have, I've given it the convoluted name centermonoTextline to emphasize that the metrics are calculated from a monospace font (i.e. Courier).

wumpus-basic

Copperbox revision 1737.

Minor updates - I've added functions halfsize and doublesize to Graphic.DrawingContext. Within a localCtx these change the size of font and thus the mark height, so on can draw small or large dots, arrowheads, etc.

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.