<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[FiT工作室]]></title> 
<link>http://www.pda01.com/index.php</link> 
<description><![CDATA[心随掌心而动]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[FiT工作室]]></copyright>
<item>
<link>http://www.pda01.com/read.php/12.htm</link>
<title><![CDATA[开源项目－－GSPlayer歌词同步显示]]></title> 
<author>FiT工作室 &lt;jovenzhang@126.com&gt;</author>
<category><![CDATA[开源项目]]></category>
<pubDate>Sat, 02 Jul 2005 09:58:26 +0000</pubDate> 
<guid>http://www.pda01.com/read.php/12.htm</guid> 
<description>
<![CDATA[ 
	给GSPlayer写了一个显示歌词的补丁<br/><br/><br/>功能就是显示歌词，呵呵，挺简单的。<br/><br/><a href="http://www.pda01.com/up/1139306465.png" target="_blank"><img src="http://www.pda01.com/up/1139306465.png" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>由于GSPlayer是开源项目(GPL)。所以需要源码的朋友直接与我联系：）<br/><br/><br/>For PPC2002/2003/2003SE<br/><br/><br/>拷贝覆盖掉您机器上的GSPlayer即可<br/><br/><br/>您要是觉得歌词显示不够明显，可以通过自定义皮肤来突出显示。<br/><br/><br/>[UpdateLog]<br/>2005.7.2<br/>1)加入对歌词文件lrc的更多格式的支持（3种），支持offset标签<br/>2)加入wzh1517@PDAFans网友的中文资源文件<br/>3)修改Unicode编码为CP_ACP，而不再是手工指定的936(GBK)，所以显示歌词编码与您的“区域设定”相关联了<br/>4)修正了点击歌词区域为SEEK区域的问题<br/>5)把gsgetfile.dll放入压缩包内（有用户反映不能添加多个文件就是因为缺少这个） <br/><br/><br/>下载： <a href="http://down.pda01.com/down/20050702.gsp222src.Patched.rar" target="_blank">20050702.gsp222src.Patched.rar</a><br/>源码： <a href="http://down.pda01.com/down/GSPlayer.rar" target="_blank">GSPlayer.rar</a>
]]>
</description>
</item><item>
<link>http://www.pda01.com/read.php/19.htm</link>
<title><![CDATA[开源项目－－Vade Mecum中文支持]]></title> 
<author>FiT工作室 &lt;jovenzhang@126.com&gt;</author>
<category><![CDATA[开源项目]]></category>
<pubDate>Sat, 05 Mar 2005 06:10:00 +0000</pubDate> 
<guid>http://www.pda01.com/read.php/19.htm</guid> 
<description>
<![CDATA[ 
	&nbsp; &nbsp; &nbsp;去年年初的时候，我在用PPC，Jarod推荐了我一款开源的BookReader － Vade Mecum。下回来一用确实还蛮不错的，因为它可以看Plucker的电子书（格式效果比HandStory好），而且还可以做note，不过问题是不显示中文！<br/> &nbsp; &nbsp; &nbsp;那个时候Jarod一直在修改Vade Mecum的源码，于是我给他说了希望能加上中文显示，不过Jarod却一直钟情于加强note，他又只看英文书，所以对我的建议没时间来理睬…… 于是我开始自己研究，终于找到了修改方法。<br/> &nbsp; &nbsp; &nbsp;首先找到pagination.c，它是负责格式化要显示的文字的，其中的static_process_item函数功能是从pdb的字节编码转换成UNICODE。就从这里开始做起吧： (cvs 0.6.2的代码)<br/><br/> &nbsp;if( state-&gt;buffer［*position］ != '\0' )<br/> &nbsp;&#123;<br/> &nbsp; &nbsp;item-&gt;item_type = IT_CHAR; // 这里表示类型是显示字符<br/> &nbsp; &nbsp;item-&gt;c = state-&gt;buffer［*position］; // 这个c的类型是TCHAR，而buffer是unsigned char<br/> &nbsp; &nbsp;*position += 1;<br/><br/> &nbsp; &nbsp; 首先需要说明一下的是Plucker是Palm上的软件，不是UNICODE的，所以buffer是char。<br/> &nbsp; &nbsp; &nbsp;对于英文这种1char的字符集来说，这段代码没有问题，DrawText能一个字母一个字母的显示，但是对中文这类2chars的字符集就不行了。DrawText会半个汉字半个汉字的显示，当然就是大家看到的乱码了。<br/> &nbsp; &nbsp; &nbsp;知道了以上这些原理修改起来就很简单了，在后面增加：<br/><br/>	if ((item-&gt;c&gt;=0x81) &amp;&amp; (item-&gt;c&lt;0xff) &amp;&amp; (state-&gt;buffer［*position］!=0x7F)) &#123;<br/>		char tmp［2］;<br/>		TCHAR totmp;<br/>		int ret;<br/>		<br/>		tmp［0］ = item-&gt;c &amp; 0xff;<br/>		tmp［1］ = state-&gt;buffer［*position］;<br/>		ret = MultiByteToWideChar(936, 0, tmp, 2, &amp;totmp, 1);<br/>		if (ret == 1) &#123;<br/>			item-&gt;c = totmp;<br/>			*position += 1;<br/>		&#125;<br/>	&#125; else if (item-&gt;c == 0x09) &#123; // tab =&gt; ' ' <br/>		item-&gt;c = 32;<br/>	&#125;<br/><br/> &nbsp; &nbsp; &nbsp;上面的代码说明了把2chars的一个汉字转换成UNICODE，如果遇到TAB转换成空格。注意的是GB汉字的判断: 0x8140-0xFEFE(除去xx7F)；CodePage 936表示GB，具体可以查MSDN。<br/><br/> &nbsp; &nbsp; &nbsp;现在已经可以很好的显示GB码的文档了，不过默认字体下的显示效果很不好，因为默认的字体显示效果不好。修改这个不难，在library.c中修改为一下这个即可：）<br/>void Library_initializeDefaults( FormattingDefaults *options )<br/>&#123;<br/> &nbsp;wcscpy( options-&gt;normal_face, &nbsp; L\&quot;宋体\&quot; );<br/> &nbsp;wcscpy( options-&gt;monotype_face, L\&quot;宋体\&quot; );<br/><br/> &nbsp;options-&gt;font_size = 12;<br/><br/>来张效果图看看吧：<br/><a href="http://www.turbozv.com/up/1110013740.jpg" target="_blank"><img src="http://www.turbozv.com/up/1110013740.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>PS:如果你要转换成其他编码格式，比如BIG5，找到相应的编码规范和CodePage就可以了:)
]]>
</description>
</item>
</channel>
</rss>