Pages: [1] 2 3   Go Down

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

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
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?

Logged

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
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?
Logged

MacTron

  • Global Moderator
  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 2116
  • 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 »
Logged
Please don't PM about things that are not private.

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
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.
Logged

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
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.
Logged

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
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.
Logged

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
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.
Logged

MacTron

  • Global Moderator
  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 2116
  • 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) ...
Logged
Please don't PM about things that are not private.

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
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?
Logged

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
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.
Logged

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
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.
Logged

InsectorX

  • Valued Member
  • **
  • Offline Offline
  • 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
Logged
Power Macintosh 8600/300
w/ PowerLogix 350Mhz G3 upgrade
Running Mac OS 9.2.2  &  8.6

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
Re: Remake of OSX's Dictionary
« Reply #12 on: June 17, 2016, 10:33:33 AM »

See attachment for preview.
Logged

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
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.
Logged

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
Re: Remake of OSX's Dictionary
« Reply #14 on: June 23, 2016, 05:28:25 AM »

Logged

DieHard

  • Global Moderator
  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 2383
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 :)
Logged

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
Re: Remake of OSX's Dictionary
« Reply #16 on: January 26, 2019, 01:40:11 AM »

I rewrote this program in C++. See attachment.
Logged

MacTron

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

OS923

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 888
Re: Remake of OSX's Dictionary
« Reply #18 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.
Logged

IIO

  • Platinum Member
  • *****
  • Offline Offline
  • Posts: 4480
  • just a number
Re: Remake of OSX's Dictionary
« Reply #19 on: January 28, 2019, 04:41:57 AM »

sitx :P
Logged
insert arbitrary signature here
Pages: [1] 2 3   Go Up
 

Recent Topics