freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] FT_New_Memory_Face: get error code 2 on arm


From: Werner LEMBERG
Subject: Re: [ft-devel] FT_New_Memory_Face: get error code 2 on arm
Date: Tue, 13 Mar 2018 22:35:20 +0100 (CET)

> My test program 
>   https://paste.ubuntu.com/p/vvwW5bfmrF/
> runs normal on my pc and my cortex-r4 board.

Yes, this looks OK.

> But I get an error code (2) on my M0 board.

>   >FT_New_Memory_Face: 2

The error codes are given in file `fterrdef.h'; errorĀ 2 means `unknown
file format'.  Maybe an endianness problem while setting up the
external array holding the PCF data?

If you activate debugging with 

  #define FT_DEBUG_LEVEL_ERROR
  #define FT_DEBUG_LEVEL_TRACE

in `ftoption.h', then setting the environment variable `FT2_DEBUG' to
`any:7' you will perhaps get more detailed information on the problem
FreeType has encountered.  [In case your environment doesn't have
environment variables you have to adjust `ftdebug.c' accordingly.]

Of course there could also be a bug in FreeType.  However, I can't
debug this...

> By the way, the assembly code is broken with thumb2:
>   >  static __inline FT_Int32
>   >  FT_MulFix_arm( FT_Int32  a,
>   >                 FT_Int32  b )
>   >  {
>   >    FT_Int32  t, t2;
>   >
>   >
>   >    __asm
>   >    {
>   >      smull t2, t,  b,  a           /* (lo=t2,hi=t) = a*b */
>   >      mov   a,  t,  asr #31         /* a   = (hi >> 31) */
>   >      add   a,  a,  #0x8000         /* a  += 0x8000 */
>   >      adds  t2, t2, a               /* t2 += a */
>   >      adc   t,  t,  #0              /* t  += carry */
>   >      mov   a,  t2, lsr #16         /* a   = t2 >> 16 */
>   >      orr   a,  a,  t,  lsl #16     /* a  |= t << 16 */
>   >    }
>   >    return a;
>   >  }

Can you fix it?  I have zero knowledge w.r.t. assembler code.


    Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]