Welcome, Guest. Please login or register.

Author Topic: AFAOS and encodings  (Read 4367 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline walkeroTopic starter

AFAOS and encodings
« on: August 14, 2007, 12:56:39 PM »
Hello to everyone. I'd like to ask you where can I find the encoding files that are needed to make AFAOS 3.96 work with ttf and greek letters. I tried the the same files that I used with TTManager, but it didn't work, so I cannot see greek letters. Do you have any clue?
 

Offline AmiKit

Re: AFAOS and encodings
« Reply #1 on: August 14, 2007, 01:21:49 PM »
It would interest me too. So far I have not been able to display central European letters using AfA_OS and appropriate TT fonts.

Offline unusedunused

  • Sr. Member
  • ****
  • Join Date: Nov 2005
  • Posts: 479
    • Show only replies by unusedunused
Re: AFAOS and encodings
« Reply #2 on: August 14, 2007, 05:04:18 PM »
that stand in AFA FAQ txt.

 Q: I want use unicode Fonts for other languages.

  A: Make sure the truetype font support your national signs.
     Select in the mainpage the codepage file.It must be a ASCII file that
     use no Hex values (0x). Now select the font and click on convert. The
     message "can`t copy font" can ignored when dir "Fonts:" is chosen.      
 

Offline walkeroTopic starter

Re: AFAOS and encodings
« Reply #3 on: August 14, 2007, 07:51:42 PM »
Thanks for your replies guys...
well, i tried the following things

I used ttf that I was using with TTFtools and worked fine, with greek encoding. So these fonts support my national signs.

Then I used 3 different encoding files. I will give you part of them to tell me which is the best to use. But none of them did the work, unfortunately. All the files are for ISO-8859-7 encoding.

File #1
0xC1   0x0391   #   GREEK CAPITAL LETTER ALPHA
0xC2   0x0392   #   GREEK CAPITAL LETTER BETA
0xC3   0x0393   #   GREEK CAPITAL LETTER GAMMA
0xC4   0x0394   #   GREEK CAPITAL LETTER DELTA
0xC5   0x0395   #   GREEK CAPITAL LETTER EPSILON
0xC6   0x0396   #   GREEK CAPITAL LETTER ZETA


File #2
C1 0391
C2 0392
C3 0393
C4 0394
C5 0395
C6 0396


File #3
!C1 U+0391 Alpha

!C2 U+0392 Beta

!C3 U+0393 Gamma

!C4 U+0394 Delta

!C5 U+0395 Epsilon

!C6 U+0396 Zeta

So which is the best, or where should I find the right one?
 

Offline unusedunused

  • Sr. Member
  • ****
  • Join Date: Nov 2005
  • Posts: 479
    • Show only replies by unusedunused
Re: AFAOS and encodings
« Reply #4 on: August 16, 2007, 07:09:47 PM »
that files use hex letters.

for example 0xc1 is 193
0x391 is 913

0xC1 0x0391 # GREEK CAPITAL LETTER ALPHA

correct for AFA is this

193 913 # GREEK CAPITAL LETTER ALPHA

but because MOS use the same truetype fontmanger i think if youz ask for a MOS greek codepage fiel this work in AFA too
 

Offline walkeroTopic starter

Re: AFAOS and encodings
« Reply #5 on: August 17, 2007, 07:50:39 AM »
Thanks for your reply again.

I thought that it might be the same with morphos, so I got from my MorphOS installation the _codepages folder form the FONTS: and tried that one. Unfortunately, it didn't work, and also the encoding files look like this:

0x41   0x0041   #   LATIN CAPITAL LETTER A
0x42   0x0042   #   LATIN CAPITAL LETTER B
0x43   0x0043   #   LATIN CAPITAL LETTER C
0x44   0x0044   #   LATIN CAPITAL LETTER D
0x45   0x0045   #   LATIN CAPITAL LETTER E
0x46   0x0046   #   LATIN CAPITAL LETTER F
0x47   0x0047   #   LATIN CAPITAL LETTER G


Is there somewhere a site where I could download the needed encoding files? Or should I make the changes by hand?
 

Offline walkeroTopic starter

Re: AFAOS and encodings
« Reply #6 on: August 17, 2007, 08:38:05 AM »
Well, I just made the transformation by hand and worked just fine. But there should be a place where someone could download these encoding files. Is there anywhere to do that?

Thanks for your time and help.
 

Offline unusedunused

  • Sr. Member
  • ****
  • Join Date: Nov 2005
  • Posts: 479
    • Show only replies by unusedunused
Re: AFAOS and encodings
« Reply #7 on: August 18, 2007, 02:19:58 PM »
does this mean MOS support files with hex content ?

I thought MOS is same as AROS because MOS team should exchange files with AROS team.the diskfont stuff of MOS and AROS is same.

But if MOS work with hex codepages, and they dont want exchange the files, seem i must add this feature, because there are no codepages here

maybe you can ask if somebody send you the actual MOS source of the truetype manager to save me time ?
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: AFAOS and encodings
« Reply #8 on: August 18, 2007, 02:59:40 PM »
@bernd_afa
Quote
I thought MOS is same as AROS because MOS team should exchange files with AROS team.the diskfont stuff of MOS and AROS is same.

While AROS has accepted many of our contributions, it doesn't mean they'll just merge all our changes blindly. As a result there are differences between AROS and MorphOS, even for the components shared. That is why you can't share ft .otag files between AROS and MorphOS for example (AROS for some unknown reason renamed the freetype bullet engine from "ft2" to "freetype2").

Quote
But if MOS work with hex codepages, and they dont want exchange the files, seem i must add this feature, because there are no codepages here

maybe you can ask if somebody send you the actual MOS source of the truetype manager to save me time ?

As AROS ftmanager is directly based on the MorphOS ftmanager, you already have it.

BTW: The codepage files are available at Unicode, Inc ftp server.
 

Offline unusedunused

  • Sr. Member
  • ****
  • Join Date: Nov 2005
  • Posts: 479
    • Show only replies by unusedunused
Re: AFAOS and encodings
« Reply #9 on: August 18, 2007, 05:17:07 PM »
The code i have is this.It work only with dec values.
or is MOS strtolong enhanced that strtolong support too hex values ?

BOOL LoadCodePage(const char *filename)
{
   BOOL ret = FALSE;
   BPTR file;
   UBYTE buf[256];

   SetDefaultCodePage();
   
   file = Open(filename, MODE_OLDFILE);
   if (file)
   {
      ret = TRUE;

      while (FGets(file, buf, sizeof(buf)))
      {
         STRPTR p = buf;
         LONG index, unicode;
         LONG chars;

         if (*p == '#')
            continue;

         chars = StrToLong(p, &index);

         if (chars <= 0 || index < 0 || index > 255)
            continue;

         p += chars;

         chars = StrToLong(p, &unicode);
         kprintf ("%d %d\n",codepage[index],unicode);

         if (chars <= 0)
            continue;

         codepage[index] = (UWORD)unicode;
      }

      Close(file);
   }

   return ret;
}

here is code of aros strtolong

{
    AROS_LIBFUNC_INIT
    AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)

    LONG sign=0, v=0;
    CONST_STRPTR s=string;

    /* Skip leading whitespace characters */
    if(*s==' '||*s=='\t')
   s++;

    /* Swallow sign */
    if(*s=='+'||*s=='-')
   sign=*s++;

    /* If there is no number return an error. */
    if(*s<'0'||*s>'9')
    {
   *value=0;
   return -1;
    }

    /* Calculate result */
    do
   v=v*10+*s++-'0';
    while(*s>='0'&&*s<='9');

    /* Negative? */
    if(sign=='-')
   v=-v;

    /* All done. */
    *value=v;
    return s-string;
    AROS_LIBFUNC_EXIT
} /* StrToLong */
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: AFAOS and encodings
« Reply #10 on: August 18, 2007, 05:23:51 PM »
@bernd_afa
Quote
is MOS strtolong enhanced that strtolong support too hex values ?

