NRSI: Computers & Writing Systems
Graphite-enabled Edit Control Version 0.9
UNESCO project Initiative B@bel
A complete index of all SIL's contributions to UNESCO‘s project Initiative B@bel can be found here.
From January to October of 2003, SIL International was engaged in a cooperative project with UNESCO as part of UNESCO’s Initiative B@bel effort. The goal was to enable the development of complex script support in information and communication technologies (ICTs). This was done through preparation of documents to guide development, technical tools for complex script support, and two example script implementations. All of these are available from a general UNESCO page.
This document describes a beta version of a basic Graphite edit control for data input applications. It includes a software development kit (SDK) that includes: a binary DLL for Windows 2000 and XP, a developer guide for integrating into host applications, well commented source code, a simple Windows (2000 & XP) based test application for testing the control. The complete document is available on this page, but can also be downloaded in both Word and PDF formats:
The original specification is available here, but is also provided in Word and PDF formats:
SilGraphiteControl is an ActiveX control that provides rendering using SIL's Graphite engine. It is intended for use on the Window 2000 and Windows XP operating systems.
The functionality of version 0.9 is fairly close to what is described as "phase 3" in the specification document. See the Known issues section below for more details about the status of specific features.
Source code and libraries
The test application is provided solely to demonstrate how to interface with the edit control. It is known to be buggy!
In order to run the test application, you will need to have the MS .NET framework installed.
To use the edit control within your application, you will need to download one of the executable packages above. The SILGraphiteControl.ocx file must be registered using regsvr32.
You may also need to install and register the three MFC DLLs in the package above if they are not already present on your system.
Below are listed the methods that are part of the SilGraphiteControl interface.
Methods for initializing the parameters of the control
void SetDefaultFont([in] BSTR fontName); void SetDefaultFontSize([in] int fontSize); void SetAllowFormatDlg([in] VARIANT_BOOL newVal); void SetVerticalScroll([in] VARIANT_BOOL scrollFlag); void SetMultiline([in] VARIANT_BOOL);
Methods for editing text
void SetText([in] LPCTSTR newVal); BSTR GetText(); void Cut(void); void Copy(void); void Paste(void); void Undo(void); void Redo(void);
Methods for formatting text
void SetSelectionFont([in] BSTR fontName); void GetSelectionFont([out] BSTR* fontName); void SetSelectionFontSize([in] int fontSize); int GetSelectionFontSize(void);
Methods for working with files
void Open([in] BSTR pVar, [in] LONG flags, [in] LONG CodePage); void Save([in] BSTR pVar, [in] LONG flags, [in] LONG CodePage); void PutHtmlText([in] BSTR text); void GetHtmlText([out] BSTR* text);
The following methods exist but have not been tested adequately or are known to be buggy:
void New(void); void ResizeWindow([in] LONG x, [in] LONG y); LONG GetSizeX(void); LONG GetSizeY(void); void MoveRight([in] VARIANT_BOOL shiftFlag); void MoveLeft([in] VARIANT_BOOL shiftFlag); void MoveUp([in] VARIANT_BOOL shiftFlag); void MoveDown([in] VARIANT_BOOL shiftFlag);
The control supports the following stock events:
Mouse bug: It is possible to get into a state where the mouse hangs. Workaround: do an extra right click to return the mouse to its normal state.
Printing is unsupported in this version.
Zooming is unsupported in this version.
Menu options are not appropriately disabled (e.g., Copy and Paste).
Horizontal scrolling in the multi-line control is not available in this version.
Graphite and Uniscribe: The Graphite engine is used for all fonts, even those with no Graphite tables. This is a hinderance to perforance, and also means that Uniscribe support built into the operating system is not available.
Vertical scroll bar: Turning on the vertical scroll bar after the control has been filled with text will not work correctly.
HTML import: The HTML import routines will only handle files that have been generated by the control's HTML export function. Arbitrary HTML or XHTML will not be successfully loaded, and error recovery is minimal.
Keyman: Keyman behavior seems to be inconsistent within the test application. Starting and stopping either the application or Keyman may help.
(c) Copyright 2003 UNESCO and SIL International Inc.
SIL would like to express appreciation to the University of Singapore for their contributions to the Graphite Edit Control project through their intern program, and to Chia Sheau Ching and Victor for their excellent work on this project. SIL would also like to thank Wycliffe Singapore and Jim Moore for oversight of this project.
This material is released under LGPL/CPL licenses. Details of these