unit X11_Fonts; interface uses X11_Objects, X11, xlib, type_fixes; type { loaded and ready font:} TFont = class(X11_Objects.TObject, IFont, X11_Objects.IObject, IInterface) protected procedure DeleteUnderlyingObject; override; published constructor Load(aDisplay : PDisplay; aFontName : ANSIString); end; implementation //if ((*font_info = XLoadQueryFont(display, fontname)) == procedure TFont.DeleteUnderlyingObject; begin if fHandle <> 0 then begin XUnloadFont(Display, fHandle); // FIXME or XFreeFont? fHandle := 0; end; end; constructor TFont.Load(aDisplay : PDisplay; aFontName : ANSIString); begin inherited Reuse(aDisplay, XLoadFont(aDisplay, PChar(aFontName)), True); end; // TODO XTextWidth. // XDrawString end.