Author Topic: Remake of OSX's Dictionary  (Read 3435 times)

Offline OS923

  • Silver Member
  • ****
  • Posts: 195
    • OS 9.2.3
Remake of OSX's Dictionary
« 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?


Offline OS923

  • Silver Member
  • ****
  • Posts: 195
    • OS 9.2.3
Re: Remake of OSX's Dictionary
« Reply #1 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?

Offline MacTron

  • Global Moderator
  • Platinum Member
  • *****
  • Posts: 1933
  • keep it simple
Re: Remake of OSX's Dictionary
« Reply #2 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.
« Last Edit: April 25, 2016, 09:36:15 AM by MacTron »
Please don't PM about things that are not private.

Offline OS923

  • Silver Member
  • ****
  • Posts: 195
    • OS 9.2.3
Re: Remake of OSX's Dictionary
« Reply #3 on: April 28, 2016, 07:13:56 AM »
I'm going to try the Google Noto fonts.

Offline OS923

  • Silver Member
  • ****
  • Posts: 195
    • OS 9.2.3
Re: Remake of OSX's Dictionary
« Reply #4 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:
  • draw the special characters as pictures.
  • make a temporary HTML file and open it in the browser.
I consider doing them both.

Offline OS923

  • Silver Member
  • ****
  • Posts: 195
    • OS 9.2.3
Re: Remake of OSX's Dictionary
« Reply #5 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.

Offline OS923

  • Silver Member
  • ****
  • Posts: 195
    • OS 9.2.3
Re: Remake of OSX's Dictionary
« Reply #6 on: May 03, 2016, 03:27:30 AM »
The versions for Windows and Linux will be able to draw all characters as text.

Offline MacTron

  • Global Moderator
  • Platinum Member
  • *****
  • Posts: 1933
  • keep it simple
Re: Remake of OSX's Dictionary
« Reply #7 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) ...
Please don't PM about things that are not private.

Offline OS923

  • Silver Member
  • ****
  • Posts: 195
    • OS 9.2.3
Re: Remake of OSX's Dictionary
« Reply #8 on: June 01, 2016, 03:27:25 AM »
Is there a plugin for REALbasic which can show the Unicode correctly?

Offline OS923

  • Silver Member
  • ****
  • Posts: 195
    • OS 9.2.3
Re: Remake of OSX's Dictionary
« Reply #9 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.

Offline OS923

  • Silver Member
  • ****
  • Posts: 195
    • OS 9.2.3
Re: Remake of OSX's Dictionary
« Reply #10 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.

Offline InsectorX

  • Enthusiast
  • **
  • Posts: 34
  • new to the forums
Re: Remake of OSX's Dictionary
« Reply #11 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
Power Macintosh 8600/300
w/ PowerLogix 350Mhz G3 upgrade
Running Mac OS 9.2.2  &  8.6

Offline OS923

  • Silver Member
  • ****
  • Posts: 195
    • OS 9.2.3
Re: Remake of OSX's Dictionary
« Reply #12 on: June 17, 2016, 10:33:33 AM »
See attachment for preview.

Offline OS923

  • Silver Member
  • ****
  • Posts: 195
    • OS 9.2.3
Re: Remake of OSX's Dictionary
« Reply #13 on: June 18, 2016, 02:34:52 AM »
There are still problems with the style on Windows.

Offline OS923

  • Silver Member
  • ****
  • Posts: 195
    • OS 9.2.3
Re: Remake of OSX's Dictionary
« Reply #14 on: June 23, 2016, 05:28:25 AM »

Offline DieHard

  • Administrator
  • Platinum Member
  • *****
  • Posts: 1251
Re: Remake of OSX's Dictionary
« Reply #15 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 :)