~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to otherlibs/labltk/frx/frx_font.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-04-21 21:35:08 UTC
  • mfrom: (1.1.11 upstream) (12.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110421213508-kg34453aqmb0moha
* Fixes related to -output-obj with g++ (in debian/patches):
  - add Declare-primitive-name-table-as-const-char
  - add Avoid-multiple-declarations-in-generated-.c-files-in
  - fix Embed-bytecode-in-C-object-when-using-custom: the closing
    brace for extern "C" { ... } was missing in some cases

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
open Camltk
17
17
open Widget
18
18
 
19
 
let version = "$Id: frx_font.ml 5029 2002-07-23 14:12:03Z doligez $"
 
19
let version = "$Id: frx_font.ml 9547 2010-01-22 12:48:24Z doligez $"
20
20
 
21
 
(* 
 
21
(*
22
22
 * Finding fonts. Inspired by code in Ical by Sanjay Ghemawat.
23
23
 * Possibly bogus because some families use "i" for italic where others
24
24
 * use "o".
30
30
 
31
31
let available_fonts = ref (StringSet.empty)
32
32
 
33
 
let get_canvas = 
 
33
let get_canvas =
34
34
  Frx_misc.autodef (fun () -> Canvas.create Widget.default_toplevel [])
35
35
 
36
36
 
41
41
    else
42
42
      let c = get_canvas() in
43
43
      try
44
 
        let tag = Canvas.create_text c (Pixels 0) (Pixels 0) 
 
44
        let tag = Canvas.create_text c (Pixels 0) (Pixels 0)
45
45
                                [Text "foo"; Font fontspec] in
46
46
           Canvas.delete c [tag];
47
47
           available_fonts := StringSet.add fontspec !available_fonts;
48
48
           fontspec
49
49
      with
50
50
        _ -> raise (Invalid_argument fontspec)
51