caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Strange error w/ Mlgraph.make_font
@ 2003-07-14  3:38 Matt Gushee
  2003-07-14 14:32 ` Florian Hars
  2003-07-14 16:21 ` Manos Renieris
  0 siblings, 2 replies; 5+ messages in thread
From: Matt Gushee @ 2003-07-14  3:38 UTC (permalink / raw)
  To: caml-list

I have been doing some work with Mlgraph lately, and have noticed a
problem with the make_font function:

  bash-2.05a$ ocaml mlgraph.cma
          Objective Caml version 3.06
  
  # open Mlgraph;;
  # let f = make_font Helvetica 12.;;
  Exception: Failure "float_of_string".

This happens with proportional fonts (Helvetica, Times, and Symbol),
but not for fixed-width fonts (Courier). I tracked down the cause today:
it's because the function that loads the font definition files is 
attempting to apply 'float_of_string' to lines ending in semicolons.
So, for my own installation, I've added a 'strip_semicolon' function
to 'fonts.ml'.

However, I am planning to distribute a software package that may 
depend on MLgraph, so I'd like to make a patch available for this
error. But I'm wondering if my fix is really the right solution. 
What's strange about this is that it's almost certain that anyone
who tried to use MLgraph would have discovered this bug a long time
ago, so I can only think that, once upon a time, it wasn't a bug, but
something outside of Mlgraph changed to cause the error. For example:

  Older versions of Ghostscript didn't add semicolons to the ends
  of the problematic lines; or

  Older versions of OCaml had a float_of_string function that 
  ignored trailing semicolons.

Anybody know what the real reason might be?

While I'm at it, are the MLgraph developers still around? Would they
(you) be interested in accepting patches?

-- 
Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through
mgushee@havenrock.com           its fields;
http://www.havenrock.com/   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                                
                            --Lao Tzu (Peter Merel, trans.)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-07-14 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-14  3:38 [Caml-list] Strange error w/ Mlgraph.make_font Matt Gushee
2003-07-14 14:32 ` Florian Hars
2003-07-14 14:48   ` Matt Gushee
2003-07-14 15:19     ` Florian Hars
2003-07-14 16:21 ` Manos Renieris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).