• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

Tesseract Font Box Editor (PM/GUI)

Started by jep, 2009.01.18, 12:15:56

Previous topic - Next topic

jep

#30
HI,

here's a script that extract the info about encoding inside the dictionary.

just type the name of the script and the path to the dictionary and it will tell you the encoding, on what row it was found inside and name of the package. Ensure you don't place .zip-files in the same directory, unless they're spelling dictionaries from OOorg you want to check. See below.

if you download all packages (yes there's an option for that as well) it'll scan them all as the're named e.g. af_Za.zip to zu_ZA.zip

//Jan-Erik

Sample output:
Encoding:UTF-8 Name:cop_EG Row:19
Encoding:UTF-8 Name:csb_CSB Row:1
Encoding:ISO8859-2 Name:cs_CZ Row:1
Encoding:ISO8859-14 Name:cy_GB Row:79
Encoding:ISO8859-1 Name:da_DK Row:1
Encoding:ISO8859-1 Name:de_AT Row:1
Encoding:ISO8859-1 Name:de_CH Row:1
Encoding:ISO8859-1 Name:de_DE_comb Row:1
Encoding:ISO8859-1 Name:de_DE_neu Row:1
Encoding:ISO8859-1 Name:de_DE Row:1
Encoding:ISO8859-1 Name:de_frami_neu Row:1
Encoding:ISO8859-7 Name:el_GR Row:31
Encoding:ISO8859-1 Name:en_AU Row:7
Encoding:ISO8859-1 Name:en_CA Row:1
Encoding:ISO8859-1 Name:en_GB-oed Row:7
Encoding:ISO8859-1 Name:en_GB Row:7
Encoding:ISO8859-1 Name:en_NZ Row:7
Encoding:ISO8859-1 Name:en_US Row:1
Encoding:ISO8859-1 Name:en_ZA Row:7
Encoding:ISO8859-3 Name:eo_l3 Row:1
Encoding:ISO8859-1 Name:es_ES Row:1
Encoding:ISO8859-1 Name:es_MX Row:1
Encoding:ISO8859-1 Name:et_EE Row:1
Encoding:ISO8859-1 Name:eu-ES Row:9


Note! You need unzip32.dll from Info-Zip to use it, but it should be included in your system...

/* OpenOffice.org v3 Dictionaries -> Dictionary Encoding */

call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs

call RxFuncAdd 'UZLoadFuncs', 'UNZIP32', 'UZLoadFuncs'
call UZLoadFuncs
parse arg retval

fname = 'D:\OOorg_Spelling_pack\'
if retval = '' then retval = fname
cfg.file = retval

call RxFuncAdd 'ULSLoadFuncs', 'rxuls', 'ULSLoadFuncs'
call ULSLoadFuncs

curr_time = TIME( 'R' )

CALL SysFileTree retval||'*.oxt', 'fnames', 'FO'
IF fnames.0 = 0 THEN
    CALL SysFileTree retval||'*.zip', 'fnames', 'FO'
DO a = 1 to fnames.0
    CALL UZFileTree fnames.a, 'file','*.aff'
    DO i = 1 to file.0
        PARSE VALUE FILESPEC( 'N', file.i ) WITH file.i.name'.'.
        lng. = 0
        retval = UZUnZipToVar( fnames.a, file.i, 'lng' )
        DO j = 1 TO lng.0
            PARSE VALUE lng.j WITH 'SET' rest
            rest = STRIP( rest )
            IF LENGTH( rest ) > 0 THEN DO
                say 'Encoding:'||rest||' Name:'||file.i.name||' Row:'||j
                LEAVE j
            END
        END
        DROP lng.
    END
    DROP file.
END

CALL ULSDropFuncs
call UZDropFuncs
exit

jep

Hello,

I've now found a convenient solution on how to load and match codepages in the dictionary. The attached file contain both the executable version, the sources with the new modifications (plus some additional adjustments to fix some bugs and shortcomings in the code). This version require that you have unzip32.dll installed as well.

It's now possible to select an OOorg dictionary and it'll read the info from it and (hopefully) decode it right before it launch wordlist2dawg to create a word list. Note that the included wordlist2dawg is a special build by Franz Bakan that's not included in the packages you can find elsewhere. It require the included gcc433.dll to work, doesn't crash as other versions have done in the past.

eTFBE can also create the word list for frequently used words, but use a rather naive implementation, but it's hopefully ok for most situations.

Notice the changed behaviour:
The file eFTBE.cfg now contain information about codepages and languages and is required to be present if you want to create word lists. eFBE.cfg is actually a renamed .zip-file created from the folder eFTBE that you also find in the package. There's no reference to the files a to z yet, but may come whenever language selection will be implemented. When you replace your current version you'll loose the startup settings saved in the EA (Extended Attributes) of the current eFTBE.cfg for Window size and position. It does however not affect your project folders or the Window setting saved there.

//Jan-Erik

jep

Hello,

I've now looked at rexx/gd for OS/2 to create images with text, but it seem like it doesn't support the required function to create images with TTF fonts in OS/2-eCS.

I therefore need your help to come up with a solution for it. It would be very welcome if another solution excist or if we can get the functionality through GBM by Heiko Nitche, or if I have to write something with your help and add it to rxImgSze. I've written some code in C/C++ before, but require your help to handle image manipulation and fonts to get futher.

//Jan-Erik

warpcafe

Hi jep,

now that's what I would call a coincidence!
I was just about writing you concerning ImageMagick: Given the fact that Paul Smedley just posted about his current port today, I went to check out what ImageMagick can do. And it looks quite promising, see

http://www.imagemagick.org/Usage/text

and scroll down a little below to see multiline text.
There is no rexx "library" for it, but as along as everything can be done via commandline (which seems to be the case from what I saw) we should be on the safe side and able to control it from rexx too.

Hope this helps
(if it does - be sure to send a note to Paul... :) )
Thomas
"It is not worth an intelligent man's time to be in the majority.
By definition, there are already enough people to do that"
- G.H. Hardy

jep

Hello Thomas,

Quote from: warpcafe on 2009.03.24, 10:06:15
Hi jep,

now that's what I would call a coincidence!
I was just about writing you concerning ImageMagick: Given the fact that Paul Smedley just posted about his current port today, I went to check out what ImageMagick can do. And it looks quite promising, see

http://www.imagemagick.org/Usage/text

Neat, exactly what we need, just wonder if one can merge some code and get tiff output right away...

Quote from: warpcafe on 2009.03.24, 10:06:15
and scroll down a little below to see multiline text.
There is no rexx "library" for it, but as along as everything can be done via commandline (which seems to be the case from what I saw) we should be on the safe side and able to control it from rexx too.

Hope this helps
(if it does - be sure to send a note to Paul... :) )
Thomas

Hmm, I've noticed that it's quite easy to rewrite textmode apps, so I think I'll rewrite tesseracct as a rexx dll, so why not ImageMagic as well.  ;D
The only problem is that it may take time to set everything up right, and make it work (if at all possible) with OpenWatcom.

//Jan-Erik