Yes.
 

Offline unusedunused

  • Sr. Member
  • ****
  • Join Date: Nov 2005
  • Posts: 479
    • Show only replies by unusedunused
Re: AFAOS and encodings
« Reply #11 on: August 18, 2007, 06:30:39 PM »
and source is not available ?

I look a little in ansi c libs, the command strtol seem work too in hex and dec.only syntax is diffrent.but maybe can wrap

does somebody know if strtolong on OS4 too work with hex ?
I prefer to enhance strtolong then because it is usefull when support too hex values
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: AFAOS and encodings
« Reply #12 on: August 18, 2007, 06:54:16 PM »
@bernd_afa
Quote
and source is not available ?

To my knowledge AROS has the source-code for this function, along with other dos.library parts which were derived from AROS. Perhaps it wasn't merged for some reason?
 

Offline Georg

  • Jr. Member
  • **
  • Join Date: Feb 2002
  • Posts: 90
    • Show only replies by Georg
Re: AFAOS and encodings
« Reply #13 on: August 19, 2007, 11:41:41 AM »
Quote

Quote
is MOS strtolong enhanced that strtolong support too hex values ?

Yes.


Was that a good idea considering that autodocs say "Converts decimal string into LONG value."?
 

Offline unusedunused

  • Sr. Member
  • ****
  • Join Date: Nov 2005
  • Posts: 479
    • Show only replies by unusedunused
Re: AFAOS and encodings
« Reply #14 on: August 19, 2007, 12:33:19 PM »
I am sure they add the feature that hex is support and change the autodoc when they not went down 1994 ;-)

I think it is usefull for coding that strtolong support also other input formats.

So in parser can use hex and decimal values.

there is a ansi command strtol.
but when i look on this, i see it is not so easy to get the number of the character in the value.