This may well be a fix to the "Improper line wrapping" bug. The fix

is basically that we use our own special ViewFactory, with a new
subclass of LabelView (the view RTFEditorKit uses for the nitty
gritty) that is aware of Tibetan.

There are a couple of nasty hacks still here, and Swing's
documentation for doing what I did was quite poor.  I searched the web
for hours, read the Javadocs and the tutorials, and consulted a Swing
reference book, but I still don't have tremendous confidence in this
solution.  If it fundamentally doesn't work, though, we have to define
our own first-class Document, Element hierarchy, ViewFactory, Views,
and EditorKit.  So let's hope it *does* work fundamentally.

I can't say for sure if this even works, as I have yet to run this
code on a machine where Jskad works properly.  I had major trouble
installing the TMW fonts on Linux, and have yet to resolve it, even
after verifying via xlsfonts that the fonts were installed and then
changing TibetanMachineWeb.java to look for them.  Because I haven't
tested this yet, a lot of nasty code is tagged 'DLC' and commented
out.
This commit is contained in:
dchandler 2002-10-28 03:08:04 +00:00
parent f26dd53da3
commit 0ad135f8f1
5 changed files with 267 additions and 8 deletions

View file

@ -221,6 +221,11 @@ public class TibetanMachineWeb {
private static final String farrights = "d,s,ng";
static {
// FIXME: we have it so that you can select the default
// keyboard via the preferences mechanism. We can remove this
// DEFAULT_KEYBOARD stuff, can't we?
readData();
URL keyboard_url = TibetanMachineWeb.class.getResource(DEFAULT_KEYBOARD);