Mon Dec 27 00:49:02 2021 UTC ()
Make print/advi build again.
(dholland)
diff -r1.137 -r1.138 pkgsrc/print/advi/Makefile
diff -r1.13 -r1.14 pkgsrc/print/advi/distinfo
diff -r1.3 -r1.4 pkgsrc/print/advi/patches/patch-src_Makefile.in
diff -r0 -r1.1 pkgsrc/print/advi/patches/patch-src_drawimage.ml
diff -r0 -r1.1 pkgsrc/print/advi/patches/patch-src_dvi.ml
diff -r0 -r1.1 pkgsrc/print/advi/patches/patch-src_glyph.ml
diff -r0 -r1.1 pkgsrc/print/advi/patches/patch-src_grdev.ml
diff -r0 -r1.1 pkgsrc/print/advi/patches/patch-src_gterm.ml
diff -r0 -r1.1 pkgsrc/print/advi/patches/patch-src_input.ml
diff -r0 -r1.1 pkgsrc/print/advi/patches/patch-src_pkfont.ml
diff -r0 -r1.1 pkgsrc/print/advi/patches/patch-src_ttfont.ml
--- pkgsrc/print/advi/Makefile 2021/12/08 16:06:11 1.137
+++ pkgsrc/print/advi/Makefile 2021/12/27 00:49:02 1.138
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile,v 1.137 2021/12/08 16:06:11 adam Exp $ | | 1 | # $NetBSD: Makefile,v 1.138 2021/12/27 00:49:02 dholland Exp $ |
2 | | | 2 | |
3 | DISTNAME= advi-1.10.2 | | 3 | DISTNAME= advi-1.10.2 |
4 | PKGREVISION= 53 | | 4 | PKGREVISION= 53 |
5 | CATEGORIES= print | | 5 | CATEGORIES= print |
6 | MASTER_SITES= http://gallium.inria.fr/advi/ | | 6 | MASTER_SITES= http://gallium.inria.fr/advi/ |
7 | | | 7 | |
8 | MAINTAINER= pkgsrc-users@NetBSD.org | | 8 | MAINTAINER= pkgsrc-users@NetBSD.org |
9 | HOMEPAGE= http://gallium.inria.fr/advi/ | | 9 | HOMEPAGE= http://gallium.inria.fr/advi/ |
10 | COMMENT= Active-DVI Presenter | | 10 | COMMENT= Active-DVI Presenter |
11 | LICENSE= gnu-lgpl-v2 | | 11 | LICENSE= gnu-lgpl-v2 |
12 | | | 12 | |
13 | BUILD_DEPENDS+= ImageMagick-[0-9]*:../../graphics/ImageMagick | | 13 | BUILD_DEPENDS+= ImageMagick-[0-9]*:../../graphics/ImageMagick |
14 | BUILD_DEPENDS+= ocaml>=3.04:../../lang/ocaml | | 14 | BUILD_DEPENDS+= ocaml>=3.04:../../lang/ocaml |
| @@ -20,26 +20,34 @@ DEPENDS+= camlimages>=4.0.0:../../graph | | | @@ -20,26 +20,34 @@ DEPENDS+= camlimages>=4.0.0:../../graph |
20 | #DEPENDS+= texlive-tetex>=2010:../../print/texlive-tetex | | 20 | #DEPENDS+= texlive-tetex>=2010:../../print/texlive-tetex |
21 | DEPENDS+= tex-fontinst>=1.933:../../fonts/tex-fontinst | | 21 | DEPENDS+= tex-fontinst>=1.933:../../fonts/tex-fontinst |
22 | DEPENDS+= tex-texlive-scripts-extra-[0-9]*:../../print/tex-texlive-scripts-extra | | 22 | DEPENDS+= tex-texlive-scripts-extra-[0-9]*:../../print/tex-texlive-scripts-extra |
23 | DEPENDS+= tex-cyrillic-bin>=2013:../../print/tex-cyrillic-bin | | 23 | DEPENDS+= tex-cyrillic-bin>=2013:../../print/tex-cyrillic-bin |
24 | DEPENDS+= hevea-[0-9]*:../../textproc/hevea | | 24 | DEPENDS+= hevea-[0-9]*:../../textproc/hevea |
25 | BUILD_DEPENDS+= vera-ttf-[0-9]*:../../fonts/vera-ttf | | 25 | BUILD_DEPENDS+= vera-ttf-[0-9]*:../../fonts/vera-ttf |
26 | | | 26 | |
27 | USE_PKGLOCALEDIR= yes | | 27 | USE_PKGLOCALEDIR= yes |
28 | GNU_CONFIGURE= yes | | 28 | GNU_CONFIGURE= yes |
29 | USE_TOOLS+= gmake gs:run | | 29 | USE_TOOLS+= gmake gs:run |
30 | GNU_CONFIGURE_LIBDIR= ${PREFIX}/share/texmf-dist | | 30 | GNU_CONFIGURE_LIBDIR= ${PREFIX}/share/texmf-dist |
31 | CONFIGURE_ARGS+= --with-gs=${PREFIX}/bin/gs | | 31 | CONFIGURE_ARGS+= --with-gs=${PREFIX}/bin/gs |
32 | | | 32 | |
| | | 33 | GRAPHICS_PREFIX= ${BUILDLINK_PREFIX.ocaml-graphics} |
| | | 34 | GRAPHICS_DIR= ${GRAPHICS_PREFIX}/lib/ocaml/site-lib/graphics |
| | | 35 | MAKE_ENV+= OCAMLGRAPHICS_INCLUDES=-I\ ${GRAPHICS_DIR} |
| | | 36 | # For reasons best known to itself the preexisting makefiles already include |
| | | 37 | # the library but not the includes. |
| | | 38 | #MAKE_ENV+= OCAMLGRAPHICS_LIBS_BYTE=${GRAPHICS_DIR}/graphics.cma |
| | | 39 | #MAKE_ENV+= OCAMLGRAPHICS_LIBS_NATIVE=${GRAPHICS_DIR}/graphics.cmxa |
| | | 40 | |
33 | INSTALL_UNSTRIPPED= yes | | 41 | INSTALL_UNSTRIPPED= yes |
34 | | | 42 | |
35 | SUBST_CLASSES+= gs | | 43 | SUBST_CLASSES+= gs |
36 | SUBST_STAGE.gs= post-configure | | 44 | SUBST_STAGE.gs= post-configure |
37 | SUBST_FILES.gs= src/config.ml.in | | 45 | SUBST_FILES.gs= src/config.ml.in |
38 | SUBST_SED.gs= -e 's,@GS@,gs,' | | 46 | SUBST_SED.gs= -e 's,@GS@,gs,' |
39 | SUBST_MESSAGE.gs= Fixing hard-coded path to gs | | 47 | SUBST_MESSAGE.gs= Fixing hard-coded path to gs |
40 | | | 48 | |
41 | INSTALLATION_DIRS= share/doc/advi | | 49 | INSTALLATION_DIRS= share/doc/advi |
42 | | | 50 | |
43 | post-extract: | | 51 | post-extract: |
44 | ${CP} ${WRKSRC}/tex/*.eps ${WRKSRC}/doc | | 52 | ${CP} ${WRKSRC}/tex/*.eps ${WRKSRC}/doc |
45 | ${MKDIR} ${WRKSRC}/doc.orig | | 53 | ${MKDIR} ${WRKSRC}/doc.orig |
--- pkgsrc/print/advi/distinfo 2021/10/26 11:12:02 1.13
+++ pkgsrc/print/advi/distinfo 2021/12/27 00:49:02 1.14
| @@ -1,7 +1,15 @@ | | | @@ -1,7 +1,15 @@ |
1 | $NetBSD: distinfo,v 1.13 2021/10/26 11:12:02 nia Exp $ | | 1 | $NetBSD: distinfo,v 1.14 2021/12/27 00:49:02 dholland Exp $ |
2 | | | 2 | |
3 | BLAKE2s (advi-1.10.2.tar.gz) = 93641026540c5820f9ecc94b7874dd8353a1ecbf9cae162d35fae561a483622f | | 3 | BLAKE2s (advi-1.10.2.tar.gz) = 93641026540c5820f9ecc94b7874dd8353a1ecbf9cae162d35fae561a483622f |
4 | SHA512 (advi-1.10.2.tar.gz) = 93479e22261019b571bc331604a659e4e58200284bcdd63929b2c7ab07f8e9fabbd120f8876081a36e7e09e08286eeba9a45f3b077b545a9e404060622ec45c8 | | 4 | SHA512 (advi-1.10.2.tar.gz) = 93479e22261019b571bc331604a659e4e58200284bcdd63929b2c7ab07f8e9fabbd120f8876081a36e7e09e08286eeba9a45f3b077b545a9e404060622ec45c8 |
5 | Size (advi-1.10.2.tar.gz) = 9772060 bytes | | 5 | Size (advi-1.10.2.tar.gz) = 9772060 bytes |
6 | SHA1 (patch-doc_pngs_Makefile.in) = 3141938a6433d4dab8d7247ae89ad3381d902372 | | 6 | SHA1 (patch-doc_pngs_Makefile.in) = 3141938a6433d4dab8d7247ae89ad3381d902372 |
7 | SHA1 (patch-src_Makefile.in) = 3f9be7ac0c4a98b3e36c383ed2489b0d71e73f8a | | 7 | SHA1 (patch-src_Makefile.in) = 57c725715075697b12d61df2aaf598c8964f2e37 |
| | | 8 | SHA1 (patch-src_drawimage.ml) = edbb86f69f034d6b5f1d4dba936c74a51a1c7e0a |
| | | 9 | SHA1 (patch-src_dvi.ml) = 2adfe109dcdbc5d8449d318e500015bb8a87cdf6 |
| | | 10 | SHA1 (patch-src_glyph.ml) = 186993579b52da03944be40f86ce87990d5eefc4 |
| | | 11 | SHA1 (patch-src_grdev.ml) = 96eb2c162a9aa8e4bb36a2c93cdc20d385dbf98f |
| | | 12 | SHA1 (patch-src_gterm.ml) = 514f5bf9fc3ea1579a6e990f998e8536af85b1b7 |
| | | 13 | SHA1 (patch-src_input.ml) = 2b896cfb700cb63fcf1688116a43492e81fd09e8 |
| | | 14 | SHA1 (patch-src_pkfont.ml) = dcdb0aaaee33acbc1ab40a4f92d8a8e7c376058c |
| | | 15 | SHA1 (patch-src_ttfont.ml) = e15a108630f690dac092751b7850686510e5cf6b |
--- pkgsrc/print/advi/patches/patch-src_Makefile.in 2015/01/24 03:55:34 1.3
+++ pkgsrc/print/advi/patches/patch-src_Makefile.in 2021/12/27 00:49:02 1.4
| @@ -1,15 +1,32 @@ | | | @@ -1,15 +1,32 @@ |
1 | $NetBSD: patch-src_Makefile.in,v 1.3 2015/01/24 03:55:34 mef Exp $ | | 1 | $NetBSD: patch-src_Makefile.in,v 1.4 2021/12/27 00:49:02 dholland Exp $ |
2 | | | 2 | |
3 | Fix build with modular Xorg.1.2 | | 3 | Fix build with modular Xorg.1.2 (link with X_LIBS and honor LDFLAGS) |
4 | | | 4 | |
5 | --- src/Makefile.in.orig 2011-08-07 14:43:38.000000000 +0000 | | 5 | Hack ocaml-graphics paths into the build. The makefiles date from when |
6 | +++ src/Makefile.in 2011-08-07 14:44:05.000000000 +0000 | | 6 | it was part of the ocaml stdlib. |
7 | @@ -624,7 +624,7 @@ | | 7 | |
| | | 8 | --- src/Makefile.in.orig 2011-09-27 07:45:41.000000000 +0000 |
| | | 9 | +++ src/Makefile.in |
| | | 10 | @@ -292,10 +292,10 @@ OCAMLBYTOBJS = $(OCAMLBUILTSOURCES:.ml=. |
| | | 11 | OCAMLOPTOBJS = $(OCAMLBUILTSOURCES:.ml=.cmx) $(OCAMLSOURCES:.ml=.cmx) |
| | | 12 | COBJS = $(CSOURCES:.c=.o) |
| | | 13 | AM_CFLAGS = $(XINERAMA_CFLAGS) $(X_CFLAGS) |
| | | 14 | -AM_OCAMLCFLAGS = $(CAMLIMAGES_INCLUDES) |
| | | 15 | +AM_OCAMLCFLAGS = $(CAMLIMAGES_INCLUDES) $(OCAMLGRAPHICS_INCLUDES) |
| | | 16 | OTHER_LIBS = unix str |
| | | 17 | -OCAMLLIBS_OPT = $(CAMLIMAGES_LIBS_NATIVE) $(OTHER_LIBS:=.cmxa) |
| | | 18 | -OCAMLLIBS_BYT = $(CAMLIMAGES_LIBS_BYTE) $(OTHER_LIBS:=.cma) |
| | | 19 | +OCAMLLIBS_OPT = $(CAMLIMAGES_LIBS_NATIVE) $(OCAMLGRAHPICS_LIBS_NATIVE) $(OTHER_LIBS:=.cmxa) |
| | | 20 | +OCAMLLIBS_BYT = $(CAMLIMAGES_LIBS_BYTE) $(OCAMLGRAPHICS_LIBS_BYTE) $(OTHER_LIBS:=.cma) |
| | | 21 | |
| | | 22 | # In bytecode mode create stubcode in dlladvi |
| | | 23 | DLLADVI = dlladvi.so |
| | | 24 | @@ -624,7 +624,7 @@ dlladvi.so: $(COBJS) Makefile |
8 | $(OCAMLMKLIB) -o advi \ | | 25 | $(OCAMLMKLIB) -o advi \ |
9 | $(OCAMLCFLAGS) $(AM_OCAMLCFLAGS) $(AM_LINKFLAGS) \ | | 26 | $(OCAMLCFLAGS) $(AM_OCAMLCFLAGS) $(AM_LINKFLAGS) \ |
10 | $(COBJS) \ | | 27 | $(COBJS) \ |
11 | - $(CAMLIMAGES_MKLIBS) $(CAMLIMAGES_LPATH) $(XINERAMA_MKLIB) | | 28 | - $(CAMLIMAGES_MKLIBS) $(CAMLIMAGES_LPATH) $(XINERAMA_MKLIB) |
12 | + $(LDFLAGS) $(CAMLIMAGES_MKLIBS) $(CAMLIMAGES_LPATH) $(X_LIBS) $(XINERAMA_MKLIB) | | 29 | + $(LDFLAGS) $(CAMLIMAGES_MKLIBS) $(CAMLIMAGES_LPATH) $(X_LIBS) $(XINERAMA_MKLIB) |
13 | | | 30 | |
14 | advi.byt$(EXEEXT): dlladvi.so $(OCAMLBYTOBJS) | | 31 | advi.byt$(EXEEXT): dlladvi.so $(OCAMLBYTOBJS) |
15 | $(OCAMLC) -o advi.byt$(EXEEXT) \ | | 32 | $(OCAMLC) -o advi.byt$(EXEEXT) \ |
$NetBSD: patch-src_drawimage.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
Hack up the code for immutable strings.
--- src/drawimage.ml~ 2007-01-18 14:14:35.000000000 +0000
+++ src/drawimage.ml
@@ -161,10 +161,20 @@ let after f g = try let x = f () in g (
let cache_path file whitetransp psbbox ratiopt antialias (w, h) =
let file' = Userfile.fullpath (Unix.getcwd ()) file in
+(*
let file' = if file == file' then String.copy file' else file' in
for i = 0 to String.length file' - 1 do
if file'.[i] = '/' then file'.[i] <- '-'
done;
+*)
+ let file' =
+ let f i =
+ match String.get file' i with
+ | '/' -> '-'
+ | c -> c
+ in
+ String.init (String.length file') f
+ in
let geom_string x =
if x >= 0 then "+" ^ string_of_int x else string_of_int x
in
@@ -206,9 +216,9 @@ let cache_path file whitetransp psbbox r
let cache_load file =
debugs ("cache_load " ^ file);
let load ic =
- let s = String.create (String.length cache_key) in
+ let s = Bytes.create (String.length cache_key) in
ignore (input ic s 0 (String.length cache_key));
- if s <> cache_key then failwith (file ^ " has no proper header");
+ if Bytes.to_string s <> cache_key then failwith (file ^ " has no proper header");
let rgba = input_value ic in (* bool *)
let width = input_value ic in
let height = input_value ic in
@@ -237,7 +247,7 @@ let cache_load file =
let cache_save file img =
debugs ("cache_save " ^ file);
let save oc =
- output oc cache_key 0 (String.length cache_key);
+ output oc (Bytes.of_string cache_key) 0 (String.length cache_key);
match img with
| Rgba32 image ->
output_value oc true;
$NetBSD: patch-src_dvi.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
Hack up the code for immutable strings.
--- src/dvi.ml~ 2010-04-05 08:15:06.000000000 +0000
+++ src/dvi.ml
@@ -363,9 +363,9 @@ let input_int32 =
| _ -> assert false;;
let input_string ch len =
- let str = String.create len in
+ let str = Bytes.create len in
really_input ch str 0 len ;
- str;;
+ Bytes.to_string str;;
(*** Parsing commands ***)
$NetBSD: patch-src_glyph.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
Hack up the code for immutable strings.
--- src/glyph.ml~ 2007-01-18 14:14:36.000000000 +0000
+++ src/glyph.ml
@@ -61,7 +61,7 @@ let from_char_def cdef ratio =
and hot_row = cdef.Font.voffset in
let (ncols', hot_col', col_table) = make_table ncols hot_col ratio
and (nrows', hot_row', row_table) = make_table nrows hot_row ratio in
- let graymap = String.create (ncols' * nrows')
+ let graymap = Bytes.create (ncols' * nrows')
and index = ref 0
and fact = 256.0 *. ratio *. ratio
and last_col = ncols - 1
@@ -92,7 +92,7 @@ let from_char_def cdef ratio =
done
done ;
let gray = Misc.round (!sum *. fact) in
- graymap.[!index] <- Char.chr (max 0 (min gray 255)) ;
+ Bytes.set graymap !index (Char.chr (max 0 (min gray 255))) ;
incr index
done
done ;
@@ -100,4 +100,4 @@ let from_char_def cdef ratio =
height = nrows' ;
hoffset = hot_col' ;
voffset = hot_row' ;
- graymap = graymap } ;;
+ graymap = Bytes.to_string graymap } ;;
$NetBSD: patch-src_grdev.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
Hack up the code for immutable strings.
--- src/grdev.ml~ 2011-08-05 08:24:17.000000000 +0000
+++ src/grdev.ml
@@ -169,12 +169,12 @@ let inputp fdins =
| _, _, _ -> true
let get_input () =
- let buf = String.create 1 in
+ let buf = Bytes.create 1 in
if inputp [ Unix.stdin ] then
let _ = Unix.read Unix.stdin buf 0 1 in
if inputp [ Unix.stdin ] then ()
else clear_usr2();
- buf.[0]
+ Bytes.get buf 0
else assert false;;
let watch_file_check () =
$NetBSD: patch-src_gterm.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
Hack up the code for immutable strings.
--- src/gterm.ml~ 2007-01-18 14:14:36.000000000 +0000
+++ src/gterm.ml
@@ -28,7 +28,7 @@ type rectangle = GraphicsY11.rectangle =
type term = {
(* Character contents of the terminal. *)
- mutable lines : string array;
+ mutable lines : Bytes.t array;
(* Height in lines. *)
mutable height : int;
(* Width in characters. *)
@@ -71,7 +71,7 @@ let draw_cursor t cc cf =
let gx = cursor_gx t
and gy = cursor_gy t in
Graphics.fill_rect gx gy t.font_size_x t.font_size_y;
- let c = t.lines.(t.cursor_y).[t.cursor_x] in
+ let c = Bytes.get t.lines.(t.cursor_y) t.cursor_x in
Graphics.moveto gx gy;
Graphics.set_color cf;
Graphics.draw_char c;
@@ -147,7 +147,7 @@ let redraw t =
Array.iteri
(fun i s ->
Graphics.moveto t.gx (t.gy + t.font_size_y * i);
- Graphics.draw_string s)
+ Graphics.draw_string (Bytes.to_string s)) (* XXX: slow? *)
t.lines;
show_cursor t;;
@@ -156,7 +156,7 @@ let clear t =
Graphics.fill_rect
t.gx t.gy (t.width * t.font_size_x) (t.height * t.font_size_y);
Graphics.set_color t.foreground_color;
- Array.iter (fun s -> String.fill s 0 (String.length s) ' ') t.lines;
+ Array.iter (fun s -> Bytes.fill s 0 (Bytes.length s) ' ') t.lines;
htab t 0;
vtab t (t.height - 1);;
@@ -223,7 +223,7 @@ let make_term_gen fg bg bw bwc tc cc xc
if h < 1 || w < 1 || bw < 0 then failwith "make_term_gen" else
let font_size_x, font_size_y = Graphics.text_size "M" in
let t = {
- lines = Array.init h (fun i -> String.make w ' ');
+ lines = Array.init h (fun i -> Bytes.make w ' ');
height = h;
width = w;
gheight = h * font_size_y;
@@ -305,7 +305,7 @@ let make_term =
(* Basic functions to edit. *)
let end_of_line t =
let line = t.lines.(t.cursor_y) in
- let l = String.length line in
+ let l = Bytes.length line in
htab t l;;
let beginning_of_line t = htab t 0;;
$NetBSD: patch-src_input.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
Hack up the code for immutable strings.
--- src/input.ml~ 2007-01-18 14:14:36.000000000 +0000
+++ src/input.ml
@@ -84,9 +84,9 @@ let input_int32 =
(Printf.sprintf "Pkfont: cannot work on a %d-bit architecture" size) ;;
let input_string ch n =
- let str = String.create n in
+ let str = Bytes.create n in
really_input ch str 0 n ;
- str ;;
+ Bytes.to_string str ;;
let skip_bytes ch n =
seek_in ch (pos_in ch + n) ;;
$NetBSD: patch-src_pkfont.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
Hack up the code for immutable strings.
--- src/pkfont.ml~ 2007-01-18 14:14:36.000000000 +0000
+++ src/pkfont.ml
@@ -237,7 +237,7 @@ let unpack cdef =
and h = cdef.height in
let size = w * h in
let datalen = (size + 7) lsr 3 in
- let data = String.make datalen '\000'
+ let data = Bytes.make datalen '\000'
(* Index into the bitmap *)
and i = ref 0 and imask = ref 0x80
(* Index into the bitmap, [w] bits before *)
@@ -246,7 +246,7 @@ let unpack cdef =
(* Sending a bit to the bitmap *)
let send_bit b =
if b then
- data.[!i] <- Char.chr (Char.code data.[!i] lor !imask) ;
+ Bytes.set data !i (Char.chr (Char.code (Bytes.get data !i) lor !imask)) ;
imask := !imask lsr 1 ;
if !imask = 0 then begin imask := 0x80 ; incr i end ;
jmask := !jmask lsr 1 ;
@@ -254,8 +254,8 @@ let unpack cdef =
(* Resending n times the last line to the bitmap *)
let resend_last_line n =
for p = 1 to n * w do
- if Char.code data.[!j] land !jmask <> 0 then
- data.[!i] <- Char.chr (Char.code data.[!i] lor !imask) ;
+ if Char.code (Bytes.get data !j) land !jmask <> 0 then
+ Bytes.set data !i (Char.chr (Char.code (Bytes.get data !i) lor !imask)) ;
imask := !imask lsr 1 ;
if !imask = 0 then begin imask := 0x80 ; incr i end ;
jmask := !jmask lsr 1 ;
@@ -295,4 +295,4 @@ let unpack cdef =
black := not !black
end
done ;
- cdef.bitmap <- Unpacked data ;;
+ cdef.bitmap <- Unpacked (Bytes.to_string data) ;;
$NetBSD: patch-src_ttfont.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
Hack up the code for immutable strings.
--- src/ttfont.ml~ 2010-08-18 10:05:40.000000000 +0000
+++ src/ttfont.ml
@@ -57,7 +57,7 @@ let build face dpi pt unicode =
let width = bitmapinfo.bitmap_width in
let height = bitmapinfo.bitmap_height in
let bitmap_len = (width * height + 7) / 8 in
- let bitmap = String.create bitmap_len in
+ let bitmap = Bytes.create bitmap_len in
let is_black pos =
let x = pos mod width in
let y = pos / width in
@@ -72,7 +72,7 @@ let build face dpi pt unicode =
if is_black !pos then char := !char lor 0x01;
incr pos
done;
- bitmap.[i] <- char_of_int !char
+ Bytes.set bitmap i (char_of_int !char)
done;
{ code= unicode;
@@ -82,7 +82,7 @@ let build face dpi pt unicode =
height= height;
hoffset= -bitmapinfo.bitmap_left;
voffset= bitmapinfo.bitmap_top;
- bitmap= bitmap
+ bitmap= Bytes.to_string bitmap
}
;;