open X11
-(*let font = font_load "Times New Roman:size=12"*)
+let font = font_load "Times New Roman:size=12"
+(*
let font = font_load "Monaco:size=10::antialias=true:autohint=true"
+*)
+
let tags_buf = ref Buf.create
let edit_buf = ref Buf.create
| 0x0A -> newline ()
| 0x0D -> ()
| _ -> begin
- if (!x + glyph.width) > width then (newline ());
- let _ = X11.draw_glyph Cfg.Color.palette.(5) glyph (!x, !y) in
- x := !x + glyph.xoff
+ if (!x + glyph.xoff) > width then (newline ());
+ let off = X11.draw_glyph Cfg.Color.palette.(5) glyph (!x, !y) in
+ x := !x + off
end);
((!y + font.height) < height)
in
CAMLreturn(glyph);
}
+
CAMLprim value x11_draw_glyph(value color, value glyph, value coord) {
CAMLparam3(color, glyph, coord);
XftFont* font = (XftFont*)Field(glyph,0);
XftGlyphFontSpec spec = {
.font = font,
.glyph = intfield(glyph,1),
- .x = intfield(coord,0) + intfield(glyph,4),
+ .x = intfield(coord,0), // - intfield(glyph,4),
.y = intfield(coord,1) + font->ascent
};
// printf("c: '%c' w: %d x: %d y: %d xoff: %d yoff: %d\n",