| Index: core/src/fxge/ge/fx_ge_linux.cpp
|
| diff --git a/core/src/fxge/ge/fx_ge_linux.cpp b/core/src/fxge/ge/fx_ge_linux.cpp
|
| index e2ed84e081e1ba4c2e09011c3146563ff891618a..027c519feaa2e82ff1862176323b903067ed0a28 100644
|
| --- a/core/src/fxge/ge/fx_ge_linux.cpp
|
| +++ b/core/src/fxge/ge/fx_ge_linux.cpp
|
| @@ -9,8 +9,8 @@
|
| #include "text_int.h"
|
| #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_
|
| static const struct {
|
| - FX_LPCSTR m_pName;
|
| - FX_LPCSTR m_pSubstName;
|
| + const FX_CHAR* m_pName;
|
| + const FX_CHAR* m_pSubstName;
|
| }
|
| Base14Substs[] = {
|
| {"Courier", "Courier New"},
|
| @@ -29,13 +29,13 @@ Base14Substs[] = {
|
| class CFX_LinuxFontInfo : public CFX_FolderFontInfo
|
| {
|
| public:
|
| - virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL& bExact);
|
| + virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL& bExact);
|
| FX_BOOL ParseFontCfg();
|
| - void* FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL bMatchName);
|
| + void* FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL bMatchName);
|
| };
|
| #define LINUX_GPNAMESIZE 6
|
| static const struct {
|
| - FX_LPCSTR NameArr[LINUX_GPNAMESIZE];
|
| + const FX_CHAR* NameArr[LINUX_GPNAMESIZE];
|
| }
|
| LinuxGpFontList[] = {
|
| {{"TakaoPGothic", "VL PGothic", "IPAPGothic", "VL Gothic", "Kochi Gothic", "VL Gothic regular"}},
|
| @@ -43,20 +43,20 @@ LinuxGpFontList[] = {
|
| {{"TakaoPMincho", "IPAPMincho", "VL Gothic", "Kochi Mincho", NULL, "VL Gothic regular"}},
|
| {{"TakaoMincho", "IPAMincho", "VL Gothic", "Kochi Mincho", NULL, "VL Gothic regular"}},
|
| };
|
| -static const FX_LPCSTR g_LinuxGbFontList[] = {
|
| +static const FX_CHAR* const g_LinuxGbFontList[] = {
|
| "AR PL UMing CN Light",
|
| "WenQuanYi Micro Hei",
|
| "AR PL UKai CN",
|
| };
|
| -static const FX_LPCSTR g_LinuxB5FontList[] = {
|
| +static const FX_CHAR* const g_LinuxB5FontList[] = {
|
| "AR PL UMing TW Light",
|
| "WenQuanYi Micro Hei",
|
| "AR PL UKai TW",
|
| };
|
| -static const FX_LPCSTR g_LinuxHGFontList[] = {
|
| +static const FX_CHAR* const g_LinuxHGFontList[] = {
|
| "UnDotum",
|
| };
|
| -static int32_t GetJapanesePreference(FX_LPCSTR facearr, int weight, int picth_family)
|
| +static int32_t GetJapanesePreference(const FX_CHAR* facearr, int weight, int picth_family)
|
| {
|
| CFX_ByteString face = facearr;
|
| if (face.Find("Gothic") >= 0 || face.Find("\x83\x53\x83\x56\x83\x62\x83\x4e") >= 0) {
|
| @@ -77,7 +77,7 @@ static int32_t GetJapanesePreference(FX_LPCSTR facearr, int weight, int picth_fa
|
| }
|
| return 2;
|
| }
|
| -void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR cstr_face, FX_BOOL& bExact)
|
| +void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, FX_BOOL& bExact)
|
| {
|
| CFX_ByteString face = cstr_face;
|
| int iBaseFont;
|
| @@ -90,7 +90,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
|
| if (iBaseFont < 12) {
|
| return GetFont(face);
|
| }
|
| - FX_LPVOID p = NULL;
|
| + void* p = NULL;
|
| FX_BOOL bCJK = TRUE;
|
| switch (charset) {
|
| case FXFONT_SHIFTJIS_CHARSET: {
|
| @@ -105,7 +105,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
|
| }
|
| break;
|
| case FXFONT_GB2312_CHARSET: {
|
| - static int32_t s_gbCount = sizeof(g_LinuxGbFontList) / sizeof(FX_LPCSTR);
|
| + static int32_t s_gbCount = sizeof(g_LinuxGbFontList) / sizeof(const FX_CHAR*);
|
| for (int32_t i = 0; i < s_gbCount; i++)
|
| if (m_FontList.Lookup(g_LinuxGbFontList[i], p)) {
|
| return p;
|
| @@ -113,7 +113,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
|
| }
|
| break;
|
| case FXFONT_CHINESEBIG5_CHARSET: {
|
| - static int32_t s_b5Count = sizeof(g_LinuxB5FontList) / sizeof(FX_LPCSTR);
|
| + static int32_t s_b5Count = sizeof(g_LinuxB5FontList) / sizeof(const FX_CHAR*);
|
| for (int32_t i = 0; i < s_b5Count; i++)
|
| if (m_FontList.Lookup(g_LinuxB5FontList[i], p)) {
|
| return p;
|
| @@ -121,7 +121,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
|
| }
|
| break;
|
| case FXFONT_HANGEUL_CHARSET: {
|
| - static int32_t s_hgCount = sizeof(g_LinuxHGFontList) / sizeof(FX_LPCSTR);
|
| + static int32_t s_hgCount = sizeof(g_LinuxHGFontList) / sizeof(const FX_CHAR*);
|
| for (int32_t i = 0; i < s_hgCount; i++)
|
| if (m_FontList.Lookup(g_LinuxHGFontList[i], p)) {
|
| return p;
|
| @@ -177,7 +177,7 @@ static int32_t _LinuxGetSimilarValue(int weight, FX_BOOL bItalic, int pitch_fami
|
| }
|
| return iSimilarValue;
|
| }
|
| -void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL bMatchName)
|
| +void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL bMatchName)
|
| {
|
| CFontFaceInfo* pFind = NULL;
|
| FX_DWORD charset_flag = _LinuxGetCharset(charset);
|
| @@ -186,7 +186,7 @@ void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int
|
| while (pos) {
|
| CFX_ByteString bsName;
|
| CFontFaceInfo* pFont = NULL;
|
| - m_FontList.GetNextAssoc(pos, bsName, (FX_LPVOID&)pFont);
|
| + m_FontList.GetNextAssoc(pos, bsName, (void*&)pFont);
|
| if (!(pFont->m_Charsets & charset_flag) && charset != FXFONT_DEFAULT_CHARSET) {
|
| continue;
|
| }
|
|
|