Example #1
0
void module_init_encode_cyril(ptu32_t para)
{
    static struct tagCharset encoding;
   //加载字库
     printf("Init the code\n");
    LanguageCode=GetLanguagecodeFromFile(FileName);

    encoding.max_len = 1;
    encoding.mb_to_ucs4 = __cyril_mb_to_ucs4;
    encoding.ucs4_to_mb = __cyril_ucs4_to_mb;
    encoding.mbs_to_ucs4s = __cyril_mbs_to_ucs4s;
    encoding.ucs4s_to_mbs = __cyril_ucs4s_to_mbs;
    if( Charset_NlsInstallCharset(&encoding, cn_nls_charset_cyril))
    {
        printf("cyril encoding install sucess\n\r");
        return 1;
    }else
    {
        Djy_SaveLastError(EN_GK_CHARSET_INSTALL_ERROR);
        printf("cyril encoding install fail\n\r");
        return 0;
    }


}
Example #2
0
File: arabic.c Project: djyos/djyos
void module_init_encode_arabic(ptu32_t para)
{
    static struct Charset encoding;

    int i=0;
   //加载字库
     printf("Init the code\n");
    arabic_file_code=GetLanguagecodeFromFile(ArialFile);
    if(arabic_file_code==NULL)
    {
         printf("Get file code failed!\n");
         return;
    }
    nSections=((struct FontLibHeader*)arabic_file_code)->nSection;
    pSectionInfo=(struct FlSectionInfo *)(arabic_file_code+0x10);

    //打印编码信息
    for(i=0;i<nSections;i++)
        {
     printf("Section=%d ,First=%04x,Last=%04x,Addr=%08x\n",i,pSectionInfo[i].First,\
        pSectionInfo[i].Last,pSectionInfo[i].OffAddr);

    }

    encoding.max_len = 2;
    encoding.EOC_Size = 1;
    encoding.GetOneMb = ArabicGetOneMb;
    encoding.MbToUcs4 = ArabicMbToUcs4;
    encoding.Ucs4ToMb = ArabicUcs4ToMb;
    encoding.MbsToUcs4s = ArabicMbsToUcs4s;
    encoding.Ucs4sToMbs = ArabicUcs4sToMbs;
    if( Charset_NlsInstallCharset(&encoding, CN_NLS_CHARSET_ARABIC))
    {
        printf("arabic encoding install sucess\n\r");
        return 1;
    }else
    {
        Djy_SaveLastError(EN_GK_CHARSET_INSTALL_ERROR);
        printf("arabic encoding install fail\n\r");
        return 0;
    }


}
Example #3
0
void module_init_encode_arabic(ptu32_t para)
{
    static struct tagCharset encoding;

    int i=0;
   //加载字库
     printf("Init the code\n");
    arabic_file_code=GetLanguagecodeFromFile(ArialFile);
    if(arabic_file_code==NULL)
        {
         printf("Get file code failed!\n");
         return;
    }
    nSections=((struct tagFontLibHeader*)arabic_file_code)->nSection;
    pSectionInfo=(struct tagFlSectionInfo *)(arabic_file_code+0x10);

    //打印编码信息
    for(i=0;i<nSections;i++)
        {
     printf("Section=%d ,First=%04x,Last=%04x,Addr=%08x\n",i,pSectionInfo[i].First,\
        pSectionInfo[i].Last,pSectionInfo[i].OffAddr);

    }

    encoding.max_len = 1;
    encoding.mb_to_ucs4 = __arabic_mb_to_ucs4;
    encoding.ucs4_to_mb = __arabic_ucs4_to_mb;
    encoding.mbs_to_ucs4s = __arabic_mbs_to_ucs4s;
    encoding.ucs4s_to_mbs = __arabic_ucs4s_to_mbs;
    if( Charset_NlsInstallCharset(&encoding, cn_nls_charset_arabic))
    {
        printf("arabic encoding install sucess\n\r");
        return 1;
    }else
    {
        Djy_SaveLastError(EN_GK_CHARSET_INSTALL_ERROR);
        printf("arabic encoding install fail\n\r");
        return 0;
    }


}