Concurrent Clean と日本語入力

サンプルの中に、typistというタイプ速度を計るアプリがあるので、これで日本語入力をチェックしてみたのですが、文字化けて、正しく動作しません。なので、ひとまず、これを日本語化することをやってみます。

      • -

標準フォントに、DefaultfontとDialogfontが提供されていますが、以下のように定義されています。このままでは当然日本語表示がおかしくなるので、"MS 明朝","MS ゴシック"を使った定義を作って、それを利用するようにしなければならないです。

< Libraries/ObjectIO/OS Windows/osfont.icl >
osDefaultfont :: !*OSToolbox -> (!Font,!*OSToolbox)
osDefaultfont tb
	= ({fontdef=def,fontimp=imp},tb)
where
	def		= (name,styles,size)
	imp		= {osfontname=name,osfontstyles=sStyle2IStyle styles,osfontsize=size}
	name	= "Times New Roman"
	styles	= []
	size	= 10

osDialogfont :: !*OSToolbox -> (!Font,!*OSToolbox)
osDialogfont tb
	= ({fontdef=def,fontimp=imp},tb)
where
	def		= (name,styles,size)
	imp		= {osfontname=name,osfontstyles=sStyle2IStyle styles,osfontsize=size}
	name	= "MS Sans Serif"
	styles	= []
	size	= 8
      • -

EditControlsは、ControlPen属性が有効ではないようで、独自のフォントを設定できません。osfont.iclを編集しても、フォントは変化しないようです。それ以外のコントロールは、デフォルトのままで日本語が表示できました。

      • -

日本語が間違いなく表示されるのは、Windowのタイトル、メニューの表示、ツールチップコマンドプロンプトの表示などで、ボタンやエディット、ダイアログなどはすべて文字化けします。

      • -

こんな記述を見つけました。http://mailman.science.ru.nl/pipermail/clean-list/1999.txt

From martinw@cs.kun.nl Fri, 14 May 1999 08:46:50 +0200
Date: Fri, 14 May 1999 08:46:50 +0200
From: Martin Wierich martinw@cs.kun.nl
Subject: Installing fonts.

Hi Paulo,

With the 0.8 I/O library try

f picture
    #   (ok,font)   = SelectFont "ANASTASIA" [] 12
    |    not ok = abort "not ok"
    #   picture    = SetFont font picture
    = picture

SelectFont and SetFont are defined in the "picture" module.

regards
    Martin Wierich

--------------------------------------------
Paulo Alfredo Mainieri Junior wrote:

> I'm developing a program that needs to load a true type font called
> ANASTASIA. How can i install this font in a Clean environment? As i can
> see it just have three kinds of fonts: Geneva, Helvetica and Times, is
> that write?
>
> Thank you very much for help.
>
> Paulo.