ubuntu下编译wine 作者: Goando 出自: http://www.linuxdiyf.com $sudo apt-get update $sudo apt-get build-dep wine $sudo apt-get install fakeroot libglib1.2-dev libglib2.0-dev libltdl3-dev libmad0-dev libmng-dev libodbcinstq1c2 libogg-dev libpng12-dev libqt3-headers libqt3-mt-dev libvorbis-dev libxft-dev libxi-dev libxinerama-dev libxmu-dev libxmu-headers libxmuu-dev libxpm-dev libxtrap-dev libxtst-dev libxv-dev libxxf86dga-dev qt3-dev-tools render-dev unixodbc-dev x-dev x11proto-record-dev x11proto-trap-dev x11proto-video-dev x11proto-xf86dga-dev xlibs-dev 创建一个编译Wine时所需要的目录: $mkdir wine-src $cd wine-src sudo apt-get source wine 或下载Wine的源码包 地 址 http://www.winehq.org/?announce=latest 解 压 tar jxvf wine-0.9.59.tar.bz2 修改源代码 --- wine-20050111/dlls/gdi/freetype.c 2005-01-06 01:12:07.000000000 +0800 +++ wine-20050111.gbhack/dlls/gdi/freetype.c 2005-01-15 18:30:32.481788272 +0800 @@ -1677,7 +1677,22 @@ if(!strcmpiW(lf.lfFaceName, SymbolW)) lf.lfCharSet = SYMBOL_CHARSET; - if(!TranslateCharsetInfo((DWORD*)(INT_PTR)lf.lfCharSet, &csi, TCI_SRCCHARSET)) { + if( lf.lfCharSet == DEFAULT_CHARSET || lf.lfCharSet == ANSI_CHARSET) + { + int codepage = 936; /* I'm Chinese. Let me do something selfish. */ + char *env_wdc = getenv("WINE_DEFAULT_CODEPAGE"); + if (env_wdc != NULL) + { + codepage = atoi(env_wdc); + } + FIXME("Dirty hack. Default and ansi charset is translated to getenv(/"WINE_DEFAULT_CODEPAGE/")/n"); + if(!TranslateCharsetInfo((DWORD*)(INT_PTR)codepage, &csi, TCI_SRCCODEPAGE)) { + FIXME("OMG. Even this dirty hack doesn't work. Let's PRAY./n"); + csi.fs.fsCsb[0] = 0; + } + lf.lfCharSet = csi.ciCharset; + } + else if(!TranslateCharsetInfo((DWORD*)(INT_PTR)lf.lfCharSet, &csi, TCI_SRCCHARSET)) { switch(lf.lfCharSet) { case DEFAULT_CHARSET: csi.fs.fsCsb[0] = 0; @@ -1861,6 +1876,10 @@ width = face->size.x_ppem >> 6; height = face->size.y_ppem >> 6; } + + if (0 <= height && height <12) height =12; + else if ( 0 > height && height > -12) height = -12; + ret->ft_face = OpenFontFile(ret, face->file, face->face_index, width, height); if (!ret->ft_face) 编译安装 cd wine-0.9.59 sudo ./configure sudo make depend && make 编 译完成以后 sudo make install