android2.2支持泰语

来源:互联网 发布:mac 双系统 win7 编辑:程序博客网 时间:2024/04/27 23:56

修改这个文件 android2.2-froyo/build/target/product/languages_full.mk,添加 th_TH增加泰文支持。

make -j4
编译完成后在external/skia/src/ports/SkFontHost-android.cpp文件gSystemFonts结构中就会看到
static const FontInitRec gSystemFonts[] = {
    { "DroidSans.ttf",              gSansNames  },
    { "DroidSans-Bold.ttf",         NULL        },
    { "DroidSerif-Regular.ttf",     gSerifNames },
    { "DroidSerif-Bold.ttf",        NULL        },
    { "DroidSerif-Italic.ttf",      NULL        },
    { "DroidSerif-BoldItalic.ttf",  NULL        },
    { "DroidSansMono.ttf",          gMonoNames  },
    /*  These are optional, and can be ignored if not found in the file system.
        These are appended to gFallbackFonts[] as they are seen, so we list
        them in the order we want them to be accessed by NextLogicalFont().
     */
    { "DroidSansArabic.ttf",        gFBNames    },
    { "DroidSansHebrew.ttf",        gFBNames    },
    { "DroidSansThai.ttf",          gFBNames    },
    { "DroidSansJapanese.ttf",      gFBNames    },
    { "DroidSansFallback.ttf",      gFBNames    }
};
在frameworks/base/data/fonts/也会看到
DroidSansThai.ttf文件


修改FontAndroid.cpp的selectionRectForComplexText的返回值FloatRect,
point.y()-metrics.fAscent变成point.y()

运行时把字库DroidSansThai.ttf放在system/fonts下

原创粉丝点击