> We would like to include Bengali script (Indic script) in
> FLTK. We would also like to control the keyboard entry to
> make the entry phonetic. Can anyone suggest how to start ?

Well, first off you need a version of fltk that can display the
character glyphs for you (the base fltk-1.x really only handles ASCII
strings and localised variants of that.)

So you either need to look at fltk-2 (which includes some utf8 support)
or one of the utf8 patches fltk-1.1 variants (there are several of these
kicking about, mine is here:
http://www.imm.uklinux.net/fltk/fltk118-utf8-2007-07-14.tar.bz2 )

However, all that really gives you is the ability to display glyphs from
a suitable Unicode font. Thereafter there are a number of further
problems that need to be addressed, that are not covered by the fltk
library at all.

1. Text direction: If you need to be able to handle left-to-right and
right-to-left text ordering (I don't think you do for Bengali?) then you
might need to use libfribidi or similar to handle detection,
manipulation and etc. of text order. (Actually displaying l-r or r-l
text fltk can do, or at least my fltk-1.1.x-patch does, I think fltk2
does also.)

2. Composite characters: This isn't all that common among latin
languages for example, but many languages (and Bengali might be amongst
them?) use variant representations for character glyphs depending on
which characters precede or follow them, or where they appear in the
word... This can be a Hard Problem to handle and fltk provides no
support for it. There are a number of libraries that help with this
problem, the most obvious one being Pango - which was originally created
to solve this problem for the gtk folk. I have never tried integrating
Pango with fltk. It might work. Or you might be able to handle this
problem directly yourselves, if you only have the one language to cope
with... (and if it is actually a problem that your language has...)

3. Input Methods: All the common platforms (*nix, OSX, win32) provide
some sort of input method support for inputting of "non-latin" languages
from a "latin-style" keyboard. These can be integrated with fltk to
provide keyboard input for your app. For example on linux this would be
done using XIM (or increasingly these days by SCIM, which is a sort of
enhanced XIM). This generally appears to the user as a separate (usually
floating) edit widget into which you can type phonetic representations
or etc., and the "proper" representation appears in the underlying
application window. 
Most IM systems support multiple languages - SCIM for example has a
plug-in architecture that allows you to install plugins for various
languages as required, each plug-in "knows" the mapping from "latin"
keys to target language representation.
All the IM versions on the various platforms have well defined and
documented API's. That doesn't mean they are easy to use, unfortunatley,
and if (for example) your code has to work on libnux, OSX and win32
systems it can all get a little messy as the API's aren't really similar
enough...!


So, in summary, it can be done, but it is not easy. Googling for XIM and
SCIM might give you some leads, but there is still a lot of work to do
on *all* computing platforms (not just fltk) to make this work as well
as it should!







SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to