yes, I also found this directory:
/montavista5/pro/devkit/arm/v5t_le/target/usr/include/freetype2

so I suppose MV5 support freetype also.

But I download the latest version from
http://ftp.twaren.net/Unix/NonGNU/freetype/

It can work.

My step is:
1, download the latest version
2, tar -jxvf freetype-2.xx.bz2
3, cd freetype-2.xx
3, CC=arm_v5t_le-gcc ./configure --host=arm-linux --prefix=/mnt/sdb/freetype2
4, make
5, make install

run /mnt/sdb/freetype2/bin/freetype-config in host to get envionment variables

-I/mnt/sdb/freetype2/include/freetype2 -I/mnt/sdb/freetype2/include
-L/mnt/sdb/freetype2/lib -lfreetype -lz

add those variables in your Makefile

Create a test_ft.c, and compile, it can work in my target.

#include <ft2build.h>
#include "test_ft.h"

#include FT_FREETYPE_H

#define FONT_NAME "arial.ttf"

unsigned int string2bitmap( unsigned char *frame )
{

  FT_Library    library;   /* handle to library     */
  FT_Face       face;      /* handle to face object */
  FT_UInt       glyph_index;
  unsigned int  ucode;
  unsigned int  error ;
  unsigned int  row, pixel;

  ucode = strtol("A", NULL, 16);

  error = FT_Init_FreeType( &library );
  if ( error ) {
    printf("\nFT_Init_FreeType error, return %d\n",error);
    return error ;
  }

  error = FT_New_Face( library,
                       FONT_NAME ,//The font file pathname
                       0, //face_index
                       &face );
  if ( error ) {
    printf("\nCheck font file: %s.\terror code:%d\n",FONT_NAME,error);
    return error ;
  }
  else {
    printf("Load %s successful, faces number:%ld\n",FONT_NAME,face->num_faces);
  }

  /* use 16*16 pixel */
  error = FT_Set_Pixel_Sizes(
            face,   /* handle to face object */
            0,      /* pixel_width           */
            32 );   /* pixel_height          */
  if ( error ) {
    printf("\nFT_Set_Pixel_Sizes error,\terror code:%d\n",error);
    return error ;
  }

  glyph_index = FT_Get_Char_Index( face, 0x061 );
  if(glyph_index == 0){
    printf("glyph_index error: %d\n",glyph_index);
    return 2;
  }

  error = FT_Load_Glyph(
            face,         /* handle to face object */
            glyph_index,  /* glyph index           */
            0 );          /* The default value is 0 */
  if( error ){
    printf("FT_Load_Glyph error: %d\n",error);
    return error;
  }

  error = FT_Render_Glyph( face->glyph,   /* glyph slot  */
                   0 ); /* render mode, 0:gray mode, 8-bit*/
  if( error ){
    printf("FT_Load_Glyph error: %d\n",error);
    return error;
  }

        printf("bitmap_left=%d\n"
               "bitmap_top=%d\n"
               "bitmap.rows=%d\n"
               "bitmap.width=%d\n"
               "bitmap.pitch=%d\n"
               "bitmap.pixel_mode=%d\n",
               face->glyph->bitmap_left,
               face->glyph->bitmap_top,
               face->glyph->bitmap.rows,
               face->glyph->bitmap.width,
               face->glyph->bitmap.pitch,
               face->glyph->bitmap.pixel_mode);
        printf("\n");
}


2009/11/18 Albert Burbea <[email protected]>:
> hi
> there is also a package in the dm6446 demos that implements the font library
> for davinci osd. you will need to work a little to convert the rgb16
> colorspace to yuv422 (a little of a hassle)
> Let me know
> Albert
>
> On Mon, Nov 16, 2009 at 9:00 AM, AR <[email protected]> wrote:
>>
>> Thanks.
>>
>> I found their web site: http://freetype.sourceforge.net/
>> Its very helpful.
>>
>> Jack
>>
>> 2009/11/14 Vladimir Pantelic <[email protected]>:
>> > Jack wrote:
>> >>
>> >> Hi All:
>> >>
>> >> I using DM6446 platform:
>> >> 1, capture RGB raw data from
>> >> CMOS sensor by CCDC,
>> >>
>> >> 2, RGB ==> YUV by preview engine,
>> >>
>> >> 3, encode to H.264 video, format:736*480
>> >>
>> >> I want to add string, like time or date in each frame.
>> >
>> > well, you need a font (look at something like freetype or a fixed font)
>> > then you copy the string char by char and pixel by pixel into your YUV
>> > image
>> > (converting the B&W font data to YUV)
>> >
>> > _______________________________________________
>> > Davinci-linux-open-source mailing list
>> > [email protected]
>> > http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
>> >
>>
>> _______________________________________________
>> Davinci-linux-open-source mailing list
>> [email protected]
>> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
>
>
>
> --
> Albert Burbea
> Harishonim 8
> Ramat Gan 52502, Israel
> Tel/Fax + 972-3-7526016
> Mobile: +972-52-3541842
>

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to