[iyonix-support] Re: FontManager and ROMFonts

  • From: Martin Wuerthner <lists@xxxxxxxxxxxxxxx>
  • To: iyonix-support@xxxxxxxxxxxxx
  • Date: Sat, 02 Jul 2011 11:49:36 +0200

In message <51eb79f563Paul@xxxxxxxx>
          Paul Sprangers <Paul@xxxxxxxx> wrote:

> In article <6a8274eb51.martin@xxxxxxxxxxxxxxxxxxx>,
>    Martin Wuerthner <lists@xxxxxxxxxxxxxxx> wrote:

>> You can check by simply using some UCS functionality and checking for
>> returned errors.

> I hardly dare to ask, but how should I do that, for example?

Just open a font with UTF8 encoding and try to do something that 
requires that encoding to be understood. For instance:

UCSFontManagerPresent = FALSE
SYS "XFont_FindFont",,"\FHomerton.Medium\EUTF8",192,192,0,0 TO H%;F%
IF (F% AND 1) = 0 THEN
  REM We could open a font using the UTF8 encoding. That means it is
  REM likely that the FontManager supports Unicode, but just to be
  REM sure, try to actually use it. Find the "fi" ligature.
  SYS "XFont_EnumerateCharacters",H%,&FB01 TO ,next%,code%;F%
  REM Now code% is the internal character code of the given character,
  REM -1 means it is unmapped. We expect it to be mapped.
  IF (F% AND 1) = 0 AND code% <> -1 THEN
    UCSFontManagerPresent = TRUE
  ENDIF
  SYS "XFont_LoseFont",H%
ENDIF

In c.s.a.misc Rick Murray suggested there might be a SWI that only the 
UCS FontManager has, and there is one, it is the "EnumerateCharacters" 
SWI used above. So, a very simple test would be to test for the 
presence of that SWI using OS_SWINumberFromString.

Martin
-- 
---------------------------------------------------------------------
Martin Wuerthner           MW Software          lists@xxxxxxxxxxxxxxx
---------------------------------------------------------------------
---
To alter your preferences or leave the group, 
visit //www.freelists.org/list/iyonix-support
Other info via //www.freelists.org/webpage/iyonix-support
List-related queries to iyonix-support-moderators@xxxxxxxxxxxxx

Other related posts: