On 10/06/13 21:04, Jan Bracker wrote:I'm not sure we need "Renderable a" here? Renderable is a higher level chart library concept that combines a rendering function with a minimum bounding box. I don't think the drawing backend should need to know of this?
instance ChartBackend CairoBackend where
type ChartRenderM CairoBackend = Cairo.Render
type ChartOutput CairoBackend = Renderable a -> Int -> Int -> OutputType -> FilePath -> IO ()
I am unclear on how this should be structured at this stage... Cairo has a monadic interface, based upon IO. diagrams can be created purely (I think), however it's not clear if this will still be the case once font handling is taken into account.For this to work the CRender monad has to be generalized so it can take an inner backend-specific monad as first type parameter.
Rather than have the CRender monad take an extra parameter, I guess one could just have a separate data type for each backend (ie CRenderCairo and CRenderDiagrams) and have the drawing code abstracted over a typeclass implemented by both. Not sure if this would be better...
It should actually be possible to trim this down without too much effort. There are 8 functions associated with drawing text. It should be possible to trim these down to 2 functions (one to get the metrics, and one to actually draw it), and then the others could be implemented in terms of these.While writing this I looked at how Diagrams backend mechanism works. I would like to hear some thoughts on what I did (and in general on my changes so far). I don't really like that there are so many functions in the backend class, but I can't see how to make it smaller without making radical changes to the way that Charts works right now (which Tim and I decided against).
> Rather than have the CRender monad take an extra parameter, I guess one could just have a separate data type for each backend (ie CRenderCairo and CRenderDiagrams) and have the drawing code abstracted over a typeclass implemented by both. Not sure if this would be better...
My week is not turning out very well :-(
I will be a bit late tonight. I'm sure you can continue without me.
Sorry!
On 31 Jul 2013 21:45, "Brent Yorgey" <byo...@seas.upenn.edu> wrote:Yes, I've been quite impressed with Jan's progress and am excited to
try it out! I will indeed be available then and would be happy to
discuss text handling. I will have to leave at 12:00UTC but that
should give us plenty of time for discussion.
-Brent
On Wed, Jul 31, 2013 at 07:16:37AM +1000, Tim Docker wrote:
> Hi Brent,
>
> Jan has made great progress, and has charts more or less up and
> running atop diagrams (see below).
>
> Currently the text handling is done outside the diagrams libs, just
> rendering the paths. It would be good if we could discuss with you
> potential approaches for improving the diagrams native text support.
>
> Is there any chance you may be around on IRC at 11:00UTC on thursday?
> If that time doesn't suit, I'm sure we can arrange another soon.
>
> Tim
>
>
> On 30/07/13 22:25, Jan Bracker wrote:
> >Tomorrow 9:30pm sounds good for me.
> >
> >Jan
> >
> >
> >2013/7/30 Tim Docker <t...@dockerz.net <mailto:t...@dockerz.net>>
> >
> > Hi,
> >
> > I'm sorry for the late notice, but I won't be able to make our IRC
> > meeting this tonight.
> >
> > Either tomorrow at 9:30pm, or Thursday at 9:00pm are fine with me.
> >
> > Tim
> >> <mailto:stephen...@gmail.com>>
> >>
> >> Hi Jan
> >>
> >> In the PostScript world, glyph metrics are given as 1/1000 of
> >> a point size. One would hope SVG might follow this lead.
> >>
> >> Although out-of-date in the TrueType world, the AFM spec from
> >> Adobe is a readable (and skimmable) introduction to glyph
> >> metrics and still a worthwhile reference.
> >>
> >> http://partners.adobe.com/public/developer/en/font/5004.AFM_Spec.pdf
> >>
> >> Best wishes
> >>
> >> Stephen
> >>
> >> On 23 July 2013 11:07, Jan Bracker
> >> <jan.b...@googlemail.com
> >> <mailto:jan.b...@googlemail.com>> wrote:
> >>
> >>
> >>
> >> Aside of that I also noticed that the text metric
> >> information in SVGFonts are not given in device
> >> coordinates. Am I right in assuming they are given in
> >> 1000em, because the value "units-per-em" says 1000? If
> >> that is right I will try to dig my way through the
> >> textSVG' function to find out how to convert that into
> >> device coordinates.
> >>
> >>
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> Chart mailing list
> >> Ch...@projects.haskell.org <mailto:Ch...@projects.haskell.org>
> >> http://projects.haskell.org/cgi-bin/mailman/listinfo/chart
> >
> >
>