Hi,

Short (?) status report.

I've added some experimental code to the LessTif tree.
You can compile it if you manually add -DUSE_XFT to the compiler command
line in lib/Xm-2.1/Makefile .

There's one test program that actually does a couple of things,
it's in test/Xm-2.0/rendition/test4.c .

You can browse individual files in LessTif's CVS at this link :
  http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/lesstif/lesstif/
and you can get download instructions for the whole CVS at
  http://sourceforge.net/cvs/?group_id=8596

The code is all in
  include/Motif-1.2/XmI/XmI.h
  lib/Xm/ResConvert.c
  lib/Xm/XmString.c
  lib/Xm-2.0/RenderTable.c

The code is not yet very clean, it has a couple of memory leaks, etc.
Also I've only implemented XmStrings, no XmText or XmTextField yet.

As the attached image shows, the test does something.

In case you wonder, the faulty alignment in the third line
appears to be because XftTextExtents8 thinks that the width of
"everywhere that" is 118, where reality shows it as about 80
pixels. I haven't figured out the cause of this yet.

The test program currently displays a single XmLabel,
the program is derived from one on Anthony Fountain's
tips pages.

The colour conversion has been created using the String to
XftColor converter in xc/programs/xclock/Clock.c as Keith Packard
suggested.

The current set of resources are pretty low level; I'm not
sure whether this is the right approach, but it mimicks the
parameters designed into Xft. I guess they make sense.
You can see some of them below in an excerpt from test4.c .

The next thing I'll try is XmText. Before that, porting
this to OpenMotif is probably not yet a good idea.

Comments are very welcome.

        Danny

Part of test/Xm-2.0/rendition/test4.c :

        "*One.renderTable:              one, two, three, four",
        "*one.fontName:                 fixed",
        "*One*one.renditionForeground:  red",
        "*one*renditionForeground:      yellow",
        "*two.fontName:                 helvetica",
        "*two.fontSize:                 10",
        "*two.renditionForeground:      green",
        "*three.fontName:               bembo",
        "*three.fontStyle:              bold",
        "*three.renditionForeground:    blue",
        "*four.foundry:                 adobe",
//      "*four.fontName:                bembo",
        "*four.fontSize:                24",
//      "*four.fontName:                helvetica",
//      "*four.fontSize:                10",
        "*four.renditionForeground:     black",
        "*tabList:                      1.5in, +1.5in, +1.5in, +1.5in",

PNG image

Reply via email to