Swing Miss Support Some Language

From iDempiere en
Jump to navigation Jump to search

when you run a swing application in window with some Lao character, character will display as square.

it's same for swing client of *dempiere also POS swing.

(*) this issue isn't at ubuntu (maybe other linux base)

what is reason?

Unicode is supported for Lao, but almost unicode font in window don't has glyph (maybe i wrong concept)

so just square for Lao character.

how to resolve issue?

just install a unicode font and use it for all control in application.

so we will modify all font properties in application?

it will take time and make your code don't sync with main repository.

or when this font don't support a other language as Lao_2 you again take time for edit.

so how to resolve issue?

use linux mint is strong advice.

but if your client still like windown you can try below solution.

I developer a util class for auto change font.

source code at: bitbucket.org

just copy class FontGlyphsUtil to your swing project.

modify defaultInit for set your font, or load it from your configuration

call FontGlyphsUtil.registry() for active it.

test it. any report issue or idea for imporve is welcome.

But you still issue with netbean or eclipse when see Lao character in GUI design or properties file?

just go to setting of your tool and set a font support Lao language.

for properties, has a properties editor plugin for eclipse also netbean, just install it and use.

This solution don't limit to Lao language, it also apply for other language support by unicode but miss glyph in default font.

(*)idea for improvement

Just see some interest api from Font can help improve this utility

+ store a list language your application must support.

+ each language, store a character code for check font support it

(this character must representative for language, when font support this character sure it support this language)

Checks if this Font has a glyph for the specified character

+ store a list of map font, this list map each font use at developer time with a font use for replace at run time

+ attach list font can support all language you need and load it for use in your app