Mac OS 9 Lives! (Classic Mac OS Forum)

Classic Mac OS Software (Discussions on Applications) => Business Software & Application Suites => Topic started by: OS923 on April 17, 2016, 02:26:09 AM

Title: Remake of OSX's Dictionary
Post by: OS923 on April 17, 2016, 02:26:09 AM
I can read OSX dictionaries into a REALbasic program. This works fine on Windows, but on OS 9 the weird pronunciation characters are replaced with question marks.

Then I read this:
Quote
Because OS 9 can't draw Unicode directly; we have to convert to the encoding associated with the font you're using. But our code that does this conversion is clever enough to short-cut the process when your string contains only ASCII characters, and you're converting from one ASCII superset to another (e.g., UTF-8 to MacRoman). That's why it's faster when there are no non-ASCII characters in your string.
Do I have to install a special Unicode font and script?

Title: Re: Remake of OSX's Dictionary
Post by: OS923 on April 25, 2016, 07:31:34 AM
I made a test page with all different Unicode characters which are used in the American dictionary.
Then I tried the code2000 font on Windows.
Some characters were missing.

I didn't find such a font for OS 9.

Is it possible to convert OSX fonts to OS 9 fonts?
Title: Re: Remake of OSX's Dictionary
Post by: MacTron on April 25, 2016, 09:23:56 AM
Is it possible to convert OSX fonts to OS 9 fonts?
If the fonts are in truetype format, then it can work on Mac Os 9. But you'll need a converter, probably.

BTW: Long time ago I had worked in a little project that use unicode text. I have used the WASTE text engine to deal with UTF8 and UTF16 encodings.
ATSUI and WorldScript II can be used also.
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on April 28, 2016, 07:13:56 AM
I'm going to try the Google Noto fonts.
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on May 03, 2016, 03:22:16 AM
REALbasic 5.5.5 has unicode support, but some characters are drawn as 2 characters, like a letter followed by an accent.

I had 2 possible solutions:
I consider doing them both.
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on May 03, 2016, 03:24:50 AM
I converted the dictionary to a 7-bit ASCII Scheme expression without backslash.
Then I converted it to a binary format that contains the dictionary, thesaurus and index.
It's half the size of the original.
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on May 03, 2016, 03:27:30 AM
The versions for Windows and Linux will be able to draw all characters as text.
Title: Re: Remake of OSX's Dictionary
Post by: MacTron on May 03, 2016, 12:27:59 PM
REALbasic 5.5.5 has unicode support, but some characters are drawn as 2 characters, like a letter followed by an accent.

but it seems that it can't deal well with UTF-16 (2 bytes per char) ...
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on June 01, 2016, 03:27:25 AM
Is there a plugin for REALbasic which can show the Unicode correctly?
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on June 07, 2016, 06:03:03 AM
I fragmalyzed REALbasic 5.5.5.
It doesn't use Text Services while this is necessary for Unicode support.
Thus OSX's Dictionary can't be remade with REALbasic 5.5.5.
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on June 15, 2016, 06:08:23 AM
I remade it with REALbasic 5.5.5.
On OS9 the weird characters are replaced with ? but I don't care.
It's still very useful.
It looks OK on Windows.
Now I'm adding custom style with preferences.
Title: Re: Remake of OSX's Dictionary
Post by: InsectorX on June 16, 2016, 10:47:26 PM
Sounds cool, I'd love a copy whenever it's "ready".  even with some question marks, it sounds cool

I'm impressed
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on June 17, 2016, 10:33:33 AM
See attachment for preview.
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on June 18, 2016, 02:34:52 AM
There are still problems with the style on Windows.
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on June 23, 2016, 05:28:25 AM
It's finished.
http://shareware.gangstalkingwiki.com/Dictionary98_manual.htm
Title: Re: Remake of OSX's Dictionary
Post by: DieHard on June 23, 2016, 09:39:33 AM
That is really nifty to have this available on OS 9.. I will definitely download, thanks for all the effort :)
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on January 26, 2019, 01:40:11 AM
I rewrote this program in C++. See attachment.
Title: Re: Remake of OSX's Dictionary
Post by: MacTron on January 26, 2019, 04:08:46 AM
Thank you for sharing your work.
But unfortunately I couldn't try it because it closes immediately after open it, not even show a window ...
I have booted with a brand new standar 9.2.2 System folder in a G4 MDD and the result is the same.
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on January 28, 2019, 03:03:14 AM
You need to have 300 MB of free memory and I think that it requires that you install the Unicode support (which you didn't because your system is "brand new"). (I never tried it without Unicode support.) If I remember correctly, on the install CD there's an "Extras" folder with a "Unicode" folder. This contains 3 files and if you drag this to the system folder then it installs 4 things, because the script file contains also another thing. You also need to install the "Noto Sans" font (which is included in the download). It doesn't work without the font.
Title: Re: Remake of OSX's Dictionary
Post by: IIO on January 28, 2019, 04:41:57 AM
sitx :P
Title: Re: Remake of OSX's Dictionary
Post by: MacTron on January 28, 2019, 08:04:42 AM
You also need to install the "Noto Sans" font (which is included in the download). It doesn't work without the font.
That's was the issue. Once I have installed "Noto Sans" font the app worked.
Title: Re: Remake of OSX's Dictionary
Post by: ELN on January 28, 2019, 07:56:51 PM
No chance of bundling the font in the app’s resource fork? This is a very cool tool!
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on January 29, 2019, 02:42:02 AM
If you install the Unicode support then you can type Unicode in the windows.

Unfortunately printing will crash. I tried to print in WorldText and it crashed too. Is there a program/printer combination that doesn't crash when trying to print Unicode?
Title: Re: Remake of OSX's Dictionary
Post by: WillyWonka on February 01, 2019, 02:54:01 AM
Does this app accept custom dictionaries?

The reference dictionary in Spanish is the Real Academia de la Lengua, which I use under OS X as it was converted to Dictionary.app format using DictUnifier.

The bundled Spanish dictionary in dictionary.app is well... poor.
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on February 01, 2019, 05:22:55 AM
Does this app accept custom dictionaries?
No, I convert the XML to a binary format that contains Unicode instead of UTF-8.

If you send me a download link for this Real Academia de la Lengua converted to Dictionary.app format then I'll look into it. Does this contain also a thesaurus? The program was written for dictionary + thesaurus combination.
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on February 07, 2019, 04:39:21 AM
I improved the program with error messages.
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on February 11, 2019, 04:06:01 AM
There's a flaw in the multilingual text engine. You have to move the file position to 0 before you call TXNSave if you change the data fork (after Save As). I'll correct this in the next version.
Title: Re: Remake of OSX's Dictionary
Post by: OS923 on April 09, 2019, 06:19:56 AM
I rewrote the Dictionary program. The difficult stuff is part of the OS 9.3 SDK as DictionaryLib. The rest is open source and in English, less than 2000 lines of code. Then you can make dictionary programs for other languages.