Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Matt Gushee <mgushee@havenrock.com>
To: caml-list@pauillac.inria.fr
Subject: [Caml-list] Strange error w/ Mlgraph.make_font
Date: Sun, 13 Jul 2003 21:38:21 -0600	[thread overview]
Message-ID: <20030714033820.GI4031@swordfish> (raw)

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


             reply	other threads:[~2003-07-14  3:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-14  3:38 Matt Gushee [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030714033820.GI4031@swordfish \
    --to=mgushee@havenrock.com \
    --cc=caml-list@pauillac.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox