However there are several issues. The critical one is,
as I previously discussed with Martin, Sinhala text are not rendered
at all with the current configuration.
when the laguage is selected, only box symbols are displayed. The
reason is because the font does not have the glyphs to match to the
unicode values. Default fonts used in any OS currently doesn't contain
glyphs corresponding to sinhala unicode range as I know.
As far as I understand, your Windows is setup with a font which does not
contain Sinhala glyphs i.e. you don't use Sinhala in other applications
and you want to have it in SIP Communicator only? I'm asking because we
use the system font as set by the user on both Windows and the GNOME
desktop environment on Linux and, if that font contains Sinhala glyphs,
SIP Communicator should display them as well.
I don't think this is due to setup of my windows. I haven't modified
any setting related to fonts or installed Sinhala fonts other than the
one which is there by default. Sinhala is displayed correctly in web
pages and other applications (firefox etc.).
Object defaultGUIFont =
impl.gui.UIServiceImpl.java is the place you get the system font for
in windows, right? I knew about that.
In Windows 7, I get
win.defaultGUI.font - Tahoma
win.menu.font - Segoe UI
win.messagebox.font - Segoe UI
these fonts doesn't contain glyphs of Sinhala unicode range.
Without any changes (to a font or setting), Sinhala text is displayed
correctly on title bars in SIP Communicator, I guess that's because
fonts on title bars are handled by the OS
Also SWT renders Sinhala text correctly, I created a simple SWT
application and added a label with sinhala text without changing its
font. It's displayed correctly. That's because in SWT, font rendering
is handled by the OS as I read somewhere
I don't know the exact mechanism how OS handles unicode text but,
gives the font name as Segoe UI, and that font doesn't contain Sinhala glyphs!
so my guess is the OS somehow picks glyphs from other fonts according
to unicode value and java Swing doesn't do it.
This is same in Ubuntu 10.10, only default fonts are different and
they don't display sinhala glyphs.
Therefore I edited UIServiceImpl.java to set fonts using UIManager.
Windows vista and 7 come with a sinhala font named "Iskoola Pota".
what I did was check the OS and setting it as the font for all
to do that the current laguage should be read at UIServicesImpl. But
plugin.generalconfig.ConfigurationManager.getCurrentLanguage() did not
work (bundle not started). so I copied that method to
impl.gui.utils.ConfigurationManager. and it worked. (patch attached)
is that ok?
However this way, physical font name is hard coded, which i think is
not a good thing.
Well... I don't really know the best practices with respect to such a
problem but it doesn't currently sound great to me to have the font
hard-coded into SIP Communicator. It's not that much different but I
might prefer having a list of well-known fonts defined in the
language/translation file itself which SIP Communicator could try to set
(preferably, if it first determines that the current font doesn't have
the necessary glyphs).
I found a better way (attached). here I get the fonts installed in the
system and iterate through them, and select the first font that can
display both Sinhala and English glyphs, and this loop will run only
if language is set to Sinhala, of course
Thanks and Regards,
si2.patch (4.75 KB)
On Mon, Nov 8, 2010 at 4:11 PM, Lyubomir Marinov <email@example.com> wrote:
On Mon, 2010-11-08 at 05:12 +0530, Amila Manoj Silva wrote: