XlFontOps.mesa
Copyright Ó 1992 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, October 13, 1992
Christian Jacobi, October 13, 1992 5:42 pm PDT
Generic font utilities.
These procedures are not X protocol wrappers. They may or may not make calls to the X server.
DIRECTORY
Rope USING [ROPE],
Xl USING [Connection, Font, Fontable];
XlFontOps: CEDAR DEFINITIONS ~
BEGIN
GetDefaultFont: PROC [c: Xl.Connection] RETURNS [font: Xl.Font];
Get default font (from cache, or, using database query).
QueryPosInfo: PROC [c: Xl.Connection, font: Xl.Fontable, text: Rope.ROPE, x: INT] RETURNS [PosInfo];
Given an x coordinate and a font, returns according indices of text.
Reverse of Xl.QueryTextExtents; avoids calling the X server if font information is cached.
0 <= charIndex < Rope.Length[text]
0 <= gapIndex <= Rope.Length[text]
PosInfo: TYPE = RECORD [
charIndex: INT, --index of character closest to x
gapIndex: INT, --index of gap closest to x
gapX: INT --x position giving best match for gapIndex
];
END.