3.3.7 FTFontPreview

  To see a list of known Fontconfig fonts, you can use fc-list command in Fontconfig package.
Using an output of fc-list, we can implement a font-preview C++ class to browse X11 Fontconfig fonts.
The following FTFontPreview program is an example to display available fonts by FTFontPreview (FreeTypeFontPreview) of xft++.

//Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED.

#include <oz++/motif/ApplicationView.h>
#include <oz++/xft/FTFontPreview.h>

namespace OZ {

class MainView :public ApplicationView {
  SmartPtr<FTFontPreview> fontPreview;

  MainView(Application& applet, const char* name, Args& args)
  :ApplicationView(applet, name, args),
    Args ar;
    fontPreview = new FTFontPreview(this, "", ar);


int main(int argc, char** argv)
  const char*  appclass = argv[0];
  Application applet(appclass, argc, argv);
  try {
    Args args;
    args.set(XmNgeometry, "500x500");
    MainView view(applet, argv[0], args);

  } catch (Exception& ex) {
  return 0;

Last modified: 1 Jan 2017

 Last modified: 1 Jan 2017

Copyright (c) 2000-2017 Antillia.com ALL RIGHTS RESERVED.